cnhis-design-vue 2.1.14 → 2.1.17

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 (46) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +84 -78
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +1922 -2879
  6. package/es/button/style.css +1 -1
  7. package/es/captcha/index.js +3 -3
  8. package/es/checkbox/index.js +1 -1
  9. package/es/color-picker/index.js +1 -1
  10. package/es/drag-layout/index.js +3 -3
  11. package/es/editor/index.js +1 -1
  12. package/es/fabric-chart/index.js +121 -119
  13. package/es/fabric-chart/style.css +1 -1
  14. package/es/form-table/index.js +17 -17
  15. package/es/index/index.js +2253 -3181
  16. package/es/index/style.css +1 -1
  17. package/es/input/index.js +1 -1
  18. package/es/map/index.js +1 -1
  19. package/es/multi-chat/index.js +24 -24
  20. package/es/multi-chat-client/index.js +18 -18
  21. package/es/multi-chat-history/index.js +4 -4
  22. package/es/multi-chat-record/index.js +4 -4
  23. package/es/multi-chat-setting/index.js +20 -20
  24. package/es/multi-chat-sip/index.js +1 -1
  25. package/es/radio/index.js +1 -1
  26. package/es/scale-view/index.js +24 -24
  27. package/es/select/index.js +3 -3
  28. package/es/select-label/index.js +3 -3
  29. package/es/select-person/index.js +2 -2
  30. package/es/table-filter/index.js +1960 -2903
  31. package/es/table-filter/style.css +1 -1
  32. package/es/tag/index.js +1 -1
  33. package/es/verification-code/index.js +2 -2
  34. package/lib/cui.common.js +2378 -2945
  35. package/lib/cui.umd.js +2378 -2945
  36. package/lib/cui.umd.min.js +27 -25
  37. package/package.json +1 -1
  38. package/packages/big-table/src/BigTable.vue +23 -29
  39. package/packages/big-table/src/components/AutoLayoutButton.vue +1 -1
  40. package/packages/big-table/src/utils/batchEditing.js +34 -27
  41. package/packages/button/src/ButtonPrint/index.vue +4 -0
  42. package/packages/button/src/ButtonPrint/js/print.es.min.js +2792 -1
  43. package/packages/fabric-chart/src/FabricChart.vue +15 -36
  44. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +4 -3
  45. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +8 -6
  46. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +21 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.14",
3
+ "version": "2.1.17",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -101,21 +101,12 @@
101
101
  >
102
102
  <template v-slot:empty>
103
103
  <div v-if="isShowEmpty">
104
- <NoData
105
- :noDataImg="emptyItems.noDataImg"
106
- :noDataTip="emptyItems.noDataTip"
107
- :showImg="!isNestTable"
108
- ></NoData>
104
+ <NoData :noDataImg="emptyItems.noDataImg" :noDataTip="emptyItems.noDataTip" :showImg="!isNestTable"></NoData>
109
105
  </div>
110
106
  </template>
111
107
  <!-- 修复 vxe-table升级3.x版本 原自定义checkbox样式失效 -->
112
108
  <template v-slot:tooltip_checkbox="{ row, checked }">
113
- <a-tooltip
114
- v-if="row.forbiddenBatchSelect"
115
- :title="row.forbiddenBatchSelectReason"
116
- placement="right"
117
- trigger="hover"
118
- >
109
+ <a-tooltip v-if="row.forbiddenBatchSelect" :title="row.forbiddenBatchSelectReason" placement="right" trigger="hover">
119
110
  <i class="disabled-checked-tips"></i>
120
111
  </a-tooltip>
121
112
  <a-checkbox class="tooltip-checkbox-item" v-else :checked="checked"></a-checkbox>
@@ -197,7 +188,10 @@ export default create({
197
188
  mixins: [format, batchEditing, nestTable],
198
189
  props: Object.assign({}, bigTableProps),
199
190
  beforeCreate() {
200
- Vue.use(Button).use(Checkbox).use(Input).use(DomPortal);
191
+ Vue.use(Button)
192
+ .use(Checkbox)
193
+ .use(Input)
194
+ .use(DomPortal);
201
195
  !this.$xss && Vue.use(VueXss);
202
196
  },
203
197
  mounted() {
@@ -295,7 +289,7 @@ export default create({
295
289
  return this.isTree > 0 ? this.primaryKey || 'theUniqueKey' : 'theUniqueKey';
296
290
  },
297
291
  handleName() {
298
- return function (item, key = 'name') {
292
+ return function(item, key = 'name') {
299
293
  return item.alias || item[key];
300
294
  };
301
295
  },
@@ -394,13 +388,13 @@ export default create({
394
388
  this.loadData(list);
395
389
  },
396
390
  quickSearchConfig: {
397
- handler: function () {
391
+ handler: function() {
398
392
  this.setFilterStatus();
399
393
  },
400
394
  deep: true
401
395
  },
402
396
  tableDataCache: {
403
- handler: function (val) {
397
+ handler: function(val) {
404
398
  this.setAllCheckedRows(val);
405
399
  },
406
400
  deep: true
@@ -1656,7 +1650,7 @@ export default create({
1656
1650
  let showTitleFeildDescribe = feildDescribe || feildDescribeI18n;
1657
1651
  let titleFeildDescribe = '';
1658
1652
  if (showTitleFeildDescribe) {
1659
- titleFeildDescribe = (feildDescribeI18n && this.$root.$t(feildDescribeI18n)) || feildDescribe;
1653
+ titleFeildDescribe = (feildDescribeI18n && this.$root?.$t?.(feildDescribeI18n)) || feildDescribe;
1660
1654
  }
1661
1655
  return (
1662
1656
  <div class={['table-title-wrap', { 'table-title-wrap-describe': showTitleFeildDescribe }]}>
@@ -1739,7 +1733,7 @@ export default create({
1739
1733
  )}
1740
1734
  <div class="checkbox-box">
1741
1735
  <div class="checkbox-wrap js-checkbox-wrap" style={{ height: this.filterHeight + this.distance + 'px' }}>
1742
- {!field.searchFilterText && (field.advanceOptionSetting) != '0' ? (
1736
+ {!field.searchFilterText && field.advanceOptionSetting != '0' ? (
1743
1737
  <div class="ant-checkbox-group">
1744
1738
  <a-checkbox
1745
1739
  indeterminate={field.indeterminate}
@@ -1896,7 +1890,7 @@ export default create({
1896
1890
  handleFilterChange(newValue, name, field) {
1897
1891
  this.reScrollFilterWrap();
1898
1892
  let value = newValue;
1899
- value = this.getSingleConvert(value,this.filterFields[name].CONVERT,field);
1893
+ value = this.getSingleConvert(value, this.filterFields[name].CONVERT, field);
1900
1894
  this.filterFields[name].CONVERT = value;
1901
1895
 
1902
1896
  field.checkAll = value.length === field.setting.showSetting.length;
@@ -1910,12 +1904,12 @@ export default create({
1910
1904
  let addItems = value.filter(item => {
1911
1905
  return !beforeSearchConvert.includes(item);
1912
1906
  });
1913
- if(field.advanceOptionSetting == '0'){
1914
- if(Array.isArray(this.filterFields[columnName].CONVERT)){
1907
+ if (field.advanceOptionSetting == '0') {
1908
+ if (Array.isArray(this.filterFields[columnName].CONVERT)) {
1915
1909
  this.filterFields[columnName].CONVERT.length = 0;
1916
1910
  }
1917
1911
  }
1918
- this.filterFields[columnName].CONVERT.push(...addItems);
1912
+ this.filterFields[columnName].CONVERT.push(...addItems);
1919
1913
  } else {
1920
1914
  let removeItems = beforeSearchConvert.filter(item => {
1921
1915
  return !value.includes(item);
@@ -1926,7 +1920,7 @@ export default create({
1926
1920
  }
1927
1921
 
1928
1922
  let newValue = value;
1929
- newValue = this.getSingleConvert(newValue,field.searchFilterCONVERT,field);
1923
+ newValue = this.getSingleConvert(newValue, field.searchFilterCONVERT, field);
1930
1924
 
1931
1925
  field.searchFilterCONVERT = newValue;
1932
1926
  beforeSearchConvert = vexutils.clone(newValue, true);
@@ -3021,17 +3015,17 @@ export default create({
3021
3015
  /**
3022
3016
  * 映射值如果配置了单选,限制只能选一个
3023
3017
  */
3024
- getSingleConvert(value,old,field){
3018
+ getSingleConvert(value, old, field) {
3025
3019
  let cValue = value;
3026
- if(!Array.isArray(old) || !Array.isArray(value)) return cValue;
3020
+ if (!Array.isArray(old) || !Array.isArray(value)) return cValue;
3027
3021
  // 单选
3028
- if((field.advanceOptionSetting) == '0' && (value?.length || 0)>1){
3029
- cValue = cValue.filter(v=> !old?.includes?.(v));
3030
- if(cValue.length > 1){
3031
- return [cValue[0]]
3022
+ if (field.advanceOptionSetting == '0' && (value?.length || 0) > 1) {
3023
+ cValue = cValue.filter(v => !old?.includes?.(v));
3024
+ if (cValue.length > 1) {
3025
+ return [cValue[0]];
3032
3026
  }
3033
3027
  }
3034
- return cValue;
3028
+ return cValue;
3035
3029
  }
3036
3030
  }
3037
3031
  });
@@ -215,7 +215,7 @@ export default {
215
215
  return;
216
216
  }
217
217
  btnTotalWidth += (this.btnShowWidthObj[btn.id] || 0) + 10;
218
- if (btnTotalWidth < (wrapWidth-15)) {
218
+ if (btnTotalWidth < (wrapWidth)) {
219
219
  btn.showType = '_show';
220
220
  } else {
221
221
  btn.showType = '_hide';
@@ -1,5 +1,5 @@
1
1
  // import { mapMutations, mapActions } from "vuex";
2
- import utils from "@/utils/utils-map";
2
+ import utils from '@/utils/utils-map';
3
3
  export default {
4
4
  props: {
5
5
  // 曾经的getters
@@ -43,10 +43,10 @@ export default {
43
43
  return {
44
44
  isLoadData: this.isLoadData,
45
45
  isLoadColumn: this.isLoadColumn
46
- }
46
+ };
47
47
  },
48
48
  isTableEdit() {
49
- return this.isInlineOperating || this.isInlineAdding
49
+ return this.isInlineOperating || this.isInlineAdding;
50
50
  }
51
51
  },
52
52
  watch: {
@@ -55,7 +55,7 @@ export default {
55
55
  let { isLoadData, isLoadColumn } = obj;
56
56
  if (!(isLoadData && isLoadColumn)) return;
57
57
  if (this.isBatchEditing) return;
58
- this.$emit('tableLoad', true)
58
+ this.$emit('tableLoad', true);
59
59
  },
60
60
  /**
61
61
  * 编辑
@@ -69,7 +69,7 @@ export default {
69
69
  }
70
70
  // 非行内按钮触发
71
71
  if (!this.isRowEditing) {
72
- await this.toggleColumn()
72
+ await this.toggleColumn();
73
73
  }
74
74
  this.hideSelectCloumns();
75
75
  this.handleClickBatchEditBtnByInline();
@@ -90,7 +90,7 @@ export default {
90
90
  if (!val || this.isNestTable) return false;
91
91
  if (this.isTree != 0 || !this.isMatchComponent) return false;
92
92
  if (!this.checkOperateCurrentTable()) return false;
93
- await this.toggleColumn('showColumn')
93
+ await this.toggleColumn('showColumn');
94
94
  this.handleClickBatchCancelBtnByInline();
95
95
  },
96
96
  /**
@@ -109,17 +109,17 @@ export default {
109
109
  this.resetBatchOperationRowStatus();
110
110
  return false;
111
111
  }
112
- await this.toggleColumn()
112
+ await this.toggleColumn();
113
113
  this.hideSelectCloumns();
114
- this.handleClickAddRow()
114
+ this.handleClickAddRow();
115
115
  }
116
116
  },
117
117
  methods: {
118
118
  toggleColumn(key) {
119
- let method = key || 'hideColumn'
119
+ let method = key || 'hideColumn';
120
120
  const xGrid = this.$refs.xGrid;
121
121
  if (!xGrid) return Promise.resolve();
122
- let operate = xGrid.getColumnByField("operatorColumn")
122
+ let operate = xGrid.getColumnByField('operatorColumn');
123
123
  if (method === 'showColumn' && operate.visible) {
124
124
  return Promise.resolve();
125
125
  }
@@ -233,10 +233,18 @@ export default {
233
233
  this.$emit('resetBatchEditDoneStatus');
234
234
 
235
235
  let formDom = document.querySelectorAll('.js-inlineEditForm');
236
- let sliceLen = this.handleEditFormLength();
237
- // HACK: vxeTable行内编辑时复制的DOM节点,无需触发提交
238
- formDom = [...formDom].slice(0, sliceLen);
239
- formDom.forEach(item => {
236
+ let filterFormDom = [];
237
+ [...formDom].map(item => {
238
+ let pNode = item.parentNode?.parentNode;
239
+ if (pNode) {
240
+ if (pNode.classList.contains('vxe-body--column') && !pNode.classList.contains('fixed--hidden')) {
241
+ filterFormDom.push(item);
242
+ }
243
+ }
244
+ });
245
+ if (!filterFormDom.length) return false;
246
+ // // HACK: vxeTable行内编辑时复制的DOM节点,无需触发提交
247
+ filterFormDom.forEach(item => {
240
248
  item.__vue__.handleSubmitForm();
241
249
  });
242
250
  },
@@ -340,22 +348,21 @@ export default {
340
348
  return editColumnMap;
341
349
  },
342
350
  async handleRequestedUniqueKey(id) {
343
- let handleEditFormRequestedUniqueKey = this.editFormApiConfig?.handleEditFormRequestedUniqueKey
351
+ let handleEditFormRequestedUniqueKey = this.editFormApiConfig?.handleEditFormRequestedUniqueKey;
344
352
  if (!handleEditFormRequestedUniqueKey || typeof handleEditFormRequestedUniqueKey !== 'function') {
345
353
  handleEditFormRequestedUniqueKey = this.getPrimaryKeyRequest;
346
354
  }
347
- return handleEditFormRequestedUniqueKey({ tableId: id }).then((val) => {
348
- val && (this.cacheUniqueKey[id] = { value: val, status: true })
349
- })
350
-
355
+ return handleEditFormRequestedUniqueKey({ tableId: id }).then(val => {
356
+ val && (this.cacheUniqueKey[id] = { value: val, status: true });
357
+ });
351
358
  },
352
359
  getPrimaryKeyRequest(params) {
353
360
  return new Promise((resolve, reject) => {
354
361
  this.axios
355
- .get("tableList/getPrimaryKey", { params })
362
+ .get('tableList/getPrimaryKey', { params })
356
363
  .then(({ data }) => {
357
364
  let result;
358
- if (data.result == "SUCCESS") {
365
+ if (data.result == 'SUCCESS') {
359
366
  const { map = {} } = data;
360
367
  result = map.primaryKey || undefined;
361
368
  } else {
@@ -413,7 +420,7 @@ export default {
413
420
  let originalRow = this.pageIndexOldtableData.find(item => {
414
421
  let oldItemVal = utils.handleCurValue(item[this.primaryKey]);
415
422
  let rowVal = utils.handleCurValue(row[this.primaryKey]);
416
- return oldItemVal == rowVal
423
+ return oldItemVal == rowVal;
417
424
  });
418
425
  defaultCombinationForm = this.setDefaultFormData(column.property, fieldItem, originalRow);
419
426
  }
@@ -504,7 +511,7 @@ export default {
504
511
  this.$emit('triggerSpinning', false);
505
512
  return;
506
513
  }
507
- let { listFormUnionSetting } = this
514
+ let { listFormUnionSetting } = this;
508
515
  let { formId } = listFormUnionSetting;
509
516
  let params = this.handleSubmitParams(this.batchFormData);
510
517
  if (!formId || !params) {
@@ -543,7 +550,7 @@ export default {
543
550
  let arr = [];
544
551
  for (let key in batchFormData) {
545
552
  // v[this.primaryKey] 可能为数字
546
- // key 为字符串 用全等匹配不到 改为 ==
553
+ // key 为字符串 用全等匹配不到 改为 ==
547
554
  let matchItem = this.oldtableData.find(v => v[this.primaryKey] == key);
548
555
  let obj = batchFormData[key];
549
556
  if (matchItem) {
@@ -556,11 +563,11 @@ export default {
556
563
  return arr;
557
564
  },
558
565
  savaForm(formId, params) {
559
- let handleEditFormSavaForm = this.editFormApiConfig?.handleEditFormSavaForm
566
+ let handleEditFormSavaForm = this.editFormApiConfig?.handleEditFormSavaForm;
560
567
  if (!handleEditFormSavaForm || typeof handleEditFormSavaForm !== 'function') {
561
- handleEditFormSavaForm = this.savaFormRequest
568
+ handleEditFormSavaForm = this.savaFormRequest;
562
569
  }
563
- return handleEditFormSavaForm(params, { formId })
570
+ return handleEditFormSavaForm(params, { formId });
564
571
  },
565
572
  savaFormRequest(params, config) {
566
573
  let url = `/form/editRows/update/${config.formId}`;
@@ -171,6 +171,10 @@ export default create({
171
171
  mounted() {
172
172
  this.isInited = false;
173
173
  },
174
+ beforeDestroy() {
175
+ // 创建Print实例的时候会在webview中注册一个事件, 需要调用printInstance.destroy()手动清除
176
+ printInstance?.destroy?.()
177
+ },
174
178
  watch: {
175
179
  // 监听变化, 重新格式化printParams
176
180
  params: {