cnhis-design-vue 2.1.145 → 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 (44) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +26 -26
  4. package/es/button/index.js +11 -5
  5. package/es/captcha/index.js +3 -3
  6. package/es/card-reader-sdk/index.js +1 -1
  7. package/es/checkbox/index.js +1 -1
  8. package/es/color-picker/index.js +1 -1
  9. package/es/drag-layout/index.js +3 -3
  10. package/es/editor/index.js +1 -1
  11. package/es/ellipsis/index.js +1 -1
  12. package/es/fabric-chart/index.js +84 -48
  13. package/es/form-table/index.js +20 -20
  14. package/es/full-calendar/index.js +4 -4
  15. package/es/index/index.js +266 -224
  16. package/es/input/index.js +1 -1
  17. package/es/map/index.js +1 -1
  18. package/es/multi-chat/index.js +25 -25
  19. package/es/multi-chat-client/index.js +19 -19
  20. package/es/multi-chat-history/index.js +4 -4
  21. package/es/multi-chat-record/index.js +4 -4
  22. package/es/multi-chat-setting/index.js +20 -20
  23. package/es/multi-chat-sip/index.js +1 -1
  24. package/es/radio/index.js +1 -1
  25. package/es/scale-container/index.js +1 -1
  26. package/es/scale-view/index.js +27 -27
  27. package/es/select/index.js +4 -4
  28. package/es/select-label/index.js +3 -3
  29. package/es/select-person/index.js +2 -2
  30. package/es/select-tag/index.js +4 -4
  31. package/es/shortcut-setter/index.js +2 -2
  32. package/es/slider-tree/index.js +1 -1
  33. package/es/table-filter/index.js +39 -33
  34. package/es/tag/index.js +1 -1
  35. package/es/verification-code/index.js +2 -2
  36. package/lib/cui.common.js +270 -228
  37. package/lib/cui.umd.js +270 -228
  38. package/lib/cui.umd.min.js +1 -1
  39. package/package.json +1 -1
  40. package/packages/button/src/ButtonPrint/index.vue +6 -0
  41. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +30 -10
  42. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +2 -2
  43. package/packages/fabric-chart/src/mixins/fabricCommon.js +0 -4
  44. package/packages/fabric-chart/src/utils/index.js +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.145",
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>
@@ -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,7 @@ 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, getUuid } from '../utils';
17
+ import { nearlyEqual, getUuid, toReversed } from '../utils';
18
18
  import vexutils from '@/utils/vexutils';
19
19
 
20
20
  /**
@@ -1063,7 +1063,7 @@ export default {
1063
1063
  if (isRight) {
1064
1064
  this._concatIndex = polylineObj?.pointerList.findIndex(l => l + n > left && l > originLeft);
1065
1065
  } else {
1066
- 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;
1067
1067
  this._concatIndex = !~idx ? -1 : polylineObj?.pointerList.length - 1 - idx;
1068
1068
  }
1069
1069
  if (!~this._concatIndex) {
@@ -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
  };
@@ -95,3 +97,8 @@ export function getUuid() {
95
97
  return v.toString(16);
96
98
  });
97
99
  }
100
+
101
+ export function toReversed(arr) {
102
+ const copyArr = vexutils.clone(arr, true);
103
+ return copyArr.reverse();
104
+ }