cnhis-design-vue 2.1.123 → 2.1.126

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 (109) hide show
  1. package/CHANGELOG.md +31 -3
  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 +103 -104
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/card-reader-sdk/index.js +1 -1
  19. package/es/carousel/index.js +8 -8
  20. package/es/cascader/index.js +8 -8
  21. package/es/checkbox/index.js +9 -9
  22. package/es/col/index.js +8 -8
  23. package/es/collapse/index.js +8 -8
  24. package/es/color-picker/index.js +1 -1
  25. package/es/comment/index.js +8 -8
  26. package/es/config-provider/index.js +8 -8
  27. package/es/date-picker/index.js +8 -8
  28. package/es/descriptions/index.js +8 -8
  29. package/es/direct/index.js +16 -16
  30. package/es/divider/index.js +8 -8
  31. package/es/drag-layout/index.js +3 -3
  32. package/es/drawer/index.js +8 -8
  33. package/es/dropdown/index.js +8 -8
  34. package/es/editor/index.js +1 -1
  35. package/es/ellipsis/index.js +1 -1
  36. package/es/empty/index.js +8 -8
  37. package/es/fabric-chart/index.js +217 -91
  38. package/es/form/index.js +8 -8
  39. package/es/form-model/index.js +8 -8
  40. package/es/form-table/index.js +74 -74
  41. package/es/full-calendar/index.js +52 -52
  42. package/es/full-calendar/style.css +1 -1
  43. package/es/grid/index.js +12 -2
  44. package/es/index/index.js +719 -591
  45. package/es/index/style.css +1 -1
  46. package/es/input/index.js +9 -9
  47. package/es/input-number/index.js +8 -8
  48. package/es/layout/index.js +8 -8
  49. package/es/list/index.js +8 -8
  50. package/es/locale-provider/index.js +8 -8
  51. package/es/map/index.js +9 -9
  52. package/es/mentions/index.js +8 -8
  53. package/es/menu/index.js +8 -8
  54. package/es/message/index.js +8 -8
  55. package/es/multi-chat/index.js +76 -76
  56. package/es/multi-chat-client/index.js +70 -70
  57. package/es/multi-chat-history/index.js +4 -4
  58. package/es/multi-chat-record/index.js +14 -14
  59. package/es/multi-chat-setting/index.js +22 -22
  60. package/es/multi-chat-sip/index.js +1 -1
  61. package/es/notification/index.js +8 -8
  62. package/es/page-header/index.js +8 -8
  63. package/es/pagination/index.js +8 -8
  64. package/es/popconfirm/index.js +8 -8
  65. package/es/popover/index.js +8 -8
  66. package/es/progress/index.js +8 -8
  67. package/es/radio/index.js +9 -9
  68. package/es/rate/index.js +8 -8
  69. package/es/result/index.js +8 -8
  70. package/es/row/index.js +8 -8
  71. package/es/scale-container/index.js +9 -9
  72. package/es/scale-view/index.js +27 -27
  73. package/es/select/index.js +12 -12
  74. package/es/select-label/index.js +11 -11
  75. package/es/select-person/index.js +2 -2
  76. package/es/select-tag/index.js +4 -4
  77. package/es/shortcut-setter/index.js +10 -10
  78. package/es/skeleton/index.js +8 -8
  79. package/es/slider/index.js +8 -8
  80. package/es/slider-tree/index.js +9 -9
  81. package/es/space/index.js +8 -8
  82. package/es/spin/index.js +8 -8
  83. package/es/statistic/index.js +8 -8
  84. package/es/steps/index.js +8 -8
  85. package/es/switch/index.js +8 -8
  86. package/es/table-filter/index.js +65 -65
  87. package/es/tabs/index.js +8 -8
  88. package/es/tag/index.js +9 -9
  89. package/es/time-picker/index.js +8 -8
  90. package/es/timeline/index.js +8 -8
  91. package/es/tooltip/index.js +8 -8
  92. package/es/transfer/index.js +8 -8
  93. package/es/tree/index.js +8 -8
  94. package/es/tree-select/index.js +8 -8
  95. package/es/upload/index.js +8 -8
  96. package/es/verification-code/index.js +2 -2
  97. package/lib/cui.common.js +633 -477
  98. package/lib/cui.umd.js +633 -477
  99. package/lib/cui.umd.min.js +55 -55
  100. package/package.json +1 -1
  101. package/packages/big-table/src/BigTable.vue +6 -8
  102. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +4 -1
  103. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +5 -2
  104. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +80 -28
  105. package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +2 -6
  106. package/packages/fabric-chart/src/utils/index.js +8 -0
  107. package/packages/full-calendar/src/FullCalendar.vue +16 -11
  108. package/packages/full-calendar/src/components/ListTag.vue +6 -4
  109. package/packages/grid/src/grid.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.123",
3
+ "version": "2.1.126",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -2143,13 +2143,11 @@ export default create({
2143
2143
  let forbiddenBatchSelect = !this.checkMethod(data);
2144
2144
  // 如果该行禁止批量多选,则选择/取消单行 并触发单击事件
2145
2145
  if (this.selectType == 'checkbox' && forbiddenBatchSelect) {
2146
- /* 存在问题注释的代码
2147
- 选中“禁用”行,会把之前的选中数据清空
2148
- table?.setAllCheckboxRow(false);
2149
- */
2150
- const value = this.getRowClassName({ row }) == 'single--checked' ? [] : [row];
2146
+ // 选中“禁用”行,需要清空其它选择数据, 并且再次点击不要取消选中
2147
+ table?.setAllCheckboxRow(false);
2148
+ const value = [row];
2151
2149
  this.$set(this, 'checkedRows', value);
2152
- this.pubCheckChange(value);
2150
+ this.pubCheckChange(value, { forbiddenBatchSelect });
2153
2151
  this.$emit('handlerClickRow', row, rowIndex, { source, column, trigger });
2154
2152
  return;
2155
2153
  }
@@ -2493,13 +2491,13 @@ export default create({
2493
2491
 
2494
2492
  this.setCurrentCheckedLength();
2495
2493
  },
2496
- pubCheckChange(rows = []) {
2494
+ pubCheckChange(rows = [], config = {}) {
2497
2495
  this.treeTableLength = rows.filter(item => {
2498
2496
  let isGroupRow = vexutils.has(item, GROUP_TITLE_KEY);
2499
2497
  return !isGroupRow;
2500
2498
  }).length;
2501
2499
  this.visibleTreeCheck = rows.length > 1;
2502
- this.$emit('selectionChange', rows);
2500
+ this.$emit('selectionChange', rows, config);
2503
2501
  },
2504
2502
  setCurrentPageRowChecked() {
2505
2503
  let table = this.$refs.xGrid;
@@ -265,7 +265,10 @@ export default {
265
265
  const [preItem0] = lineList[j + 1];
266
266
  if (preItem0) {
267
267
  const preStartMinute = new Date(preItem0).getTime();
268
- if (preStartMinute > minMinute && preStartMinute <= maxMinute) rightLimit.x2 = this.computedX(preItem0);
268
+ if (preStartMinute > minMinute && preStartMinute <= maxMinute) {
269
+ rightLimit.x2 = this.computedX(preItem0);
270
+ if (!x2) leftLimit.x2 = rightLimit.x2;
271
+ }
269
272
  }
270
273
  }
271
274
 
@@ -610,7 +610,7 @@ export default {
610
610
  * @param {polylineIndex} 当前折线 index
611
611
  */
612
612
  drawPolyline(polyline, polylineIndex, polylineType, polylineTypeId) {
613
- const { originY, endY } = this.propItems;
613
+ const { originY, endY, xCellWidth, table } = this.propItems;
614
614
  const { list = [], critical = {}, diffValue = {} } = polyline;
615
615
 
616
616
  const pointList = [];
@@ -649,7 +649,10 @@ export default {
649
649
  let line;
650
650
  let point;
651
651
  let previousLine;
652
- line = points && nextPoint && !linePoints.data?.breakpoint ? this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr }) : null;
652
+ line =
653
+ !points || !nextPoint || linePoints.data?.breakpoint || (table.breakpoint && nextPoint[0] - points[0] > xCellWidth)
654
+ ? null
655
+ : this.drawLine([...points, ...nextPoint], { polylineIndex, polylineTypeId, lineIndex: index, ...lineAttr });
653
656
  previousLine = lineList[index - 1];
654
657
  const pointOthers = { polylineTypeId, polylineIndex, pointIndex: index, ...pointAttr, lineAttr };
655
658
  if (points) {
@@ -14,6 +14,8 @@ import DropPopup from '../components/DropPopup';
14
14
  import MouseRightClick from '../components/MouseRightClick';
15
15
  import eventCommon from '../mixins/eventCommon';
16
16
  import Bus from '../utils/bus';
17
+ import { cloneDeep } from 'lodash';
18
+ import { sortByTime } from '../utils';
17
19
 
18
20
  const rightClickNode = [
19
21
  { name: '修改', type: 'edit' },
@@ -65,6 +67,8 @@ export default {
65
67
  }
66
68
  },
67
69
  data() {
70
+ this.markData = sortByTime(cloneDeep(this.templateData.bottom?.list));
71
+ this.markObjs = [];
68
72
  return {
69
73
  leftStartX: 0,
70
74
  isDropVisible: false,
@@ -101,7 +105,7 @@ export default {
101
105
  // this.canvas.renderAll();
102
106
  if (this.templateData.bottom) {
103
107
  this.drawExtracorporealCirculation();
104
- this.drawBottomTextDataGroup(this.templateData.bottom);
108
+ this.drawBottomTextDataGroup();
105
109
  }
106
110
  },
107
111
  drawBorder() {
@@ -322,29 +326,33 @@ export default {
322
326
  };
323
327
  const left = this.computedX(v.time);
324
328
  title.dataList.push(left);
325
- const icon = await this.createPoint(_icon.type, {
326
- originX: 'center',
327
- left,
328
- ...item.style,
329
- ...(item.style ? { stroke: item.style.fill } : {}),
330
- ...(_icon.style || {}),
331
- ...commonOptions
332
- });
329
+ const icon =
330
+ !Reflect.has(_icon, 'show') || _icon.show
331
+ ? await this.createPoint(_icon.type, {
332
+ originX: 'center',
333
+ left,
334
+ ...item.style,
335
+ ...(item.style ? { stroke: item.style.fill } : {}),
336
+ ...(_icon.style || {}),
337
+ ...commonOptions
338
+ })
339
+ : null;
340
+ const iconHalfWidth = icon ? icon.width / 2 : 0;
333
341
  const text = new this.fabric.Text(String(v.value), {
334
342
  ...defaultVaule.style,
335
343
  ...defaultVaule.textStyle,
336
344
  ...item.style,
337
- left: left + icon.width / 2,
345
+ left: left + iconHalfWidth,
338
346
  name: v.value,
339
347
  ...commonOptions
340
348
  });
341
- const groupObj = new this.fabric.Group([icon, text], {
349
+ const groupObj = new this.fabric.Group(icon ? [icon, text] : [text], {
342
350
  id: `${index}_${i}_other_${Date.now()}`,
343
351
  lockMovementY: true,
344
352
  ...commonOptions,
345
353
  ...this.eventStyle,
346
354
  realLeft: left,
347
- iconHalfWidth: icon.width / 2
355
+ iconHalfWidth
348
356
  });
349
357
  if (prevPoint) {
350
358
  prevPoint.nextPoint = groupObj;
@@ -455,23 +463,19 @@ export default {
455
463
  return time >= minTime && time <= maxTime;
456
464
  },
457
465
  removeMark() {
458
- this.canvas.forEachObject(obj => {
459
- if (obj.type && obj.type === 'mark') {
460
- this.canvas.remove(obj);
461
- }
462
- });
466
+ this.markObjs.forEach(obj => this.canvas.remove(obj));
463
467
  },
464
- // 底部标记
465
- drawBottomTextDataGroup(obj) {
468
+ drawTopTotalLineAndTitle() {
469
+ const { bottom: obj, left: leftData } = this.templateData;
466
470
  const { endX, originX, endY, topTotal, markHeight } = this.propItems;
467
- if (!markHeight || !obj.list) {
471
+ if (!topTotal.width) {
468
472
  return;
469
473
  }
470
474
 
471
- topTotal.width && this.canvas.add(this.drawLine([endX, endY - 1, endX, endY + markHeight], { ...this.defaultRectStyle }));
472
- topTotal.width && this.canvas.add(this.drawLine([originX, endY + markHeight, endX, endY + markHeight], { ...this.defaultRectStyle }));
473
- // const textList = [];
474
- const marginLeft = this.templateData.left.leftYScalevalue.spaceGridNumber || defaultVaule.spaceGridNumber;
475
+ const line1 = this.drawLine([endX, endY - 1, endX, endY + markHeight], { ...this.defaultRectStyle });
476
+ const line2 = this.drawLine([originX, endY + markHeight, endX, endY + markHeight], { ...this.defaultRectStyle });
477
+
478
+ const marginLeft = leftData.leftYScalevalue.spaceGridNumber || defaultVaule.spaceGridNumber;
475
479
  const left = originX - marginLeft * 4; // 默认减去4倍的左边距,防止最左边的数据与名称显示重合了
476
480
  const title = new this.fabric.Text(String(obj.title), {
477
481
  ...defaultVaule.style,
@@ -483,14 +487,31 @@ export default {
483
487
  top: endY + markHeight / 2,
484
488
  type: 'mark'
485
489
  });
486
- this.canvas.add(title);
487
- // textList.push(title);
490
+ this.markObjs.push(title, line1, line2);
491
+ this.canvas.add(title, line1, line2);
492
+ },
493
+ // 底部标记
494
+ drawBottomTextDataGroup() {
495
+ const { bottom: obj } = this.templateData;
496
+ const { originX, endY, markHeight, xCellWidth } = this.propItems;
497
+ if (!markHeight || !this.markData?.length) {
498
+ return;
499
+ }
500
+ if (this.markObjs.length) {
501
+ [...this.markObjs].forEach(obj => this.canvas.remove(obj));
502
+ this.markObjs = [];
503
+ }
504
+
505
+ this.drawTopTotalLineAndTitle();
506
+
488
507
  const _endY = this.extracorporealCirculationHeight ? endY + this.extracorporealCirculationHeight : endY;
489
508
  const baseY = _endY + 2; // 目前固定10像素的下边距
490
509
  const baseYLimit = endY - 2; // 目前固定10像素的上边距
491
510
  const lineHeightText = (obj.style?.fontSize || 12) + 2;
492
511
  const lineHeightImg = (obj.iconStyle?.height || 12) + 2;
493
512
  const lineHeightSeq = (obj.seqStyle?.circle?.radius || 9) * 2 + 2;
513
+ let prevLeft = originX;
514
+ let prevCondition;
494
515
 
495
516
  const setTop = (lineHeight, i, condition) => {
496
517
  if (!~condition.limitIndex) {
@@ -507,12 +528,16 @@ export default {
507
528
  }
508
529
  return condition.y;
509
530
  };
510
- obj.list.forEach((item, index) => {
531
+ this.markData.forEach((item, index) => {
511
532
  const condition = {
512
533
  limitIndex: -1, // 标志点是否往上排列的标志,大于-1则表示需要往上排列
513
534
  y: baseY
514
535
  };
515
536
  const x = this.computedX(item[0]);
537
+ // 相隔小于或等于一个小格的宽度就继承上个时间标记的高度继续计算定位,即错位显示
538
+ if (x - prevLeft <= xCellWidth) {
539
+ Object.assign(condition, prevCondition);
540
+ }
516
541
  if (this.isLimit(item[0])) {
517
542
  const pointList = [];
518
543
  item[1].forEach(async (v, i) => {
@@ -546,7 +571,12 @@ export default {
546
571
  }
547
572
  }
548
573
  });
549
- Promise.all(pointList).then(res => this.canvas.add(...res));
574
+ prevLeft = x;
575
+ prevCondition = condition;
576
+ Promise.all(pointList).then(res => {
577
+ this.markObjs.push(...res);
578
+ this.canvas.add(...res);
579
+ });
550
580
  }
551
581
  });
552
582
  },
@@ -620,9 +650,31 @@ export default {
620
650
  newVal: this.getXValue(point.left)
621
651
  };
622
652
  this.$emit('markChange', value);
653
+ this.updateMarkData(value);
654
+ this.drawBottomTextDataGroup();
655
+ this.canvas.discardActiveObject();
623
656
  });
624
657
  }
625
658
  },
659
+ updateMarkData({ data, newVal }) {
660
+ const id = data.id;
661
+ let listIndex, index;
662
+ listIndex = this.markData.findIndex(v => {
663
+ const i = v[1].findIndex(k => k.data?.id === id);
664
+ i > -1 && (index = i);
665
+ return i > -1;
666
+ });
667
+ const obj = this.markData[listIndex][1].splice(index, 1)[0];
668
+ const newIndex = this.markData.findIndex(v => v[0] === newVal);
669
+ if (!~newIndex) {
670
+ this.markData.push([newVal, [obj]]);
671
+ } else {
672
+ this.markData[newIndex][1].push(obj);
673
+ }
674
+ const emptyIndex = this.markData.findIndex(v => v[1].length === 0);
675
+ !!~emptyIndex && this.markData.splice(emptyIndex, 1);
676
+ sortByTime(this.markData);
677
+ },
626
678
  moveLimit(point) {
627
679
  point.setCoords();
628
680
  const { originX, endX, originY, endY, markHeight } = this.propItems;
@@ -155,13 +155,9 @@ export default {
155
155
  this.$emit('extracorporealCirculationChange', params);
156
156
  const { index, key, data } = params;
157
157
  this.extracorporealCirculation.list[index][key] = data;
158
- this.drawExtracorporealCirculation(this.extracorporealCirculation);
158
+ this.drawExtracorporealCirculation();
159
159
  this.canvas.discardActiveObject();
160
- this.canvas.forEachObject(obj => {
161
- if (obj.type && obj.type === 'mark') {
162
- obj.bringForward();
163
- }
164
- });
160
+ this.markObjs.forEach(obj => obj.bringForward());
165
161
  });
166
162
  }
167
163
  },
@@ -79,3 +79,11 @@ export function getIntersectionPoint(a, b, c, d) {
79
79
  // 否则不相交
80
80
  return false;
81
81
  }
82
+
83
+ export function sortByTime(list = []) {
84
+ list.sort((a, b) => {
85
+ return Date.parse(a[0]) - Date.parse(b[0]);
86
+ });
87
+
88
+ return list;
89
+ }
@@ -473,7 +473,7 @@ export default create({
473
473
  });
474
474
  </script>
475
475
  <style lang="less" scoped>
476
- @primary-color: #2d7aff;
476
+ @main-color: #2563f4;
477
477
 
478
478
  .c-full-calendar {
479
479
  position: relative;
@@ -527,7 +527,7 @@ export default create({
527
527
  align-items: center;
528
528
  flex: 0 0 66px;
529
529
  padding: 0 5px;
530
- background: #f7f7f7;
530
+ background: #fff;
531
531
  .header-left {
532
532
  color: #212121;
533
533
  span {
@@ -543,19 +543,19 @@ export default create({
543
543
  border: 1px solid #d9d9d9;
544
544
  cursor: pointer;
545
545
  &:hover {
546
- color: #2d7aff;
546
+ color: @main-color;
547
547
  background: rgba(36, 116, 255, 0.1);
548
548
  border-color: rgba(36, 116, 255, 0.2);
549
549
  i {
550
- color: #2d7aff;
550
+ color: @main-color;
551
551
  }
552
552
  }
553
553
  &:active {
554
- color: #2d7aff;
554
+ color: @main-color;
555
555
  background: rgba(36, 116, 255, 0.2);
556
- border-color: #2d7aff;
556
+ border-color: @main-color;
557
557
  i {
558
- color: #2d7aff;
558
+ color: @main-color;
559
559
  }
560
560
  }
561
561
  &.disabled {
@@ -580,7 +580,7 @@ export default create({
580
580
  box-shadow: 1px 0 0 0 rgba(36, 116, 255, 0.2);
581
581
  }
582
582
  &:active {
583
- box-shadow: 1px 0 0 0 #2d7aff;
583
+ box-shadow: 1px 0 0 0 @main-color;
584
584
  }
585
585
  }
586
586
  .btn-next {
@@ -629,6 +629,10 @@ export default create({
629
629
  overflow-y: auto;
630
630
  box-sizing: border-box;
631
631
 
632
+ .fc-timegrid-divider {
633
+ display: none;
634
+ }
635
+
632
636
  .fc-header-toolbar {
633
637
  margin-bottom: 0;
634
638
  }
@@ -641,6 +645,7 @@ export default create({
641
645
 
642
646
  .fc-col-header-cell-cushion {
643
647
  font-weight: normal;
648
+ color: @main-color;
644
649
  & > span {
645
650
  padding: 10px 0;
646
651
  display: inline-block;
@@ -716,9 +721,9 @@ export default create({
716
721
  }
717
722
  }
718
723
  .fc-day-today .week-header {
719
- color: @primary-color;
724
+ color: @main-color;
720
725
  .week-day {
721
- color: @primary-color;
726
+ color: @main-color;
722
727
  }
723
728
  }
724
729
 
@@ -755,7 +760,7 @@ export default create({
755
760
  background-color: #f2f7ff;
756
761
  .fc-daygrid-day-number {
757
762
  color: #fff;
758
- background-color: #2d7aff;
763
+ background-color: @main-color;
759
764
  border-radius: 50%;
760
765
  }
761
766
  }
@@ -113,6 +113,8 @@ export default {
113
113
  };
114
114
  </script>
115
115
  <style lang="less" scoped>
116
+ @main-color: #2563f4;
117
+
116
118
  .list-tag {
117
119
  width: 100%;
118
120
  height: 100%;
@@ -136,19 +138,19 @@ export default {
136
138
  }
137
139
  &.active {
138
140
  .list-day {
139
- color: @primary-color;
141
+ color: @main-color;
140
142
  background: rgba(36, 116, 255, 0.1);
141
143
  }
142
144
  }
143
145
  &.curday {
144
146
  .list-day {
145
147
  color: #fff;
146
- background: @primary-color;
148
+ background: @main-color;
147
149
  &:hover {
148
- background: @primary-color;
150
+ background: @main-color;
149
151
  }
150
152
  }
151
- color: @primary-color;
153
+ color: @main-color;
152
154
  }
153
155
  .list-day {
154
156
  width: 36px;
@@ -6,10 +6,10 @@
6
6
  import Vue from 'vue';
7
7
  import 'xe-utils';
8
8
  import VXETable from 'vxe-table';
9
- import VXETablePluginAntd from 'vxe-table-plugin-antd'
9
+ import VXETablePluginAntd from 'vxe-table-plugin-antd';
10
10
  import Grid from 'vxe-table/lib/grid';
11
- // import 'vxe-table/lib/style.css';
12
- import 'vxe-table-plugin-antd/dist/style.css'
11
+ import 'vxe-table/lib/style.css';
12
+ import 'vxe-table-plugin-antd/dist/style.css';
13
13
 
14
14
  VXETable.use(VXETablePluginAntd);
15
15
  import create from '@/core/create';