From 569ed4c9330cc7aca2cb7c462c6f02a13b92eb46 Mon Sep 17 00:00:00 2001 From: baiqi Date: Sun, 3 Mar 2024 13:45:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E7=BB=84=E4=BB=B6):=20=E6=96=B0=E5=A2=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=BD=AC=E5=AD=98=E5=8A=9F=E8=83=BD&=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=AB=98=E4=BC=98=E5=85=88=E7=BA=A7bug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.eslintrc.js | 2 +- frontend/src/api/modules/api-test/debug.ts | 14 +- frontend/src/api/modules/setting/user.ts | 6 + frontend/src/api/requrls/api-test/debug.ts | 2 + frontend/src/api/requrls/setting/user.ts | 2 + .../ms-add-attachment/dropdownMenu.vue | 3 +- .../business/ms-add-attachment/index.vue | 116 +++-- .../ms-add-attachment/locale/en-US.ts | 4 + .../ms-add-attachment/locale/zh-CN.ts | 4 + .../ms-add-attachment/saveAsFilePopover.vue | 169 +++++++ .../ms-common-script/scriptDefined.vue | 48 +- .../ms-personal-drawer/locale/zh-CN.ts | 2 +- .../components/business/ms-select/index.tsx | 2 +- .../src/components/pure/ms-card/index.vue | 25 +- .../components/pure/ms-code-editor/index.vue | 19 +- .../components/pure/ms-code-editor/types.ts | 2 +- .../components/pure/ms-menu-panel/index.vue | 2 +- .../pure/ms-table-more-action/index.vue | 2 +- .../src/components/pure/ms-upload/index.vue | 38 +- frontend/src/enums/apiEnum.ts | 10 +- frontend/src/hooks/useFullScreen.ts | 2 +- frontend/src/models/apiTest/common.ts | 53 +- frontend/src/models/apiTest/debug.ts | 7 +- frontend/src/models/apiTest/management.ts | 66 +++ .../src/models/caseManagement/featureCase.ts | 2 - frontend/src/models/common.ts | 9 + .../api-test/components/condition/content.vue | 14 +- .../views/api-test/components/paramTable.vue | 36 +- .../views/api-test/components/popConfirm.vue | 2 + .../components/requestComposition/body.vue | 17 +- .../components/requestComposition/index.vue | 21 +- .../requestComposition/response/edit.vue | 453 +++++++++++++++++- .../requestComposition/response/index.vue | 227 ++------- .../requestComposition/response/result.vue | 27 +- .../src/views/api-test/components/utils.ts | 4 +- .../api-test/debug/components/moduleTree.vue | 14 +- frontend/src/views/api-test/debug/index.vue | 5 + .../components/management/api/index.vue | 20 + .../views/api-test/management/locale/zh-CN.ts | 2 + frontend/src/views/base/invite/index.vue | 31 +- frontend/src/views/base/locale/en-US.ts | 1 + frontend/src/views/base/locale/zh-CN.ts | 1 + .../components/caseTemplateDetail.vue | 2 +- .../components/fileDetailDrawer.vue | 12 +- .../fileManagement/components/folderTree.vue | 6 +- .../fileManagement/components/storageList.vue | 2 + .../fileManagement/index.vue | 13 +- .../components/messageList.vue | 5 +- .../components/robotList.vue | 6 +- .../system/log/components/logCards.vue | 5 +- .../setting/system/resourcePool/detail.vue | 23 +- .../src/views/setting/system/user/index.vue | 4 +- 52 files changed, 1148 insertions(+), 416 deletions(-) create mode 100644 frontend/src/components/business/ms-add-attachment/saveAsFilePopover.vue create mode 100644 frontend/src/models/apiTest/management.ts diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 7a6879be0c..449b38aea7 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -64,7 +64,7 @@ module.exports = { tsx: 'never', }, ], - 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'no-debugger': 2, 'no-param-reassign': 0, 'prefer-regex-literals': 0, 'import/no-extraneous-dependencies': 0, diff --git a/frontend/src/api/modules/api-test/debug.ts b/frontend/src/api/modules/api-test/debug.ts index 1e0adedd09..418ba9f7c3 100644 --- a/frontend/src/api/modules/api-test/debug.ts +++ b/frontend/src/api/modules/api-test/debug.ts @@ -12,6 +12,8 @@ import { LocalExecuteApiDebugUrl, MoveDebugModuleUrl, TestMockUrl, + TransferFileUrl, + TransferOptionsUrl, UpdateApiDebugUrl, UpdateDebugModuleUrl, UploadTempFileUrl, @@ -25,7 +27,7 @@ import { UpdateDebugModule, UpdateDebugParams, } from '@/models/apiTest/debug'; -import { DragSortParams, ModuleTreeNode, MoveModules } from '@/models/common'; +import { DragSortParams, ModuleTreeNode, MoveModules, TransferFileParams } from '@/models/common'; // 获取模块树 export function getDebugModules() { @@ -101,3 +103,13 @@ export function testMock(key: string) { export function uploadTempFile(file: File) { return MSR.uploadFile({ url: UploadTempFileUrl }, { fileList: [file] }, 'file'); } + +// 文件转存 +export function transferFile(data: TransferFileParams) { + return MSR.post({ url: TransferFileUrl, data }); +} + +// 文件转存目录 +export function getTransferOptions(projectId: string) { + return MSR.get({ url: TransferOptionsUrl, params: projectId }); +} diff --git a/frontend/src/api/modules/setting/user.ts b/frontend/src/api/modules/setting/user.ts index f77436da6f..0972c8aab4 100644 --- a/frontend/src/api/modules/setting/user.ts +++ b/frontend/src/api/modules/setting/user.ts @@ -16,6 +16,7 @@ import { RegisterByInviteUrl, ResetPasswordUrl, UpdateUserUrl, + ValidInviteUrl, } from '@/api/requrls/setting/user'; import type { CommonList, TableQueryParams } from '@/models/common'; @@ -118,3 +119,8 @@ export function inviteUser(data: InviteUserParams) { export function registerByInvite(data: RegisterByInviteParams) { return MSR.post({ url: RegisterByInviteUrl, data }); } + +// 检查邀请链接是否过期 +export function validInvite(id: string) { + return MSR.get({ url: ValidInviteUrl, params: id }); +} diff --git a/frontend/src/api/requrls/api-test/debug.ts b/frontend/src/api/requrls/api-test/debug.ts index 67897858c0..2d85cef007 100644 --- a/frontend/src/api/requrls/api-test/debug.ts +++ b/frontend/src/api/requrls/api-test/debug.ts @@ -13,3 +13,5 @@ export const GetDebugModulesUrl = '/api/debug/module/tree'; // 查询模块树 export const DeleteDebugModuleUrl = '/api/debug/module/delete'; // 删除模块 export const DragDebugUrl = '/api/debug/edit/pos'; // 拖拽调试节点 export const UploadTempFileUrl = '/api/debug/upload/temp/file'; // 上传文件 +export const TransferOptionsUrl = '/api/debug/transfer/options'; // 文件转存目录 +export const TransferFileUrl = '/api/debug/transfer'; // 文件转存 diff --git a/frontend/src/api/requrls/setting/user.ts b/frontend/src/api/requrls/setting/user.ts index eb5afbd66e..0c67c55ca9 100644 --- a/frontend/src/api/requrls/setting/user.ts +++ b/frontend/src/api/requrls/setting/user.ts @@ -30,3 +30,5 @@ export const GetProjectsUrl = '/system/user/get/project'; export const RegisterByInviteUrl = '/system/user/register-by-invite'; // 邀请用户 export const InviteUserUrl = '/system/user/invite'; +// 检查邀请链接是否过期 +export const ValidInviteUrl = '/system/user/check-invite'; diff --git a/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue b/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue index 89f9a13c95..5beb9094c1 100644 --- a/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue +++ b/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue @@ -49,12 +49,13 @@ const { t } = useI18n(); const innerFileList = defineModel('fileList', { - required: true, + default: () => [], }); const dropdownVisible = ref(false); function handleChange(_fileList: MsFileItem[], fileItem: MsFileItem) { + fileItem.local = true; emit('change', _fileList, fileItem); nextTick(() => { // emit 完文件之后再关闭菜单 diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index fc60c939ad..181b4b4deb 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -9,20 +9,21 @@ {{ t('system.orgTemplate.addAttachment') }}