|
@ -5,6 +5,7 @@ |
|
|
<div class="SmartDevice"> |
|
|
<div class="SmartDevice"> |
|
|
<ElTabs v-model="activeName" class="tabs"> |
|
|
<ElTabs v-model="activeName" class="tabs"> |
|
|
<ElTabPane label="基本信息" name="first"> |
|
|
<ElTabPane label="基本信息" name="first"> |
|
|
|
|
|
<!-- {{ dialogData }} --> |
|
|
<Descriptions :list="list" :data="data" style="gap: 18px" /> |
|
|
<Descriptions :list="list" :data="data" style="gap: 18px" /> |
|
|
</ElTabPane> |
|
|
</ElTabPane> |
|
|
<ElTabPane label="设备参数" name="second"> |
|
|
<ElTabPane label="设备参数" name="second"> |
|
@ -16,8 +17,8 @@ |
|
|
</ElTabs> |
|
|
</ElTabs> |
|
|
</div> |
|
|
</div> |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<Button v-if="data.deviceState == '1'" @click.native="deviceControlVisible = true"> 设备操作 </Button> |
|
|
<Button v-if="activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true"> 设备操作 </Button> |
|
|
<Button v-else style="background-color: #bbb;"> 设备离线 </Button> |
|
|
<Button v-else-if="activeName != 'first'" style="background-color: #bbb;"> 设备离线 </Button> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<DeviceControlDialog |
|
|
<DeviceControlDialog |
|
@ -36,11 +37,14 @@ import LineChart from "./components/LineChart/index.vue"; |
|
|
import DeviceParams from "./components/DeviceParams.vue"; |
|
|
import DeviceParams from "./components/DeviceParams.vue"; |
|
|
import DeviceControlDialog from "./components/DeviceControlDialog.vue"; |
|
|
import DeviceControlDialog from "./components/DeviceControlDialog.vue"; |
|
|
|
|
|
|
|
|
|
|
|
import request from "@/utils/request"; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getRoadInfoByStakeMark, |
|
|
getRoadInfoByStakeMark, |
|
|
getProduct, |
|
|
getProduct, |
|
|
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
|
|
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"; |
|
|
import { dialogDelayVisible } from "./../mixin"; |
|
|
import { dialogDelayVisible } from "./../mixin"; |
|
|
|
|
|
import { resolve } from "@antv/x6/lib/registry/node-anchor/util"; |
|
|
|
|
|
|
|
|
// 广播发布 |
|
|
// 广播发布 |
|
|
export default { |
|
|
export default { |
|
@ -90,7 +94,13 @@ export default { |
|
|
{ |
|
|
{ |
|
|
label: "设备状态", |
|
|
label: "设备状态", |
|
|
key: "deviceState", |
|
|
key: "deviceState", |
|
|
enum: "DeviceTypeEnum", |
|
|
// enum: "DeviceTypeEnum", |
|
|
|
|
|
visible: false |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "设备状态", |
|
|
|
|
|
key: "deviceStateLiteral", |
|
|
|
|
|
// enum: "DeviceTypeEnum", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "设备厂商", |
|
|
label: "设备厂商", |
|
@ -102,14 +112,15 @@ export default { |
|
|
async created() { |
|
|
async created() { |
|
|
// if (!this.dialogData.iotDeviceId) this.dialogData.iotDeviceId = '10.0.36.146-1883'; |
|
|
// if (!this.dialogData.iotDeviceId) this.dialogData.iotDeviceId = '10.0.36.146-1883'; |
|
|
|
|
|
|
|
|
this.data = { ...this.dialogData, roadName: null }; |
|
|
let deviceInfo = await this.getDeviceInfo(); |
|
|
|
|
|
this.data = { ...this.dialogData, roadName: null, deviceStateLiteral : deviceInfo.data.formatValue.deviceState }; |
|
|
|
|
|
|
|
|
console.log( |
|
|
// console.log( |
|
|
"%c [ dialogData ]-103-「index.vue」", |
|
|
// "%c [ dialogData ]-103-「index.vue」", |
|
|
"font-size:15px; background:#36347c; color:#7a78c0;", |
|
|
// "font-size:15px; background:#36347c; color:#7a78c0;", |
|
|
this.dialogData, |
|
|
// this.dialogData, |
|
|
"+++========" |
|
|
// "+++========" |
|
|
); |
|
|
// ); |
|
|
|
|
|
|
|
|
getProduct(this.dialogData.productId).then((data) => { |
|
|
getProduct(this.dialogData.productId).then((data) => { |
|
|
this.dialogData.brand = data.brand; |
|
|
this.dialogData.brand = data.brand; |
|
@ -119,6 +130,15 @@ export default { |
|
|
|
|
|
|
|
|
if (roadInfo) this.data.roadName = roadInfo.roadName; |
|
|
if (roadInfo) this.data.roadName = roadInfo.roadName; |
|
|
}, |
|
|
}, |
|
|
|
|
|
methods:{ |
|
|
|
|
|
async getDeviceInfo() { |
|
|
|
|
|
return request({ |
|
|
|
|
|
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId || '10.0.36.143-1883'}/3`, |
|
|
|
|
|
method: "get", |
|
|
|
|
|
params: {} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|