cnhis-design-vue 2.1.144 → 2.1.146

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 (111) hide show
  1. package/CHANGELOG.md +42 -15
  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 +40 -34
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/card-reader-sdk/index.js +1 -1
  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/direct/index.js +16 -16
  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 +199 -104
  37. package/es/fabric-chart/style.css +1 -1
  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 +776 -626
  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 +125 -109
  54. package/es/multi-chat/style.css +1 -1
  55. package/es/multi-chat-client/index.js +121 -105
  56. package/es/multi-chat-client/style.css +1 -1
  57. package/es/multi-chat-history/index.js +4 -4
  58. package/es/multi-chat-record/index.js +14 -14
  59. package/es/multi-chat-setting/index.js +66 -49
  60. package/es/multi-chat-setting/style.css +1 -1
  61. package/es/multi-chat-sip/index.js +1 -1
  62. package/es/notification/index.js +8 -8
  63. package/es/page-header/index.js +8 -8
  64. package/es/pagination/index.js +8 -8
  65. package/es/popconfirm/index.js +8 -8
  66. package/es/popover/index.js +8 -8
  67. package/es/progress/index.js +8 -8
  68. package/es/radio/index.js +9 -9
  69. package/es/rate/index.js +8 -8
  70. package/es/result/index.js +8 -8
  71. package/es/row/index.js +8 -8
  72. package/es/scale-container/index.js +9 -9
  73. package/es/scale-view/index.js +27 -27
  74. package/es/select/index.js +12 -12
  75. package/es/select-label/index.js +11 -11
  76. package/es/select-person/index.js +2 -2
  77. package/es/select-tag/index.js +4 -4
  78. package/es/shortcut-setter/index.js +10 -10
  79. package/es/skeleton/index.js +8 -8
  80. package/es/slider/index.js +8 -8
  81. package/es/slider-tree/index.js +9 -9
  82. package/es/space/index.js +8 -8
  83. package/es/spin/index.js +8 -8
  84. package/es/statistic/index.js +8 -8
  85. package/es/steps/index.js +8 -8
  86. package/es/switch/index.js +8 -8
  87. package/es/table-filter/index.js +82 -76
  88. package/es/tabs/index.js +8 -8
  89. package/es/tag/index.js +9 -9
  90. package/es/time-picker/index.js +8 -8
  91. package/es/timeline/index.js +8 -8
  92. package/es/tooltip/index.js +8 -8
  93. package/es/transfer/index.js +8 -8
  94. package/es/tree/index.js +8 -8
  95. package/es/tree-select/index.js +8 -8
  96. package/es/upload/index.js +8 -8
  97. package/es/verification-code/index.js +2 -2
  98. package/lib/cui.common.js +788 -638
  99. package/lib/cui.umd.js +788 -638
  100. package/lib/cui.umd.min.js +26 -26
  101. package/package.json +1 -1
  102. package/packages/button/src/ButtonPrint/index.vue +6 -0
  103. package/packages/fabric-chart/src/FabricChart.vue +10 -1
  104. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +0 -1
  105. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +30 -10
  106. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +27 -6
  107. package/packages/fabric-chart/src/mixins/fabricCommon.js +0 -4
  108. package/packages/fabric-chart/src/utils/index.js +15 -0
  109. package/packages/multi-chat/chat/client/clientChat.vue +14 -2
  110. package/packages/multi-chat/chat/index.vue +14 -2
  111. package/packages/multi-chat/setting/index.vue +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.144",
3
+ "version": "2.1.146",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -148,6 +148,12 @@ export default create({
148
148
  getProps() {
149
149
  return this.$props;
150
150
  }
151
+ },
152
+ methods: {
153
+ // 向外抛出vue2组件直接调用内部的方法
154
+ handleClickBtn() {
155
+ this.$refs.printComponentRef.handleClickBtn();
156
+ }
151
157
  }
152
158
  });
153
159
  </script>
@@ -31,7 +31,6 @@ import FabricGrid from './FabricGrid';
31
31
  import FabricTextGroup from './fabric-chart/FabricTextGroup';
32
32
  import FabricScaleValue from './fabric-chart/FabricScaleValue';
33
33
  import FabricLines from './fabric-chart/FabricLines';
34
- import { isObject } from './utils';
35
34
 
36
35
  export default create({
37
36
  name: 'fabric-chart',
@@ -50,6 +49,12 @@ export default create({
50
49
  FabricLines
51
50
  },
52
51
  computed: {
52
+ fabric() {
53
+ return this.$refs.canvasEle?.fabric;
54
+ },
55
+ canvas() {
56
+ return this.$refs.canvasEle?.canvas;
57
+ },
53
58
  polylines() {
54
59
  const list = [];
55
60
  if (this.templateData?.right?.rightYScalevalue?.dataList?.length) {
@@ -84,6 +89,10 @@ export default create({
84
89
  this.canvasWidth = `${this.templateData.canvasWidth}px` || '1000px';
85
90
  },
86
91
  methods: {
92
+ computedX() {
93
+ if (!this.$refs.polylines?.computedX) return;
94
+ return this.$refs.polylines?.computedX(...arguments);
95
+ },
87
96
  setTimeRange(enabled) {
88
97
  this.$refs.polylines.timeRangeData.enabled = enabled;
89
98
  },
@@ -83,7 +83,6 @@ export default {
83
83
  console.warn(error);
84
84
  }
85
85
  }
86
- // if (!this.templateData.left || !this.templateData.right) {
87
86
  if (!this.templateData.left) {
88
87
  try {
89
88
  throw new Error('缺少左侧数据对象, 无法生成垂直方向刻度');
@@ -58,6 +58,14 @@ export default {
58
58
  this.createLine();
59
59
  this.eventStyle.evented && this.createEvent();
60
60
  },
61
+ isTopTreeAndGridLimit(x, y) {
62
+ const { endX, endYTop, originYTop } = this.propItems;
63
+ return x >= 0 && x <= endX && y >= originYTop && y <= endYTop;
64
+ },
65
+ isGridLimit({ x, y }) {
66
+ const { originX, endX, endYTop, originYTop } = this.propItems;
67
+ return x >= originX && x <= endX && y >= originYTop && y <= endYTop;
68
+ },
61
69
  createEvent() {
62
70
  this.canvas.on('mouse:up', event => {
63
71
  if (event.button === 3) {
@@ -104,25 +112,37 @@ export default {
104
112
  this.rightClickNode = Object.freeze(rightClickNode.slice());
105
113
  this.isRightVisible = true;
106
114
  } else {
107
- this.doContextmenuEvent(this.activeEvent.pointer);
115
+ this.doContextmenuEvent(id, this.activeEvent.pointer);
108
116
  }
109
117
  });
110
118
  },
111
- doContextmenuEvent(pointer) {
119
+ doContextmenuEvent(id, pointer) {
112
120
  const { x, y } = pointer;
113
121
  const { treeList } = this.$propItems();
114
122
  const _treeList = vexutils.clone(treeList, true);
115
- let data;
123
+ const param = { type: 'tree', treeData: [] };
124
+ const isBlankGrid = !id && this.isGridLimit(pointer);
125
+ if (isBlankGrid) {
126
+ param.type = 'grid';
127
+ param.time = this.getXValue(x);
128
+ param.lineData = [];
129
+ }
116
130
  ergodicTree(_treeList);
117
- data && this.$emit('rightClick', data);
118
- data = null;
131
+ this.$emit('rightClick', param);
119
132
  function ergodicTree(tree) {
120
133
  for (let i = 0, len = tree.length; i < len; i++) {
121
- const { left, top, width, height, children = [], origin } = tree[i];
122
- if (x >= left && x <= left + width && y >= top && y <= y + height) {
123
- data = origin;
124
- } else if (children.length) {
125
- ergodicTree(children);
134
+ const { left, top, width, height, children = [], origin, lineList = [] } = tree[i];
135
+ if (y >= top && y <= top + height) {
136
+ if (x >= left && x <= left + width) {
137
+ param.treeData = origin;
138
+ break;
139
+ } else if (children.length) {
140
+ ergodicTree(children);
141
+ } else if (isBlankGrid) {
142
+ param.treeData = origin;
143
+ param.lineData = lineList;
144
+ break;
145
+ }
126
146
  }
127
147
  }
128
148
  }
@@ -14,7 +14,8 @@ import MouseRightClick from '../components/MouseRightClick';
14
14
  import DropPopup from '../components/DropPopup';
15
15
  import defaultVaule from '../const/defaultVaule';
16
16
  import Bus from '../utils/bus';
17
- import { nearlyEqual } from '../utils';
17
+ import { nearlyEqual, getUuid, toReversed } from '../utils';
18
+ import vexutils from '@/utils/vexutils';
18
19
 
19
20
  /**
20
21
  * @description: 递归遍历节点,设置颜色属性
@@ -1062,7 +1063,7 @@ export default {
1062
1063
  if (isRight) {
1063
1064
  this._concatIndex = polylineObj?.pointerList.findIndex(l => l + n > left && l > originLeft);
1064
1065
  } else {
1065
- const idx = polylineObj?.pointerList.toReversed().findIndex(l => l - n < left && l < originLeft);
1066
+ const idx = polylineObj?.pointerList?.length ? toReversed(polylineObj?.pointerList).findIndex(l => l - n < left && l < originLeft) : -1;
1066
1067
  this._concatIndex = !~idx ? -1 : polylineObj?.pointerList.length - 1 - idx;
1067
1068
  }
1068
1069
  if (!~this._concatIndex) {
@@ -1100,7 +1101,7 @@ export default {
1100
1101
  // 如果往回拖动则删除经过的已存在的节点
1101
1102
  if (startLength > 0) {
1102
1103
  if (isRight) {
1103
- this.removeLeftClonePoint(originLeft);
1104
+ this.removeLeftClonePoint(originLeft - this.spaceWidth);
1104
1105
  this.addPointList = this.addPointList.filter(v => v.left >= originLeft);
1105
1106
  if (this.addPointList.length > 0 && currentLeft <= this.addPointList[this.addPointList.length - 1].left) {
1106
1107
  this.removePolyline('increasePointBatch', left);
@@ -1117,7 +1118,7 @@ export default {
1117
1118
  }
1118
1119
  }
1119
1120
  } else {
1120
- this.removePolyline('increasePointBatch', originLeft);
1121
+ this.removePolyline('increasePointBatch', originLeft + this.spaceWidth);
1121
1122
  this.addPointList = this.addPointList.filter(v => v.left <= originLeft);
1122
1123
  if (this.addPointList.length > 0 && currentLeft >= this.addPointList[this.addPointList.length - 1].left) {
1123
1124
  this.removeLeftClonePoint(left);
@@ -1292,15 +1293,35 @@ export default {
1292
1293
  this.rightClickNode.push(item);
1293
1294
  }
1294
1295
  });
1296
+ this.addExtraMenu();
1295
1297
  this.isRightVisible = true;
1296
1298
  }
1297
1299
  });
1298
1300
  },
1301
+ addExtraMenu() {
1302
+ const { menuList } = this.propItems.table?.extraMenuConfig || {};
1303
+ if (Array.isArray(menuList) && menuList.length > 0) {
1304
+ menuList.forEach(item => {
1305
+ this.rightClickNode.push({
1306
+ name: item.label,
1307
+ type: item.key || getUuid(),
1308
+ extra: true,
1309
+ origin: item
1310
+ });
1311
+ });
1312
+ }
1313
+ },
1299
1314
  // 关闭右键菜单,打开添加节点弹窗表单
1300
- handleRightClick({ type, name }) {
1315
+ handleRightClick({ type, name, extra, origin }) {
1301
1316
  this.isRightVisible = false;
1302
1317
  const { left, top } = this._active;
1303
- let data = this._currentPoint?.id ? this.getDataByPoint(this._currentPoint) : this.getValue({ left, top });
1318
+ const data = this._currentPoint?.id ? this.getDataByPoint(this._currentPoint) : this.getValue({ left, top });
1319
+ if (extra) {
1320
+ const { click } = this.propItems.table?.extraMenuConfig || {};
1321
+ if (!vexutils.isFunction(click)) return;
1322
+ click(data, origin);
1323
+ return;
1324
+ }
1304
1325
  if (type == 'add') {
1305
1326
  if (name.includes('左')) {
1306
1327
  data.range = {
@@ -72,10 +72,6 @@ export default {
72
72
  isGridLimit(x, y) {
73
73
  const { originX, originY, endX, endY } = this.propItems;
74
74
  return x >= originX && x <= endX && y >= originY && y <= endY;
75
- },
76
- isTopTreeAndGridLimit(x, y) {
77
- const { endX, endYTop, originYTop } = this.propItems;
78
- return x >= 0 && x <= endX && y >= originYTop && y <= endYTop;
79
75
  }
80
76
  }
81
77
  };
@@ -1,3 +1,5 @@
1
+ import vexutils from '@/utils/vexutils';
2
+
1
3
  export const isNumber = num => {
2
4
  return typeof num === 'number' && Number.isFinite(num);
3
5
  };
@@ -87,3 +89,16 @@ export function sortByTime(list = []) {
87
89
 
88
90
  return list;
89
91
  }
92
+
93
+ export function getUuid() {
94
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
95
+ const r = (Math.random() * 16) | 0,
96
+ v = c == 'x' ? r : (r & 0x3) | 0x8;
97
+ return v.toString(16);
98
+ });
99
+ }
100
+
101
+ export function toReversed(arr) {
102
+ const copyArr = vexutils.clone(arr, true);
103
+ return copyArr.reverse();
104
+ }
@@ -59,6 +59,9 @@ export default {
59
59
  isCustomServe: {
60
60
  type: Boolean,
61
61
  default: false
62
+ },
63
+ decrypt: {
64
+ type: Function
62
65
  }
63
66
  },
64
67
  computed: {
@@ -201,12 +204,21 @@ export default {
201
204
  }
202
205
  }).then(({ data }) => {
203
206
  if (data.result === 'SUCCESS') {
204
- const { sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential } = data.obj;
207
+ let useObj = data?.obj || {}
208
+ const {isEncrypt, obj} = useObj;
209
+ if(isEncrypt && obj && this.decrypt && typeof this.decrypt === 'function') {
210
+ try {
211
+ useObj = JSON.parse(this.decrypt(obj)) || {};
212
+ } catch(err) {
213
+ console.log(err)
214
+ }
215
+ }
216
+ const { sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential } = useObj;
205
217
  this.setSdkInfo({ sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential });
206
218
  // 江苏省
207
219
  if (vendor == 3) {
208
220
  this.initUniRTC({
209
- ...data.obj,
221
+ ...useObj,
210
222
  params: {
211
223
  assemblyId: this.assemblyId
212
224
  }
@@ -421,6 +421,9 @@ export default {
421
421
  rightPanelHide: {
422
422
  type: Boolean,
423
423
  default: false
424
+ },
425
+ decrypt: {
426
+ type: Function
424
427
  }
425
428
  },
426
429
  async created() {
@@ -1343,12 +1346,21 @@ export default {
1343
1346
  })
1344
1347
  .then(({ data }) => {
1345
1348
  if (data.result === 'SUCCESS') {
1346
- const { sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential } = data.obj;
1349
+ let useObj = data?.obj || {}
1350
+ const {isEncrypt, obj} = useObj;
1351
+ if(isEncrypt && obj && this.decrypt && typeof this.decrypt === 'function') {
1352
+ try {
1353
+ useObj = JSON.parse(this.decrypt(obj)) || {};
1354
+ } catch(err) {
1355
+ console.log(err)
1356
+ }
1357
+ }
1358
+ const { sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential } = useObj;
1347
1359
  this.setSdkInfo({ sdkAppId, host, vendor, wsUrl, turnUrl, turnUsername, turnCredential });
1348
1360
  // 江苏省
1349
1361
  if (vendor == 3) {
1350
1362
  this.initUniRTC({
1351
- ...data.obj,
1363
+ ...useObj,
1352
1364
  vueSelf: this,
1353
1365
  params: {
1354
1366
  assemblyId: this.assemblyId
@@ -61,6 +61,9 @@ export default {
61
61
  isOtherEntry: {
62
62
  type: Boolean,
63
63
  default: false
64
+ },
65
+ decrypt: {
66
+ type: Function
64
67
  }
65
68
  },
66
69
  data() {
@@ -187,7 +190,16 @@ export default {
187
190
  })
188
191
  .then(({ data }) => {
189
192
  if (data.result === "SUCCESS") {
190
- const { vendor } = data.obj;
193
+ let useObj = data?.obj || {}
194
+ const {isEncrypt, obj} = useObj;
195
+ if(isEncrypt && obj && this.decrypt && typeof this.decrypt === 'function') {
196
+ try {
197
+ useObj = JSON.parse(this.decrypt(obj)) || {};
198
+ } catch(err) {
199
+ console.log(err)
200
+ }
201
+ }
202
+ const { vendor } = useObj;
191
203
  this.skdVender = vendor;
192
204
  }
193
205
  });