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 @@
风险矩阵 — CMA P2 ERM框架
-
-
-
-
+
+ {{ entityLabel }}
刷新
@@ -373,6 +371,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import { alertApi, userApi, actionPlanApi, kpiApi, alertRulesApi } from '../api/index'
import BotSourceTag from '../components/BotSourceTag.vue'
import RiskCell from '../components/charts/RiskCell.vue'
+import { sessionEntityName } from '../utils/entity'
const route = useRoute()
const activeTab = ref((route.meta?.tab as string) || 'alerts')
@@ -721,7 +720,8 @@ async function loadUsers() {
}
// ── 风险矩阵 ──
-const riskEntity = ref('hanke')
+// 企业只读标识(账套由登录窗口选定,页内无切换入口)
+const entityLabel = ref(sessionEntityName())
const riskData = ref(null)
const riskLoading = ref(false)
const selectedRisk = ref(null)
@@ -743,7 +743,7 @@ async function loadRiskMatrix() {
riskLoading.value = true
selectedRisk.value = null
try {
- const r: any = await alertApi.riskMatrix({ entity: riskEntity.value })
+ const r: any = await alertApi.riskMatrix()
riskData.value = r
} catch { ElMessage.error('加载风险矩阵失败') }
riskLoading.value = false
diff --git a/frontend/src/views/DataQuality.vue b/frontend/src/views/DataQuality.vue
index 7ea47219..9982d549 100644
--- a/frontend/src/views/DataQuality.vue
+++ b/frontend/src/views/DataQuality.vue
@@ -198,12 +198,9 @@
🛡️ DAMA数据治理规则检查(财务七规则)
-
-
-
-
-
-
+
+
+ {{ entityLabel }}
重新检查
@@ -289,6 +286,7 @@ import { ElMessage } from 'element-plus'
import VChart from 'vue-echarts'
import 'echarts'
import { dataQualityApi } from '../api/index'
+import { sessionEntityName } from '../utils/entity'
const activeTab = ref('kpi')
const govLoaded = ref(false)
@@ -305,7 +303,8 @@ const govScore = ref(0)
const govTotalDeduct = ref(0)
const govIssues = ref
([])
const govCheckedAt = ref('')
-const govEntity = ref(0)
+// 企业只读标识(账套由登录窗口选定,页内无切换入口)
+const entityLabel = ref(sessionEntityName())
const govChecking = ref(false)
const govRuleMeta = ref({})
@@ -413,9 +412,8 @@ async function runCheck() {
async function runGovernanceCheck() {
govChecking.value = true
try {
- const params: any = {}
- if (govEntity.value) params.entity_id = govEntity.value
- const r: any = await dataQualityApi.governanceCheck(params)
+ // 会话账套:不再传页面级 entity_id(后端 assert_entity_scope 按 token 绑定账套取数)
+ const r: any = await dataQualityApi.governanceCheck()
govScore.value = r.score ?? 0
govTotalDeduct.value = r.total_deduct ?? 0
govIssues.value = r.issues || []
diff --git a/frontend/src/views/GrowthQuality.vue b/frontend/src/views/GrowthQuality.vue
index cfddc153..e1c53a76 100644
--- a/frontend/src/views/GrowthQuality.vue
+++ b/frontend/src/views/GrowthQuality.vue
@@ -3,10 +3,8 @@