Commit a7fbb709 authored by xinzhedeai's avatar xinzhedeai

add:警戒线 动态test 数量5

parent 53d6a0b3
......@@ -186,8 +186,10 @@ export default {
const canvasW = 1000
const po_pad_right = 180 // 第一个台阶距离画布的距离
const poH = 150
const line_color = ['red', 'yellow', 'green', 'blue', 'white']
this.poConfigs = []
this.guanConfigs = []
this.lineConfigs = []
for (let index = 0; index < 4; index++) {
this.poConfigs.push({
x: 0,
......@@ -201,11 +203,28 @@ export default {
})
}
// lineConfigs: [
// { points: [], color: 'red', lineWidth: 2 }, // 红色连接线配置
// { points: [], color: 'yellow', lineWidth: 2 } // 黄色连接线配置
// ]
// 警戒线逻辑- 初始化4条线
for (let index1 = 0; index1 < 5; index1++) {
this.lineConfigs.push({ // 设置
points: [],
color: line_color[index1],
lineWidth: 2,
cha: 20*index1 // 每条线之间的差值
})
}
// 警戒线种类下,根据管孔个数,设定对应的坐标点
this.lineConfigs.forEach((line, index)=>{ // 几个管孔几个坐标点
this.guanConfigs.forEach((guan, subindex)=>{
line.points.push({
x: guan.x+1,
y: guan.y + 30 + line.cha,
})
})
})
......@@ -366,23 +385,23 @@ export default {
// 4. 绘制连接线(遍历配置数组)
this.lineConfigs.forEach((config, index) => {
const firstGuan = this.guanConfigs[0];
const secondGuan = this.guanConfigs[1];
// 红色连接线坐标(原逻辑)
if (index === 0) {
config.points = [
{ x: firstGuan.x, y: firstGuan.y + 100 },
{ x: secondGuan.x, y: secondGuan.y + 50 },
{ x: secondGuan.x - 100, y: secondGuan.y - 10 } // 扩展第三点
];
}
// 黄色连接线坐标(原逻辑)
if (index === 1) {
config.points = [
{ x: firstGuan.x, y: firstGuan.y + 80 }, // 调整偏移量
{ x: secondGuan.x, y: secondGuan.y + 30 }
];
}
// const firstGuan = this.guanConfigs[0];
// const secondGuan = this.guanConfigs[1];
// // 红色连接线坐标(原逻辑)
// if (index === 0) {
// config.points = [
// { x: firstGuan.x, y: firstGuan.y + 100 },
// { x: secondGuan.x, y: secondGuan.y + 50 },
// { x: secondGuan.x - 100, y: secondGuan.y - 10 } // 扩展第三点
// ];
// }
// // 黄色连接线坐标(原逻辑)
// if (index === 1) {
// config.points = [
// { x: firstGuan.x, y: firstGuan.y + 80 }, // 调整偏移量
// { x: secondGuan.x, y: secondGuan.y + 30 }
// ];
// }
this.drawLine(config);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment