|
@@ -28,6 +28,8 @@
|
|
|
:result-kpi-source="resultKpiSource"
|
|
:result-kpi-source="resultKpiSource"
|
|
|
:result-kpi-loading="resultKpiState === 'loading'"
|
|
:result-kpi-loading="resultKpiState === 'loading'"
|
|
|
:result-kpi-error="resultKpiState === 'error' ? resultKpiError : null"
|
|
:result-kpi-error="resultKpiState === 'error' ? resultKpiError : null"
|
|
|
|
|
+ :dept-backlog-items="deptBacklogItems"
|
|
|
|
|
+ :dept-backlog-loading="deptBacklogLoading"
|
|
|
:layout="draftLayout.modules"
|
|
:layout="draftLayout.modules"
|
|
|
:editable="editMode"
|
|
:editable="editMode"
|
|
|
:row-height="60"
|
|
:row-height="60"
|
|
@@ -80,6 +82,7 @@ import {
|
|
|
type S8QdcSummaryItem,
|
|
type S8QdcSummaryItem,
|
|
|
type S8ResultKpiItem,
|
|
type S8ResultKpiItem,
|
|
|
} from '../api/s8MonitoringApi';
|
|
} from '../api/s8MonitoringApi';
|
|
|
|
|
+import { s8DashboardApi, type S8DeptBacklogItem } from '../api/s8DashboardApi';
|
|
|
import { deepClone, useS8Layout } from './useS8Layout';
|
|
import { deepClone, useS8Layout } from './useS8Layout';
|
|
|
import type { S8LayoutSchema } from './useS8Layout';
|
|
import type { S8LayoutSchema } from './useS8Layout';
|
|
|
import { DEMO_LAYOUT } from './useS8Layout';
|
|
import { DEMO_LAYOUT } from './useS8Layout';
|
|
@@ -373,7 +376,10 @@ const s9SummaryCard = computed<SummaryCardData>(() => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// S9 由 S9QdcSummaryCard 特判渲染,不再注入 summaryCards
|
|
// S9 由 S9QdcSummaryCard 特判渲染,不再注入 summaryCards
|
|
|
-const allSummaryCards = computed<SummaryCardData[]>(() => [s8SummaryCard.value]);
|
|
|
|
|
|
|
+// TASK-013-DEPT-SERIOUS-CARD-1:S8 cell 由 S8DeptSeverityTabsCard 特判渲染(在 ModulesGrid 内),
|
|
|
|
|
+// 不再把 s8SummaryCard(功能异常多维分析)注入 summaryCards。s8SummaryCard / s9SummaryCard
|
|
|
|
|
+// computed 暂保留以减少范围蔓延,作为 P3 死代码清理(TASK-013-CLEANUP-S9-DEPT-DEAD-CODE-1)。
|
|
|
|
|
+const allSummaryCards = computed<SummaryCardData[]>(() => []);
|
|
|
|
|
|
|
|
const deptCards = computed<DeptDisplay[]>(() => {
|
|
const deptCards = computed<DeptDisplay[]>(() => {
|
|
|
const source = gridData.byDept.length
|
|
const source = gridData.byDept.length
|
|
@@ -600,6 +606,23 @@ const resultKpiSource = shallowRef<string>('DICTIONARY_MOCK');
|
|
|
const resultKpiState = shallowRef<'idle' | 'loading' | 'ok' | 'error'>('idle');
|
|
const resultKpiState = shallowRef<'idle' | 'loading' | 'ok' | 'error'>('idle');
|
|
|
const resultKpiError = shallowRef<string>('');
|
|
const resultKpiError = shallowRef<string>('');
|
|
|
|
|
|
|
|
|
|
+// TASK-013-DEPT-SERIOUS-CARD-1:S8 cell 部门严重异常 Tab 数据;按 period 联动刷新。
|
|
|
|
|
+const deptBacklogItems = shallowRef<S8DeptBacklogItem[]>([]);
|
|
|
|
|
+const deptBacklogLoading = shallowRef(false);
|
|
|
|
|
+
|
|
|
|
|
+async function loadDeptBacklog() {
|
|
|
|
|
+ deptBacklogLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const data = await s8DashboardApi.deptBacklog({ tenantId: 1, factoryId: 1, period: period.value });
|
|
|
|
|
+ deptBacklogItems.value = data ?? [];
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.error('[S8MonitoringOverviewPage] loadDeptBacklog failed:', err);
|
|
|
|
|
+ deptBacklogItems.value = [];
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ deptBacklogLoading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function loadResultKpi() {
|
|
async function loadResultKpi() {
|
|
|
resultKpiState.value = 'loading';
|
|
resultKpiState.value = 'loading';
|
|
|
resultKpiError.value = '';
|
|
resultKpiError.value = '';
|
|
@@ -675,7 +698,7 @@ onMounted(async () => {
|
|
|
// initializeFromCards 因 initialized=true 跳过,导致真实 API 数据无法覆盖。
|
|
// initializeFromCards 因 initialized=true 跳过,导致真实 API 数据无法覆盖。
|
|
|
// 改用 reset(无条件用最新 cards 重建 state.items),每次进入本页都对齐 API。
|
|
// 改用 reset(无条件用最新 cards 重建 state.items),每次进入本页都对齐 API。
|
|
|
await loadPageConfig();
|
|
await loadPageConfig();
|
|
|
- await Promise.all([loadData(), loadResultKpi()]);
|
|
|
|
|
|
|
+ await Promise.all([loadData(), loadResultKpi(), loadDeptBacklog()]);
|
|
|
resetStageConfigState(stageCards.value);
|
|
resetStageConfigState(stageCards.value);
|
|
|
resetCategoryConfigState(categoryCards.value);
|
|
resetCategoryConfigState(categoryCards.value);
|
|
|
resetDeptConfigState(deptCards.value);
|
|
resetDeptConfigState(deptCards.value);
|
|
@@ -689,7 +712,11 @@ watch(
|
|
|
},
|
|
},
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
-watch(period, () => void loadData());
|
|
|
|
|
|
|
+watch(period, () => {
|
|
|
|
|
+ void loadData();
|
|
|
|
|
+ // TASK-013-DEPT-SERIOUS-CARD-1:period 切换时联动刷新部门严重异常。
|
|
|
|
|
+ void loadDeptBacklog();
|
|
|
|
|
+});
|
|
|
watch(categoryCards, (cats) => { initializeFromCategories(cats); });
|
|
watch(categoryCards, (cats) => { initializeFromCategories(cats); });
|
|
|
watch(deptCards, (depts) => {
|
|
watch(deptCards, (depts) => {
|
|
|
initializeFromDepts(depts);
|
|
initializeFromDepts(depts);
|