|
|
@@ -82,7 +82,7 @@ export default {
|
|
|
condition: { name: '' },
|
|
|
list: getDevices,
|
|
|
transform: this.transform,
|
|
|
- transformData: this.transformTableData,
|
|
|
+ transformData: __SUB_DEVICE__ && this.transformTableData,
|
|
|
filters: [
|
|
|
{ key: 'name', type: 'search', placeholder: '设备名称' }
|
|
|
],
|
|
|
@@ -204,7 +204,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onEditDevice ({ id, name, longitude, latitude, address }) {
|
|
|
+ onEditDevice (device) {
|
|
|
+ const { id, name, longitude, latitude, address } = device
|
|
|
+ this.$device = device
|
|
|
this.info = { id, name, longitude, latitude, address }
|
|
|
this.$refs.editDialog.show()
|
|
|
},
|
|
|
@@ -237,13 +239,13 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (Object.keys(this.info).every(key => this.info[key] === this.device[key])) {
|
|
|
+ if (Object.keys(this.info).every(key => this.info[key] === this.$device[key])) {
|
|
|
done()
|
|
|
return
|
|
|
}
|
|
|
updateDevice(this.info).then(() => {
|
|
|
done()
|
|
|
- Object.assign(this.device, this.info)
|
|
|
+ Object.assign(this.$device, this.info)
|
|
|
})
|
|
|
},
|
|
|
onSettingDevice ({ id }) {
|