Browse Source

太阳能板

wangqin
zhoule 8 months ago
parent
commit
41266ed2d4
  1. 5
      ruoyi-ui/src/views/JiHeExpressway/images/layer/路测设备/太阳能板.svg
  2. 3
      ruoyi-ui/src/views/JiHeExpressway/images/layer/路测设备/太阳能板_active.svg
  3. 3
      ruoyi-ui/src/views/JiHeExpressway/images/layer/路测设备/太阳能板_fault.svg
  4. 55
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/components/DeviceControlDialog.vue
  5. 160
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/components/DeviceParams.vue
  6. 44
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/data.js
  7. 197
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/index.vue
  8. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  9. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

5
ruoyi-ui/src/views/JiHeExpressway/images/layer/路测设备/太阳能板.svg

@ -0,0 +1,5 @@
<svg width="20" height="17" viewBox="0 0 20 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 1142815835">
<path id="Vector" d="M10.7401 12.0997V14.218H14.3689V16.1134H5.29693V14.218H8.92573V12.0997H10.7401ZM3.66073 9.01901L3.03433 11.7838H1.22803C0.939128 11.7838 0.666428 11.6488 0.490928 11.4166C0.315428 11.1844 0.261428 10.8847 0.339728 10.6066L0.796028 9.01901H3.66073ZM9.37933 9.01901V11.7838H3.96583L4.59223 9.01901H9.37933ZM15.6622 9.01901L16.2886 11.7838H10.2865V9.01901H15.6622ZM19.1695 9.01901L19.6258 10.6093C19.7041 10.8874 19.6501 11.1871 19.4746 11.4166C19.3018 11.6488 19.0291 11.7838 18.7375 11.7838H17.2174L16.591 9.01901H19.1695ZM4.28713 6.25421L3.86863 8.09831H1.06333L1.59253 6.25421H4.28713ZM9.37933 6.25421V8.09831H4.80013L5.21863 6.25421H9.37933ZM15.0358 6.25421L15.4543 8.09831H10.2865V6.25421H15.0358ZM18.3757 6.25421L18.9049 8.09831H16.3831L15.9673 6.25421H18.3757ZM4.91353 3.48941L4.49503 5.33351H1.85713L2.38633 3.48941H4.91353ZM9.37933 3.48941V5.33351H5.42653L5.84503 3.48941H9.37933ZM14.4094 3.48941L14.8279 5.33351H10.2865V3.48941H14.4094ZM17.5819 3.48941L18.1111 5.33351H15.7567L15.3382 3.48941H17.5819ZM5.53993 0.724609L5.12143 2.56871H2.65093L2.98843 1.39421C3.10183 1.00001 3.46363 0.727309 3.87403 0.727309H5.53993V0.724609ZM9.37933 0.724609V2.56871H6.05293L6.47143 0.724609H9.37933ZM13.783 0.724609L14.2015 2.56871H10.2865V0.724609H13.783ZM16.0942 0.724609C16.5046 0.724609 16.8664 0.997309 16.9798 1.39151L17.3173 2.56871H15.1303L14.7118 0.724609H16.0942Z" fill="#0FD4FF"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

3
ruoyi-ui/src/views/JiHeExpressway/images/layer/路测设备/太阳能板_active.svg

@ -0,0 +1,3 @@
<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Vector" d="M10.4354 11.3751V13.4934H14.0642V15.3888H4.99224V13.4934H8.62104V11.3751H10.4354ZM3.35604 8.2944L2.72964 11.0592H0.923341C0.634441 11.0592 0.361741 10.9242 0.186241 10.692C0.0107407 10.4598 -0.0432593 10.1601 0.0350407 9.882L0.491341 8.2944H3.35604ZM9.07464 8.2944V11.0592H3.66114L4.28754 8.2944H9.07464ZM15.3575 8.2944L15.9839 11.0592H9.98184V8.2944H15.3575ZM18.8648 8.2944L19.3211 9.8847C19.3994 10.1628 19.3454 10.4625 19.1699 10.692C18.9971 10.9242 18.7244 11.0592 18.4328 11.0592H16.9127L16.2863 8.2944H18.8648ZM3.98244 5.5296L3.56394 7.3737H0.758641L1.28784 5.5296H3.98244ZM9.07464 5.5296V7.3737H4.49544L4.91394 5.5296H9.07464ZM14.7311 5.5296L15.1496 7.3737H9.98184V5.5296H14.7311ZM18.071 5.5296L18.6002 7.3737H16.0784L15.6626 5.5296H18.071ZM4.60884 2.7648L4.19034 4.6089H1.55244L2.08164 2.7648H4.60884ZM9.07464 2.7648V4.6089H5.12184L5.54034 2.7648H9.07464ZM14.1047 2.7648L14.5232 4.6089H9.98184V2.7648H14.1047ZM17.2772 2.7648L17.8064 4.6089H15.452L15.0335 2.7648H17.2772ZM5.23524 0L4.81674 1.8441H2.34624L2.68374 0.6696C2.79714 0.2754 3.15894 0.00269997 3.56934 0.00269997H5.23524V0ZM9.07464 0V1.8441H5.74824L6.16674 0H9.07464ZM13.4783 0L13.8968 1.8441H9.98184V0H13.4783ZM15.7895 0C16.1999 0 16.5617 0.2727 16.6751 0.6669L17.0126 1.8441H14.8256L14.4071 0H15.7895Z" fill="#FFDB82"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
ruoyi-ui/src/views/JiHeExpressway/images/layer/路测设备/太阳能板_fault.svg

@ -0,0 +1,3 @@
<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Vector" d="M10.4354 11.3751V13.4934H14.0642V15.3888H4.99224V13.4934H8.62104V11.3751H10.4354ZM3.35604 8.2944L2.72964 11.0592H0.923341C0.634441 11.0592 0.361741 10.9242 0.186241 10.692C0.0107407 10.4598 -0.0432593 10.1601 0.0350407 9.882L0.491341 8.2944H3.35604ZM9.07464 8.2944V11.0592H3.66114L4.28754 8.2944H9.07464ZM15.3575 8.2944L15.9839 11.0592H9.98184V8.2944H15.3575ZM18.8648 8.2944L19.3211 9.8847C19.3994 10.1628 19.3454 10.4625 19.1699 10.692C18.9971 10.9242 18.7244 11.0592 18.4328 11.0592H16.9127L16.2863 8.2944H18.8648ZM3.98244 5.5296L3.56394 7.3737H0.758641L1.28784 5.5296H3.98244ZM9.07464 5.5296V7.3737H4.49544L4.91394 5.5296H9.07464ZM14.7311 5.5296L15.1496 7.3737H9.98184V5.5296H14.7311ZM18.071 5.5296L18.6002 7.3737H16.0784L15.6626 5.5296H18.071ZM4.60884 2.7648L4.19034 4.6089H1.55244L2.08164 2.7648H4.60884ZM9.07464 2.7648V4.6089H5.12184L5.54034 2.7648H9.07464ZM14.1047 2.7648L14.5232 4.6089H9.98184V2.7648H14.1047ZM17.2772 2.7648L17.8064 4.6089H15.452L15.0335 2.7648H17.2772ZM5.23524 0L4.81674 1.8441H2.34624L2.68374 0.6696C2.79714 0.2754 3.15894 0.00269997 3.56934 0.00269997H5.23524V0ZM9.07464 0V1.8441H5.74824L6.16674 0H9.07464ZM13.4783 0L13.8968 1.8441H9.98184V0H13.4783ZM15.7895 0C16.1999 0 16.5617 0.2727 16.6751 0.6669L17.0126 1.8441H14.8256L14.4071 0H15.7895Z" fill="#FF5F5F"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

55
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/components/DeviceControlDialog.vue

@ -0,0 +1,55 @@
<template>
<Dialog v-model="modelVisible" title="设备操作" width="550px">
<div class="DeviceControlDialog">
<DeviceParams :dialogData="dialogData" />
</div>
</Dialog>
</template>
<script>
import Dialog from "@screen/components/Dialog/index.vue";
import DeviceParams from "./DeviceParams.vue";
export default {
name: "DeviceControlDialog",
components: {
Dialog,
DeviceParams,
},
model: {
prop: "visible",
event: "update:value",
},
props: {
visible: Boolean,
dialogData: {
type: Object,
default: () => ({}),
},
},
computed: {
modelVisible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:value", val);
},
},
},
};
</script>
<style lang="scss" scoped>
.DeviceControlDialog {
width: 510px;
display: flex;
flex-direction: column;
gap: 15px;
min-height: 360px;
.tips {
font-size: 12px;
}
}
</style>

160
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/components/DeviceParams.vue

@ -0,0 +1,160 @@
<template>
<div class='DeviceParams'>
<div class="no-data" v-if="!devicesList.length" v-loading="secondLoading">暂无设备参数</div>
<Descriptions :list="devicesList" :data="devicesData" style="gap: 18px;" column="6">
<template v-for="item in devicesList.slice(0, -1)" #[`content-${getSlotKey(item.key)}`]="{ data }">
<span>{{ data.text }}</span>
<Switcher v-if="!disabled" class="switcher" :activeOption="activeOption" :value="data.state"
@change="(value) => handleSwitcherChange(value, data)" />
<ElTag style="margin-left: 20px;" v-else effect="dark" :type="data.state ? '' : 'info'">{{ data.state ? '开' :
'关' }}
</ElTag>
</template>
</Descriptions>
</div>
</template>
<script>
import Descriptions from '@screen/components/Descriptions.vue';
import Switcher from '@screen/pages/service/PublishingChannelManagement/components/Switcher.vue';
import request from "@/utils/request";
import { Message } from 'element-ui';
import { confirm } from "@screen/utils/common";
import { devicesFormList } from '../data.js';
export default {
name: 'DeviceParams',
components: {
Descriptions,
Switcher
},
props: {
dialogData: {
type: Object,
default: () => ({})
},
disabled: Boolean
},
data() {
return {
secondLoading: true,
devicesList: [],
devicesData: {},
activeOption: {
active: {
text: "开"
},
unActive: {
text: "关"
}
}
}
},
created() {
// this.devicesList = devicesFormList;
this.devicesList = [];
let devs = [];
// Promise.all([this.getAc('A1'), this.getAc('A2'), this.getAc('A3'), this.getAc('A4'), this.getAc('A5'), this.getAc('A6')]).then(res => {
Promise.all([this.getAc()]).then(res => {
console.log('res', res)
request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`,
method: "get",
}).then(result => {
if (result.code != 200) return Message.error("操作失败");
result.data.forEach(item => {
devs.push({
label: item.propertyName,
key: item.property,
gridColumn: 3,
});
this.devicesData[item.property] = item.formatValue;
});
this.devicesList = devs;
})
})
},
methods: {
getAc() {
return request({
url: `/business/device/batchFunctions`,
method: "post",
data: {
devices: [{
iotDeviceId: this.dialogData.iotDeviceId,
id: this.dialogData.id,
}],
functions: [
{
functionId: "A1",
}, {
functionId: "A2",
}, {
functionId: "A3",
}, {
functionId: "A4",
}, {
functionId: "A5",
}, {
functionId: "A6",
}
],
// parameter: {}
}
})
},
async handleSwitcherChange(value, data) {
let str = data.state ? "关闭" : "开启";
let deviceName = "";
if (data.key.includes("fan")) {
str += "风扇?";
deviceName = "fan_out_en";
} else {
str += "该支路?"
deviceName = data.key.match(/^[a-z]+_out|[0-9]+/g).join("_") + "_en"; //dc_out_2_en ac_out_2_en;
}
data.state = value;
const isContinue = await confirm({ message: `${str}` })
.catch(() => {
console.log(data.state, value, 333)
data.state = !value;
});
if (!isContinue) return;
// https://www.yuque.com/dayuanzhong-ovjwn/gkht0m/ww776d5kzs72ilzh?singleDoc=
request({
url: `/business/device/functions/${this.dialogData.iotDeviceId}/${102}`,
method: "POST",
data: {
deviceName,
// 1=0=
value: value ? 1 : 0
}
})
.then(result => {
if (result.code != 200) {
Message.error("操作失败");
data.state = !value;
return;
};
Message.success("操作成功");
})
.catch(() => {
data.state = !value;
Message.error("操作失败");
})
},
getSlotKey(key) {
return key.includes('electricity') || key.includes('fan') ? key : ''
}
}
}
</script>
<style lang='scss' scoped>
.DeviceParams {
height: 100%;
}
</style>

44
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/data.js

@ -0,0 +1,44 @@
export const devicesFormList = [
{
label: "设备内温度过高",
key: `theInternalTemperatureOfTheDeviceOverheats`,
// text: "-",
gridColumn: 2,
},
{
label: "阵列电压",
key: `arrayVoltage`,
// text: "-",
gridColumn: 2,
},
{
label: "阵列电流",
key: `arrayCurrent`,
// text: "-",
gridColumn: 2,
},
{
label: "发电功率L",
key: `generatingPowerL`,
text: "-",
gridColumn: 2,
},
{
label: "发电功率H",
key: `generatingPowerH`,
text: "-",
gridColumn: 2,
},
{
label: "负载电压",
key: `loadVoltage`,
text: "-",
gridColumn: 2,
},
{
label: "负载电流",
key: `loadCurrent`,
text: "-",
gridColumn: 2,
},
];

197
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/SolarEnergy/index.vue

@ -0,0 +1,197 @@
<template>
<Dialog v-model="obverseVisible" title="太阳能板" width="550px">
<Video class="video-stream" :pileNum="dialogData.stakeMark" />
<div class="SolarEnergy">
<ElTabs v-model="activeName" class="tabs">
<ElTabPane label="基本信息" name="first">
<!-- {{ dialogData }} -->
<Descriptions :list="list" :data="data" style="gap: 18px" />
</ElTabPane>
<ElTabPane label="设备参数" name="second">
<DeviceParams disabled :dialogData="dialogData" />
</ElTabPane>
<ElTabPane label="在线率统计" name="third">
<LineChart v-if="activeName === 'third'" :productId="dialogData.id" style="height: 180px" />
</ElTabPane>
</ElTabs>
</div>
<!-- <template #footer>
<Button v-if="activeName != 'first' && data.deviceState == '1'" @click.native="deviceControlVisible = true">
设备操作
</Button>
<Button v-else-if="activeName != 'first'" style="background-color: #bbb">
设备离线
</Button>
</template> -->
<DeviceControlDialog v-model="deviceControlVisible" :dialogData="dialogData" />
</Dialog>
</template>
<script>
import Dialog from "@screen/components/Dialog/index.vue";
import Button from "@screen/components/Buttons/Button.vue";
import Descriptions from "@screen/components/Descriptions.vue";
import Video from "@screen/components/Video";
import LineChart from "../../LineChart/index.vue";
import DeviceParams from "./components/DeviceParams.vue";
import DeviceControlDialog from "./components/DeviceControlDialog.vue";
import request from "@/utils/request";
import {
getRoadInfoByStakeMark,
getProduct,
} from "@screen/pages/Home/components/RoadAndEvents/utils/httpList.js";
import { dialogDelayVisible } from "./../mixin";
import { resolve } from "@antv/x6/lib/registry/node-anchor/util";
//
export default {
name: "SolarEnergy",
mixins: [dialogDelayVisible],
components: {
Dialog,
Descriptions,
LineChart,
Video,
Button,
DeviceParams,
DeviceControlDialog,
},
data() {
return {
activeName: "first",
releaseVisible: false,
deviceControlVisible: false,
data: {
deviceName: "LH24",
roadName: "G35济泽高速",
stakeMark: "k094+079",
direction: "1",
organizationName: "山东高速济南发展公司",
brand: "XXX厂家",
deviceState: "0",
},
list: [
{
label: "设备名称",
key: "deviceName",
},
{
label: "设备桩号",
key: "stakeMark",
},
{
label: "道路名称",
key: "roadName",
},
{
label: "设备方向",
key: "direction",
enum: "CameraDirectionEnum",
},
{
label: "设备状态",
key: "deviceState",
enum: "DeviceTypeEnum",
// visible: false,
},
// {
// label: "",
// key: "deviceStateLiteral",
// },
{
label: "设备厂商",
key: "manufacturer",
},
],
};
},
async created() {
// if (!this.dialogData.iotDeviceId) this.dialogData.iotDeviceId = '10.0.36.146-1883';
// let deviceInfo = await this.getDeviceInfo();
this.data = {
...this.dialogData,
roadName: null,
// deviceStateLiteral: deviceInfo.data.formatValue.deviceState,
};
// console.log(
// "%c [ dialogData ]-103-index.vue",
// "font-size:15px; background:#36347c; color:#7a78c0;",
// this.dialogData,
// "+++========"
// );
//
getProduct(this.dialogData.productId).then((data) => {
this.dialogData.brand = data.brand;
});
const roadInfo = await getRoadInfoByStakeMark(this.dialogData.stakeMark);
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>
<style lang="scss">
div.switcher {
font-size: 12px;
padding: 2px;
}
</style>
<style lang="scss" scoped>
.SolarEnergy {
width: 510px;
// height: 240px;
color: #fff;
display: flex;
flex-direction: column;
.camera-video {
flex: 1.5;
}
.tabs {
flex: 1;
display: flex;
flex-direction: column;
::v-deep {
.el-tabs__content {
flex: 1;
.el-tab-pane {
height: 100%;
}
}
}
}
.bottom {
margin-top: 12px;
display: flex;
gap: 9px;
align-items: center;
justify-content: end;
>div {
font-size: 16px;
padding: 6px 12px;
}
}
}
</style>

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -46,6 +46,7 @@ import Broadcast from "./../Dialogs/Broadcast/index.vue";
import TrafficIncidents from "./../Dialogs/TrafficIncidents/index.vue";
import PerceiveEvent from "./../Dialogs/PerceiveEvent/index.vue";
import SmartDevice from "./../Dialogs/SmartDevice/index.vue";
import SolarEnergy from "./../Dialogs/SolarEnergy/index.vue";
import Intermodulation from "./../Dialogs/Intermodulation/index.vue";
import GuardrailCollision from "./../Dialogs/GuardrailCollision/index.vue";
@ -65,6 +66,7 @@ export default {
TrafficIncidents,
PerceiveEvent,
SmartDevice,
SolarEnergy,
Intermodulation,
GuardrailCollision,
FatigueWakesUp

4
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -74,6 +74,10 @@ export const DeviceForMap = {
deviceType: "10",
dialog: "FatigueWakesUp",
},
太阳能板: {
deviceType: "15",
dialog: "SolarEnergy",
},
};
export const lngLatMap = {}; //优化 缩略图 + 地图 复用lngLatmap

Loading…
Cancel
Save