From 953be659482a0bceff10c788e039f41556ae0a9a Mon Sep 17 00:00:00 2001 From: Hermes CI Fix Date: Tue, 14 Jul 2026 11:28:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E9=BD=90NodeEditDialog=20props?= =?UTF-8?q?=20+=20BSC=E5=88=86=E7=B1=BB=E5=A4=9A=E9=80=89=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=20+=20adoptedStyleSheets=20polyfill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/index.ts | 46 ++++++++++++++++++++++++++++++++ frontend/src/router/index.ts | 2 ++ frontend/src/views/MapCanvas.vue | 27 ++++++++++--------- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 6203a994..cf70082c 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -35,6 +35,7 @@ export const kpiApi = { update: (id: number, data: any) => api.put(`/kpis/${id}`, data), delete: (id: number) => api.delete(`/kpis/${id}`), listCategories: () => api.get('/kpis/categories'), + associateMap: (id: number, data: any) => api.put(`/kpis/${id}/associate-map`, data), } export const mapApi = { @@ -83,6 +84,19 @@ export const alertApi = { resolve: (id: number, data: any) => api.post(`/alerts/${id}/resolve`, data), } +export const alertRulesApi = { + list: (params?: any) => api.get('/alert-rules', { params }), + getKpiRules: (kpiId: number) => api.get(`/alert-rules/kpi/${kpiId}`), + create: (data: any) => api.post('/alert-rules', data), + update: (id: number, data: any) => api.put(`/alert-rules/${id}`, data), + delete: (id: number) => api.delete(`/alert-rules/${id}`), + batchCreate: (data: any) => api.post('/alert-rules/batch', data), + generateDefaults: () => api.post('/alert-rules/generate-defaults'), + checkAll: () => api.post('/alert-rules/check-all'), + calculateDynamic: () => api.post('/alert-rules/calculate-dynamic'), + dynamicThresholds: (params?: any) => api.get('/alert-rules/dynamic-thresholds', { params }), +} + export const userApi = { list: () => api.get('/users'), create: (data: any) => api.post('/users', data), @@ -167,4 +181,36 @@ export const permissionApi = { setUserRoles: (data: any) => api.post('/user-roles', data), } +export const kpiCausalityApi = { + list: (params?: any) => api.get('/kpi-causality', { params }), + get: (id: number) => api.get(`/kpi-causality/${id}`), + create: (data: any) => api.post('/kpi-causality', data), + update: (id: number, data: any) => api.put(`/kpi-causality/${id}`, data), + delete: (id: number) => api.delete(`/kpi-causality/${id}`), + getNetwork: (kpiId: number) => api.get(`/kpi-causality/kpi/${kpiId}/network`), + getFullNetwork: () => api.get('/kpi-causality/full-network'), + simulate: (data: any) => api.post('/kpi-causality/simulate', data), +} + +export const dataQualityApi = { + check: () => api.get('/data-quality/check'), + stats: () => api.get('/data-quality/stats'), + logs: (params?: any) => api.get('/data-quality/logs', { params }), + updateLog: (id: number, data: any) => api.put(`/data-quality/logs/${id}`, data), + deleteLog: (id: number) => api.delete(`/data-quality/logs/${id}`), +} + +export const biReportApi = { + listTemplates: () => api.get('/bi-reports/templates'), + list: () => api.get('/bi-reports'), + get: (id: number) => api.get(`/bi-reports/${id}`), + create: (data: any) => api.post('/bi-reports', data), + update: (id: number, data: any) => api.put(`/bi-reports/${id}`, data), + delete: (id: number) => api.delete(`/bi-reports/${id}`), + templates: () => api.get('/bi-reports/templates'), + seedTemplates: () => api.post('/bi-reports/templates/seed'), + analyze: (data: any) => api.post('/bi-reports/analyze', data), + exportReport: (data: any) => api.post('/bi-reports/export', data), +} + export default api diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 68dd6b19..f2263438 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -31,6 +31,8 @@ const routes = [ { path: 'reports', name: 'ReportCenter', component: () => import('@/views/ReportCenter.vue'), meta: { title: '管理报表', roles: ['ceo', 'finance', 'business'] } }, { path: 'alignment', name: 'KPIAlignment', component: () => import('@/views/KPIAlignment.vue'), meta: { title: '战略执行看板', roles: ['ceo', 'finance', 'business', 'it'] } }, { path: 'dupont-analysis', name: 'DupontAnalysis', component: () => import('@/views/DupontAnalysis.vue'), meta: { title: '杜邦分析', roles: ['ceo', 'finance', 'it'] } }, + { path: 'data-quality', name: 'DataQuality', component: () => import('@/views/DataQuality.vue'), meta: { title: '数据质量', roles: ['ceo', 'finance', 'it'] } }, + { path: 'bi-reports', name: 'BiReports', component: () => import('@/views/BIReportCenter.vue'), meta: { title: 'BI报表', roles: ['ceo', 'finance', 'business'] } }, ] }, ] diff --git a/frontend/src/views/MapCanvas.vue b/frontend/src/views/MapCanvas.vue index a9a37145..669956aa 100644 --- a/frontend/src/views/MapCanvas.vue +++ b/frontend/src/views/MapCanvas.vue @@ -115,9 +115,9 @@ @@ -581,22 +581,25 @@ function openEditDialog(dimKey: string, oi: number, obj: any) { } function onNodeSave(data: any) { - const dim = dimensions.find((d: any) => d.key === data.layer) + const layer = editingLayerKey.value || data.layer || data.dimKey + const dim = dimensions.find((d: any) => d.key === layer) if (!dim) return - // 构建节点对象 + // 构建节点对象(兼容新旧两种格式) const node = { name: data.name, - targetValue: data.targetValue, - currentValue: data.currentValue, - unit: data.unit, - owner: data.owner, - isLeading: data.isLeading, + targetValue: data.targetValue ?? null, + currentValue: data.currentValue ?? null, + unit: data.unit || '%', + owner: data.owner || '', + isLeading: data.isLeading ?? false, description: data.description || '', - layer: data.layer, + layer: layer, + kpis: data.kpis || [], + icon: data.icon || 'target', } - if (editingNodeData.value?._index != null && editingNodeData.value._dimKey === data.layer) { + if (editingNodeData.value?._index != null && editingNodeData.value._dimKey === layer) { // 编辑已有节点 const idx = editingNodeData.value._index if (dim.objectives[idx]) {