From 938348fc70fe2f2332793c7e9d66acf07691936a Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期一, 08 九月 2025 15:06:25 +0800 Subject: [PATCH] feat(bigScreen): 添加键盘控制功能并优化界面显示 --- src/views/dry/bigScreen/BigEqp-tjt.vue | 52 +++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/views/dry/bigScreen/BigEqp-tjt.vue b/src/views/dry/bigScreen/BigEqp-tjt.vue index 1dc991d..120aea8 100644 --- a/src/views/dry/bigScreen/BigEqp-tjt.vue +++ b/src/views/dry/bigScreen/BigEqp-tjt.vue @@ -2190,15 +2190,53 @@ router.back() } + + function handleKeyDown(event) { + event.preventDefault() + if (event.key === 'ArrowUp') { + num-- + if (num < 0) { + num = eqps.value.length + } + if (eqps.value.length > 0) { + var i = num % eqps.value.length + //eqp.value = eqps.value[i] + // console.log("777",i); + eqpNum.value = i + //console.log("888",eqp.value); + queryRealTime() + //setTimeout(initCharts, 500) + } + } else if (event.key === 'ArrowDown') { + num++ + if (eqps.value.length > 0) { + var i = num % eqps.value.length + //eqp.value = eqps.value[i] + // console.log("777",i); + eqpNum.value = i + //console.log("888",eqp.value); + queryRealTime() + //setTimeout(initCharts, 500) + } + } else if (event.key === 'Tab') { + back(); + } + } listAllEqp() //queryEqp() // DOM鎸傝浇瀹屾垚鍚庢覆鏌撳浘琛� onMounted(() => { + // 娣诲姞閿洏浜嬩欢鐩戝惉鍣� + window.addEventListener('keydown', handleKeyDown) + // 鑾峰彇鐒︾偣 + Timer.value = setInterval(queryRealTime, 3000) Timer2.value = setInterval(moveImage, 50) }) onUnmounted(() => { + // 绉婚櫎閿洏浜嬩欢鐩戝惉鍣� + window.removeEventListener('keydown', handleKeyDown) clearInterval(Timer.value) clearInterval(Timer2.value) Timer.value = null @@ -2270,7 +2308,7 @@ color: white; } .subhead { - color: #a19f9c; + color: #cdcdcd; font-size: 16px; padding-left: 10px; } @@ -2281,8 +2319,8 @@ font-size: 16px; } .subhead2 { - color: #a19f9c; - font-size: 10px; + color: #cdcdcd; + font-size: 12px; padding-left: 0px; } .zhengqi { @@ -2439,7 +2477,7 @@ .herbInfo { width: 362px; height: 440px; - color: #727272; + color: #ffffff; } .curEqp { @@ -2455,10 +2493,10 @@ height: 260px; /* background: white; border-radius: 10px; */ - + opacity: 0.7; background-repeat: no-repeat; - background-size: 200px; - background-position: 0px 10px; + background-size: 120px; + background-position: 14px 10px; } .tempMoisChart { width: 736px; -- Gitblit v1.9.3