From 3e4b1ffcf2fb97c26bf22a0180f639f94c496d39 Mon Sep 17 00:00:00 2001 From: baiqi Date: Mon, 25 Sep 2023 13:34:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project-management/fileManagement.ts | 1105 ++++++++++++++++- frontend/src/locale/en-US/common.ts | 1 + frontend/src/locale/zh-CN/common.ts | 1 + frontend/src/router/constants.ts | 4 +- frontend/src/store/modules/user/index.ts | 10 +- frontend/src/utils/index.ts | 20 + .../components/fileDetailDrawer.vue | 127 +- .../fileManagement/components/folderTree.vue | 84 +- .../fileManagement/components/popConfirm.vue | 50 +- .../fileManagement/components/rightBox.vue | 434 ++++++- .../fileManagement/components/storageList.vue | 7 +- .../fileManagement/locale/en-US.ts | 43 +- .../fileManagement/locale/zh-CN.ts | 22 +- .../system/config/components/baseConfig.vue | 3 +- .../setting/system/config/locale/en-US.ts | 2 + .../setting/system/config/locale/zh-CN.ts | 1 + .../setting/system/resourcePool/detail.vue | 1 - .../src/views/setting/system/user/index.vue | 26 +- 18 files changed, 1800 insertions(+), 141 deletions(-) diff --git a/frontend/src/api/modules/project-management/fileManagement.ts b/frontend/src/api/modules/project-management/fileManagement.ts index b7a6f62973..e156300a8d 100644 --- a/frontend/src/api/modules/project-management/fileManagement.ts +++ b/frontend/src/api/modules/project-management/fileManagement.ts @@ -9,10 +9,12 @@ const fileList = [ name: 'JAR', url: 'https://github.com/metersphere/metersphere/blob/v2.10/.gitignore', type: 'JAR', + desc: 'fwihflhlofihlasjkhfdlkasjdhgaksuidhoasidoasidasopidapsoidaps', storage: 'minio', tag: ['dsadasd'], size: '12MB', enable: true, + fileVersion: 'v2.10', fileModule: 'XXX', creator: '创建人', updater: '更新人', @@ -24,6 +26,1105 @@ const fileList = [ name: 'PNG', url: 'http://localhost:5173/front/base-display/get/logo-platform', type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000003, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000004, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000005, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000006, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000007, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000008, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000009, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000010, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000011, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000012, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000013, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000014, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000015, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000016, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000017, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000018, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000019, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000020, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 100001, + name: 'JAR', + url: 'https://github.com/metersphere/metersphere/blob/v2.10/.gitignore', + type: 'JAR', + desc: 'fwihflhlofihlasjkhfdlkasjdhgaksuidhoasidoasidasopidapsoidaps', + storage: 'minio', + tag: ['dsadasd'], + size: '12MB', + enable: true, + fileVersion: 'v2.10', + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000002, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000003, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000004, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000005, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000006, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000007, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000008, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000009, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000010, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000011, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000012, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000013, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000014, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000015, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000016, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000017, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000018, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000019, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000020, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 100001, + name: 'JAR', + url: 'https://github.com/metersphere/metersphere/blob/v2.10/.gitignore', + type: 'JAR', + desc: 'fwihflhlofihlasjkhfdlkasjdhgaksuidhoasidoasidasopidapsoidaps', + storage: 'minio', + tag: ['dsadasd'], + size: '12MB', + enable: true, + fileVersion: 'v2.10', + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000002, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000003, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000004, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000005, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000006, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000007, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000008, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000009, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000010, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000011, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000012, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000013, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000014, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000015, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000016, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000017, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000018, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000019, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', + storage: 'github', + gitBranch: 'master', + gitVersion: 'v2.10', + gitPath: '/asdas/xas/xas/fd/f/', + tag: ['asfasdfas'], + size: '12MB', + enable: false, + fileModule: 'XXX', + creator: '创建人', + updater: '更新人', + updateTime: 18975439859, + createTime: 18975439859, + }, + { + id: 1000020, + name: 'PNG', + url: 'http://localhost:5173/front/base-display/get/logo-platform', + type: 'PNG', + desc: 'sfakjdghkjrugheoirugkblasjblsdjkhflksdjfsldkjklnjkhkljds', storage: 'github', gitBranch: 'master', gitVersion: 'v2.10', @@ -39,10 +1140,10 @@ const fileList = [ }, ]; // 获取文件列表 -export function getFileList(data: TableQueryParams) { +export function getFileList(data: TableQueryParams): Promise> { // return MSR.post>({ url: FileListUrl, data }); return Promise.resolve({ - total: 2, + total: 100, list: fileList, pageSize: 10, current: 1, diff --git a/frontend/src/locale/en-US/common.ts b/frontend/src/locale/en-US/common.ts index 071bbf8bb1..b2dac578c9 100644 --- a/frontend/src/locale/en-US/common.ts +++ b/frontend/src/locale/en-US/common.ts @@ -1,6 +1,7 @@ export default { 'common.pleaseSelectMember': 'Please select member', 'common.add': 'Add', + 'common.saveAndContinue': 'Save & Continue', 'common.edit': 'Edit', 'common.delete': 'Delete', 'common.save': 'Save', diff --git a/frontend/src/locale/zh-CN/common.ts b/frontend/src/locale/zh-CN/common.ts index 246889e26b..4f06492bee 100644 --- a/frontend/src/locale/zh-CN/common.ts +++ b/frontend/src/locale/zh-CN/common.ts @@ -1,6 +1,7 @@ export default { 'common.pleaseSelectMember': '请选择成员', 'common.add': '添加', + 'common.saveAndContinue': '保存并继续添加', 'common.edit': '编辑', 'common.delete': '删除', 'common.save': '保存', diff --git a/frontend/src/router/constants.ts b/frontend/src/router/constants.ts index b16d845907..b0051047b8 100644 --- a/frontend/src/router/constants.ts +++ b/frontend/src/router/constants.ts @@ -1,7 +1,7 @@ // 路由白名单,无需校验权限与登录状态 export const WHITE_LIST = [ - { name: 'notFound', children: [] }, - { name: 'invite', children: [] }, + { name: 'notFound', path: '/notFound', children: [] }, + { name: 'invite', path: '/invite', children: [] }, ]; // 左侧菜单底部对齐的菜单数组,数组项为一级路由的name diff --git a/frontend/src/store/modules/user/index.ts b/frontend/src/store/modules/user/index.ts index 7541af4d23..e893e033c4 100644 --- a/frontend/src/store/modules/user/index.ts +++ b/frontend/src/store/modules/user/index.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia'; -import { useRoute } from 'vue-router'; import { login as userLogin, logout as userLogout, isLogin as userIsLogin } from '@/api/modules/user'; +import { getHashParameters } from '@/utils'; import { setToken, clearToken } from '@/utils/auth'; import { removeRouteListener } from '@/utils/route-listener'; import useAppStore from '../app'; @@ -98,14 +98,12 @@ const useUserStore = defineStore('user', { const appStore = useAppStore(); setToken(res.sessionId, res.csrfToken); this.setInfo(res); - const route = useRoute(); - const urlOrgId = route.query.organizationId; - const urlProjectId = route.query.projectId; + const { organizationId, projectId } = getHashParameters(); // 如果访问页面的时候携带了组织 ID和项目 ID,则不设置 - if (!urlOrgId) { + if (!organizationId) { appStore.setCurrentOrgId(res.lastOrganizationId || ''); } - if (!urlProjectId) { + if (!projectId) { appStore.setCurrentProjectId(res.lastProjectId || ''); } return true; diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts index d51c9dffbf..99b4bffb48 100644 --- a/frontend/src/utils/index.ts +++ b/frontend/src/utils/index.ts @@ -282,3 +282,23 @@ export const downloadUrlFile = (url: string, fileName: string) => { export const getTime = (time: string): string => { return dayjs(time).format('YYYY-MM-DD HH:mm:ss'); }; + +/** + * 获取 URL 哈希参数 + * @returns 参数对象 + */ +export const getHashParameters = (): Record => { + const query = window.location.hash.split('?')[1]; // 获取 URL 哈希参数部分 + const paramsArray = query.split('&'); // 将哈希参数字符串分割成数组 + const params: Record = {}; + + // 遍历数组并解析参数 + paramsArray.forEach((param) => { + const [key, value] = param.split('='); + if (key && value) { + params[key] = decodeURIComponent(value); // 解码参数值 + } + }); + + return params; +}; diff --git a/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue b/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue index 91e04085a0..55644a4a9f 100644 --- a/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue +++ b/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue @@ -77,20 +77,31 @@
- -
-
- + + + + + + + + + + +
@@ -170,15 +206,16 @@ import MsDrawer from '@/components/pure/ms-drawer/index.vue'; import MsButton from '@/components/pure/ms-button/index.vue'; import MsIcon from '@/components/pure/ms-icon-font/index.vue'; - import { getFileEnum, FileIconMap } from '@/components/pure/ms-upload/iconMap'; + import { getFileEnum } from '@/components/pure/ms-upload/iconMap'; import MsDescription, { type Description } from '@/components/pure/ms-description/index.vue'; import popConfirm from './popConfirm.vue'; - import { UploadStatus } from '@/enums/uploadEnum'; import useTable from '@/components/pure/ms-table/useTable'; import { getFileDetail, getFileCases, getFileVersions } from '@/api/modules/project-management/fileManagement'; import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; + import MsPreviewCard from '@/components/business/ms-thumbnail-card/index.vue'; import { TableKeyEnum } from '@/enums/tableEnum'; import { downloadUrlFile } from '@/utils'; + import useLocale from '@/locale/useLocale'; import type { MsTableColumn } from '@/components/pure/ms-table/type'; @@ -193,6 +230,7 @@ const { file: newFile, open } = useFileSystemAccess(); const { t } = useI18n(); + const { currentLocale } = useLocale(); const innerVisible = ref(false); const fileDetail = ref(); @@ -228,6 +266,11 @@ value: fileDetail.value.name, key: 'name', }, + { + label: t('project.fileManagement.desc'), + value: fileDetail.value.desc, + key: 'desc', + }, { label: t('project.fileManagement.type'), value: fileDetail.value.type, @@ -289,9 +332,6 @@ () => props.fileId, () => { initFileDetail(); - }, - { - immediate: true, } ); @@ -414,14 +454,17 @@ { title: 'project.fileManagement.record', dataIndex: 'record', + showTooltip: true, }, { title: 'project.fileManagement.creator', dataIndex: 'creator', + showTooltip: true, }, { title: 'project.fileManagement.createTime', dataIndex: 'createTime', + width: 180, }, ]; const { @@ -436,10 +479,12 @@ }); watchEffect(() => { - if (activeTab.value === 'case') { - loadCaseList(); - } else { - loadVersionList(); + if (innerVisible.value) { + if (activeTab.value === 'case') { + loadCaseList(); + } else { + loadVersionList(); + } } }); @@ -451,30 +496,6 @@ padding: 16px; width: 300px; border-right: 1px solid var(--color-text-n8); - .file-detail-icon { - @apply relative inline-block cursor-pointer overflow-hidden; - - margin-bottom: 16px; - width: 102px; - height: 102px; - border-radius: var(--border-radius-small); - background-color: var(--color-text-n9); - &:hover { - .file-detail-icon-footer { - @apply visible; - } - } - .file-detail-icon-footer { - @apply invisible absolute w-full text-center; - - bottom: 0; - padding: 2px 0; - font-size: 12px; - font-weight: 500; - color: #ffffff; - background-color: #00000050; - } - } } .file-relation { width: 660px; diff --git a/frontend/src/views/project-management/fileManagement/components/folderTree.vue b/frontend/src/views/project-management/fileManagement/components/folderTree.vue index d86122c2cf..baea3ffea0 100644 --- a/frontend/src/views/project-management/fileManagement/components/folderTree.vue +++ b/frontend/src/views/project-management/fileManagement/components/folderTree.vue @@ -3,7 +3,7 @@ v-model:model-value="moduleKeyword" :placeholder="t('project.fileManagement.folderSearchPlaceholder')" allow-clear - class="mb-[8px]" + class="mb-[16px]" > - diff --git a/frontend/src/views/project-management/fileManagement/components/rightBox.vue b/frontend/src/views/project-management/fileManagement/components/rightBox.vue index 92df91bc93..3083274dac 100644 --- a/frontend/src/views/project-management/fileManagement/components/rightBox.vue +++ b/frontend/src/views/project-management/fileManagement/components/rightBox.vue @@ -1,14 +1,20 @@ + + +
@@ -123,6 +156,86 @@ + + + + + + + + + + + + + + + + import { computed, onBeforeMount, ref, watch } from 'vue'; import { useRoute } from 'vue-router'; - import { Message } from '@arco-design/web-vue'; + import { Message, ValidatedError } from '@arco-design/web-vue'; import { debounce } from 'lodash-es'; import { useI18n } from '@/hooks/useI18n'; import useTableStore from '@/store/modules/ms-table'; @@ -156,9 +269,14 @@ import MsFileList from '@/components/pure/ms-upload/fileList.vue'; import MsTableMoreAction from '@/components/pure/ms-table-more-action/index.vue'; import MsTagGroup from '@/components/pure/ms-tag/ms-tag-group.vue'; + import MsFormItemSub from '@/components/business/ms-form-item-sub/index.vue'; + import MsThumbnailCard from '@/components/business/ms-thumbnail-card/index.vue'; + import MsCardList from '@/components/business/ms-card-list/index.vue'; import fileDetailDrawerVue from './fileDetailDrawer.vue'; + import folderTree from './folderTree.vue'; - import type { MsTableColumn } from '@/components/pure/ms-table/type'; + import type { FormInstance } from '@arco-design/web-vue'; + import type { BatchActionParams, MsTableColumn } from '@/components/pure/ms-table/type'; import type { MsFileItem, UploadType } from '@/components/pure/ms-upload/types'; import type { ActionsItem } from '@/components/pure/ms-table-more-action/types'; @@ -172,9 +290,8 @@ const asyncTaskStore = useAsyncTaskStore(); const { openModal } = useModal(); - const keyword = ref(''); - const fileType = ref('module'); - const acceptType = ref('none'); + const fileType = ref('module'); // 当前查看的文件类型,模块/存储库 + const acceptType = ref('none'); // 模块-上传文件类型 const isUploading = ref(false); watch( @@ -188,15 +305,11 @@ } ); - function changeFileType() { - console.log(fileType.value); - } + function changeFileType() {} - const showType = ref('list'); + const showType = ref<'list' | 'card'>('list'); // 文件列表展示形式 - function changeShowType() { - console.log(showType.value); - } + function changeShowType() {} function getCardClass(type: 'none' | 'jar') { if (acceptType.value !== type && isUploading.value) { @@ -209,6 +322,13 @@ } const normalFileActions: ActionsItem[] = [ + { + label: 'project.fileManagement.move', + eventTag: 'move', + }, + { + isDivider: true, + }, { label: 'project.fileManagement.delete', eventTag: 'delete', @@ -217,6 +337,10 @@ ]; const jarFileActions: ActionsItem[] = [ + { + label: 'project.fileManagement.move', + eventTag: 'move', + }, { label: 'common.disable', eventTag: 'disabled', @@ -241,6 +365,7 @@ { title: 'project.fileManagement.type', dataIndex: 'type', + width: 90, }, { title: 'project.fileManagement.tag', @@ -251,20 +376,22 @@ { title: 'project.fileManagement.creator', dataIndex: 'creator', + showTooltip: true, }, { title: 'project.fileManagement.updater', dataIndex: 'updater', + showTooltip: true, }, { title: 'project.fileManagement.updateTime', dataIndex: 'updateTime', - width: 170, + width: 180, }, { title: 'project.fileManagement.createTime', dataIndex: 'createTime', - width: 170, + width: 180, }, { title: 'common.operation', @@ -276,32 +403,67 @@ ]; const tableStore = useTableStore(); tableStore.initColumn(TableKeyEnum.FILE_MANAGEMENT_FILE, columns, 'drawer'); - const { propsRes, propsEvent, loadList } = useTable(getFileList, { + const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(getFileList, { tableKey: TableKeyEnum.FILE_MANAGEMENT_FILE, columns, showSetting: true, + selectable: true, + showSelectAll: true, }); + const moduleFileBatchActions = { + baseAction: [ + { + label: 'project.fileManagement.download', + eventTag: 'download', + }, + { + label: 'project.fileManagement.move', + eventTag: 'move', + }, + { + label: 'project.fileManagement.delete', + eventTag: 'delete', + danger: true, + }, + ], + }; + const storageFileBatchActions = { + baseAction: [ + { + label: 'project.fileManagement.download', + eventTag: 'download', + }, + { + label: 'project.fileManagement.delete', + eventTag: 'delete', + danger: true, + }, + ], + }; + const tableSelected = ref<(string | number)[]>([]); - watch( - () => props.activeFolder, - () => { - keyword.value = ''; - debounce(loadList, 200)(); - }, - { immediate: true } - ); - - function downloadFile(url: string, name: string) { - downloadUrlFile(url, name); + /** + * 处理表格选中 + */ + function handleTableSelect(arr: (string | number)[]) { + tableSelected.value = arr; } + function batchDownload() {} + /** * 删除文件 */ - function delFile(record: any) { + function delFile(record: any, isBatch?: boolean) { + let title = t('project.fileManagement.deleteFileTipTitle', { name: characterLimit(record?.name) }); + let selectIds = [record?.id]; + if (isBatch) { + title = t('project.fileManagement.batchDeleteFileTipTitle', { count: tableSelected.value.length }); + selectIds = tableSelected.value as string[]; + } openModal({ type: 'error', - title: t('project.fileManagement.deleteFileTipTitle', { name: characterLimit(record.name) }), + title, content: t('project.fileManagement.deleteFileTipContent'), okText: t('common.confirmDelete'), cancelText: t('common.cancel'), @@ -311,6 +473,8 @@ maskClosable: false, onBeforeOk: async () => { try { + console.log(selectIds); + Message.success(t('common.deleteSuccess')); loadList(); } catch (error) { @@ -321,6 +485,102 @@ }); } + const moveModalVisible = ref(false); // 移动文件弹窗 + const selectedModuleKeys = ref<(string | number)[]>([]); // 移动文件搜索关键字 + const isBatchMove = ref(false); // 是否批量移动文件 + const activeFile = ref(null); // 当前查看的文件信息 + + /** + * 处理文件夹树节点选中事件 + */ + function folderNodeSelect(keys: (string | number)[]) { + selectedModuleKeys.value = keys; + } + + /** + * 处理表格选中后批量操作 + * @param event 批量操作事件对象 + */ + function handleTableBatch(event: BatchActionParams) { + switch (event.eventTag) { + case 'download': + batchDownload(); + break; + case 'move': + moveModalVisible.value = true; + isBatchMove.value = true; + break; + case 'delete': + delFile(null, true); + break; + default: + break; + } + } + + const batchMoveFileLoading = ref(false); + /** + * 单个/批量移动文件 + */ + async function batchMoveFile() { + try { + batchMoveFileLoading.value = true; + await new Promise((resolve) => { + setTimeout(() => resolve(true), 2000); + }); + Message.success(t('project.fileManagement.batchMoveSuccess')); + if (isBatchMove.value) { + tableSelected.value = []; + isBatchMove.value = false; + } else { + activeFile.value = null; + } + loadList(); + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } finally { + batchMoveFileLoading.value = false; + } + } + + function handleMoveFileModalCancel() { + moveModalVisible.value = false; + selectedModuleKeys.value = []; + } + + const keyword = ref(''); + const tableFileType = ref(''); + const tableFileTypeOptions = ref(['JPG', 'PNG']); + + const searchList = debounce(() => { + setLoadListParams({ + fileType: tableFileType.value, + keyword: keyword.value, + }); + loadList(); + }, 300); + + watch( + () => props.activeFolder, + () => { + keyword.value = ''; + searchList(); + }, + { immediate: true } + ); + + watch( + () => keyword.value, + () => { + searchList(); + } + ); + + function downloadFile(url: string, name: string) { + downloadUrlFile(url, name); + } + /** * 禁用 jar 文件 */ @@ -348,8 +608,13 @@ * 处理表格更多按钮事件 * @param item */ - function handleSelect(item: ActionsItem, record: any) { + function handleMoreActionSelect(item: ActionsItem, record: any) { switch (item.eventTag) { + case 'move': + isBatchMove.value = false; + activeFile.value = record; + moveModalVisible.value = true; + break; case 'delete': delFile(record); break; @@ -376,7 +641,7 @@ propsRes.value.msPagination!.total ); - async function openFileDetail(id: string, index: number) { + async function openFileDetail(id: string | number, index: number) { showDetailDrawer.value = true; activeFileId.value = id; activeFileIndex.value = index; @@ -414,15 +679,19 @@ } } - const uploadDrawerVisible = ref(false); + const uploadDrawerVisible = ref(false); // 模块-上传文件抽屉 const fileList = ref(asyncTaskStore.uploadFileTask.fileList); - + // 是否非上传中状态 const noWaitingUpload = computed( () => fileList.value.filter((e) => e.status && (e.status === UploadStatus.init || e.status === UploadStatus.uploading)) .length === 0 ); + /** + * 设置上传文件类型 + * @param type 文件类型 + */ function setAcceptType(type: UploadType) { if (isUploading.value) return; acceptType.value = type; @@ -461,6 +730,9 @@ isUploading.value = true; } + /** + * 后台上传 + */ function backstageUpload() { fileListRef.value?.backstageUpload(); uploadDrawerVisible.value = false; @@ -525,6 +797,81 @@ } } ); + + const storageDialogVisible = ref(false); // 存储库-上传文件弹窗 + const storageForm = ref({ + branch: '', + path: '', + }); // 存储库-上传文件表单 + const storageFormRef = ref(); // 存储库-上传文件表单ref + const storageModalLoading = ref(false); // 存储库-上传文件弹窗loading + + /** + * 处理添加文件按钮点击事件,根据当前查看的文件类型,打开不同的弹窗 + */ + function handleAddClick() { + if (fileType.value === 'module') { + uploadDrawerVisible.value = true; + } else if (fileType.value === 'storage') { + storageDialogVisible.value = true; + } + } + + function handleStorageModalCancel() { + storageFormRef.value?.resetFields(); + storageDialogVisible.value = false; + } + + /** + * 存储库-添加文件 + * @param isContinue 是否继续添加 + */ + async function addStorageFile(isContinue?: boolean) { + const params = { + branch: storageForm.value.branch, + path: storageForm.value.path, + }; + // await batchCreateUser(params); + Message.success(t('common.addSuccess')); + if (!isContinue) { + storageDialogVisible.value = false; + } + loadList(); + } + + /** + * 存储库-触发添加文件表单校验 + * @param cb 校验通过后执行回调 + */ + function storageFormValidate(cb: () => Promise) { + storageFormRef.value?.validate(async (errors: undefined | Record) => { + if (!errors) { + try { + storageModalLoading.value = true; + await cb(); + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } finally { + storageModalLoading.value = false; + } + } + }); + } + + function saveAndContinue() { + storageFormValidate(async () => { + await addStorageFile(true); + storageFormRef.value?.resetFields(); + }); + } + + function beforeAddStorageFile() { + storageFormValidate(async () => { + await addStorageFile(); + handleStorageModalCancel(); + }); + } diff --git a/frontend/src/views/project-management/fileManagement/components/storageList.vue b/frontend/src/views/project-management/fileManagement/components/storageList.vue index 86dc2c9b10..6329a72a48 100644 --- a/frontend/src/views/project-management/fileManagement/components/storageList.vue +++ b/frontend/src/views/project-management/fileManagement/components/storageList.vue @@ -29,7 +29,12 @@
diff --git a/frontend/src/views/project-management/fileManagement/locale/en-US.ts b/frontend/src/views/project-management/fileManagement/locale/en-US.ts index 69516ba94b..b3c820b5f8 100644 --- a/frontend/src/views/project-management/fileManagement/locale/en-US.ts +++ b/frontend/src/views/project-management/fileManagement/locale/en-US.ts @@ -68,7 +68,11 @@ export default { 'After cancellation, files that have not been successfully uploaded will not be saved, so please operate with caution!', 'project.fileManagement.cancelConfirm': 'Cancel upload', 'project.fileManagement.name': 'File name', - 'project.fileManagement.type': 'Type', + 'project.fileManagement.type': 'Format', + 'project.fileManagement.fileNamePlaceholder': 'Please enter the file name and press Enter to save', + 'project.fileManagement.desc': 'Description', + 'project.fileManagement.updateDesc': 'Update description', + 'project.fileManagement.descPlaceholder': 'Please enter content', 'project.fileManagement.tag': 'Tag', 'project.fileManagement.creator': 'Creator', 'project.fileManagement.updater': 'Updater', @@ -76,10 +80,47 @@ export default { 'project.fileManagement.createTime': 'Created time', 'project.fileManagement.download': 'Download', 'project.fileManagement.disabled': 'Disable', + 'project.fileManagement.move': 'Move to', 'project.fileManagement.deleteFileTipTitle': 'Are you sure you want to delete the file {name}?', 'project.fileManagement.deleteFileTipContent': 'After deletion, the use cases associated with the file will fail to execute. Please operate with caution!', 'project.fileManagement.disabledFileTipTitle': 'Are you sure you want to disable the file {name}?', 'project.fileManagement.disabledFileTipContent': 'After being disabled, the custom script associated with the file will fail to execute, so please operate with caution!', + 'project.fileManagement.batchDeleteFileTipTitle': 'Are you sure you want to delete these {count} files?', + 'project.fileManagement.batchDeleteFileTipContent': + 'After deletion, the use cases associated with these files will fail to execute, so please operate with caution!', + 'project.fileManagement.detail': 'File details', + 'project.fileManagement.prev': 'Prev', + 'project.fileManagement.noPrev': 'Currently the first', + 'project.fileManagement.next': 'Next', + 'project.fileManagement.noNext': 'Currently the last one', + 'project.fileManagement.updateFile': 'Update file', + 'project.fileManagement.replaceFile': 'Replace file', + 'project.fileManagement.replaceFileSuccess': 'File replacement successful', + 'project.fileManagement.size': 'File size', + 'project.fileManagement.fileModule': 'Module', + 'project.fileManagement.gitBranch': 'Git branch', + 'project.fileManagement.gitPath': 'Git path', + 'project.fileManagement.gitVersion': 'Git version', + 'project.fileManagement.cases': 'Related Use Cases', + 'project.fileManagement.versionHistory': 'Version history', + 'project.fileManagement.updateCaseFile': 'Update use case file', + 'project.fileManagement.id': 'ID', + 'project.fileManagement.fileVersion': 'File version', + 'project.fileManagement.record': 'Update history', + 'project.fileManagement.caseList': 'Use case list', + 'project.fileManagement.search': 'Enter name to search', + 'project.fileManagement.gitBranchNotNull': 'Git branch cannot be empty', + 'project.fileManagement.gitBranchPlaceholder': 'Please enter the git branch, such as: master', + 'project.fileManagement.gitFilePath': 'File path', + 'project.fileManagement.gitFilePathNotNull': 'File path cannot be empty', + 'project.fileManagement.gitFilePathPlaceholder': 'Please enter the file path, such as: /xxxxxx.xx', + 'project.fileManagement.gitFilePathSub': 'No need to add file path separator before root directory: /', + 'project.fileManagement.batchMoveTitle': 'Batch move', + 'project.fileManagement.singleMoveTitle': 'Move', + 'project.fileManagement.batchMoveTitleSub': '({count} files selected)', + 'project.fileManagement.batchMoveSearchPlaceholder': 'Please enter the module name to search', + 'project.fileManagement.batchMoveConfirm': 'Move to selected module', + 'project.fileManagement.batchMoveSuccess': 'File moved successfully', }; diff --git a/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts b/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts index 562d27171e..6b3db79dad 100644 --- a/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts +++ b/frontend/src/views/project-management/fileManagement/locale/zh-CN.ts @@ -64,7 +64,11 @@ export default { 'project.fileManagement.cancelTipContent': '取消后,未上传成功的文件不会被保存,请谨慎操作!', 'project.fileManagement.cancelConfirm': '取消上传', 'project.fileManagement.name': '文件名称', - 'project.fileManagement.type': '文件类型', + 'project.fileManagement.fileNamePlaceholder': '请输入文件名称,按回车键保存', + 'project.fileManagement.desc': '文件描述', + 'project.fileManagement.updateDesc': '更新描述', + 'project.fileManagement.descPlaceholder': '请输入内容', + 'project.fileManagement.type': '文件格式', 'project.fileManagement.tag': '标签', 'project.fileManagement.creator': '创建人', 'project.fileManagement.updater': '更新人', @@ -72,10 +76,12 @@ export default { 'project.fileManagement.createTime': '创建时间', 'project.fileManagement.download': '下载', 'project.fileManagement.disabled': '禁用', + 'project.fileManagement.move': '移动', 'project.fileManagement.deleteFileTipTitle': '确认删除 {name} 这个文件吗?', - 'project.fileManagement.deleteFileTipContent': '删除后,导致关联该文件的用例执行失败,请谨慎操作!', + 'project.fileManagement.deleteFileTipContent': '删除后,会导致关联该文件的用例执行失败,请谨慎操作!', 'project.fileManagement.disabledFileTipTitle': '确认禁用 {name} 这个文件吗?', 'project.fileManagement.disabledFileTipContent': '禁用后,会导致关联该文件的自定义脚本执行失败,请谨慎操作!', + 'project.fileManagement.batchDeleteFileTipTitle': '确认删除这 {count} 个文件吗?', 'project.fileManagement.detail': '文件详情', 'project.fileManagement.prev': '上一个', 'project.fileManagement.noPrev': '当前已是第一个', @@ -97,4 +103,16 @@ export default { 'project.fileManagement.record': '更新历史', 'project.fileManagement.caseList': '用例列表', 'project.fileManagement.search': '输入名称搜索', + 'project.fileManagement.gitBranchNotNull': 'git 分支不能为空', + 'project.fileManagement.gitBranchPlaceholder': '请输入 git 分支,如:master', + 'project.fileManagement.gitFilePath': '文件路径', + 'project.fileManagement.gitFilePathNotNull': '文件路径不能为空', + 'project.fileManagement.gitFilePathPlaceholder': '请输入文件路径,如:/xxxxxx.xx', + 'project.fileManagement.gitFilePathSub': '根目录前无需添加文件路径分隔符:/', + 'project.fileManagement.batchMoveTitle': '批量移动', + 'project.fileManagement.singleMoveTitle': '移动', + 'project.fileManagement.batchMoveTitleSub': '(已选 {count} 个文件)', + 'project.fileManagement.batchMoveSearchPlaceholder': '请输入模块名称进行搜索', + 'project.fileManagement.batchMoveConfirm': '移动至所选模块', + 'project.fileManagement.batchMoveSuccess': '文件移动成功', }; diff --git a/frontend/src/views/setting/system/config/components/baseConfig.vue b/frontend/src/views/setting/system/config/components/baseConfig.vue index f59a205d90..643de00722 100644 --- a/frontend/src/views/setting/system/config/components/baseConfig.vue +++ b/frontend/src/views/setting/system/config/components/baseConfig.vue @@ -157,13 +157,14 @@ allow-clear /> - + +