diff --git a/frontend/.gitignore b/frontend/.gitignore index 9a70e767ff..e9e5e28db2 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -5,6 +5,7 @@ dist-ssr .history coverage .node/ +.DS_Store package-lock.json pnpm-lock.yaml yarn.lock diff --git a/frontend/src/api/modules/setting/pluginManger.ts b/frontend/src/api/modules/setting/pluginManger.ts index baf59e1bd3..d949c280bc 100644 --- a/frontend/src/api/modules/setting/pluginManger.ts +++ b/frontend/src/api/modules/setting/pluginManger.ts @@ -1,9 +1,25 @@ import MSR from '@/api/http/index'; -import { GetPluginListUrl } from '@/api/requrls/setting/plugin'; -import type { PluginList } from '@/models/setting/plugin'; -import type { TableQueryParams } from '@/models/common'; +import { + GetPluginListUrl, + UploadPluginUrl, + UpdatePluginUrl, + DeletePluginUrl, + GetScriptUrl, +} from '@/api/requrls/setting/plugin'; +import type { PluginList, PluginItem, AddReqData, UpdatePluginModel, UploadFile } from '@/models/setting/plugin'; -// eslint-disable-next-line import/prefer-default-export -export function getPluginList(data: TableQueryParams) { - return MSR.post({ url: GetPluginListUrl, data }); +export function getPluginList() { + return MSR.get({ url: GetPluginListUrl }); +} +export function addPlugin(data: UploadFile) { + return MSR.uploadFile({ url: UploadPluginUrl }, data); +} +export function updatePlugin(data: UpdatePluginModel) { + return MSR.post({ url: UpdatePluginUrl, data }); +} +export function deletePluginReq(id: string) { + return MSR.get({ url: DeletePluginUrl, params: id }); +} +export function getScriptDetail(pluginId: string, scriptId: string) { + return MSR.get({ url: GetScriptUrl, params: `/${pluginId}/${scriptId}` }); } diff --git a/frontend/src/api/requrls/setting/plugin.ts b/frontend/src/api/requrls/setting/plugin.ts index a7219e996b..82fbfb10be 100644 --- a/frontend/src/api/requrls/setting/plugin.ts +++ b/frontend/src/api/requrls/setting/plugin.ts @@ -1,2 +1,5 @@ -export const GetPluginListUrl = '/plugin/page'; -export const UplodaPluginUrl = '/member/add'; +export const GetPluginListUrl = '/plugin/list'; +export const UploadPluginUrl = '/plugin/add'; +export const UpdatePluginUrl = '/plugin/update'; +export const DeletePluginUrl = '/plugin/delete'; +export const GetScriptUrl = '/plugin/script/get'; diff --git a/frontend/src/assets/svg/apitest.svg b/frontend/src/assets/svg/apitest.svg deleted file mode 100644 index 85338a6bf0..0000000000 --- a/frontend/src/assets/svg/apitest.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/assets/svg/promanger.svg b/frontend/src/assets/svg/promanger.svg deleted file mode 100644 index c4937843ee..0000000000 --- a/frontend/src/assets/svg/promanger.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/mock/index.ts b/frontend/src/mock/index.ts index 40409be580..94f8aad132 100644 --- a/frontend/src/mock/index.ts +++ b/frontend/src/mock/index.ts @@ -7,6 +7,5 @@ import './system/user'; import './system/project'; import './system/resourcePool'; import './system/member'; -import './system/pluginManger'; MOCK.onAny().passThrough(); diff --git a/frontend/src/mock/system/pluginManger.ts b/frontend/src/mock/system/pluginManger.ts deleted file mode 100644 index bbd2154c6c..0000000000 --- a/frontend/src/mock/system/pluginManger.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { mock } from '@/utils/setup-mock'; -import { RequestEnum } from '@/enums/httpEnum'; - -const getPluginList = () => { - return [ - { - id: '1-1', - name: '插件一', - describe: '插件一', - enable: true, - createTime: 'number', - updateTime: 'number', - jarPackage: 'string', - version: 'string', - applicationScene: 'string', - createUser: 'string', - updateUser: 'string', - organizationList: [ - { - id: 'string', - num: 0, - name: '组织 1', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - { - id: 'string', - num: 0, - name: '组织 2', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - { - id: 'string', - num: 0, - name: '组织 3', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - { - id: 'string', - num: 0, - name: '组织 4', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - ], - steps: [ - { - id: '1-1-1', - name: '步骤一', - }, - { - id: '1-1-2', - name: '步骤二', - }, - { - id: '1-1-3', - name: '步骤三', - }, - ], - }, - { - id: '2-1', - name: '插件一', - describe: '插件一', - enable: true, - createTime: 'number', - updateTime: 'number', - jarPackage: 'string', - version: 'string', - applicationScene: 'string', - createUser: 'string', - updateUser: 'string', - organizationList: [ - { - id: 'string', - num: 0, - name: '组织 1', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - { - id: 'string', - num: 0, - name: '组织 2', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - { - id: 'string', - num: 0, - name: '组织 3', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - { - id: 'string', - num: 0, - name: '组织 4', - description: 'blabla', - createTime: 0, - updateTime: 0, - createUser: 'string', - updateUser: 'string', - deleted: true, - deleteUser: 'string', - deleteTime: 0, - enable: true, - }, - ], - steps: [ - { - id: '2-1-1', - name: '步骤2-一', - }, - { - id: '2-1-2', - name: '步骤2-二', - }, - { - id: '2-1-3', - name: '步骤3-三', - }, - ], - }, - ]; -}; - -mock(RequestEnum.POST, '/plugin/page', getPluginList(), 200, true); diff --git a/frontend/src/models/setting/plugin.ts b/frontend/src/models/setting/plugin.ts index bcf5845327..4e62cb5aef 100644 --- a/frontend/src/models/setting/plugin.ts +++ b/frontend/src/models/setting/plugin.ts @@ -14,41 +14,82 @@ export interface organizationItem { } export type organizationList = organizationItem[]; -export interface PluginItem { +// 上传文件 +export type UploadFile = { + fileList?: FormData[]; // 上传文件 + [key: string]: any; // 表单收集字段字符串 +}; + +export interface PluginForms { id: string; name: string; - describe: string; - enable: boolean; +} +export interface OrganizationsItem { + id: string; + num: number; + name: string; +} +export type OrganizationsItemList = OrganizationsItem[]; +// 插件管理列表项 +export type PluginItem = Partial<{ + id: string; + name: string; + pluginId: string; + fileName: string; // 文件名称 createTime: number; updateTime: number; - jarPackage: string; - version: string; - applicationScene: string; createUser: string; - updateUser: string; - organizationList: organizationList; - steps?: string[]; -} -export type PluginList = PluginItem[]; - -export interface StepItem { - name: string; - title: string; - status: boolean; -} -export type StepList = StepItem[]; - -export interface SceneItem { - name: string; + enable: boolean; + global: boolean; + xpack: boolean; // 授权类型 description: string; - isSelected: boolean; - svg: string; + scenario: string; // 应用场景 + organizations: OrganizationsItemList; // 组织列表 + pluginForms: PluginForms[]; // 插件步骤 + expand?: any; +}>; +// 插件管理列表 +export type PluginList = PluginItem[]; +// 更新插件参数定义 +export interface UpdatePluginModel { + id?: string; + name?: string; + global?: boolean | string; // 是否选择全部组织 + description?: string; + enable?: boolean; + organizationIds?: Array; // 指定组织 + [key: string]: any; } -export type SceneList = SceneItem[]; -export type PluginForm = { - pluginName: string; - organize: string | number; - describe: string; - organizeGroup: Array; +// 添加返回的接口 +export interface AddReqData { + id?: string; + name: string; + pluginId: string; // 插件id + fileName: string; + createTime: number; + updateTime: number; + createUser: string; + enable: boolean; + global: boolean; + xpack: boolean; // 授权类型 + description: string; + scenario: string; +} +export type Options = { + title: string; + visible: boolean; + onClose?: () => void; }; +// 抽屉配置 +export interface DrawerConfig { + title: string; + pluginId: string; // 插件id +} +export interface DrawerReqParams { + pluginId: string; // 插件id + scriptId: string; // 脚本id +} +export interface PluginState { + doNotShowAgain: boolean; +} diff --git a/frontend/src/views/setting/system/pluginManager/components/SceneList.vue b/frontend/src/views/setting/system/pluginManager/components/SceneList.vue deleted file mode 100644 index a270062b48..0000000000 --- a/frontend/src/views/setting/system/pluginManager/components/SceneList.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - -@/models/setting/plugin diff --git a/frontend/src/views/setting/system/pluginManager/components/pluginTable.vue b/frontend/src/views/setting/system/pluginManager/components/pluginTable.vue index 8e974fcbb6..b26900b8c9 100644 --- a/frontend/src/views/setting/system/pluginManager/components/pluginTable.vue +++ b/frontend/src/views/setting/system/pluginManager/components/pluginTable.vue @@ -7,119 +7,157 @@ {{ t('system.plugin.uploadPlugin') }} - + {{ item.label }} - + - - - - -
{{ 101 }}项数据
- - + + + + +
{{ t('system.plugin.totalNum') }}{{ totalNum }}{{ t('system.plugin.dataList') }}
+ + + - -@/api/modules/setting/pluginManger + diff --git a/frontend/src/views/setting/system/pluginManager/components/sceneChangeModal.vue b/frontend/src/views/setting/system/pluginManager/components/sceneChangeModal.vue deleted file mode 100644 index 211b65bcb8..0000000000 --- a/frontend/src/views/setting/system/pluginManager/components/sceneChangeModal.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - -@/models/setting/plugin diff --git a/frontend/src/views/setting/system/pluginManager/components/scriptDetailDrawer.vue b/frontend/src/views/setting/system/pluginManager/components/scriptDetailDrawer.vue new file mode 100644 index 0000000000..3290dbf071 --- /dev/null +++ b/frontend/src/views/setting/system/pluginManager/components/scriptDetailDrawer.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/frontend/src/views/setting/system/pluginManager/components/stepProgress.vue b/frontend/src/views/setting/system/pluginManager/components/stepProgress.vue deleted file mode 100644 index adc0eb2faa..0000000000 --- a/frontend/src/views/setting/system/pluginManager/components/stepProgress.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - -@/models/setting/plugin diff --git a/frontend/src/views/setting/system/pluginManager/components/updatePluginModal.vue b/frontend/src/views/setting/system/pluginManager/components/updatePluginModal.vue index 46eb4dd749..b0089bbe09 100644 --- a/frontend/src/views/setting/system/pluginManager/components/updatePluginModal.vue +++ b/frontend/src/views/setting/system/pluginManager/components/updatePluginModal.vue @@ -1,38 +1,41 @@ -@/models/setting/plugin diff --git a/frontend/src/views/setting/system/pluginManager/components/uploadModel.vue b/frontend/src/views/setting/system/pluginManager/components/uploadModel.vue index 53d8614337..041584836c 100644 --- a/frontend/src/views/setting/system/pluginManager/components/uploadModel.vue +++ b/frontend/src/views/setting/system/pluginManager/components/uploadModel.vue @@ -1,26 +1,97 @@