From d372c3179c32801978da3054921fbfcaf5915ca8 Mon Sep 17 00:00:00 2001 From: mbp <360013221@qq.com> Date: Sat, 21 Sep 2024 16:45:31 +0800 Subject: [PATCH] =?UTF-8?q?=E2=91=A0=20=E9=A6=96=E9=A1=B5=E6=8A=A4?= =?UTF-8?q?=E6=A0=8F=E7=A2=B0=E6=92=9E=E8=AD=A6=E7=A4=BA=E7=81=AF=E5=BC=80?= =?UTF-8?q?=E5=85=B3=20=E2=91=A1=20=E9=A6=96=E9=A1=B5=E6=94=B6=E8=B4=B9?= =?UTF-8?q?=E7=AB=99=E6=91=84=E5=83=8F=E5=A4=B4=E5=BC=95=E5=AF=BC=E5=9B=BE?= =?UTF-8?q?=20=E2=91=A2=20=E9=AB=98=E9=80=9F=E4=BA=91=E7=BB=9F=E8=AE=A1=20?= =?UTF-8?q?=E2=91=A3=20=E8=AE=BE=E5=A4=87=E7=A6=BB=E7=BA=BF=E5=BC=B9?= =?UTF-8?q?=E7=AA=97/=E9=A1=B5=E9=9D=A2=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/common/menuData.js | 6 + ruoyi-ui/src/main.js | 5 +- .../components/DialogDeviceOffline/data.js | 11 + .../components/DialogDeviceOffline/index.vue | 156 +++++++++ .../components/HeaderMenu/WarningList.vue | 40 ++- .../components/VideoMulti/index.vue | 26 +- .../components/WarningNotify.vue | 25 +- .../images/deviceType/balle_active.svg | 46 +-- .../images/deviceType/balle_fault.svg | 46 +-- .../JiHeExpressway/images/event/设备.svg | 1 + .../images/shoufeiz/大学城收费站.jpg | Bin 0 -> 134112 bytes .../images/shoufeiz/孝里收费站.jpg | Bin 0 -> 131381 bytes .../Dialogs/DrivingGuidance/index.vue | 1 - .../Dialogs/GuardrailCollision/index.vue | 40 ++- .../Dialogs/RoadNetworkFacilities/index.vue | 159 ++++++--- .../Home/components/RoadAndEvents/index.vue | 1 + .../smart/abnormal/data.js | 32 ++ .../smart/abnormal/index.vue | 242 ++++++++++++++ .../trafficFlow/analysis/real/charts.js | 5 +- .../pages/service/analysis/charts.js | 1 + .../pages/service/analysis/charts3.js | 174 +--------- .../pages/service/analysis/charts4.js | 1 + .../pages/service/analysis/charts6.js | 116 +------ .../pages/service/analysis/charts8.js | 85 ++++- .../pages/service/analysis/index.vue | 312 +++++++++++------- .../pages/service/analysis/search/index.vue | 6 +- .../src/views/JiHeExpressway/utils/enum.js | 8 + ruoyi-ui/src/views/websocket.vue | 35 +- ruoyi-ui/vue.config.js | 4 +- 29 files changed, 1086 insertions(+), 498 deletions(-) create mode 100644 ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/data.js create mode 100644 ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/index.vue create mode 100644 ruoyi-ui/src/views/JiHeExpressway/images/event/设备.svg create mode 100644 ruoyi-ui/src/views/JiHeExpressway/images/shoufeiz/大学城收费站.jpg create mode 100644 ruoyi-ui/src/views/JiHeExpressway/images/shoufeiz/孝里收费站.jpg create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/data.js create mode 100644 ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/index.vue diff --git a/ruoyi-ui/src/common/menuData.js b/ruoyi-ui/src/common/menuData.js index abc5ab88..a8f75e43 100644 --- a/ruoyi-ui/src/common/menuData.js +++ b/ruoyi-ui/src/common/menuData.js @@ -188,6 +188,12 @@ export default [ path: "/maintain/smart/analysis", component: "maintenanceOperations/smart/analysis/index.vue", }, + { + title: "设备异常管理", + name: "deviceAbnormal", + path: "/maintain/smart/abnormal", + component: "maintenanceOperations/smart/abnormal/index.vue", + }, ], }, // { diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 28f626aa..b82f3e1a 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -55,9 +55,10 @@ import eventDialogTable from "@/components/eventDialogTable"; import evtDialogOneThing from "@/components/eventDialogTable/evtDialogOneThing.vue"; import evtDialogVideo from "@/components/eventDialogTable/video.vue"; -// 时间弹窗 +// 事件弹窗 import EventDetailDialog from "@screen/pages/control/event/event/EventDetailDialog/index"; +import DialogDeviceOffline from '@screen/components/DialogDeviceOffline/index.vue' import mitt from "mitt"; const emitter = mitt(); @@ -135,6 +136,8 @@ Vue.component("evtDialogOneThing", evtDialogOneThing); Vue.component("evtDialogVideo", evtDialogVideo); + +Vue.component("DialogDeviceOffline", DialogDeviceOffline); Vue.component("EventDetailDialog", EventDetailDialog); Vue.component(CollapseTransition.name, CollapseTransition); diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/data.js b/ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/data.js new file mode 100644 index 00000000..8d8511f3 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/data.js @@ -0,0 +1,11 @@ + +export const _formList = [ + { + label: "设备名称:", + key: "deviceName", + type: "input", + options: { + placeholder: "", + } + }, +]; diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/index.vue new file mode 100644 index 00000000..7e9ffaf7 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/components/DialogDeviceOffline/index.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/WarningList.vue b/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/WarningList.vue index 72821ef2..a746ca77 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/WarningList.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/WarningList.vue @@ -5,6 +5,7 @@ +
@@ -34,10 +35,14 @@ + + + @@ -45,8 +50,9 @@ import request from "@/utils/request"; import Table from '@screen/components/Table.vue'; import Pagination from '@screen/components/Pagination.vue'; -import { WarningType } from "@screen/utils/enum.js"; +import { WarningType , deviceTypeOptions} from "@screen/utils/enum.js"; import { Message } from "element-ui"; + import { WarningType as warningTypeMapping, DirectionTypes as gzDirectionMapping, warningSourceMapping, warningStateMapping } from "@screen/utils/enum.js" import DialogWarning from './dialogWarn/DialogWarning.vue' @@ -55,7 +61,7 @@ export default { components: { Table, Pagination, - DialogWarning + DialogWarning, }, data() { return { @@ -72,6 +78,10 @@ export default { }, dialogWarningVisible: false, + + + modelDeviceVisible:false, + activeId:'' }; }, computed: { @@ -89,7 +99,17 @@ export default { onChangeTab(tab, event) { this.getMainData(); }, + + handleDeviceDialogClose() { + this.modelDeviceVisible = false; + }, onCellClick(row, column, cell, event) { + if(this.activeTab === 'fifth'){ + this.activeId = row.id; + this.modelDeviceVisible = true; + + return; + } if(this.activeTab === 'four'){ if(row.warningType === '1'){ @@ -167,6 +187,22 @@ export default { this.tableData = result.rows; this.total = result.total; }) + } else if(this.activeTab === 'fifth'){ + request({ + url: `/deviceOfflineRecord/list?pageSize=${this.searchData.pageSize}&pageNum=${this.searchData.pageNum}`, + method: "GET", + }) + .then((result) => { + if (result.code != 200) return; + result.rows.forEach(item => { + item.icon = '设备' + item.remark = item.createTime+ ' '+item.stakeMark +' ' +item.deviceName+'发生故障' + item.stringEventType = _.find(deviceTypeOptions,{value:parseInt(item.deviceType)}).label + + }) + this.tableData = result.rows; + this.total = result.total; + }) } }, firstBtnClick(id) {//点击去确认/详情/处置记录等第一个按钮 diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/VideoMulti/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/VideoMulti/index.vue index 2e2e5602..87a6227d 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/VideoMulti/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/VideoMulti/index.vue @@ -63,14 +63,17 @@ export default { this.playVideo(); this.$once("hook:beforeDestroy", () => this.player?.destroy()); }, + destroyed(){ + this.player?.destroy(); + }, methods: { handleClose() { this.controlDialogVisible = false; }, cameraChange() { + console.log('chanage.======') const changeItem = find(this.urls, { iotDeviceId: this.cameraId }); this.dialogData = { ...changeItem, parseOtherConfig: changeItem.otherConfig && JSON.parse(changeItem.otherConfig) }; - console.log(this.cameraId, this.dialogData) this.player?.destroy(); const self = this; setTimeout(() => { @@ -89,9 +92,19 @@ export default { this.$message.warning("未获取到附近的相机信息"); return; } - if (data[this.rangeIndex]) { - this.urls = data[this.rangeIndex] - const firstItem = data[this.rangeIndex]?.[0] || {}; + let urls = []; + if(this.rangeIndex === 'all'){ + for(let i in data){ + urls = [...urls,...data[i]] + } + this.$emit('nearload', urls.map(x=>x.iotDeviceId)) + } + else if (data[this.rangeIndex]) { + urls = data[this.rangeIndex] + } + if(urls.length > 0){ + this.urls = urls; + const firstItem = urls[0]; this.cameraId = firstItem['iotDeviceId']; this.dialogData = { ...firstItem, parseOtherConfig: firstItem.otherConfig && JSON.parse(firstItem.otherConfig) } this.showVideo(); @@ -99,6 +112,11 @@ export default { }, showVideo() { this.player = new HttpLivePlayer(this.$refs.videoContainerRef, { camId: this.cameraId }); + }, + setCameraId(id){ + console.log('外部改变cameraId',id,3333) + this.cameraId = id; + this.cameraChange(); } } } diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue b/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue index d775d610..7c93d5aa 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/WarningNotify.vue @@ -5,13 +5,16 @@ + + + @@ -190,4 +221,9 @@ div.switcher { } } } +.jsdcontrol{ + display:flex; + margin-top:20px; + align-content: center; +} diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue index 705413c4..26d9933c 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/RoadNetworkFacilities/index.vue @@ -3,47 +3,55 @@ v-model="obverseVisible" :title="dialogData._itemData && dialogData._itemData.title" @update:close="camClose" - width="500px" top="10%"> -
-
-
-
- - - - - -
- - - - - -
- - - - - - - -
- - - - - + :width="isCameraMap?'1300px':'500px'" top="10%"> +
+
+
+
+
+ + + + + + + + + + + +
+
+ + + + + + +
+ + - - + +
- +
+
+ +
+
@@ -63,7 +71,16 @@ import { chartOption } from "./chart" import moment from "moment"; import Table from "@screen/components/Table.vue"; - +const icona = require(`@screen/images/layerb/路测设备/摄像机_active.svg`);// childType==='1-2 高清网络枪机 +const icona_f = require(`@screen/images/layerb/路测设备/摄像机_fault.svg`); +const iconb = require(`@screen/images/deviceType/ballb_active.svg`); // childType==='1-2 高清网络球形摄像机 +const iconb_f = require(`@screen/images/deviceType/ballb_fault.svg`); +const iconc = require(`@screen/images/deviceType/ballc_active.svg`); // 1-3 桥下高清网络球形摄像机 +const iconc_f = require(`@screen/images/deviceType/ballc_fault.svg`); +const icond = require(`@screen/images/deviceType/balld_active.svg`); // 1-4 360°全景摄像机 +const icond_f = require(`@screen/images/deviceType/balld_fault.svg`); +const icone = require(`@screen/images/deviceType/balle_active.svg`); //1-5 180°全景摄像机 +const icone_f = require(`@screen/images/deviceType/balle_fault.svg`); // 所有交通事件的详情 export default { name: "RoadNetworkFacilities", @@ -97,7 +114,10 @@ export default { upsData:{}, // 收费站增加UPS upsList:[], - + // 收费站 + isCameraMap:false, + imgSrc:'', + cameraMaps:[] }; }, watch: { @@ -165,21 +185,53 @@ export default { // pointList = resPointList.data.result[0] // } dData = { ...dData, ...otherConfig,} - - + this.isCameraMap = false; + this.cameraMaps = []; + if(dData.facilityType === 1){ + // console.log('收费站单独处理图像') + if(dData.facilityName === '大学城收费站'){ + this.imgSrc = require('@screen/images/shoufeiz/大学城收费站.jpg') + this.cameraMaps = [ + {icon:icona,iconUn:icona_f,left:50,top:50,status:0,iotDeviceId:'57954'}, + {icon:iconb,iconUn:iconb_f,left:500,top:50,status:0,iotDeviceId:'57939'}, + {icon:iconc,iconUn:iconc_f,left:100,top:200,status:0,iotDeviceId:'57941'}, + {icon:iconc,iconUn:iconc_f,left:600,top:500,status:0,iotDeviceId:'111111'}, + {icon:icone,iconUn:icone_f,left:200,top:400,status:0,iotDeviceId:'222222'}, + {icon:icona,iconUn:icona_f,left:30,top:30,status:0,iotDeviceId:'57953'} + ] + this.isCameraMap = true; + } + else if(dData.facilityName === '孝里收费站'){ + this.imgSrc = require('@screen/images/shoufeiz/孝里收费站.jpg') + this.isCameraMap = true; + } + } this.upsList=otherConfig.UPSList||[] } this.data = dData; - - }, methods: { + bindNearLoad(e){ + for(let i of this.cameraMaps){ + if(e.indexOf(i.iotDeviceId) !== -1){ + i.status = 1; + } + } + }, camClose(){ if(this.$refs.refVideo.closeContrl){ this.$refs.refVideo.closeContrl() } this.upsList =[] }, + showCamera(item){ + if(item.status === 1){ + this.$refs.refVideo.setCameraId(item.iotDeviceId) + } else { + this.$message.warning('设备离线') + } + + }, bindUPS(id){ request({ url: `business/device/properties/latest/${id}`, @@ -258,7 +310,10 @@ export default { height: 160px; overflow: hidden; } - +.panelParent{ + display: flex; + flex-direction: row; +} .RoadNetworkFacilities { width: 452px; color: #fff; @@ -316,4 +371,16 @@ export default { } } } + +.cameraMap{ + position:relative; + width:800px; + height:600px; + background-repeat: no-repeat; + background-size: 100% 100%; + img{ + position: absolute; + cursor: pointer; + } +} \ No newline at end of file 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 974aebb2..2f868c7c 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 @@ -408,6 +408,7 @@ export default { transition: all .24s linear; height: 0px; overflow-y: auto; + min-height: 185px; .device-item { // position: absolute; position: relative; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/data.js new file mode 100644 index 00000000..83fccd47 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/data.js @@ -0,0 +1,32 @@ +// import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js"; +import * as PresetFormItems from "@screen/common/PresetFormItems.js"; +// import { merge, cloneDeep } from "lodash"; + +import {directionOptions} from '@screen/utils/enum.js'; +export const searchFormList = [ + { + label: "处理状态:", + key: "status", + type: "select", + options: { + clearable: true, + options: [ + {key:'0', label:'未处理'}, + {key:'1', label:'已处理'}, + {key:'2', label:'自动处理'} + ], + }, + }, + { + label: "发生时间:", + key: "createTime", + required: false, + type: "datePicker", + options: { + type: "daterange", + format: "yyyy-MM-dd", + valueFormat: "yyyy-MM-dd", + }, + }, + +]; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/index.vue new file mode 100644 index 00000000..501e8dd0 --- /dev/null +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/smart/abnormal/index.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/analysis/real/charts.js b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/analysis/real/charts.js index a54da39d..d5367c47 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/analysis/real/charts.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/analysis/real/charts.js @@ -59,14 +59,13 @@ var options = { }, grid: [ { - left: 40, + left: 60, top: '25%', right: 10, height: "35%", }, { - left: 40, - + left: 60, right: 10, top: "60%", height: "35%", diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts.js b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts.js index 064bd531..9609a41a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts.js @@ -46,6 +46,7 @@ let options = { yAxis: [ { name: "(起)", + minInterval:1, nameTextStyle: { color: "#E5E7E8", fomtSize: 10, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts3.js b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts3.js index 6222589d..c36fae1e 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts3.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts3.js @@ -1,7 +1,6 @@ import * as echarts from "echarts"; let options = { - color:['#00A3FF','#0c8c52','#c7d61d'], tooltip: { show: true, trigger: "axis", @@ -73,6 +72,7 @@ let options = { axisTick: { show: false, }, + minInterval:1, }, ], legend: { @@ -90,174 +90,34 @@ let options = { type: "bar", barWidth: "10px", selectedMode: false, - select: { - itemStyle: { - opacity: 1, - color: function (params) { - var a = params; - - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#0c8c52", // 0% 处的颜色 - }, - { - offset: 1, - color: "#003B4E", // 100% 处的颜色 - }, - ], - false - ); - }, - }, - }, - itemStyle: { - barBorderRadius: [10, 10, 10, 10], // 圆角(左上、右上、右下、左下) - // lenged文本 - opacity: 1, - color: function (params) { - var a = params.name; - // console.log("==========a=============", a); - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#00A3FF", // 0% 处的颜色 - }, - { - offset: 1, - color: "#00A3FF00", // 100% 处的颜色 - }, - ], - false - ); - }, - }, data: [], }, { name: "小型车", type: "bar", barWidth: "10px", + data: [], + }, { + name: "客车", + type: "bar", + barWidth: "10px", selectedMode: false, - select: { - itemStyle: { - opacity: 1, - color: function (params) { - var a = params; - - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#0c8c52", // 0% 处的颜色 - }, - { - offset: 1, - color: "#003B4E", // 100% 处的颜色 - }, - ], - false - ); - }, - }, - }, - itemStyle: { - barBorderRadius: [10, 10, 10, 10], // 圆角(左上、右上、右下、左下) - // lenged文本 - opacity: 1, - color: function (params) { - var a = params.name; - // console.log("==========a=============", a); - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#0c8c52", // 0% 处的颜色 - }, - { - offset: 1, - color: "#0c8c5200", // 100% 处的颜色 - }, - ], - false - ); - }, - }, + data: [], + }, { + name: "货车", + type: "bar", + barWidth: "10px", + selectedMode: false, + data: [], + }, { + name: "小型车", + type: "bar", + barWidth: "10px", data: [], }, { name: "客车", type: "bar", barWidth: "10px", selectedMode: false, - select: { - itemStyle: { - opacity: 1, - color: function (params) { - var a = params; - - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#c7d61d", // 0% 处的颜色 - }, - { - offset: 1, - color: "#003B4E", // 100% 处的颜色 - }, - ], - false - ); - }, - }, - }, - itemStyle: { - barBorderRadius: [10, 10, 10, 10], // 圆角(左上、右上、右下、左下) - // lenged文本 - opacity: 1, - color: function (params) { - var a = params.name; - // console.log("==========a=============", a); - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#c7d61d", // 0% 处的颜色 - }, - { - offset: 1, - color: "#c7d61d00", // 100% 处的颜色 - }, - ], - false - ); - }, - }, data: [], } ], diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts4.js b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts4.js index e2aae96f..f9edaa48 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts4.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts4.js @@ -73,6 +73,7 @@ let options = { axisTick: { show: false, }, + minInterval:1, }, ], legend: { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts6.js b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts6.js index 788d677d..d30ea3d0 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts6.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts6.js @@ -1,7 +1,6 @@ import * as echarts from "echarts"; let options = { - color:['#00A3FF','#0c8c52'], tooltip: { show: true, trigger: "axis", @@ -73,6 +72,7 @@ let options = { axisTick: { show: false, }, + minInterval:1, }, ], legend: { @@ -89,117 +89,23 @@ let options = { name: "封闭", type: "bar", barWidth: "10px", + data: [], + }, { + name: "限行", + type: "bar", + barWidth: "10px", selectedMode: false, - select: { - itemStyle: { - opacity: 1, - color: function (params) { - var a = params; - - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#0c8c52", // 0% 处的颜色 - }, - { - offset: 1, - color: "#003B4E", // 100% 处的颜色 - }, - ], - false - ); - }, - }, - }, - itemStyle: { - barBorderRadius: [10, 10, 10, 10], // 圆角(左上、右上、右下、左下) - // lenged文本 - opacity: 1, - color: function (params) { - var a = params.name; - // console.log("==========a=============", a); - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#00A3FF", // 0% 处的颜色 - }, - { - offset: 1, - color: "#00A3FF00", // 100% 处的颜色 - }, - ], - false - ); - }, - }, + data: [], + }, { + name: "封闭", + type: "bar", + barWidth: "10px", data: [], }, { name: "限行", type: "bar", barWidth: "10px", selectedMode: false, - select: { - itemStyle: { - opacity: 1, - color: function (params) { - var a = params; - - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#0c8c52", // 0% 处的颜色 - }, - { - offset: 1, - color: "#003B4E", // 100% 处的颜色 - }, - ], - false - ); - }, - }, - }, - itemStyle: { - barBorderRadius: [10, 10, 10, 10], // 圆角(左上、右上、右下、左下) - // lenged文本 - opacity: 1, - color: function (params) { - var a = params.name; - // console.log("==========a=============", a); - return new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "#0c8c52", // 0% 处的颜色 - }, - { - offset: 1, - color: "#0c8c5200", // 100% 处的颜色 - }, - ], - false - ); - }, - }, data: [], } ], diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts8.js b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts8.js index 97d713cb..20d691d6 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts8.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/charts8.js @@ -14,11 +14,15 @@ var options = { } return `${name1}
- ${params[0].marker}${params[0].seriesName}: ${params[0].value} 辆 + ${params[0].marker}${params[0].seriesName}: ${params[0].value} 辆 +
+ ${params[1].marker}${params[1].seriesName}: ${params[1].value} 辆

${name2}
- ${params[1].marker}${params[1].seriesName}: ${params[1].value} 辆`; + ${params[2].marker}${params[2].seriesName}: ${params[2].value} 辆 +
+ ${params[3].marker}${params[3].seriesName}: ${params[3].value} 辆`; }, }, axisPointer: { @@ -55,14 +59,13 @@ var options = { }, grid: [ { - left: 40, + left: 70, top: '25%', right: 10, height: "35%", }, { - left: 40, - + left: 70, right: 10, top: "60%", height: "35%", @@ -151,6 +154,7 @@ var options = { splitLine: { show: false, }, + minInterval:1, }, { gridIndex: 1, @@ -169,6 +173,7 @@ var options = { splitLine: { show: false, }, + minInterval:1, }, ], series: [ @@ -205,6 +210,40 @@ var options = { 57, 36, 56, 95, 125, 194, 94, 94, 74, 34, 125, 194, 94, 94, 74, 34, ], }, + { + name: "去年同期", + type: "line", + symbol: 'none', + smooth: true, + lineStyle: { + type:'dashed', + width: 1 + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 1, + color: "#5FA52B00", + }, + { + offset: 0, + color: "#5FA52B55", + }, + ], + false + ), + }, + }, + data: [ + 94, 74, 34, 125, 194, 94, 94, 74, 34,57, 36, 56, 95, 125, 194, 94, + ], + }, { name: "本期车流量", type: "line", @@ -241,6 +280,42 @@ var options = { 67, 36, 56, 195, 25, 194, 94, 94, 74, 21, 195, 25, 194, 94, 94, 74, 21, ], }, + { + name: "去年同期", + type: "line", + symbol: 'none', + smooth: true, + xAxisIndex: 1, + yAxisIndex: 1, + lineStyle: { + type:'dashed', + width: 1 + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 1, + color: "#5FA52B00", + }, + { + offset: 0, + color: "#5FA52B55", + }, + ], + false + ), + }, + }, + data: [ + 195,25, 194, 94, 94, 7, 25, 194, 94, 94, 74, 21, 67, 36, 56, 195, 4, 21, + ], + }, ], }; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/index.vue index dedeb73e..4684da6a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/index.vue @@ -24,11 +24,13 @@
-
方向:济南
-
方向:菏泽
-
方向:出口
-
方向:入口
-
+
+
方向:济南
+
方向:菏泽
+
方向:出口
+
方向:入口
+
+
@@ -51,6 +53,7 @@ import chartsOptions4 from "./charts4"; import chartsOptions6 from "./charts6"; import chartsOptions8 from "./charts8"; import Table from '@screen/components/Table.vue'; +import { chartOption } from '../../Home/components/Dialogs/RoadNetworkFacilities/chart'; // 辖段管理 export default { @@ -136,6 +139,7 @@ export default { bind(){ let id = this.$refs.menu.getCurrentKey(); let query = this.$refs.search.searchQuery(); + const {thisTime,lastTime} = query; if(id==='1'){ request({ url: '/business/sdhsEvent/sectionAnalysis', @@ -143,11 +147,10 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - - this.tableCols = [{label:'路段桩号',value:'stakeMark'},{label:query.thisTime+' 数量(起)',value:query.thisTime},{label:query.lastTime+' 数量(起)',value:query.lastTime}] - let _tableData = [] - chartsOptions.series[0].name = query.thisTime; - chartsOptions.series[1].name = query.lastTime; + + this.tableCols = [{label:'路段桩号',value:'stakeMark'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}] + chartsOptions.series[0].name = thisTime; + chartsOptions.series[1].name = lastTime; if(result.data.length === 0){ this.tableData = [] chartsOptions.series[0].data = [] @@ -160,9 +163,9 @@ export default { this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions.series[0].data = _tableData.map(x=>x[query.thisTime]) - chartsOptions.series[1].data = _tableData.map(x=>x[query.lastTime]) - chartsOptions.xAxis.data = _tableData.map(x=>x.stakeMark); + chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime]) + chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime]) + chartsOptions.xAxis.data = this.tableData.map(x=>x.stakeMark); this.myChart.setOption(chartsOptions); this.myChart.resize(); }, 200); @@ -174,32 +177,28 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'事故类型',value:'name'},{label:'数量(起)',value:'num'}] - let _tableData = [] - if(_.keys(result.data).length === 0){ + this.tableCols = [{label:'事故类型',value:'eventType'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}] + chartsOptions.series[0].name = thisTime; + chartsOptions.series[1].name = lastTime; + if(result.data.length === 0){ + this.tableData = [] chartsOptions.series[0].data = [] + chartsOptions.series[1].data = [] this.myChart.setOption(chartsOptions); this.myChart.resize(); - this.tableData = [] this.$message.warning('暂无数据') return; } - for(let i in result.data){ - _tableData.push({ - name:i, num:result.data[i] - }) - } - - this.tableData = _tableData; + this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions.series[0].data = _tableData.map(x=>x.num) - chartsOptions.xAxis.data = _tableData.map(x=>x.name); + chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime]) + chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime]) + + chartsOptions.xAxis.data = this.tableData.map(x=>x.eventType); this.myChart.setOption(chartsOptions); this.myChart.resize(); - }, 200); - - + }, 200) }) } else if(id==='3'){ request({ @@ -208,12 +207,30 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'事故类型',value:'name'},{label:'货车',value:'货车'},{label:'小型车',value:'小型车'},{label:'客车',value:'客车'}] + this.tableCols = [ + {label:'事故类型',value:'name'}, + {label:'货车'+thisTime,value:'货车'+thisTime}, + {label:'小型车'+thisTime,value:'小型车'+thisTime}, + {label:'客车'+thisTime,value:'客车'+thisTime}, + {label:'货车'+lastTime,value:'货车'+lastTime}, + {label:'小型车'+lastTime,value:'小型车'+lastTime}, + {label:'客车'+lastTime,value:'客车'+lastTime} + ] + chartsOptions3.series[0].name = '货车'+thisTime + chartsOptions3.series[1].name = '小型车'+thisTime + chartsOptions3.series[2].name = '客车'+thisTime + chartsOptions3.series[3].name = '货车'+lastTime + chartsOptions3.series[4].name = '小型车'+lastTime + chartsOptions3.series[5].name = '客车'+lastTime if(_.keys(result.data).length === 0){ + chartsOptions3.series[0].data = [] chartsOptions3.series[1].data = [] chartsOptions3.series[2].data = [] + chartsOptions3.series[3].data = [] + chartsOptions3.series[4].data = [] + chartsOptions3.series[5].data = [] this.myChart.setOption(chartsOptions3); this.myChart.resize(); this.tableData = [] @@ -221,21 +238,27 @@ export default { return; } let _tableData = [] - for(let i in result.data){ - _tableData.push({ - name:i, - 货车: result.data[i]['货车'] || 0, - 小型车: result.data[i]['小型车'] || 0, - 客车: result.data[i]['客车'] || 0, - }) + for(let i in result.data[thisTime]){ + const _row = {name:i} + _row['货车'+thisTime] = result.data[thisTime][i]['货车']||0 + _row['小型车'+thisTime] = result.data[thisTime][i]['小型车']||0 + _row['客车'+thisTime] = result.data[thisTime][i]['客车']||0 + + _row['货车'+lastTime] = result.data[lastTime][i]['货车']||0 + _row['小型车'+lastTime] = result.data[lastTime][i]['小型车']||0 + _row['客车'+lastTime] = result.data[lastTime][i]['客车']||0 + _tableData.push(_row) } this.tableData = _tableData; this.curid = id; setTimeout(() => { chartsOptions3.xAxis.data = _tableData.map(x=>x.name); - chartsOptions3.series[0].data = _tableData.map(x=>x.货车) - chartsOptions3.series[1].data = _tableData.map(x=>x.小型车) - chartsOptions3.series[2].data = _tableData.map(x=>x.客车) + chartsOptions3.series[0].data = _tableData.map(x=>x['货车'+thisTime]) + chartsOptions3.series[1].data = _tableData.map(x=>x['小型车'+thisTime]) + chartsOptions3.series[2].data = _tableData.map(x=>x['客车'+thisTime]) + chartsOptions3.series[3].data = _tableData.map(x=>x['货车'+lastTime]) + chartsOptions3.series[4].data = _tableData.map(x=>x['小型车'+lastTime]) + chartsOptions3.series[5].data = _tableData.map(x=>x['客车'+lastTime]) this.myChart.setOption(chartsOptions3); this.myChart.resize(); }, 200); @@ -250,47 +273,41 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'事故时间',value:'time'},{label:'当前事故总量(起)',value:'num'},{label:'去年事故总量(起)',value:'numYes'}] + this.tableCols = [{label:'事故时间',value:'time'},{label:thisTime+'事故总量(起)',value:'num'},{label:lastTime+'事故总量(起)',value:'numYes'}] let _tableData = [] + chartsOptions4.series[0].name = thisTime; + chartsOptions4.series[1].name = lastTime; this.curid = id; - - let queryYes = _.cloneDeep(query) - queryYes.startTime = (Number(queryYes.startTime.substr(0,4))-1).toString()+queryYes.startTime.substr(4) - queryYes.endTime = (Number(queryYes.endTime.substr(0,4))-1).toString()+queryYes.endTime.substr(4) - - request({ - url: '/business/sdhsEvent/accidentTimeAnalysis', - method: 'post', - data: queryYes - }).then(resultYes=>{ - if(_.keys(result.data).length === 0){ + if(_.keys(result.data[thisTime]).length === 0){ chartsOptions4.series[0].data = [] chartsOptions4.series[1].data = [] - chartsOptions4.xAxis.data = _tableData.map(x=>x.time); + chartsOptions4.xAxis.data = []; this.myChart.setOption(chartsOptions4); this.myChart.resize(); this.tableData = [] this.$message.warning('暂无数据') return; } - for(let i in result.data){ + for(let i in result.data[thisTime]){ _tableData.push({ idx:parseInt(i), - time:i.toString()+ unit, num:result.data[i.toString()],numYes:resultYes.data[i.toString()] + time:i.toString()+ unit, + num:result.data[thisTime][i.toString()], + numYes:result.data[lastTime][i.toString()] }) } _tableData.sort(function(a,b){return a.idx-b.idx}) this.tableData = _tableData; + setTimeout(() => { + + chartsOptions4.series[0].data = _tableData.map(x=>x.num) chartsOptions4.series[1].data = _tableData.map(x=>x.numYes) chartsOptions4.xAxis.data = _tableData.map(x=>x.time); this.myChart.setOption(chartsOptions4); this.myChart.resize(); - }) - setTimeout(() => { - - }, 200); + },200) }) } else if(id==='5'){ request({ @@ -300,9 +317,12 @@ export default { }).then(result=>{ console.log(result) if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'发生地区',value:'regionName'},{label:'数量(起)',value:'num'}] + this.tableCols = [{label:'发生地区',value:'city'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}] + chartsOptions.series[0].name = thisTime; + chartsOptions.series[1].name = lastTime; if(result.data.length===0){ chartsOptions.series[0].data = [] + chartsOptions.series[1].data = [] this.myChart.setOption(chartsOptions); this.myChart.resize(); this.tableData = [] @@ -312,8 +332,10 @@ export default { this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions.series[0].data = result.data.map(x=>x.num) - chartsOptions.xAxis.data = result.data.map(x=>x.regionName); + chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime]) + chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime]) + + chartsOptions.xAxis.data = result.data.map(x=>x.city); this.myChart.setOption(chartsOptions); this.myChart.resize(); }, 200); @@ -326,11 +348,22 @@ export default { }).then(result=>{ console.log(result) if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'发生地区',value:'stationName'},{label:'封闭',value:'close'},{label:'限行',value:'restriction'},{label:'全部',value:'allNum'}] + this.tableCols = [ + {label:'发生地区',value:'stationName'}, + {label:thisTime+'封闭',value:thisTime+'close'}, + {label:thisTime+'限行',value:thisTime+'restriction'}, + {label:lastTime+'封闭',value:lastTime+'close'}, + {label:lastTime+'限行',value:lastTime+'restriction'}, + ] + chartsOptions6.series[0].name = thisTime+'封闭' + chartsOptions6.series[1].name = thisTime+'限行' + chartsOptions6.series[2].name = lastTime+'封闭' + chartsOptions6.series[3].name = lastTime+'限行' if(result.data.length===0){ - chartsOptions6.series[0].data = [] chartsOptions6.series[1].data = [] + chartsOptions6.series[2].data = [] + chartsOptions6.series[3].data = [] this.myChart.setOption(chartsOptions6); this.myChart.resize(); this.tableData = [] @@ -340,8 +373,10 @@ export default { this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions6.series[0].data = result.data.map(x=>x.close) - chartsOptions6.series[1].data = result.data.map(x=>x.restriction) + chartsOptions6.series[0].data = result.data.map(x=>x[thisTime+'close']) + chartsOptions6.series[1].data = result.data.map(x=>x[thisTime+'restriction']) + chartsOptions6.series[2].data = result.data.map(x=>x[lastTime+'close']) + chartsOptions6.series[3].data = result.data.map(x=>x[lastTime+'restriction']) chartsOptions6.xAxis.data = result.data.map(x=>x.stationName); this.myChart.setOption(chartsOptions6); this.myChart.resize(); @@ -354,6 +389,7 @@ export default { method: 'post' }).then(result=>{ console.log(result) + this.curid = id; if (result.code != 200) return this.$message.error(result?.msg); if(result.data.dataList.length===0){ this.tableData = [] @@ -378,24 +414,47 @@ export default { if (result.code != 200) return this.$message.error(result?.msg); this.tableCols = [{label:'方向',value:'dir'},{label:'门架',value:'name'},{label:'车流量',value:'num'}] + + chartsOptions8.legend.data[0].name = thisTime+'车流量' + chartsOptions8.legend.data[1].name = lastTime+'车流量' + + chartsOptions8.series[0].name = thisTime+'车流量' + chartsOptions8.series[1].name = lastTime+'车流量' + + chartsOptions8.series[2].name = thisTime+'车流量' + chartsOptions8.series[3].name = lastTime+'车流量' let _tableData = [] - for(let i of result.data.jinanDirection){ + for(let i of result.data[thisTime+'heze']){ _tableData.push({ - dir:'济南方向',name:i.intervalName, num:(i.trafficVolume||0) + dir:thisTime+'菏泽方向',name:i.facilityName, num:(i.trafficVolume||0) }) - } for(let i of result.data.hezeDirection){ + } + for(let i of result.data[thisTime+'jinan']){ + _tableData.push({ + dir:thisTime+'济南方向',name:i.facilityName, num:(i.trafficVolume||0) + }) + } + for(let i of result.data[lastTime+'heze']){ + _tableData.push({ + dir:lastTime+'菏泽方向',name:i.facilityName, num:(i.trafficVolume||0) + }) + } + for(let i of result.data[lastTime+'jinan']){ _tableData.push({ - dir:'菏泽方向',name:i.intervalName, num:(i.trafficVolume||0) + dir:lastTime+'济南方向',name:i.facilityName, num:(i.trafficVolume||0) }) } this.tableData = _tableData; this.curid = id; setTimeout(() => { - const xAxis = result.data.jinanDirection.map(x=>x.intervalName); - + const xAxis = result.data[thisTime+'heze'].map(x=>x.facilityName); + chartsOptions8.xAxis[0].data = xAxis + chartsOptions8.xAxis[1].data = xAxis // 1今年菏泽 2今年济南 3去年菏泽 4去年济南 - chartsOptions8.series[0].data = result.data.jinanDirection.map(x=>x.trafficVolume) - chartsOptions8.series[1].data =result.data.hezeDirection.map(x=>x.trafficVolume) + chartsOptions8.series[0].data = result.data[thisTime+'jinan'].map(x=>x.trafficVolume) + chartsOptions8.series[1].data =result.data[lastTime+'jinan'].map(x=>x.trafficVolume) + chartsOptions8.series[2].data = result.data[thisTime+'heze'].map(x=>x.trafficVolume) + chartsOptions8.series[3].data =result.data[lastTime+'heze'].map(x=>x.trafficVolume) this.myChart.setOption(chartsOptions8); this.myChart.resize(); }, 200); @@ -409,24 +468,48 @@ export default { if (result.code != 200) return this.$message.error(result?.msg); this.tableCols = [{label:'方向',value:'dir'},{label:'收费站',value:'name'},{label:'车流量',value:'num'}] + + chartsOptions8.legend.data[0].name = thisTime+'车流量' + chartsOptions8.legend.data[1].name = lastTime+'车流量' + + chartsOptions8.series[0].name = thisTime+'车流量' + chartsOptions8.series[1].name = lastTime+'车流量' + + chartsOptions8.series[2].name = thisTime+'车流量' + chartsOptions8.series[3].name = lastTime+'车流量' + + let _tableData = [] - for(let i of result.data.exit){ + for(let i of result.data[thisTime+'exit']){ _tableData.push({ - dir:'出口',name:i.facilityName, num:(i.trafficVolume||0) + dir:thisTime+'出口',name:i.facilityName, num:(i.trafficVolume||0) }) - } for(let i of result.data.entrance){ + } for(let i of result.data[thisTime+'entrance']){ _tableData.push({ - dir:'入口',name:i.facilityName, num:(i.trafficVolume||0) + dir:thisTime+'入口',name:i.facilityName, num:(i.trafficVolume||0) + }) + } + for(let i of result.data[lastTime+'exit']){ + _tableData.push({ + dir:lastTime+'出口',name:i.facilityName, num:(i.trafficVolume||0) + }) + } for(let i of result.data[lastTime+'entrance']){ + _tableData.push({ + dir:lastTime+'入口',name:i.facilityName, num:(i.trafficVolume||0) }) } this.tableData = _tableData; this.curid = id; setTimeout(() => { - const xAxis = result.data.exit.map(x=>x.facilityName); + const xAxis = result.data[thisTime+'exit'].map(x=>x.facilityName); chartsOptions8.xAxis[0].data = xAxis chartsOptions8.xAxis[1].data = xAxis - chartsOptions8.series[0].data = result.data.exit.map(x=>x.trafficVolume) - chartsOptions8.series[1].data =result.data.entrance.map(x=>x.trafficVolume) + + chartsOptions8.series[0].data = result.data[thisTime+'exit'].map(x=>x.trafficVolume) + chartsOptions8.series[1].data =result.data[lastTime+'exit'].map(x=>x.trafficVolume) + chartsOptions8.series[2].data = result.data[thisTime+'entrance'].map(x=>x.trafficVolume) + chartsOptions8.series[3].data =result.data[lastTime+'entrance'].map(x=>x.trafficVolume) + this.myChart.setOption(chartsOptions8); this.myChart.resize(); }, 200); @@ -438,20 +521,25 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'事故类型',value:'subclassName'},{label:'数量(起)',value:'num'}] + this.tableCols = [{label:'事故类型',value:'eventSubclass'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}] + chartsOptions.series[0].name = thisTime; + chartsOptions.series[1].name = lastTime; if(result.data.length===0){ + this.tableData = [] chartsOptions.series[0].data = [] + chartsOptions.series[1].data = [] this.myChart.setOption(chartsOptions); this.myChart.resize(); - this.tableData = [] this.$message.warning('暂无数据') return; } this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions.series[0].data = result.data.map(x=>x.num) - chartsOptions.xAxis.data = result.data.map(x=>x.subclassName); + chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime]) + chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime]) + + chartsOptions.xAxis.data = this.tableData.map(x=>x.eventSubclass); this.myChart.setOption(chartsOptions); this.myChart.resize(); }, 200); @@ -463,26 +551,25 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'拥堵类型',value:'name'},{label:'数量(起)',value:'num'}] - let _tableData = [] - if(_.keys(result.data).length === 0){ + this.tableCols = [{label:'拥堵类型',value:'eventSubclass'},{label:thisTime+' 数量(起)',value:thisTime},{label:lastTime+' 数量(起)',value:lastTime}] + chartsOptions.series[0].name = thisTime; + chartsOptions.series[1].name = lastTime; + if(result.data.length===0){ + this.tableData = [] chartsOptions.series[0].data = [] + chartsOptions.series[1].data = [] this.myChart.setOption(chartsOptions); this.myChart.resize(); - this.tableData = [] this.$message.warning('暂无数据') return; } - for(let i in result.data){ - _tableData.push({ - name:i, num:result.data[i] - }) - } - this.tableData = _tableData; + this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions.series[0].data = _tableData.map(x=>x.num) - chartsOptions.xAxis.data = _tableData.map(x=>x.name); + chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime]) + chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime]) + + chartsOptions.xAxis.data = this.tableData.map(x=>x.eventSubclass); this.myChart.setOption(chartsOptions); this.myChart.resize(); }, 200); @@ -496,28 +583,25 @@ export default { data: query }).then(result=>{ if (result.code != 200) return this.$message.error(result?.msg); - this.tableCols = [{label:'路段桩号',value:'name'},{label:'时长(分钟)',value:'num'}] - let _tableData = [] - if(_.keys(result.data).length === 0){ - + this.tableCols = [{label:'路段桩号',value:'stakeMark'},{label:thisTime+' 时长(分钟)',value:thisTime},{label:lastTime+' 时长(分钟)',value:lastTime}]; + chartsOptions.series[0].name = thisTime; + chartsOptions.series[1].name = lastTime; + if(result.data.length===0){ + this.tableData = [] chartsOptions.series[0].data = [] + chartsOptions.series[1].data = [] this.myChart.setOption(chartsOptions); this.myChart.resize(); - this.tableData = [] this.$message.warning('暂无数据') return; } - - for(let i in result.data){ - _tableData.push({ - name:i, num:result.data[i] - }) - } - this.tableData = _tableData; + this.tableData = result.data; this.curid = id; setTimeout(() => { - chartsOptions.series[0].data = _tableData.map(x=>x.num) - chartsOptions.xAxis.data = _tableData.map(x=>x.name); + chartsOptions.series[0].data = this.tableData.map(x=>x[thisTime]) + chartsOptions.series[1].data = this.tableData.map(x=>x[lastTime]) + + chartsOptions.xAxis.data = this.tableData.map(x=>x.stakeMark); this.myChart.setOption(chartsOptions); this.myChart.resize(); }, 200); @@ -623,10 +707,10 @@ export default { } } -.tag1 { +.tag1A { position: absolute; margin-top: 100px; - margin-left: 60px; + margin-left: 90px; font-size: 12px; span{ color: #8be8fe; @@ -635,7 +719,7 @@ export default { } } - .tag2 { + .tag2A { position: absolute; font-size: 12px; margin-top: 300px; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue index bac2e84e..926beb07 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue @@ -10,7 +10,7 @@ -