cnhis-design-vue 2.1.44 → 2.1.46

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 (102) hide show
  1. package/CHANGELOG.md +24 -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 +225 -139
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  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/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +1 -1
  33. package/es/empty/index.js +8 -8
  34. package/es/fabric-chart/index.js +49 -35
  35. package/es/form/index.js +8 -8
  36. package/es/form-model/index.js +8 -8
  37. package/es/form-table/index.js +62 -62
  38. package/es/index/index.js +787 -565
  39. package/es/index/style.css +1 -1
  40. package/es/input/index.js +9 -9
  41. package/es/input-number/index.js +8 -8
  42. package/es/layout/index.js +8 -8
  43. package/es/list/index.js +8 -8
  44. package/es/locale-provider/index.js +8 -8
  45. package/es/map/index.js +9 -9
  46. package/es/mentions/index.js +8 -8
  47. package/es/menu/index.js +8 -8
  48. package/es/message/index.js +8 -8
  49. package/es/multi-chat/index.js +75 -75
  50. package/es/multi-chat-client/index.js +69 -69
  51. package/es/multi-chat-history/index.js +4 -4
  52. package/es/multi-chat-record/index.js +14 -14
  53. package/es/multi-chat-setting/index.js +22 -22
  54. package/es/multi-chat-sip/index.js +1 -1
  55. package/es/notification/index.js +8 -8
  56. package/es/page-header/index.js +8 -8
  57. package/es/pagination/index.js +8 -8
  58. package/es/popconfirm/index.js +8 -8
  59. package/es/popover/index.js +8 -8
  60. package/es/progress/index.js +8 -8
  61. package/es/radio/index.js +9 -9
  62. package/es/rate/index.js +8 -8
  63. package/es/result/index.js +8 -8
  64. package/es/row/index.js +8 -8
  65. package/es/scale-view/index.js +88 -67
  66. package/es/scale-view/style.css +1 -1
  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 +188 -87
  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 +784 -563
  91. package/lib/cui.umd.js +784 -563
  92. package/lib/cui.umd.min.js +23 -23
  93. package/package.json +1 -1
  94. package/packages/big-table/src/BigTable.vue +23 -8
  95. package/packages/big-table/src/utils/bigTableProps.js +4 -0
  96. package/packages/big-table/src/utils/tableParse.js +41 -0
  97. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  98. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +23 -16
  99. package/packages/scale-view/formitem/r-choice.vue +13 -1
  100. package/packages/scale-view/scaleView.vue +2010 -2010
  101. package/packages/table-filter/src/base-search-com/BaseSearch.vue +121 -50
  102. package/packages/table-filter/src/components/multi-select/multi-select.vue +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.44",
3
+ "version": "2.1.46",
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
+ v-bind="tableAttrs"
101
102
  >
102
103
  <template v-slot:empty>
103
104
  <div v-if="isShowEmpty">
@@ -144,7 +145,7 @@ import TextOverTooltip from './components/TextOverTooltip.vue';
144
145
  import AutoLayoutButton from './components/AutoLayoutButton.vue';
145
146
  import { Icon, Tooltip, Progress, Switch, Popover, Button, Dropdown, Menu, Checkbox, Input, Popconfirm } from 'ant-design-vue';
146
147
  import format from './utils/format';
147
- import { parseDurationValue, parseCombinationValue, formatFieldText, imgs2imgArr } from './utils/tableParse';
148
+ import { parseDurationValue, parseCombinationValue, formatFieldText, imgs2imgArr, parseNumberField } from './utils/tableParse';
148
149
  import passwordCom from './components/password-com.vue';
149
150
  import NoData from './components/NoData.vue';
150
151
  import VideoList from './components/player-vod/video-list';
@@ -363,6 +364,9 @@ export default create({
363
364
  tableFieldMap[v.tableField] = v;
364
365
  });
365
366
  return tableFieldMap;
367
+ },
368
+ tableAttrs(){
369
+ return this?.tableProps || {}
366
370
  }
367
371
  },
368
372
  watch: {
@@ -2001,8 +2005,8 @@ export default create({
2001
2005
  // 用rowIndex替换$rowIndex, 如果开启了虚拟滚动$rowIndex 下标会有问题
2002
2006
  let { row, column, rowIndex } = params;
2003
2007
  let own = column?._own || column?.own || col;
2004
- let attrType = own?.attrType || '';
2005
- let fieldType = own?.fieldType || '';
2008
+
2009
+ let {attrType, fieldType, extraField} = own || {};
2006
2010
  // 批量行编辑
2007
2011
  let formUnionItem = this.showEditForm(row, column, rowIndex);
2008
2012
  if (formUnionItem) {
@@ -2074,8 +2078,8 @@ export default create({
2074
2078
  return this.getOrCode(row, own, attrType);
2075
2079
  }
2076
2080
  let value = row[own.columnName];
2077
- if (attrType === 'MONEY' && fieldType == 'NUMBER' && vexutils.isNumber(value)) {
2078
- return value.toFixed(2);
2081
+ if (["MONEY", "NUMBER"].includes(attrType) || extraField && fieldType === "NUMBER") {
2082
+ return parseNumberField(value, own);
2079
2083
  }
2080
2084
 
2081
2085
  if (column.property === 'operatorColumn') {
@@ -2956,6 +2960,10 @@ export default create({
2956
2960
  }
2957
2961
  },
2958
2962
  setRowStatus(vxeTable, rowIndex, value) {
2963
+ /**
2964
+ * 行编辑状态切换,样式修改
2965
+ * 目前行编辑的状态行高度为66px,普通状态的高度应取配置值(如果有)
2966
+ */
2959
2967
  if (!vxeTable) return false;
2960
2968
 
2961
2969
  let tableWrap = [
@@ -2975,14 +2983,21 @@ export default create({
2975
2983
 
2976
2984
  let height = value ? `${value}px` : value;
2977
2985
  let lineHeight = value ? `${value - 14}px` : value;
2978
-
2986
+ // 如value 没有值,则是恢复默认的行高
2987
+ if(!value){
2988
+ let rowheight = this?.tableAttrs?.rowConfig?.height;
2989
+ if(rowheight){
2990
+ height = `${rowheight}px`;
2991
+ lineHeight = '30px';
2992
+ }
2993
+ }
2979
2994
  rowWrap.forEach(wrap => {
2980
2995
  let rowItemWrap = [...wrap.querySelectorAll('.vxe-cell')];
2981
2996
  rowItemWrap.push(...[...wrap.querySelectorAll('.vxe-body--column')]);
2982
2997
  rowItemWrap.forEach(dom => {
2983
- dom.style.setProperty('height', height, 'important');
2998
+ dom.style.setProperty('height', height, value? 'important': undefined);
2984
2999
  dom.style.lineHeight = lineHeight;
2985
- if (height) {
3000
+ if (value) {
2986
3001
  dom.style.backgroundColor = '#EFF5FF';
2987
3002
  setTimeout(() => {
2988
3003
  dom.title = '';
@@ -90,6 +90,10 @@ const bigTableProps = {
90
90
  default: true
91
91
  },
92
92
  listCountParams:{ type: Object, default: () => ({}) },
93
+ tableProps:{
94
+ type: Object,
95
+ default:()=>({})
96
+ }
93
97
  };
94
98
 
95
99
  export default bigTableProps;
@@ -191,3 +191,44 @@ export function imgs2imgArr(imgs) {
191
191
  })
192
192
  .split('|');
193
193
  }
194
+
195
+ const getLen = value => {
196
+ const len = value.toString().split('.')?.[1]?.length || 0;
197
+ return len;
198
+ };
199
+
200
+ const myToFixed = (num, decimals) => {
201
+ if (!num) return num;
202
+ if (typeof num !== 'number') return num;
203
+ return num.toLocaleString('en-US', {
204
+ minimumFractionDigits: decimals,
205
+ maximumFractionDigits: decimals
206
+ });
207
+ };
208
+
209
+ export function parseNumberField(val, own) {
210
+ let attrType = own?.attrType || '';
211
+ let fieldType = own?.fieldType || '';
212
+ let { numShowType, numScale } = own.settingObj || {};
213
+ if (!numShowType || (!numScale && numScale !== 0)) {
214
+ return val;
215
+ }
216
+ let rVal = val;
217
+ if (vexutils.isPlainObject(val)) {
218
+ rVal = val.value;
219
+ }
220
+ if (!rVal) return rVal;
221
+ if (isNaN(+rVal)) return rVal;
222
+ rVal = +rVal;
223
+ numScale = +numScale;
224
+ numScale = numScale > 6 ? 6 : numScale < 0 ? 0 : numScale;
225
+ if (numShowType === 'fixed') {
226
+ return myToFixed(rVal, numScale);
227
+ }
228
+ let len = getLen(rVal);
229
+ if (numShowType === 'must') {
230
+ rVal = parseFloat(rVal);
231
+ }
232
+ if (len <= numScale) return rVal;
233
+ return myToFixed(rVal, numScale);
234
+ }
@@ -1,59 +1,59 @@
1
- const data = {
2
- style: {
3
- evented: false,
4
- selectable: false
5
- },
6
- rectStyle: {
7
- fill: 'transparent',
8
- stroke: '#999',
9
- strokeWidth: 1
10
- },
11
- textStyle: {
12
- fontFamily: '微软雅黑',
13
- fontSize: 12,
14
- fill: '#000',
15
- lineHeight: 1
16
- },
17
- borderStyle: {
18
- stroke: '#999',
19
- strokeWidth: 1,
20
- selectable: false,
21
- evented: false
22
- },
23
- // 折线图中的点
24
- pointStyle: {
25
- fill: '#ffffff', // 填充色
26
- stroke: '#000000', // 描边色
27
- originX: 'center',
28
- originY: 'center'
29
- },
30
- // 折线图中的线
31
- lineStyle: {
32
- stroke: '#000', // 描边色
33
- strokeWidth: 1, // 描边宽度
34
- originX: 'center',
35
- originY: 'center'
36
- },
37
- topSpaceHeight: 10, // templateData.top.spaceHeight
38
- topSpaceGridNumber: 3, // templateData.top.xScalevalue.spaceGridNumber
39
- leftSpaceGridNumber: 2, // templateData.left.leftYScalevalue.spaceGridNumber
40
- rightSpaceGridNumber: 2, // templateData.right.rightYScalevalue.spaceGridNumber
41
- topTotal: {
42
- title: '总量',
43
- width: 0,
44
- style: {
45
- fontFamily: '微软雅黑',
46
- fontSize: 12,
47
- fill: '#000',
48
- lineHeight: 1
49
- }
50
- },
51
- criticalStyle: { // 危急值样式
52
- stroke: 'purple', // 颜色 默认 #999
53
- strokeWidth: 1, // 线宽 默认 1
54
- strokeDashArray: [0, 0] // 实线设置 默认[0, 0]
55
- },
56
- bottomNumberLeftSpace: 10 // 底部标记的序号与标记之间的距离
57
- };
58
-
59
- export default data;
1
+ const data = {
2
+ style: {
3
+ evented: false,
4
+ selectable: false
5
+ },
6
+ rectStyle: {
7
+ fill: 'transparent',
8
+ stroke: '#999',
9
+ strokeWidth: 1
10
+ },
11
+ textStyle: {
12
+ fontFamily: '微软雅黑',
13
+ fontSize: 12,
14
+ fill: '#000',
15
+ lineHeight: 1
16
+ },
17
+ borderStyle: {
18
+ stroke: '#999',
19
+ strokeWidth: 1,
20
+ selectable: false,
21
+ evented: false
22
+ },
23
+ // 折线图中的点
24
+ pointStyle: {
25
+ fill: '#ffffff', // 填充色
26
+ stroke: '#000000', // 描边色
27
+ originX: 'center',
28
+ originY: 'center'
29
+ },
30
+ // 折线图中的线
31
+ lineStyle: {
32
+ stroke: '#000', // 描边色
33
+ strokeWidth: 1, // 描边宽度
34
+ originX: 'center',
35
+ originY: 'center'
36
+ },
37
+ topSpaceHeight: 10, // templateData.top.spaceHeight
38
+ topSpaceGridNumber: 3, // templateData.top.xScalevalue.spaceGridNumber
39
+ leftSpaceGridNumber: 2, // templateData.left.leftYScalevalue.spaceGridNumber
40
+ rightSpaceGridNumber: 2, // templateData.right.rightYScalevalue.spaceGridNumber
41
+ topTotal: {
42
+ title: '总量',
43
+ width: 0,
44
+ style: {
45
+ fontFamily: '微软雅黑',
46
+ fontSize: 12,
47
+ fill: '#000',
48
+ lineHeight: 1
49
+ }
50
+ },
51
+ criticalStyle: { // 危急值样式
52
+ stroke: 'purple', // 颜色 默认 #999
53
+ strokeWidth: 1, // 线宽 默认 1
54
+ strokeDashArray: [0, 0] // 实线设置 默认[0, 0]
55
+ },
56
+ bottomNumberLeftSpace: 10 // 底部标记的序号与标记之间的距离
57
+ };
58
+
59
+ export default data;
@@ -203,23 +203,14 @@ export default {
203
203
 
204
204
  const minTime = Math.min(...xScaleList);
205
205
  const maxTime = Math.max(...xScaleList);
206
+
206
207
  this.polyline.forEach((item, index) => {
207
208
  item.dataList.forEach((v, i) => {
209
+ const point = v.list.find(k => isEffectiveNode(k) && new Date(k.time).getTime() >= minTime && new Date(k.time).getTime() <= maxTime);
210
+ const firstPointLeft = point ? this.cumputedX(point.time) : 0;
211
+ const rightLimit = point ? firstPointLeft - this.spaceWidth : '';
208
212
  // 配置是否可拖动标题图标批量增加-
209
- const isAdd = v.list.length
210
- ? !v.list.some(k => {
211
- return isEffectiveNode(k) && new Date(k.time).getTime() >= minTime && new Date(k.time).getTime() < xScaleCellList[1].time;
212
- })
213
- : true;
214
- let rightLimit = endX;
215
- const point = v.list.find(k => isEffectiveNode(k) && new Date(k.time).getTime() >= xScaleCellList[1].time && new Date(k.time).getTime() <= maxTime);
216
- const limitObj =
217
- point &&
218
- JSON.parse(JSON.stringify(xScaleCellList))
219
- .reverse()
220
- .find(k => new Date(point.time).getTime() > k.time);
221
- limitObj && (rightLimit = limitObj.x);
222
- point && !limitObj && new Date(point.time).getTime() === maxTime && (rightLimit = xScaleCellList[xScaleCellList.length - 1].x);
213
+ const isAdd = (firstPointLeft || endX) - this.spaceWidth >= originX;
223
214
  leftTitleList.push({
224
215
  title: v.title,
225
216
  type: v.type,
@@ -326,6 +317,7 @@ export default {
326
317
  });
327
318
  // 标题折线点停止拖拽后 更新
328
319
  icon.on('moved', () => {
320
+ this.setLeft(icon);
329
321
  icon.set({
330
322
  id: icon.id.replace('_isTitle', '')
331
323
  });
@@ -362,11 +354,26 @@ export default {
362
354
  // this.canvas.requestRenderAll();
363
355
  });
364
356
  },
357
+ // 限制节点新增位置与右侧节点间隔的spaceWidth格子树必须为整数
358
+ setLeft(icon) {
359
+ const { originX } = this.propItems;
360
+ let tempLeft = icon.rightLimit;
361
+
362
+ if (!tempLeft) return;
363
+ const leftLimit = icon.left + this.spaceWidth;
364
+ let i = 0;
365
+ while (tempLeft >= leftLimit) {
366
+ tempLeft = icon.rightLimit - i * this.spaceWidth;
367
+ i++;
368
+ }
369
+ icon.left = tempLeft < originX ? originX : tempLeft;
370
+ },
365
371
  // 点移动限制
366
372
  moveLimit(point) {
367
373
  point.setCoords();
368
- const leftLimit = this.propItems.treeTableminCellWidth;
369
- const rightLimit = point.rightLimit;
374
+ const { treeTableminCellWidth, endX } = this.propItems;
375
+ const leftLimit = treeTableminCellWidth;
376
+ const rightLimit = point.rightLimit || endX;
370
377
  if (point.top < this.propItems.originY) {
371
378
  point.set('top', this.propItems.originY);
372
379
  }
@@ -503,7 +503,7 @@ export default {
503
503
  },
504
504
  handleDynamic2StaticOptions(options) {
505
505
  if (!options || !options.length) return [];
506
- return options.map(item => {
506
+ let arr = options.map(item => {
507
507
  if ('cascadeData' in item) {
508
508
  Object.assign(item, {
509
509
  ...item.cascadeData
@@ -518,10 +518,22 @@ export default {
518
518
  }
519
519
  return item;
520
520
  });
521
+
522
+ return this.uniqArrObj(arr, this.columnKey);
523
+ },
524
+ // 数组对象去重
525
+ uniqArrObj(arr, name = "value") {
526
+ let obj = {};
527
+ return arr.reduce((cur, next) => {
528
+ obj[next[name]] ? "" : (obj[next[name]] = true && cur.push(next));
529
+ return cur;
530
+ }, []);
521
531
  },
522
532
  // 下拉组件搜索
523
533
  async handleSearch(value) {
524
534
  try {
535
+ // 动态数据源转静态数据
536
+ if (this.cloneItem?.type == 'SELECT' && this.isDynamic2Static) return
525
537
  this.curOptions = await this.getSearchOptions(
526
538
  {
527
539
  values: this.columnKey,