1
1
<template >
2
2
<g
3
3
@contextmenu.prevent =" onContextMenu"
4
- @click =" activeLineChange"
4
+ @click.stop =" activeLineChange"
5
5
:class =" [{ showdesc: line.showdesc }, { active: isInActiveLines() }]"
6
6
>
7
7
<path
@@ -305,26 +305,18 @@ export default {
305
305
y: 0 ,
306
306
};
307
307
secondArcEnd .x = startPoint .x + LINE_H ;
308
- secondArcEnd .y =
309
- stateTop -
310
- LINE_V +
311
- lineCfg .threadTitleHeight +
312
- lineCfg .threadToolBoxHeight ;
308
+ secondArcEnd .y = stateTop - LINE_V + lineCfg .threadTitleHeight ;
313
309
tempLinePath += this .drawArc (LINE_RADIUS , 0 , 0 , secondArcEnd);
314
310
return tempLinePath;
315
311
},
316
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
312
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
317
313
drawLine5OutputVUp (startPoint , endPoint , startStateTop , endStateTop ) {
318
314
let tempLinePath = " " ;
319
315
let secondArcStart;
320
316
if (startStateTop < endStateTop) {
321
317
// 比较起始状态和结束状态的上边缘的高低,根据上边缘高的状态决定垂直绘制连线的坐标
322
318
secondArcStart =
323
- startStateTop -
324
- LINE_V +
325
- LINE_RADIUS +
326
- lineCfg .threadTitleHeight +
327
- lineCfg .threadToolBoxHeight ;
319
+ startStateTop - LINE_V + LINE_RADIUS + lineCfg .threadTitleHeight ;
328
320
tempLinePath += this .drawVerticalLine (secondArcStart);
329
321
tempLinePath += this .drawLine5SecondArcUp (
330
322
startPoint,
@@ -333,11 +325,7 @@ export default {
333
325
);
334
326
} else {
335
327
secondArcStart =
336
- endStateTop -
337
- LINE_V +
338
- LINE_RADIUS +
339
- lineCfg .threadTitleHeight +
340
- lineCfg .threadToolBoxHeight ;
328
+ endStateTop - LINE_V + LINE_RADIUS + lineCfg .threadTitleHeight ;
341
329
tempLinePath += this .drawVerticalLine (secondArcStart);
342
330
tempLinePath += this .drawLine5SecondArcUp (
343
331
startPoint,
@@ -354,15 +342,11 @@ export default {
354
342
y: 0 ,
355
343
};
356
344
secondArcEnd .x = startPoint .x + LINE_H ;
357
- secondArcEnd .y =
358
- stateBottom +
359
- LINE_V +
360
- lineCfg .threadTitleHeight +
361
- lineCfg .threadToolBoxHeight ;
345
+ secondArcEnd .y = stateBottom + LINE_V + lineCfg .threadTitleHeight ;
362
346
tempLinePath += this .drawArc (LINE_RADIUS , 0 , 1 , secondArcEnd);
363
347
return tempLinePath;
364
348
},
365
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
349
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
366
350
drawLine5OutputVDown (
367
351
startPoint,
368
352
endPoint,
@@ -378,11 +362,7 @@ export default {
378
362
if (startStateBottom < endStateBottom) {
379
363
// 比较起始状态和结束状态的下边缘的高低,根据下边缘低的状态决定垂直绘制连线的坐标
380
364
secondArcStart =
381
- endStateBottom +
382
- LINE_V -
383
- LINE_RADIUS +
384
- lineCfg .threadTitleHeight +
385
- lineCfg .threadToolBoxHeight ;
365
+ endStateBottom + LINE_V - LINE_RADIUS + lineCfg .threadTitleHeight ;
386
366
tempLinePath += this .drawVerticalLine (secondArcStart);
387
367
tempLinePath += this .drawLine5SecondArcDown (
388
368
startPoint,
@@ -391,11 +371,7 @@ export default {
391
371
);
392
372
} else {
393
373
secondArcStart =
394
- startStateBottom +
395
- LINE_V -
396
- LINE_RADIUS +
397
- lineCfg .threadTitleHeight +
398
- lineCfg .threadToolBoxHeight ;
374
+ startStateBottom + LINE_V - LINE_RADIUS + lineCfg .threadTitleHeight ;
399
375
tempLinePath += this .drawVerticalLine (secondArcStart);
400
376
tempLinePath += this .drawLine5SecondArcDown (
401
377
startPoint,
@@ -476,15 +452,11 @@ export default {
476
452
};
477
453
thirdArcEnd .x = endPoint .x - LINE_H ;
478
454
thirdArcEnd .y =
479
- stateTop -
480
- LINE_V +
481
- LINE_RADIUS +
482
- lineCfg .threadTitleHeight +
483
- lineCfg .threadToolBoxHeight ;
455
+ stateTop - LINE_V + LINE_RADIUS + lineCfg .threadTitleHeight ;
484
456
tempLinePath += this .drawArc (LINE_RADIUS , 1 , 0 , thirdArcEnd);
485
457
return tempLinePath;
486
458
},
487
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
459
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
488
460
drawLine5HUp (startPoint , endPoint , startStateTop , endStateTop ) {
489
461
let tempLinePath = " " ;
490
462
let thirdArcStart = {
@@ -494,11 +466,7 @@ export default {
494
466
// 比较起始状态和结束状态的上边缘的高低,根据上边缘高的状态决定水平绘制连线的坐标
495
467
if (startStateTop < endStateTop) {
496
468
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
497
- thirdArcStart .y =
498
- startStateTop -
499
- LINE_V +
500
- lineCfg .threadTitleHeight +
501
- lineCfg .threadToolBoxHeight ;
469
+ thirdArcStart .y = startStateTop - LINE_V + lineCfg .threadTitleHeight ;
502
470
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
503
471
tempLinePath += this .drawLine5ThirdArcUp (
504
472
startPoint,
@@ -507,11 +475,7 @@ export default {
507
475
);
508
476
} else {
509
477
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
510
- thirdArcStart .y =
511
- endStateTop -
512
- LINE_V +
513
- lineCfg .threadTitleHeight +
514
- lineCfg .threadToolBoxHeight ;
478
+ thirdArcStart .y = endStateTop - LINE_V + lineCfg .threadTitleHeight ;
515
479
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
516
480
tempLinePath += this .drawLine5ThirdArcUp (
517
481
startPoint,
@@ -529,15 +493,11 @@ export default {
529
493
};
530
494
thirdArcEnd .x = endPoint .x - LINE_H ;
531
495
thirdArcEnd .y =
532
- stateBottom +
533
- LINE_V -
534
- LINE_RADIUS +
535
- lineCfg .threadTitleHeight +
536
- lineCfg .threadToolBoxHeight ;
496
+ stateBottom + LINE_V - LINE_RADIUS + lineCfg .threadTitleHeight ;
537
497
tempLinePath += this .drawArc (LINE_RADIUS , 0 , 1 , thirdArcEnd);
538
498
return tempLinePath;
539
499
},
540
- // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight与threadToolBoxHeight以获取连线的准确坐标
500
+ // 因为连线的坐标是相对于svg元素的,所以需要加上threadTitleHeight以获取连线的准确坐标
541
501
drawLine5HDown (startPoint , endPoint , startStateBottom , endStateBottom ) {
542
502
let tempLinePath = " " ;
543
503
let thirdArcStart = {
@@ -547,11 +507,7 @@ export default {
547
507
// 比较起始状态和结束状态的下边缘的高低,根据下边缘低的状态决定水平绘制连线的坐标
548
508
if (startStateBottom < endStateBottom) {
549
509
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
550
- thirdArcStart .y =
551
- endStateBottom +
552
- LINE_V +
553
- lineCfg .threadTitleHeight +
554
- lineCfg .threadToolBoxHeight ;
510
+ thirdArcStart .y = endStateBottom + LINE_V + lineCfg .threadTitleHeight ;
555
511
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
556
512
tempLinePath += this .drawLine5ThirdArcDown (
557
513
startPoint,
@@ -560,11 +516,7 @@ export default {
560
516
);
561
517
} else {
562
518
thirdArcStart .x = endPoint .x - LINE_H + LINE_RADIUS ;
563
- thirdArcStart .y =
564
- startStateBottom +
565
- LINE_V +
566
- lineCfg .threadTitleHeight +
567
- lineCfg .threadToolBoxHeight ;
519
+ thirdArcStart .y = startStateBottom + LINE_V + lineCfg .threadTitleHeight ;
568
520
tempLinePath += this .drawLineToEndPoint (thirdArcStart);
569
521
tempLinePath += this .drawLine5ThirdArcDown (
570
522
startPoint,
@@ -805,7 +757,7 @@ export default {
805
757
};
806
758
</script >
807
759
808
- <style lang="less">
760
+ <style lang="less" scoped >
809
761
@qkmGrey : #aaaaaa ;
810
762
@qkmLightBlue : #70ffff ;
811
763
@qkmOrange : #ffaf3d ;
0 commit comments