|
@ -4,8 +4,9 @@ |
|
|
<Descriptions :list="devicesList" style="gap: 18px;" column="5"> |
|
|
<Descriptions :list="devicesList" style="gap: 18px;" column="5"> |
|
|
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }"> |
|
|
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }"> |
|
|
<span>{{ data.text }}</span> |
|
|
<span>{{ data.text }}</span> |
|
|
<Switcher class="switcher" :disabled="disabled" :activeOption="activeOption" :value="data.state" |
|
|
<Switcher v-if="!disabled" class="switcher" :activeOption="activeOption" :value="data.state" |
|
|
@change="(value) => handleSwitcherChange(value, data)" /> |
|
|
@change="(value) => handleSwitcherChange(value, data)" /> |
|
|
|
|
|
<ElTag style="margin-left: 20px;" v-else :effect="data.state?'dark':''" :type="data.state?'':'info'">{{ data.state?'开':'关' }}</ElTag> |
|
|
</template> |
|
|
</template> |
|
|
</Descriptions> |
|
|
</Descriptions> |
|
|
</div> |
|
|
</div> |
|
@ -49,12 +50,15 @@ export default { |
|
|
created() { |
|
|
created() { |
|
|
// https://www.yuque.com/dayuanzhong-ovjwn/gkht0m/ww776d5kzs72ilzh?singleDoc= |
|
|
// https://www.yuque.com/dayuanzhong-ovjwn/gkht0m/ww776d5kzs72ilzh?singleDoc= |
|
|
// 获取设备参数 |
|
|
// 获取设备参数 |
|
|
request({ |
|
|
// request({ |
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}`, |
|
|
// url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}`, |
|
|
method: "get", |
|
|
// method: "get", |
|
|
params: {} |
|
|
// params: {} |
|
|
}) |
|
|
// }) |
|
|
.then(result => { |
|
|
Promise.resolve({ |
|
|
|
|
|
code: 200, |
|
|
|
|
|
data: [{ "id": "ab58aab1e4c5fcf0457b3f1d808be44e", "deviceId": "10.0.36.143-1883", "property": "1", "propertyName": "状态包", "type": "object", "numberValue": null, "objectValue": { "dc_out_electricity_2": 0, "dc_out_electricity_1": 0, "power_status": "1", "dc_out_voltage_2": 11.3238, "fan_status": "0", "dc_out_voltage_1": 11.3125, "ac_out_voltage_2": 232.5156, "ac_out_voltage_1": 231.1293, "ac_out_electricity_1": 0, "temperature": "7.9", "humidity": "40.6", "ac_out_electricity_2": 0.1964, "door_status": "1" }, "geoValue": null, "value": { "dc_out_electricity_2": 0, "dc_out_electricity_1": 0, "power_status": "1", "dc_out_voltage_2": 11.3238, "fan_status": "0", "dc_out_voltage_1": 11.3125, "ac_out_voltage_2": 232.5156, "ac_out_voltage_1": 231.1293, "ac_out_electricity_1": 0, "temperature": "7.9", "humidity": "40.6", "ac_out_electricity_2": 0.1964, "door_status": "1" }, "formatValue": { "dc_out_electricity_2": "0.00A", "dc_out_electricity_1": "0.00A", "power_status": "1", "dc_out_voltage_2": "11.32V", "fan_status": "0", "dc_out_voltage_1": "11.31V", "ac_out_voltage_2": "232.52V", "ac_out_voltage_1": "231.13V", "ac_out_electricity_1": "0.00A", "temperature": "7.9", "humidity": "40.6", "ac_out_electricity_2": "0.20A", "door_status": "1" }, "createTime": 1707187234249, "timestamp": 1707187234249, "formatTime": null, "state": null }] |
|
|
|
|
|
}).then(result => { |
|
|
if (result.code != 200) return; |
|
|
if (result.code != 200) return; |
|
|
const [deviceInfo] = result.data; |
|
|
const [deviceInfo] = result.data; |
|
|
|
|
|
|
|
@ -109,8 +113,8 @@ export default { |
|
|
{ |
|
|
{ |
|
|
label: '湿度', |
|
|
label: '湿度', |
|
|
key: `humidity`, |
|
|
key: `humidity`, |
|
|
text: deviceInfo.formatValue['humidity'] || '-', |
|
|
text: deviceInfo.formatValue['humidity'] ? `${deviceInfo.formatValue['humidity']} %` : '-', |
|
|
gridColumn: 1 |
|
|
gridColumn: 2 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '市电掉电', |
|
|
label: '市电掉电', |
|
|