diff --git a/frontend/package.json b/frontend/package.json index 8761bcab30..add1e8326e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -37,7 +37,7 @@ "dependencies": { "@7polo/kity": "2.0.8", "@7polo/kityminder-core": "1.4.53", - "@arco-design/web-vue": "^2.52.0", + "@arco-design/web-vue": "^2.52.1", "@arco-themes/vue-ms-theme-default": "^0.0.30", "@form-create/arco-design": "^3.1.23", "@halo-dev/richtext-editor": "0.0.0-alpha.32", diff --git a/frontend/src/api/modules/project-management/fileManagement.ts b/frontend/src/api/modules/project-management/fileManagement.ts index 50b45e3e6e..1f7f845011 100644 --- a/frontend/src/api/modules/project-management/fileManagement.ts +++ b/frontend/src/api/modules/project-management/fileManagement.ts @@ -1,831 +1,96 @@ import MSR from '@/api/http/index'; -import { FileDetailUrl, FileListUrl } from '@/api/requrls/project-management/fileManagement'; +import { + AddModuleUrl, + BatchDownloadFileUrl, + DeleteFileUrl, + DeleteModuleUrl, + DownloadFileUrl, + FilePageUrl, + GetModuleCountUrl, + GetModuleUrl, + MoveModuleUrl, + ReuploadFileUrl, + UpdateFileUrl, + UpdateModuleUrl, + UploadFileUrl, +} from '@/api/requrls/project-management/fileManagement'; -import type { CommonList, TableQueryParams } from '@/models/common'; +import type { CommonList } from '@/models/common'; +import type { + AddModuleParams, + BatchFileApiParams, + FileItem, + FileListQueryParams, + ModuleCount, + ModuleTreeNode, + MoveModuleParams, + ReuploadFileParams, + UpdateFileParams, + UpdateModuleParams, + UploadFileParams, +} from '@/models/projectManagement/file'; -const fileList = [ - { - 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: 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, - }, -]; // 获取文件列表 -export function getFileList(data: TableQueryParams): Promise> { - // return MSR.post>({ url: FileListUrl, data }); - return Promise.resolve({ - total: 100, - list: fileList, - pageSize: 10, - current: 1, - }); +export function getFileList(data: FileListQueryParams) { + return MSR.post>({ url: FilePageUrl, data }); } -// 获取文件详情 -export function getFileDetail(id: string | number) { - // return MSR.post>({ url: FileDetailUrl, data }); - return Promise.resolve(fileList.find((item) => item.id === id)); +// 获取文件列表 +export function getModulesCount(data: FileListQueryParams) { + return MSR.post({ url: GetModuleCountUrl, data }); } -// 获取文件关联用例列表 -export function getFileCases(data: TableQueryParams) { - // return MSR.post>({ url: FileDetailUrl, data }); - return Promise.resolve({ - total: 1, - list: [ - { - id: 1, - name: '用例名称 xxxx', - type: '功能', - fileVersion: '93f9384yf9', - updateTime: 18975439859, - createTime: 18975439859, - }, - { - id: 1, - name: '用例名称 12433421', - type: '接口', - fileVersion: '93f9384yf9', - updateTime: 18975439859, - createTime: 18975439859, - }, - ], - pageSize: 10, - current: 1, - }); +// 上传文件 +export function uploadFile(data: UploadFileParams) { + return MSR.uploadFile({ url: UploadFileUrl }, { request: data.request, fileList: [data.file] }); } -// 获取文件版本列表 -export function getFileVersions(data: TableQueryParams) { - // return MSR.post>({ url: FileDetailUrl, data }); - return Promise.resolve({ - total: 1, - list: [ - { - id: 1, - version: 'd08hf034f3', - record: 'fuih03h4f0ihoiw', - creator: '创建人', - createTime: 18975439859, - }, - { - id: 1, - version: 'd08hf034f3', - record: 'fuih03h4f0ihoiw', - creator: '创建人', - createTime: 18975439859, - }, - ], - pageSize: 10, - current: 1, - }); +// 更新文件信息 +export function updateFile(data: UpdateFileParams) { + return MSR.post({ url: UpdateFileUrl, data }); +} + +// 重新上传文件 +export function reuploadFile(data: ReuploadFileParams) { + return MSR.uploadFile({ url: ReuploadFileUrl }, { request: data.request, fileList: [data.file] }); +} + +// 删除文件 +export function deleteFile(data: BatchFileApiParams) { + return MSR.post({ url: DeleteFileUrl, data }); +} + +// 下载文件 +export function downloadFile(id: string) { + return MSR.get({ url: DownloadFileUrl, params: id }, { isTransformResponse: false }); +} + +// 批量下载文件 +export function batchDownloadFile(data: BatchFileApiParams) { + return MSR.post({ url: BatchDownloadFileUrl, data }, { isTransformResponse: false }); +} + +// 更新模块 +export function updateModule(data: UpdateModuleParams) { + return MSR.post({ url: UpdateModuleUrl, data }); +} + +// 移动模块 +export function moveModule(data: MoveModuleParams) { + return MSR.post({ url: MoveModuleUrl, data }); +} + +// 添加模块 +export function addModule(data: AddModuleParams) { + return MSR.post({ url: AddModuleUrl, data }); +} + +// 查找模块 +export function getModules(id: string) { + return MSR.get({ url: GetModuleUrl, params: id }); +} + +// 删除模块 +export function deleteModule(id: string) { + return MSR.get({ url: DeleteModuleUrl, params: id }); } diff --git a/frontend/src/api/requrls/project-management/fileManagement.ts b/frontend/src/api/requrls/project-management/fileManagement.ts index 85e197f885..a78d87a6d8 100644 --- a/frontend/src/api/requrls/project-management/fileManagement.ts +++ b/frontend/src/api/requrls/project-management/fileManagement.ts @@ -1,2 +1,13 @@ -export const FileListUrl = '/project/member/get-member/option'; -export const FileDetailUrl = '/project/member/get-member/option'; +export const UploadFileUrl = '/project/file/upload'; // 上传文件 +export const UpdateFileUrl = '/project/file/update'; // 更新文件 +export const ReuploadFileUrl = '/project/file/re-upload'; // 重新上传文件 +export const FilePageUrl = '/project/file/page'; // 分页查询文件列表 +export const DeleteFileUrl = '/project/file/delete'; // 删除文件 +export const DownloadFileUrl = '/project/file/download'; // 下载文件 +export const BatchDownloadFileUrl = '/project/file/batch-download'; // 批量下载文件 +export const UpdateModuleUrl = '/project/file-module/update'; // 更新模块 +export const MoveModuleUrl = '/project/file-module/move'; // 移动模块 +export const AddModuleUrl = '/project/file-module/add'; // 添加模块 +export const GetModuleUrl = '/project/file-module/tree'; // 查找模块 +export const DeleteModuleUrl = '/project/file-module/delete'; // 删除模块 +export const GetModuleCountUrl = '/project/file/module/count'; // 模块统计文件数量 diff --git a/frontend/src/components/business/ms-card-list/index.vue b/frontend/src/components/business/ms-card-list/index.vue index ad6b7cb200..f98ddc03c9 100644 --- a/frontend/src/components/business/ms-card-list/index.vue +++ b/frontend/src/components/business/ms-card-list/index.vue @@ -28,7 +28,7 @@ diff --git a/frontend/src/components/business/ms-thumbnail-card/index.vue b/frontend/src/components/business/ms-thumbnail-card/index.vue index 5082299cb2..90595d8ff9 100644 --- a/frontend/src/components/business/ms-thumbnail-card/index.vue +++ b/frontend/src/components/business/ms-thumbnail-card/index.vue @@ -4,11 +4,17 @@
- - - + + + + + @@ -58,14 +64,14 @@ diff --git a/frontend/src/views/project-management/fileManagement/components/popConfirm.vue b/frontend/src/views/project-management/fileManagement/components/popConfirm.vue index 57639757f3..3ba72ef878 100644 --- a/frontend/src/views/project-management/fileManagement/components/popConfirm.vue +++ b/frontend/src/views/project-management/fileManagement/components/popConfirm.vue @@ -51,7 +51,9 @@ import { ref, watch } from 'vue'; import { Message } from '@arco-design/web-vue'; + import { addModule, updateFile, updateModule } from '@/api/modules/project-management/fileManagement'; import { useI18n } from '@/hooks/useI18n'; + import useAppStore from '@/store/modules/app'; import type { FieldRule, FormInstance } from '@arco-design/web-vue'; @@ -64,16 +66,19 @@ } const props = defineProps<{ - mode: 'add' | 'rename'; + mode: 'add' | 'rename' | 'fileRename' | 'fileUpdateDesc'; visible?: boolean; title?: string; allNames: string[]; popupContainer?: string; fieldConfig?: FieldConfig; + parentId?: string; // 父节点 id + nodeId?: string; // 节点 id }>(); - const emit = defineEmits(['update:visible', 'close']); + const emit = defineEmits(['update:visible', 'close', 'addFinish', 'renameFinish', 'updateDescFinish']); + const appStore = useAppStore(); const { t } = useI18n(); const innerVisible = ref(props.visible || false); @@ -113,9 +118,38 @@ try { loading.value = true; if (props.mode === 'add') { + // 添加根级模块 + await addModule({ + projectId: appStore.currentProjectId, + parentId: props.parentId || '', + name: form.value.field, + }); Message.success(t('project.fileManagement.addSubModuleSuccess')); - } else { + emit('addFinish', form.value.field); + } else if (props.mode === 'rename') { + // 模块重命名 + await updateModule({ + id: props.nodeId || '', + name: form.value.field, + }); Message.success(t('project.fileManagement.renameSuccess')); + emit('renameFinish', form.value.field); + } else if (props.mode === 'fileRename') { + // 文件重命名 + await updateFile({ + id: props.nodeId || '', + name: form.value.field, + }); + Message.success(t('project.fileManagement.renameSuccess')); + emit('renameFinish', form.value.field); + } else if (props.mode === 'fileUpdateDesc') { + // 更新文件描述 + await updateFile({ + id: props.nodeId || '', + description: form.value.field, + }); + Message.success(t('project.fileManagement.updateDescSuccess')); + emit('updateDescFinish', form.value.field); } if (done) { done(true); @@ -123,7 +157,11 @@ innerVisible.value = false; } } catch (error) { + // eslint-disable-next-line no-console console.log(error); + if (done) { + done(false); + } } finally { loading.value = false; } diff --git a/frontend/src/views/project-management/fileManagement/components/rightBox.vue b/frontend/src/views/project-management/fileManagement/components/rightBox.vue index 39386230f2..1e550366a7 100644 --- a/frontend/src/views/project-management/fileManagement/components/rightBox.vue +++ b/frontend/src/views/project-management/fileManagement/components/rightBox.vue @@ -25,64 +25,74 @@ {{ t('project.fileManagement.module') }} {{ t('project.fileManagement.storage') }} - + - - - - - + + + + + +
@@ -126,6 +136,11 @@ (); + const emit = defineEmits<{ + (e: 'init', params: FileListQueryParams): void; + }>(); const route = useRoute(); const { t } = useI18n(); + const appStore = useAppStore(); + const userStore = useUserStore(); const asyncTaskStore = useAsyncTaskStore(); const { openModal } = useModal(); const fileType = ref('module'); // 当前查看的文件类型,模块/存储库 const acceptType = ref('none'); // 模块-上传文件类型 const isUploading = ref(false); + const keyword = ref(''); + const tableFileType = ref(''); + const tableFileTypeOptions = ref(['JPG', 'PNG']); + const loading = ref(false); watch( () => props.activeFolderType, @@ -312,8 +345,6 @@ const showType = ref<'list' | 'card'>('list'); // 文件列表展示形式 - function changeShowType() {} - function getCardClass(type: 'none' | 'jar') { if (acceptType.value !== type && isUploading.value) { return 'file-type-card file-type-card--disabled'; @@ -363,16 +394,16 @@ title: 'project.fileManagement.name', slotName: 'name', dataIndex: 'name', - showTooltip: true, + width: 200, }, { title: 'project.fileManagement.type', - dataIndex: 'type', + dataIndex: 'fileType', width: 90, }, { title: 'project.fileManagement.tag', - dataIndex: 'tag', + dataIndex: 'tags', slotName: 'tag', isTag: true, }, @@ -383,7 +414,7 @@ }, { title: 'project.fileManagement.updater', - dataIndex: 'updater', + dataIndex: 'updateUser', showTooltip: true, }, { @@ -452,17 +483,61 @@ tableSelected.value = arr; } - function batchDownload() {} + /** + * 批量下载文件 + * @param params 批量操作参数 + */ + async function batchDownload(params: BatchActionQueryParams) { + try { + loading.value = true; + const res = await batchDownloadFile({ + selectIds: params?.selectedIds || [], + selectAll: !!params?.selectAll, + excludeIds: params?.excludeIds || [], + condition: { keyword: keyword.value }, + projectId: appStore.currentProjectId, + fileType: tableFileType.value, + moduleIds: [props.activeFolder], + }); + downloadByteFile(res, 'files.zip'); + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } finally { + loading.value = false; + } + } + + function emitTableParams() { + emit('init', { + keyword: keyword.value, + fileType: tableFileType.value, + moduleIds: ['all', 'my'].includes(props.activeFolder) ? [] : [props.activeFolder], + projectId: appStore.currentProjectId, + current: propsRes.value.msPagination?.current, + pageSize: propsRes.value.msPagination?.pageSize, + comebine: + props.activeFolder === 'my' + ? { + createUser: userStore.id, + } + : {}, + }); + } + + const cardListRef = ref>(); /** * 删除文件 */ - function delFile(record: any, isBatch?: boolean) { + function delFile(record: FileItem | null, isBatch: boolean, params?: BatchActionQueryParams) { let title = t('project.fileManagement.deleteFileTipTitle', { name: characterLimit(record?.name) }); - let selectIds = [record?.id]; + let selectIds = [record?.id || '']; if (isBatch) { - title = t('project.fileManagement.batchDeleteFileTipTitle', { count: tableSelected.value.length }); - selectIds = tableSelected.value as string[]; + title = t('project.fileManagement.batchDeleteFileTipTitle', { + count: params?.currentSelectCount || params?.selectedIds?.length, + }); + selectIds = params?.selectedIds || []; } openModal({ type: 'error', @@ -476,11 +551,24 @@ maskClosable: false, onBeforeOk: async () => { try { - console.log(selectIds); - + await deleteFile({ + selectIds, + selectAll: !!params?.selectAll, + excludeIds: params?.excludeIds || [], + condition: { keyword: keyword.value }, + projectId: appStore.currentProjectId, + fileType: tableFileType.value, + moduleIds: [props.activeFolder], + }); Message.success(t('common.deleteSuccess')); - loadList(); + if (showType.value === 'card') { + cardListRef.value?.reload(); + } else { + loadList(); + } + emitTableParams(); } catch (error) { + // eslint-disable-next-line no-console console.log(error); } }, @@ -491,7 +579,7 @@ const moveModalVisible = ref(false); // 移动文件弹窗 const selectedModuleKeys = ref<(string | number)[]>([]); // 移动文件搜索关键字 const isBatchMove = ref(false); // 是否批量移动文件 - const activeFile = ref(null); // 当前查看的文件信息 + const activeFile = ref(null); // 当前查看的文件信息 /** * 处理文件夹树节点选中事件 @@ -504,17 +592,18 @@ * 处理表格选中后批量操作 * @param event 批量操作事件对象 */ - function handleTableBatch(event: BatchActionParams) { + function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) { + tableSelected.value = params?.selectedIds || []; switch (event.eventTag) { case 'download': - batchDownload(); + batchDownload(params); break; case 'move': moveModalVisible.value = true; isBatchMove.value = true; break; case 'delete': - delFile(null, true); + delFile(null, true, params); break; default: break; @@ -538,7 +627,12 @@ } else { activeFile.value = null; } - loadList(); + if (showType.value === 'card') { + cardListRef.value?.reload(); + } else { + loadList(); + } + emitTableParams(); } catch (error) { // eslint-disable-next-line no-console console.log(error); @@ -552,16 +646,25 @@ selectedModuleKeys.value = []; } - const keyword = ref(''); - const tableFileType = ref(''); - const tableFileTypeOptions = ref(['JPG', 'PNG']); - const searchList = debounce(() => { setLoadListParams({ - fileType: tableFileType.value, keyword: keyword.value, + fileType: tableFileType.value, + moduleIds: ['all', 'my'].includes(props.activeFolder) ? [] : [props.activeFolder], + projectId: appStore.currentProjectId, + comebine: + props.activeFolder === 'my' + ? { + createUser: userStore.id, + } + : {}, }); - loadList(); + if (showType.value === 'card') { + cardListRef.value?.reload(); + } else { + loadList(); + } + emitTableParams(); }, 300); watch( @@ -580,14 +683,27 @@ } ); - function downloadFile(url: string, name: string) { - downloadUrlFile(url, name); + /** + * 下载单个文件 + * @param record 表格数据项 + */ + async function handleDownload(record: FileItem) { + try { + loading.value = true; + const res = await downloadFile(record.id); + downloadByteFile(res, `${record.name}.${record.fileType}`); + } catch (error) { + // eslint-disable-next-line no-console + console.log(error); + } finally { + loading.value = false; + } } /** * 禁用 jar 文件 */ - function disabledFile(record: any) { + function disabledFile(record: FileItem) { openModal({ type: 'warning', title: t('project.fileManagement.disabledFileTipTitle', { name: characterLimit(record.name) }), @@ -598,8 +714,13 @@ onBeforeOk: async () => { try { Message.success(t('common.disableSuccess')); - loadList(); + if (showType.value === 'card') { + cardListRef.value?.reload(); + } else { + loadList(); + } } catch (error) { + // eslint-disable-next-line no-console console.log(error); } }, @@ -611,7 +732,7 @@ * 处理表格更多按钮事件 * @param item */ - function handleMoreActionSelect(item: ActionsItem, record: any) { + function handleMoreActionSelect(item: ActionsItem, record: FileItem) { switch (item.eventTag) { case 'move': isBatchMove.value = false; @@ -619,7 +740,7 @@ moveModalVisible.value = true; break; case 'delete': - delFile(record); + delFile(record, false); break; case 'disabled': disabledFile(record); @@ -630,10 +751,10 @@ } const showDetailDrawer = ref(false); - const activeFileId = ref(''); + const activeFileId = ref(''); const activeFileIndex = ref(0); - async function openFileDetail(id: string | number, index: number) { + async function openFileDetail(id: string, index: number) { showDetailDrawer.value = true; activeFileId.value = id; activeFileIndex.value = index; @@ -721,6 +842,7 @@ fileList.value = []; isUploading.value = false; } catch (error) { + // eslint-disable-next-line no-console console.log(error); } }, @@ -758,6 +880,21 @@ } ); + watch( + () => asyncTaskStore.uploadFileTask.finishedTime, + () => { + if (asyncTaskStore.uploadFileTask.finishedTime) { + // 上传任务完成后刷新文件列表 + if (showType.value === 'card') { + cardListRef.value?.reload(); + } else { + loadList(); + } + emitTableParams(); + } + } + ); + const storageDialogVisible = ref(false); // 存储库-上传文件弹窗 const storageForm = ref({ branch: '', @@ -796,7 +933,11 @@ if (!isContinue) { storageDialogVisible.value = false; } - loadList(); + if (showType.value === 'card') { + cardListRef.value?.reload(); + } else { + loadList(); + } } /** diff --git a/frontend/src/views/project-management/fileManagement/components/storageList.vue b/frontend/src/views/project-management/fileManagement/components/storageList.vue index 544f848d73..dbb395f14d 100644 --- a/frontend/src/views/project-management/fileManagement/components/storageList.vue +++ b/frontend/src/views/project-management/fileManagement/components/storageList.vue @@ -31,6 +31,7 @@ - +
@@ -49,8 +54,10 @@
@@ -64,7 +71,7 @@ @@ -87,6 +94,8 @@ import { useI18n } from '@/hooks/useI18n'; + import { FileListQueryParams } from '@/models/projectManagement/file'; + const { t } = useI18n(); const myFileCount = ref(0); @@ -94,6 +103,7 @@ const isExpandAll = ref(false); const activeFolderType = ref<'folder' | 'module' | 'storage'>('folder'); const storageDrawerVisible = ref(false); + const rootModulesName = ref([]); // 根模块名称列表 function changeExpand() { isExpandAll.value = !isExpandAll.value; @@ -111,7 +121,7 @@ } } - const activeFolder = ref('all'); + const activeFolder = ref('all'); const selectedKeys = computed({ get: () => [activeFolder.value], set: (val) => val, @@ -140,7 +150,7 @@ /** * 处理文件夹树节点选中事件 */ - function folderNodeSelect(keys: (string | number)[]) { + function folderNodeSelect(keys: string[]) { [activeFolder.value] = keys; activeFolderType.value = 'module'; } @@ -148,10 +158,37 @@ /** * 处理存储库列表项选中事件 */ - function storageItemSelect(key: string | number) { + function storageItemSelect(key: string) { activeFolder.value = key; activeFolderType.value = 'storage'; } + + /** + * 设置根模块名称列表 + * @param names 根模块名称列表 + */ + function setRootModules(names: string[]) { + rootModulesName.value = names; + } + + const folderTreeRef = ref>(); + /** + * 添加根模块后,若当前展示的是模块,则刷新模块树 + */ + function handleAddRootModuleFinish() { + if (showType.value === 'Module') { + folderTreeRef.value?.initModules(); + } + } + + /** + * 右侧表格数据刷新后,若当前展示的是模块,则刷新模块树的统计数量 + */ + function handleModuleTableInit(params: FileListQueryParams) { + if (showType.value === 'Module') { + folderTreeRef.value?.initModulesCount(params); + } + }