From d4495e97f126bbbde5eecee17a167d28853e3478 Mon Sep 17 00:00:00 2001 From: zwq Date: Thu, 3 Jul 2025 11:08:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/allDashboard/index-model.vue | 28 ++- src/views/dashboard/allDashboard/index.vue | 82 +++++---- .../dashboard/coldDashboard/index-model.vue | 13 +- src/views/dashboard/coldDashboard/index.vue | 161 +++++++++--------- .../dashboard/rawDashboard/index-model.vue | 6 +- src/views/dashboard/rawDashboard/index.vue | 6 +- 6 files changed, 155 insertions(+), 141 deletions(-) diff --git a/src/views/dashboard/allDashboard/index-model.vue b/src/views/dashboard/allDashboard/index-model.vue index 637bc711..9b0b16fe 100644 --- a/src/views/dashboard/allDashboard/index-model.vue +++ b/src/views/dashboard/allDashboard/index-model.vue @@ -26,22 +26,36 @@
-
{{ Number(topData.yestodaySum).toFixed(1) }}
+
+ {{ + topData.yestodaySum ? Number(topData.yestodaySum).toFixed(1) : '-' + }} +
昨日总成本/万元
- {{ Number(topData.yestodayRatio).toFixed(1) }}% + {{ + topData.yestodayRatio + ? Number(topData.yestodayRatio).toFixed(1) + : '-' + }}%
昨日良品率
-
{{ Number(topData.monthSum).toFixed(1) }}
+
+ {{ topData.monthSum ? Number(topData.monthSum).toFixed(1) : '-' }} +
本月总成本/万元
- {{ Number(topData.monthAreaCost).toFixed(1) }} + {{ + topData.monthAreaCost + ? Number(topData.monthAreaCost).toFixed(1) + : '-' + }}
本月每平米总成本/元
@@ -81,7 +95,7 @@ 二氧化硫 排放浓度
- {{ Number(topData.so2).toFixed(1) }} + {{ topData.so2 ? Number(topData.so2).toFixed(1) : '-' }} mg/m³
@@ -91,7 +105,7 @@ 粉尘排放
- {{ Number(topData.fc).toFixed(1) }} + {{ topData.fc ? Number(topData.fc).toFixed(1) : '-' }} mg/m³
@@ -101,7 +115,7 @@ 氮氧化物 排放浓度
- {{ Number(topData.no).toFixed(1) }} + {{ topData.no ? Number(topData.no).toFixed(1) : '-' }} mg/m³
diff --git a/src/views/dashboard/allDashboard/index.vue b/src/views/dashboard/allDashboard/index.vue index e89bc9ea..f60e3053 100644 --- a/src/views/dashboard/allDashboard/index.vue +++ b/src/views/dashboard/allDashboard/index.vue @@ -26,22 +26,36 @@
-
{{ Number(topData.yestodaySum).toFixed(1) }}
+
+ {{ + topData.yestodaySum ? Number(topData.yestodaySum).toFixed(1) : '-' + }} +
昨日总成本/万元
- {{ Number(topData.yestodayRatio).toFixed(1) }}% + {{ + topData.yestodayRatio + ? Number(topData.yestodayRatio).toFixed(1) + : '-' + }}%
昨日良品率
-
{{ Number(topData.monthSum).toFixed(1) }}
+
+ {{ topData.monthSum ? Number(topData.monthSum).toFixed(1) : '-' }} +
本月总成本/万元
- {{ Number(topData.monthAreaCost).toFixed(1) }} + {{ + topData.monthAreaCost + ? Number(topData.monthAreaCost).toFixed(1) + : '-' + }}
本月每平米总成本/元
@@ -73,13 +87,15 @@ margin: 10px 30px; gap: 12px; "> -
-
+
+
二氧化硫 排放浓度
- {{ Number(topData.so2).toFixed(1) }} + {{ topData.so2 ? Number(topData.so2).toFixed(1) : '-' }} mg/m³
@@ -89,7 +105,7 @@ 粉尘排放
- {{ Number(topData.fc).toFixed(1) }} + {{ topData.fc ? Number(topData.fc).toFixed(1) : '-' }} mg/m³
@@ -99,7 +115,7 @@ 氮氧化物 排放浓度
- {{ Number(topData.no).toFixed(1) }} + {{ topData.no ? Number(topData.no).toFixed(1) : '-' }} mg/m³
@@ -260,7 +276,7 @@ export default { } else { this.permission = false; } - this.initWebSocket(); + this.initWebSocket(); }); }, destroy() { @@ -352,37 +368,37 @@ export default { // 数据接收 if ('factoryState' in dataJson) { this.topData = dataJson.factoryState; - if(!this.permission){ - this.topData.monthAreaCost = '***' - this.topData.monthSum = '***' - this.topData.yestodaySum = '***' - } + if (!this.permission) { + this.topData.monthAreaCost = '***'; + this.topData.monthSum = '***'; + this.topData.yestodaySum = '***'; + } } if ('factoryCostTableList' in dataJson) { this.tableData1 = dataJson.factoryCostTableList; - if(!this.permission){ - this.tableData1.forEach(item=>{ - item.priceS = null - item.matPriceS = null - item.energyPriceS = null - item.otherPriceS = null - item.areaPriceS = null - }) - } + if (!this.permission) { + this.tableData1.forEach((item) => { + item.priceS = null; + item.matPriceS = null; + item.energyPriceS = null; + item.otherPriceS = null; + item.areaPriceS = null; + }); + } } if ('factoryEnergyTableList' in dataJson) { this.tableData2 = dataJson.factoryEnergyTableList; - if(!this.permission){ - this.tableData2.forEach(item=>{ - item.price = null - }) - } + if (!this.permission) { + this.tableData2.forEach((item) => { + item.price = null; + }); + } } if ('factoryCostTrendList' in dataJson) { this.echartData = dataJson.factoryCostTrendList; - this.$nextTick(()=>{ - this.$refs.chartRef.initChart(!this.permission); - }) + this.$nextTick(() => { + this.$refs.chartRef.initChart(!this.permission); + }); } }, websocketsend(val) { @@ -525,7 +541,7 @@ export default { padding-top: 12px; padding-left: 12px; float: left; - margin-right: 10px; + margin-right: 10px; } .middle2-right { font-weight: 600; diff --git a/src/views/dashboard/coldDashboard/index-model.vue b/src/views/dashboard/coldDashboard/index-model.vue index 5fed683f..02c71888 100644 --- a/src/views/dashboard/coldDashboard/index-model.vue +++ b/src/views/dashboard/coldDashboard/index-model.vue @@ -35,7 +35,6 @@ export default { return { isFullScreen: false, scaleNum: 1, - permission: false, url: process.env.VUE_APP_WS_API, websock: '', line1: {}, @@ -46,16 +45,7 @@ export default { }, created() { this.init(); - this.permission = false; - getUserProfile().then((response) => { - const user = response.data; - if (user.roles[0].name !== 'dashborad') { - this.permission = true; - } else { - this.permission = false; - } - this.initWebSocket(); - }); + this.initWebSocket(); }, mounted() { this.boxReset(); @@ -133,7 +123,6 @@ export default { console.log('websocket: [unable to msgData] : ', e.data); } if (!Object.prototype.toString.call(msgData).includes('Object')) return; - if (!this.permission) return; msgData.originRatioTables && msgData.originRatioTables.forEach((item) => { item.lineName.includes('1') && (this.line1 = item); diff --git a/src/views/dashboard/coldDashboard/index.vue b/src/views/dashboard/coldDashboard/index.vue index 2a8cd01a..68d10e38 100644 --- a/src/views/dashboard/coldDashboard/index.vue +++ b/src/views/dashboard/coldDashboard/index.vue @@ -1,16 +1,23 @@ - \ No newline at end of file + diff --git a/src/views/dashboard/rawDashboard/index-model.vue b/src/views/dashboard/rawDashboard/index-model.vue index b848b82f..380fd400 100644 --- a/src/views/dashboard/rawDashboard/index-model.vue +++ b/src/views/dashboard/rawDashboard/index-model.vue @@ -89,7 +89,7 @@ 二氧化硫 排放浓度
- {{ Number(topData.so2).toFixed(1) }} + {{ topData.so2 ? Number(topData.so2).toFixed(1) : '-' }} mg/m³
@@ -99,7 +99,7 @@ 粉尘排放
- {{ Number(topData.fc).toFixed(1) }} + {{ topData.fc ? Number(topData.fc).toFixed(1) : '-' }} mg/m³
@@ -109,7 +109,7 @@ 氮氧化物 排放浓度
- {{ Number(topData.no).toFixed(1) }} + {{ topData.no ? Number(topData.no).toFixed(1) : '-' }} mg/m³
diff --git a/src/views/dashboard/rawDashboard/index.vue b/src/views/dashboard/rawDashboard/index.vue index 725c26bb..f533c27f 100644 --- a/src/views/dashboard/rawDashboard/index.vue +++ b/src/views/dashboard/rawDashboard/index.vue @@ -83,7 +83,7 @@ 二氧化硫 排放浓度
- {{ Number(topData.so2).toFixed(1) }} + {{ topData.so2 ? Number(topData.so2).toFixed(1) : '-' }} mg/m³
@@ -93,7 +93,7 @@ 粉尘排放
- {{ Number(topData.fc).toFixed(1) }} + {{ topData.fc ? Number(topData.fc).toFixed(1) : '-' }} mg/m³
@@ -103,7 +103,7 @@ 氮氧化物 排放浓度
- {{ Number(topData.no).toFixed(1) }} + {{ topData.no ? Number(topData.no).toFixed(1) : '-' }} mg/m³