cnhis-design-vue 3.4.0-beta.30 → 3.4.0-beta.33

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.
@@ -124,6 +124,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
124
124
  hidePreviewBtns: {
125
125
  type: StringConstructor;
126
126
  };
127
+ isShowResetPrinter: {
128
+ type: BooleanConstructor;
129
+ default: boolean;
130
+ };
127
131
  }>, {
128
132
  $attrs: {
129
133
  [x: string]: unknown;
@@ -251,6 +255,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
251
255
  hidePreviewBtns: {
252
256
  type: StringConstructor;
253
257
  };
258
+ isShowResetPrinter: {
259
+ type: BooleanConstructor;
260
+ default: boolean;
261
+ };
254
262
  }>> & Readonly<{
255
263
  onSuccess?: ((...args: any[]) => any) | undefined;
256
264
  onError?: ((...args: any[]) => any) | undefined;
@@ -1085,6 +1093,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1085
1093
  hidePreviewBtns: {
1086
1094
  type: StringConstructor;
1087
1095
  };
1096
+ isShowResetPrinter: {
1097
+ type: BooleanConstructor;
1098
+ };
1088
1099
  }>, {
1089
1100
  $attrs: {
1090
1101
  [x: string]: unknown;
@@ -1208,6 +1219,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1208
1219
  hidePreviewBtns: {
1209
1220
  type: StringConstructor;
1210
1221
  };
1222
+ isShowResetPrinter: {
1223
+ type: BooleanConstructor;
1224
+ };
1211
1225
  }>> & Readonly<{}> & {}>;
1212
1226
  emit: any;
1213
1227
  defaultFormatInfo: import("../../shared/types").AnyObject;
@@ -1247,6 +1261,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1247
1261
  handleClickPreview: () => Promise<void>;
1248
1262
  handleClickPdf: () => Promise<void>;
1249
1263
  handleClickEdit: () => void;
1264
+ handleResetPrinter: () => Promise<void>;
1250
1265
  handleSelect: (key: string, option: import("../../shared/types").AnyObject) => Promise<void>;
1251
1266
  handleClickOutside: () => void;
1252
1267
  instantiatePrintSDK: () => false | undefined;
@@ -1602,6 +1617,9 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1602
1617
  hidePreviewBtns: {
1603
1618
  type: StringConstructor;
1604
1619
  };
1620
+ isShowResetPrinter: {
1621
+ type: BooleanConstructor;
1622
+ };
1605
1623
  }>> & Readonly<{}>, {
1606
1624
  params: import("../../shared/types").AnyObject[];
1607
1625
  btnText: string;
@@ -1626,6 +1644,7 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1626
1644
  showLoading: boolean;
1627
1645
  hideButtons: unknown[];
1628
1646
  printCustomProps: Record<string, any>;
1647
+ isShowResetPrinter: boolean;
1629
1648
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
1630
1649
  getProps: import("vue").ComputedRef<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1631
1650
  printParams: {
@@ -1750,6 +1769,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1750
1769
  hidePreviewBtns: {
1751
1770
  type: StringConstructor;
1752
1771
  };
1772
+ isShowResetPrinter: {
1773
+ type: BooleanConstructor;
1774
+ default: boolean;
1775
+ };
1753
1776
  }>> & Readonly<{
1754
1777
  onSuccess?: ((...args: any[]) => any) | undefined;
1755
1778
  onError?: ((...args: any[]) => any) | undefined;
@@ -1887,6 +1910,10 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1887
1910
  hidePreviewBtns: {
1888
1911
  type: StringConstructor;
1889
1912
  };
1913
+ isShowResetPrinter: {
1914
+ type: BooleanConstructor;
1915
+ default: boolean;
1916
+ };
1890
1917
  }>> & Readonly<{
1891
1918
  onSuccess?: ((...args: any[]) => any) | undefined;
1892
1919
  onError?: ((...args: any[]) => any) | undefined;
@@ -1920,5 +1947,6 @@ declare const ButtonPrint: SFCWithInstall<import("vue").DefineComponent<import("
1920
1947
  printCustomProps: Record<string, any>;
1921
1948
  placement: string;
1922
1949
  newPrintSetting: Record<string, any>;
1950
+ isShowResetPrinter: boolean;
1923
1951
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
1924
1952
  export default ButtonPrint;
@@ -127,6 +127,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
127
127
  hidePreviewBtns: {
128
128
  type: StringConstructor;
129
129
  };
130
+ isShowResetPrinter: {
131
+ type: BooleanConstructor;
132
+ default: boolean;
133
+ };
130
134
  }>, {
131
135
  $attrs: {
132
136
  [x: string]: unknown;
@@ -257,6 +261,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
257
261
  hidePreviewBtns: {
258
262
  type: StringConstructor;
259
263
  };
264
+ isShowResetPrinter: {
265
+ type: BooleanConstructor;
266
+ default: boolean;
267
+ };
260
268
  }>> & Readonly<{
261
269
  onSuccess?: ((...args: any[]) => any) | undefined;
262
270
  onError?: ((...args: any[]) => any) | undefined;
@@ -1091,6 +1099,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1091
1099
  hidePreviewBtns: {
1092
1100
  type: StringConstructor;
1093
1101
  };
1102
+ isShowResetPrinter: {
1103
+ type: BooleanConstructor;
1104
+ };
1094
1105
  }>, {
1095
1106
  $attrs: {
1096
1107
  [x: string]: unknown;
@@ -1214,6 +1225,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1214
1225
  hidePreviewBtns: {
1215
1226
  type: StringConstructor;
1216
1227
  };
1228
+ isShowResetPrinter: {
1229
+ type: BooleanConstructor;
1230
+ };
1217
1231
  }>> & Readonly<{}> & {}>;
1218
1232
  emit: any;
1219
1233
  defaultFormatInfo: AnyObject;
@@ -1253,6 +1267,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1253
1267
  handleClickPreview: () => Promise<void>;
1254
1268
  handleClickPdf: () => Promise<void>;
1255
1269
  handleClickEdit: () => void;
1270
+ handleResetPrinter: () => Promise<void>;
1256
1271
  handleSelect: (key: string, option: AnyObject) => Promise<void>;
1257
1272
  handleClickOutside: () => void;
1258
1273
  instantiatePrintSDK: () => false | undefined;
@@ -1608,6 +1623,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1608
1623
  hidePreviewBtns: {
1609
1624
  type: StringConstructor;
1610
1625
  };
1626
+ isShowResetPrinter: {
1627
+ type: BooleanConstructor;
1628
+ };
1611
1629
  }>> & Readonly<{}>, {
1612
1630
  params: AnyObject[];
1613
1631
  btnText: string;
@@ -1632,6 +1650,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1632
1650
  showLoading: boolean;
1633
1651
  hideButtons: unknown[];
1634
1652
  printCustomProps: Record<string, any>;
1653
+ isShowResetPrinter: boolean;
1635
1654
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
1636
1655
  getProps: import("vue").ComputedRef<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1637
1656
  printParams: {
@@ -1759,6 +1778,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1759
1778
  hidePreviewBtns: {
1760
1779
  type: StringConstructor;
1761
1780
  };
1781
+ isShowResetPrinter: {
1782
+ type: BooleanConstructor;
1783
+ default: boolean;
1784
+ };
1762
1785
  }>> & Readonly<{
1763
1786
  onSuccess?: ((...args: any[]) => any) | undefined;
1764
1787
  onError?: ((...args: any[]) => any) | undefined;
@@ -1899,6 +1922,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1899
1922
  hidePreviewBtns: {
1900
1923
  type: StringConstructor;
1901
1924
  };
1925
+ isShowResetPrinter: {
1926
+ type: BooleanConstructor;
1927
+ default: boolean;
1928
+ };
1902
1929
  }>> & Readonly<{
1903
1930
  onSuccess?: ((...args: any[]) => any) | undefined;
1904
1931
  onError?: ((...args: any[]) => any) | undefined;
@@ -1932,5 +1959,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1932
1959
  printCustomProps: Record<string, any>;
1933
1960
  placement: string;
1934
1961
  newPrintSetting: Record<string, any>;
1962
+ isShowResetPrinter: boolean;
1935
1963
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1936
1964
  export default _default;
@@ -125,6 +125,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
125
125
  },
126
126
  hidePreviewBtns: {
127
127
  type: String
128
+ },
129
+ isShowResetPrinter: {
130
+ type: Boolean,
131
+ default: false
128
132
  }
129
133
  },
130
134
  emits: [
@@ -119,6 +119,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
119
119
  hidePreviewBtns: {
120
120
  type: StringConstructor;
121
121
  };
122
+ isShowResetPrinter: {
123
+ type: BooleanConstructor;
124
+ };
122
125
  }>, {
123
126
  $attrs: {
124
127
  [x: string]: unknown;
@@ -245,6 +248,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
245
248
  hidePreviewBtns: {
246
249
  type: StringConstructor;
247
250
  };
251
+ isShowResetPrinter: {
252
+ type: BooleanConstructor;
253
+ };
248
254
  }>> & Readonly<{}> & {}>;
249
255
  emit: any;
250
256
  defaultFormatInfo: AnyObject;
@@ -284,6 +290,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
284
290
  handleClickPreview: () => Promise<void>;
285
291
  handleClickPdf: () => Promise<void>;
286
292
  handleClickEdit: () => void;
293
+ handleResetPrinter: () => Promise<void>;
287
294
  handleSelect: (key: string, option: AnyObject) => Promise<void>;
288
295
  handleClickOutside: () => void;
289
296
  instantiatePrintSDK: () => false | undefined;
@@ -642,6 +649,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
642
649
  hidePreviewBtns: {
643
650
  type: StringConstructor;
644
651
  };
652
+ isShowResetPrinter: {
653
+ type: BooleanConstructor;
654
+ };
645
655
  }>> & Readonly<{}>, {
646
656
  params: AnyObject[];
647
657
  btnText: string;
@@ -666,5 +676,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
666
676
  showLoading: boolean;
667
677
  hideButtons: unknown[];
668
678
  printCustomProps: Record<string, any>;
679
+ isShowResetPrinter: boolean;
669
680
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
670
681
  export default _default;
@@ -125,6 +125,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
125
125
  },
126
126
  hidePreviewBtns: {
127
127
  type: String
128
+ },
129
+ isShowResetPrinter: {
130
+ type: Boolean
128
131
  }
129
132
  },
130
133
  setup(__props, {
@@ -167,6 +170,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
167
170
  }, {
168
171
  label: props.formatEditText,
169
172
  key: "formatEditText"
173
+ }, {
174
+ label: i18n("10010.1.484", "\u91CD\u7F6E\u6253\u5370\u673A"),
175
+ key: "resetPrinter"
170
176
  }, ...((_a = props.externalOptionConfig) == null ? void 0 : _a.options) || []]);
171
177
  const tempOptions = ref([]);
172
178
  const currentFormatItem = computed(() => {
@@ -433,6 +439,28 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
433
439
  state.spinning = false;
434
440
  });
435
441
  };
442
+ const handleResetPrinter = async () => {
443
+ if (props.showLoading && state.spinning)
444
+ return;
445
+ state.spinning = true;
446
+ props.prevFn("resetPrinter", {
447
+ formatId: state.currentFormatId,
448
+ templateId: getTemplateIdByFormatId.value
449
+ }).then(async () => {
450
+ const data = await printInstance.resetPrinter(state.currentFormatId, state.iReportExecuteMode);
451
+ state.spinning = false;
452
+ if ((data == null ? void 0 : data.result) == "success") {
453
+ $message.success((data == null ? void 0 : data.message) || i18n("10010.1.487", "\u91CD\u7F6E\u6253\u5370\u673A\u6210\u529F"));
454
+ return;
455
+ }
456
+ $message.warning((data == null ? void 0 : data.message) || i18n("10010.1.488", "\u91CD\u7F6E\u6253\u5370\u673A\u5931\u8D25"));
457
+ }).catch(() => {
458
+ prevFnError("resetPrinter");
459
+ state.spinning = false;
460
+ }).finally(() => {
461
+ state.visible = false;
462
+ });
463
+ };
436
464
  const handleSelect = async (key, option) => {
437
465
  var _a2, _b;
438
466
  switch (key) {
@@ -448,6 +476,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
448
476
  case "downloadPdf":
449
477
  handleClickPdf();
450
478
  break;
479
+ case "resetPrinter":
480
+ handleResetPrinter();
481
+ break;
451
482
  default: {
452
483
  state.visible = false;
453
484
  const formatObj = state.formatList.find((item) => item.id === key) || {};
@@ -548,6 +579,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
548
579
  if (isIReport(state.currentFormatId)) {
549
580
  options.value = tempOptions.value.filter((option) => option.key != "formatEditText");
550
581
  }
582
+ if (!props.isShowResetPrinter) {
583
+ options.value = options.value.filter((option) => option.key != "resetPrinter");
584
+ }
551
585
  };
552
586
  const formatFormatList = (list) => {
553
587
  let formatList = [];
@@ -74,7 +74,7 @@ function useLeft(canvas, propItems, emits, pointTipProps, moveLimit, setPopup, u
74
74
  list.forEach((item) => {
75
75
  var _a;
76
76
  const targetList = !item.linkKey ? item.list : (_a = list.find((_item) => _item.key === item.linkKey)) == null ? void 0 : _a.list;
77
- let firstPointLeft = originX;
77
+ let firstPointLeft = 0;
78
78
  targetList.find((k) => {
79
79
  let con = false;
80
80
  if (isEffectiveNode(k)) {
@@ -85,7 +85,7 @@ function useLeft(canvas, propItems, emits, pointTipProps, moveLimit, setPopup, u
85
85
  }
86
86
  return con;
87
87
  });
88
- item.limitRight = firstPointLeft - xCellWidth;
88
+ item.limitRight = firstPointLeft ? firstPointLeft - xCellWidth : endX;
89
89
  });
90
90
  const externalIconList = cloneDeep(left.externalIconList || []).map((item) => ({
91
91
  ...item,
@@ -107,7 +107,7 @@ function useLeft(canvas, propItems, emits, pointTipProps, moveLimit, setPopup, u
107
107
  leftX,
108
108
  topY,
109
109
  originX: "center",
110
- ...item.isExternal ? { evented: false, selectable: false } : {},
110
+ ...item.isExternal && { evented: false, selectable: false },
111
111
  origin: {
112
112
  linkKey: item.linkKey,
113
113
  limitRight: item.limitRight
@@ -35,9 +35,12 @@ function bindHeaderInfoAndFlatten(fieldList, depth) {
35
35
  Object.entries(fieldItem).forEach(([key, value]) => {
36
36
  if (!key.match(/^header_(\d+)$/))
37
37
  return;
38
+ if (key === `header_${depth}`)
39
+ return;
38
40
  if (value !== prevItem[key] || !value)
39
41
  return;
40
- if (key === `header_${depth}`)
42
+ const fieldKey = key + "_key";
43
+ if (fieldItem[fieldKey] && prevItem[fieldKey] && fieldItem[fieldKey] !== prevItem[fieldKey])
41
44
  return;
42
45
  fieldItem[`${key}_colspan`] = 0;
43
46
  fieldItem[`${key}_rowspan`] = 0;
@@ -47,6 +50,7 @@ function bindHeaderInfoAndFlatten(fieldList, depth) {
47
50
  function setHeaderInfo(field, depth2) {
48
51
  if (!field.parent) {
49
52
  field[`header_${depth2}`] = field.title;
53
+ field[`header_${depth2}_key`] = field.val_key;
50
54
  range(depth2 + 1).forEach((idx) => {
51
55
  field[`header_${idx}_colspan`] = idx === depth2 ? depth2 + 1 : 0;
52
56
  field[`header_${idx}_rowspan`] = idx === depth2 ? 1 : 0;
@@ -61,15 +65,17 @@ function bindHeaderInfoAndFlatten(fieldList, depth) {
61
65
  fieldLine.unshift(currentField);
62
66
  }
63
67
  range(depth2 + 1).forEach((index) => {
64
- var _a, _b;
68
+ var _a, _b, _c, _d;
65
69
  const item = fieldLine[index];
66
70
  if (!item) {
67
71
  field[`header_${index}`] = "";
72
+ field[`header_${index}_key`] = "";
68
73
  field[`header_${index}_colspan`] = 0;
69
74
  field[`header_${index}_rowspan`] = 0;
70
75
  return;
71
76
  }
72
77
  field[`header_${index}`] = (_b = (_a = fieldLine[index]) == null ? void 0 : _a.title) != null ? _b : "";
78
+ field[`header_${index}_key`] = (_d = (_c = fieldLine[index]) == null ? void 0 : _c.val_key) != null ? _d : "";
73
79
  field[`header_${index}_colspan`] = index < fieldDepth ? 1 : depth2 - fieldDepth + 1;
74
80
  field[`header_${index}_rowspan`] = getChildrenNum(item);
75
81
  });
@@ -1,5 +1,5 @@
1
1
  var name = "@cnhis-design-vue/shared";
2
- var version = "3.4.0-beta.30";
2
+ var version = "3.4.0-beta.33";
3
3
  var main = "index.ts";
4
4
  var peerDependencies = {
5
5
  "naive-ui": "^2.30.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.4.0-beta.30",
3
+ "version": "3.4.0-beta.33",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -73,5 +73,5 @@
73
73
  "iOS 7",
74
74
  "last 3 iOS versions"
75
75
  ],
76
- "gitHead": "5db80cf14a13537f6072106d3f97b61d3c1e1899"
76
+ "gitHead": "8354c1494663058951b0f3ec155d0d7032eaa938"
77
77
  }