fix(系统设置): 修复资源池容量列表字段展示bug

This commit is contained in:
xinxin.wu 2024-10-30 12:58:45 +08:00 committed by 刘瑞斌
parent 0a05e7a30f
commit 99821d98be
1 changed files with 45 additions and 0 deletions

View File

@ -92,6 +92,7 @@
import ExecStatus from '@/views/test-plan/report/component/execStatus.vue'; import ExecStatus from '@/views/test-plan/report/component/execStatus.vue';
import { getCapacityDetail, getCapacityTaskList } from '@/api/modules/setting/resourcePool'; import { getCapacityDetail, getCapacityTaskList } from '@/api/modules/setting/resourcePool';
import { systemOrgOptions, systemProjectOptions } from '@/api/modules/taskCenter/system';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import { useTableStore } from '@/store'; import { useTableStore } from '@/store';
@ -257,6 +258,50 @@
}, },
]; ];
async function initProjectAndOrgs() {
try {
const projects = await systemProjectOptions();
const orgs = await systemOrgOptions();
columns.splice(
2,
0,
{
title: 'common.belongProject',
dataIndex: 'projectName',
showTooltip: true,
showDrag: true,
width: 200,
filterConfig: {
options: projects.map((item) => ({
label: item.name,
value: item.id,
})),
filterSlotName: FilterSlotNameEnum.GLOBAL_TASK_CENTER_BELONG_PROJECT,
},
},
{
title: 'common.belongOrg',
dataIndex: 'organizationName',
showTooltip: true,
showDrag: true,
width: 200,
filterConfig: {
options: orgs.map((item) => ({
label: item.name,
value: item.id,
})),
filterSlotName: FilterSlotNameEnum.GLOBAL_TASK_CENTER_BELONG_PROJECT,
},
}
);
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
}
}
await initProjectAndOrgs();
const { propsRes, propsEvent, loadList, setLoadListParams } = useTable( const { propsRes, propsEvent, loadList, setLoadListParams } = useTable(
getCapacityTaskList, getCapacityTaskList,
{ {