cnhis-design-vue 2.1.63 → 2.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +85 -68
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +68 -68
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +22 -22
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +1 -1
  32. package/es/ellipsis/index.js +1 -1
  33. package/es/empty/index.js +8 -8
  34. package/es/fabric-chart/index.js +490 -275
  35. package/es/form/index.js +8 -8
  36. package/es/form-model/index.js +8 -8
  37. package/es/form-table/index.js +66 -66
  38. package/es/index/index.js +928 -692
  39. package/es/index/style.css +1 -1
  40. package/es/input/index.js +9 -9
  41. package/es/input-number/index.js +8 -8
  42. package/es/layout/index.js +8 -8
  43. package/es/list/index.js +8 -8
  44. package/es/locale-provider/index.js +8 -8
  45. package/es/map/index.js +9 -9
  46. package/es/mentions/index.js +8 -8
  47. package/es/menu/index.js +8 -8
  48. package/es/message/index.js +8 -8
  49. package/es/multi-chat/index.js +76 -76
  50. package/es/multi-chat-client/index.js +70 -70
  51. package/es/multi-chat-history/index.js +4 -4
  52. package/es/multi-chat-record/index.js +14 -14
  53. package/es/multi-chat-setting/index.js +22 -22
  54. package/es/multi-chat-sip/index.js +1 -1
  55. package/es/notification/index.js +8 -8
  56. package/es/page-header/index.js +8 -8
  57. package/es/pagination/index.js +8 -8
  58. package/es/popconfirm/index.js +8 -8
  59. package/es/popover/index.js +8 -8
  60. package/es/progress/index.js +8 -8
  61. package/es/radio/index.js +9 -9
  62. package/es/rate/index.js +8 -8
  63. package/es/result/index.js +8 -8
  64. package/es/row/index.js +8 -8
  65. package/es/scale-container/index.js +1 -1
  66. package/es/scale-view/index.js +27 -27
  67. package/es/select/index.js +12 -12
  68. package/es/select-label/index.js +11 -11
  69. package/es/select-person/index.js +2 -2
  70. package/es/shortcut-setter/index.js +10 -10
  71. package/es/skeleton/index.js +8 -8
  72. package/es/slider/index.js +8 -8
  73. package/es/space/index.js +8 -8
  74. package/es/spin/index.js +8 -8
  75. package/es/statistic/index.js +8 -8
  76. package/es/steps/index.js +8 -8
  77. package/es/switch/index.js +8 -8
  78. package/es/table-filter/index.js +102 -81
  79. package/es/table-filter/style.css +1 -1
  80. package/es/tabs/index.js +8 -8
  81. package/es/tag/index.js +9 -9
  82. package/es/time-picker/index.js +8 -8
  83. package/es/timeline/index.js +8 -8
  84. package/es/tooltip/index.js +8 -8
  85. package/es/transfer/index.js +8 -8
  86. package/es/tree/index.js +8 -8
  87. package/es/tree-select/index.js +8 -8
  88. package/es/upload/index.js +8 -8
  89. package/es/verification-code/index.js +2 -2
  90. package/lib/cui.common.js +870 -634
  91. package/lib/cui.umd.js +870 -634
  92. package/lib/cui.umd.min.js +12 -12
  93. package/package.json +1 -1
  94. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +3 -3
  95. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +20 -20
  96. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +54 -20
  97. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +25 -24
  98. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +66 -11
  99. package/packages/table-filter/src/mixins/wordBookutils.js +36 -25
  100. package/packages/table-filter/src/quick-search/QuickSearch.vue +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.63",
3
+ "version": "2.1.64",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -144,9 +144,9 @@ export default {
144
144
  },
145
145
  endY() {
146
146
  // 画布高度 - 底部列表高度 ,网格右下角y轴坐标值
147
- if (!this.templateData.bottom) return this.templateData.canvasHeight;
148
- const endHeight = this.templateData.bottom.height || 30;
149
- return this.canvasHeight - endHeight;
147
+ const { show = true, height } = this.templateData.bottom || {};
148
+ if (!show || !height) return this.templateData.canvasHeight;
149
+ return this.canvasHeight - height;
150
150
  },
151
151
  xCellWidth() {
152
152
  // 水平方向网格宽度
@@ -181,7 +181,7 @@ export default {
181
181
  // 左边手柄竖线
182
182
  let leftLine;
183
183
  if (x1 && x1 >= originX && x1 <= endX) {
184
- leftLine = await this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'left', customIcon: !endMinute && !isContinue ? true : false, isContinue });
184
+ leftLine = await this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'left', customIcon: !endMinute && !isContinue });
185
185
  lineItemList.push(leftLine);
186
186
  } else if (x1 < originX) {
187
187
  x1 = originX;
@@ -233,7 +233,7 @@ export default {
233
233
  // 右边手柄竖线
234
234
  let rightLine;
235
235
  if (item[1] && endMinute <= maxMinute && endMinute >= minMinute) {
236
- rightLine = await this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'right' });
236
+ rightLine = await this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'right', isContinue });
237
237
  lineItemList.push(rightLine);
238
238
  }
239
239
 
@@ -355,7 +355,6 @@ export default {
355
355
  left = x2 - this.propItems.xCellWidth / 2;
356
356
  }
357
357
  let line;
358
- let arrow;
359
358
  const common = {
360
359
  selectable: false,
361
360
  evented: false
@@ -380,23 +379,23 @@ export default {
380
379
  ...common
381
380
  });
382
381
  } else {
383
- line = this.drawLine(point, {
384
- ...dataLineStyle,
385
- ...common
386
- });
387
- arrow = isContinue
388
- ? await this.ceateLineArrow({
389
- left: x1,
390
- top: y1 + (y2 - y1) / 2,
391
- originY: 'center',
392
- width: 14,
393
- height: 5,
394
- arrowwidth: 6,
395
- arrowheight: 5,
382
+ line = isContinue
383
+ ? await this.createArrow({
384
+ left: x2,
385
+ top: y1 + (y2 - y1) / 2 - 3.5,
386
+ originY: 'bottom',
387
+ originX: 'right',
388
+ fill: 'transparent',
389
+ width: 7,
390
+ height: 7,
391
+ angle: 270,
396
392
  ...dataLineStyle,
397
393
  ...common
398
394
  })
399
- : null;
395
+ : this.drawLine(point, {
396
+ ...dataLineStyle,
397
+ ...common
398
+ });
400
399
  }
401
400
  const rect = new this.fabric.Rect({
402
401
  width: this.propItems.xCellWidth,
@@ -408,7 +407,7 @@ export default {
408
407
  evented: false
409
408
  });
410
409
 
411
- return new this.fabric.Group([line, rect, ...(arrow ? [arrow] : [])], {
410
+ return new this.fabric.Group([line, rect], {
412
411
  selectable: true,
413
412
  evented: true,
414
413
  originX: 'center',
@@ -418,6 +417,7 @@ export default {
418
417
  colIndex: j,
419
418
  ...this.eventStyle,
420
419
  ...others,
420
+ isContinue,
421
421
  lockMovementY: true // 锁定Y轴,即只能x轴方向移动
422
422
  });
423
423
  },
@@ -497,13 +497,13 @@ export default {
497
497
  // 移动手柄竖线后,需要更新this.lines,便于后面重新渲染时重新计算其左右限制坐标点
498
498
  updateData(line, isHover) {
499
499
  if (!line) return;
500
- const { rowIndex, colIndex, position, left } = line;
500
+ const { rowIndex, colIndex, position, left, isContinue } = line;
501
501
  const linesRow = this.lines[rowIndex];
502
502
  // isHover,只是鼠标移上去显示提示信息而不需要重新计算x值
503
503
  if (isHover) {
504
504
  return { lineObj: { title: linesRow.title, obj: linesRow.lineList[colIndex], rowIndex, index: colIndex } };
505
505
  }
506
- const x = this.getXValue(left);
506
+ const x = this.getXValue(isContinue ? left + 0.5 : left);
507
507
  if (position === 'left') {
508
508
  linesRow.lineList[colIndex][0] = x;
509
509
  } else {
@@ -85,7 +85,9 @@ export default {
85
85
  selectArea: null, // 选区矩形对象
86
86
  currentDelPoint: null, // 缓存当前可批量删除的项目线段上的点
87
87
  polylinePointList: [], // 缓存折线项目节点
88
- isMovingToOtherTarget: false
88
+ isMovingToOtherTarget: false,
89
+ interval: null,
90
+ flickerablePoints: [] // 记录需要闪烁的节点
89
91
  };
90
92
  },
91
93
  computed: {
@@ -114,11 +116,12 @@ export default {
114
116
  init() {
115
117
  this.drawPolylineTitle();
116
118
  this.polylinePointList = [];
119
+ this.flickerablePoints = [];
117
120
  this.polyline.forEach((polylineType, polylineTypeId) => {
118
121
  this.createPolyline(polylineType, polylineTypeId);
119
122
  });
120
-
121
123
  this.eventStyle.evented && this.createEvent();
124
+ this.setFlicker();
122
125
  },
123
126
  createEvent() {
124
127
  this.canvas.on('mouse:up', event => {
@@ -424,15 +427,27 @@ export default {
424
427
  const getTime = new Date(time).getTime();
425
428
  return getTime >= minMinute && getTime <= maxMinute;
426
429
  },
430
+ // 设置节点闪烁
431
+ setFlicker() {
432
+ setTimeout(() => {
433
+ if (this.interval) clearInterval(this.interval);
434
+ if (this.flickerablePoints?.length) {
435
+ this.interval = setInterval(() => {
436
+ this.flickerablePoints.forEach(o => o?.set('opacity', o.opacity === 1 ? 0.5 : 1));
437
+ this.canvas.renderAll();
438
+ }, 800);
439
+ }
440
+ });
441
+ },
427
442
  // 创建危急值和差异值
428
- createAttrVaule(attr, polyline, polylineIndex, polylineType, polylineTypeId) {
443
+ createAttrVaule({ attr, polyline, polylineIndex, polylineType, polylineTypeId }) {
429
444
  const { list } = polyline;
430
- const valueObj = polyline[attr] || {};
431
- if (!valueObj.max && !valueObj.min) return;
445
+ const { max, min } = polyline[attr] || {};
446
+ if (!max && !min) return;
432
447
 
433
448
  const { originX, endX } = this.propItems;
434
- const isMax = valueObj.max?.show && valueObj.max?.value && list.some(v => +v.value >= +valueObj.max.value && this.isLimit(v.time));
435
- const isMin = valueObj.min?.show && valueObj.min?.value && list.some(v => +v.value <= +valueObj.min.value && this.isLimit(v.time));
449
+ const isMax = max?.show && max?.value && list.some(v => +v.value >= +max.value && this.isLimit(v.time));
450
+ const isMin = min?.show && min?.value && list.some(v => +v.value <= +min.value && this.isLimit(v.time));
436
451
  const lines = [];
437
452
 
438
453
  const drawLine = ({ value, lineStyle }) => {
@@ -449,21 +464,21 @@ export default {
449
464
  top: top - 5
450
465
  });
451
466
  };
467
+ const isDraw = (isMaxOrMin, maxOrMin) => isMaxOrMin && (!maxOrMin?.flickerable || attr !== 'critical');
452
468
 
453
- if (isMax) {
454
- const line = drawLine(valueObj.max);
455
- const text = drawText(valueObj.max, line.top);
469
+ if (isDraw(isMax, max)) {
470
+ const line = drawLine(max);
471
+ const text = drawText(max, line.top);
456
472
  line.text = text;
457
473
  lines.push(line, text);
458
474
  }
459
- if (isMin) {
460
- const line = drawLine(valueObj.min);
461
- const text = drawText(valueObj.min, line.top);
475
+ if (isDraw(isMin, min)) {
476
+ const line = drawLine(min);
477
+ const text = drawText(min, line.top);
462
478
  line.text = text;
463
479
  lines.push(line, text);
464
480
  }
465
481
  this.canvas.add(...lines);
466
- // this.canvas.renderAll();
467
482
  },
468
483
  /**
469
484
  * 绘制一条折线
@@ -475,10 +490,9 @@ export default {
475
490
  */
476
491
  drawPolyline(polyline, polylineIndex, polylineType, polylineTypeId) {
477
492
  const { originY, endY } = this.propItems;
478
- const { pointAttr, lineAttr } = polyline;
493
+ const { pointAttr, lineAttr, list = [], critical = {} } = polyline;
479
494
  this._iconClassName = polyline.type === 'img' && pointAttr.iconClassName ? pointAttr.iconClassName : '';
480
495
 
481
- const list = polyline.list;
482
496
  const pointList = [];
483
497
  let lineList = [];
484
498
  const _this = this;
@@ -493,6 +507,7 @@ export default {
493
507
  }
494
508
  return { isInit, points };
495
509
  }
510
+ this.flickerablePoints = this.flickerablePoints.filter(point => point.polylineTypeId !== polylineTypeId && point.polylineIndex !== polylineIndex);
496
511
  list.forEach((linePoints, index) => {
497
512
  // 当前点
498
513
  let { points, isInit } = getPointer(linePoints);
@@ -511,7 +526,8 @@ export default {
511
526
  Object.assign(pointOthers, {
512
527
  originLeft: points[0],
513
528
  originTop: points[1],
514
- time: linePoints.time
529
+ time: linePoints.time,
530
+ __value: linePoints.value
515
531
  });
516
532
  point = previousLine ? this.drawPoint(...points, previousLine, line, polyline.type, pointOthers, isInit) : this.drawPoint(...points, null, line, polyline.type, pointOthers, isInit);
517
533
  }
@@ -548,11 +564,24 @@ export default {
548
564
  return v;
549
565
  });
550
566
  this.canvas.add(...lineList, ...res);
551
- // this.canvas.requestRenderAll();
567
+
568
+ // 缓存需要闪烁的节点
569
+ const { max, min } = critical;
570
+ if (max?.flickerable || min?.flickerable) {
571
+ const maxVal = max?.value;
572
+ const minVal = min?.value;
573
+ if (maxVal && max?.flickerable) {
574
+ this.flickerablePoints.push(...res.filter(point => +point.__value >= +maxVal));
575
+ }
576
+ if (minVal && min?.flickerable) {
577
+ this.flickerablePoints.push(...res.filter(point => +point.__value <= +minVal));
578
+ }
579
+ }
552
580
  });
553
581
 
554
- this.createAttrVaule('critical', polyline, polylineIndex, polylineType, polylineTypeId);
555
- this.createAttrVaule('diffValue', polyline, polylineIndex, polylineType, polylineTypeId);
582
+ const params = { polyline, polylineIndex, polylineType, polylineTypeId };
583
+ this.createAttrVaule({ ...params, attr: 'critical' });
584
+ this.createAttrVaule({ ...params, attr: 'diffValue' });
556
585
  },
557
586
  // 计算y轴坐标
558
587
  cumputedY(polylineType, linePointY) {
@@ -1134,6 +1163,7 @@ export default {
1134
1163
  this.removePolyline();
1135
1164
  }
1136
1165
  this.polylinePointList = [];
1166
+ this.flickerablePoints = [];
1137
1167
  this.polyline.forEach((polylineType, polylineTypeId) => {
1138
1168
  this.createPolyline(polylineType, polylineTypeId);
1139
1169
  });
@@ -1145,6 +1175,10 @@ export default {
1145
1175
  this.drawPolyline(this.polyline[polylineTypeId].dataList[parseInt(dadaIndex)], parseInt(dadaIndex), this.polyline[polylineTypeId], polylineTypeId);
1146
1176
  }
1147
1177
  }
1178
+ },
1179
+ beforeDestroy() {
1180
+ clearInterval(this.interval);
1181
+ this.interval = null;
1148
1182
  }
1149
1183
  };
1150
1184
  </script>
@@ -45,11 +45,8 @@ export default {
45
45
  // x轴时间刻度绘制
46
46
  topScaleValue(obj) {
47
47
  const { originX, originY, xCellWidth, originYTime, spaceHeight } = this.propItems;
48
- const spaceGridNumber = obj.xScalevalue.spaceGridNumber || 3;
49
- const defaultSpaceMinute = obj.xScalevalue.defaultSpaceTime || 15;
48
+ const { spaceGridNumber = 3, defaultSpaceTime: defaultSpaceMinute = 15, style = {}, customStyle = {} } = obj.xScalevalue || {};
50
49
  const defaultSpaceTime = defaultSpaceMinute * 60 * 1000;
51
- const style = obj.xScalevalue.style || {};
52
- const customStyle = obj.xScalevalue.customStyle || {};
53
50
  const top = originYTime + Math.floor(spaceHeight / 2);
54
51
  let textList = [];
55
52
  const list = obj.xScalevalue.list || [];
@@ -73,18 +70,19 @@ export default {
73
70
  },
74
71
  rightScaleValue(obj) {
75
72
  if (!obj) return;
76
- const spaceGridNumber = obj.rightYScalevalue.spaceGridNumber || 2;
77
- const marginLeft = obj.rightYScalevalue.marginLeft || 3;
78
- const originX = this.propItems.endX + marginLeft;
79
- const style = obj.rightYScalevalue.style ? obj.rightYScalevalue.style : {};
73
+ const { spaceGridNumber = 2, marginLeft = 3, style = {}, list = [], unit } = obj.rightYScalevalue || {};
74
+ const { endX, endY, yCellHeight } = this.propItems;
75
+ const _originX = endX + marginLeft;
80
76
  let textList = [];
81
- obj.rightYScalevalue.list.forEach((item, index) => {
82
- textList.push(this.createText(item, originX, this.propItems.endY - index * this.propItems.yCellHeight * spaceGridNumber, 'left', style));
77
+ list.forEach((item, index) => {
78
+ const numObj = this.createText(item, _originX, endY - index * yCellHeight * spaceGridNumber, 'left', style);
79
+ index === 0 && this.setOverFlowPoint(numObj);
80
+ textList.push(numObj);
83
81
  });
84
82
  // 添加单位
85
- if (obj.rightYScalevalue.unit) {
86
- const top = this.propItems.endY - obj.rightYScalevalue.list.length * this.propItems.yCellHeight * spaceGridNumber + this.propItems.yCellHeight;
87
- textList.push(this.createText(obj.rightYScalevalue.unit, originX, top, 'left', style));
83
+ if (unit) {
84
+ const top = endY - list.length * yCellHeight * spaceGridNumber + yCellHeight;
85
+ textList.push(this.createText(unit, _originX, top, 'left', style));
88
86
  }
89
87
  const group = new this.fabric.Group([...textList], {
90
88
  evented: false,
@@ -94,23 +92,22 @@ export default {
94
92
  this.canvas.sendBackwards(group);
95
93
  },
96
94
  leftScaleValue(obj) {
97
- const { endY, yCellHeight } = this.propItems;
98
- const spaceGridNumber = obj.leftYScalevalue.spaceGridNumber || 2;
99
- const [titleMarginRight, titleMarginButton] = obj.leftYScalevalue?.titleMargin || [5, 30];
100
- const listMarginRight = obj.leftYScalevalue.listMarginRight || 3;
101
- const style = obj.leftYScalevalue.style || {};
102
- const originX = this.propItems.originX;
95
+ const { spaceGridNumber = 2, titleMargin = [5, 30], listMarginRight = 3, style = {}, list = [], name, unit } = obj.leftYScalevalue || {};
96
+ const { originX, endY, yCellHeight } = this.propItems;
97
+ const [titleMarginRight, titleMarginButton] = titleMargin;
103
98
  let textList = [];
104
- obj.leftYScalevalue.list.forEach((item, index) => {
105
- textList.push(this.createText(item, originX - listMarginRight, endY - index * yCellHeight * spaceGridNumber, 'right', style));
99
+ list.forEach((item, index) => {
100
+ const numObj = this.createText(item, originX - listMarginRight, endY - index * yCellHeight * spaceGridNumber, 'right', style);
101
+ index === 0 && this.setOverFlowPoint(numObj);
102
+ textList.push(numObj);
106
103
  });
107
104
 
108
105
  // 添加标题和单位
109
106
  let txt = '';
110
- txt = obj.leftYScalevalue.name || '';
111
- if (obj.leftYScalevalue.unit) txt += '\n' + obj.leftYScalevalue.unit;
107
+ txt = name || '';
108
+ if (unit) txt += '\n' + unit;
112
109
  if (txt) {
113
- const top = endY - (obj.leftYScalevalue.list.length - 1) * yCellHeight * spaceGridNumber - titleMarginButton;
110
+ const top = endY - (list.length - 1) * yCellHeight * spaceGridNumber - titleMarginButton;
114
111
  textList.push(this.createText(txt, originX - titleMarginRight, top, 'right', { ...style, textAlign: 'right', originY: 'bottom' }));
115
112
  }
116
113
  const group = new this.fabric.Group([...textList], {
@@ -120,6 +117,10 @@ export default {
120
117
  this.canvas.add(group);
121
118
  this.canvas.sendBackwards(group);
122
119
  },
120
+ setOverFlowPoint(point) {
121
+ const { endY, canvasHeight } = this.propItems;
122
+ endY === canvasHeight && point.set('top', point.top - point.height / 2);
123
+ },
123
124
  createText(text, left, top, originX, style) {
124
125
  return new this.fabric.Text(String(text), {
125
126
  ...this.defaultTextStyle,
@@ -264,18 +264,23 @@ export default {
264
264
  if (list[index - 1]) {
265
265
  top += item.lineHeight || 15;
266
266
  }
267
-
267
+ const originOptions = { originX: 'right', left, top };
268
268
  const title = new this.fabric.Text(String(item.title), {
269
269
  ...defaultVaule.style,
270
270
  ...defaultVaule.textStyle,
271
271
  ...item.style,
272
272
  ...(item.titleStyle || {}),
273
- originX: 'right',
274
273
  originY: 'center',
275
- left,
276
- top,
277
- id: `${index}_other_${Date.now()}`
274
+ id: `${index}_other_${Date.now()}`,
275
+ dataIndex: index,
276
+ type: 'list',
277
+ hasControls: false,
278
+ hasBorders: false,
279
+ ...originOptions,
280
+ ...this.eventStyle,
281
+ dataList: []
278
282
  });
283
+ this.setMovingEvent(title, originOptions);
279
284
  textList.push(title);
280
285
  const { icon: _icon = { type: 'circle' }, dataList } = item || {};
281
286
  for (let i = 0, len = dataList.length; i < len; i++) {
@@ -288,9 +293,11 @@ export default {
288
293
  index: i,
289
294
  type: 'list'
290
295
  };
296
+ const left = this.cumputedX(v.time);
297
+ title.dataList.push(left);
291
298
  const icon = await this.createPoint(_icon.type, {
292
299
  originX: 'center',
293
- left: this.cumputedX(v.time),
300
+ left,
294
301
  ...item.style,
295
302
  ...(item.style ? { stroke: item.style.fill } : {}),
296
303
  ...(_icon.style || {}),
@@ -300,7 +307,7 @@ export default {
300
307
  ...defaultVaule.style,
301
308
  ...defaultVaule.textStyle,
302
309
  ...item.style,
303
- left: icon.left + icon.width / 2,
310
+ left: left + icon.width / 2,
304
311
  name: v.value,
305
312
  ...commonOptions
306
313
  });
@@ -309,7 +316,8 @@ export default {
309
316
  lockMovementX: true,
310
317
  lockMovementY: true,
311
318
  ...commonOptions,
312
- ...this.eventStyle
319
+ ...this.eventStyle,
320
+ realLeft: left
313
321
  });
314
322
  groupObj.hasControls = groupObj.hasBorders = false;
315
323
  this.setPopup(groupObj);
@@ -319,6 +327,52 @@ export default {
319
327
  }
320
328
  this.canvas.add(...textList);
321
329
  },
330
+ setMovingEvent(point) {
331
+ const { originX, originY, endX, endY } = this.propItems;
332
+ const isLimit = () => point.left >= originX && point.left <= endX && point.top >= originY && point.top <= endY;
333
+ let cloneObj;
334
+ point.on('moving', () => {
335
+ point.set('originX', 'center');
336
+ !point.isClone &&
337
+ point.clone(obj => {
338
+ obj.set('originX', 'right');
339
+ this.canvas.add(obj);
340
+ cloneObj = obj;
341
+ point.isClone = true;
342
+ });
343
+ if (isLimit()) {
344
+ Bus.$emit('mouseoverTarget', true);
345
+ this.showDrapPopup(point, true);
346
+ } else {
347
+ !this.isRightVisible && Bus.$emit('mouseoverTarget', false);
348
+ this.isDropVisible = false;
349
+ }
350
+ });
351
+ point.on('moved', () => {
352
+ this.canvas.remove(cloneObj);
353
+ point.isClone = false;
354
+ this.removeOther();
355
+ this.drawTextDataGroup(this.templateData.other);
356
+ !this.isRightVisible && Bus.$emit('mouseoverTarget', false);
357
+ this.isDropVisible = false;
358
+ if (isLimit()) {
359
+ const { type, dataIndex, left, dataList } = point;
360
+ const time = this.getXValue(left);
361
+ const index = dataList.findIndex(_left => _left > left);
362
+ // 使用定时器,是因为:防止上方移除重绘过慢新增完后再次触发移除重绘导致页面多次重绘节点
363
+ setTimeout(() => {
364
+ this.$emit('addOhter', {
365
+ type,
366
+ dataIndex,
367
+ index: !~index ? (dataList.length ? dataList.length - 1 : 0) : index,
368
+ data: {
369
+ time
370
+ }
371
+ });
372
+ });
373
+ }
374
+ });
375
+ },
322
376
  setPopup(point) {
323
377
  point.on('mouseover', () => {
324
378
  Bus.$emit('mouseoverTarget', true);
@@ -346,10 +400,11 @@ export default {
346
400
  },
347
401
  // 底部标记
348
402
  drawBottomTextDataGroup(obj) {
349
- if (!obj.list) {
403
+ const { endX, originX, endY, canvasHeight, topTotal } = this.propItems;
404
+ if (!obj.list || endY === canvasHeight) {
350
405
  return;
351
406
  }
352
- const { endX, originX, endY, canvasHeight, topTotal } = this.propItems;
407
+
353
408
  topTotal.width && this.canvas.add(this.drawLine([endX, endY - 1, endX, canvasHeight], { ...this.defaultRectStyle }));
354
409
  // const textList = [];
355
410
  const marginLeft = this.templateData.left.leftYScalevalue.spaceGridNumber || defaultVaule.spaceGridNumber;
@@ -546,7 +601,7 @@ export default {
546
601
  top: point.top,
547
602
  margin: { top: this.propItems.yCellHeight }
548
603
  };
549
- const x = arguments.length > 1 && point.other?.viewTime ? point.other.viewTime : this.getXValue(point.left);
604
+ const x = arguments.length > 1 && point.other?.viewTime ? point.other.viewTime : this.getXValue(point.realLeft || point.left);
550
605
  this.dropVal = {
551
606
  title: point.name || '',
552
607
  list: [{ id: '1', name: '时间', value: x }]
@@ -1,11 +1,11 @@
1
1
  import vexutils from '@/utils/vexutils';
2
2
 
3
- const SYMBOL = "<&=&>"
3
+ const SYMBOL = '<&=&>';
4
4
  /**
5
5
  * 处理 getWordbookData 接口返回的数据以及配置
6
6
  */
7
7
  const formatWordbookDataUtils = {
8
- hasArray: (arr) => Array.isArray(arr) && arr.length > 0,
8
+ hasArray: arr => Array.isArray(arr) && arr.length > 0,
9
9
  handleWordbookData(item, data, params) {
10
10
  // this.$set(item, "hasFieldList", false);
11
11
  let { setting = {} } = item;
@@ -17,52 +17,64 @@ const formatWordbookDataUtils = {
17
17
  let searchPageConfig = {};
18
18
 
19
19
  if (defaultValue && defaultValueTitle) {
20
+ // 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
21
+ if (typeof defaultValue === 'number') {
22
+ defaultValue = String(defaultValue);
23
+ }
20
24
  defaultItem = {
21
25
  myName: defaultValue,
22
26
  showKeys: defaultValueTitle
23
27
  };
24
28
  }
25
29
  if (data && data.result) {
26
- let reqParams = data?.reqParams || {}
30
+ let reqParams = data?.reqParams || {};
27
31
 
28
- let { page, hasNextPage,fieldList } = data.map;
29
- searchPageConfig = Object.assign(item.searchPageConfig, {
30
- page,
31
- hasNextPage,
32
- isRequest: true,
33
- keyword: params?.keyword || undefined,
34
- asyncCount: reqParams?.asyncCount || undefined
35
- });
32
+ let { page, hasNextPage, fieldList } = data.map;
33
+ searchPageConfig = Object.assign(item.searchPageConfig, {
34
+ page,
35
+ hasNextPage,
36
+ isRequest: true,
37
+ keyword: params?.keyword || undefined,
38
+ asyncCount: reqParams?.asyncCount || undefined
39
+ });
36
40
  // 数组赋值并添加唯一name
37
41
  let rows = data.map.rows.map(row => {
38
42
  let showKeysStr = [];
39
43
  showKeys.forEach(ren => {
40
- let str = vexutils.stringToValue(row[ren],'change_text')
44
+ let str = vexutils.stringToValue(row[ren], 'change_text');
41
45
  showKeysStr.push(str);
42
46
  });
43
- let name = vexutils.stringToValue(row[item.setting.wordbook.field_key],'value')
47
+ let name = vexutils.stringToValue(row[item.setting.wordbook.field_key], 'value');
48
+ // 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
49
+ if (typeof name === 'number') {
50
+ name = String(name);
51
+ }
44
52
  return Object.assign(row, {
45
53
  myName: name,
46
54
  showKeys: showKeysStr.join(SYMBOL),
47
- _show_title: showKeysStr.join(" ")
55
+ _show_title: showKeysStr.join(' ')
48
56
  });
49
57
  });
50
58
  // 数组对象去重
51
59
  let obj = {};
52
60
  resArr = rows.reduce((cur, next) => {
53
- obj[next.myName] ? "" : (obj[next.myName] = true && cur.push(next));
61
+ obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
54
62
  return cur;
55
63
  }, []);
56
64
  if (defaultItem) {
57
65
  resArr.unshift(defaultItem);
58
66
  }
59
- if(formatWordbookDataUtils.hasArray(fieldList) && formatWordbookDataUtils.hasArray(showKeys) && showKeys.length > 1){
60
- let t = formatWordbookDataUtils.getTitleHeader(fieldList,showKeys);
67
+ if (formatWordbookDataUtils.hasArray(fieldList) && formatWordbookDataUtils.hasArray(showKeys) && showKeys.length > 1) {
68
+ let t = formatWordbookDataUtils.getTitleHeader(fieldList, showKeys);
69
+ // 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
70
+ if (typeof t === 'number') {
71
+ t = String(t);
72
+ }
61
73
  resArr.unshift({
62
- myName: t,
74
+ myName: t,
63
75
  showKeys: t,
64
- sid: Math.random()
65
- })
76
+ sid: Math.random()
77
+ });
66
78
  // this.$set(item, "hasFieldList", true);
67
79
  hasFieldList = true;
68
80
  }
@@ -70,10 +82,10 @@ const formatWordbookDataUtils = {
70
82
  }
71
83
 
72
84
  return {
73
- rows:resArr,
85
+ rows: resArr,
74
86
  hasFieldList,
75
87
  searchPageConfig
76
- }
88
+ };
77
89
  },
78
90
 
79
91
  // 下拉搜索框获取字段title
@@ -95,8 +107,7 @@ const formatWordbookDataUtils = {
95
107
  });
96
108
  let res = titleHeader.join(SYMBOL);
97
109
  return res;
98
- },
99
- }
100
-
110
+ }
111
+ };
101
112
 
102
113
  export default formatWordbookDataUtils;
@@ -1012,6 +1012,11 @@ export default create({
1012
1012
  if (find) {
1013
1013
  let value = find?.value
1014
1014
  let isTrance = item.CONVERT && Array.isArray(item.CONVERT) || item.comType == "SelectMui" && item.con == "CONVERT"
1015
+ // wordbook多选
1016
+ let isWordBookMulti = value && item.comType === "SelectMuiWordBook"&& typeof value ==='string' && value.includes('|#|')
1017
+ if(isWordBookMulti) {
1018
+ value = value.split('|#|')
1019
+ }
1015
1020
  if(Array.isArray(value) && isTrance){
1016
1021
  let value = find?.value?.map?.(item => JSON.stringify(item)) || find.value;
1017
1022
  value = value.filter(Boolean)