fix: 移除 refreshBusinessStatus 死代码,消除 N+1 无效请求

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wsm
2026-07-16 09:11:45 +08:00
co-authored by Claude Opus 4.7
parent 6432395d36
commit 4dd45eeab0
3 changed files with 4 additions and 67 deletions
+1 -23
View File
@@ -157,7 +157,7 @@
import Icon from '/@/components/Icon/index';
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
import SzDeptUserModal from '/@/components/semri/deptUserComponent/SzDeptUserModal.vue';
import { startProcessSchedules, getBusinessStatus } from '/@/api/common/api';
import { startProcessSchedules } from '/@/api/common/api';
import { dateUtil } from '/@/utils/dateUtil';
import FlowScheduleStartModal from './components/DqInspectTaskFlowScheduleStartModal.vue';
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
@@ -610,30 +610,8 @@
reload();
}
async function refreshBusinessStatus(records) {
if (!records || records.length === 0) return;
try {
const results = await Promise.all(records.map((item) => getBusinessStatus({ businessId: item.id }).catch(() => null)));
const statusMap: Record<string, string> = {};
for (const item of results) {
if (item?.businessId) {
statusMap[item.businessId] = item.status_dictText || '';
}
}
for (const item of records) {
const status = statusMap[item.id];
if (status !== undefined) {
item.status_dictText = status;
}
}
} catch (e) {
// 静默处理查询异常
}
}
async function onFetchSuccess(result) {
if (result?.items?.length > 0) {
await refreshBusinessStatus(result.items);
setTableData([...getDataSource()]);
}
}