|
|
@ -48,15 +48,14 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// https://www.yuque.com/dayuanzhong-ovjwn/gkht0m/ww776d5kzs72ilzh?singleDoc= |
|
|
|
// 获取设备参数 |
|
|
|
request({ |
|
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1`, |
|
|
|
method: "get", |
|
|
|
params: {} |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return; |
|
|
|
const deviceInfo = result.data; |
|
|
|
|
|
|
|
Promise.all([this.getAc(), this.getDc()]).then(res=>{ |
|
|
|
// if (result.code != 200) return; |
|
|
|
|
|
|
|
let ac = res[0].data; |
|
|
|
let dc = res[1].data; |
|
|
|
let deviceInfo = _.merge({}, ac, dc); |
|
|
|
|
|
|
|
const typeMap = { |
|
|
|
ac: '220v', |
|
|
|
dc: '12v', |
|
|
@ -129,6 +128,20 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getAc(){ |
|
|
|
return request({ |
|
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1ac`, |
|
|
|
method: "get", |
|
|
|
params: {} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getDc(){ |
|
|
|
return request({ |
|
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/1dc`, |
|
|
|
method: "get", |
|
|
|
params: {} |
|
|
|
}) |
|
|
|
}, |
|
|
|
async handleSwitcherChange(value, data) { |
|
|
|
let str = data.state ? "关闭" : "开启"; |
|
|
|
let deviceName = ""; |
|
|
|