cnhis-design-vue 2.1.143 → 2.1.144

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 (106) hide show
  1. package/CHANGELOG.md +28 -4
  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 +71 -71
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +474 -314
  14. package/es/button/style.css +1 -1
  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 +283 -149
  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 +4 -4
  42. package/es/index/index.js +1778 -1073
  43. package/es/index/style.css +1 -1
  44. package/es/input/index.js +9 -9
  45. package/es/input-number/index.js +8 -8
  46. package/es/layout/index.js +8 -8
  47. package/es/list/index.js +8 -8
  48. package/es/locale-provider/index.js +8 -8
  49. package/es/map/index.js +9 -9
  50. package/es/mentions/index.js +8 -8
  51. package/es/menu/index.js +8 -8
  52. package/es/message/index.js +8 -8
  53. package/es/multi-chat/index.js +76 -76
  54. package/es/multi-chat-client/index.js +70 -70
  55. package/es/multi-chat-history/index.js +4 -4
  56. package/es/multi-chat-record/index.js +14 -14
  57. package/es/multi-chat-setting/index.js +22 -22
  58. package/es/multi-chat-sip/index.js +1 -1
  59. package/es/notification/index.js +8 -8
  60. package/es/page-header/index.js +8 -8
  61. package/es/pagination/index.js +8 -8
  62. package/es/popconfirm/index.js +8 -8
  63. package/es/popover/index.js +8 -8
  64. package/es/progress/index.js +8 -8
  65. package/es/radio/index.js +9 -9
  66. package/es/rate/index.js +8 -8
  67. package/es/result/index.js +8 -8
  68. package/es/row/index.js +8 -8
  69. package/es/scale-container/index.js +9 -9
  70. package/es/scale-view/index.js +27 -27
  71. package/es/select/index.js +12 -12
  72. package/es/select-label/index.js +11 -11
  73. package/es/select-person/index.js +2 -2
  74. package/es/select-tag/index.js +4 -4
  75. package/es/shortcut-setter/index.js +10 -10
  76. package/es/skeleton/index.js +8 -8
  77. package/es/slider/index.js +8 -8
  78. package/es/slider-tree/index.js +9 -9
  79. package/es/space/index.js +8 -8
  80. package/es/spin/index.js +8 -8
  81. package/es/statistic/index.js +8 -8
  82. package/es/steps/index.js +8 -8
  83. package/es/switch/index.js +8 -8
  84. package/es/table-filter/index.js +1143 -572
  85. package/es/table-filter/style.css +1 -1
  86. package/es/tabs/index.js +8 -8
  87. package/es/tag/index.js +9 -9
  88. package/es/time-picker/index.js +8 -8
  89. package/es/timeline/index.js +8 -8
  90. package/es/tooltip/index.js +8 -8
  91. package/es/transfer/index.js +8 -8
  92. package/es/tree/index.js +8 -8
  93. package/es/tree-select/index.js +8 -8
  94. package/es/upload/index.js +8 -8
  95. package/es/verification-code/index.js +2 -2
  96. package/lib/cui.common.js +1743 -1064
  97. package/lib/cui.umd.js +1743 -1064
  98. package/lib/cui.umd.min.js +20 -20
  99. package/package.json +1 -1
  100. package/packages/button/src/ButtonPrint/index.vue +21 -13
  101. package/packages/button/src/ButtonPrint/new.vue +270 -291
  102. package/packages/button/src/ButtonPrint/old.vue +33 -4
  103. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +175 -85
  104. package/packages/fabric-chart/src/mixins/eventCommon.js +1 -1
  105. package/packages/table-filter/src/base-search-com/BaseSearch.vue +21 -71
  106. package/packages/table-filter/src/mixins/printNew.js +184 -0
@@ -8,16 +8,16 @@
8
8
  </a-menu-item>
9
9
  </a-sub-menu>
10
10
  <a-menu-divider />
11
- <a-menu-item @click="e => handleClickPrint(e)">
11
+ <a-menu-item @click="e => handleClickPrint(e)" v-if="!hideButtons.includes('printText')">
12
12
  {{ printText }}
13
13
  </a-menu-item>
14
- <a-menu-item @click="e => handleClickPreview(e)">
14
+ <a-menu-item @click="e => handleClickPreview(e)" v-if="!hideButtons.includes('previewText')">
15
15
  {{ previewText }}
16
16
  </a-menu-item>
17
- <a-menu-item @click="e => handleClickPdf(e)">
17
+ <a-menu-item @click="e => handleClickPdf(e)" v-if="isShowDownloadPdf">
18
18
  {{ pdfLoadText }}
19
19
  </a-menu-item>
20
- <a-menu-item @click="e => handleClickEdit(e)">
20
+ <a-menu-item @click="e => handleClickEdit(e)" v-if="isShowFormatEditText">
21
21
  {{ formatEditText }}
22
22
  </a-menu-item>
23
23
  </a-menu>
@@ -59,6 +59,8 @@ import axios from 'axios';
59
59
  import moment from 'moment';
60
60
  import vexutils from '@/utils/vexutils';
61
61
 
62
+ const downloadPdfCode = 'RY7.2.21.1.M2.G94181E';
63
+ const formatEditTextCode = 'RY7.2.21.1.M2.G33633A';
62
64
  export default create({
63
65
  name: 'button-print',
64
66
  components: {
@@ -165,6 +167,11 @@ export default create({
165
167
 
166
168
  getPrintParamsAfter: {
167
169
  type: Function
170
+ },
171
+ // 隐藏默认按钮配置。printText: 直接打印;previewText: 打印预览;downloadPdf:下载pdf;formatEditText:格式编辑。示例:hideButtons = ['formatEditText']
172
+ hideButtons: {
173
+ type: Array,
174
+ default: () => []
168
175
  }
169
176
  },
170
177
  computed: {
@@ -184,6 +191,18 @@ export default create({
184
191
  formatId: this.currentFormatId,
185
192
  templateId: this.getTemplateIdByFormatId(this.currentFormatId)
186
193
  };
194
+ },
195
+ // 展示下载pdf按钮
196
+ isShowDownloadPdf() {
197
+ const isShow = !this.hideButtons.includes('downloadPdf');
198
+ const settingShow = this.isShowOperation(downloadPdfCode);
199
+ return isShow && settingShow;
200
+ },
201
+ // 展示格式编辑按钮
202
+ isShowFormatEditText() {
203
+ const isShow = !this.hideButtons.includes('formatEditText');
204
+ const settingShow = this.isShowOperation(formatEditTextCode);
205
+ return isShow && settingShow;
187
206
  }
188
207
  },
189
208
  data() {
@@ -232,6 +251,16 @@ export default create({
232
251
  // getPopupContainer(triggerNode) {
233
252
  // return triggerNode.parentNode;
234
253
  // },
254
+ isShowOperation(code) {
255
+ const portalStr = sessionStorage.getItem('portal');
256
+ if (portalStr) {
257
+ const portal = JSON.parse(portalStr);
258
+ const limitObj = portal?.user?.currentRoleResourceObj || {};
259
+ const limitList = Object.keys(limitObj);
260
+ return limitList.includes(code)
261
+ }
262
+ return true;
263
+ },
235
264
  handleClickOutside() {
236
265
  this.visible = false;
237
266
  },
@@ -37,10 +37,17 @@ function resetPointColor(pointArr, color) {
37
37
  }
38
38
  });
39
39
  }
40
- const setPointLineColor = (point, color, conditionHasLine2) => {
41
- const line1Color = color === 'transparent' ? color : point.prevPoint?.__attrs?.lineAttr?.stroke || color;
42
- point.line1?.set({ stroke: line1Color });
43
- conditionHasLine2 && point.line2?.set({ stroke: color });
40
+ const setPointLineColor = (point, color, isRight) => {
41
+ const lineColor = color === 'transparent' ? color : isRight ? point.prevPoint?.__attrs?.lineAttr?.stroke || color : color;
42
+ if (isRight) {
43
+ point.line1?.set({ stroke: lineColor });
44
+ point.line2?.set({ stroke: color });
45
+ } else {
46
+ point.line2?.set({ stroke: lineColor });
47
+ point.line1?.set({ stroke: color });
48
+ }
49
+ // point.line2?.set({ stroke: color });
50
+ // conditionHasLine && point.line2?.set({ stroke: color });
44
51
  };
45
52
 
46
53
  const isEffectiveNode = node => {
@@ -833,6 +840,7 @@ export default {
833
840
  const lastPoint = this.addPointList[this.addPointList.length - 1];
834
841
  const position = this.polyline[point.polylineTypeId].position;
835
842
  const [firstPoint] = this.addPointList;
843
+ const isRight = lastPoint.left > point.originLeft;
836
844
  // 如果是重合/连线节点
837
845
  if (point.get('scaleX') !== point.scale) {
838
846
  const addOjb = {
@@ -848,17 +856,35 @@ export default {
848
856
  } else {
849
857
  this.addPointList.push(addOjb);
850
858
  }
851
- this.addPointList.forEach(v => Object.assign(v, { isConcat: true, concatIndex: this._concatIndex }));
852
- } else if (point.line2 || (point.nextPoint && lastPoint.left >= point.nextPoint.left)) {
859
+ if (!isRight) {
860
+ this.addPointList.unshift({
861
+ ...firstPoint,
862
+ value: {
863
+ time: this.getXValue(point.originLeft),
864
+ value: this.getYValue(position, point.originTop),
865
+ ...(point.__attrs?.key ? { key: point.__attrs.key } : {})
866
+ }
867
+ });
868
+ }
869
+
870
+ this.addPointList.forEach(v =>
871
+ Object.assign(v, { isConcat: true, concatIndex: isRight ? this._concatIndex : point.pointIndex, pointIndex: isRight ? point.pointIndex : this._concatPoint.pointIndex })
872
+ );
873
+ } else if (!isRight || (isRight && (point.line2 || (point.nextPoint && lastPoint.left >= point.nextPoint.left)))) {
853
874
  // 1、存在右连线 2、无右侧连线,并且存在下一个节点的情况
854
875
  this.addPointList = [];
855
876
  this.repaintPolyline(position, point.polylineIndex);
856
877
  return;
857
878
  }
858
- !point.line2 && firstPoint.left <= point.originLeft && this.addPointList.splice(0, 1);
859
879
  !point.id.includes('isTitle') && this.removePolyline(point.id);
880
+ if (isRight && !point.line2 && firstPoint.left <= point.originLeft) {
881
+ this.addPointList.splice(0, 1);
882
+ }
883
+ if (!isRight) {
884
+ this.addPointList.splice(-1, 1);
885
+ }
860
886
  if (this.addPointList.length > 0) {
861
- this.$emit('pointOperation', 'increasePointBatch', this.addPointList);
887
+ this.$emit('pointOperation', 'increasePointBatch', isRight ? this.addPointList : this.addPointList.reverse());
862
888
  this.addPointList = [];
863
889
  } else {
864
890
  this.repaintPolyline(position, point.polylineIndex);
@@ -875,41 +901,59 @@ export default {
875
901
  this.addPointList.push(data);
876
902
  },
877
903
  // 纠正线段坐标
878
- setLinePatch(point) {
904
+ setLinePatch(point, isRight) {
879
905
  const { originLeft, originTop } = point;
880
906
  for (let i = 0, len = this.addPointList.length; i < len; i++) {
881
907
  const currentPoint = this.addPointList[i];
882
908
  const prevPoint = this.addPointList[i - 1] || { left: point.prePoint?.left ?? originLeft, top: point.prePoint?.top ?? originTop };
883
909
  const currentPointObj = this.addPointObjList.find(obj => nearlyEqual(obj.left, currentPoint.left));
884
- if (!nearlyEqual(currentPointObj?.line1?.x1, prevPoint.left)) {
885
- currentPointObj?.line1?.set({
886
- x1: prevPoint.left,
887
- y1: prevPoint.top,
888
- x2: currentPoint.left,
889
- y2: currentPoint.top
890
- });
910
+ if (isRight) {
911
+ if (!nearlyEqual(currentPointObj?.line1?.x1, prevPoint.left)) {
912
+ currentPointObj?.line1?.set({
913
+ x1: prevPoint.left,
914
+ y1: prevPoint.top,
915
+ x2: currentPoint.left,
916
+ y2: currentPoint.top
917
+ });
918
+ }
919
+ } else {
920
+ if (!nearlyEqual(currentPointObj?.line2?.x2, prevPoint.left)) {
921
+ currentPointObj?.line1?.set({
922
+ x1: currentPoint.left,
923
+ y1: currentPoint.top,
924
+ x2: prevPoint.left,
925
+ y2: prevPoint.top
926
+ });
927
+ }
891
928
  }
892
929
  }
893
930
  },
894
931
  // 检查批量新增拖动过程中是否存在漏点的情况
895
- checkPoints(point) {
932
+ checkPoints(point, isRight) {
896
933
  const { originLeft, originTop, left, polylineTypeId } = point;
897
- const PointLens = Math.floor((left - originLeft) / this.spaceWidth);
934
+ const PointLens = Math.floor(Math.abs(left - originLeft) / this.spaceWidth);
898
935
  if (PointLens > 1 && this.addPointList?.length <= PointLens) {
899
936
  const position = this.polyline[polylineTypeId].position;
900
937
  for (let k = 0; k <= PointLens; k++) {
901
938
  if (k > 0) {
902
- const curLeft = originLeft + this.spaceWidth * k;
939
+ const spaceWidth = this.spaceWidth * k;
940
+ const curLeft = isRight ? originLeft + spaceWidth : originLeft - spaceWidth;
903
941
  // 判断this.addPointList中的left是否包含curLeft,不包含就说明是漏了
904
942
  const hasPoint = this.addPointList.some(p => nearlyEqual(p.left, curLeft));
905
- // const hasPoint = this.addPointList.some(v => v.left == curLeft);
906
943
  if (!hasPoint) {
907
944
  let index;
908
945
  const pointObj = this.addPointList.find((v, i) => {
909
- if (v.left > curLeft) {
910
- index = i;
946
+ if (isRight) {
947
+ if (v.left > curLeft) {
948
+ index = i;
949
+ }
950
+ return v.left > curLeft;
951
+ } else {
952
+ if (v.left < curLeft) {
953
+ index = i;
954
+ }
955
+ return v.left < curLeft;
911
956
  }
912
- return v.left > curLeft;
913
957
  });
914
958
  if (pointObj) {
915
959
  let cloneObj = JSON.parse(JSON.stringify(pointObj));
@@ -917,7 +961,7 @@ export default {
917
961
  left: originLeft,
918
962
  top: originTop
919
963
  };
920
- const len = ~~((pointObj.left - (curLeft - this.spaceWidth)) / this.spaceWidth);
964
+ const len = ~~(Math.abs(pointObj.left - curLeft) / this.spaceWidth) + 1;
921
965
  const spaceHeight = (pointObj.top - prePoint.top) / len;
922
966
  cloneObj.top = prePoint.top + spaceHeight;
923
967
  cloneObj.value.time = this.getXValue(curLeft);
@@ -925,14 +969,32 @@ export default {
925
969
  if (point.__attrs.key) cloneObj.value.key = point.__attrs.key;
926
970
  cloneObj.left = curLeft;
927
971
  this.addPointList.splice(index, 0, cloneObj);
928
- this.clonePoint(point, [prePoint.left, prePoint.top, cloneObj.left, cloneObj.top]);
972
+ this.clonePoint(point, [prePoint.left, prePoint.top, cloneObj.left, cloneObj.top], isRight);
929
973
  }
930
974
  }
931
975
  }
932
976
  }
933
977
  }
934
978
  // 纠正节点上的line1的坐标
935
- this.setLinePatch(point);
979
+ this.setLinePatch(point, isRight);
980
+ },
981
+ // 断点相连
982
+ concatPoint(point, target, left, top, n) {
983
+ const { left: targetLeft, top: targetTop } = target;
984
+ point.setCoords();
985
+ if (Math.abs(left - targetLeft) <= n && Math.abs(top - targetTop) <= n) {
986
+ point.set({
987
+ left: targetLeft,
988
+ top: targetTop,
989
+ scaleX: point.scale === 1 ? 2.5 : 0.1,
990
+ scaleY: point.scale === 1 ? 2.5 : 0.1
991
+ });
992
+ } else {
993
+ point.set({
994
+ scaleX: point.scale,
995
+ scaleY: point.scale
996
+ });
997
+ }
936
998
  },
937
999
  /**
938
1000
  * @description: 拖动批量新增节点
@@ -942,31 +1004,35 @@ export default {
942
1004
  addPoint(point) {
943
1005
  let { left, top, originLeft, originTop } = point;
944
1006
  const currentLeft = left;
945
-
1007
+ const isRight = currentLeft > originLeft;
946
1008
  const startLength = this.addPointList.length;
1009
+
947
1010
  const n = Math.min(this.spaceWidth / 2, 6); // 拖动范围,在需要增加节点的刻度左右吸入的范围值
948
- const residue = (left - originLeft) % this.spaceWidth;
1011
+ const residue = Math.abs(left - originLeft) % this.spaceWidth;
949
1012
 
950
- const condition = residue > 0 && (residue > this.spaceWidth - n || residue < n);
951
- const conditionNoLine2 = !point.line2 && left > originLeft;
952
- const conditionHasLine2 = point.line2 && left > originLeft + this.spaceWidth;
1013
+ const condition = residue > this.spaceWidth - n || residue < n;
1014
+ const condition2 = left > originLeft + this.spaceWidth;
1015
+ const conditionHasLeftPoint = point.prevPoint && left < originLeft - this.spaceWidth;
953
1016
 
954
- // if (!point.line2 && left > originLeft && condition) {
955
- if (condition && (conditionNoLine2 || conditionHasLine2)) {
956
- if (residue > this.spaceWidth - n) left = left - residue + this.spaceWidth;
957
- if (residue < n) left = left - residue;
1017
+ if (condition && (condition2 || conditionHasLeftPoint)) {
1018
+ if (isRight) {
1019
+ if (residue > this.spaceWidth - n) left = left - residue + this.spaceWidth;
1020
+ if (residue < n) left = left - residue;
1021
+ } else {
1022
+ if (residue > this.spaceWidth - n) left = left + residue - this.spaceWidth;
1023
+ if (residue < n) left = left + residue;
1024
+ }
958
1025
  point.set({
959
1026
  left
960
1027
  });
961
1028
 
962
- // const i = Math.floor((left - originLeft) / this.spaceWidth);
963
1029
  // 复制点和线
964
- if (conditionNoLine2 || conditionHasLine2) {
965
- // point.line1 && this.removePolyline(point.line1.id);
966
- setPointLineColor(point, 'transparent', conditionHasLine2);
967
- this.addPointList.length == 0 && this.clonePoint(point, [point.line1 ? point.line1.x1 : originLeft, point.line1 ? point.line1.y1 : originTop, originLeft, originTop]);
1030
+ if (condition2 || conditionHasLeftPoint) {
1031
+ setPointLineColor(point, 'transparent', isRight);
1032
+ const x1 = isRight ? point.line1?.x1 || originLeft : point.line2?.x2 || originLeft;
1033
+ const y1 = isRight ? point.line1?.y1 || originTop : point.line2?.y2 || originTop;
1034
+ this.addPointList.length == 0 && this.clonePoint(point, [x1, y1, originLeft, originTop]);
968
1035
  if (this.addPointList.every(v => !nearlyEqual(v.left, left))) {
969
- // const points1 = i === 1 ? [originLeft, originTop] : point.prePoints;
970
1036
  const points1 = this.addPointList.length == 0 ? [originLeft, originTop] : point.prePoints;
971
1037
  if (points1) {
972
1038
  // this.setAddPointList(point);
@@ -979,30 +1045,11 @@ export default {
979
1045
  // 避免重复添加
980
1046
  if (this.addPointObjList.every(o => !nearlyEqual(o.left, left))) {
981
1047
  this.addPointList.push(data);
982
- this.clonePoint(point, [...points1, left, top]);
1048
+ this.clonePoint(point, [...points1, left, top], isRight);
983
1049
  }
984
1050
  }
985
1051
  }
986
- this.checkPoints(point);
987
- }
988
- }
989
-
990
- // 断点相连
991
- function concatPoint(target) {
992
- const { left: targetLeft, top: targetTop } = target;
993
- point.setCoords();
994
- if (left >= targetLeft - n && left <= targetLeft + n && top <= targetTop + n && top >= targetTop - n) {
995
- point.set({
996
- left: targetLeft,
997
- top: targetTop,
998
- scaleX: point.scale === 1 ? 2.5 : 0.1,
999
- scaleY: point.scale === 1 ? 2.5 : 0.1
1000
- });
1001
- } else {
1002
- point.set({
1003
- scaleX: point.scale,
1004
- scaleY: point.scale
1005
- });
1052
+ this.checkPoints(point, isRight);
1006
1053
  }
1007
1054
  }
1008
1055
 
@@ -1011,55 +1058,94 @@ export default {
1011
1058
  const color = point.__attrs.lineAttr.stroke;
1012
1059
  const polylineObj = this.polylinePointList.find(v => v.polylineTypeId == polylineTypeId && v.polylineIndex == polylineIndex);
1013
1060
  polylineObj?.pointList.forEach(v => v.bringToFront());
1014
- if (point.nextPoint) {
1015
- this._concatIndex = polylineObj?.pointerList.findIndex(v => v + n > left && v > originLeft);
1061
+ if ((isRight && point.nextPoint) || (!isRight && point.prevPoint)) {
1062
+ if (isRight) {
1063
+ this._concatIndex = polylineObj?.pointerList.findIndex(l => l + n > left && l > originLeft);
1064
+ } else {
1065
+ const idx = polylineObj?.pointerList.toReversed().findIndex(l => l - n < left && l < originLeft);
1066
+ this._concatIndex = !~idx ? -1 : polylineObj?.pointerList.length - 1 - idx;
1067
+ }
1016
1068
  if (!~this._concatIndex) {
1017
1069
  point.set({
1018
1070
  scaleX: point.scale,
1019
1071
  scaleY: point.scale
1020
1072
  });
1021
1073
  } else {
1022
- concatPoint(polylineObj?.pointList[this._concatIndex]);
1074
+ this.concatPoint(point, polylineObj?.pointList[this._concatIndex], left, top, n);
1023
1075
  }
1024
1076
  this._concatPoint = polylineObj?.pointList?.[this._concatIndex] || null;
1025
1077
 
1026
1078
  // 被覆盖节点置灰配置
1027
- polylineObj?.pointerList.forEach((v, i) => {
1079
+ polylineObj?.pointerList.forEach((l, i) => {
1028
1080
  const obj = polylineObj?.pointList[i];
1029
- if (v > originLeft && v < left) {
1081
+ if ((isRight && l > originLeft && l < left) || (!isRight && l < originLeft && l > left)) {
1030
1082
  // 此处需要递归遍历group节点的所有子节点,然后更改其颜色
1031
1083
  resetPointColor([obj], '#999');
1032
- obj.line2?.set({ stroke: '#999' });
1084
+ isRight && obj.line2?.set({ stroke: '#999' });
1085
+ !isRight && obj.line1?.set({ stroke: '#999' });
1033
1086
  } else {
1034
1087
  const color = obj.__attrs.lineAttr.stroke;
1035
1088
  resetPointColor([obj], color);
1036
- obj.line2?.set({ stroke: color });
1089
+ isRight && obj.line2?.set({ stroke: color });
1090
+ !isRight && obj.line1?.set({ stroke: color });
1037
1091
  }
1038
1092
  });
1039
- if ((point.line1 || point.line2) && left < originLeft + this.spaceWidth) {
1040
- setPointLineColor(point, color, true);
1093
+ if ((point.line1 || point.line2) && Math.abs(left - originLeft) < this.spaceWidth) {
1094
+ setPointLineColor(point, color, isRight);
1041
1095
  } else {
1042
- setPointLineColor(point, 'transparent', true);
1096
+ setPointLineColor(point, 'transparent', isRight);
1043
1097
  }
1044
1098
  }
1045
1099
 
1046
1100
  // 如果往回拖动则删除经过的已存在的节点
1047
- if (startLength > 0 && currentLeft <= this.addPointList[startLength - 1].left) {
1048
- this.removePolyline('increasePointBatch', left);
1049
- this.addPointList = this.addPointList.filter(v => v.left < left);
1050
- const endLength = this.addPointList.length;
1051
- if (endLength === 0) {
1052
- setPointLineColor(point, color, conditionHasLine2);
1101
+ if (startLength > 0) {
1102
+ if (isRight) {
1103
+ this.removeLeftClonePoint(originLeft);
1104
+ this.addPointList = this.addPointList.filter(v => v.left >= originLeft);
1105
+ if (this.addPointList.length > 0 && currentLeft <= this.addPointList[this.addPointList.length - 1].left) {
1106
+ this.removePolyline('increasePointBatch', left);
1107
+ this.addPointList = this.addPointList.filter(v => v.left < left);
1108
+ const endLength = this.addPointList.length;
1109
+ if (endLength === 0) {
1110
+ setPointLineColor(point, color, isRight);
1111
+ this.removePolyline('increasePointBatch', originLeft);
1112
+ }
1113
+ if (endLength > 0) {
1114
+ point.set({
1115
+ prePoints: [this.addPointList[endLength - 1].left, this.addPointList[endLength - 1].top]
1116
+ });
1117
+ }
1118
+ }
1119
+ } else {
1053
1120
  this.removePolyline('increasePointBatch', originLeft);
1054
- }
1055
- if (endLength > 0) {
1056
- point.set({
1057
- prePoints: [this.addPointList[endLength - 1].left, this.addPointList[endLength - 1].top]
1058
- });
1121
+ this.addPointList = this.addPointList.filter(v => v.left <= originLeft);
1122
+ if (this.addPointList.length > 0 && currentLeft >= this.addPointList[this.addPointList.length - 1].left) {
1123
+ this.removeLeftClonePoint(left);
1124
+ this.addPointList = this.addPointList.filter(v => v.left > left);
1125
+ const endLength = this.addPointList.length;
1126
+ if (endLength === 0) {
1127
+ setPointLineColor(point, color, isRight);
1128
+ this.removeLeftClonePoint(originLeft);
1129
+ }
1130
+ if (endLength > 0) {
1131
+ point.set({
1132
+ prePoints: [this.addPointList[endLength - 1].left, this.addPointList[endLength - 1].top]
1133
+ });
1134
+ }
1135
+ }
1059
1136
  }
1060
1137
  }
1061
1138
  },
1062
- clonePoint(point, points) {
1139
+ removeLeftClonePoint(left) {
1140
+ this.addPointObjList.forEach(obj => {
1141
+ if (obj.left <= left) {
1142
+ this.canvas.remove(obj);
1143
+ obj.line2 && this.canvas.remove(obj.line2);
1144
+ }
1145
+ });
1146
+ this.addPointObjList = this.addPointObjList.filter(obj => obj.left > left);
1147
+ },
1148
+ clonePoint(point, points, isRight) {
1063
1149
  const { lineIndex, polylineIndex, lineAttr, polylineTypeId, originLeft } = point;
1064
1150
  const currentLineAttr = originLeft === points[2] && point.prevPoint ? point.prevPoint.__attrs.lineAttr : lineAttr;
1065
1151
 
@@ -1077,7 +1163,11 @@ export default {
1077
1163
  clonedObj.hasControls = clonedObj.hasBorders = false;
1078
1164
  point.prePoints = [point.left, point.top];
1079
1165
  const line = this.drawLine([...points], { evented: false, selectable: false, ...currentLineAttr, polylineIndex, polylineTypeId, lineIndex });
1080
- clonedObj.line1 = line;
1166
+ if (isRight) {
1167
+ clonedObj.line1 = line;
1168
+ } else {
1169
+ clonedObj.line2 = line;
1170
+ }
1081
1171
  this.canvas.add(clonedObj);
1082
1172
  this.canvas.sendBackwards(line);
1083
1173
  clonedObj.bringForward();
@@ -55,7 +55,7 @@ export default {
55
55
  point.setCoords(); // 需调用setCoords()才能重新计算控制位置(改变Object状态)
56
56
  // const objBoundingBox = point.getBoundingRect(); // 此方式会导致结果不精准,应该用point的top值判断
57
57
  const { originX, endX, originY, endY } = this.propItems;
58
- const leftLimit = point.prevPoint?.get('left') || originX;
58
+ const leftLimit = (isLimit && point.prevPoint?.get('left')) || originX;
59
59
  const rightLimit = (isLimit && point.nextPoint?.get('left')) || endX;
60
60
  if (point.top < originY) {
61
61
  point.set('top', originY);
@@ -311,10 +311,13 @@
311
311
  :authorizationKey="item.__printConfig && item.__printConfig.authorizationKey"
312
312
  :templateNumber="item.__printConfig && item.__printConfig.number"
313
313
  :hisParams="item.__printConfig && item.__printConfig.hisParams"
314
+ :newPrintSetting="item.__newPrintSetting"
315
+ :printFormatByNumberData="item.__printFormatByNumberData"
314
316
  :params="getPrintBtnParams(item)"
315
317
  :prevFn="() => printBtnPrevFn(clickRowData, item, 2, j)"
316
318
  @success="receivePrintSuccess"
317
319
  @error="receivePrintError"
320
+ @saveOuterPrint="(val) => saveOuterPrint(val, item)"
318
321
  ></PrintBtn>
319
322
  </template>
320
323
  </li>
@@ -439,6 +442,7 @@ import { durationMixin, $utils, filterApiFn, outQuickSearchFn, outQuickSearchDef
439
442
  import tableSearchCon from '../mixins/tableSearchCon';
440
443
  import OutQuickMethod from '../mixins/out-quick-method'
441
444
  import dynamicMethod from '../components/render-widget/mixins/dynamic-method'
445
+ import printNew from '../mixins/printNew'
442
446
  import svgIcon from '@/component/svg/index.vue';
443
447
  import 'text-security/text-security.css';
444
448
  import create from '@/core/create';
@@ -491,7 +495,7 @@ const BTNOBJ = {
491
495
 
492
496
  export default create({
493
497
  name: 'base-search',
494
- mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn, outQuickSearchDefCommon, OutQuickMethod, dynamicMethod],
498
+ mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn, outQuickSearchDefCommon, OutQuickMethod, dynamicMethod, printNew],
495
499
  directives: { resize, preventReClick },
496
500
  props: {
497
501
  width: {
@@ -687,6 +691,9 @@ export default create({
687
691
  }
688
692
  },
689
693
  computed: {
694
+ isLowCode() {
695
+ return this.libSource === 'lowCode';
696
+ },
690
697
  isOrgAdmin() {
691
698
  return this.isAdmin;
692
699
  },
@@ -1590,7 +1597,8 @@ export default create({
1590
1597
  });
1591
1598
 
1592
1599
  let printNumberList = (await this.getPrintNumber(rowPrintBtnList)) || [];
1593
- rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList);
1600
+ let configObj = await this.getPrintUserConfigReuqestAll(printNumberList, rowPrintBtnList)
1601
+ rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList, configObj);
1594
1602
  // this.rowPrintBtnList = rowPrintBtnList;
1595
1603
  // 添加批量打印策略:strategy: MULTI(循环多条, 默认值, 为空时使用该策略) ONCE(聚合一条)
1596
1604
  this.rowPrintBtnList = rowPrintBtnList.map(item => {
@@ -1968,77 +1976,14 @@ export default create({
1968
1976
  table: i
1969
1977
  };
1970
1978
  // paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
1971
- paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })));
1972
- });
1973
-
1974
- return paramsArray;
1975
- },
1976
- setPrintNumberToBtnList(printNumberList = [], btnList = []) {
1977
- let cloneList = cloneDeep(btnList);
1978
-
1979
- printNumberList.forEach((item, index) => {
1980
- const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
1981
- if (i > -1) {
1982
- cloneList[i].__printConfig = {
1983
- number: item.number,
1984
- authorizationKey: item.authorizationKey,
1985
- port: item.port,
1986
- versionType: item.versionType,
1987
- hisParams: { reportid: item.number }
1988
- };
1979
+ let resParams = utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })) || {}
1980
+ if(btn?.__printConfig?.number) {
1981
+ resParams.templateNumbers = [btn.__printConfig.number]
1989
1982
  }
1990
- // cloneList[index].__printConfig = {
1991
- // number: item.number,
1992
- // authorizationKey: item.authorizationKey,
1993
- // port: item.port,
1994
- // versionType: item.versionType,
1995
- // hisParams: { reportid: item.number }
1996
- // };
1983
+ paramsArray.push(resParams);
1997
1984
  });
1998
-
1999
- return cloneList;
2000
- },
2001
- async getPrintNumber(list) {
2002
- if (!list?.length) return;
2003
-
2004
- let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
2005
-
2006
- let printNumberCacheKeys = Object.keys(this.printNumberCache);
2007
- let haveCache = printNumberCacheKeys.includes(ids);
2008
- if (haveCache) {
2009
- let printNumberList = this.printNumberCache[ids];
2010
- this.printBtnStrategys = printNumberList;
2011
- return Promise.resolve(printNumberList);
2012
- }
2013
-
2014
- let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
2015
-
2016
- const { status, data } = res;
2017
- if (status) {
2018
- let resList = data?.list || [];
2019
- this.printBtnStrategys = resList;
2020
- list = resList.map(item => {
2021
- return {
2022
- number: item.number,
2023
- authorizationKey: data.authorizationKey,
2024
- versionType: data.versionType,
2025
- port: data.port,
2026
- id: item.id,
2027
- ...item
2028
- };
2029
- });
2030
- let len = list?.length || 0;
2031
- if (len > 0) {
2032
- this.setPrintNumberCache({
2033
- ids,
2034
- list
2035
- });
2036
- }
2037
-
2038
- return list;
2039
- }
2040
- return list;
2041
- },
1985
+ return paramsArray;
1986
+ },
2042
1987
  async receivePrintSuccessAboutPrint(res, info) {
2043
1988
  const printBtn = this.printBtn;
2044
1989
  const templateId = info.templateId;
@@ -2378,6 +2323,11 @@ export default create({
2378
2323
  justify-content: space-between;
2379
2324
  text-align: left;
2380
2325
  background: #fff;
2326
+ .rowPrintBtn-btn {
2327
+ /deep/ .newprint-button-outer {
2328
+ margin: 0px 8px 8px 0px;
2329
+ }
2330
+ }
2381
2331
  }
2382
2332
  .bease-left {
2383
2333
  display: flex;