cnhis-design-vue 2.1.66 → 2.1.68

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 (51) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +199 -119
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +2 -2
  6. package/es/captcha/index.js +3 -3
  7. package/es/checkbox/index.js +1 -1
  8. package/es/color-picker/index.js +1 -1
  9. package/es/drag-layout/index.js +3 -3
  10. package/es/editor/index.js +1 -1
  11. package/es/ellipsis/index.js +1 -1
  12. package/es/fabric-chart/index.js +368 -353
  13. package/es/form-table/index.js +20 -20
  14. package/es/index/index.js +793 -704
  15. package/es/index/style.css +1 -1
  16. package/es/input/index.js +1 -1
  17. package/es/map/index.js +1 -1
  18. package/es/multi-chat/index.js +25 -25
  19. package/es/multi-chat-client/index.js +19 -19
  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-container/index.js +1 -1
  26. package/es/scale-view/index.js +53 -53
  27. package/es/scale-view/style.css +1 -1
  28. package/es/select/index.js +4 -4
  29. package/es/select-label/index.js +3 -3
  30. package/es/select-person/index.js +2 -2
  31. package/es/shortcut-setter/index.js +2 -2
  32. package/es/table-filter/index.js +87 -93
  33. package/es/table-filter/style.css +1 -1
  34. package/es/tag/index.js +1 -1
  35. package/es/verification-code/index.js +2 -2
  36. package/lib/cui.common.js +1414 -18535
  37. package/lib/cui.umd.js +1414 -18535
  38. package/lib/cui.umd.min.js +147 -155
  39. package/package.json +1 -1
  40. package/packages/big-table/src/BigTable.vue +23 -4
  41. package/packages/big-table/src/assets/style/table-base.less +2 -1
  42. package/packages/big-table/src/components/AutoLayoutButton.vue +59 -31
  43. package/packages/big-table/src/utils/eventBroadcast.js +24 -0
  44. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +128 -110
  45. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +27 -20
  46. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +9 -8
  47. package/packages/fabric-chart/src/mixins/eventCommon.js +4 -4
  48. package/packages/fabric-chart/src/mixins/fabricCommon.js +8 -22
  49. package/packages/scale-view/formitem/r-choice.vue +29 -14
  50. package/packages/table-filter/src/base-search-com/BaseSearch.vue +6 -6
  51. package/packages/table-filter/src/quick-search/QuickSearch.vue +4 -4
@@ -127,12 +127,11 @@ export default {
127
127
  this.canvas.on('mouse:up', event => {
128
128
  if (event.button === 3) {
129
129
  const { x, y } = event.pointer;
130
- const { originX, originY, endX, endY } = this.$propItems();
131
- if (!(x < originX || x > endX || y < originY || y > endY)) {
130
+ if (this.isGridLimit(x, y)) {
132
131
  this.activeEvent = event;
133
- document.querySelector('.upper-canvas').addEventListener('contextmenu', this.addEventListenerContextmenu, true);
132
+ !this.isAddEventListenerContextmenu && document.querySelector('.upper-canvas').addEventListener('contextmenu', this.addEventListenerContextmenu, true);
133
+ this.isAddEventListenerContextmenu = true;
134
134
  }
135
- // this.willUpdateLine = line;
136
135
  }
137
136
  // 左键松开鼠标-批量删除
138
137
  this.isSelectArea = false;
@@ -464,7 +463,7 @@ export default {
464
463
  top: top - 5
465
464
  });
466
465
  };
467
- const isDraw = (isMaxOrMin, maxOrMin) => isMaxOrMin && (!maxOrMin?.flickerable || attr !== 'critical');
466
+ const isDraw = (isMaxOrMin, maxOrMin) => isMaxOrMin && !maxOrMin?.flickerable;
468
467
 
469
468
  if (isDraw(isMax, max)) {
470
469
  const line = drawLine(max);
@@ -490,7 +489,7 @@ export default {
490
489
  */
491
490
  drawPolyline(polyline, polylineIndex, polylineType, polylineTypeId) {
492
491
  const { originY, endY } = this.propItems;
493
- const { pointAttr, lineAttr, list = [], critical = {} } = polyline;
492
+ const { pointAttr, lineAttr, list = [], critical = {}, diffValue = {} } = polyline;
494
493
  this._iconClassName = polyline.type === 'img' && pointAttr.iconClassName ? pointAttr.iconClassName : '';
495
494
 
496
495
  const pointList = [];
@@ -566,17 +565,24 @@ export default {
566
565
  this.canvas.add(...lineList, ...res);
567
566
 
568
567
  // 缓存需要闪烁的节点
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));
568
+ setFlickerablePoints.call(this, critical);
569
+ setFlickerablePoints.call(this, diffValue);
570
+ function setFlickerablePoints(diffObj) {
571
+ const { max, min } = diffObj;
572
+ if (max?.flickerable || min?.flickerable) {
573
+ const maxVal = max?.value;
574
+ const minVal = min?.value;
575
+ if (maxVal && max?.flickerable) {
576
+ this.flickerablePoints.push(...res.filter(point => +point.__value >= +maxVal).filter(point => !this.flickerablePoints.some(_point => isSamePoint(point, _point))));
577
+ }
578
+ if (minVal && min?.flickerable) {
579
+ this.flickerablePoints.push(...res.filter(point => +point.__value <= +minVal).filter(point => !this.flickerablePoints.some(_point => isSamePoint(point, _point))));
580
+ }
578
581
  }
579
582
  }
583
+ function isSamePoint(point, _point) {
584
+ return point.polylineTypeId == _point.polylineTypeId && point.polylineIndex === _point.polylineIndex && point.pointIndex === _point.pointIndex;
585
+ }
580
586
  });
581
587
 
582
588
  const params = { polyline, polylineIndex, polylineType, polylineTypeId };
@@ -1015,14 +1021,15 @@ export default {
1015
1021
  }
1016
1022
  },
1017
1023
  // 打开右键菜单
1018
- openRightModal(event) {
1024
+ openRightModal() {
1025
+ const { clientX, pageX, clientY, pageY } = this.activeEvent.e;
1019
1026
  this.rightPos = {
1020
- clientX: event.e.clientX || event.e.pageX,
1021
- clientY: event.e.clientY || event.e.pageY
1027
+ clientX: clientX ?? pageX,
1028
+ clientY: clientY ?? pageY
1022
1029
  };
1023
1030
  this.isRightVisible = false;
1024
- const target = event.target;
1025
- const id = target ? target.id : '';
1031
+ const target = this.activeEvent.target;
1032
+ const id = target?.id || '';
1026
1033
  this.$nextTick(() => {
1027
1034
  if (id && id.includes('_polylinePoint_')) {
1028
1035
  this._currentPoint = target;
@@ -117,23 +117,24 @@ export default {
117
117
  this.canvas.on('mouse:up', event => {
118
118
  if (event.button === 3) {
119
119
  const { x, y } = event.pointer;
120
- const { originX, originY, endX, endY } = this.$propItems();
121
- if (!(x < originX || x > endX || y < originY || y > endY)) {
120
+ if (this.isGridLimit(x, y)) {
122
121
  this.activeEvent = event;
123
- document.querySelector('.upper-canvas').addEventListener('contextmenu', this.addEventListenerContextmenu, true);
122
+ !this.isAddEventListenerContextmenu && document.querySelector('.upper-canvas').addEventListener('contextmenu', this.addEventListenerContextmenu, true);
123
+ this.isAddEventListenerContextmenu = true;
124
124
  }
125
125
  }
126
126
  });
127
127
  },
128
128
  // 打开右键菜单
129
- openRightModal(event) {
129
+ openRightModal() {
130
+ const { clientX, pageX, clientY, pageY } = this.activeEvent.e;
130
131
  this.rightPos = {
131
- clientX: event.e.clientX || event.e.pageX,
132
- clientY: event.e.clientY || event.e.pageY
132
+ clientX: clientX ?? pageX,
133
+ clientY: clientY ?? pageY
133
134
  };
134
135
  this.isRightVisible = false;
135
- const target = event.target;
136
- const id = target ? target.id : '';
136
+ const target = this.activeEvent.target;
137
+ const id = target?.id || '';
137
138
  this.$nextTick(() => {
138
139
  if (id && id.includes('_other')) {
139
140
  this._currentPoint = target || '';
@@ -7,7 +7,8 @@ export default {
7
7
  y: 0
8
8
  },
9
9
  dropTimer: null,
10
- isRightVisible: false
10
+ isRightVisible: false,
11
+ isAddEventListenerContextmenu: false
11
12
  };
12
13
  },
13
14
  watch: {
@@ -79,13 +80,12 @@ export default {
79
80
  event.preventDefault();
80
81
  const x = event.offsetX;
81
82
  const y = event.offsetY;
82
- const { originX, originY, endX, endY } = this.$propItems();
83
- if (!(x < originX || x > endX || y < originY || y > endY)) {
83
+ if (this.isGridLimit(x, y)) {
84
84
  this._active = {
85
85
  left: x,
86
86
  top: y
87
87
  };
88
- this.openRightModal(this.activeEvent);
88
+ this.openRightModal();
89
89
  }
90
90
  return false;
91
91
  },
@@ -31,18 +31,6 @@ export default {
31
31
  }
32
32
  },
33
33
  methods: {
34
- // 根据x轴坐标获取对应的时间点
35
- // getXValue(left) {
36
- // const { xScaleList, xScaleCell, originX } = this.propItems;
37
- // const minScale = Math.min(...xScaleList);
38
- // const time = minScale + (left - originX) / xScaleCell;
39
- // let d = new Date(time);
40
- // const month = `00${d.getMonth() + 1}`.slice(-2);
41
- // const day = `00${d.getDate()}`.slice(-2);
42
- // const hours = `00${d.getHours()}`.slice(-2);
43
- // const minute = `00${d.getMinutes()}`.slice(-2);
44
- // return `${d.getFullYear()}-${month}-${day} ${hours}:${minute}`;
45
- // },
46
34
  getXValue(left) {
47
35
  const { xScaleCellList, originX, endX, xScaleList } = this.propItems;
48
36
  let time;
@@ -80,16 +68,14 @@ export default {
80
68
  !~index && (index = xScaleCellList.length);
81
69
  const obj = xScaleCellList[index - 1];
82
70
  return obj.x + (time - obj.time) / obj.xScaleTime;
71
+ },
72
+ isGridLimit(x, y) {
73
+ const { originX, originY, endX, endY } = this.propItems;
74
+ return x >= originX && x <= endX && y >= originY && y <= endY;
75
+ },
76
+ isTopTreeAndGridLimit(x, y) {
77
+ const { endX, endYTop, originYTop } = this.propItems;
78
+ return x >= 0 && x <= endX && y >= originYTop && y <= endYTop;
83
79
  }
84
- // // 根据时间戳计算x轴坐标
85
- // cumputedX(value) {
86
- // if (!value) {
87
- // return '';
88
- // }
89
- // const { xScaleList, xScaleCell, originX } = this.propItems;
90
- // const time = new Date(value).getTime();
91
- // const minScale = Math.min(...xScaleList);
92
- // return originX + (time - minScale) * xScaleCell;
93
- // },
94
80
  }
95
81
  };
@@ -17,6 +17,7 @@
17
17
  :value="o[choiceUseKey]"
18
18
  :disabled="isLock"
19
19
  :style="{ color: choiceColor(o) }"
20
+ :class="{'choice-radio-presuffix':showPreSuffix(o)}"
20
21
  >
21
22
  <template v-if="showImgWrap(o)">
22
23
  <span class="scale-choice-img-wrap" @click.stop.prevent>
@@ -28,11 +29,11 @@
28
29
  </template>
29
30
  <template>
30
31
  <template v-if="isRadioItem && showPreSuffix(o)">
31
- <span
32
+ <template
32
33
  v-if="o.prefix"
33
34
  class="prefix-span"
34
35
  :style="{ color: choiceColor(o) }"
35
- >{{ o.prefix }}</span>
36
+ >{{ o.prefix }}</template>
36
37
  <a-input
37
38
  v-model="optionsPreSuffixObj[o.key]"
38
39
  :disabled="isLock || inputLock"
@@ -40,11 +41,11 @@
40
41
  :style="{ color: choiceColor(o) }"
41
42
  placeholder="请输入"
42
43
  />
43
- <span
44
+ <template
44
45
  v-if="o.suffix"
45
46
  class="suffix-span"
46
47
  :style="{ color: choiceColor(o) }"
47
- >{{ o.suffix }}</span>
48
+ >{{ o.suffix }}</template>
48
49
  </template>
49
50
  <span v-else :style="{ color: choiceColor(o) }">{{ o.label }}</span>
50
51
  <a-input
@@ -76,6 +77,7 @@
76
77
  :value="o[choiceUseKey]"
77
78
  :disabled="isLock"
78
79
  :style="{ color: choiceColor(o) }"
80
+ :class="{'choice-checkbox-presuffix':showPreSuffix(o)}"
79
81
  >
80
82
  <template v-if="showImgWrap(o)">
81
83
  <span class="scale-choice-img-wrap" @click.stop.prevent>
@@ -87,11 +89,11 @@
87
89
  </template>
88
90
  <template>
89
91
  <template v-if="isCheckboxItem && showPreSuffix(o)">
90
- <span
92
+ <template
91
93
  v-if="o.prefix"
92
94
  class="prefix-span"
93
95
  :style="{ color: choiceColor(o) }"
94
- >{{ o.prefix }}</span>
96
+ >{{ o.prefix }}</template>
95
97
  <a-input
96
98
  v-model="optionsPreSuffixObj[o.key]"
97
99
  :disabled="isLock || inputLock"
@@ -99,11 +101,11 @@
99
101
  :style="{ color: choiceColor(o) }"
100
102
  placeholder="请输入"
101
103
  />
102
- <span
104
+ <template
103
105
  v-if="o.suffix"
104
106
  class="suffix-span"
105
107
  :style="{ color: choiceColor(o) }"
106
- >{{ o.suffix }}</span>
108
+ >{{ o.suffix }}</template>
107
109
  </template>
108
110
  <span
109
111
  v-else
@@ -630,13 +632,8 @@ export default {
630
632
  border-color: transparent !important;
631
633
  border-bottom: 1px solid #d9d9d9 !important;
632
634
  }
633
- .prefix-span {
634
- padding-right: 8px;
635
- }
636
- .suffix-span {
637
- padding-left: 8px;
638
- }
639
635
  }
636
+
640
637
  /deep/ .ant-select {
641
638
  min-width: 160px;
642
639
  }
@@ -726,6 +723,24 @@ export default {
726
723
  /deep/ .ant-checkbox-inner {
727
724
  vertical-align: top;
728
725
  }
726
+
727
+ /deep/ .choice-radio-presuffix,
728
+ /deep/ .choice-checkbox-presuffix {
729
+ width: 100%;
730
+ box-sizing: border-box;
731
+ > span:last-child {
732
+ display: inline-table;
733
+ width: calc(100% - 20px);
734
+ max-width: calc(100% - 20px);
735
+ flex-wrap: wrap;
736
+ }
737
+ input {
738
+ flex: unset;
739
+ width: unset;
740
+ max-width: 300px;
741
+ min-width: 80px;
742
+ }
743
+ }
729
744
  }
730
745
  }
731
746
  </style>
@@ -390,7 +390,7 @@
390
390
  import moment from 'moment';
391
391
  import 'moment/locale/zh-cn';
392
392
 
393
- import _ from 'lodash';
393
+ import cloneDeep from 'lodash/cloneDeep';
394
394
  import vexutils from '@/utils/vexutils';
395
395
  import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu } from 'ant-design-vue';
396
396
  import resize from 'vue-resize-directive';
@@ -1026,11 +1026,11 @@ export default create({
1026
1026
  if (!this.validConObj(obj, this.searchFieldList, this.searchFieldLimit)) return false;
1027
1027
  let copy = [];
1028
1028
  if (this.outSearchFieldList.length) {
1029
- copy = _.cloneDeep(this.outSearchFieldList, true);
1029
+ copy = cloneDeep(this.outSearchFieldList, true);
1030
1030
  }
1031
1031
  let copyRelation = [];
1032
1032
  if (this.outRelationQuickSearch.length) {
1033
- copyRelation = _.cloneDeep(this.outRelationQuickSearch, true);
1033
+ copyRelation = cloneDeep(this.outRelationQuickSearch, true);
1034
1034
  }
1035
1035
  this.$emit('onSave', obj, isOutFilter, copy, copyRelation, config);
1036
1036
  this.modalVisible = false;
@@ -1476,7 +1476,7 @@ export default create({
1476
1476
  if (!(btn.isShow == '1' && btn.type != 'LINK')) return;
1477
1477
  btn.isHide = false;
1478
1478
  btn.isButtonGroup = false;
1479
- let cloneBtn = _.cloneDeep(btn);
1479
+ let cloneBtn = cloneDeep(btn);
1480
1480
  this.setBtnStatus(cloneBtn);
1481
1481
  // 按钮自适应 即使折叠也平铺显示出来
1482
1482
  if (this.isShowSetting('buttonAdaption')) {
@@ -1758,7 +1758,7 @@ export default create({
1758
1758
  this.handlerInitSearchItem(item.fieldList);
1759
1759
  });
1760
1760
  if (this.lastOutSearchFieldList.length > 0) {
1761
- this.outSearchFieldList = _.cloneDeep(this.lastOutSearchFieldList);
1761
+ this.outSearchFieldList = cloneDeep(this.lastOutSearchFieldList);
1762
1762
  }
1763
1763
  if (this.lastOutRelationQuickSearch.length) {
1764
1764
  this.outRelationQuickSearch = this.$utils.clone(this.lastOutRelationQuickSearch, true);
@@ -1863,7 +1863,7 @@ export default create({
1863
1863
  return paramsArray;
1864
1864
  },
1865
1865
  setPrintNumberToBtnList(printNumberList = [], btnList = []) {
1866
- let cloneList = _.cloneDeep(btnList);
1866
+ let cloneList = cloneDeep(btnList);
1867
1867
 
1868
1868
  printNumberList.forEach((item, index) => {
1869
1869
  const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
@@ -728,7 +728,7 @@ import tableSearchCon from "../mixins/tableSearchCon";
728
728
  import moment from 'moment';
729
729
  import 'moment/locale/zh-cn';
730
730
  // antd
731
- import _ from 'lodash';
731
+ import cloneDeep from 'lodash/cloneDeep';
732
732
  import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu, Radio, Checkbox, Row, Tag, InputNumber, Col, Form, Modal, Tooltip } from 'ant-design-vue';
733
733
  import rangeAge from '../components/range-age/index';
734
734
  import multiSelect from '../components/multi-select/multi-select';
@@ -917,7 +917,7 @@ export default create({
917
917
  deep: true,
918
918
  handler(newVal) {
919
919
  if (newVal && this.lastQuickSearchData.length > 0) {
920
- this.quickSearch = _.cloneDeep(this.lastQuickSearchData);
920
+ this.quickSearch = cloneDeep(this.lastQuickSearchData);
921
921
  }
922
922
  }
923
923
  }
@@ -939,10 +939,10 @@ export default create({
939
939
  this.birthdayTeam = this.dateTeam.filter(
940
940
  item => item.con != "THIS_YEAR" && item.con != "NEXT_YEAR" && item.con != "UP_YEAR"
941
941
  );
942
- let copyList = _.cloneDeep(this.searchFieldList);
942
+ let copyList = cloneDeep(this.searchFieldList);
943
943
  let mySearchFieldList = copyList.filter(i => i.isShowSearch == 1 && i.filterExplicit != 1) || [];
944
944
  // let relationTableList = JSON.parse(JSON.stringify(this.relationTableList));
945
- let relationTableList = _.cloneDeep(this.relationTableList);
945
+ let relationTableList = cloneDeep(this.relationTableList);
946
946
 
947
947
  // 跨表
948
948
  let relationQuickSearch = relationTableList.map(item => {