From 1e91bce309e4f99d9bcbd88717d818081e596747 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Thu, 13 Jul 2023 14:09:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=5F=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=5F?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=9B=BD=E9=99=85=E5=8C=96=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components.d.ts | 6 +- frontend/src/mock/system/pluginManger.ts | 158 +++--------------- frontend/src/models/system/plugin.ts | 2 +- .../member/components/addMemberModal.vue | 33 ++-- .../src/views/organization/member/index.vue | 22 ++- .../views/organization/member/locale/en-US.ts | 1 + .../views/organization/member/locale/zh-CN.ts | 1 + .../pluginManager/components/pluginTable.vue | 42 ++++- .../components/sceneChangeModal.vue | 15 +- .../components/updatePluginModal.vue | 37 ++-- .../src/views/system/pluginManager/index.vue | 10 +- .../system/pluginManager/locale/en-US.ts | 16 +- .../system/pluginManager/locale/zh-CN.ts | 13 +- 13 files changed, 147 insertions(+), 209 deletions(-) diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 704d0f03b2..524ea40698 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -5,11 +5,11 @@ // Read more: https://github.com/vuejs/core/pull/3399 import '@vue/runtime-core' -export {}; +export {} declare module '@vue/runtime-core' { export interface GlobalComponents { - RouterLink: typeof import('vue-router')['RouterLink']; - RouterView: typeof import('vue-router')['RouterView']; + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] } } diff --git a/frontend/src/mock/system/pluginManger.ts b/frontend/src/mock/system/pluginManger.ts index 5cf8f93056..ecbc53bd4f 100644 --- a/frontend/src/mock/system/pluginManger.ts +++ b/frontend/src/mock/system/pluginManger.ts @@ -73,77 +73,18 @@ const getPluginList = () => { enable: true, }, ], - children: [ + steps: [ { id: '1-1-1', - name: '插件1-1', - describe: '插件1-1', - 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, - }, - ], + name: '步骤一', + }, + { + id: '1-1-2', + name: '步骤二', + }, + { + id: '1-1-3', + name: '步骤三', }, ], }, @@ -217,77 +158,18 @@ const getPluginList = () => { enable: true, }, ], - children: [ + steps: [ { id: '2-1-1', - name: '插件2-1', - describe: '插件2-1', - 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, - }, - ], + name: '步骤2-一', + }, + { + id: '2-1-2', + name: '步骤2-二', + }, + { + id: '2-1-3', + name: '步骤3-三', }, ], }, diff --git a/frontend/src/models/system/plugin.ts b/frontend/src/models/system/plugin.ts index e02f1de028..bcf5845327 100644 --- a/frontend/src/models/system/plugin.ts +++ b/frontend/src/models/system/plugin.ts @@ -27,7 +27,7 @@ export interface PluginItem { createUser: string; updateUser: string; organizationList: organizationList; - children?: PluginItem[]; + steps?: string[]; } export type PluginList = PluginItem[]; diff --git a/frontend/src/views/organization/member/components/addMemberModal.vue b/frontend/src/views/organization/member/components/addMemberModal.vue index 844714cc07..da868b092d 100644 --- a/frontend/src/views/organization/member/components/addMemberModal.vue +++ b/frontend/src/views/organization/member/components/addMemberModal.vue @@ -1,15 +1,15 @@ - + diff --git a/frontend/src/views/organization/member/locale/en-US.ts b/frontend/src/views/organization/member/locale/en-US.ts index e38ec26dc3..9ac43f0372 100644 --- a/frontend/src/views/organization/member/locale/en-US.ts +++ b/frontend/src/views/organization/member/locale/en-US.ts @@ -2,6 +2,7 @@ export default { 'organization.member.addMember': 'Add Member', 'organization.member.searchMember': 'Search by name or email address', 'organization.member.remove': 'Remove', + 'organization.member.edit': 'Edit', 'organization.member.batchActionAddProject': 'Add to project', 'organization.member.batchActionAddUsergroup': 'Add to usergroup', 'organization.member.tableEnable': 'Enabled', diff --git a/frontend/src/views/organization/member/locale/zh-CN.ts b/frontend/src/views/organization/member/locale/zh-CN.ts index b49ae0334f..3a48ef6063 100644 --- a/frontend/src/views/organization/member/locale/zh-CN.ts +++ b/frontend/src/views/organization/member/locale/zh-CN.ts @@ -2,6 +2,7 @@ export default { 'organization.member.addMember': '添加成员', 'organization.member.searchMember': '通过名称或邮箱搜索搜索', 'organization.member.remove': '移除', + 'organization.member.edit': '编辑', 'organization.member.batchActionAddProject': '添加至项目', 'organization.member.batchActionAddUsergroup': '添加至用户组', 'organization.member.tableEnable': '正常', diff --git a/frontend/src/views/system/pluginManager/components/pluginTable.vue b/frontend/src/views/system/pluginManager/components/pluginTable.vue index 59525d7607..8eff388439 100644 --- a/frontend/src/views/system/pluginManager/components/pluginTable.vue +++ b/frontend/src/views/system/pluginManager/components/pluginTable.vue @@ -40,6 +40,10 @@ +
{{ 101 }}项数据
@@ -60,6 +64,8 @@ import uploadSuccessModal from './uploadSuccessModal.vue'; import sceneChangeModal from './sceneChangeModal.vue'; import { useCommandComponent } from '@/hooks/useCommandComponent'; + import useModal from '@/hooks/useModal'; + import { Message } from '@arco-design/web-vue'; const { t } = useI18n(); export type Options = { @@ -123,10 +129,13 @@ ]; const { propsRes, propsEvent, loadList, setKeyword } = useTable(getPluginList, { columns, - scroll: { y: 'auto', x: 1800 }, - selectable: false, - showSelectAll: false, + 'scroll': { y: 'auto', x: 1800 }, + 'selectable': false, + 'showSelectAll': false, + 'pagination': false, + 'virtual-list-props': { height: 380 }, }); + const { openModal } = useModal(); const keyword = ref(''); const scene = ref('1'); const sceneList = ref([ @@ -146,7 +155,28 @@ setKeyword(keyword.value); await loadList(); } - function deletePlugin() {} + function deletePlugin(record: any) { + openModal({ + type: 'warning', + title: t('system.plugin.deletePluginTip', { name: record.name }), + content: '', + okText: t('system.plugin.deletePluginConfirm'), + cancelText: t('system.plugin.pluginCancel'), + okButtonProps: { + status: 'danger', + }, + onBeforeOk: async () => { + try { + Message.success(t('system.plugin.deletePluginSuccess')); + return true; + } catch (error) { + console.log(error); + return false; + } + }, + hideCancel: false, + }); + } /** * 处理表格更多按钮事件 * @param item @@ -154,7 +184,7 @@ function handleSelect(item: ActionsItem, record: any) { switch (item.eventTag) { case 'delete': - deletePlugin(); + deletePlugin(record); break; default: break; @@ -191,7 +221,7 @@ const okHandler = () => { dialogOpen(uploadSuccessOptions); }; - const changeScene = () => { + const changeScene = (record: any) => { sceneChangeOptions.visible = true; mySceneChangeDialog(sceneChangeOptions); }; diff --git a/frontend/src/views/system/pluginManager/components/sceneChangeModal.vue b/frontend/src/views/system/pluginManager/components/sceneChangeModal.vue index d0b221c46a..045742140e 100644 --- a/frontend/src/views/system/pluginManager/components/sceneChangeModal.vue +++ b/frontend/src/views/system/pluginManager/components/sceneChangeModal.vue @@ -1,8 +1,8 @@ @@ -69,6 +75,9 @@ }); currentItem.isSelected = true; }; + const handelOk = () => { + emits('close'); + };