Browse Source

更新首页设备箱显示

wangqin
王钦 10 months ago
parent
commit
f62e6ea8fa
  1. 16
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/ConditionStatistics/index.vue
  2. 22
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue
  3. 18
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/FocusedMonitoring/index.vue

16
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/ConditionStatistics/index.vue

@ -1,23 +1,23 @@
<template> <template>
<Bg2 class='ConditionStatistics'> <Bg2 class='ConditionStatistics'>
<div class="statistics-header"> <div class="statistics-header">
<div class="title"></div> <div class="title keep-ratio" origin="left"></div>
<img class="icon-right" src="@screen/images/icon/icon_right.png" /> <img class="icon-right keep-ratio" origin="right" src="@screen/images/icon/icon_right.png" />
</div> </div>
<div class="content-r-t-box"> <div class="content-r-t-box">
<div class="box-title"><span>预警事件</span></div> <div class="box-title keep-ratio" origin="left"><span>预警事件</span></div>
<div class="box-content"> <div class="box-content">
<div class="box-content-l"> <div class="box-content-l">
<div class="event-item">今日<span>{{ earlyWarningEvents.day }}</span></div> <div class="event-item keep-ratio" origin="left">今日<span>{{ earlyWarningEvents.day }}</span></div>
<div class="event-item">本月<span>{{ earlyWarningEvents.month }}</span></div> <div class="event-item keep-ratio" origin="left">本月<span>{{ earlyWarningEvents.month }}</span></div>
</div> </div>
<div class="box-content-c"> <div class="box-content-c keep-ratio">
<span class="num">{{ earlyWarningEvents.processing }}</span> <span class="num">{{ earlyWarningEvents.processing }}</span>
<span class="text">处理中</span> <span class="text">处理中</span>
</div> </div>
<div class="box-content-r"> <div class="box-content-r">
<div class="event-item">本周<span>{{ earlyWarningEvents.week }}</span></div> <div class="event-item keep-ratio" origin="right">本周<span>{{ earlyWarningEvents.week }}</span></div>
<div class="event-item">本年<span>{{ earlyWarningEvents.year }}</span></div> <div class="event-item keep-ratio" origin="right">本年<span>{{ earlyWarningEvents.year }}</span></div>
</div> </div>
</div> </div>
</div> </div>

22
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/components/DeviceParams.vue

@ -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: '市电掉电',

18
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/FocusedMonitoring/index.vue

@ -1,43 +1,43 @@
<template> <template>
<Bg2 class="content-l-t"> <Bg2 class="content-l-t">
<div class="content-l-t-title"> <div class="content-l-t-title keep-ratio" origin="left">
</div> </div>
<img class="icon_005" src="@screen/images/icon/icon_005.png" /> <img class="icon_005" src="@screen/images/icon/icon_005.png" />
<div class="content-l-t-content"> <div class="content-l-t-content">
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span>59676</span> <span>59676</span>
<div>日累计车流量</div> <div>日累计车流量</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span>4618</span> <span>4618</span>
<div>当前在途车辆</div> <div>当前在途车辆</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<p> <p>
<span class="abnormal">{{ trafficIncidents[0] }}</span> <span class="abnormal">{{ trafficIncidents[0] }}</span>
<span>/{{ trafficIncidents[1] }}</span> <span>/{{ trafficIncidents[1] }}</span>
</p> </p>
<div>交通事件</div> <div>交通事件</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span>{{ constructionSection }}</span> <span>{{ constructionSection }}</span>
<span class="unit"></span> <span class="unit"></span>
<div>施工路段</div> <div>施工路段</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span class="fault">4</span> <span class="fault">4</span>
<span class="unit"></span> <span class="unit"></span>
<div>气象预警</div> <div>气象预警</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span class="abnormal">5</span> <span class="abnormal">5</span>
<div>异常设备</div> <div>异常设备</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span>{{ perceiveEvent }}</span> <span>{{ perceiveEvent }}</span>
<div>感知事件</div> <div>感知事件</div>
</div> </div>
<div class="monitor-item"> <div class="monitor-item keep-ratio">
<span class="num">96.3</span> <span class="num">96.3</span>
<div>平均车速</div> <div>平均车速</div>
</div> </div>

Loading…
Cancel
Save