|
|
@ -50,35 +50,34 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
async created() { |
|
|
|
// this.devicesList = devicesFormList; |
|
|
|
this.devicesList = []; |
|
|
|
let devs = []; |
|
|
|
// Promise.all([this.getAc('A1'), this.getAc('A2'), this.getAc('A3'), this.getAc('A4'), this.getAc('A5'), this.getAc('A6')]).then(res => { |
|
|
|
Promise.all([this.getAc()]).then(async (res) => { |
|
|
|
console.log('res', res) |
|
|
|
if (res[0].code == 500) { |
|
|
|
await this.getAc(); |
|
|
|
} |
|
|
|
request({ |
|
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`, |
|
|
|
method: "get", |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return Message.error("操作失败"); |
|
|
|
result.data.forEach(item => { |
|
|
|
if (item.propertyName) { |
|
|
|
devs.push({ |
|
|
|
label: item.propertyName, |
|
|
|
key: item.property, |
|
|
|
gridColumn: 3, |
|
|
|
}); |
|
|
|
this.devicesData[item.property] = item.formatValue; |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
this.devicesList = devs; |
|
|
|
}) |
|
|
|
const res = await this.getAc(); |
|
|
|
console.log('res', res) |
|
|
|
if (res.code == 500) { |
|
|
|
await this.getAc(); |
|
|
|
} |
|
|
|
request({ |
|
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`, |
|
|
|
method: "get", |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return Message.error("操作失败"); |
|
|
|
result.data.forEach(item => { |
|
|
|
if (item.propertyName) { |
|
|
|
devs.push({ |
|
|
|
label: item.propertyName, |
|
|
|
key: item.property, |
|
|
|
gridColumn: 3, |
|
|
|
}); |
|
|
|
this.devicesData[item.property] = item.formatValue; |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
this.devicesList = devs; |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|