fix(任务中心): bugFix

This commit is contained in:
baiqi 2024-10-23 17:19:14 +08:00 committed by Craftsman
parent 307f58d36f
commit b5a8bd541f
16 changed files with 81 additions and 56 deletions

View File

@ -78,7 +78,7 @@ export function organizationTaskOrder(data: string[]) {
// 组织任务-批量停止任务 // 组织任务-批量停止任务
export function organizationBatchStopTask(data: TaskCenterBatchParams) { export function organizationBatchStopTask(data: TaskCenterBatchParams) {
return MSR.get({ url: organizationBatchStopTaskUrl, data }); return MSR.post({ url: organizationBatchStopTaskUrl, data });
} }
// 组织任务-用例任务详情-停止任务 // 组织任务-用例任务详情-停止任务

View File

@ -85,7 +85,7 @@ export function projectTaskOrder(data: string[]) {
// 项目任务-批量停止任务 // 项目任务-批量停止任务
export function projectBatchStopTask(data: TaskCenterBatchParams) { export function projectBatchStopTask(data: TaskCenterBatchParams) {
return MSR.get({ url: projectBatchStopTaskUrl, data }); return MSR.post({ url: projectBatchStopTaskUrl, data });
} }
// 项目任务-用例任务详情-停止任务 // 项目任务-用例任务详情-停止任务

View File

@ -75,7 +75,7 @@ export function systemStopTask(id: string) {
// 系统任务-批量停止任务 // 系统任务-批量停止任务
export function systemBatchStopTask(data: TaskCenterBatchParams) { export function systemBatchStopTask(data: TaskCenterBatchParams) {
return MSR.get({ url: systemBatchStopTaskUrl, data }); return MSR.post({ url: systemBatchStopTaskUrl, data });
} }
// 系统任务-用例任务详情-停止任务 // 系统任务-用例任务详情-停止任务

View File

@ -201,6 +201,7 @@ export default {
'common.completed': 'Completed', 'common.completed': 'Completed',
'common.config': 'Config', 'common.config': 'Config',
'common.executionResult': 'Execution result', 'common.executionResult': 'Execution result',
'common.executionResultCleaned': 'Execution results are cleaned',
'common.expandAllSubModule': 'Expand all submodules', 'common.expandAllSubModule': 'Expand all submodules',
'common.collapseAllSubModule': 'Collapse all submodules', 'common.collapseAllSubModule': 'Collapse all submodules',
'common.selectedCount': '{count} data selected', 'common.selectedCount': '{count} data selected',

View File

@ -185,6 +185,7 @@ export default {
'common.belongModule': '所属模块', 'common.belongModule': '所属模块',
'common.moreSetting': '更多设置', 'common.moreSetting': '更多设置',
'common.executionResult': '执行结果', 'common.executionResult': '执行结果',
'common.executionResultCleaned': '执行结果被清理',
'common.detail': '详情', 'common.detail': '详情',
'common.baseInfo': '基本信息', 'common.baseInfo': '基本信息',
'common.remark': '备注', 'common.remark': '备注',

View File

@ -46,7 +46,7 @@
</template> </template>
<template #operation="{ record, rowIndex }"> <template #operation="{ record, rowIndex }">
<div v-if="record.historyDeleted"> <div v-if="record.historyDeleted">
<a-tooltip :content="t('project.executionHistory.cleared')" position="top"> <a-tooltip :content="t('common.executionResultCleaned')" position="top">
<MsButton <MsButton
:disabled=" :disabled="
record.historyDeleted || record.historyDeleted ||

View File

@ -36,7 +36,7 @@
</template> </template>
<template #operation="{ record }"> <template #operation="{ record }">
<div v-if="record.historyDeleted"> <div v-if="record.historyDeleted">
<a-tooltip :content="t('project.executionHistory.cleared')" position="top"> <a-tooltip :content="t('common.executionResultCleaned')" position="top">
<MsButton <MsButton
:disabled=" :disabled="
record.historyDeleted || record.historyDeleted ||

View File

@ -93,7 +93,6 @@
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import { TaskCenterTaskItem } from '@/models/taskCenter'; import { TaskCenterTaskItem } from '@/models/taskCenter';
import { ReportExecStatus } from '@/enums/apiEnum';
import { ReportEnum, ReportStatus, TriggerModeLabel } from '@/enums/reportEnum'; import { ReportEnum, ReportStatus, TriggerModeLabel } from '@/enums/reportEnum';
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum'; import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { ExecuteTaskType } from '@/enums/taskCenter'; import { ExecuteTaskType } from '@/enums/taskCenter';
@ -136,14 +135,6 @@
}); });
}); });
const ExecStatusList = computed(() => {
return Object.values(ReportExecStatus).map((e) => {
return {
value: e,
key: e,
};
});
});
const columns: MsTableColumn = [ const columns: MsTableColumn = [
{ {
title: 'report.name', title: 'report.name',
@ -178,21 +169,6 @@
showInTable: true, showInTable: true,
width: 120, width: 120,
}, },
{
title: 'report.status',
dataIndex: 'execStatus',
slotName: 'execStatus',
filterConfig: {
options: ExecStatusList.value,
filterSlotName: FilterSlotNameEnum.API_TEST_CASE_API_REPORT_EXECUTE_RESULT,
},
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
showInTable: true,
width: 120,
},
{ {
title: 'report.trigger.mode', title: 'report.trigger.mode',
dataIndex: 'triggerMode', dataIndex: 'triggerMode',

View File

@ -109,7 +109,9 @@
}, },
{ {
label: t('ms.taskCenter.executeEnvInfo'), label: t('ms.taskCenter.executeEnvInfo'),
value: `${res.environmentName} ${res.resourcePoolName} ${res.resourcePoolNode}`, value: `${res.environmentName || t('ms.taskCenter.defaultResourcePool')} ${res.resourcePoolName} ${
res.resourcePoolNode
}`,
class: '!w-[calc(100%/3*2)]', class: '!w-[calc(100%/3*2)]',
}, },
{ {

View File

@ -161,7 +161,7 @@
const columns: MsTableColumn = [ const columns: MsTableColumn = [
{ {
title: t('ms.taskCenter.taskID'), title: 'ms.taskCenter.taskID',
dataIndex: 'num', dataIndex: 'num',
width: 100, width: 100,
columnSelectorDisabled: true, columnSelectorDisabled: true,
@ -174,6 +174,7 @@
showTooltip: true, showTooltip: true,
width: 200, width: 200,
fixed: 'left', fixed: 'left',
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeStatus', title: 'ms.taskCenter.executeStatus',
@ -191,6 +192,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeMethod', title: 'ms.taskCenter.executeMethod',
@ -208,6 +210,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeResult', title: 'ms.taskCenter.executeResult',
@ -226,29 +229,34 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.resourcePool', title: 'ms.taskCenter.resourcePool',
dataIndex: 'resourcePoolName', dataIndex: 'resourcePoolName',
isStringTag: true, isStringTag: true,
isTag: true, isTag: true,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.node', title: 'ms.taskCenter.node',
dataIndex: 'resourcePoolNode', dataIndex: 'resourcePoolNode',
slotName: 'resourcePoolNode', slotName: 'resourcePoolNode',
width: 180, width: 180,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.queue', title: 'ms.taskCenter.queue',
dataIndex: 'lineNum', dataIndex: 'lineNum',
width: 100, width: 100,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.threadID', title: 'ms.taskCenter.threadID',
dataIndex: 'threadId', dataIndex: 'threadId',
showTooltip: true, showTooltip: true,
width: 190, width: 190,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.startExecuteTime', title: 'ms.taskCenter.startExecuteTime',
@ -258,6 +266,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.endExecuteTime', title: 'ms.taskCenter.endExecuteTime',
@ -267,12 +276,14 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.operationUser', title: 'ms.taskCenter.operationUser',
dataIndex: 'userName', dataIndex: 'userName',
width: 100, width: 100,
showTooltip: true, showTooltip: true,
showDrag: true,
}, },
{ {
title: 'common.operation', title: 'common.operation',
@ -328,6 +339,7 @@
{ {
label: 'common.stop', label: 'common.stop',
eventTag: 'stop', eventTag: 'stop',
anyPermission: [getCurrentPermission('STOP')],
}, },
// { // {
// label: 'ms.taskCenter.rerun', // label: 'ms.taskCenter.rerun',

View File

@ -241,7 +241,7 @@
const batchModalParams = ref(); const batchModalParams = ref();
const columns: MsTableColumn = [ const columns: MsTableColumn = [
{ {
title: 'ID', title: 'ms.taskCenter.taskID',
dataIndex: 'num', dataIndex: 'num',
slotName: 'num', slotName: 'num',
width: 100, width: 100,
@ -254,6 +254,7 @@
showTooltip: true, showTooltip: true,
width: 200, width: 200,
fixed: 'left', fixed: 'left',
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeStatus', title: 'ms.taskCenter.executeStatus',
@ -271,6 +272,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeMethod', title: 'ms.taskCenter.executeMethod',
@ -288,6 +290,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeResult', title: 'ms.taskCenter.executeResult',
@ -306,17 +309,20 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.caseCount', title: 'ms.taskCenter.caseCount',
dataIndex: 'caseCount', dataIndex: 'caseCount',
width: 90, width: 90,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.executeFinishedRate', title: 'ms.taskCenter.executeFinishedRate',
dataIndex: 'executeRate', dataIndex: 'executeRate',
slotName: 'executeRate', slotName: 'executeRate',
width: 100, width: 100,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.createTime', title: 'ms.taskCenter.createTime',
@ -326,6 +332,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.startTime', title: 'ms.taskCenter.startTime',
@ -335,6 +342,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.endTime', title: 'ms.taskCenter.endTime',
@ -344,12 +352,14 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.operationUser', title: 'ms.taskCenter.operationUser',
dataIndex: 'createUserName', dataIndex: 'createUserName',
width: 100, width: 100,
showTooltip: true, showTooltip: true,
showDrag: true,
}, },
{ {
title: 'common.operation', title: 'common.operation',
@ -420,6 +430,7 @@
{ {
label: 'common.stop', label: 'common.stop',
eventTag: 'stop', eventTag: 'stop',
anyPermission: [getCurrentPermission('STOP')],
}, },
// { // {
// label: 'ms.taskCenter.rerun', // label: 'ms.taskCenter.rerun',
@ -428,6 +439,7 @@
{ {
label: 'common.delete', label: 'common.delete',
eventTag: 'delete', eventTag: 'delete',
anyPermission: [getCurrentPermission('DELETE')],
}, },
], ],
}; };
@ -704,7 +716,8 @@
const reportBatchType = ref<ExecuteTaskType>(ExecuteTaskType.API_CASE); const reportBatchType = ref<ExecuteTaskType>(ExecuteTaskType.API_CASE);
const reportBatchTaskId = ref(''); const reportBatchTaskId = ref('');
function checkReport(record: TaskCenterTaskItem) { function checkReport(record: TaskCenterTaskItem) {
if (record.taskType.includes('BATCH')) { if (record.taskType.includes('BATCH') && record.integrated !== true) {
// integrated true
reportModuleType.value = record.taskType.includes('CASE') reportModuleType.value = record.taskType.includes('CASE')
? ReportEnum.API_REPORT ? ReportEnum.API_REPORT
: ReportEnum.API_SCENARIO_REPORT; : ReportEnum.API_SCENARIO_REPORT;
@ -718,7 +731,8 @@
ExecuteTaskType.API_SCENARIO, ExecuteTaskType.API_SCENARIO,
ExecuteTaskType.TEST_PLAN_API_CASE, ExecuteTaskType.TEST_PLAN_API_CASE,
ExecuteTaskType.TEST_PLAN_API_SCENARIO, ExecuteTaskType.TEST_PLAN_API_SCENARIO,
].includes(record.taskType) ].includes(record.taskType) ||
record.integrated === true
) { ) {
showReportDetail(record); showReportDetail(record);
} else if ([ExecuteTaskType.TEST_PLAN_GROUP, ExecuteTaskType.TEST_PLAN].includes(record.taskType)) { } else if ([ExecuteTaskType.TEST_PLAN_GROUP, ExecuteTaskType.TEST_PLAN].includes(record.taskType)) {

View File

@ -115,7 +115,9 @@
}, },
{ {
label: t('ms.taskCenter.executeEnvInfo'), label: t('ms.taskCenter.executeEnvInfo'),
value: `${res.environmentName} ${res.poolName} ${res.resourcePoolNode}`, value: `${res.environmentName || t('ms.taskCenter.defaultResourcePool')} ${res.poolName} ${
res.resourcePoolNode
}`,
class: '!w-[calc(100%/3*2)]', class: '!w-[calc(100%/3*2)]',
}, },
{ {

View File

@ -72,7 +72,12 @@
import MsCronSelect from '@/components/pure/ms-cron-select/index.vue'; import MsCronSelect from '@/components/pure/ms-cron-select/index.vue';
import MsIcon from '@/components/pure/ms-icon-font/index.vue'; import MsIcon from '@/components/pure/ms-icon-font/index.vue';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue'; import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import type { BatchActionParams, BatchActionQueryParams, MsTableColumn } from '@/components/pure/ms-table/type'; import type {
BatchActionConfig,
BatchActionParams,
BatchActionQueryParams,
MsTableColumn,
} from '@/components/pure/ms-table/type';
import useTable from '@/components/pure/ms-table/useTable'; import useTable from '@/components/pure/ms-table/useTable';
import MsTag from '@/components/pure/ms-tag/ms-tag.vue'; import MsTag from '@/components/pure/ms-tag/ms-tag.vue';
@ -130,7 +135,7 @@
const batchModalParams = ref(); const batchModalParams = ref();
const columns: MsTableColumn = [ const columns: MsTableColumn = [
{ {
title: 'ID', title: 'ms.taskCenter.taskID',
dataIndex: 'num', dataIndex: 'num',
slotName: 'num', slotName: 'num',
width: 100, width: 100,
@ -142,30 +147,35 @@
showTooltip: true, showTooltip: true,
width: 200, width: 200,
fixed: 'left', fixed: 'left',
showDrag: true,
}, },
{ {
title: 'common.status', title: 'common.status',
dataIndex: 'status', dataIndex: 'status',
slotName: 'status', slotName: 'status',
width: 50, width: 50,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.type', title: 'ms.taskCenter.type',
dataIndex: 'resourceType', dataIndex: 'resourceType',
slotName: 'resourceType', slotName: 'resourceType',
width: 120, width: 120,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.runRule', title: 'ms.taskCenter.runRule',
slotName: 'runRule', slotName: 'runRule',
dataIndex: 'value', dataIndex: 'value',
width: 220, width: 220,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.operationUser', title: 'ms.taskCenter.operationUser',
dataIndex: 'createUserName', dataIndex: 'createUserName',
width: 150, width: 150,
showTooltip: true, showTooltip: true,
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.operationTime', title: 'ms.taskCenter.operationTime',
@ -175,6 +185,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.lastFinishTime', title: 'ms.taskCenter.lastFinishTime',
@ -184,6 +195,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'ms.taskCenter.nextExecuteTime', title: 'ms.taskCenter.nextExecuteTime',
@ -193,6 +205,7 @@
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
sorter: true, sorter: true,
}, },
showDrag: true,
}, },
{ {
title: 'common.operation', title: 'common.operation',
@ -230,15 +243,34 @@
await tableStore.initColumn(TableKeyEnum.TASK_CENTER_SYSTEM_TASK, columns, 'drawer'); await tableStore.initColumn(TableKeyEnum.TASK_CENTER_SYSTEM_TASK, columns, 'drawer');
const tableBatchActions = { function getCurrentPermission(action: 'DELETE' | 'EDIT') {
return {
system: {
DELETE: 'SYSTEM_SCHEDULE_TASK_CENTER:READ+DELETE',
EDIT: 'SYSTEM_SCHEDULE_TASK_CENTER:READ+UPDATE',
},
org: {
DELETE: 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ+DELETE',
EDIT: 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ+UPDATE',
},
project: {
DELETE: 'PROJECT_SCHEDULE_TASK_CENTER:READ+DELETE',
EDIT: 'PROJECT_SCHEDULE_TASK_CENTER:READ+UPDATE',
},
}[props.type][action];
}
const tableBatchActions: BatchActionConfig = {
baseAction: [ baseAction: [
{ {
label: 'common.open', label: 'common.open',
eventTag: 'open', eventTag: 'open',
anyPermission: [getCurrentPermission('EDIT')],
}, },
{ {
label: 'common.close', label: 'common.close',
eventTag: 'close', eventTag: 'close',
anyPermission: [getCurrentPermission('EDIT')],
}, },
], ],
}; };
@ -270,23 +302,6 @@
} }
); );
function getCurrentPermission(action: 'DELETE' | 'EDIT') {
return {
system: {
DELETE: 'SYSTEM_SCHEDULE_TASK_CENTER:READ+DELETE',
EDIT: 'SYSTEM_SCHEDULE_TASK_CENTER:READ+UPDATE',
},
org: {
DELETE: 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ+DELETE',
EDIT: 'ORGANIZATION_SCHEDULE_TASK_CENTER:READ+UPDATE',
},
project: {
DELETE: 'PROJECT_SCHEDULE_TASK_CENTER:READ+DELETE',
EDIT: 'PROJECT_SCHEDULE_TASK_CENTER:READ+UPDATE',
},
}[props.type][action];
}
function searchTask() { function searchTask() {
setLoadListParams({ keyword: keyword.value }); setLoadListParams({ keyword: keyword.value });
loadList(); loadList();

View File

@ -25,6 +25,7 @@ export default {
'ms.taskCenter.executeProgress': 'Execution Progress', 'ms.taskCenter.executeProgress': 'Execution Progress',
'ms.taskCenter.taskID': 'Task ID', 'ms.taskCenter.taskID': 'Task ID',
'ms.taskCenter.resourcePool': 'Resource Pool', 'ms.taskCenter.resourcePool': 'Resource Pool',
'ms.taskCenter.defaultResourcePool': 'Default Resource Pool',
'ms.taskCenter.node': 'Node', 'ms.taskCenter.node': 'Node',
'ms.taskCenter.nodeErrorTip': 'Node has an exception, please check', 'ms.taskCenter.nodeErrorTip': 'Node has an exception, please check',
'ms.taskCenter.queue': 'Queue', 'ms.taskCenter.queue': 'Queue',

View File

@ -25,6 +25,7 @@ export default {
'ms.taskCenter.executeProgress': '执行进度', 'ms.taskCenter.executeProgress': '执行进度',
'ms.taskCenter.taskID': '任务 ID', 'ms.taskCenter.taskID': '任务 ID',
'ms.taskCenter.resourcePool': '资源池', 'ms.taskCenter.resourcePool': '资源池',
'ms.taskCenter.defaultResourcePool': '默认资源池',
'ms.taskCenter.node': '节点', 'ms.taskCenter.node': '节点',
'ms.taskCenter.nodeErrorTip': '节点存在异常,请检查', 'ms.taskCenter.nodeErrorTip': '节点存在异常,请检查',
'ms.taskCenter.queue': '排队', 'ms.taskCenter.queue': '排队',

View File

@ -18,7 +18,7 @@
</a-tooltip> </a-tooltip>
</template> </template>
<template #operation="{ record }"> <template #operation="{ record }">
<a-tooltip :content="t('project.executionHistory.cleared')" :disabled="!record.deleted"> <a-tooltip :content="t('common.executionResultCleaned')" :disabled="!record.deleted">
<MsButton <MsButton
:disabled="record.deleted || !hasAnyPermission(['PROJECT_TEST_PLAN_REPORT:READ'])" :disabled="record.deleted || !hasAnyPermission(['PROJECT_TEST_PLAN_REPORT:READ'])"
class="!mr-0" class="!mr-0"