From 6d5d5217e7a36cd45a8e91e3510de22d0024bc63 Mon Sep 17 00:00:00 2001 From: baiqi Date: Thu, 24 Oct 2024 15:08:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83):=20bu?= =?UTF-8?q?gFix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/enums/tableFilterEnum.ts | 1 + frontend/src/enums/taskCenter.ts | 1 + frontend/src/models/taskCenter.ts | 1 + frontend/src/router/routes/modules/setting.ts | 16 +++-- .../component/caseTaskDetailTable.vue | 41 ++++++----- .../taskCenter/component/caseTaskTable.vue | 18 +++-- .../src/views/taskCenter/component/config.ts | 1 + .../taskCenter/component/systemTaskTable.vue | 69 +++++++++++++------ frontend/src/views/taskCenter/locale/en-US.ts | 4 +- frontend/src/views/taskCenter/locale/zh-CN.ts | 4 +- .../testPlan/components/planTable.vue | 7 +- 11 files changed, 108 insertions(+), 55 deletions(-) diff --git a/frontend/src/enums/tableFilterEnum.ts b/frontend/src/enums/tableFilterEnum.ts index 0ad0e99c2c..3631096c92 100644 --- a/frontend/src/enums/tableFilterEnum.ts +++ b/frontend/src/enums/tableFilterEnum.ts @@ -22,6 +22,7 @@ export enum FilterSlotNameEnum { GLOBAL_TASK_CENTER_EXEC_STATUS = 'GLOBAL_TASK_CENTER_EXEC_STATUS', // 任务中心-执行状态 GLOBAL_TASK_CENTER_EXEC_RESULT = 'GLOBAL_TASK_CENTER_EXEC_RESULT', // 任务中心-执行结果 GLOBAL_TASK_CENTER_EXEC_METHOD = 'GLOBAL_TASK_CENTER_EXEC_METHOD', // 任务中心-执行方式 + GLOBAL_TASK_CENTER_SYSTEM_TASK_TYPE = 'GLOBAL_TASK_CENTER_SYSTEM_TASK_TYPE', // 任务中心-后台任务类型 } export enum FilterRemoteMethodsEnum { diff --git a/frontend/src/enums/taskCenter.ts b/frontend/src/enums/taskCenter.ts index f2b37f9a38..503cc67724 100644 --- a/frontend/src/enums/taskCenter.ts +++ b/frontend/src/enums/taskCenter.ts @@ -47,6 +47,7 @@ export enum SystemTaskType { BUG_SYNC = 'BUG_SYNC', DEMAND_SYNC = 'DEMAND_SYNC', TEST_PLAN = 'TEST_PLAN', + TEST_PLAN_GROUP = 'TEST_PLAN_GROUP', } export enum ExecuteTaskType { diff --git a/frontend/src/models/taskCenter.ts b/frontend/src/models/taskCenter.ts index d30793d7e7..8344e2386d 100644 --- a/frontend/src/models/taskCenter.ts +++ b/frontend/src/models/taskCenter.ts @@ -13,6 +13,7 @@ export interface TaskCenterSystemTaskItem { resourceId: string; // 资源ID num: number; resourceType: string; // 资源类型 + resourceNum: number; // 资源num value: string; nextTime: number; enable: boolean; diff --git a/frontend/src/router/routes/modules/setting.ts b/frontend/src/router/routes/modules/setting.ts index d38112ba5a..2e5deb3b95 100644 --- a/frontend/src/router/routes/modules/setting.ts +++ b/frontend/src/router/routes/modules/setting.ts @@ -25,13 +25,16 @@ const Setting: AppRouteRecordRaw = { 'SYSTEM_AUTH:READ', 'SYSTEM_PLUGIN:READ', 'SYSTEM_LOG:READ', + 'SYSTEM_CASE_TASK_CENTER:READ', + 'SYSTEM_SCHEDULE_TASK_CENTER:READ', 'ORGANIZATION_MEMBER:READ', 'ORGANIZATION_USER_ROLE:READ', 'ORGANIZATION_PROJECT:READ', 'SYSTEM_SERVICE_INTEGRATION:READ', 'ORGANIZATION_TEMPLATE:READ', 'ORGANIZATION_LOG:READ', - 'SYSTEM_TASK_CENTER:READ', + 'ORGANIZATION_CASE_TASK_CENTER:READ', + 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ', ], }, children: [ @@ -54,7 +57,8 @@ const Setting: AppRouteRecordRaw = { 'SYSTEM_AUTH:READ', 'SYSTEM_PLUGIN:READ', 'SYSTEM_LOG:READ', - 'SYSTEM_TASK_CENTER:READ', + 'SYSTEM_CASE_TASK_CENTER:READ', + 'SYSTEM_SCHEDULE_TASK_CENTER:READ', ], hideChildrenInMenu: true, }, @@ -143,7 +147,7 @@ const Setting: AppRouteRecordRaw = { component: () => import('@/views/setting/system/taskCenter/index.vue'), meta: { locale: 'menu.projectManagement.taskCenter', - roles: [' SYSTEM_CASE_TASK_CENTER:READ'], + roles: ['SYSTEM_CASE_TASK_CENTER:READ', 'SYSTEM_SCHEDULE_TASK_CENTER:READ'], isTopMenu: true, }, }, @@ -193,8 +197,8 @@ const Setting: AppRouteRecordRaw = { 'SYSTEM_SERVICE_INTEGRATION:READ', 'ORGANIZATION_TEMPLATE:READ', 'ORGANIZATION_LOG:READ', - 'ORGANIZATION_TASK_CENTER:READ', - 'ORGANIZATION_TASK_CENTER:READ', + 'ORGANIZATION_CASE_TASK_CENTER:READ', + 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ', ], hideChildrenInMenu: true, }, @@ -406,7 +410,7 @@ const Setting: AppRouteRecordRaw = { component: () => import('@/views/setting/organization/taskCenter/index.vue'), meta: { locale: 'menu.projectManagement.taskCenter', - roles: ['ORGANIZATION_CASE_TASK_CENTER:READ'], + roles: ['ORGANIZATION_CASE_TASK_CENTER:READ', 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ'], isTopMenu: true, }, }, diff --git a/frontend/src/views/taskCenter/component/caseTaskDetailTable.vue b/frontend/src/views/taskCenter/component/caseTaskDetailTable.vue index 10ee1ee35a..bb249744b1 100644 --- a/frontend/src/views/taskCenter/component/caseTaskDetailTable.vue +++ b/frontend/src/views/taskCenter/component/caseTaskDetailTable.vue @@ -135,6 +135,7 @@ import useTableStore from '@/hooks/useTableStore'; import { useAppStore } from '@/store'; import { characterLimit, mapTree } from '@/utils'; + import { hasAnyPermission } from '@/utils/permission'; import { TaskCenterTaskDetailItem } from '@/models/taskCenter'; import { TableKeyEnum } from '@/enums/tableEnum'; @@ -307,29 +308,32 @@ ]; if (props.type === 'system') { - columns.splice(2, 0, [ + columns.splice( + 2, + 0, { title: 'common.belongProject', - dataIndex: 'belongProject', + dataIndex: 'projectName', showTooltip: true, - width: 100, + width: 200, + showDrag: true, }, { title: 'common.belongOrg', - dataIndex: 'belongOrg', + dataIndex: 'organizationName', showTooltip: true, - width: 100, - }, - ]); + width: 200, + showDrag: true, + } + ); } else if (props.type === 'org') { - columns.splice(2, 0, [ - { - title: 'common.belongProject', - dataIndex: 'belongProject', - showTooltip: true, - width: 100, - }, - ]); + columns.splice(2, 0, { + title: 'common.belongProject', + dataIndex: 'projectName', + showTooltip: true, + width: 200, + showDrag: true, + }); } function getCurrentPermission(action: 'STOP') { @@ -371,7 +375,7 @@ { tableKey: TableKeyEnum.TASK_CENTER_CASE_TASK_DETAIL, scroll: { x: '1000px' }, - selectable: true, + selectable: hasAnyPermission([getCurrentPermission('STOP')]), heightUsed: 288, showSetting: true, size: 'default', @@ -581,7 +585,10 @@ const queue = res[item.id]; if (queue) { item.lineNum = queue; - } else if ([ExecuteStatusEnum.COMPLETED, ExecuteStatusEnum.STOPPED].includes(item.status)) { + } else if ( + [ExecuteStatusEnum.COMPLETED, ExecuteStatusEnum.STOPPED].includes(item.status) || + !item.resourcePoolNode + ) { item.lineNum = '-'; } else { item.lineNum = t('ms.taskCenter.waitQueue'); diff --git a/frontend/src/views/taskCenter/component/caseTaskTable.vue b/frontend/src/views/taskCenter/component/caseTaskTable.vue index 53f54d0348..5d0438645e 100644 --- a/frontend/src/views/taskCenter/component/caseTaskTable.vue +++ b/frontend/src/views/taskCenter/component/caseTaskTable.vue @@ -212,6 +212,7 @@ import useTableStore from '@/hooks/useTableStore'; import useAppStore from '@/store/modules/app'; import { characterLimit } from '@/utils'; + import { hasAnyPermission } from '@/utils/permission'; import { TaskCenterTaskItem } from '@/models/taskCenter'; import { ReportEnum } from '@/enums/reportEnum'; @@ -376,23 +377,26 @@ 0, { title: 'common.belongProject', - dataIndex: 'belongProject', + dataIndex: 'projectName', showTooltip: true, - width: 100, + showDrag: true, + width: 200, }, { title: 'common.belongOrg', - dataIndex: 'belongOrg', + dataIndex: 'organizationName', showTooltip: true, - width: 100, + showDrag: true, + width: 200, } ); } else if (props.type === 'org') { columns.splice(2, 0, { title: 'common.belongProject', - dataIndex: 'belongProject', + dataIndex: 'projectName', showTooltip: true, - width: 100, + showDrag: true, + width: 200, }); } @@ -448,7 +452,7 @@ { tableKey: TableKeyEnum.TASK_CENTER_CASE_TASK, scroll: { x: '1000px' }, - selectable: true, + selectable: hasAnyPermission([getCurrentPermission('STOP'), getCurrentPermission('DELETE')]), showSetting: true, showPagination: true, }, diff --git a/frontend/src/views/taskCenter/component/config.ts b/frontend/src/views/taskCenter/component/config.ts index d924f986f2..e7029f448f 100644 --- a/frontend/src/views/taskCenter/component/config.ts +++ b/frontend/src/views/taskCenter/component/config.ts @@ -87,4 +87,5 @@ export const scheduleTaskTypeMap: Record = { BUG_SYNC: 'ms.taskCenter.thirdPartSync', DEMAND_SYNC: 'ms.taskCenter.thirdPartSync', TEST_PLAN: 'menu.testPlan', + TEST_PLAN_GROUP: 'menu.testPlanGroup', }; diff --git a/frontend/src/views/taskCenter/component/systemTaskTable.vue b/frontend/src/views/taskCenter/component/systemTaskTable.vue index 4ac0f4cb38..6a675c73f2 100644 --- a/frontend/src/views/taskCenter/component/systemTaskTable.vue +++ b/frontend/src/views/taskCenter/component/systemTaskTable.vue @@ -34,11 +34,15 @@ v-model:model-value="record.enable" size="small" :before-change="() => handleBeforeEnableChange(record)" + :disabled="!hasAnyPermission([getCurrentPermission('EDIT')])" > +