From 220db80e605945ced1b33443020933206b0915db Mon Sep 17 00:00:00 2001
From: baoshiwei <baoshiwei@shlanbao.cn>
Date: 星期四, 24 七月 2025 14:56:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'bak/master' into master-lpyun

---
 src/views/dry/bigScreen/BigWorkShop.vue |   67 +++++++++++++++++++++++----------
 1 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/src/views/dry/bigScreen/BigWorkShop.vue b/src/views/dry/bigScreen/BigWorkShop.vue
index 1d764c7..9ca3231 100644
--- a/src/views/dry/bigScreen/BigWorkShop.vue
+++ b/src/views/dry/bigScreen/BigWorkShop.vue
@@ -34,12 +34,12 @@
 									<div class="statistics putincolor">
 										<div class="stat_label font16"> 鎬绘姇鏂欓噺 </div>
 										<div class="stat_value">
-											{{ originWeight.toFixed(2) }}
+											{{ originWeight?.toFixed(2) || 0 }}
 											<span class="font16"> Kg </span>
 										</div>
 										<div class="stat_avg">
 											<div> 棰勮浜ч噺 </div>
-											<div> {{ totalYield.toFixed(2) }} kg </div>
+											<div> {{ totalYield?.toFixed(2) || 0 }} kg </div>
 										</div>
 									</div>
 								</dv-border-box7>
@@ -47,12 +47,12 @@
 									<div class="statistics putincolor">
 										<div class="stat_label font16"> 鐢甸噺娑堣�� </div>
 										<div class="stat_value">
-											{{ watt.toFixed(2) }}
+											{{ watt?.toFixed(2) || 0 }}
 											<span class="font16"> Kwh </span>
 										</div>
 										<div class="stat_avg">
 											<div> 骞冲潎鐢佃�� </div>
-											<div> {{wattAvg.toFixed(2)}} Kwh/kg </div>
+											<div> {{wattAvg?.toFixed(2) || 0}} Kwh/kg </div>
 										</div>
 									</div>
 								</dv-border-box7>
@@ -60,12 +60,12 @@
 									<div class="statistics putincolor">
 										<div class="stat_label font16"> 钂告苯娑堣�� </div>
 										<div class="stat_value">
-											{{ steam.toFixed(2) }}
+											{{ steam?.toFixed(2) || 0 }}
 											<span class="font16"> m鲁 </span>
 										</div>
 										<div class="stat_avg">
 											<div> 骞冲潎姹借�� </div>
-											<div> {{steamAvg.toFixed(2)}} m鲁 </div>
+											<div> {{steamAvg?.toFixed(2) || 0}} m鲁/kg </div>
 										</div>
 									</div>
 								</dv-border-box7>
@@ -155,11 +155,11 @@
 									<div class="eqp-timer">
 										<div
 											><Icon style="color: #1850b7" icon="ic:twotone-water-drop" :size="20" />
-											{{ realTime.get(eqpCodes[num - 1])?.trendVo?.moisture.toFixed(1) || '0' }} %
+											{{ realTime.get(eqpCodes[num - 1])?.trendVo?.moisture?.toFixed(1) || '0' }} %
 										</div>
 										<div
 											><Icon style="color: #873853" icon="fluent:temperature-20-regular" :size="20" />
-											{{ realTime.get(eqpCodes[num - 1])?.trendVo?.bellowsTemp.toFixed(0) || '0' }} 鈩�
+											{{ realTime.get(eqpCodes[num - 1])?.trendVo?.bellowsTemp?.toFixed(0) || '0' }} 鈩�
 										</div>
 										<div
 											><Icon style="color: rgb(134 207 106)" icon="gg:sand-clock" :size="20" />
@@ -247,11 +247,11 @@
 									<div class="eqp-timer">
 										<div
 											><Icon style="color: #1850b7" icon="ic:twotone-water-drop" :size="20" />
-											{{ realTime.get(eqpCodes[num + 3])?.trendVo?.moisture.toFixed(1) || '0' }} %
+											{{ realTime.get(eqpCodes[num + 3])?.trendVo?.moisture?.toFixed(1) || '0' }} %
 										</div>
 										<div
 											><Icon style="color: #873853" icon="fluent:temperature-20-regular" :size="20" />
-											{{ realTime.get(eqpCodes[num + 3])?.trendVo?.bellowsTemp.toFixed(0) || '0' }} 鈩�
+											{{ realTime.get(eqpCodes[num + 3])?.trendVo?.bellowsTemp?.toFixed(0) || '0' }} 鈩�
 										</div>
 										<!-- <div><Icon style="color: rgb(42 154 234)" icon="mdi:clock-outline" :size="20" />
 											 {{realTime.get(eqpCodes[num + 3])?.dryTime || 0}} min
@@ -285,12 +285,18 @@
 	import { router } from '/@/router'
 	import { defHttp } from '/@/utils/http/axios'
 	import { useUserStore } from '/@/store/modules/user'
+  import {setAuthCache} from "/@/utils/auth";
+  import {TENANT_ID} from "/@/enums/cacheEnum";
 	const eqpNum = ref(4)
 	const eqpMap = ref(new Map())
 	const eqpCodes = ref(['GM001', 'GM002', 'GM003', 'GM004', 'GM005', 'GM006', 'GM007', 'GM008'])
 	const eqps = ref([] as dryEquipment[])
-	const title = ref('鍏版郸鏅鸿兘骞茬嚗杞﹂棿')
+	const title = ref('鏅鸿兘骞茬嚗杞﹂棿')
 	const userStore = useUserStore()
+  const tenantId = ref(router.currentRoute.value.query.tenantId | userStore.getTenant)
+  setAuthCache(TENANT_ID, tenantId.value)
+  console.log('tenantId1', router.currentRoute.value.query.tenantId)
+  console.log('tenantId2', userStore.getTenant)
 	const envHum = ref(0)
 	const envTemp = ref(0)
 	const originWeight = ref(0)
@@ -314,9 +320,9 @@
 	const nowDate = ref()
 
 	function listAllEqp() {
-		listAll({ enable: 'Y' })
+    defHttp.get({ url: '/dry/real/queryAllEqps', params: { tenantId: tenantId.value,enable: 'Y'  } })
 			.then((result) => {
-				console.log(`output->result`, result)
+				// (`output->result`, result)
 				eqps.value = result
 
 				result.forEach((item) => {
@@ -325,7 +331,7 @@
 				updateRealTime()
 			})
 			.catch((err) => {
-				console.log(`output->err`, err)
+				// console.log(`output->err`, err)
 			})
 	}
 
@@ -340,8 +346,8 @@
 	}
 
 	function queryWorkShopStatistics() {
-		let tenantId = userStore.getTenant
-		defHttp.get({ url: '/dry/real/workshopStatistics', params: { tenantid: tenantId } }).then((res) => {
+
+		defHttp.get({ url: '/dry/real/workshopStatistics', params: { tenantid: tenantId.value } }).then((res) => {
 			console.log(`output->res`, res)
 			steam.value = res.steam
 			watt.value = res.watt
@@ -358,17 +364,19 @@
 	}
 
 	function queryRealTime(eqp: dryEquipment) {
-		let tenantId = userStore.getTenant
+
 		let eqpCode = eqp.code
 		let queryRealTimeUrl = '/dry/real/getRealTimeData'
-		defHttp.get({ url: queryRealTimeUrl, params: { tenantid: tenantId, machineid: eqpCode } }).then((res) => {
+		defHttp.get({ url: queryRealTimeUrl, params: { tenantid: tenantId.value, machineid: eqpCode } }).then((res) => {
 			if (res && res.trendVo) {
 				res.tempValue = [res.windTemp, 100]
 				res.totalRemain = res.remain
-				if (res.detailList) {
+				if (res.detailList && res.detailList.length > 0) {
 					// 骞茬嚗鍓╀綑鏃堕棿=宸ュ崟棰勮鍓╀綑-锛堝綋鍓嶅共鐕ユ椂闂�-鏈�鍚庝竴娆¤褰曞共鐕ユ椂闂达級
 					res.totalRemain = res.remain - (res.dryTime - res.detailList[res.detailList.length - 1].totalTime)
-				}
+				} else {
+          res.totalRemain = res.remain - res.dryTime
+        }
 				if (res.totalRemain < 0) {
 					res.totalRemain = 0
 				}
@@ -386,7 +394,7 @@
 		})
 	}
 	function gotoeqp(num) {
-		console.log('璺宠浆鏈哄彴', num)
+		//console.log('璺宠浆鏈哄彴', num)
 		if (num < eqpCodes.value.length) {
 			router.push({ path: '/bigEqp', query: { num: num } })
 		}
@@ -411,6 +419,23 @@
 		return data ? (data.fault ? data.fault : data.warning ? data.warning : data.level ? data.level : '绌洪棽') : '绌洪棽'
 	}
 
+  function covertStatus(status){
+    //console.log('status',status)
+    switch (status) {
+      case '0':
+        return '鍑嗗闃舵'
+      case '1':
+        return '涓婃枡闃舵'
+      case '2':
+        return '骞茬嚗闃舵'
+      case '3':
+        return '鏆傚仠'
+      case '4':
+        return '骞茬嚗瀹屾垚'
+
+    }
+  }
+  console.log("router-param", router.currentRoute.value.params.tenant);
 	getNowTime()
 	listAllEqp()
 	onMounted(() => {

--
Gitblit v1.9.3