feat(data): 清理遗留ERP数据源配置标注收尾 — 移除DataManage遗留标签/告警, 空态引导真实zxt通道 (project-20260908-data-source-cleanup)

This commit is contained in:
Hermes CI Fix
2026-09-08 21:10:32 +08:00
parent aa81cee009
commit f8688713db
+8 -26
View File
@@ -35,13 +35,6 @@
</div>
</el-alert>
<el-alert v-else type="info" :closable="false" class="channel-alert" title="当前账套暂无 zxt 智享通注入数据(可能为企业数据未接入智享通通道)" />
<el-alert v-if="erpDirect && erpDirect.legacy_sources_count > 0" type="warning" :closable="false" class="channel-alert">
<template #title>
⚠️ ERP 直连同步通道已停用(2026-08-31),以下 {{ erpDirect.legacy_sources_count }} 条 ERP 数据源为<strong>遗留配置</strong>,不属于当前数据通道
</template>
<div class="channel-desc">{{ erpDirect.reason }}</div>
</el-alert>
</template>
<el-card>
@@ -66,9 +59,7 @@
</el-table-column>
<el-table-column prop="status" label="状态" width="110">
<template #default="{ row }">
<!-- 诚实化:ERP 遗留数据源即使 status=active 也标注"非当前通道",避免误导 -->
<el-tag v-if="isLegacyErpSource(row)" type="warning" size="small">遗留·非当前通道</el-tag>
<el-tag v-else :type="row.status==='active'?'success':'danger'" size="small">{{ row.status }}</el-tag>
<el-tag :type="row.status==='active'?'success':'danger'" size="small">{{ row.status }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="last_sync_at" label="上次同步" width="160" />
@@ -79,10 +70,10 @@
</template>
</el-table-column>
</el-table>
<el-empty v-if="!sourcesLoading && sources.length === 0" description="暂无数据源,请点击「新增数据源」添加" />
<div v-if="legacyErpIds.size > 0" class="legacy-note">
💡 上表中「ERP」类型数据源为遗留演示配置:其端点指向 erp-gateway 容器(2026-08-31 起 DB 凭据删除、已停用)。
新增数据源请选择非 ERP 类型;企业财务数据由上方 zxt 智享通通道真实供给,无需在此配置。
<el-empty v-if="!sourcesLoading && sources.length === 0" description="暂无数据源配置" />
<div v-if="!sourcesLoading && sources.length === 0" class="legacy-note">
💡 ERP 直连通道已于 2026-08-31 停用,历史遗留 ERP 配置已按决策清理(2026-09-08)。
企业财务数据由上方 zxt 智享通通道自动归集(source_type='zxt-sync'),无需在此配置。
</div>
</el-card>
@@ -93,7 +84,7 @@
<span>📡 实际取数映射(采集器使用,kpi_value_sources)</span>
</div>
</template>
<div class="channel-desc">06:30 定时采集(scripts/kpi_value_collector.py)按此映射写入 kpi_values(source_type='auto_collect'),与上方 ERP 遗留数据源相互独立。</div>
<div class="channel-desc">06:30 定时采集(scripts/kpi_value_collector.py)按此映射写入 kpi_values(source_type='auto_collect'),与上方「数据源配置」相互独立。</div>
<el-table :data="valueSources" class="full-width-table">
<el-table-column prop="kpi_code" label="KPI编码" min-width="130" />
<el-table-column prop="kpi_name" label="KPI名称" min-width="130" />
@@ -112,7 +103,7 @@
<MyDialog v-model="showSourceForm" :title="sourceForm.id ? '编辑数据源' : '新增数据源'" :width="550">
<el-alert v-if="!sourceForm.id && sourceForm.source_type==='erp'" type="warning" :closable="false" class="form-warn"
title="ERP 直连通道已停用(2026-08-31)。ERP 类型仅用于保留/查看遗留配置,企业财务数据由 zxt 智享通通道供给。" />
title="ERP 直连通道已停用(2026-08-31)。ERP 类型数据源仅作记录、不会执行同步;企业财务数据由 zxt 智享通通道供给。" />
<el-form :model="sourceForm" label-width="120px">
<el-form-item label="名称"><el-input v-model="sourceForm.name" /></el-form-item>
<el-form-item label="类型">
@@ -123,7 +114,7 @@
<el-option label="手工" value="manual" />
</el-select>
</el-form-item>
<el-form-item v-if="sourceForm.source_type==='erp'" label="遗留说明">
<el-form-item v-if="sourceForm.source_type==='erp'" label="通道说明">
<el-alert type="warning" :closable="false" show-icon title="该类型数据源不会执行同步(通道已停用),仅作记录" />
</el-form-item>
<el-form-item label="API地址"><el-input v-model="sourceForm.api_endpoint" placeholder="https://..." /></el-form-item>
@@ -192,23 +183,14 @@ async function doImport() {
// === 数据链路状态(2026-09-08 诚实化) ===
const channelLoading = ref(false)
const realChannel = ref<any>(null)
const erpDirect = ref<any>(null)
const legacyErpIds = ref<Set<number>>(new Set())
const valueSources = ref<any[]>([])
function isLegacyErpSource(row: any): boolean {
return row.source_type === 'erp' && legacyErpIds.value.has(Number(row.id))
}
async function loadChannelStatus() {
channelLoading.value = true
try {
const r: any = await dataApi.channelStatus()
const d = r.data || r
realChannel.value = d.real_channel || null
erpDirect.value = d.erp_direct || null
const ids = (d.erp_direct?.legacy_sources || []).map((s: any) => Number(s.id))
legacyErpIds.value = new Set(ids)
} catch (e) { /* 非阻塞:状态卡片加载失败不影响列表 */ }
channelLoading.value = false
}