From e6dd8f61f0671235324d30f9bd43a97bed810b22 Mon Sep 17 00:00:00 2001 From: Hermes CI Fix Date: Mon, 14 Sep 2026 11:32:52 +0800 Subject: [PATCH] feat(ui): converge 6 page-level entity selectors to read-only session tag - DataQuality / ProductMatrix / AlertList / ActionPlanLibrary / views.GrowthQuality / PredictAccuracy: drop entity el-select (including the "all entities" option), show read-only session entity tag (not clickable), same style as the top bar tag - drop page-level entity param from those requests; backend resolves entity from the session token (assert_entity_scope / get_entity_id) - utils/entity.ts: add sessionEntityName() (cma_entity_name else id map) - P3: ReportCenter header emoji removed; components/GrowthQuality detail drill-down el-dialog -> MyDialog (cma-entity-selectors-converge-6pages-20260914) --- frontend/src/components/GrowthQuality.vue | 5 +++-- frontend/src/utils/entity.ts | 10 ++++++++++ frontend/src/views/ActionPlanLibrary.vue | 12 ++++++------ frontend/src/views/AlertList.vue | 12 ++++++------ frontend/src/views/DataQuality.vue | 18 ++++++++---------- frontend/src/views/GrowthQuality.vue | 14 +++++++------- frontend/src/views/PredictAccuracy.vue | 12 ++++++------ frontend/src/views/ProductMatrix.vue | 12 ++++++------ frontend/src/views/ReportCenter.vue | 4 ++-- 9 files changed, 54 insertions(+), 45 deletions(-) diff --git a/frontend/src/components/GrowthQuality.vue b/frontend/src/components/GrowthQuality.vue index c54f8733..cb9d3186 100644 --- a/frontend/src/components/GrowthQuality.vue +++ b/frontend/src/components/GrowthQuality.vue @@ -98,7 +98,7 @@ - + - + @@ -139,6 +139,7 @@ import { ref, computed } from 'vue' import VChart from 'vue-echarts' import 'echarts' import { predictApi } from '../api/index' +import MyDialog from './MyDialog.vue' import { ElMessage } from 'element-plus' const loading = ref(false) diff --git a/frontend/src/utils/entity.ts b/frontend/src/utils/entity.ts index d937afe2..be9c9eec 100644 --- a/frontend/src/utils/entity.ts +++ b/frontend/src/utils/entity.ts @@ -23,3 +23,13 @@ export function effectiveEntityId(): number { const stored = Number(localStorage.getItem('cma_entity_id')) return Number.isNaN(stored) ? 1 : stored } + +/** 会话企业显示名:优先 localStorage.cma_entity_name(登录时写入),否则按会话 entity_id 映射 */ +export function sessionEntityName(): string { + const stored = localStorage.getItem('cma_entity_name') + if (stored) return stored + const id = effectiveEntityId() + if (id === 1) return '酣客' + if (id === 2) return '博海' + return `企业 #${id}` +} diff --git a/frontend/src/views/ActionPlanLibrary.vue b/frontend/src/views/ActionPlanLibrary.vue index 6aebbfa4..94af51fb 100644 --- a/frontend/src/views/ActionPlanLibrary.vue +++ b/frontend/src/views/ActionPlanLibrary.vue @@ -291,10 +291,8 @@
COSO内控自检表 — CMA P1内部控制五要素 - - - - + + {{ entityLabel }} 刷新 生成改善行动
@@ -350,6 +348,7 @@ import { useRoute, useRouter } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' import { actionPlanApi, kpiApi, userApi, okrApi } from '../api/index' import MyDialog from '../components/MyDialog.vue' +import { sessionEntityName } from '../utils/entity' const route = useRoute() const router = useRouter() @@ -645,7 +644,8 @@ function statusLabel(status: string) { } // ── COSO内控自检 ── -const cosoEntity = ref('hanke') +// 企业只读标识(账套由登录窗口选定,页内无切换入口) +const entityLabel = ref(sessionEntityName()) const cosoData = ref(null) const cosoLoading = ref(false) const cosoExpanded = ref>({}) @@ -657,7 +657,7 @@ function toggleCosoElement(id: string) { async function loadCosoChecklist() { cosoLoading.value = true try { - const r: any = await actionPlanApi.cosoChecklist({ entity: cosoEntity.value }) + const r: any = await actionPlanApi.cosoChecklist() cosoData.value = r // 默认展开第一个 if (r?.elements?.length > 0) { diff --git a/frontend/src/views/AlertList.vue b/frontend/src/views/AlertList.vue index 91f1d942..2ed91e30 100644 --- a/frontend/src/views/AlertList.vue +++ b/frontend/src/views/AlertList.vue @@ -78,10 +78,8 @@