From b35fdf835593b14ac699962b3bee48f33c755fb1 Mon Sep 17 00:00:00 2001 From: baiqi Date: Mon, 19 Feb 2024 16:02:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95-=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=A0=91=E9=87=8D=E5=91=BD=E5=90=8D&=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=81=E9=83=A8=E5=88=86bug=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 | 6 ++ frontend/src/api/requrls/api-test/debug.ts | 1 + frontend/src/assets/style/arco-reset.less | 4 ++ frontend/src/assets/style/var.less | 2 +- .../src/components/business/ms-menu/index.vue | 2 +- .../ms-personal-drawer/components/apiKey.vue | 14 ++-- .../components/tripartite.vue | 3 +- .../ms-personal-drawer/locale/en-US.ts | 3 +- .../ms-personal-drawer/locale/zh-CN.ts | 3 +- .../src/components/business/ms-tree/index.vue | 2 + .../pure/ms-table-more-action/index.vue | 40 ++++++++++- .../src/components/pure/ms-table/useTable.ts | 3 +- frontend/src/directive/permission/index.ts | 7 +- frontend/src/models/apiTest/debug.ts | 6 +- frontend/src/router/routes/modules/setting.ts | 13 +++- frontend/src/utils/index.ts | 22 ++++++ .../views/api-test/components/popConfirm.vue | 22 +++--- .../components/requestComposition/index.vue | 33 ++++++++- .../api-test/debug/components/moduleTree.vue | 67 ++++++++++++++----- frontend/src/views/api-test/debug/index.vue | 31 ++++++--- .../src/views/api-test/debug/locale/en-US.ts | 2 + .../src/views/api-test/debug/locale/zh-CN.ts | 4 +- .../components/fileDetailDrawer.vue | 16 +++-- .../system/config/components/baseConfig.vue | 41 +++++++----- .../config/components/memoryCleanup.vue | 14 ++-- .../src/views/setting/system/config/index.vue | 25 ++++--- .../system/log/components/logCards.vue | 29 ++++++-- .../src/views/setting/system/user/index.vue | 23 +++++-- 28 files changed, 328 insertions(+), 110 deletions(-) diff --git a/frontend/src/api/modules/api-test/debug.ts b/frontend/src/api/modules/api-test/debug.ts index bdf3e3948a..ea8719dbc6 100644 --- a/frontend/src/api/modules/api-test/debug.ts +++ b/frontend/src/api/modules/api-test/debug.ts @@ -3,6 +3,7 @@ import { AddApiDebugUrl, AddDebugModuleUrl, DeleteDebugModuleUrl, + DeleteDebugUrl, ExecuteApiDebugUrl, GetApiDebugDetailUrl, GetDebugModuleCountUrl, @@ -71,3 +72,8 @@ export function updateDebug(data: UpdateDebugParams) { export function getDebugDetail(id: string) { return MSR.get({ url: GetApiDebugDetailUrl, params: id }); } + +// 删除接口调试 +export function deleteDebug(id: string) { + return MSR.get({ url: DeleteDebugUrl, params: id }); +} diff --git a/frontend/src/api/requrls/api-test/debug.ts b/frontend/src/api/requrls/api-test/debug.ts index 5a8436f3d9..1b9832f2de 100644 --- a/frontend/src/api/requrls/api-test/debug.ts +++ b/frontend/src/api/requrls/api-test/debug.ts @@ -2,6 +2,7 @@ export const ExecuteApiDebugUrl = '/api/debug/debug'; // 执行调试 export const AddApiDebugUrl = '/api/debug/add'; // 新增调试 export const UpdateApiDebugUrl = '/api/debug/update'; // 更新调试 export const GetApiDebugDetailUrl = '/api/debug/get'; // 获取接口调试详情 +export const DeleteDebugUrl = '/api/debug/delete'; // 删除调试 export const UpdateDebugModuleUrl = '/api/debug/module/update'; // 更新模块 export const MoveDebugModuleUrl = '/api/debug/module/move'; // 移动模块 export const GetDebugModuleCountUrl = '/api/debug/module/count'; // 模块统计数量 diff --git a/frontend/src/assets/style/arco-reset.less b/frontend/src/assets/style/arco-reset.less index 44adfc7f36..9f66db7ab0 100644 --- a/frontend/src/assets/style/arco-reset.less +++ b/frontend/src/assets/style/arco-reset.less @@ -215,6 +215,10 @@ } .arco-btn-size-mini { line-height: 16px; + .arco-icon-loading { + font-size: 14px; + line-height: 16px; + } } /** 输入框,选择器,文本域 **/ diff --git a/frontend/src/assets/style/var.less b/frontend/src/assets/style/var.less index 1c207d6ad1..1d4125075c 100644 --- a/frontend/src/assets/style/var.less +++ b/frontend/src/assets/style/var.less @@ -249,7 +249,7 @@ margin-left: -16px !important; border-radius: 0 4px 4px 0 !important; background-color: var(--color-text-n8) !important; - &:hover { + &:hover:not(.arco-select-view-disabled) { border-color: rgb(var(--primary-5)) !important; background-color: var(--color-text-n8) !important; } diff --git a/frontend/src/components/business/ms-menu/index.vue b/frontend/src/components/business/ms-menu/index.vue index 8963d38619..e91ae6d1b4 100644 --- a/frontend/src/components/business/ms-menu/index.vue +++ b/frontend/src/components/business/ms-menu/index.vue @@ -388,7 +388,7 @@ let mouseEnterTimer; // 渲染菜单项 - const renderMenuItem = (element, icon) => + const renderMenuItem = (element: RouteRecordRaw | null, icon) => element?.name === SettingRouteEnum.SETTING_ORGANIZATION ? ( goto(element)}>
diff --git a/frontend/src/components/business/ms-personal-drawer/components/apiKey.vue b/frontend/src/components/business/ms-personal-drawer/components/apiKey.vue index 46294efeea..ffd8ece9ad 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/apiKey.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/apiKey.vue @@ -65,7 +65,7 @@
- {{ t('ms.personal.nodata') }} - {{ - t('common.new') - }} + {{ hasCratePermission ? t('ms.personal.noData') : t('ms.personal.empty') }} + + {{ t('common.new') }} +
@@ -156,6 +156,7 @@ } from '@/api/modules/user/index'; import { useI18n } from '@/hooks/useI18n'; import useModal from '@/hooks/useModal'; + import { hasAnyPermission } from '@/utils/permission'; import { APIKEY } from '@/models/user'; @@ -169,6 +170,7 @@ desensitization: boolean; } const apiKeyList = ref([]); + const hasCratePermission = hasAnyPermission(['SYSTEM_PERSONAL_API_KEY:READ+ADD']); async function initApiKeys() { try { @@ -210,6 +212,7 @@ { label: t('ms.personal.validTime'), eventTag: 'time', + permission: ['SYSTEM_PERSONAL_API_KEY:READ+UPDATE'], }, { isDivider: true, @@ -218,6 +221,7 @@ label: t('common.delete'), danger: true, eventTag: 'delete', + permission: ['SYSTEM_PERSONAL_API_KEY:READ+DELETE'], }, ]; diff --git a/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue b/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue index 7a863a22f8..0c14be2e5e 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/tripartite.vue @@ -14,7 +14,7 @@
-
{{ config.key }}
+
{{ config.name }}
{ dynamicForm.value[key] = { key, + name: res[key].name, status: 0, formModel: {}, formRules: res[key].formItems, diff --git a/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts b/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts index fa70cf2c4a..9cbccac696 100644 --- a/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts +++ b/frontend/src/components/business/ms-personal-drawer/locale/en-US.ts @@ -87,5 +87,6 @@ export default { 'ms.personal.azureTip': 'This information is the user token information for submitting defects through Azure Devops. If not filled in, the default information configured by the organization will be used.', 'ms.personal.azurePlaceholder': 'Please enter Personal Access Tokens', - 'ms.personal.nodata': 'No data yet, please ', + 'ms.personal.noData': 'No data yet, please ', + 'ms.personal.empty': 'No data', }; diff --git a/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts b/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts index 2e1fde0e5d..616060fb6c 100644 --- a/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts +++ b/frontend/src/components/business/ms-personal-drawer/locale/zh-CN.ts @@ -79,5 +79,6 @@ export default { 'ms.personal.zendaoTip': '该信息为通过禅道提交缺陷的的用户名、密码,若未填写,则使用组织配置的默认信息', 'ms.personal.azureTip': '该信息为通过Azure Devops提交缺陷的用户令牌信息,若未填写,则使用组织配置的默认信息', 'ms.personal.azurePlaceholder': '请输入 Personal Access Tokens', - 'ms.personal.nodata': '暂无数据,请 ', + 'ms.personal.noData': '暂无数据,请 ', + 'ms.personal.empty': '暂无数据', }; diff --git a/frontend/src/components/business/ms-tree/index.vue b/frontend/src/components/business/ms-tree/index.vue index e8916bd4fe..ab92e53832 100644 --- a/frontend/src/components/business/ms-tree/index.vue +++ b/frontend/src/components/business/ms-tree/index.vue @@ -355,8 +355,10 @@ diff --git a/frontend/src/views/api-test/debug/locale/en-US.ts b/frontend/src/views/api-test/debug/locale/en-US.ts index 144d8040be..9a57ecef4d 100644 --- a/frontend/src/views/api-test/debug/locale/en-US.ts +++ b/frontend/src/views/api-test/debug/locale/en-US.ts @@ -96,6 +96,8 @@ export default { 'apiTestDebug.deleteFolderTipTitle': 'Remove the `{name}` module?', 'apiTestDebug.deleteFolderTipContent': 'This operation will delete the module and all resources under it, please operate with caution!', + 'apiTestDebug.deleteDebugTipTitle': 'Remove the {name}?', + 'apiTestDebug.deleteDebugTipContent': 'Deletion cannot be restored, please proceed with caution!', 'apiTestDebug.deleteConfirm': 'Confirm delete', 'apiTestDebug.deleteSuccess': 'Successfully deleted', 'apiTestDebug.moduleMoveSuccess': 'Module moved successfully', diff --git a/frontend/src/views/api-test/debug/locale/zh-CN.ts b/frontend/src/views/api-test/debug/locale/zh-CN.ts index 0c085f2eba..b2027d6a3b 100644 --- a/frontend/src/views/api-test/debug/locale/zh-CN.ts +++ b/frontend/src/views/api-test/debug/locale/zh-CN.ts @@ -88,8 +88,10 @@ export default { 'apiTestDebug.extractParameter': '提取参数', 'apiTestDebug.searchTip': '请输入模块/请求名称', 'apiTestDebug.allRequest': '全部请求', - 'apiTestDebug.deleteFolderTipTitle': '是否删除 `{name}` 模块?', + 'apiTestDebug.deleteFolderTipTitle': '是否删除 {name} 模块?', 'apiTestDebug.deleteFolderTipContent': '该操作会删除模块及其下所有资源,请谨慎操作!', + 'apiTestDebug.deleteDebugTipTitle': '是否删除 {name}?', + 'apiTestDebug.deleteDebugTipContent': '删除后无法恢复,请谨慎操作!', 'apiTestDebug.deleteConfirm': '确认删除', 'apiTestDebug.deleteSuccess': '删除成功', 'apiTestDebug.moduleMoveSuccess': '模块移动成功', diff --git a/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue b/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue index c590f86b27..8b5509d6b2 100644 --- a/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue +++ b/frontend/src/views/project-management/fileManagement/components/fileDetailDrawer.vue @@ -276,6 +276,7 @@ const innerVisible = ref(false); const fileDescriptions = ref([]); const detailDrawerRef = ref>(); + const innerFileId = ref(props.fileId); watch( () => props.visible, @@ -293,7 +294,7 @@ async function handleEnableIntercept(newValue: string | number | boolean) { try { - await toggleJarFileStatus(props.fileId, newValue as boolean); + await toggleJarFileStatus(innerFileId.value, newValue as boolean); return true; } catch (error) { // eslint-disable-next-line no-console @@ -332,7 +333,7 @@ fileLoading.value = true; await reuploadFile({ request: { - fileId: props.fileId, + fileId: innerFileId.value, enable: false, }, file: data, @@ -362,7 +363,7 @@ async function addFileTag(val: string, item: Description) { await updateFile({ - id: props.fileId, + id: innerFileId.value, tags: Array.isArray(item.value) ? [...item.value, val] : [item.value, val], }); } @@ -371,7 +372,7 @@ try { const lastTags = Array.isArray(item.value) ? item.value.filter((e) => e !== tag) : []; await updateFile({ - id: props.fileId, + id: innerFileId.value, tags: lastTags, }); item.value = [...lastTags]; @@ -387,7 +388,7 @@ async function upgradeRepositoryFile() { try { fileLoading.value = true; - await updateRepositoryFile(props.fileId); + await updateRepositoryFile(innerFileId.value); Message.success(t('common.updateSuccess')); detailDrawerRef.value?.initDetail(); } catch (error) { @@ -534,18 +535,19 @@ function loadTable() { if (activeTab.value === 'case') { setLoadListParams({ - id: props.fileId, + id: innerFileId.value, }); loadCaseList(); } else { setVersionLoadListParams({ - id: props.fileId, + id: innerFileId.value, }); loadVersionList(); } } function loadedFile(detail: FileDetail) { + innerFileId.value = detail.id; fileType.value = detail.fileType; renameTitle.value = detail.name; fileDescriptions.value = [ diff --git a/frontend/src/views/setting/system/config/components/baseConfig.vue b/frontend/src/views/setting/system/config/components/baseConfig.vue index cd9524a59f..3d0255975a 100644 --- a/frontend/src/views/setting/system/config/components/baseConfig.vue +++ b/frontend/src/views/setting/system/config/components/baseConfig.vue @@ -1,6 +1,6 @@