mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-11 03:22:17 +08:00
feat(任务中心): 任务中心列表接口
This commit is contained in:
parent
9b899ffb50
commit
115c476559
@ -135,7 +135,7 @@
|
||||
const columns: MsTableColumn = [
|
||||
{
|
||||
title: t('ms.taskCenter.taskID'),
|
||||
dataIndex: 'taskId',
|
||||
dataIndex: 'num',
|
||||
width: 180,
|
||||
columnSelectorDisabled: true,
|
||||
showTooltip: true,
|
||||
|
@ -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,18 +470,21 @@
|
||||
|
||||
async function initTaskStatistics() {
|
||||
try {
|
||||
const res = await currentExecuteTaskStatistics(propsRes.value.data.map((item) => item.id));
|
||||
res.forEach((item) => {
|
||||
const target = propsRes.value.data.find((task) => task.id === item.id);
|
||||
if (target) {
|
||||
target.executeRate = item.executeRate;
|
||||
target.pendingCount = item.pendingCount;
|
||||
target.successCount = item.successCount;
|
||||
target.fakeErrorCount = item.fakeErrorCount;
|
||||
target.errorCount = item.errorCount;
|
||||
target.caseTotal = item.caseTotal;
|
||||
}
|
||||
});
|
||||
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) {
|
||||
target.executeRate = item.executeRate;
|
||||
target.pendingCount = item.pendingCount;
|
||||
target.successCount = item.successCount;
|
||||
target.fakeErrorCount = item.fakeErrorCount;
|
||||
target.errorCount = item.errorCount;
|
||||
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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user