diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/components/DeviceControlDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/components/DeviceControlDialog.vue new file mode 100644 index 00000000..91566e7f --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/components/DeviceControlDialog.vue @@ -0,0 +1,184 @@ + + + + + 时间范围: + + 日 + 月度 + 年度 + + + + + + + + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/components/chart.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/components/chart.js new file mode 100644 index 00000000..8d786f83 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/components/chart.js @@ -0,0 +1,114 @@ +import * as echarts from "echarts"; + +export const lineChartOption = { + color: ["#2AD9FD"], + xAxis: { + name: "时", + type: "category", + // boundaryGap: ["15%", "15%"], + nameTextStyle: { + color: "#2AD9FD", + align: "right", + fontSize: 15, + padding: [0, -15, 0, 0], + }, + boundaryGap: false, + data: ['00:00','02:00','04:00','06:00'], + axisTick: { + show: false, + }, + axisLabel: { + color: "#fff", + fontSize: 12, + }, + axisLine: { + lineStyle: { + color: "#668598", + }, + }, + }, + yAxis: { + name: "辆", + type: "value", + nameTextStyle: { + color: "#2AD9FD", + // align: "right", + fontSize: 15, + // padding: [0, -15, 0, 0], + }, + // nameGap: 24, + splitLine: { + lineStyle: { + type: [6, 9], + color: "rgba(255,255,255, .3)", + // dashOffset: [10, 10], + // cap: 21, + // width: 2 + }, + }, + axisLabel: { + color: "#fff", + fontSize: 12, + formatter: "{value}", + }, + }, + grid: { + left: 33, + top: 33, + bottom: 24, + right: 36, + }, + tooltip: { + trigger: "axis", + backgroundColor: "rgba(0,0,0,0.36)", + borderWidth: 0, + textStyle: { + color: "#fff", + }, + formatter: "{b}:{c}", + // formatter: function([axisData]) { + // console.log(axisData) + // let str = axisData.name + ' ' + axisData.data + '辆'; + // // params.forEach(item => { + // // if (item.seriesName === '供温' || item.seriesName === '回温') { + // // str += item.marker + item.seriesName + ' : ' + item.data.value + ' ℃' + ''; + // // } else if (item.seriesName === '压力值(Mpa)') { + // // // 柱状图渐变时设置marker + // // item.marker = ''; + // // str += item.marker + item.seriesName + ' : ' + item.data.value + ' m'; + // // } + // // }); + // return str; + // } + }, + legend: { + textStyle: { + color: '#2AD9FD' + } + }, + series: [ + { + data: [1,2,3,4], + type: "line", + showSymbol: false, + smooth: true, + name: '温度(℃)', + lineStyle: { + color: "#2AD9FD", + }, + areaStyle: { + opacity: 0.8, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgb(90, 227, 255, .9)", + }, + { + offset: 1, + color: "rgba(42,217,253,0)", + }, + ]), + }, + }, + ], +}; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/index.vue new file mode 100644 index 00000000..0f93b269 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/MeteorologicalDetection/index.vue @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + 气温变化趋势 + 能见度变化趋势 + + + + + + + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue index a7291719..f30a110b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue @@ -51,6 +51,7 @@ import RemoteMachine from "./../Dialogs/RemoteMachine/index.vue"; import SolarEnergy from "./../Dialogs/SolarEnergy/index.vue"; import Intermodulation from "./../Dialogs/Intermodulation/index.vue"; import GuardrailCollision from "./../Dialogs/GuardrailCollision/index.vue"; +import MeteorologicalDetection from "./../Dialogs/MeteorologicalDetection/index.vue"; import FatigueWakesUp from "./../Dialogs/FatigueWakesUp/index.vue"; import { addInGraphHandle, markerClusterIns } from "./utils/map" @@ -73,7 +74,8 @@ export default { GuardrailCollision, FatigueWakesUp, RoadNetworkFacilities, - RemoteMachine + RemoteMachine, + MeteorologicalDetection }, data() { return { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js index a2d3858d..c724281d 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js @@ -70,6 +70,7 @@ export const DeviceForMap = { }, 气象检测器: { deviceType: "3", + dialog: "MeteorologicalDetection", }, 疲劳唤醒: { deviceType: "10", @@ -111,7 +112,7 @@ function resolveDataOptions(data, config, component, isDefault) { name: "", config: { markerClick: (extData, item) => { - const formData = extData?.otherConfig + const formData = (extData?.otherConfig && typeof extData?.otherConfig !== 'string') ? JSON.parse(extData.otherConfig) : null; // formData.pictures = ["https://pic1.zhimg.com/80/v2-c00beaae1f6e3c09a6d77c16c70002fe_1440w.webp?source=1def8aca","https://pic1.zhimg.com/80/v2-c56626621906417a453d262ac11f3385_1440w.webp?source=1def8aca"] @@ -121,7 +122,7 @@ function resolveDataOptions(data, config, component, isDefault) { data: { ...extData, formData, - parseOtherConfig: JSON.parse(extData.otherConfig || "{}"), + parseOtherConfig: JSON.parse((extData.otherConfig && typeof extData.otherConfig !== 'string')|| "{}"), _itemData: item, }, }; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js index d8c81886..e07ab632 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/httpList.js @@ -205,7 +205,7 @@ const DeviceTypeMap = { 14: "光线在线监测", */ export function getDeviceList(deviceType, options) { - console.log(deviceType, options,'------------') + console.log(deviceType, options, "------------"); return new Promise((resolve, reject) => { if (!deviceType) { // Message.error(`${DeviceTypeMap[deviceType]}设备加载失败!`); @@ -223,13 +223,13 @@ export function getDeviceList(deviceType, options) { let data = { deviceType: deviceType, endStakeMark: newEndStakeMark, - startStakeMark: newStartStakeMark - } - if(options.childType && options.childType.split('-')[0] === deviceType){ - data.childType = options.childType + startStakeMark: newStartStakeMark, + }; + if (options.childType && options.childType.split("-")[0] === deviceType) { + data.childType = options.childType; } - if(options.deviceState && options.deviceState !== ''){ - data['deviceState'] = options.deviceState + if (options.deviceState && options.deviceState !== "") { + data["deviceState"] = options.deviceState; } request( Object.keys(options || {}).length @@ -461,3 +461,33 @@ export function getRoadNetworkFacilitiesList(facilityType, options = {}) { }); }); } + +/** + * 气象检测器 获取气象信息 + * @param {string} deviceName + */ +export function getMeteorologicalDetector(deviceName, options = {}) { + return new Promise((resolve, reject) => { + if (!deviceName) { + Message.error(`气象信息加载失败!`); + return reject(); + } + + request({ + url: `/dc/system/meteorologicalDetector/device/${deviceName}`, + method: "get", + }) + .then(({ code, rows }) => { + if (code != 200) { + reject(); + return Message.error(`气象信息加载失败!`); + } + + resolve(rows[0] || {}); + }) + .catch(() => { + Message.error(`气象信息加载失败!`); + reject(); + }); + }); +} diff --git a/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js b/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js index 3c4c97e6..c77e90ab 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js +++ b/ruoyi-ui/src/views/JiHeExpressway/utils/enum.js @@ -126,7 +126,7 @@ export const RoadNFTopics = { 服务区: 6, 停车区: 7, 清障驻点: 8, - 边坡: 9 + 边坡: 9, }; // 事件类型 eventType @@ -168,21 +168,21 @@ export const InfoWarningSource = { }; export const warningSourceMapping = { - 1: '视频AI', - 2: '雷达识别', - 3: '锥桶', - 4: '护栏碰撞', - 5: '扫码报警', - 6: '非机预警', + 1: "视频AI", + 2: "雷达识别", + 3: "锥桶", + 4: "护栏碰撞", + 5: "扫码报警", + 6: "非机预警", // 7: '气象监测器' -} +}; export const warningStateMapping = { - 1: '上报', - 2: '已完成', - 3: '已终止', - 4: '自动结束' -} + 1: "上报", + 2: "已完成", + 3: "已终止", + 4: "自动结束", +}; // 感知事件主类 warningType export const WarningType = { @@ -288,16 +288,16 @@ export const trafficType = Object.keys(EventTopics).reduce((prev, now) => { //激光疲劳唤醒工作模式 export const awakerWorkModeDic = { - "0": "激光关闭", - "1": "常亮模式", - "2": "间隔100ms闪烁模式", - "3": "间隔200ms闪烁模式", - "4": "间隔500ms闪烁模式", - "5": "2次闪烁模式", - "6": "SOS模式", - "7": "自定义模式1", - "8": "自定义模式2", - "9": "自定义模式3", + 0: "激光关闭", + 1: "常亮模式", + 2: "间隔100ms闪烁模式", + 3: "间隔200ms闪烁模式", + 4: "间隔500ms闪烁模式", + 5: "2次闪烁模式", + 6: "SOS模式", + 7: "自定义模式1", + 8: "自定义模式2", + 9: "自定义模式3", }; // 感知事件主类的子类(上方) warningSubclass @@ -1077,14 +1077,14 @@ export const EventSubclass = { "9-6": "其他", "10-1": "雨", "10-2": "雪", - "10-3":"雾", - "10-4":"大风", - "10-5":"低温寒潮", - "10-6":"路面积雪", - "10-7":"路面结冰", - "10-8":"路面积水", - "10-9":"其他", - "11-1":"其他事件" + "10-3": "雾", + "10-4": "大风", + "10-5": "低温寒潮", + "10-6": "路面积雪", + "10-7": "路面结冰", + "10-8": "路面积水", + "10-9": "其他", + "11-1": "其他事件", }; export const directionOptions = [ { value: "1", label: "菏泽方向" }, @@ -1181,4 +1181,62 @@ export const usageStatus = { 1: { text: "未使用", }, -} \ No newline at end of file +}; +//路面类型 +export const remoteRoadSurfaceStatus = { + "00": { + text: "干燥", + }, + "01": { + text: "潮湿", + }, + "02": { + text: "积水", + }, + "03": { + text: "结冰", + }, + "04": { + text: "积雪", + }, + "05": { + text: "冰水混合物", + }, + "06": { + text: "泥泞", + }, +}; + +//下雨类型 +export const precipitationType = { + 0: { + text: "无降雨", + }, + 1: { + text: "雨", + }, + 2: { + text: "雪", + }, + 3: { + text: "毛毛雨", + }, + 4: { + text: "雨夹雪", + }, +}; +//能见度类型 +export const visibilityType = { + 4: { + text: "良好", + }, + 3: { + text: "阴霾", + }, + 2: { + text: "雾", + }, + 1: { + text: "浓雾", + }, +};
时间范围: