Browse Source

感知事件统计

wangqin
zhoule 9 months ago
parent
commit
1e34ddcbe6
  1. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js
  2. 21
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue

6
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js

@ -44,8 +44,12 @@ var options = {
}
},
formatter: (params) => {
let count = 0;
echartsData.forEach((it) => {
count += it.value;
})
let obj = echartsData.filter(it => { return it.name == params })
return `{ast|${obj[0].name}} {bst|${Math.round(obj[0].value)}%}`
return `{ast|${obj[0].name}} {bst|${Math.round(obj[0].value / count * 100)}%}`
},
data: echartsData?.map(x => x),
},

21
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue

@ -55,8 +55,14 @@ export default {
getWarningStateDay().then(res => {
if (res.code == 200) {
let data = res.data;
if (data.lemgth > 0) {
if (data.length > 0) {
window.echartsData = [];
// let count = 0;
// data.forEach((it) => {
// count += it.number;
// })
for (let i = 0; i < data.length; i++) {
let it = data[i];
if (it.warningState == 1) {
@ -89,11 +95,6 @@ export default {
}
let count = 0;
echartsData.forEach((it) => {
count += it.value;
})
chartsStatistics.legend.data = window.echartsData?.map(x => x);
chartsStatistics.series[0].data = echartsData.map((item, index) => {
@ -140,10 +141,10 @@ export default {
context.lineWidth = 1; // 线
//
drawRoundRect(context, 272, 50, 120, 24, 12, gr)
drawRoundRect(context, 272, 78, 120, 24, 12, gr)
drawRoundRect(context, 272, 106, 120, 24, 12, gr)
drawRoundRect(context, 270, 36, 120, 24, 12, gr)
drawRoundRect(context, 270, 63, 120, 24, 12, gr)
drawRoundRect(context, 270, 90, 120, 24, 12, gr)
drawRoundRect(context, 270, 117, 120, 24, 12, gr)
});
});
},

Loading…
Cancel
Save