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
@@ -0,0 +1,184 @@
1
+ import cloneDeep from 'lodash/cloneDeep';
2
+ export default {
3
+ data() {
4
+ return {
5
+ printConfigCache: {}
6
+ };
7
+ },
8
+ methods: {
9
+ setPrintConfigCache(key, value, isUpdate) {
10
+ let cacheItem = this.printConfigCache[key];
11
+ if (!cacheItem) {
12
+ if (isUpdate) return;
13
+ this.printConfigCache[key] = value;
14
+ return;
15
+ }
16
+ Object.assign(cacheItem, { ...value });
17
+ },
18
+ async handlePrintFormatByNumber(printItem) {
19
+ if (!this.isLowCode || !printItem?.number || !printItem?.authorizationKey) {
20
+ return;
21
+ }
22
+ let params = {
23
+ number: printItem.number,
24
+ authorizationKey: printItem.authorizationKey
25
+ };
26
+ let res = await this.handleGetConfigApi(params, 'requestGetPrintFormatByNumber');
27
+ return res;
28
+ },
29
+ async handlePrintNumberList(list, config) {
30
+ if (!list || !list.length) return [];
31
+ const { isNew, data } = config || {};
32
+ let i = 0,
33
+ item,
34
+ len = list.length;
35
+ let resList = [];
36
+ for (; i < len; i++) {
37
+ item = list[i];
38
+ let obj = { ...item };
39
+ if (isNew) {
40
+ obj = {
41
+ number: item.number,
42
+ authorizationKey: data?.authorizationKey,
43
+ port: data?.port,
44
+ versionType: data?.versionType,
45
+ id: item.id,
46
+ ...item
47
+ };
48
+ }
49
+ if (obj.versionType == 2) {
50
+ let formatRes = await this.handlePrintFormatByNumber(obj);
51
+ formatRes && (obj.__printFormatByNumberData = formatRes);
52
+ }
53
+ resList.push(obj);
54
+ }
55
+ return resList;
56
+ },
57
+ async saveOuterPrint(list, item) {
58
+ if (!item?.id) return;
59
+ let formatIds = '';
60
+ if (list.length) {
61
+ formatIds = list
62
+ .map(v => v.key)
63
+ .filter(Boolean)
64
+ .join(',');
65
+ }
66
+ let templateId = item.__printConfig?.id;
67
+ let params = {
68
+ // id: item.__configItem?.id,
69
+ buttonId: item.id,
70
+ templateId,
71
+ formatIds
72
+ };
73
+ let res = await this.handleGetConfigApi(params, 'requestSavePrintUserConfig');
74
+ if (!res) return;
75
+ // 保存成功后 打印按钮的宽度有调整, 如果是按钮自适应则需要重新计算按钮宽度
76
+ this.setPrintConfigCache(templateId, { formatIds }, true);
77
+ this.pageResize({ type: 'resize' });
78
+ },
79
+ async getPrintUserConfigReuqestAll(printNumberList = [], btnList = []) {
80
+ if (!this.isLowCode) return;
81
+ if (!printNumberList.length) return;
82
+ if (!btnList.length) return;
83
+ let reqList = [];
84
+ printNumberList.forEach((item, index) => {
85
+ let btnItem = btnList.find(v => v.settingObj[0].trigger_id == item.id);
86
+ if (!~btnItem) return;
87
+ let cacheItem = this.printConfigCache[item.id];
88
+ if (cacheItem) {
89
+ reqList.push(Promise.resolve({ [item.id]: cacheItem, _id: item.id }));
90
+ return;
91
+ }
92
+ let params = {
93
+ buttonId: btnItem.id,
94
+ templateId: item.id
95
+ };
96
+ reqList.push(this.handleGetConfigApi(params, 'requestGetPrintUserConfig'));
97
+ });
98
+ if (!reqList.length) return;
99
+ let res = await Promise.allSettled(reqList);
100
+ if (!res?.length) return;
101
+ let resObj = {};
102
+ res.map(v => {
103
+ if (v.status !== 'fulfilled' || !v.value || !Object.keys(v.value).length) return null;
104
+ let obj = v.value;
105
+ this.setPrintConfigCache(obj._id, obj[obj._id]);
106
+ Object.assign(resObj, { ...v.value });
107
+ });
108
+ return Promise.resolve(resObj);
109
+ },
110
+ async getPrintNumber(list) {
111
+ if (!list?.length) return;
112
+ let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
113
+
114
+ let printNumberCacheKeys = Object.keys(this.printNumberCache);
115
+ let haveCache = printNumberCacheKeys.includes(ids);
116
+ if (haveCache) {
117
+ let printNumberList = this.printNumberCache[ids];
118
+ let hasId = printNumberList?.length && printNumberList?.every(item => !!item.id);
119
+ if (hasId) {
120
+ this.printBtnStrategys = printNumberList;
121
+ let hasPrintFormat = printNumberList.every(item => !!item.__printFormatByNumberData);
122
+ if (!hasPrintFormat) {
123
+ printNumberList = await this.handlePrintNumberList(printNumberList);
124
+ }
125
+ return Promise.resolve(printNumberList);
126
+ }
127
+ }
128
+
129
+ let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
130
+ let newList = await this.handleGetByIdsList(res, { ids, list });
131
+ return Promise.resolve(newList);
132
+ },
133
+ async handleGetByIdsList(res, config) {
134
+ const { ids, list: oldList } = config;
135
+ const { status, data } = res;
136
+ if (!status) return oldList;
137
+ let resList = data?.list || [];
138
+ this.printBtnStrategys = resList;
139
+ let list = await this.handlePrintNumberList(resList, { isNew: true, data });
140
+ let len = list?.length || 0;
141
+ if (len) {
142
+ this.setPrintNumberCache({ ids, list });
143
+ }
144
+ return list;
145
+ },
146
+ setPrintNumberToBtnList(printNumberList = [], btnList = [], configObj = {}) {
147
+ let cloneList = cloneDeep(btnList);
148
+
149
+ 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
+ });
180
+
181
+ return cloneList;
182
+ }
183
+ }
184
+ };