mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 21:49:23 +08:00
feat(任务中心): 任务中心列表接口
This commit is contained in:
parent
9b899ffb50
commit
115c476559
@ -135,7 +135,7 @@
|
|||||||
const columns: MsTableColumn = [
|
const columns: MsTableColumn = [
|
||||||
{
|
{
|
||||||
title: t('ms.taskCenter.taskID'),
|
title: t('ms.taskCenter.taskID'),
|
||||||
dataIndex: 'taskId',
|
dataIndex: 'num',
|
||||||
width: 180,
|
width: 180,
|
||||||
columnSelectorDisabled: true,
|
columnSelectorDisabled: true,
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
v-on="propsEvent"
|
v-on="propsEvent"
|
||||||
@batch-action="handleTableBatch"
|
@batch-action="handleTableBatch"
|
||||||
>
|
>
|
||||||
<template #id="{ record }">
|
<template #num="{ record }">
|
||||||
<a-button type="text" class="max-w-full justify-start px-0" @click="showTaskDetail(record.id)">
|
<a-button type="text" class="max-w-full justify-start px-0" @click="showTaskDetail(record.num)">
|
||||||
<a-tooltip :content="record.id">
|
<a-tooltip :content="record.num">
|
||||||
<div class="one-line-text">
|
<div class="one-line-text">
|
||||||
{{ record.id }}
|
{{ record.num }}
|
||||||
</div>
|
</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</a-button>
|
</a-button>
|
||||||
@ -175,9 +175,9 @@
|
|||||||
const columns: MsTableColumn = [
|
const columns: MsTableColumn = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
dataIndex: 'id',
|
dataIndex: 'num',
|
||||||
slotName: 'id',
|
slotName: 'num',
|
||||||
width: 180,
|
width: 100,
|
||||||
columnSelectorDisabled: true,
|
columnSelectorDisabled: true,
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
},
|
},
|
||||||
@ -470,18 +470,21 @@
|
|||||||
|
|
||||||
async function initTaskStatistics() {
|
async function initTaskStatistics() {
|
||||||
try {
|
try {
|
||||||
const res = await currentExecuteTaskStatistics(propsRes.value.data.map((item) => item.id));
|
const ids = propsRes.value.data.map((item) => item.id);
|
||||||
res.forEach((item) => {
|
if (ids.length > 0) {
|
||||||
const target = propsRes.value.data.find((task) => task.id === item.id);
|
const res = await currentExecuteTaskStatistics(ids);
|
||||||
if (target) {
|
res.forEach((item) => {
|
||||||
target.executeRate = item.executeRate;
|
const target = propsRes.value.data.find((task) => task.id === item.id);
|
||||||
target.pendingCount = item.pendingCount;
|
if (target) {
|
||||||
target.successCount = item.successCount;
|
target.executeRate = item.executeRate;
|
||||||
target.fakeErrorCount = item.fakeErrorCount;
|
target.pendingCount = item.pendingCount;
|
||||||
target.errorCount = item.errorCount;
|
target.successCount = item.successCount;
|
||||||
target.caseTotal = item.caseTotal;
|
target.fakeErrorCount = item.fakeErrorCount;
|
||||||
}
|
target.errorCount = item.errorCount;
|
||||||
});
|
target.caseTotal = item.caseTotal;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -494,10 +497,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await loadList();
|
loadList();
|
||||||
initTaskStatistics();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => propsRes.value.data,
|
||||||
|
() => {
|
||||||
|
initTaskStatistics();
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
await tableStore.initColumn(TableKeyEnum.TASK_CENTER_CASE_TASK, columns, 'drawer');
|
await tableStore.initColumn(TableKeyEnum.TASK_CENTER_CASE_TASK, columns, 'drawer');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user