cnhis-design-vue 2.0.17 → 2.0.19-beta.2

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 (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +23 -23
  4. package/es/button/index.js +2 -2
  5. package/es/captcha/index.js +3 -3
  6. package/es/checkbox/index.js +1 -1
  7. package/es/color-picker/index.js +1 -1
  8. package/es/drag-layout/index.js +3 -3
  9. package/es/editor/index.js +1 -1
  10. package/es/fabric-chart/index.js +305 -48
  11. package/es/fabric-chart/style.css +1 -1
  12. package/es/form-table/index.js +17 -17
  13. package/es/index/index.js +477 -223
  14. package/es/index/style.css +1 -1
  15. package/es/input/index.js +1 -1
  16. package/es/map/index.js +1 -1
  17. package/es/multi-chat/index.js +55 -51
  18. package/es/multi-chat/style.css +1 -1
  19. package/es/multi-chat-client/index.js +18 -18
  20. package/es/multi-chat-history/index.js +4 -4
  21. package/es/multi-chat-record/index.js +4 -4
  22. package/es/multi-chat-setting/index.js +20 -20
  23. package/es/multi-chat-sip/index.js +1 -1
  24. package/es/radio/index.js +1 -1
  25. package/es/scale-view/index.js +24 -24
  26. package/es/select/index.js +3 -3
  27. package/es/select-label/index.js +3 -3
  28. package/es/select-person/index.js +2 -2
  29. package/es/table-filter/index.js +21 -21
  30. package/es/tag/index.js +1 -1
  31. package/es/verification-code/index.js +2 -2
  32. package/package.json +2 -2
  33. package/packages/fabric-chart/src/components/TimeScaleValue.vue +117 -0
  34. package/packages/fabric-chart/src/const/defaultVaule.js +1 -0
  35. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +49 -22
  36. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +19 -6
  37. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +25 -2
  38. package/packages/multi-chat/chat/index.vue +13 -7
@@ -2,7 +2,7 @@
2
2
  <div class="poly-line">
3
3
  <MouseRightClick v-if="isRightVisible" :getContainer="getContainer" :nodeList="rightClickNode" :rightPos="rightPos" @nodeClick="handleRightClick" @closeRight="isRightVisible = false" />
4
4
 
5
- <DropPopup v-if="isDropVisible" :val="dropVal" :dropPos="dropPos" />
5
+ <DropPopup v-show="isDropVisible" :val="dropVal" :dropPos="dropPos" />
6
6
  </div>
7
7
  </template>
8
8
 
@@ -23,7 +23,7 @@ const rightClickNode = [
23
23
  { name: '删除节点', type: 'delete' }
24
24
  ];
25
25
  const rightClickNodeConnect = [
26
- { name: '新增节点连接右侧节点', type: 'add', },
26
+ { name: '新增节点连接右侧节点', type: 'add' },
27
27
  { name: '新增节点连接左侧节点', type: 'add' }
28
28
  ];
29
29
  export default {
@@ -64,8 +64,7 @@ export default {
64
64
  }
65
65
  },
66
66
 
67
- watch: {
68
- },
67
+ watch: {},
69
68
 
70
69
  mounted() {
71
70
  this.$nextTick(() => {
@@ -160,7 +159,7 @@ export default {
160
159
  const maxTime = Math.max(...xScaleList);
161
160
  this.polyline.forEach((item, index) => {
162
161
  item.dataList.forEach((v, i) => {
163
- // 配置是否可拖动标题图标批量增加-
162
+ // 配置是否可拖动标题图标批量增加-
164
163
  const isAdd = v.list.length
165
164
  ? !v.list.some(k => {
166
165
  return isEffectiveNode(k) && new Date(k.time).getTime() >= minTime && new Date(k.time).getTime() < xScaleCellList[1].time;
@@ -264,12 +263,11 @@ export default {
264
263
  let originTop = top;
265
264
  let cloneIconId;
266
265
  icon.on('moving', () => {
267
-
268
266
  // 优化左侧图标太小不容易选中的问题
269
267
  if (!icon.url && icon.scaleX == 1.8 && icon.scaleY == 1.8) {
270
268
  icon.set({
271
- 'scaleX': 1,
272
- 'scaleY': 1
269
+ scaleX: 1,
270
+ scaleY: 1
273
271
  });
274
272
  this.canvas.renderAll();
275
273
  }
@@ -376,7 +374,7 @@ export default {
376
374
  const isMax = valueObj.max?.show && valueObj.max?.value && list.some(v => +v.value >= +valueObj.max.value && this.isLimit(v.time));
377
375
  const isMin = valueObj.min?.show && valueObj.min?.value && list.some(v => +v.value <= +valueObj.min.value && this.isLimit(v.time));
378
376
  const lines = [];
379
-
377
+
380
378
  const drawLine = ({ value, lineStyle }) => {
381
379
  const top = this.cumputedY(polylineType, +value);
382
380
  return this.drawLine([originX, top, endX, top], { polylineIndex, lineIndex: 0, polylineTypeId, ...(lineStyle || defaultVaule.criticalStyle) });
@@ -447,7 +445,7 @@ export default {
447
445
  let point;
448
446
  let previousLine;
449
447
 
450
- line = points && nextPoint ? this.drawLine([...points, ...nextPoint], { polylineIndex, lineIndex: index, ...lineAttr }) : null;
448
+ line = points && nextPoint ? this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr }) : null;
451
449
  previousLine = lineList[index - 1];
452
450
  const pointOthers = { polylineTypeId, polylineIndex, pointIndex: index, ...pointAttr, lineAttr };
453
451
  if (points) {
@@ -512,6 +510,19 @@ export default {
512
510
  line2 && (point.line2 = line2);
513
511
  point.on('mouseover', () => {
514
512
  this.showDrapPopup(point);
513
+ // 将当条线段以及点层级置顶
514
+ // 线段不能先置顶,会挡住其他线段上的点
515
+ // this.canvas.forEachObject(obj => {
516
+ // if (this.isOnePolyLine(obj, point.polylineTypeId, point.polylineIndex)) {
517
+ // obj.line1 && this.canvas.bringToFront(obj.line1);
518
+ // obj.line2 && this.canvas.bringToFront(obj.line2);
519
+ // }
520
+ // });
521
+ this.canvas.forEachObject(obj => {
522
+ if (this.isOnePolyLine(obj, point.polylineTypeId, point.polylineIndex)) {
523
+ this.canvas.bringToFront(obj);
524
+ }
525
+ });
515
526
  });
516
527
  point.on('mouseout', () => {
517
528
  this.isDropVisible = false;
@@ -533,7 +544,7 @@ export default {
533
544
  }
534
545
  });
535
546
  }
536
-
547
+
537
548
  // 超出表格最高或最低值则需要触发pointChange事件并且不能更新视图,否则连接节点判断不会成功
538
549
  isInit && this.setEmitFunction(point, isInit);
539
550
 
@@ -631,7 +642,7 @@ export default {
631
642
  let cloneObj = JSON.parse(JSON.stringify(pointObj));
632
643
  cloneObj.value.time = this.getXValue(curLeft);
633
644
  cloneObj.left = curLeft;
634
- this.addPointList.splice(index, 0 , cloneObj);
645
+ this.addPointList.splice(index, 0, cloneObj);
635
646
  }
636
647
  }
637
648
  }
@@ -644,12 +655,12 @@ export default {
644
655
  if (left > originLeft) {
645
656
  point.line1 && this.removePolyline(point.line1.id);
646
657
  // if (i === 1) {
647
- this.addPointList.length == 0 && await this.clonePoint(point, [point.line1 ? point.line1.x1 : originLeft, point.line1 ? point.line1.y1 : originTop, originLeft, originTop]);
658
+ this.addPointList.length == 0 && (await this.clonePoint(point, [point.line1 ? point.line1.x1 : originLeft, point.line1 ? point.line1.y1 : originTop, originLeft, originTop]));
648
659
  // }
649
660
  if (this.addPointList.every(v => v.left !== left)) {
650
661
  // const points1 = i === 1 ? [originLeft, originTop] : point.prePoints;
651
662
  const points1 = this.addPointList.length == 0 ? [originLeft, originTop] : point.prePoints;
652
- points1 && await this.clonePoint(point, [...points1, left, top]);
663
+ points1 && (await this.clonePoint(point, [...points1, left, top]));
653
664
  // this.setAddPointList(point);
654
665
  // 调用上面方法就会导致线段绘制失败,目前还不知道为啥子
655
666
  const { data, x, y } = this.getValue(point);
@@ -719,7 +730,7 @@ export default {
719
730
  this.canvas.renderAll();
720
731
  resolve(clonedObj);
721
732
  });
722
- })
733
+ });
723
734
  },
724
735
  getValue(point) {
725
736
  const x = this.getXValue(point.left);
@@ -750,12 +761,17 @@ export default {
750
761
  const lineId = `${others.lineIndex}_${others.polylineIndex}_polylineLine_${new Date().getTime()}`;
751
762
  const line = new this.fabric.Line(lines, {
752
763
  id: lineId,
753
- hoverCursor: 'pointer',
754
- objectCaching: false,
764
+ hoverCursor: 'default',
765
+ // objectCaching: false,
755
766
  selectable: false,
756
767
  evented: false,
757
768
  ...others
758
769
  });
770
+ // line.hasControls = line.hasBorders = false;
771
+ // line.on('mouseover', () => {
772
+ // // 将当条线段以及点层级置顶
773
+ // // 此处有问题,线段定位是斜角形成的整个矩形,会挡住其他点或线段的mouseover事件
774
+ // });
759
775
 
760
776
  return line;
761
777
  },
@@ -763,14 +779,15 @@ export default {
763
779
  this.isDropVisible = true;
764
780
  this.dropPos = {
765
781
  left: point.left,
766
- top: point.top
782
+ top: point.top,
783
+ margin: { top: this.propItems.yCellHeight }
767
784
  };
768
785
  let { x, y, data } = this.getValue(point);
769
786
  const getY = y => {
770
787
  if (data?.position == 'right') {
771
788
  if (y.toString().includes('.')) {
772
789
  const [m, n] = y.toString().split('.');
773
- return parseFloat(`${m}.${n.slice(0, 1)}`) * 10 / 10;
790
+ return (parseFloat(`${m}.${n.slice(0, 1)}`) * 10) / 10;
774
791
  }
775
792
  return y;
776
793
  } else {
@@ -820,7 +837,12 @@ export default {
820
837
  nodeConnect = rightClickNodeConnect.slice();
821
838
  }
822
839
  }
823
- this.rightClickNode = Object.freeze(rightClickNode.slice(0, 1).concat(nodeConnect).concat(rightClickNode.slice(-1)));
840
+ this.rightClickNode = Object.freeze(
841
+ rightClickNode
842
+ .slice(0, 1)
843
+ .concat(nodeConnect)
844
+ .concat(rightClickNode.slice(-1))
845
+ );
824
846
  this.isRightVisible = true;
825
847
  } else if (!id) {
826
848
  const { operable } = this.propItems;
@@ -866,6 +888,12 @@ export default {
866
888
  data: value
867
889
  };
868
890
  },
891
+ isOnePolyLine(obj, polylineTypeId, polylineIndex) {
892
+ // 排除左侧标题
893
+ const isPolyLine = obj.polylineTypeId === polylineTypeId && obj.polylineIndex === polylineIndex;
894
+ if (obj.id && /_polyline(Point|Line)_/.test(obj.id) && !obj.id.includes('isTitle') && isPolyLine) return true;
895
+ return;
896
+ },
869
897
  removePolyline(id, left, position, polylineIndex) {
870
898
  // 根据id或者idClone删除
871
899
  if (id) {
@@ -888,8 +916,7 @@ export default {
888
916
  if (position && (polylineIndex === 0 || polylineIndex)) {
889
917
  const polylineTypeId = this.polyline.findIndex(v => v.position === position);
890
918
  this.canvas.forEachObject(obj => {
891
- const isPolyLine = obj.polylineTypeId === polylineTypeId && obj.polylineIndex === polylineIndex;
892
- if (obj.id && /_polyline(Point|Line)_/.test(obj.id) && !obj.id.includes('isTitle') && isPolyLine) {
919
+ if (this.isOnePolyLine(obj, polylineTypeId, polylineIndex)) {
893
920
  obj.text && this.canvas.remove(obj.text);
894
921
  obj.line1 && this.canvas.remove(obj.line1);
895
922
  obj.line2 && this.canvas.remove(obj.line2);
@@ -1,10 +1,18 @@
1
+ <template>
2
+ <TimeScaleValue v-if="templateData.top.xScalevalue.popupTop" :times="timeList" :templateData="templateData" />
3
+ </template>
4
+
1
5
  <script>
2
6
  import fabricCommon from '../mixins/fabricCommon';
3
7
  import defaultVaule from '../const/defaultVaule';
8
+ import TimeScaleValue from '../components/TimeScaleValue.vue';
4
9
 
5
10
  export default {
6
11
  name: 'fabric-scale-value',
7
12
  mixins: [fabricCommon],
13
+ components: {
14
+ TimeScaleValue
15
+ },
8
16
  props: {
9
17
  templateData: {
10
18
  type: Object,
@@ -13,6 +21,7 @@ export default {
13
21
  },
14
22
  data() {
15
23
  return {
24
+ timeList: []
16
25
  };
17
26
  },
18
27
  computed: {
@@ -21,8 +30,8 @@ export default {
21
30
  ...defaultVaule.textStyle,
22
31
  centeredRotation: true,
23
32
  originX: 'center',
24
- originY: 'center',
25
- }
33
+ originY: 'center'
34
+ };
26
35
  }
27
36
  },
28
37
  mounted() {
@@ -47,9 +56,16 @@ export default {
47
56
  const list = obj.xScalevalue.list || [];
48
57
  list.reduce((pre, cur, i) => {
49
58
  const newStyle = pre && new Date(cur).getTime() - new Date(pre).getTime() < defaultSpaceTime ? { ...style, ...customStyle } : style;
50
- textList.push(this.createText(cur.slice(-5), originX + i * spaceGridNumber * xCellWidth, top, 'center', newStyle));
59
+ const text = this.createText(cur.slice(-5), originX + i * spaceGridNumber * xCellWidth, top, 'center', newStyle);
60
+ textList.push(text);
61
+ this.timeList.push({
62
+ time: cur.slice(-5),
63
+ left: originX + i * spaceGridNumber * xCellWidth,
64
+ width: text.width
65
+ });
51
66
  return cur;
52
67
  }, '');
68
+ console.log(textList);
53
69
  const group = new this.fabric.Group([...textList], {
54
70
  evented: false,
55
71
  selectable: false
@@ -112,9 +128,6 @@ export default {
112
128
  originX
113
129
  });
114
130
  }
115
- },
116
- render(h) {
117
- return this.$slots.default ? h('div', this.$slots.default) : undefined;
118
131
  }
119
132
  };
120
133
  </script>
@@ -41,7 +41,7 @@ export default {
41
41
  templateData: {
42
42
  type: Object,
43
43
  required: true
44
- },
44
+ }
45
45
  },
46
46
  watch: {
47
47
  'templateData.other': {
@@ -384,9 +384,23 @@ export default {
384
384
  ele: ele || '',
385
385
  ...option
386
386
  });
387
+ // 标记增加序号
388
+ if (v.other?.number) {
389
+ const text = new this.fabric.Text(String(v.other?.number?.value || ''), {
390
+ ...defaultVaule.textStyle,
391
+ ...common,
392
+ ...(v.other?.number?.style || {}),
393
+ originY: 'right',
394
+ left: img.left - (img.width * img.scale) / 2 - defaultVaule.bottomNumberLeftSpace,
395
+ selectable: false,
396
+ evented: false
397
+ });
398
+ img.number = text;
399
+ }
387
400
  img.hasControls = img.hasBorders = false;
388
401
  this.pointEvent(img);
389
402
  this.canvas.add(img);
403
+ img.number && this.canvas.add(img.number);
390
404
  this.canvas.requestRenderAll();
391
405
  } else {
392
406
  const text = new this.fabric.Text(String(v.value), {
@@ -406,6 +420,13 @@ export default {
406
420
  });
407
421
  // this.canvas.add(...textList);
408
422
  },
423
+ // 标记移动时 setCoords()方法手动更新相关联的序号等坐标
424
+ updateNumber(point) {
425
+ if (point.number) {
426
+ point.number.setCoords();
427
+ point.number.set({ left: point.left - (point.width * point.scale) / 2 - defaultVaule.bottomNumberLeftSpace, top: point.top });
428
+ }
429
+ },
409
430
  pointEvent(point) {
410
431
  point.on('mouseover', () => {
411
432
  this.showDrapPopup(point, true);
@@ -417,6 +438,7 @@ export default {
417
438
  if (this.eventStyle.evented) {
418
439
  point.on('moving', () => {
419
440
  this.moveLimit(point);
441
+ this.updateNumber(point);
420
442
  this.canvas.renderAll();
421
443
  this.showDrapPopup(point);
422
444
  });
@@ -483,7 +505,8 @@ export default {
483
505
  this.isDropVisible = true;
484
506
  this.dropPos = {
485
507
  left: point.left,
486
- top: point.top
508
+ top: point.top,
509
+ margin: { top: this.propItems.yCellHeight }
487
510
  };
488
511
  const x = arguments.length > 1 && point.other?.viewTime ? point.other.viewTime : this.getXValue(point.left);
489
512
  this.dropVal = {
@@ -191,7 +191,7 @@
191
191
  <chat-footer :addvisible.sync="visible" :validTalkingEnv="validTalkingEnv" :hideQueueBtns="hideQueueBtns"></chat-footer>
192
192
  <Video v-if="showVideo"></Video>
193
193
  <Audio v-if="showAudio" :validTalkingEnv="validTalkingEnv"></Audio>
194
- <div v-if="showPanel && clientId" :class="['collapse-icon', foldPanel ? '' : 'fold']" @click="() => (foldPanel = !foldPanel)">
194
+ <div v-if="showPanel && clientId && !rightPanelHide" :class="['collapse-icon', foldPanel ? '' : 'fold']" @click="() => (foldPanel = !foldPanel)">
195
195
  <img style="position: absolute;z-index: 30000;top: calc(50% - 6px);right: 10px;" src="../img/left.png" width="9" />
196
196
  </div>
197
197
  </a-layout>
@@ -416,11 +416,15 @@ export default {
416
416
  enableTypeValid: {
417
417
  type: Boolean,
418
418
  default: false
419
+ },
420
+ rightPanelHide: {
421
+ type: Boolean,
422
+ default: false
419
423
  }
420
424
  },
421
425
  async created() {
422
426
  this.init();
423
- this.registerEvent('searchCurrenChatList', ({type = 'change', keyword}) => {
427
+ this.registerEvent('searchCurrenChatList', ({ type = 'change', keyword }) => {
424
428
  this.handleKeywordsChange({ target: { value: keyword } });
425
429
  type == 'pressEnter' && this.handleKeywordsSearch({ target: { value: keyword } });
426
430
  });
@@ -507,7 +511,8 @@ export default {
507
511
  (!this.isConference && !this.clientId) ||
508
512
  this.foldPanel ||
509
513
  (currentTab == 'queue' && !this.isShowPanel) ||
510
- (!this.isShowPanel && !this.isShowGroupChat)
514
+ (!this.isShowPanel && !this.isShowGroupChat) ||
515
+ this.rightPanelHide
511
516
  ) {
512
517
  return 24;
513
518
  }
@@ -521,7 +526,8 @@ export default {
521
526
  (!this.isConference && !this.clientId) ||
522
527
  this.foldPanel ||
523
528
  (currentTab == 'queue' && !this.isShowPanel) ||
524
- (!this.isShowPanel && !this.isShowGroupChat)
529
+ (!this.isShowPanel && !this.isShowGroupChat) ||
530
+ this.rightPanelHide
525
531
  ) {
526
532
  return 0;
527
533
  }
@@ -636,7 +642,7 @@ export default {
636
642
  'setLastCurrentTab',
637
643
  'setQueueItem',
638
644
  'setCurScrollItem',
639
- 'setSessionType',
645
+ 'setSessionType'
640
646
  ]),
641
647
  ...mapActions(['setChatTimer', 'getVideoHistoryList', 'initUniRTC']),
642
648
  ...mapActions({
@@ -791,7 +797,7 @@ export default {
791
797
  this.status = status;
792
798
  clearInterval(this.heartTimer);
793
799
  // 不是“客服人员”,不用心跳连接
794
- if(!isService) return;
800
+ if (!isService) return;
795
801
  this.heartTimer = setInterval(() => {
796
802
  fetch.post(
797
803
  '/chat/service/sessionHeart',
@@ -1288,7 +1294,7 @@ export default {
1288
1294
  this.initUniRTC({
1289
1295
  ...data.obj,
1290
1296
  params: {
1291
- assemblyId: this.assemblyId,
1297
+ assemblyId: this.assemblyId
1292
1298
  }
1293
1299
  });
1294
1300
  }