From 8383f214d97bab1eae657e07a6b8c99b2d804594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E8=8A=B1=E4=B8=80=E4=B8=96=E6=9C=88?= <1149505133@qq.com> Date: Sun, 14 Jul 2024 15:00:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=89=A9=E8=81=94=E7=BD=91):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=A6=96=E9=A1=B5=E6=8A=A5=E8=AD=A6=E3=80=81=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=A7=A6=E5=8F=91=E3=80=81=E8=AE=BE=E5=A4=87=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E8=A7=A3=E5=86=B3=E5=88=86=E7=BB=84=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=92=8Cinput=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot-components/input/iots-input.vue | 14 ++++++++-- pages/iots/device/device-detail.vue | 9 +++--- pages/tabbar/module/iots2.vue | 28 +++++++++++-------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/components/iot-components/input/iots-input.vue b/components/iot-components/input/iots-input.vue index 15549d3..ea19be3 100644 --- a/components/iot-components/input/iots-input.vue +++ b/components/iot-components/input/iots-input.vue @@ -20,7 +20,7 @@ props:{ // 选择值 value: { - type: [String,null], + type: [String,Number], default: '' }, // 图标 @@ -51,11 +51,19 @@ } }, created() { - this.inputValue = this.value; + if(this.value!=null){ + this.inputValue = this.value+''; + }else{ + this.inputValue = this.value; + } }, watch: { value(newValue) { - this.inputValue = newValue; + if(newValue!=null){ + this.inputValue = newValue+''; + }else{ + this.inputValue = newValue; + } } }, methods:{ diff --git a/pages/iots/device/device-detail.vue b/pages/iots/device/device-detail.vue index 38ad871..2e8c596 100644 --- a/pages/iots/device/device-detail.vue +++ b/pages/iots/device/device-detail.vue @@ -170,7 +170,7 @@ :disabled="true" :name="item.name" v-model="item.value" - :unit="item.ioObj?item.ioObj.unit?item.ioObj.unit:'':''" + :unit="item.ioObj ? item.ioObj.unit ?item.ioObj.unit:'': ''" @change="downData($event,index)" @clickLog="clickLog(index)" > @@ -480,6 +480,7 @@ }, // 选择分组 changeGroup(e){ + this.dataIndex = e; if(e != 0){ const identifierMap = new Map(); this.dataAllData.forEach(val => { @@ -535,7 +536,6 @@ if(thingModel.contents.prop.length){ this.dataList = thingModel.contents.prop.map(item=>{ if(item.dataType=='int'){ - if(item.ioObj.IoDeployForm.min!=undefined){ item.value = parseFloat(item.ioObj.IoDeployForm.min); }else{ @@ -824,7 +824,7 @@ // this.addLog('up',obj); this.deviceTime = this.$u.timeFormat(obj.fg_device_ts, 'yyyy-mm-dd hh:MM:ss'); if (obj) { - let dataList = JSON.parse(JSON.stringify(this.dataList)); + let dataList = JSON.parse(JSON.stringify(this.dataAllData)); // 这是连接的第一次获取,虽然进页面已经获取一次最新数据,但是可能存在断开之后的请求,所以需要遍历覆盖 for (let i = 0; i < dataList.length; i++) { for (let key in obj) { @@ -840,7 +840,8 @@ } } this.$nextTick(()=>{ - this.$set(this,'dataList',dataList) + this.$set(this,'dataAllData',dataList) + this.changeGroup(this.dataIndex) this.$forceUpdate() }) } diff --git a/pages/tabbar/module/iots2.vue b/pages/tabbar/module/iots2.vue index bd8af1d..8d5c26f 100644 --- a/pages/tabbar/module/iots2.vue +++ b/pages/tabbar/module/iots2.vue @@ -170,18 +170,22 @@ } }, watch: { - // showToggle() { - // console.log("show变化") - // clearInterval(this.timer); - // this.timer = setInterval(() => { - // this.mescroll.resetUpScroll(); - // console.log("当前起始项Index为", this.showStartIndex, this.showEndIndex); - // }, 5000) - // }, - // hideToggle() { - // console.log("hide变化") - // clearInterval(this.timer); - // }, + showToggle() { + console.log("show变化") + // clearInterval(this.timer); + // this.timer = setInterval(() => { + // this.mescroll.resetUpScroll(); + this.getDeviceInfo(); + console.log("当前起始项Index为", this.showStartIndex, this.showEndIndex); + // }, 5000) + }, + hideToggle() { + console.log("hide变化") + // clearInterval(this.timer); + }, + }, + onShow() { + }, created() {