From 4f7466bb2919cd2f9a1ab704e302be2850266795 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Wed, 25 Mar 2026 14:10:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E9=80=A0=E6=88=90=E6=9C=AC=E5=88=86?= =?UTF-8?q?=E6=9E=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 4 +- src/permission.js | 43 +- src/views/error/404.vue | 4 +- .../components/customerInfoAdd.vue | 87 ++++ .../components/groupKeyAdd.vue | 100 ++++ .../components/productInfoAdd.vue | 87 ++++ .../customerInfoConfiguration.vue | 68 ++- .../groupKeyTaskConfiguration.vue | 69 ++- .../productInfoConfiguration.vue | 65 ++- .../electricityCostAnalysis.vue | 53 +- .../electricityCostAnalysisBase.vue | 351 +++++++++++++ .../container.vue | 95 ++-- .../dataTrend.vue | 160 +++--- .../dataTrendBar.vue | 64 +-- .../electricityGauge.vue | 6 +- .../monthlyOverview.vue | 143 ++---- .../monthlyRelatedMetrics.vue | 262 +++++----- .../operatingBar.vue | 20 +- .../operatingLineBarSale.vue | 14 +- .../operatingLineBarSaleGroup.vue | 9 +- .../operatingLineBarSaleSingle.vue | 24 +- .../operatingLineChart.vue | 212 ++++---- .../operatingLineChartCumulative.vue | 224 ++++----- .../operatingSingleBar.vue | 18 +- .../operatingTopBar.vue | 42 +- .../relatedIndicatorsAnalysis.vue | 225 +++++++++ .../totalOverview.vue | 83 +-- .../verticalBarChart.vue | 222 ++++---- .../yearRelatedMetrics.vue | 258 +++++----- .../operatingLineBarSaleSingle.vue | 2 +- .../operatingSingleBar.vue | 122 +---- .../relatedIndicatorsAnalysis.vue | 145 +++--- .../operatingLineBarSaleSingle.vue | 2 +- .../operatingSingleBar.vue | 125 +---- .../relatedIndicatorsAnalysis.vue | 127 +++-- .../productionCostAnalysis/combustible.vue | 2 +- .../compositeClarifyingAgentCostAnalysis.vue | 297 +++++++++++ .../fuelCostAnalysis.vue | 2 +- .../procMfgOverheadCost.vue | 4 +- .../productionCostAnalysis/processingFuel.vue | 2 +- .../singleCombustible.vue | 2 +- .../singleProcessingFuel.vue | 2 +- .../dataTrendBarCCA.vue | 475 ++++++++++++++++++ .../dataTrendBarFuel.vue | 5 +- .../dataTrendBarSingleFuel.vue | 1 + .../dataTrendSingleCCA.vue | 250 +++++++++ .../monthlyThreeRelatedMetricsCCA.vue | 239 +++++++++ .../operatingLineBarSale.vue | 2 +- .../operatingSingleBar.vue | 2 +- .../relateFuelCostAnalysis.vue | 10 +- .../relateSingleFuelCostAnalysis.vue | 5 +- .../yearThreeRelatedMetricsCCA.vue | 239 +++++++++ .../monthlyRelatedMetrics.vue | 81 ++- .../monthlyThreeRelatedMetrics.vue | 94 ++-- .../operatingLineBarSaleSingle.vue | 2 +- .../operatingSingleBar.vue | 125 +---- .../relatedIndicatorsAnalysis.vue | 139 +++-- .../yearRelatedMetrics.vue | 80 ++- .../yearThreeRelatedMetrics.vue | 93 ++-- 59 files changed, 3909 insertions(+), 1779 deletions(-) create mode 100644 src/views/home/basicInfoConfiguration/components/customerInfoAdd.vue create mode 100644 src/views/home/basicInfoConfiguration/components/groupKeyAdd.vue create mode 100644 src/views/home/basicInfoConfiguration/components/productInfoAdd.vue create mode 100644 src/views/home/electricityCostAnalysis/electricityCostAnalysisBase.vue create mode 100644 src/views/home/electricityCostAnalysisComponents/relatedIndicatorsAnalysis.vue create mode 100644 src/views/home/productionCostAnalysis/compositeClarifyingAgentCostAnalysis.vue create mode 100644 src/views/home/productionCostAnalysisComponents/dataTrendBarCCA.vue create mode 100644 src/views/home/productionCostAnalysisComponents/dataTrendSingleCCA.vue create mode 100644 src/views/home/productionCostAnalysisComponents/monthlyThreeRelatedMetricsCCA.vue create mode 100644 src/views/home/productionCostAnalysisComponents/yearThreeRelatedMetricsCCA.vue diff --git a/.env.dev b/.env.dev index 7c7b6af3..7c750412 100644 --- a/.env.dev +++ b/.env.dev @@ -12,9 +12,9 @@ VUE_APP_TITLE = 洛玻集团驾驶舱 # 杨姗姗 # VUE_APP_BASE_API = 'http://172.16.20.218:7070' # 小田 -# VUE_APP_BASE_API = 'http://172.16.19.232:7070' +VUE_APP_BASE_API = 'http://172.16.19.232:7070' # 测试 -VUE_APP_BASE_API = 'http://192.168.0.35:8080' +# VUE_APP_BASE_API = 'http://192.168.0.35:8080' # 路由懒加载 diff --git a/src/permission.js b/src/permission.js index 2411ca6a..ae41dce2 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,11 +8,8 @@ import { isRelogin } from '@/utils/request' NProgress.configure({ showSpinner: false }) -/** - * 从菜单树中查找 jumpFlag===1 的默认跳转路径 - * 若打标在父节点则取其下第一个可见叶子路径;若在叶子则直接返回该路径 - */ -function findDefaultPathFromMenus(menus) { +// 从菜单树中查找第一个可见叶子菜单路径(按接口返回顺序) +function findFirstLeafPathFromMenus(menus) { if (!Array.isArray(menus) || menus.length === 0) return null function dfs(list, parentPath = '') { @@ -23,16 +20,11 @@ function findDefaultPathFromMenus(menus) { ? rawPath : `${parentPath}/${rawPath}`.replace(/\/+/g, '/') - if (item.jumpFlag === 1) { - if (item.children && item.children.length > 0) { - const childPath = dfs(item.children, currentPath) - return childPath != null ? childPath : currentPath - } - return currentPath - } if (item.children && item.children.length > 0) { const found = dfs(item.children, currentPath) if (found != null) return found + } else { + return currentPath } } return null @@ -40,6 +32,24 @@ function findDefaultPathFromMenus(menus) { return dfs(menus) } +function findFirstLeafPathFromRoutes(routes) { + if (!Array.isArray(routes) || routes.length === 0) return null + const stack = [...routes] + while (stack.length) { + const route = stack.shift() + if (!route || route.hidden === true) continue + if (Array.isArray(route.children) && route.children.length > 0) { + stack.unshift(...route.children) + continue + } + const p = route.path || '' + if (typeof p === 'string' && p.startsWith('/') && p !== '/404') { + return p + } + } + return null +} + // 增加三方登陆 update by 芋艿 const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee'] @@ -65,11 +75,16 @@ router.beforeEach((to, from, next) => { store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => { // 根据 roles 权限生成可访问的路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表 - const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/' + const menuDefaultPath = findFirstLeafPathFromMenus(userInfo.menus) + const routeFallbackPath = findFirstLeafPathFromRoutes(accessRoutes) + const defaultPath = menuDefaultPath || routeFallbackPath || '/' store.dispatch('SetDefaultPath', defaultPath) // 仅当目标为根路径 '/' 时跳默认页;否则保持当前路径(含刷新场景),避免刷新被误判为“未匹配”而跳到默认页 if (to.path === '/') { - next({ path: defaultPath, replace: true }) + const matched = router.match(defaultPath) + const hasMatch = matched && Array.isArray(matched.matched) && matched.matched.length > 0 + const safePath = hasMatch ? defaultPath : (routeFallbackPath || '/') + next({ path: safePath, replace: true }) } else { next({ ...to, replace: true }) // hack方法 确保addRoutes已完成,当前页刷新时保留 to 的路径 } diff --git a/src/views/error/404.vue b/src/views/error/404.vue index 96f075c1..79849629 100644 --- a/src/views/error/404.vue +++ b/src/views/error/404.vue @@ -17,8 +17,8 @@
-
+ 环比{{ formatRate(factoryData?.thb) }}%
+
+
-
+ 同比{{ formatRate(factoryData?.thb) }}%
+
+