feat(xispeak,dq): 列表页新增状态统计栏(未开始/督办中/已逾期/已完成)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@ enum Api {
|
||||
queryDataById = '/dqinspecttask/dqInspectTask/queryById',
|
||||
dqInspectProgressList = '/dqinspecttask/dqInspectTask/queryDqInspectProgressByMainId',
|
||||
specificProblemOptions = '/dqinspectproblem/dqInspectProblem/specificOptions',
|
||||
statusStats = '/dqinspecttask/dqInspectTask/statusStats',
|
||||
|
||||
}
|
||||
/**
|
||||
@@ -62,6 +63,9 @@ export const list = (params) =>
|
||||
export const ledgerList = (params) =>
|
||||
defHttp.get({url: Api.ledgerList, params});
|
||||
|
||||
export const statusStats = (params) =>
|
||||
defHttp.get({ url: Api.statusStats, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user