From 0ecae4ec9e790c4eba150e3665c00fc61b01537b Mon Sep 17 00:00:00 2001 From: lld <15027638633@163.com> Date: Wed, 25 Feb 2026 13:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=92=8Ccss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/control/automatic.vue | 109 +++++++++++++------------------ 1 file changed, 44 insertions(+), 65 deletions(-) diff --git a/pages/home/control/automatic.vue b/pages/home/control/automatic.vue index dd6b496..5eb9817 100644 --- a/pages/home/control/automatic.vue +++ b/pages/home/control/automatic.vue @@ -135,6 +135,36 @@ + + + + + {{ `【${selectedText} - ${currentCard.name}】设置` }} + + 当前时间: + {{ currentCardTime > 0 ? `${currentCardTime} 秒` : '未设置' }} + + + 修改后时间: + + + + + + + 别名设置: + + + + + + + + @@ -303,16 +333,20 @@ export default { }, methods: { + // 滑动切换卷膜 change(e) { this.current =e.detail.current }, + // 切换卷膜 switchTab(e) { this.current=e.index }, + // 左上角选择时间 confirmTemp(event) { this.result = event[0]['label'] console.info(`选择温度:${event[0]['label']}`) }, + // 下拉刷新以及进入组件渲染 refresh() { this.termList = { "jm1": [], @@ -324,24 +358,7 @@ export default { this.getSwiperHeight(); // 页面初始化时也计算一次 }); }, - openDataModal(sensorCard) { - if ((store.getters && store.getters.name !== 'admin') - && this.$auth.hasRole("test")) { - return; - } - this.sensorCard = sensorCard; - this.remark = this.dtu_remark[sensorCard.key] || sensorCard.label; - }, - - // 优化:封装温湿度单位判断函数 - isEffectiveValue(value) { - return this.testNumber(value); - }, - testNumber(data) { - const reg = /^-?\d+(\.\d+)?$/; - return reg.test(String(data).trim()); - }, - // 新增:打开修改运行时间的弹窗 + // 修改运行时间以及设备备注弹窗 openTimeModal(card) { if ((store.getters && store.getters.name !== 'admin') && this.$auth.hasRole("test")) { @@ -353,7 +370,7 @@ export default { this.remark = this.dtu_remark[card.type] || card.name; this.$refs.inputDialog.open() }, - // 卡片点击事件(实际项目中调用接口修改状态) 功能标识 + // 设备控制 handleCardClick(status, type) { const funcMsg = "该功能用来开启或暂停设备,按钮亮为开启,按钮暗为暂停设备" if ((store.getters && store.getters.name !== 'admin') @@ -414,6 +431,7 @@ export default { } }) }, + // 修改运行时间以及备注 点击关闭 close() { this.$refs.inputDialog.close() }, @@ -490,7 +508,7 @@ export default { : await addLimit(limitTimes); if (limitRes.code === 200) { isAllSuccess = true; - this.getAgriByImei(); + this.$emit("getAgriLimit") } } @@ -523,23 +541,14 @@ export default { } }); }, - - getAgriByImei() { - getAgriByImei(this.imei).then(response => { - if (response.code === 200) { - if (!response.data) { - return; - } - this.limitTimes = response.data; - } - }) - }, + // 添加条件更新窗口高度 updateSwiperHeight() { if (this.termList[this.term[this.current]].length>4) { // 加上 param-setting 和 add-term 的高度,以及一些间距 this.swiperHeight = this.swiperHeight + 160; } }, + // 获取窗口高度 getSwiperHeight() { this.swiperHeight = 800; var length = this.termList[this.term[this.current]].length-4; @@ -547,6 +556,7 @@ export default { this.swiperHeight = this.swiperHeight + 160*length ; } }, + // 添加条件方法 addTerm() { var tempList = this.termList[this.term[this.current]]; if (tempList.length >= this.maxTermLength) { @@ -572,6 +582,7 @@ export default { // 确保value是字符串/数字,避免拼接出错 return `${value}${unit}`; }, + // 删除条件 onDeleteItem(event, id) { const currentKey = this.term[this.current]; const tempList = this.termList[currentKey]; @@ -593,13 +604,14 @@ export default { }); }); }, + // 选择运行时间 changeTime(timeTag, timeIndex) { this.timeTag = timeTag; this.timeIndex = timeIndex; this.selectTime = true; }, + // 选择时间串口点击确定 confirmTime(time) { - console.info(this.termList[this.term[this.current]]) this.termList[this.term[this.current]][this.timeIndex][this.timeTag] = `${time.hour}:${time.minute}` }, } @@ -691,26 +703,6 @@ export default { padding-bottom: 15rpx; } -.text { - width: 50rpx; - margin: 10rpx 10rpx 8rpx 0; - padding: 0; - height: 70rpx; - line-height: 70rpx; - text-align: center; - font-size: 26rpx; - box-shadow: 0 2rpx 8rpx #bfbec1 -} - -.tempStyle, .humiStyle { - display: inline-block; - font-size: 12px; -} - -.text:first-child { - margin-left: 10rpx; -} - .uni-view { -webkit-flex: 1; flex: 1; @@ -721,19 +713,6 @@ export default { align-items: center; } -.data { - font-size: 13px; - display: inline-block; - line-height: 23px; - color: #3a3a3a; -} - -.data:nth-child(even) { - font-size: 12px; - margin-top: 3px; - color: #9c9c9c; -} - /deep/ .uni-section-header__slot-right { color: green; }