fix(物联网): 调整首页报警、统计触发、设备详情解决分组切换问题和input默认值问题

This commit is contained in:
风花一世月 2024-07-14 15:00:39 +08:00
parent e6a52dcfe9
commit 8383f214d9
3 changed files with 32 additions and 19 deletions

View File

@ -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:{

View File

@ -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)"
></iots-input>
@ -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()
})
}

View File

@ -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() {