feat(xispeak,dq): 列表页新增状态统计栏(未开始/督办中/已逾期/已完成)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wsm
2026-07-10 15:07:02 +08:00
co-authored by Claude Opus 4.7
parent f13cf5f3f1
commit 0b1aafccb8
4 changed files with 66 additions and 2 deletions
+29 -1
View File
@@ -103,6 +103,11 @@
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
<a-space style="float: right; font-size: 14px; font-weight: bold">
<a-tag color="warning">未开始 {{ statsData.notStarted }}</a-tag>
<a-tag color="error">督办中 {{ statsData.inProgress }}已逾期 {{ statsData.overdue }}</a-tag>
<a-tag color="success">已完成 {{ statsData.completed }}</a-tag>
</a-space>
</template>
<!--操作栏-->
<template #action="{ record }">
@@ -127,7 +132,7 @@
</template>
<script lang="ts" name="dqinspecttask-dqInspectTask" setup>
import { ref, reactive, computed, unref } from 'vue';
import { ref, reactive, computed, unref, onMounted } from 'vue';
import { BasicTable, useTable } from '/@/components/Table';
import { Dropdown } from '/@/components/Dropdown';
import { useListPage } from '/@/hooks/system/useListPage';
@@ -145,6 +150,7 @@
getCheckExcelByEasyExcelUrl,
getExportXlsHeadersUrl,
saveOrUpdate,
statusStats,
} from './DqInspectTask.api';
import { defHttp } from '/@/utils/http/axios';
import { showImportValidationErrors } from '/@/utils/helper/importError';
@@ -162,6 +168,7 @@
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const statsData = reactive({ notStarted: 0, inProgress: 0, overdue: 0, completed: 0 });
const checkedKeys = ref<Array<string | number>>([]);
//注册model
const [registerModal, { openModal }] = useModal();
@@ -221,6 +228,27 @@
reload();
}
async function fetchStatusStats() {
try {
const params: Recordable = {};
Object.keys(queryParam).forEach((key) => {
if (queryParam[key] !== undefined && queryParam[key] !== null && queryParam[key] !== '') {
params[key] = queryParam[key];
}
});
const res = await statusStats(params);
if (res) {
Object.assign(statsData, res);
}
} catch (e) {
// stats fetch failure is non-critical
}
}
onMounted(() => {
fetchStatusStats();
});
/**
* 新增事件
*/