cnhis-design-vue 2.1.83 → 2.1.84

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 (99) hide show
  1. package/CHANGELOG.md +14 -2
  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 +134 -119
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +64 -58
  15. package/es/button/style.css +1 -1
  16. package/es/calendar/index.js +8 -8
  17. package/es/captcha/index.js +3 -3
  18. package/es/card/index.js +8 -8
  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/divider/index.js +8 -8
  30. package/es/drag-layout/index.js +3 -3
  31. package/es/drawer/index.js +8 -8
  32. package/es/dropdown/index.js +8 -8
  33. package/es/editor/index.js +1 -1
  34. package/es/ellipsis/index.js +1 -1
  35. package/es/empty/index.js +8 -8
  36. package/es/fabric-chart/index.js +9 -9
  37. package/es/form/index.js +8 -8
  38. package/es/form-model/index.js +8 -8
  39. package/es/form-table/index.js +66 -66
  40. package/es/index/index.js +505 -491
  41. package/es/index/style.css +1 -1
  42. package/es/input/index.js +9 -9
  43. package/es/input-number/index.js +8 -8
  44. package/es/layout/index.js +8 -8
  45. package/es/list/index.js +8 -8
  46. package/es/locale-provider/index.js +8 -8
  47. package/es/map/index.js +9 -9
  48. package/es/mentions/index.js +8 -8
  49. package/es/menu/index.js +8 -8
  50. package/es/message/index.js +8 -8
  51. package/es/multi-chat/index.js +76 -76
  52. package/es/multi-chat-client/index.js +70 -70
  53. package/es/multi-chat-history/index.js +4 -4
  54. package/es/multi-chat-record/index.js +14 -14
  55. package/es/multi-chat-setting/index.js +22 -22
  56. package/es/multi-chat-sip/index.js +1 -1
  57. package/es/notification/index.js +8 -8
  58. package/es/page-header/index.js +8 -8
  59. package/es/pagination/index.js +8 -8
  60. package/es/popconfirm/index.js +8 -8
  61. package/es/popover/index.js +8 -8
  62. package/es/progress/index.js +8 -8
  63. package/es/radio/index.js +9 -9
  64. package/es/rate/index.js +8 -8
  65. package/es/result/index.js +8 -8
  66. package/es/row/index.js +8 -8
  67. package/es/scale-container/index.js +1 -1
  68. package/es/scale-view/index.js +27 -27
  69. package/es/select/index.js +12 -12
  70. package/es/select-label/index.js +11 -11
  71. package/es/select-person/index.js +2 -2
  72. package/es/select-tag/index.js +4 -4
  73. package/es/shortcut-setter/index.js +10 -10
  74. package/es/skeleton/index.js +8 -8
  75. package/es/slider/index.js +8 -8
  76. package/es/space/index.js +8 -8
  77. package/es/spin/index.js +8 -8
  78. package/es/statistic/index.js +8 -8
  79. package/es/steps/index.js +8 -8
  80. package/es/switch/index.js +8 -8
  81. package/es/table-filter/index.js +91 -92
  82. package/es/table-filter/style.css +1 -1
  83. package/es/tabs/index.js +8 -8
  84. package/es/tag/index.js +9 -9
  85. package/es/time-picker/index.js +8 -8
  86. package/es/timeline/index.js +8 -8
  87. package/es/tooltip/index.js +8 -8
  88. package/es/transfer/index.js +8 -8
  89. package/es/tree/index.js +8 -8
  90. package/es/tree-select/index.js +8 -8
  91. package/es/upload/index.js +8 -8
  92. package/es/verification-code/index.js +2 -2
  93. package/lib/cui.common.js +499 -489
  94. package/lib/cui.umd.js +499 -489
  95. package/lib/cui.umd.min.js +23 -23
  96. package/package.json +1 -1
  97. package/packages/big-table/src/BigTable.vue +3 -3
  98. package/packages/big-table/src/components/AutoLayoutButton.vue +87 -64
  99. package/packages/button/src/ButtonPrint/index.vue +7 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.83",
3
+ "version": "2.1.84",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -3184,10 +3184,10 @@ export default create({
3184
3184
  },
3185
3185
 
3186
3186
  resizableChange({column }) {
3187
- let { property } =column || {}
3188
- if (property == "operatorColumn") {
3187
+ // let { property } =column || {}
3188
+ // if (property == "operatorColumn") {
3189
3189
  this.broadcastEvent('operatorColumn-resize');
3190
- }
3190
+ // }
3191
3191
  },
3192
3192
 
3193
3193
  onResize(){
@@ -45,7 +45,7 @@ export default {
45
45
  return function(item, key = 'name') {
46
46
  return item.alias || item[key];
47
47
  };
48
- },
48
+ }
49
49
  // showBtnList() {
50
50
  // if (!Array.isArray(this.btnList)) return [];
51
51
  // let res = this.btnList
@@ -69,9 +69,9 @@ export default {
69
69
  render() {
70
70
  const row = this.row;
71
71
  const index = this.index;
72
- if(window._talbe_row_btn_debugger){
73
- console.log(this.btnList,'----------------btnList')
74
- console.log(this.hideList,'----------------hideList')
72
+ if (window._talbe_row_btn_debugger) {
73
+ console.log(this.btnList, '----------------btnList');
74
+ console.log(this.hideList, '----------------hideList');
75
75
  }
76
76
  return (
77
77
  <div class="c_auto-layout-wrap" ref="layoutWrap">
@@ -87,8 +87,12 @@ export default {
87
87
  );
88
88
  },
89
89
  watch: {
90
- btnList:{
91
- handler(){
90
+ btnList: {
91
+ handler(val) {
92
+ if(this.compareArrays(val,this.cacheBtnList || [])){
93
+ return
94
+ }
95
+ this.cacheBtnList = val;
92
96
  this.reset();
93
97
  this.onResize();
94
98
  }
@@ -98,6 +102,7 @@ export default {
98
102
  created() {
99
103
  this.debouncePageResize = utils.debounce(this.handlePageResize, 300);
100
104
  this.attachEvent();
105
+ this.cacheBtnList = []
101
106
  },
102
107
  beforeMount() {},
103
108
  mounted() {
@@ -113,9 +118,14 @@ export default {
113
118
  let icon;
114
119
  if (btn.icon) {
115
120
  if (this.btnIcons[btn.icon]) {
116
- icon = <a-icon type={this.btnIcons[btn.icon]} style={{
117
- marginRight: mr
118
- }} />;
121
+ icon = (
122
+ <a-icon
123
+ type={this.btnIcons[btn.icon]}
124
+ style={{
125
+ marginRight: mr
126
+ }}
127
+ />
128
+ );
119
129
  } else {
120
130
  icon = (
121
131
  <a-tooltip title={this.handleName(btn)}>
@@ -185,72 +195,72 @@ export default {
185
195
  return b ? (
186
196
  <a-menu-item key={b.sid + j} class="c_dropdown-btn" on-click={e => this.clickBtn(row, b, index, e.domEvent, j)}>
187
197
  {this.getBtnIcon(b)}
188
- {b.showStyle === 'only_icon' ? '' : this.handleName(b)}
198
+ {b.showStyle === 'only_icon' ? '' : this.handleName(b)}
189
199
  </a-menu-item>
190
- ): null;
200
+ ) : null;
191
201
  })}
192
202
  </a-menu>
193
203
  </a-dropdown>
194
204
  );
195
205
  },
196
206
 
197
- async onResize() {
207
+ async onResize() {
198
208
  // utils.debounce(this.handlePageResize(), 300);
199
- this.$nextTick(()=>{
200
- this.debouncePageResize();
201
- });
209
+ this.$nextTick(() => {
210
+ this.debouncePageResize();
211
+ });
202
212
  },
203
213
 
204
214
  handlePageResize() {
205
- if(window._talbe_row_btn_debugger){
206
- console.log(this.btnList,'----------------handlePageResize')
215
+ if (window._talbe_row_btn_debugger) {
216
+ console.log(this.btnList, '----------------handlePageResize');
217
+ }
218
+ const layoutWrap = this.$refs.layoutWrap;
219
+ if (!layoutWrap) return;
220
+ let wrapWidth = layoutWrap.clientWidth;
221
+ let btnTotalWidth = 0;
222
+ let showBtnListWidth = 0;
223
+ let hideIndex = -1;
224
+ let len = this?.btnList?.length || 0;
225
+ let last = len - 1 > 0 ? len - 1 : 0;
226
+ this.btnList.forEach((btn, i) => {
227
+ // 记录宽度
228
+ let btnDom = this.$refs[`rowBtnItem${btn.sid}`];
229
+ if (btnDom && !this.btnShowWidthObj[btn.id]) {
230
+ this.btnShowWidthObj[btn.id] = btnDom?.$el?.offsetWidth || 0;
231
+ btn.btnClientWidth = btnDom?.$el?.offsetWidth || 0;
232
+ }
233
+ if (hideIndex > 0) {
234
+ btn.showType = '_hide';
235
+ return;
236
+ }
237
+ // 最后一个不用加
238
+ let mg = last == i ? 0 : 10;
239
+ btnTotalWidth += (this.btnShowWidthObj[btn.id] || 0) + mg;
240
+ if (btnTotalWidth < wrapWidth) {
241
+ btn.showType = '_show';
242
+ showBtnListWidth = btnTotalWidth;
243
+ } else {
244
+ btn.showType = '_hide';
245
+ hideIndex = i;
207
246
  }
208
- const layoutWrap = this.$refs.layoutWrap;
209
- if(!layoutWrap) return;
210
- let wrapWidth = layoutWrap.clientWidth;
211
- let btnTotalWidth = 0;
212
- let showBtnListWidth = 0;
213
- let hideIndex = -1;
214
- let len = this?.btnList?.length || 0;
215
- let last = len -1 > 0 ? len -1 : 0;
216
- this.btnList.forEach((btn, i) => {
217
- // 记录宽度
218
- let btnDom = this.$refs[`rowBtnItem${btn.sid}`];
219
- if (btnDom && !this.btnShowWidthObj[btn.id]) {
220
- this.btnShowWidthObj[btn.id] = btnDom?.$el?.offsetWidth || 0;
221
- btn.btnClientWidth = btnDom?.$el?.offsetWidth || 0;
222
- }
223
- if (hideIndex > 0) {
224
- btn.showType = '_hide';
225
- return;
226
- }
227
- // 最后一个不用加
228
- let mg = last == i ? 0: 10;
229
- btnTotalWidth += (this.btnShowWidthObj[btn.id] || 0) + mg;
230
- if (btnTotalWidth < (wrapWidth)) {
231
- btn.showType = '_show';
232
- showBtnListWidth = btnTotalWidth
233
- } else {
234
- btn.showType = '_hide';
235
- hideIndex = i;
236
- }
237
- });
238
- this.hideList = [];
239
- this.showList = [];
240
- this.btnList.forEach(btn => {
241
- if (btn.showType === '_hide') {
242
- this.hideList.push(btn);
243
- } else {
244
- this.showList.push(btn);
245
- }
246
- });
247
- // 边界处理
248
- // 如果有 hideList 有数据
249
- // 展示的按钮宽度和加上“更多按钮”的宽度大于容器的宽度,showList 最后一个按钮移动到 hideList
250
- if(this.hideList.length > 0 && (showBtnListWidth + 15 + 10 > wrapWidth)){
251
- let t = this.showList.pop();
252
- t && this.hideList.unshift(t);
247
+ });
248
+ this.hideList = [];
249
+ this.showList = [];
250
+ this.btnList.forEach(btn => {
251
+ if (btn.showType === '_hide') {
252
+ this.hideList.push(btn);
253
+ } else {
254
+ this.showList.push(btn);
253
255
  }
256
+ });
257
+ // 边界处理
258
+ // 如果有 hideList 有数据
259
+ // 展示的按钮宽度和加上“更多按钮”的宽度大于容器的宽度,showList 最后一个按钮移动到 hideList
260
+ if (this.hideList.length > 0 && showBtnListWidth + 15 + 10 > wrapWidth) {
261
+ let t = this.showList.pop();
262
+ t && this.hideList.unshift(t);
263
+ }
254
264
  },
255
265
 
256
266
  clickBtn(row, btn, index, e, j) {
@@ -265,10 +275,23 @@ export default {
265
275
  // });
266
276
  },
267
277
 
268
- reset(){
278
+ reset() {
269
279
  // 重置
270
280
  this.hideList = [];
271
281
  this.showList = [];
282
+ },
283
+ compareArrays(arr1, arr2) {
284
+ if (arr1.length !== arr2.length) {
285
+ return false;
286
+ }
287
+
288
+ for (var i = 0; i < arr1.length; i++) {
289
+ if (arr1[i].id !== arr2[i].id || arr1[i].updatedTime !== arr2[i].updatedTime) {
290
+ return false;
291
+ }
292
+ }
293
+
294
+ return true;
272
295
  }
273
296
  },
274
297
  components: {
@@ -301,7 +324,7 @@ export default {
301
324
  margin-left: 10px;
302
325
  }
303
326
  }
304
- .ant-dropdown-menu-item.c_dropdown-btn{
327
+ .ant-dropdown-menu-item.c_dropdown-btn {
305
328
  justify-content: flex-start;
306
329
  }
307
330
  </style>
@@ -379,22 +379,19 @@ export default create({
379
379
  });
380
380
  },
381
381
  formatDefaultVal(i, tableVal) {
382
- let val = i.defaultValue || '';
382
+ const formatMap = {
383
+ DATE: 'YYYY-MM-DD',
384
+ DATETIME: 'YYYY-MM-DD HH:mm:ss'
385
+ };
383
386
  let tVal = tableVal;
384
- if (i.type === 'NUMBER') {
385
- tVal = Number(tableVal) || 0;
386
- }
387
- if (i.type === 'DATE') {
388
- tVal = tableVal ? moment(tableVal).format('YYYY-MM-DD') : '';
389
- }
390
- if (i.type === 'DATETIME') {
391
- tVal = tableVal ? moment(tableVal).format('YYYY-MM-DD HH:mm:ss') : '';
387
+ if (Object.keys(formatMap).includes(i.type) && tableVal) {
388
+ tVal = moment(tableVal).format(formatMap[i.type]);
392
389
  }
393
390
  if (i.type === 'TEXT') {
394
391
  tVal = String(tableVal) || '';
395
392
  }
396
393
 
397
- return val ? val : tVal;
394
+ return i?.defaultValue || tVal || '';
398
395
  },
399
396
  formatParams({ customizeDataset = [], param = [] }, params = []) {
400
397
  return params.map(paramObj => {