feat(任务中心): 任务中心列表接口

This commit is contained in:
baiqi 2024-10-14 10:12:29 +08:00 committed by Craftsman
parent 9b899ffb50
commit 115c476559
2 changed files with 34 additions and 22 deletions

View File

@ -135,7 +135,7 @@
const columns: MsTableColumn = [
{
title: t('ms.taskCenter.taskID'),
dataIndex: 'taskId',
dataIndex: 'num',
width: 180,
columnSelectorDisabled: true,
showTooltip: true,

View File

@ -19,11 +19,11 @@
v-on="propsEvent"
@batch-action="handleTableBatch"
>
<template #id="{ record }">
<a-button type="text" class="max-w-full justify-start px-0" @click="showTaskDetail(record.id)">
<a-tooltip :content="record.id">
<template #num="{ record }">
<a-button type="text" class="max-w-full justify-start px-0" @click="showTaskDetail(record.num)">
<a-tooltip :content="record.num">
<div class="one-line-text">
{{ record.id }}
{{ record.num }}
</div>
</a-tooltip>
</a-button>
@ -175,9 +175,9 @@
const columns: MsTableColumn = [
{
title: 'ID',
dataIndex: 'id',
slotName: 'id',
width: 180,
dataIndex: 'num',
slotName: 'num',
width: 100,
columnSelectorDisabled: true,
fixed: 'left',
},
@ -470,7 +470,9 @@
async function initTaskStatistics() {
try {
const res = await currentExecuteTaskStatistics(propsRes.value.data.map((item) => item.id));
const ids = propsRes.value.data.map((item) => item.id);
if (ids.length > 0) {
const res = await currentExecuteTaskStatistics(ids);
res.forEach((item) => {
const target = propsRes.value.data.find((task) => task.id === item.id);
if (target) {
@ -482,6 +484,7 @@
target.caseTotal = item.caseTotal;
}
});
}
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
@ -494,10 +497,19 @@
}
onMounted(async () => {
await loadList();
initTaskStatistics();
loadList();
});
watch(
() => propsRes.value.data,
() => {
initTaskStatistics();
},
{
immediate: true,
}
);
await tableStore.initColumn(TableKeyEnum.TASK_CENTER_CASE_TASK, columns, 'drawer');
</script>