Browse Source

增加合流区

wangqin
王钦 6 months ago
parent
commit
535c2aa863
  1. 1
      ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue
  2. 41
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastReleases.vue
  3. 156
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/components/DeviceControlDialog.vue
  4. 124
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/components/DeviceParams.vue
  5. 44
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/data.js
  6. 187
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/index.vue
  7. 3
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/mixin.js
  8. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  9. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  10. 49
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/sortFaceForecast/index.vue

1
ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue

@ -105,7 +105,6 @@ export default {
},
methods: {
close() {
console.log("------");
this.modelVisible = false;
},
updateDialogVisible(bool) {

41
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/Broadcast/components/BroadcastReleases.vue

@ -99,24 +99,47 @@ export default {
if (!this.checkList.length)
return Message.error("请至少选择一个广播设备!");
const devices = [];
const functions = [];
for(let i of this.checkList){
const d = _.find(this.musicList,{otherConfig:i})
devices.push({
"id": d.id,
"iotDeviceId": d.iotDeviceId,
"deviceType": d.deviceType
})
functions.push({
"functionId": "A1",
"params": {
"name": "task-3",
"outVol": "6",
"priority": "1",
"text": "山东高速欢迎您",
"repeatTimes": "3",
"termList": [
{
...JSON.parse(i)
}
],
"functionType": "startPaTts"
}
})
}
this.submitting = true;
request({
url: `/broadcast/broadcastFunctionCall`,
url: `/business/device/batchFunctions`,
method: "post",
data: {
name: "task-3",
outVol: "6",
priority: "1",
text: this.releaseMessage.trim(),
repeatTimes: "3",
termList: this.checkList.map((str) => JSON.parse(str)),
functionType: "startPaTts",
devices,functions
},
})
.then((data) => {
// console.log(data);
if (data.retCode == "0") {
if (data.code == "200") {
Message.success("广播设置成功!");
this.modelVisible = false;
} else {

156
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/components/DeviceControlDialog.vue

@ -0,0 +1,156 @@
<template>
<Dialog v-model="modelVisible" title="设备操作" width="550px">
<div class="DeviceControlDialog">
<Form
column="2"
v-if="formList && formList.length"
class="form"
ref="FormConfigRef"
label-width='120px'
:formList="formList"
:value="formData"
/>
</div>
<template #footer>
<!-- 王思祥 回读待确认 2024-05-16 TODO-->
<Button @click.native="handleSubmit" :loading="submitting"> 发送 </Button>
</template>
</Dialog>
</template>
<script>
import Button from "@screen/components/Buttons/Button.vue";
import Dialog from "@screen/components/Dialog/index.vue";
import request from "@/utils/request";
import Form from "@screen/components/FormConfig";
export default {
name: "DeviceControlDialog",
components: {
Dialog,
Form,
Button
},
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);
},
},
},
data(){
return {
enum_color:[
{label:"红色",value:"1"},
{label:"黄色",value:"2"},
{label:"绿色",value:"3"},
],
enum_wordFlicker:[
{label:"20次/min",value:"1"},
{label:"30次/min",value:"2"},
{label:"60次/min",value:"3"},
{label:"120次/min",value:"4"},
{label:"45次/min",value:"5"},
],
formList:[],
formData: {},
list: [
"activeDevice",
"screenLuminance",
"volume",
"colour",
"wordFlickerFrequency",
"textShiningDutyCycle",
"normalTextContent",
"triggerStateTextContent",
"triggerTextDuration",
"normalTextDisplaySettings",
"vehicleDetectorSensitivity",
"calculationCycle"
]
}
},
methods:{
handleSubmit(){
this.$message.success('发送成功')
}
},
async created() {
let devs = [];
request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`,
method: "get",
}).then(result => {
if (result.code != 200) return Message.error("操作失败");
console.log(result.data)
let n = _.find(result.data,{property:'numberOfPeriods'});
this.list.forEach(e => {
const p = _.find(result.data,{property:e})
if(p) {
if(p.type === 'string' || p.type === 'long'){
this.formList.push( {
label: p.propertyName+':',
key: p.property,
})
}
else if(p.property==="colour"){
this.formList.push({
label: p.propertyName+':',
key: p.property,
type: "select",
default: null,
options: {
options: this.enum_color
}
})
}
else if(p.property==="wordFlickerFrequency"){
this.formList.push({
label: p.propertyName+':',
key: p.property,
type: "select",
default: null,
options: {
options: this.enum_wordFlicker
}
})
}
this.formData[ p.property] =p.formatValue
}
})
console.log(this.formList,this.formData)
})
}
};
</script>
<style lang="scss" scoped>
.DeviceControlDialog {
width: 510px;
display: flex;
flex-direction: column;
gap: 15px;
min-height: 360px;
.tips {
font-size: 12px;
}
}
</style>

124
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/components/DeviceParams.vue

@ -0,0 +1,124 @@
<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>
</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: "关"
}
}
}
},
async created() {
this.devicesList = [];
let devs = [];
request({
url: `/business/device/properties/latest/${this.dialogData.iotDeviceId}`,
method: "get",
}).then(result => {
if (result.code != 200) return Message.error("操作失败");
result.data.forEach(item => {
if (item.propertyName) {
devs.push({
label: item.propertyName,
key: item.property,
gridColumn: 3,
});
this.devicesData[item.property] = item.formatValue;
}
});
this.devicesList = devs;
})
},
methods: {
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/ConfluenceArea/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,
},
];

187
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/ConfluenceArea/index.vue

@ -0,0 +1,187 @@
<template>
<Dialog v-model="obverseVisible" title="合流区预警" width="550px">
<Video class="video-stream" :pileNum="dialogData.stakeMark" />
<div class="confluencearea">
<ElTabs v-model="activeName" class="tabs">
<ElTabPane label="基本信息" name="first">
<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>
</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: "ConfluenceArea",
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() {
this.data = {
...this.dialogData,
roadName: null,
};
//
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>
.confluencearea {
width: 508px;
// height: 248px;
color: #fff;
display: flex;
flex-direction: column;
::v-deep {
.el-tabs__content {
overflow-y: auto;
max-height: 220px;
}
}
.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>../mixin../mixin../mixin

3
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/mixin.js

@ -25,10 +25,13 @@ export const dialogDelayVisible = {
computed: {
obverseVisible: {
set(bool) {
if(this.visibleClose){
try {
typeof this.visibleClose === "function" && this.visibleClose?.(bool);
} catch (error) {}
}
setTimeout(() => {
this.$emit("change", bool);
}, 180);

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

@ -53,6 +53,7 @@ import RoadNetworkFacilities from "./../Dialogs/RoadNetworkFacilities/index.vue"
import SmartDevice from "./../Dialogs/SmartDevice/index.vue";
import RemoteMachine from "./../Dialogs/RemoteMachine/index.vue";
import SolarEnergy from "./../Dialogs/SolarEnergy/index.vue";
import ConfluenceArea from "./../Dialogs/ConfluenceArea/index.vue";
import Intermodulation from "./../Dialogs/Intermodulation/index.vue";
import GuardrailCollision from "./../Dialogs/GuardrailCollision/index.vue";
import MeteorologicalDetection from "./../Dialogs/MeteorologicalDetection/index.vue";
@ -79,7 +80,8 @@ export default {
FatigueWakesUp,
RoadNetworkFacilities,
RemoteMachine,
MeteorologicalDetection
MeteorologicalDetection,
ConfluenceArea
},
data() {
return {
@ -246,7 +248,7 @@ export default {
const key = getHandleDeviceType(item) || `${this.active}/${item.title}`;
const status = item.status;
console.log(item.status,'------------')
if (!status) { //
this.nowSelected = item.title;
this.nowSelectedCompleted = false;
@ -479,4 +481,4 @@ export default {
}
}
}
</style>
</style>../Dialogs/ConfluenceArea/index.vue

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

@ -57,6 +57,7 @@ export const DeviceForMap = {
},
合流区: {
deviceType: "8",
dialog:"ConfluenceArea",
},
护栏碰撞: {
deviceType: "6",

49
ruoyi-ui/src/views/JiHeExpressway/pages/perception/meteorologyCheck/components/sortFaceForecast/index.vue

@ -485,6 +485,7 @@ export default {
},
],
weatherList: [],
sort:['长清区','平阴县','东平县','汶上县','梁山县','嘉祥县','巨野县','郓城县']
};
},
@ -503,28 +504,10 @@ export default {
getWeatherFacts().then((response) => {
let obj = response.data;
let data = [];
for (let key in obj) {
// if (key === "weatherFacts1") {
// obj[key].name = "";
// } else if (key === "weatherFacts2") {
// obj[key].name = "";
// } else if (key === "weatherFacts3") {
// obj[key].name = "";
// } else if (key === "weatherFacts4") {
// obj[key].name = "";
// } else if (key === "weatherFacts5") {
// obj[key].name = "";
// } else if (key === "weatherFacts6") {
// obj[key].name = "";
// } else if (key === "weatherFacts7") {
// obj[key].name = "";
// } else if (key === "weatherFacts8") {
// obj[key].name = "";
// }
data.push(obj[key]);
for(let i of this.sort){
data.push(_.find(obj,{name:i}))
}
this.weatherList = data;
// console.log("weatherList", this.weatherList);
});
},
//
@ -533,30 +516,12 @@ export default {
let obj = response.data;
let data = [];
for (let key in obj) {
// if (key === "hourlyWeather1") {
// console.log("obj[key]", obj[key][id - 1]);
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather2") {
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather3") {
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather4") {
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather5") {
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather6") {
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather7") {
// obj[key][id - 1].name = "";
// } else if (key === "hourlyWeather8") {
// obj[key][id - 1].name = "";
// }
data.push(obj[key]);
data.push(obj[key][id-1]);
}
let newData = [];
data.forEach((item) => {
newData.push(item[id - 1]);
});
for(let i of this.sort){
newData.push(_.find(data,{name:i}))
}
this.weatherList = newData;
});
},

Loading…
Cancel
Save