Browse Source

提交 设备箱

wangqin
Joe 10 months ago
parent
commit
db1ea5327e
  1. 89
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/index.vue
  2. 9
      ruoyi-ui/src/views/JiHeExpressway/scss/reset.scss

89
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SmartDevice/index.vue

@ -8,6 +8,7 @@
<Descriptions :list="list" :data="data" style="gap: 18px" />
</ElTabPane>
<ElTabPane label="设备参数" name="second">
<div class="no-data" v-if="!devicesList.length" v-loading="secondLoading">暂无设备参数</div>
<Descriptions :list="devicesList" style="gap: 18px;" column="5">
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }">
<span>{{ data.text }}</span>
@ -32,7 +33,7 @@ import Video from "@screen/components/Video"
import LineChart from './components/LineChart/index.vue';
import Switcher from '@screen/pages/service/PublishingChannelManagement/components/Switcher.vue';
import { getRoadInfoByStakeMark, getOrganizationName, getProduct } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"
import { getRoadInfoByStakeMark, getProduct } from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js"
import { dialogDelayVisible } from "./../mixin"
import request from "@/utils/request";
import { Message } from 'element-ui';
@ -53,6 +54,7 @@ export default {
return {
activeName: 'first',
releaseVisible: false,
secondLoading: true,
data: {
deviceName: "LH24",
roadName: "G35济泽高速",
@ -113,11 +115,6 @@ export default {
this.dialogData.brand = data.brand;
})
getOrganizationName(this.dialogData.iotDeviceId)
.then(data => {
this.dialogData.organizationName = data?.organizationName;
})
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
if (roadInfo) this.data.roadName = roadInfo.roadName;
@ -128,50 +125,52 @@ export default {
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`,
method: "get",
params: {}
}).then(result => {
if (result.code != 200) return;
const [deviceInfo] = result.data;
})
.then(result => {
if (result.code != 200) return;
const [deviceInfo] = result.data;
const typeMap = {
ac: '220v',
dc: '12v',
}
const typeMap = {
ac: '220v',
dc: '12v',
}
for (const key in deviceInfo.formatValue) {
// electricity
// voltage
if (key.includes('electricity')) {
const args = key.match(/[a-z]+|[0-9]+$/g);
for (const key in deviceInfo.formatValue) {
// electricity
// voltage
if (key.includes('electricity')) {
const args = key.match(/[a-z]+|[0-9]+$/g);
const type = args[0], num = args.slice(-1)[0], prefix = args.slice(0, 2).join('_');
this.devicesList.push(
{
label: `支路${num}${typeMap[type]}) 电压`,
key: `${prefix}_voltage_${num}`,
text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 3
},
{
label: '电流',
key: `${prefix}_electricity_${num}`,
text: deviceInfo.formatValue[key],
gridColumn: 2,
state: deviceInfo.value[key] > 0
}
);
const type = args[0], num = args.slice(-1)[0], prefix = args.slice(0, 2).join('_');
this.devicesList.push(
{
label: `支路${num}${typeMap[type]}) 电压`,
key: `${prefix}_voltage_${num}`,
text: deviceInfo.formatValue[`${prefix}_voltage_${num}`],
gridColumn: 3
},
{
label: '电流',
key: `${prefix}_electricity_${num}`,
text: deviceInfo.formatValue[key],
gridColumn: 2,
state: deviceInfo.value[key] > 0
}
);
}
}
}
this.devicesList.push({
label: '风扇',
key: `fan_status`,
text: { 0: '正常', 1: '开' }[deviceInfo.formatValue['fan_status']] || '-',
gridColumn: 5
this.devicesList.push({
label: '风扇',
key: `fan_status`,
text: { 0: '正常', 1: '开' }[deviceInfo.formatValue['fan_status']] || '-',
gridColumn: 5
})
// this.data = result.rows;
// this.total = result.total;
})
.finally(() => {
this.secondLoading = false
})
// this.data = result.rows;
// this.total = result.total;
}).finally(() => {
// closeLoading();
})
},
methods: {
handleSwitcherChange(value, data) {

9
ruoyi-ui/src/views/JiHeExpressway/scss/reset.scss

@ -42,4 +42,13 @@ body {
background-color: rgba(13, 95, 121, 0.6);
}
}
.no-data {
display: flex;
align-items: center;
justify-content: center;
color: #fff;
width: 100%;
height: 100%;
}
}

Loading…
Cancel
Save