修改预警统计分析
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="warning-analysis">
|
||||
<div class="chart-section">
|
||||
<h2 class="section-title">车辆预警分析</h2>
|
||||
<h2 class="section-title">人员预警分析</h2>
|
||||
<div ref="vehicleChartRef" class="chart-container"></div>
|
||||
</div>
|
||||
<div class="chart-section">
|
||||
<h2 class="section-title">人员预警分析</h2>
|
||||
<h2 class="section-title">车辆预警分析</h2>
|
||||
<div ref="personChartRef" class="chart-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -26,8 +26,8 @@ const createChartOption = (data, colors, total) => {
|
||||
title: {
|
||||
text: `${total}`,
|
||||
subtext: "总数",
|
||||
left: 'center',
|
||||
top: 'center', //top待调整
|
||||
left: "center",
|
||||
top: "center", //top待调整
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
fontSize: 24,
|
||||
@ -44,7 +44,7 @@ const createChartOption = (data, colors, total) => {
|
||||
legend: {
|
||||
orient: "horizontal",
|
||||
top: 0,
|
||||
bottom: '50px',
|
||||
bottom: "50px",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
rich: {
|
||||
@ -135,11 +135,12 @@ const initCharts = async () => {
|
||||
// 车辆预警数据
|
||||
const res = await jczgetYjbqtj({ yjLx: 1 });
|
||||
const res2 = await jczgetYjbqtj({ yjLx: 2 });
|
||||
console.log(res, 'res');
|
||||
console.log(res2, 'res2');
|
||||
clTotal = res2.map((el) => el.sl).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
|
||||
ryTotal = res.map((el) => el.sl).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
|
||||
console.log(clTotal, 'clTotal');
|
||||
clTotal = res2
|
||||
.map((el) => el.sl)
|
||||
.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
|
||||
ryTotal = res
|
||||
.map((el) => el.sl)
|
||||
.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
|
||||
|
||||
const vehicleData = res.map((item) => {
|
||||
const color = randomHexColor();
|
||||
|
||||
Reference in New Issue
Block a user