cnhis-design-vue 2.1.157 → 2.1.159

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 (104) hide show
  1. package/CHANGELOG.md +55 -35
  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 +185 -107
  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 +9 -9
  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 +659 -573
  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 +56 -54
  71. package/es/scale-view/style.css +1 -1
  72. package/es/select/index.js +12 -12
  73. package/es/select-label/index.js +11 -11
  74. package/es/select-person/index.js +2 -2
  75. package/es/select-tag/index.js +4 -4
  76. package/es/shortcut-setter/index.js +10 -10
  77. package/es/skeleton/index.js +8 -8
  78. package/es/slider/index.js +8 -8
  79. package/es/slider-tree/index.js +9 -9
  80. package/es/space/index.js +8 -8
  81. package/es/spin/index.js +8 -8
  82. package/es/statistic/index.js +8 -8
  83. package/es/steps/index.js +8 -8
  84. package/es/switch/index.js +8 -8
  85. package/es/table-filter/index.js +269 -185
  86. package/es/table-filter/style.css +1 -1
  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 +637 -551
  98. package/lib/cui.umd.js +637 -551
  99. package/lib/cui.umd.min.js +18 -18
  100. package/package.json +1 -1
  101. package/packages/button/src/ButtonPrint/new.vue +77 -19
  102. package/packages/button/src/ButtonPrint/old.vue +32 -12
  103. package/packages/table-filter/src/mixins/printNew.js +35 -29
  104. package/packages/upload/chunk-upload/chunk-upload-new.vue +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.157",
3
+ "version": "2.1.159",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -1062,15 +1062,35 @@ export default create({
1062
1062
  },
1063
1063
  handleClickPrint(curPrintParamList, templateCode, templateId, formatId, printToParam=[], needContinuePrint) {
1064
1064
  let len = curPrintParamList.length;
1065
- const callLocalServicesSuccessCb = async data => {
1065
+ const successParams = [];
1066
+ const errorParams = [];
1067
+ const callLocalServicesSuccessErrorCb = async data => {
1066
1068
  try {
1069
+ if (data.printCbStatus) {
1070
+ successParams.push(data);
1071
+ } else {
1072
+ errorParams.push(data);
1073
+ }
1067
1074
  if (--len <= 0) {
1068
- this.callLocalServicesSuccessCb(data, 'print');
1075
+ if (errorParams.length == curPrintParamList.length) {
1076
+ this.callLocalServicesErrorCb(data, {
1077
+ successList: [],
1078
+ errorList: errorParams,
1079
+ isMulti: true
1080
+ });
1081
+ } else {
1082
+ this.callLocalServicesSuccessCb(data, 'print', {
1083
+ successList: successParams,
1084
+ errorList: errorParams,
1085
+ isMulti: true
1086
+ });
1087
+ }
1069
1088
  }
1070
1089
  } catch (error) {
1071
1090
  console.log('error', error);
1072
1091
  }
1073
1092
  };
1093
+
1074
1094
  if (this.getCurrentLoading() && !needContinuePrint) return;
1075
1095
  this.toggleExpandLoading(true, formatId);
1076
1096
  this.prevFn()
@@ -1111,20 +1131,53 @@ export default create({
1111
1131
  printdlgshow: this.printdlgshow
1112
1132
  };
1113
1133
  if (this.strategy === 'MULTI') {
1114
- // 循环多条
1115
- for (let i = 0; i < curPrintParamList.length; i++) {
1116
- if (i > 0) queryParams.printdlgshow = '0';
1117
- const params = JSON.stringify(Object.assign({}, JSON.parse(this.getPrintParams()), this.printCustomProps, curPrintParamList[i]));
1118
- this.printInstance.printDirect(
1119
- {
1120
- ...queryParams,
1121
- params
1122
- },
1123
- callLocalServicesSuccessCb,
1124
- this.callLocalServicesErrorCb,
1125
- this.callLocalServicesCancelCb
1126
- );
1134
+ // 循环剩余数据
1135
+ const multiOtherPrint = () => {
1136
+ for (let i = 1; i < curPrintParamList.length; i++) {
1137
+ queryParams.printdlgshow = '0';
1138
+ const params = JSON.stringify(Object.assign({}, JSON.parse(this.getPrintParams()), this.printCustomProps, curPrintParamList[i]));
1139
+ const originParam = this.findOriginParam(curPrintParamList[i], printToParam);
1140
+ this.printInstance.printDirect(
1141
+ {
1142
+ ...queryParams,
1143
+ params
1144
+ },
1145
+ (res) => {
1146
+ res.originPrintParam = originParam || undefined;
1147
+ res.printCbStatus = true;
1148
+ callLocalServicesSuccessErrorCb(res);
1149
+ },
1150
+ (error) => {
1151
+ error.originPrintParam = originParam || undefined;
1152
+ callLocalServicesSuccessErrorCb(error);
1153
+ },
1154
+ this.callLocalServicesCancelCb
1155
+ );
1156
+ }
1127
1157
  }
1158
+ // 先执行第一条如果取消了,则不再往下执行
1159
+ const params = JSON.stringify(Object.assign({}, JSON.parse(this.getPrintParams()), this.printCustomProps, curPrintParamList[0]));
1160
+ const originParam = this.findOriginParam(curPrintParamList[0], printToParam);
1161
+ this.printInstance.printDirect(
1162
+ {
1163
+ ...queryParams,
1164
+ params
1165
+ },
1166
+ (res) => {
1167
+ res.originPrintParam = originParam || undefined;
1168
+ res.printCbStatus = true;
1169
+ callLocalServicesSuccessErrorCb(res);
1170
+ multiOtherPrint();
1171
+ },
1172
+ (error) => {
1173
+ error.originPrintParam = originParam || undefined;
1174
+ callLocalServicesSuccessErrorCb(error);
1175
+ multiOtherPrint();
1176
+ },
1177
+ (res) => {
1178
+ this.callLocalServicesCancelCb(res);
1179
+ }
1180
+ );
1128
1181
  } else {
1129
1182
  // 聚合一条
1130
1183
  this.printInstance.printDirect(
@@ -1145,6 +1198,11 @@ export default create({
1145
1198
  }
1146
1199
  })
1147
1200
  },
1201
+
1202
+ findOriginParam(printParam, originParams) {
1203
+ const keys = Object.keys(printParam);
1204
+ return originParams.find(param => keys.every(key => printParam[key] == param[key]));
1205
+ },
1148
1206
  getHisParams(index = 0) {
1149
1207
  const { templateParams, hisParams, params } = this;
1150
1208
  const { reportid = '280' } = hisParams;
@@ -1311,7 +1369,7 @@ export default create({
1311
1369
  this.visible = false;
1312
1370
  },
1313
1371
  /* */
1314
- callLocalServicesSuccessCb(res, type) {
1372
+ callLocalServicesSuccessCb(res, type, config) {
1315
1373
  this.toggleExpandLoading(false);
1316
1374
  let info = {
1317
1375
  type,
@@ -1319,11 +1377,11 @@ export default create({
1319
1377
  templateId: res?.templateId || this.getTemplateIdByFormatId(this.currentFormatId),
1320
1378
  templateCode: res?.templateCode || this.getTemplateCodeByFormatId(this.currentFormatId),
1321
1379
  };
1322
- this.$emit('success', res, info);
1380
+ this.$emit('success', res, info, config);
1323
1381
  },
1324
- callLocalServicesErrorCb(res) {
1382
+ callLocalServicesErrorCb(res, config) {
1325
1383
  this.toggleExpandLoading(false);
1326
- this.$emit('error', res);
1384
+ this.$emit('error', res, config);
1327
1385
  },
1328
1386
  callLocalServicesCancelCb(res) {
1329
1387
  this.toggleExpandLoading(false);
@@ -578,19 +578,39 @@ export default create({
578
578
  printdlgshow: this.printdlgshow
579
579
  };
580
580
  if (this.strategy === 'MULTI') {
581
- // 循环多条
582
- for (let i = 0; i < this.printParams.length; i++) {
583
- if (i > 0) queryParams.printdlgshow = '0';
584
- this.printInstance.printDirect(
585
- {
586
- ...queryParams,
587
- params: this.getPrintParams(i)
588
- },
589
- callLocalServicesSuccessCb,
590
- this.callLocalServicesErrorCb,
591
- this.callLocalServicesCancelCb
592
- );
581
+ // 循环剩余数据
582
+ const multiOtherPrint = () => {
583
+ for (let i = 1; i < this.printParams.length; i++) {
584
+ queryParams.printdlgshow = '0';
585
+ this.printInstance.printDirect(
586
+ {
587
+ ...queryParams,
588
+ params: this.getPrintParams(i)
589
+ },
590
+ callLocalServicesSuccessCb,
591
+ this.callLocalServicesErrorCb,
592
+ this.callLocalServicesCancelCb
593
+ );
594
+ }
593
595
  }
596
+ // 先执行第一条如果取消了,则不再往下执行
597
+ this.printInstance.printDirect(
598
+ {
599
+ ...queryParams,
600
+ params: this.getPrintParams()
601
+ },
602
+ (res) => {
603
+ callLocalServicesSuccessCb(res);
604
+ multiOtherPrint();
605
+ },
606
+ (error) => {
607
+ this.callLocalServicesErrorCb(error);
608
+ multiOtherPrint();
609
+ },
610
+ (res) => {
611
+ this.callLocalServicesCancelCb(res);
612
+ }
613
+ );
594
614
  } else {
595
615
  // 聚合一条
596
616
  this.printInstance.printDirect(
@@ -143,39 +143,45 @@ export default {
143
143
  }
144
144
  return list;
145
145
  },
146
+ setBtnItemSetting(item, cItem, configObj) {
147
+ let printConfig = {
148
+ number: item.number,
149
+ authorizationKey: item.authorizationKey,
150
+ port: item.port,
151
+ versionType: item.versionType,
152
+ hisParams: { reportid: item.number },
153
+ id: item.id
154
+ };
155
+ cItem.__printConfig = printConfig;
156
+ if (!this.isLowCode) return;
157
+ let configItem = configObj[item.id] || {};
158
+ let outerPrintKeys = (configItem.formatIds && configItem.formatIds?.split(',').filter(Boolean)) || [];
159
+ let formatList = item.__printFormatByNumberData?.obj?.[0]?.format || [];
160
+ // 如果仅存在一个格式,哪怕没默认格式,按钮也展示 打印{格式名称},点击名称就是直接打印
161
+ let defaultFormatId = formatList.find(v => v.defaultFlag == 1)?.id || '';
162
+ // 低代码都走新的打印逻辑
163
+ let newPrintSetting = {
164
+ isShowPrintAll: false,
165
+ isShowOutSetting: true,
166
+ customProps: {},
167
+ outerPrintKeys,
168
+ defaultFormatId
169
+ };
170
+ cItem.__configItem = configItem || {};
171
+ cItem.__newPrintSetting = newPrintSetting;
172
+ cItem.__printFormatByNumberData = item.__printFormatByNumberData;
173
+ },
174
+
146
175
  setPrintNumberToBtnList(printNumberList = [], btnList = [], configObj = {}) {
147
176
  let cloneList = cloneDeep(btnList);
148
177
 
149
178
  printNumberList.forEach((item, index) => {
150
- const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
151
- if (!~i) return;
152
- let cItem = cloneList[i];
153
- let printConfig = {
154
- number: item.number,
155
- authorizationKey: item.authorizationKey,
156
- port: item.port,
157
- versionType: item.versionType,
158
- hisParams: { reportid: item.number },
159
- id: item.id
160
- };
161
- cItem.__printConfig = printConfig;
162
- if (!this.isLowCode) return;
163
- let configItem = configObj[item.id] || {};
164
- let outerPrintKeys = (configItem.formatIds && configItem.formatIds?.split(',').filter(Boolean)) || [];
165
- let formatList = item.__printFormatByNumberData?.obj?.[0]?.format || [];
166
- // 如果仅存在一个格式,哪怕没默认格式,按钮也展示 打印{格式名称},点击名称就是直接打印
167
- let defaultFormatId = formatList.find(v => v.defaultFlag == 1)?.id || '';
168
- // 低代码都走新的打印逻辑
169
- let newPrintSetting = {
170
- isShowPrintAll: false,
171
- isShowOutSetting: true,
172
- customProps: {},
173
- outerPrintKeys,
174
- defaultFormatId
175
- };
176
- cItem.__configItem = configItem || {};
177
- cItem.__newPrintSetting = newPrintSetting;
178
- cItem.__printFormatByNumberData = item.__printFormatByNumberData;
179
+ // 不能直接找index,因为可能多个print按钮配置了同一个trigger_id, 导致第二个一直无法赋值
180
+ const filterCList = cloneList.filter(v => v.settingObj?.[0]?.trigger_id == item.id);
181
+ if (!filterCList?.length) return;
182
+ filterCList.forEach(v => {
183
+ this.setBtnItemSetting(item, v, configObj);
184
+ });
179
185
  });
180
186
 
181
187
  return cloneList;
@@ -739,7 +739,8 @@ export default {
739
739
  return new Promise((resolve, reject) => {
740
740
  const obj = {
741
741
  ...data,
742
- ...this.uploadArguments
742
+ ...this.uploadArguments,
743
+ size: file.size,
743
744
  };
744
745
 
745
746
  instance