From 675a4ffabbb97432e8d6f772ccf73a16c79ed7b0 Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Wed, 20 Mar 2024 18:10:07 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E7=A2=B0=E6=92=9E=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/LineChart/chart.js | 102 ++++++++++ .../components/LineChart/index.vue | 23 +++ .../components/LineChartForTraffic/chart.js | 110 ++++++++++ .../components/LineChartForTraffic/index.vue | 23 +++ .../Dialogs/GuardrailCollision/index.vue | 188 ++++++++++++++++++ .../Home/components/RoadAndEvents/index.vue | 5 +- .../RoadAndEvents/utils/buttonEvent.js | 1 + 7 files changed, 451 insertions(+), 1 deletion(-) create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/chart.js create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/index.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/chart.js create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/index.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/index.vue diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/chart.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/chart.js new file mode 100644 index 00000000..b8fb844a --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/chart.js @@ -0,0 +1,102 @@ +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: ["1", "5", "10", "15", "20", "25", "30"], + axisTick: { + show: false, + }, + axisLabel: { + color: "#fff", + fontSize: 12, + }, + axisLine: { + lineStyle: { + color: "#668598", + }, + }, + }, + grid: { + left: 51, + top: 15, + 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; + // } + }, + yAxis: { + max: 100, + type: "value", + // 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} %", + }, + }, + series: [ + { + data: [0, 90, 65, 90, 45, 36, 27], + type: "line", + showSymbol: false, + smooth: true, + 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/GuardrailCollision/components/LineChart/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/index.vue new file mode 100644 index 00000000..31d73d94 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChart/index.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/chart.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/chart.js new file mode 100644 index 00000000..95649615 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/chart.js @@ -0,0 +1,110 @@ +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: ["0", "2", "4", "6", "8", "10", "12", "14", "16", "18", "20", "22"], + axisTick: { + show: false, + }, + axisLabel: { + color: "#fff", + fontSize: 12, + }, + axisLine: { + lineStyle: { + color: "#668598", + }, + }, + }, + + yAxis: { + max: 1, + 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; + // } + }, + series: [ + { + data: [0, 0.3, 0.6, 0.24, 0.15, 0.66, 0.9, 0, 0.36, 0.51, 0.72, 0.6, 0.3], + type: "line", + showSymbol: false, + smooth: true, + 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/GuardrailCollision/components/LineChartForTraffic/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/index.vue new file mode 100644 index 00000000..31d73d94 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/components/LineChartForTraffic/index.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/index.vue new file mode 100644 index 00000000..05a05c68 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/GuardrailCollision/index.vue @@ -0,0 +1,188 @@ + + + + + + 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 c56d1afc..30dbef2b 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 @@ -47,12 +47,14 @@ import TrafficIncidents from "./../Dialogs/TrafficIncidents/index.vue"; import PerceiveEvent from "./../Dialogs/PerceiveEvent/index.vue"; import SmartDevice from "./../Dialogs/SmartDevice/index.vue"; import Intermodulation from "./../Dialogs/Intermodulation/index.vue"; +import GuardrailCollision from "./../Dialogs/GuardrailCollision/index.vue"; + import FatigueWakesUp from "./../Dialogs/FatigueWakesUp/index.vue"; import { addInGraphHandle } from "./utils/map" import { lngLatMap } from "./utils/buttonEvent"; export default { - name: 'RoadAndEvents', + name: 'RoadAndEvents',//首页弹窗 渲染基类 components: { // ControlCamera, Camera, @@ -64,6 +66,7 @@ export default { PerceiveEvent, SmartDevice, Intermodulation, + GuardrailCollision, FatigueWakesUp }, data() { 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 e69d0b66..25b5bb13 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 @@ -59,6 +59,7 @@ export const DeviceForMap = { }, 护栏碰撞: { deviceType: "6", + dialog: "GuardrailCollision", }, 智慧锥桶: { deviceType: "9",