diff --git a/ruoyi-ui/src/api/event/perceiveEvent.js b/ruoyi-ui/src/api/event/perceiveEvent.js index ed8a01aa..7a147f24 100644 --- a/ruoyi-ui/src/api/event/perceiveEvent.js +++ b/ruoyi-ui/src/api/event/perceiveEvent.js @@ -78,13 +78,13 @@ export function geTwarningTotal(query) { //感知事件源分析 export function getWarningSourceGroup(query) { return request({ - // url: '/perceivedEvents/warning/warningSourceGroup', - // method: 'post', - url: '/business/warning/list', - method: 'get', - // params: { - // ...query, - // } + url: '/perceivedEvents/warning/warningSourceGroup', + method: 'post', + // url: '/business/warning/list', + // method: 'get', + params: { + ...query, + } }) } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue index 8f2328dd..2181248f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue @@ -74,6 +74,15 @@ function getMockData() { })); } +const warningSourceMapping = { + 1: '视频AI', + 2: '雷达识别', + 3: '锥桶', + 4: '护栏碰撞', + 5: '扫码报警', + 6: '非机预警', +} + export default { name: "RoadNetworkMonitoring2", components: { @@ -145,10 +154,15 @@ export default { request({ url: `/perceivedEvents/warning/perceivedEventsList`, method: "post", - data: this.searchData, + params: this.searchData, + data: {} }).then((result) => { if (result.code != 200) return Message.error(result?.msg); + result.rows.forEach(it => { + it.stringEventSource = warningSourceMapping[it.warningSource]; + }) this.data = result.rows; + this.total = result.total; }); } else { @@ -234,15 +248,43 @@ export default { }, firstBtnClick(id) { console.log("id", id); - request({ - url: `/dc/system/event/${id}`, - method: "get", - }).then((result) => { - if (result.code != 200) return Message.error(result?.msg); - this.detailDialogFormData = result.data; - - this.eventDetailDialogVisible = true; - }); + if (this.activeName == '-1') { + request({ + url: `/perceivedEvents/warning/getWarningById`, + method: "post", + data: { id } + }).then((result) => { + if (result.code != 200) return Message.error(result?.msg); + data = result.data; + const directionMapping = { + 1: '上行', + 2: '中', + 3: '下行' + } + data.stringEventSource = warningSourceMapping[data.warningSource]; + data.stringDirection = directionMapping[data.direction] || data.direction; + + + this.detailDialogFormData = data; + console.log('data', this.detailDialogFormData) + + this.eventDetailDialogVisible = true; + }); + } else { + request({ + url: `/dc/system/event/${id}`, + method: "get", + }).then((result) => { + if (result.code != 200) return Message.error(result?.msg); + let data = result.data; + data.stringDirection = directionMapping[data.direction] || data.direction; + + this.detailDialogFormData = data; + + this.eventDetailDialogVisible = true; + }); + } + }, handleClose() { this.eventDetailDialogVisible = false; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventSource/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventSource/index.vue index 4a178653..cbdf451a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventSource/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventSource/index.vue @@ -56,8 +56,8 @@ export default { getWarningSourceGroup().then((res) => { if (res.code == 200) { - let data = res.rows; - let total = 0; + let data = res.data.warningSourceList; + let total = res.data.total; if (data.length > 0) { let chartData = [ @@ -90,24 +90,24 @@ export default { ] data.forEach(it => { if (it.warningSource == 1) { - chartData[0].average++; + chartData[0].average += it.number; } if (it.warningSource == 2) { - chartData[1].average++; + chartData[1].average += it.number; } if (it.warningSource == 3) { - chartData[2].average++; + chartData[2].average += it.number; } if (it.warningSource == 4) { - chartData[3].average++; + chartData[3].average += it.number; } if (it.warningSource == 5) { - chartData[4].average++; + chartData[4].average += it.number; } if (it.warningSource == 6) { - chartData[5].average ++; + chartData[5].average += it.number; } - total ++; + // total ++; // drawRoundRect(context, 231, 37 + (index * 27), 138, 20, 12, gr); }) // console.log('data',chartData)