fix: 设备详情 子设备列表添加刷新判断优化
This commit is contained in:
parent
20fb862f61
commit
9cf476e38c
|
@ -382,7 +382,7 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDeviceTypeList();
|
this.getDeviceTypeList();
|
||||||
this.getList();
|
this.getList(false);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
relationSubmit() {
|
relationSubmit() {
|
||||||
|
@ -404,7 +404,6 @@ export default {
|
||||||
this.msgSuccess("子设备绑定操作成功!");
|
this.msgSuccess("子设备绑定操作成功!");
|
||||||
this.selectTableBoxShow = false;
|
this.selectTableBoxShow = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$emit("EventUpload");
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
chenking_deviceKey(rule, value, callback) {
|
chenking_deviceKey(rule, value, callback) {
|
||||||
|
@ -725,11 +724,21 @@ export default {
|
||||||
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
|
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 判断两个数组是否
|
||||||
|
compareName(arr = [], arr2 = [], keys){
|
||||||
|
if (!arr || !arr2) return false;
|
||||||
|
if (arr.length !== arr2.length) return false;
|
||||||
|
|
||||||
|
return arr.every(obj => arr2.find(v => v[keys] === obj[keys]));
|
||||||
|
},
|
||||||
/** 查询设备列表 */
|
/** 查询设备列表 */
|
||||||
getList() {
|
getList(upload = true) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.queryParams.parentId = this.sourceId;
|
this.queryParams.parentId = this.sourceId;
|
||||||
listDevice(this.queryParams).then((response) => {
|
listDevice(this.queryParams).then((response) => {
|
||||||
|
if (upload && !this.compareName([...this.deviceList], [...response.rows], 'deviceKey')) {
|
||||||
|
this.$emit("EventUpload");
|
||||||
|
}
|
||||||
this.deviceList = response.rows;
|
this.deviceList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -763,7 +772,6 @@ export default {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("取消成功");
|
this.msgSuccess("取消成功");
|
||||||
this.$emit("EventUpload");
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
|
@ -779,7 +787,6 @@ export default {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
this.$emit("EventUpload");
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
|
@ -802,7 +809,6 @@ export default {
|
||||||
this.msgSuccess("新增成功");
|
this.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$emit("EventUpload");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue