cnhis-design-vue 2.1.51 → 2.1.53

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 (100) hide show
  1. package/CHANGELOG.md +32 -17
  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 +170 -116
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +64 -79
  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 +919 -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/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +9 -9
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/form-table/index.js +62 -62
  39. package/es/index/index.js +1155 -505
  40. package/es/index/style.css +1 -1
  41. package/es/input/index.js +9 -9
  42. package/es/input-number/index.js +8 -8
  43. package/es/layout/index.js +8 -8
  44. package/es/list/index.js +8 -8
  45. package/es/locale-provider/index.js +8 -8
  46. package/es/map/index.js +9 -9
  47. package/es/mentions/index.js +8 -8
  48. package/es/menu/index.js +8 -8
  49. package/es/message/index.js +8 -8
  50. package/es/multi-chat/index.js +75 -75
  51. package/es/multi-chat-client/index.js +69 -69
  52. package/es/multi-chat-history/index.js +4 -4
  53. package/es/multi-chat-record/index.js +14 -14
  54. package/es/multi-chat-setting/index.js +22 -22
  55. package/es/multi-chat-sip/index.js +1 -1
  56. package/es/notification/index.js +8 -8
  57. package/es/page-header/index.js +8 -8
  58. package/es/pagination/index.js +8 -8
  59. package/es/popconfirm/index.js +8 -8
  60. package/es/popover/index.js +8 -8
  61. package/es/progress/index.js +8 -8
  62. package/es/radio/index.js +9 -9
  63. package/es/rate/index.js +8 -8
  64. package/es/result/index.js +8 -8
  65. package/es/row/index.js +8 -8
  66. package/es/scale-view/index.js +33 -33
  67. package/es/select/index.js +12 -12
  68. package/es/select-label/index.js +11 -11
  69. package/es/select-person/index.js +2 -2
  70. package/es/shortcut-setter/index.js +10 -10
  71. package/es/skeleton/index.js +8 -8
  72. package/es/slider/index.js +8 -8
  73. package/es/space/index.js +8 -8
  74. package/es/spin/index.js +8 -8
  75. package/es/statistic/index.js +8 -8
  76. package/es/steps/index.js +8 -8
  77. package/es/switch/index.js +8 -8
  78. package/es/table-filter/index.js +89 -104
  79. package/es/table-filter/style.css +1 -1
  80. package/es/tabs/index.js +8 -8
  81. package/es/tag/index.js +9 -9
  82. package/es/time-picker/index.js +8 -8
  83. package/es/timeline/index.js +8 -8
  84. package/es/tooltip/index.js +8 -8
  85. package/es/transfer/index.js +8 -8
  86. package/es/tree/index.js +8 -8
  87. package/es/tree-select/index.js +8 -8
  88. package/es/upload/index.js +8 -8
  89. package/es/verification-code/index.js +2 -2
  90. package/lib/cui.common.js +1571 -967
  91. package/lib/cui.umd.js +1571 -967
  92. package/lib/cui.umd.min.js +22 -22
  93. package/package.json +1 -1
  94. package/packages/big-table/src/BigTable.vue +59 -17
  95. package/packages/big-table/src/utils/bigTableProps.js +12 -8
  96. package/packages/button/src/ButtonPrint/index.vue +48 -59
  97. package/packages/date-picker/index.js +2 -0
  98. package/packages/date-picker/src/utils/index.js +374 -0
  99. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  100. package/packages/scale-view/scaleView.vue +2010 -2010
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.51",
3
+ "version": "2.1.53",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -98,6 +98,7 @@
98
98
  iconOpen: 'iconfont icon-a-xitongtubiaozhediejian',
99
99
  iconClose: 'iconfont icon-a-xitongtubiaotianjia'
100
100
  }"
101
+ :row-config="{ isCurrent: true }"
101
102
  v-bind="tableAttrs"
102
103
  >
103
104
  <template v-slot:empty>
@@ -2278,6 +2279,10 @@ export default create({
2278
2279
  },
2279
2280
  // 行双击
2280
2281
  rowdblclick({ row, column }) {
2282
+ // 2022/12/12 方晶晶要求 列表相关项在底部展示时, 去除双击事件, 只触发单击事件
2283
+ if (this.aboutPositionBtm) {
2284
+ return false;
2285
+ }
2281
2286
  if (this.isScanMultiTable || this.isInlineOperating) return false;
2282
2287
  if (vexutils.has(row, GROUP_TITLE_KEY)) return false;
2283
2288
  this.$emit('setNestTableClick', this.isNestTable);
@@ -2292,7 +2297,7 @@ export default create({
2292
2297
  // 嵌套表与主表click切换时需要清除上次的选中
2293
2298
  this.isAboutNestTable && this.$emit('resetNestLastClickTable', table);
2294
2299
 
2295
- let { row, $event = {}, rowIndex, source } = data;
2300
+ let { row, $event = {}, rowIndex, source, column } = data;
2296
2301
  // 点击主表格展开行按钮 不需要触发选中行
2297
2302
  let { className } = $event.target || {};
2298
2303
  if (className && vexutils.isString(className) && className.includes('vxe-table--expand-btn')) return;
@@ -2319,7 +2324,7 @@ export default create({
2319
2324
  const value = this.getRowClassName({ row }) == 'single--checked' ? [] : [row];
2320
2325
  this.$set(this, 'checkedRows', value);
2321
2326
  this.pubCheckChange(value);
2322
- this.$emit('handlerClickRow', row, rowIndex, {source});
2327
+ this.$emit('handlerClickRow', row, rowIndex, {source, column});
2323
2328
  return;
2324
2329
  }
2325
2330
  this.visibleCheckAllWrap = false;
@@ -2368,7 +2373,8 @@ export default create({
2368
2373
  }
2369
2374
  this.updateAddCheckedRows(rowVal, true);
2370
2375
  // 需要选中行
2371
- this.$emit('handlerClickRow', rowVal, rowIndex, {source});
2376
+ this.$emit('handlerClickRow', rowVal, rowIndex, {source, column});
2377
+ this.setTableCurrentRow(table, row)
2372
2378
  return;
2373
2379
  }
2374
2380
  let newTheUniqueKeyArr = [];
@@ -2380,41 +2386,59 @@ export default create({
2380
2386
  rowLen = checkedRow.filter(item => !vexutils.has(item, GROUP_TITLE_KEY)).length;
2381
2387
  }
2382
2388
  }
2383
- table.setAllCheckboxRow(false);
2389
+
2390
+ // 相关项位于底部,再次点击已选中数据不取消勾选
2391
+ let btmNotClear = rowLen < 2 && checked
2392
+ !btmNotClear && table.setAllCheckboxRow(false);
2384
2393
  // 全选后/数据大于一条 单击行只剩这一行 取消其他
2385
2394
  // 只有一条选中 单击行 取消选中
2386
2395
  let setChecked = checked;
2387
2396
  if (rowLen > 1) {
2388
2397
  this.selectType != 'radio' && table.setCheckboxRow([row], true);
2389
2398
  this.isTree != 0 && this.selectType != 'radio' && this.pubCheckChange(newRow);
2390
- this.selectType != 'radio' && this.$emit('handlerClickRow', row, rowIndex, {source});
2399
+ this.selectType != 'radio' && this.$emit('handlerClickRow', row, rowIndex, {source, column});
2391
2400
  } else {
2392
2401
  setChecked = !setChecked;
2393
2402
  if (!setChecked) {
2394
- table.clearCurrentRow();
2403
+ !this.aboutPositionBtm && table.clearCurrentRow();
2395
2404
  this.selectType == 'radio' && table.clearRadioRow();
2396
2405
  this.isTree != 0 && this.selectType != 'radio' && this.pubCheckChange([]);
2397
2406
  } else {
2398
2407
  this.selectType == 'radio' && table.setRadioRow(row);
2399
2408
  this.isTree != 0 && this.selectType != 'radio' && this.pubCheckChange(newRow);
2400
2409
  }
2401
- this.selectType != 'radio' && table.setCheckboxRow([row], setChecked);
2410
+ // 相关项位于底部,再次点击已选中数据不取消勾选
2411
+ let isBtmCheck = this.aboutPositionBtm && !setChecked
2412
+ if (this.selectType != 'radio' && !isBtmCheck) {
2413
+ table.setCheckboxRow([row], setChecked);
2414
+ }
2402
2415
  }
2403
2416
  if (this.isTree != 0) {
2404
- setChecked && this.$emit('handlerClickRow', row, rowIndex, {source});
2417
+ setChecked && this.$emit('handlerClickRow', row, rowIndex, {source, column});
2418
+ this.setTableCurrentRow(table, row)
2405
2419
  return;
2406
2420
  }
2407
2421
 
2408
2422
  this.setCheckedMehod(setChecked, row);
2409
- if (setChecked || rowLen > 1 || !rowLen) {
2410
- this.$set(this, 'checkedRows', [row]);
2411
- }
2412
- if (!setChecked && rowLen === 1) {
2413
- this.$set(this, 'checkedRows', []);
2414
- }
2423
+
2424
+ // 选中row
2425
+ let curCheckedRow = table.getCheckboxRecords();
2426
+ this.$set(this, 'checkedRows', curCheckedRow);
2427
+
2415
2428
  this.setCurrentCheckedLength();
2416
2429
  this.lastPageIndex = this.pageVO.pageIndex;
2417
2430
  setChecked && this.$emit('handlerClickRow', row, rowIndex, {source});
2431
+ this.setTableCurrentRow(table, row)
2432
+ },
2433
+ setBtmDbClick(row){
2434
+ if(!row) return;
2435
+ let id = row[this.handleRowId]
2436
+ if(!id) return;
2437
+ let table = this.$refs.xGrid;
2438
+ if (!table) return;
2439
+ let curRow = table?.getRowById(id);
2440
+ if(!curRow) return
2441
+ this.handlerClickRow({row: curRow})
2418
2442
  },
2419
2443
  /**
2420
2444
  * 单选行数据 树结构 扁平化处理
@@ -2465,6 +2489,11 @@ export default create({
2465
2489
  return;
2466
2490
  }
2467
2491
  if (this.currentCheckedKeys.includes(row[this.primaryKey])) {
2492
+ // 关项位于底部,再次点击已选中数据不取消勾选,批量及行级按钮要显示 且 重新加载该数据相关项
2493
+ if(this.aboutPositionBtm) {
2494
+ this.$emit('preRowdblclick', row, {}, true, true)
2495
+ return;
2496
+ }
2468
2497
  this.removeCheckedRows([row]);
2469
2498
  return;
2470
2499
  }
@@ -2549,11 +2578,22 @@ export default create({
2549
2578
  this.pubCheckChange(records);
2550
2579
  return true;
2551
2580
  },
2581
+ setTableCurrentRow(table, row) {
2582
+ if(!this.aboutPositionBtm) return
2583
+ setTimeout(() => {
2584
+ table.setCurrentRow(row);
2585
+ }, 30)
2586
+ },
2552
2587
  selectionChange({ checked, row, records }) {
2553
2588
  // HACK: 防止点击多选框时,触发cell-click(行选中)事件
2554
2589
  // $event.stopPropagation、$event.preventDefault,点击多选框列的空白处触发多选事件,无法阻止事件冒泡触发cell-click事件
2555
2590
  let table = this.$refs.xGrid;
2556
- table.clearCurrentRow();
2591
+
2592
+ // 相关项在底部,只选中一条的情况下,复选框不让去掉
2593
+ if (this.aboutPositionBtm && this.checkedRows?.length === 1 && !checked) {
2594
+ return false;
2595
+ }
2596
+
2557
2597
  this.isTriggerSelectionChange = true;
2558
2598
  setTimeout(() => {
2559
2599
  this.isTriggerSelectionChange = false;
@@ -2562,8 +2602,10 @@ export default create({
2562
2602
  if (this.treeTableSelectionChange(records)) return;
2563
2603
 
2564
2604
  if (checked) {
2605
+ this.setTableCurrentRow(table, row)
2565
2606
  this.addCheckedRows([row]);
2566
2607
  } else {
2608
+ table.clearCurrentRow();
2567
2609
  this.removeCheckedRows([row], true);
2568
2610
  }
2569
2611
 
@@ -2614,7 +2656,7 @@ export default create({
2614
2656
  this.$emit('selectionChangeAll');
2615
2657
  },
2616
2658
  handleCancelAllCheck() {
2617
- this.$emit('selectionChangeAllCancel');
2659
+ this.$emit('selectionChangeAllCancel', {type: 'cancelAll'});
2618
2660
  },
2619
2661
  setCurrentCheckedLength() {
2620
2662
  let table = this.$refs.xGrid;
@@ -2692,7 +2734,7 @@ export default create({
2692
2734
  let isCheckedByCheckboxRow = vxeTable.isCheckedByCheckboxRow(row);
2693
2735
  // 不冒泡 手动触发方法
2694
2736
  if (!isCheckedByCheckboxRow) {
2695
- this.handlerClickRow({row, rowIndex: index, source:'linkDetail'})
2737
+ this.handlerClickRow({row, rowIndex: index, source:'linkDetail', column: col})
2696
2738
  }
2697
2739
  e.stopPropagation();
2698
2740
  vxeTable.setCurrentRow(row);
@@ -73,11 +73,13 @@ const bigTableProps = {
73
73
  isMatchComponent: { type: Boolean, default: true }, // 为了兼容低代码(组件内部)与二次开发平台(vuex)
74
74
  asyncCount: Boolean,
75
75
  showSettings: { type: Object, default: () => ({}) },
76
- filterDomPortal: { // 表头筛选挂载的地方
76
+ filterDomPortal: {
77
+ // 表头筛选挂载的地方
77
78
  type: String,
78
- default: "body"
79
+ default: 'body'
79
80
  },
80
- filterTopOffset: { // 表头 top 调节
81
+ filterTopOffset: {
82
+ // 表头 top 调节
81
83
  type: Number,
82
84
  default: 0
83
85
  },
@@ -85,15 +87,17 @@ const bigTableProps = {
85
87
  defaultEditAllRow: Boolean,
86
88
  editTableUid: [String, Number],
87
89
  curBatchBtnData: { type: Object, default: () => ({}) },
88
- rowBtnAutoLayout:{// 行内按钮自适应布局
90
+ rowBtnAutoLayout: {
91
+ // 行内按钮自适应布局
89
92
  type: Boolean,
90
93
  default: true
91
94
  },
92
- listCountParams:{ type: Object, default: () => ({}) },
93
- tableProps:{
95
+ listCountParams: { type: Object, default: () => ({}) },
96
+ tableProps: {
94
97
  type: Object,
95
- default:()=>({})
96
- }
98
+ default: () => ({})
99
+ },
100
+ aboutPositionBtm: { type: Boolean, default: true }
97
101
  };
98
102
 
99
103
  export default bigTableProps;
@@ -148,16 +148,16 @@ export default create({
148
148
  default: '0'
149
149
  },
150
150
  // 没有模板提示
151
- noformatTips:{
151
+ noformatTips: {
152
152
  type: String,
153
153
  default: ''
154
154
  },
155
155
 
156
- getOnceParamsAfter:{
156
+ getOnceParamsAfter: {
157
157
  type: Function
158
158
  },
159
159
 
160
- getPrintParamsAfter:{
160
+ getPrintParamsAfter: {
161
161
  type: Function
162
162
  }
163
163
  },
@@ -170,8 +170,14 @@ export default create({
170
170
  formatTitle() {
171
171
  return this.currentFormatItem?.name || '格式选择';
172
172
  },
173
- printExtraParams(){
174
- return this?.printConfig?.printExtraParams || {};
173
+ printExtraParams() {
174
+ return this?.printConfig?.printExtraParams || {};
175
+ },
176
+ queryParams() {
177
+ return {
178
+ formatId: this.currentFormatId,
179
+ templateId: this.getTemplateIdByFormatId(this.currentFormatId)
180
+ };
175
181
  }
176
182
  },
177
183
  data() {
@@ -278,7 +284,7 @@ export default create({
278
284
  this.currentFormatId = this.getDefaultFormatId(this.formatList, 'defaultFlag');
279
285
 
280
286
  if (!this.currentFormatId) {
281
- this.$message.error(this.noformatTips ||'获取打印格式失败,请联系管理员!');
287
+ this.$message.error(this.noformatTips || '获取打印格式失败,请联系管理员!');
282
288
  return this.requestError();
283
289
  }
284
290
  if (!this.currentFormatId) {
@@ -384,8 +390,8 @@ export default create({
384
390
  if (i.type === 'DATETIME') {
385
391
  tVal = tableVal ? moment(tableVal).format('YYYY-MM-DD HH:mm:ss') : '';
386
392
  }
387
- if(i.type === 'TEXT'){
388
- tVal = String(tableVal) || ''
393
+ if (i.type === 'TEXT') {
394
+ tVal = String(tableVal) || '';
389
395
  }
390
396
 
391
397
  return val ? val : tVal;
@@ -446,8 +452,8 @@ export default create({
446
452
  ...(params || {}),
447
453
  ...(this.token ? { token: this.token } : {}),
448
454
  ...extraParams
449
- }
450
- if(typeof this.getPrintParamsAfter === 'function'){
455
+ };
456
+ if (typeof this.getPrintParamsAfter === 'function') {
451
457
  let t = this.getPrintParamsAfter(res);
452
458
  return t || res;
453
459
  }
@@ -461,7 +467,7 @@ export default create({
461
467
  // 聚合一条
462
468
  let params = {};
463
469
  let obj = {};
464
- let cur = this.printParams?.[0] || {}
470
+ let cur = this.printParams?.[0] || {};
465
471
  if (this.templateParams?.customizeDataset?.length) {
466
472
  // 有模板数据
467
473
  const key = Object.keys(cur?.datasetData || {})?.[0] || '';
@@ -481,8 +487,8 @@ export default create({
481
487
  });
482
488
  }
483
489
  params = Object.assign({}, JSON.parse(this.getPrintParams(0)), obj);
484
- if(typeof this.getOnceParamsAfter === 'function'){
485
- let res = this.getOnceParamsAfter(params,obj);
490
+ if (typeof this.getOnceParamsAfter === 'function') {
491
+ let res = this.getOnceParamsAfter(params, obj);
486
492
  return res || params;
487
493
  }
488
494
  return JSON.stringify(params);
@@ -530,27 +536,30 @@ export default create({
530
536
  });
531
537
  }
532
538
  } else {
539
+ const queryParams = {
540
+ ...this.queryParams,
541
+ printdlgshow: this.printdlgshow
542
+ };
533
543
  if (this.strategy === 'MULTI') {
534
544
  // 循环多条
535
545
  for (let i = 0; i < this.printParams.length; i++) {
536
- const queryParams = {
537
- formatId: this.currentFormatId,
538
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
539
- params: this.getPrintParams(i),
540
- printdlgshow: this.printdlgshow
541
- };
542
- printInstance.printDirect(queryParams, callLocalServicesSuccessCb, this.callLocalServicesErrorCb);
546
+ if (i > 0) queryParams.printdlgshow = '0';
547
+ printInstance.printDirect(
548
+ {
549
+ ...queryParams,
550
+ params: this.getPrintParams(i)
551
+ },
552
+ callLocalServicesSuccessCb,
553
+ this.callLocalServicesErrorCb
554
+ );
543
555
  }
544
556
  } else {
545
557
  // 聚合一条
546
- const queryParams = {
547
- formatId: this.currentFormatId,
548
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
549
- params: this.getOnceParams(),
550
- printdlgshow: this.printdlgshow
551
- };
552
558
  printInstance.printDirect(
553
- queryParams,
559
+ {
560
+ ...queryParams,
561
+ params: this.getOnceParams()
562
+ },
554
563
  res => {
555
564
  this.callLocalServicesSuccessCb(res, 'print');
556
565
  },
@@ -614,36 +623,17 @@ export default create({
614
623
  });
615
624
  } else {
616
625
  const IS_MULTI = this.strategy === 'MULTI';
617
- if (IS_MULTI) {
618
- // 循环多条
619
- for (let i = 0; i < this.printParams.length; i++) {
620
- const queryParams = {
621
- formatId: this.currentFormatId,
622
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
623
- params: this.getPrintParams(i)
624
- };
625
- printInstance.preview(
626
- queryParams,
627
- res => {
628
- this.callLocalServicesSuccessCb(res, 'preview');
629
- },
630
- this.callLocalServicesErrorCb
631
- );
632
- }
633
- } else {
634
- const queryParams = {
635
- formatId: this.currentFormatId,
636
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
637
- params: this.getOnceParams()
638
- };
639
- printInstance.preview(
640
- queryParams,
641
- res => {
642
- this.callLocalServicesSuccessCb(res, 'preview');
643
- },
644
- this.callLocalServicesErrorCb
645
- );
646
- }
626
+
627
+ printInstance.preview(
628
+ {
629
+ ...this.queryParams,
630
+ params: IS_MULTI ? this.getPrintParams() : this.getOnceParams()
631
+ },
632
+ res => {
633
+ this.callLocalServicesSuccessCb(res, 'preview');
634
+ },
635
+ this.callLocalServicesErrorCb
636
+ );
647
637
  }
648
638
  })
649
639
  .finally(() => {
@@ -681,8 +671,7 @@ export default create({
681
671
  this.identityVerification.visible = false;
682
672
 
683
673
  const queryParams = {
684
- formatId: this.currentFormatId,
685
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
674
+ ...this.queryParams,
686
675
  params: this.getPrintParams(),
687
676
  token
688
677
  };
@@ -4,9 +4,11 @@ import DatePicker from './src/DatePicker';
4
4
  import MonthPicker from './src/MonthPicker';
5
5
  import RangePicker from './src/RangePicker';
6
6
  import WeekPicker from './src/WeekPicker';
7
+ import { rewriteAntd } from './src/utils';
7
8
 
8
9
  // 为组件提供 install 安装方法,供按需引入
9
10
  DatePicker.install = function(Vue) {
11
+ rewriteAntd();
10
12
  Vue.use(Base);
11
13
  Vue.component(DatePicker.name, DatePicker);
12
14
  Vue.component(MonthPicker.name, MonthPicker);