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)
This commit is contained in:
@@ -3,10 +3,8 @@
|
||||
<div class="page-header">
|
||||
<h2>📈 增长质量诊断</h2>
|
||||
<div class="header-right">
|
||||
<el-select v-model="entityId" size="small" style="width:130px" @change="loadData">
|
||||
<el-option :value="1" label="酣客" />
|
||||
<el-option :value="2" label="博海" />
|
||||
</el-select>
|
||||
<!-- 企业只读标识(不可点):账套由登录窗口选定,页内无切换入口 -->
|
||||
<el-tag size="small" type="primary" effect="plain">{{ entityLabel }}</el-tag>
|
||||
<el-select v-model="period" size="small" style="width:140px" @change="loadData" :loading="loadingPeriods">
|
||||
<el-option v-for="p in periods" :key="p" :value="p" :label="p" />
|
||||
</el-select>
|
||||
@@ -82,8 +80,10 @@
|
||||
import { ref, computed, onMounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import api from '@/api'
|
||||
import { sessionEntityName } from '@/utils/entity'
|
||||
|
||||
const entityId = ref(Number(localStorage.getItem('cma_entity_id') || 1))
|
||||
// 企业只读标识(账套由登录窗口选定,页内无切换入口)
|
||||
const entityLabel = ref(sessionEntityName())
|
||||
const period = ref('2026-06')
|
||||
const periods = ref<string[]>([])
|
||||
const loading = ref(false)
|
||||
@@ -129,7 +129,7 @@ const dimensionRows = computed(() => {
|
||||
async function loadPeriods() {
|
||||
loadingPeriods.value = true
|
||||
try {
|
||||
const r: any = await api.get('/growth-quality/periods', { params: { entity_id: entityId.value } })
|
||||
const r: any = await api.get('/growth-quality/periods')
|
||||
periods.value = r.data || r || []
|
||||
if (periods.value.length && !periods.value.includes(period.value)) {
|
||||
period.value = periods.value[periods.value.length - 1]
|
||||
@@ -141,7 +141,7 @@ async function loadPeriods() {
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const r: any = await api.get('/growth-quality/diagnosis', { params: { entity_id: entityId.value, period: period.value } })
|
||||
const r: any = await api.get('/growth-quality/diagnosis', { params: { period: period.value } })
|
||||
const d = r.data || r || {}
|
||||
overall.value = d.overall ?? null
|
||||
level.value = d.level || ''
|
||||
|
||||
Reference in New Issue
Block a user