From f177716fcdcdf73a374819497b51ff6dd1979a96 Mon Sep 17 00:00:00 2001 From: yyl <279235553@qq.com> Date: Thu, 25 Jan 2024 08:35:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=9C=80=E6=96=B0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/event/perceiveEvent.js | 21 ++++- .../components/eventQuery/index.vue | 87 +++++++++++++++++-- .../components/eventQuery/progressBar.vue | 12 +-- .../components/monthStatistics/index.vue | 31 ++++++- .../components/railway/assets/charts.js | 2 +- 5 files changed, 134 insertions(+), 19 deletions(-) diff --git a/ruoyi-ui/src/api/event/perceiveEvent.js b/ruoyi-ui/src/api/event/perceiveEvent.js index 760a05fc..159329f1 100644 --- a/ruoyi-ui/src/api/event/perceiveEvent.js +++ b/ruoyi-ui/src/api/event/perceiveEvent.js @@ -129,7 +129,7 @@ export function geTwarningTotal(query) { return request({ url: '/perceivedEvents/warning/warningTrend', method: 'post', - params: { + data: { ...query, } }) @@ -141,7 +141,7 @@ export function geTwarningTotal(query) { return request({ url: '/perceivedEvents/warning/warningSectionType', method: 'post', - params: { + data: { ...query, } }) @@ -153,8 +153,21 @@ export function geTwarningTotal(query) { return request({ url: '/perceivedEvents/warning/sectionMarkNumber', method: 'post', - params: { + data: { ...query, } }) - } \ No newline at end of file + } + +/// + //查询辖区路段列表 + export function getRoadSectionList(query) { + //system/status/tablist + return request({ + url: '/business/roadSection/list', + method: 'get', + params: { + ...query, + } + }) + } \ No newline at end of file diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue index c5c6d5c4..9388eab4 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue @@ -2,6 +2,7 @@
+
- + - 查询 + 查询 重置
-
@@ -58,6 +58,7 @@ import chart2 from "./assets/charts2"; import chart3 from "./assets/charts3"; import ElQuarterPicker from './ElQuarterPicker' + import { getWarningTrend,getWarningSectionType,getSectionMarkNumber,getRoadSectionList } from '../../../../../../../api/event/perceiveEvent'; const drawRoundRect = ( ctx, x, y, width, height, radius ,gr) => { // ctx, 矩形距离x坐标位置, 矩形距离y坐标的位置, 矩形的宽, 矩形的长,圆角角度 @@ -93,7 +94,7 @@ label: '月' }, { - value: 'date', + value: 'day', label: '日' }, { @@ -101,14 +102,14 @@ label: '季' },], areaOptions: [{ - value: '济南', + value: '0531', label: '济南' }, { value: '菏泽', label: '菏泽' }], dateTime:"", - area: '济南', + area: '0531', dataList:[ { title:"殷家林枢纽" @@ -160,6 +161,7 @@ } ], quarter:"", + selectId:1, year:"year", list:[ {name:'大学城-长清', direction:'济南方向', state:"正常",speed:'108.14km/h', follow:'161'}, @@ -176,11 +178,77 @@ }, methods: { - + selectProgress(item){ + this.selectId = item.id; + }, + searchQuery(){ + let dateTime = this.dateTime; + if ( this.year == "year") { + dateTime = new Date(dateTime); + dateTime = dateTime.getFullYear(); + console.log(dateTime); + } + if ( this.year == "month") { + dateTime = new Date(dateTime); + let m = dateTime.getMonth()+1; + m = m < 10?"0"+m:m; + dateTime = dateTime.getFullYear() + "-" + m +"-00 00:00:00"; + console.log(dateTime); + } + //感知事件趋势 + getWarningTrend({ + "type": this.year, + "sectionId": this.selectId, + "createTime": dateTime, + }).then(res=>{ + console.log(res); + chart1.series[0].data = []; + this.myChart1.setOption(chart1); + }); + //类型占比 + getWarningSectionType({ + "type": this.year, + "sectionId": this.selectId, + "createTime": dateTime, + }).then(res=>{ + console.log(res); + chart2.series[0].data = []; + this.myChart2.setOption(chart2); + }) + //路段范围内桩号分布 + getSectionMarkNumber({ + "type": this.year, + "sectionId": this.selectId, + "createTime": dateTime, + }).then(res=>{ + console.log(res); + chart3.series[0].data = []; + chart3.series[1].data = []; + this.myChart3.setOption(chart3); + }) + }, }, mounted() { setTimeout(() => { this.$nextTick(() => { + + getRoadSectionList().then(res=>{ + console.log(res); + if ( res.code == 200 ) { + let rows = res.rows; + this.dataList = []; + rows.forEach(it=>{ + this.dataList.push({ + title:it.sectionName.split("-")[0], + id:it.id, + + }); + }) + } + + + }) + var myChart1 = echarts.init(document.getElementById('chart1')); myChart1.setOption(chart1); var myChart2 = echarts.init(document.getElementById('chart2')); @@ -188,6 +256,9 @@ var myChart3 = echarts.init(document.getElementById('chart3')); myChart3.setOption(chart3); + this.myChart1 = myChart1; + this.myChart2 = myChart2; + this.myChart3 = myChart3; const domMap = document.getElementById("chart2"); let parentDiv = domMap.firstChild; @@ -288,7 +359,7 @@ height: 40px; width:100%; font-size: 14px; - margin-bottom: 10px; + margin-top: 10px; div{ white-space: nowrap; margin-right: 4px; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/progressBar.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/progressBar.vue index 7951fbe0..6a7c89d1 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/progressBar.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/progressBar.vue @@ -2,8 +2,8 @@
- - + +
{{ item.title }}
@@ -38,9 +38,11 @@ import { number } from 'echarts'; }, methods: { - selectItem(index,num){ + selectItem(index,num,item){ this.selectIndex = index; - this.selectLine = num + this.selectLine = num; + if ( item ) + this.$emit("selectItem",item); } }, mounted() { @@ -147,7 +149,7 @@ import { number } from 'echarts'; >.item { position: relative; - width: 180px; + width: 113px; height:35px; display: inline-flex; flex-direction: column; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/monthStatistics/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/monthStatistics/index.vue index 797801a7..11f5fb6b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/monthStatistics/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/monthStatistics/index.vue @@ -12,6 +12,8 @@ import WgtTitle from '../../../widgets/title' import * as echarts from "echarts"; import chartsStatistics from "./assets/charts"; + import { getDailyCumulativeMonth } from '../../../../../../../api/event/perceiveEvent'; + export default { name: 'MonthStatistics', components: { @@ -33,7 +35,34 @@ setTimeout(() => { this.$nextTick(() => { var myChart = echarts.init(document.getElementById('monthStatistics')); - myChart.setOption(chartsStatistics); + getDailyCumulativeMonth().then((res)=>{ + console.log(res); + if ( res.code == 200 ) { + let data = res.data; + let timeData = []; + let datasN = []; + for (var i = 0; i < 24;i++){ + let k = 0; + for (var j = 0;j < data.length;j++){ + let it = data[j]; + if ( it.time == i ) { + timeData.push( i +"点至"+ (i +1)+"点"); + datasN.push(it.number); + k++; + } + } + if ( k == 0 ) { + timeData.push( i +"点至"+ (i +1)+"点"); + datasN.push(0); + } + } + chartsStatistics.xAxis.data = timeData; + chartsStatistics.series[0].data = datasN; + + myChart.setOption(chartsStatistics); + } + + }); }); }); }, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/railway/assets/charts.js b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/railway/assets/charts.js index 3620b89b..d3b60046 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/railway/assets/charts.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/railway/assets/charts.js @@ -49,7 +49,7 @@ var options = { margin:-5, formatter: function (value) { let index = xdata.value.indexOf(value); - return `{a|Top${index+1}} {b|${value}}` + return `{a|Top${index + 2}} {b|${value}}` }, rich: { a: {