From 47f5510056187904e26683559c47505a29c84655 Mon Sep 17 00:00:00 2001 From: bsw215583320 <baoshiwei121@163.com> Date: 星期六, 05 八月 2023 14:38:47 +0800 Subject: [PATCH] 在底部加入日期时间显示 --- src/views/dry/bigScreen/BigWorkShop.vue | 120 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 96 insertions(+), 24 deletions(-) diff --git a/src/views/dry/bigScreen/BigWorkShop.vue b/src/views/dry/bigScreen/BigWorkShop.vue index 902e6c9..af6143f 100644 --- a/src/views/dry/bigScreen/BigWorkShop.vue +++ b/src/views/dry/bigScreen/BigWorkShop.vue @@ -17,12 +17,12 @@ <div class="body"> <div class="humiture"> <div style="display: flex; width: 120px"> - <Icon style="color: #f7b733" icon="solar:temperature-line-duotone" :size="28" /> + <Icon style="color: #ba9853" icon="mdi:home-temperature-outline" :size="28" /> <div style="font-size: 20px; line-height: 26px"> 26 鈩� </div> </div> <div style="display: flex"> - <Icon style="color: #f7b733" icon="material-symbols:humidity-percentage-outline" :size="28" /> + <Icon style="color: #ba9853" icon="wi:humidity" :size="28" /> <div style="font-size: 20px; line-height: 26px"> 53 %rh </div> </div> @@ -43,22 +43,34 @@ trailColor="#2b2b2b2b" :show-info="false" /> - <!-- <div class="eqp-name">50%</div> --> + <div class="eqp-timer"> + <div><Icon style="color: rgb(42 154 234)" icon="mdi:clock-outline" :size="20" /> + {{realTime.get(eqpCodes[num - 1])?.dryTime || 0}} min + </div> + <div><Icon style="color: rgb(134 207 106)" icon="gg:sand-clock" :size="20" /> + {{ realTime.get(eqpCodes[num - 1])?.totalRemain||0}} min + </div> + </div> </div> <div class="eqp-info-up"> - <div class="herb">{{ realTime.get(eqpCodes[num - 1])?.herbName || '鏆傛棤' }}</div> + <div class="herb"> + <div>{{ realTime.get(eqpCodes[num - 1])?.herbName || '鏆傛棤' }}</div> + <!-- <div>33 Kg</div> --> + </div> + </div> + <div class="weight"><div class="herb">{{ realTime.get(eqpCodes[num - 1])?.originWeight || 0 }} Kg</div></div> <div class="water"> <div class="temp"> - <div style="line-height: 28px"><Icon style="color: #2a5a63" icon="ic:twotone-water-drop" :size="28" /> </div> + <div style="line-height: 28px"><Icon style="color: #1850b7" icon="ic:twotone-water-drop" :size="28" /> </div> <div class="font"> - <span class="value"> {{ realTime.get(eqpCodes[num - 1])?.trendVo.moisture || '0' }}</span> % + <span class="value"> {{ realTime.get(eqpCodes[num - 1])?.trendVo?.moisture || '0' }}</span> % </div> </div> <div class="temp"> - <div style="line-height: 28px"><Icon style="color: #6c5b7b" icon="solar:temperature-bold-duotone" :size="30" /> </div> + <div style="line-height: 28px"><Icon style="color: #873853" icon="fluent:temperature-20-regular" :size="30" /> </div> <div class="font"> - <span class="value">{{ realTime.get(eqpCodes[num - 1])?.trendVo.bellowsTemp || '0' }} </span> 鈩� + <span class="value">{{ realTime.get(eqpCodes[num - 1])?.trendVo?.bellowsTemp || '0' }} </span> 鈩� </div> </div> </div> @@ -71,26 +83,28 @@ <div class="eqp-info-down"> <div class="herb">{{ realTime.get(eqpCodes[num + 3])?.herbName || '鏆傛棤' }}</div> </div> + <div class="weight"><div class="herb">{{ realTime.get(eqpCodes[num + 3])?.originWeight || 0 }} Kg </div></div> <div class="water"> <div class="temp"> <div style="line-height: 28px"> - <Icon style="color: #2a5a63" icon="ic:twotone-water-drop" :size="28" /> + <Icon style="color: #1850b7" icon="ic:twotone-water-drop" :size="28" /> </div> <div class="font"> - <span class="value">{{ realTime.get(eqpCodes[num + 3])?.trendVo.moisture || '0' }}</span> % + <span class="value">{{ realTime.get(eqpCodes[num + 3])?.trendVo?.moisture || '0' }}</span> % </div> </div> <div class="temp"> - <div style="line-height: 28px"><Icon style="color: #6c5b7b" icon="solar:temperature-bold-duotone" :size="30" /> </div> + <div style="line-height: 28px"><Icon style="color: #873853" icon="fluent:temperature-20-regular" :size="30" /> </div> <div class="font"> - <span class="value">{{ realTime.get(eqpCodes[num + 3])?.trendVo.bellowsTemp || '0' }}</span> 鈩� + <span class="value">{{ realTime.get(eqpCodes[num + 3])?.trendVo?.bellowsTemp || '0' }}</span> 鈩� </div> </div> </div> - <div style="height: 70px"></div> + <div style="height: 50px"></div> <div class="eqp-title"> - <!-- <div class="process"> </div> --> + <div class="eqp-name-down">{{ eqpMap.get(eqpCodes[num + 3])?.name || '棰勭暀' }}</div> + <Progress :stroke-color="{ from: '#108ee9', @@ -102,10 +116,22 @@ :show-info="false" /> <!-- <div class="eqp-name">50%</div> --> - <div class="eqp-name-down">{{ eqpMap.get(eqpCodes[num + 3])?.name || '棰勭暀' }}</div> + <div class="eqp-timer"> + <div><Icon style="color: rgb(42 154 234)" icon="mdi:clock-outline" :size="20" /> + {{realTime.get(eqpCodes[num + 3])?.dryTime || 0}} min + </div> + <div><Icon style="color: rgb(134 207 106)" icon="gg:sand-clock" :size="20" /> + {{ realTime.get(eqpCodes[num + 3])?.totalRemain||0}} min + </div> + </div> </div> </div> </div> + </div> + <div class="footer"> + + <div >{{ nowDate }}</div> + <div >{{ nowTime }}</div> </div> </div> </div> @@ -124,13 +150,16 @@ import { useUserStore } from '/@/store/modules/user' const eqpNum = ref(4) const eqpMap = ref(new Map()) - const eqpCodes = ref(['GM001', 'GM002', 'GM003', 'GM004', 'GM005', 'GM006']) + const eqpCodes = ref(['GM001', 'GM002', 'GM003', 'GM004', 'GM005', 'GM006', 'GM007', 'GM008']) const eqps = ref([] as dryEquipment[]) const userStore = useUserStore() const Timer = ref() const realTime = ref(new Map()) + const nowTime = ref() + const nowDate = ref() + function listAllEqp() { listAll({ enable: 'Y' }) @@ -163,7 +192,16 @@ //console.log(`output->res`, res) if (res && res.trendVo) { res.tempValue = [res.windTemp, 100] - res.percent = ((res.dryTime / (res.dryTime + res.remain)) * 100).toFixed(2) + res.totalRemain = res.remain + if (res.detailList) { + // 骞茬嚗鍓╀綑鏃堕棿=宸ュ崟棰勮鍓╀綑-锛堝綋鍓嶅共鐕ユ椂闂�-鏈�鍚庝竴娆¤褰曞共鐕ユ椂闂达級 + res.totalRemain = res.remain-(res.dryTime-res.detailList[res.detailList.length - 1].totalTime) + } + if(res.totalRemain < 0) { + res.totalRemain = 0 + } + + res.percent = ((res.dryTime / (res.dryTime + res.totalRemain)) * 100).toFixed(2) } else { res = { tempValue: [0, 100], @@ -181,9 +219,18 @@ } } + function getNowTime() { + var date = new Date() + nowDate.value = (date.getFullYear()) + "/" + (date.getMonth()< 9? "0" + (date.getMonth() + 1): date.getMonth() + 1) + "/" + (date.getDay() < 10? "0" + date.getDay() : date.getDay()) + nowTime.value = "" + (date.getHours()<10? "0" + date.getHours() : date.getHours()) + ":" + (date.getMinutes()< 10? "0" + date.getMinutes(): date.getMinutes()) + //console.log("鑾峰彇褰撳墠鏃堕棿锛�"); + } + + getNowTime() listAllEqp() onMounted(() => { Timer.value = setInterval(updateRealTime, 3000) + setInterval(getNowTime,10000) }) onUnmounted(() => { @@ -254,15 +301,15 @@ } .eqpInfoup { width: 280px; - height: 300px; - margin: 0 41px; + height: 315px; + margin: -20px 41px; display: flex; flex-direction: column; } .eqpInfodown { width: 280px; - height: 300px; + height: 315px; margin: 0 41px; display: flex; flex-direction: column; @@ -286,7 +333,7 @@ } .eqp-title { - height: 30px; + height: 45px; border-radius: 20px; /* background: rgb(182, 182, 182); border: 1px solid green; */ @@ -298,6 +345,15 @@ text-align: center; color: white; margin-top: -30px; + } + + .eqp-timer { + line-height: 30px; + text-align: center; + color: white; + margin-top: 6px; + justify-content: space-around; + display: flex; } .eqp-name-down { @@ -320,9 +376,15 @@ display: flex; } + .weight { + flex: 1; + display: flex; + font-size: 16px; + } + .eqp-info-down { flex: 1; - padding-top: 50px; + padding-top: 70px; display: flex; } @@ -349,7 +411,17 @@ line-height: 26px; } - .value { + + .footer { + height: 160px; + display: flex; + padding: 10px 20px; + font-size: 30px; + flex-direction: column-reverse; + align-items: flex-end; + color: white; + line-height: 40px; + } :deep() .progress { padding: 25px 25px; @@ -361,6 +433,6 @@ height: 25px !important; } :deep() .ant-progress-inner { - background-color: rgb(197 197 197 / 52%) !important; + background-color: rgb(197 197 197 / 84%) !important; } </style> -- Gitblit v1.9.3