Browse Source

更改

wangqin
zhangzhang 8 months ago
parent
commit
76d24ad970
  1. 98
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/index.vue

98
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/index.vue

@ -28,33 +28,33 @@ import * as echarts from "echarts";
import chartsStatistics from "./assets/charts"; import chartsStatistics from "./assets/charts";
import { getWarningTypeDay } from "../../../../../../../api/event/perceiveEvent"; import { getWarningTypeDay } from "../../../../../../../api/event/perceiveEvent";
const drawRoundRect = (ctx, x, y, width, height, radius, gr) => { // const drawRoundRect = (ctx, x, y, width, height, radius, gr) => {
// ctx, x, y, , , // // ctx, x, y, , ,
ctx.beginPath(); // ctx.beginPath();
ctx.fillStyle = gr; // ctx.fillStyle = gr;
ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2); // ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2);
ctx.lineTo(width - radius + x, y); // ctx.lineTo(width - radius + x, y);
ctx.arc( // ctx.arc(
width - radius + x, // width - radius + x,
radius + y, // radius + y,
radius, // radius,
(Math.PI * 3) / 2, // (Math.PI * 3) / 2,
Math.PI * 2 // Math.PI * 2
); // );
ctx.lineTo(width + x, height + y - radius); // ctx.lineTo(width + x, height + y - radius);
ctx.arc( // ctx.arc(
width - radius + x, // width - radius + x,
height - radius + y, // height - radius + y,
radius, // radius,
0, // 0,
(Math.PI * 1) / 2 // (Math.PI * 1) / 2
); // );
ctx.lineTo(radius + x, height + y); // ctx.lineTo(radius + x, height + y);
ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI); // ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI);
ctx.closePath(); // ctx.closePath();
//ctx.stroke(); // //ctx.stroke();
ctx.fill(); // ctx.fill();
}; // };
export default { export default {
name: "TypeAnalysis", name: "TypeAnalysis",
@ -187,29 +187,29 @@ export default {
myChart.setOption(chartsStatistics); myChart.setOption(chartsStatistics);
}); });
const domMap = document.getElementById("typeAnalysis"); // const domMap = document.getElementById("typeAnalysis");
let parentDiv = domMap.firstChild; // let parentDiv = domMap.firstChild;
// canvas // // canvas
let canvas = document.createElement("canvas"); // let canvas = document.createElement("canvas");
canvas.width = parentDiv.offsetWidth; // canvas.width = parentDiv.offsetWidth;
canvas.height = parentDiv.offsetHeight; // canvas.height = parentDiv.offsetHeight;
parentDiv.appendChild(canvas); // parentDiv.appendChild(canvas);
const context = canvas.getContext("2d"); // const context = canvas.getContext("2d");
// // //
var gr = context.createLinearGradient(230, 0, 360, 0); // var gr = context.createLinearGradient(230, 0, 360, 0);
// // //
gr.addColorStop(1, "rgba(92,197,255,0)"); // gr.addColorStop(1, "rgba(92,197,255,0)");
gr.addColorStop(0, "rgba(92,197,255,0.5)"); // gr.addColorStop(0, "rgba(92,197,255,0.5)");
context.lineWidth = 1; // 线 // context.lineWidth = 1; // 线
// // //
drawRoundRect(context, 228, 8, 280, 24, 12, gr); // drawRoundRect(context, 228, 8, 280, 24, 12, gr);
drawRoundRect(context, 228, 36, 280, 24, 12, gr); // drawRoundRect(context, 228, 36, 280, 24, 12, gr);
drawRoundRect(context, 228, 64, 280, 24, 12, gr); // drawRoundRect(context, 228, 64, 280, 24, 12, gr);
drawRoundRect(context, 228, 92, 280, 24, 12, gr); // drawRoundRect(context, 228, 92, 280, 24, 12, gr);
drawRoundRect(context, 228, 120, 280, 24, 12, gr); // drawRoundRect(context, 228, 120, 280, 24, 12, gr);
}); });
}); });
}, },
@ -289,7 +289,7 @@ export default {
.legend-name { .legend-name {
width: 60px; width: 60px;
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 12px;
} }
.legend-num, .legend-num,
.legend-percert { .legend-percert {
@ -297,7 +297,7 @@ export default {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 14px; font-size: 12px;
color: #37e7ff; color: #37e7ff;
font-weight: bold; font-weight: bold;
} }

Loading…
Cancel
Save