From 716e5ead032c457e8b7b6956c23d3347b4f4ff06 Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 21 Feb 2024 18:43:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95):=20?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=81=94=E8=B0=83&=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/api-test/debug.ts | 14 +- frontend/src/api/requrls/api-test/debug.ts | 2 + .../ms-add-attachment/dropdownMenu.vue | 64 ++++ .../business/ms-add-attachment/index.vue | 211 +++++++++-- .../ms-add-attachment/locale/en-US.ts | 4 + .../ms-add-attachment/locale/zh-CN.ts | 4 + .../business/ms-batch-form/index.vue | 5 +- .../ms-common-script/ms-script-menu.vue | 16 +- .../ms-common-script/scriptDefined.vue | 13 +- .../business/ms-detail-drawer/index.vue | 4 +- .../ms-link-file/associatedFileDrawer.vue | 3 +- .../business/ms-link-file/linkFileTable.vue | 23 +- .../src/components/business/ms-tree/index.vue | 21 ++ .../src/components/business/ms-tree/types.ts | 1 + .../components/pure/ms-code-editor/index.vue | 3 + .../components/pure/ms-tags-input/index.vue | 6 +- frontend/src/config/common.ts | 7 + frontend/src/models/apiTest/debug.ts | 9 +- frontend/src/models/common.ts | 9 + .../api-test/components/condition/content.vue | 13 +- .../views/api-test/components/paramTable.vue | 48 ++- .../components/requestComposition/body.vue | 166 ++++++--- .../components/requestComposition/index.vue | 351 ++++++++++-------- .../components/requestComposition/setting.vue | 4 +- .../api-test/debug/components/moduleTree.vue | 39 +- frontend/src/views/api-test/debug/index.vue | 3 +- .../src/views/api-test/debug/locale/en-US.ts | 2 +- .../src/views/api-test/debug/locale/zh-CN.ts | 2 +- .../setting/system/resourcePool/detail.vue | 11 +- 29 files changed, 780 insertions(+), 278 deletions(-) create mode 100644 frontend/src/components/business/ms-add-attachment/dropdownMenu.vue create mode 100644 frontend/src/components/business/ms-add-attachment/locale/en-US.ts create mode 100644 frontend/src/components/business/ms-add-attachment/locale/zh-CN.ts create mode 100644 frontend/src/config/common.ts diff --git a/frontend/src/api/modules/api-test/debug.ts b/frontend/src/api/modules/api-test/debug.ts index ea8719dbc6..d0f1314544 100644 --- a/frontend/src/api/modules/api-test/debug.ts +++ b/frontend/src/api/modules/api-test/debug.ts @@ -4,6 +4,7 @@ import { AddDebugModuleUrl, DeleteDebugModuleUrl, DeleteDebugUrl, + DragDebugUrl, ExecuteApiDebugUrl, GetApiDebugDetailUrl, GetDebugModuleCountUrl, @@ -11,6 +12,7 @@ import { MoveDebugModuleUrl, UpdateApiDebugUrl, UpdateDebugModuleUrl, + UploadTempFileUrl, } from '@/api/requrls/api-test/debug'; import { @@ -21,7 +23,7 @@ import { UpdateDebugModule, UpdateDebugParams, } from '@/models/apiTest/debug'; -import { ModuleTreeNode, MoveModules } from '@/models/common'; +import { DragSortParams, ModuleTreeNode, MoveModules } from '@/models/common'; // 获取模块树 export function getDebugModules() { @@ -53,6 +55,11 @@ export function getDebugModuleCount(data: { keyword: string }) { return MSR.post({ url: GetDebugModuleCountUrl, data }); } +// 拖拽调试节点 +export function dragDebug(data: DragSortParams) { + return MSR.post({ url: DragDebugUrl, data }); +} + // 执行调试 export function executeDebug(data: ExecuteRequestParams) { return MSR.post({ url: ExecuteApiDebugUrl, data }); @@ -77,3 +84,8 @@ export function getDebugDetail(id: string) { export function deleteDebug(id: string) { return MSR.get({ url: DeleteDebugUrl, params: id }); } + +// 上传文件 +export function uploadTempFile(file: File) { + return MSR.uploadFile({ url: UploadTempFileUrl }, { fileList: [file] }, 'file'); +} diff --git a/frontend/src/api/requrls/api-test/debug.ts b/frontend/src/api/requrls/api-test/debug.ts index 1b9832f2de..6ca31642a5 100644 --- a/frontend/src/api/requrls/api-test/debug.ts +++ b/frontend/src/api/requrls/api-test/debug.ts @@ -9,3 +9,5 @@ export const GetDebugModuleCountUrl = '/api/debug/module/count'; // 模块统计 export const AddDebugModuleUrl = '/api/debug/module/add'; // 添加模块 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'; // 上传文件 diff --git a/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue b/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue new file mode 100644 index 0000000000..3c492b6a1b --- /dev/null +++ b/frontend/src/components/business/ms-add-attachment/dropdownMenu.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index 0d66b62562..491b31f516 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -1,12 +1,12 @@ - + diff --git a/frontend/src/components/business/ms-add-attachment/locale/en-US.ts b/frontend/src/components/business/ms-add-attachment/locale/en-US.ts new file mode 100644 index 0000000000..3576e451b2 --- /dev/null +++ b/frontend/src/components/business/ms-add-attachment/locale/en-US.ts @@ -0,0 +1,4 @@ +export default { + 'ms.add.attachment.localUpload': 'Local upload', + 'ms.add.attachment.associateFile': 'Associate file', +}; diff --git a/frontend/src/components/business/ms-add-attachment/locale/zh-CN.ts b/frontend/src/components/business/ms-add-attachment/locale/zh-CN.ts new file mode 100644 index 0000000000..f4a8e0be7a --- /dev/null +++ b/frontend/src/components/business/ms-add-attachment/locale/zh-CN.ts @@ -0,0 +1,4 @@ +export default { + 'ms.add.attachment.localUpload': '本地上传', + 'ms.add.attachment.associateFile': '关联文件', +}; diff --git a/frontend/src/components/business/ms-batch-form/index.vue b/frontend/src/components/business/ms-batch-form/index.vue index 54b2c238fb..f4601a55f0 100644 --- a/frontend/src/components/business/ms-batch-form/index.vue +++ b/frontend/src/components/business/ms-batch-form/index.vue @@ -52,7 +52,7 @@ diff --git a/frontend/src/components/business/ms-common-script/ms-script-menu.vue b/frontend/src/components/business/ms-common-script/ms-script-menu.vue index 7a5c922d63..f7d204b931 100644 --- a/frontend/src/components/business/ms-common-script/ms-script-menu.vue +++ b/frontend/src/components/business/ms-common-script/ms-script-menu.vue @@ -17,7 +17,7 @@ :placeholder="t('project.commonScript.pleaseSelected')" @change="changeHandler" > - + {{ item.text }} @@ -64,8 +64,8 @@ (e: 'update:languagesType', value: Language): void; (e: 'insert', code: string): void; (e: 'formApiImport'): void; // 从api 定义导入 - (e: 'insertCommonScript'): void; // 从api 定义导入 - (e: 'updateLanguages', value: Language): void; // 从api 定义导入 + (e: 'insertCommonScript'): void; // 插入公共脚本 + (e: 'updateLanguages', value: Language): void; // 更新语言类型 }>(); const innerExpand = useVModel(props, 'expand', emit); @@ -73,11 +73,11 @@ const innerLanguageType = useVModel(props, 'languagesType', emit); const languages = [ - { text: 'beanshellJSR223', value: 'beanshell-jsr233' }, - { text: 'beanshell', value: 'beanshell' }, - { text: 'python', value: 'python' }, - { text: 'groovy', value: 'groovy' }, - { text: 'javascript', value: 'javascript' }, + { text: 'beanshellJSR223', value: RequestConditionScriptLanguage.BEANSHELL_JSR233 }, + { text: 'beanshell', value: RequestConditionScriptLanguage.BEANSHELL }, + { text: 'python', value: RequestConditionScriptLanguage.PYTHON }, + { text: 'groovy', value: RequestConditionScriptLanguage.GROOVY }, + { text: 'javascript', value: RequestConditionScriptLanguage.JAVASCRIPT }, ]; function expandedHandler() { diff --git a/frontend/src/components/business/ms-common-script/scriptDefined.vue b/frontend/src/components/business/ms-common-script/scriptDefined.vue index af011373aa..7191f84c66 100644 --- a/frontend/src/components/business/ms-common-script/scriptDefined.vue +++ b/frontend/src/components/business/ms-common-script/scriptDefined.vue @@ -14,9 +14,9 @@ {{ t('project.commonScript.clear') }} - {{ - t('project.commonScript.formatting') - }} + + {{ t('project.commonScript.formatting') }} +
@@ -179,6 +179,13 @@ ${item.script} function clearCode() { innerCodeValue.value = ''; } + + defineExpose({ + formatCoding, + insertHandler, + undoHandler, + clearCode, + }); diff --git a/frontend/src/components/business/ms-detail-drawer/index.vue b/frontend/src/components/business/ms-detail-drawer/index.vue index a0e0c12f55..663503c94b 100644 --- a/frontend/src/components/business/ms-detail-drawer/index.vue +++ b/frontend/src/components/business/ms-detail-drawer/index.vue @@ -4,11 +4,12 @@ :width="props.width" :footer="false" class="ms-drawer" + :show-full-screen="props.showFullScreen" no-content-padding unmount-on-close >