cnhis-design-vue 2.1.18 → 2.1.19

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 (126) hide show
  1. package/CHANGELOG.md +2219 -2219
  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 +207 -206
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +31 -31
  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 +427 -314
  35. package/es/fabric-chart/style.css +1 -1
  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 +1078 -963
  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 +92 -92
  51. package/es/multi-chat-client/index.js +86 -86
  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 +27 -27
  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 +11 -11
  68. package/es/select-label/index.js +11 -11
  69. package/es/select-person/index.js +20 -20
  70. package/es/skeleton/index.js +8 -8
  71. package/es/slider/index.js +8 -8
  72. package/es/space/index.js +8 -8
  73. package/es/spin/index.js +8 -8
  74. package/es/statistic/index.js +8 -8
  75. package/es/steps/index.js +8 -8
  76. package/es/switch/index.js +8 -8
  77. package/es/table-filter/index.js +142 -141
  78. package/es/table-filter/style.css +1 -1
  79. package/es/tabs/index.js +8 -8
  80. package/es/tag/index.js +9 -9
  81. package/es/time-picker/index.js +8 -8
  82. package/es/timeline/index.js +8 -8
  83. package/es/tooltip/index.js +8 -8
  84. package/es/transfer/index.js +8 -8
  85. package/es/tree/index.js +8 -8
  86. package/es/tree-select/index.js +8 -8
  87. package/es/upload/index.js +8 -8
  88. package/es/verification-code/index.js +2 -2
  89. package/lib/cui.common.js +1073 -958
  90. package/lib/cui.umd.js +1073 -958
  91. package/lib/cui.umd.min.js +77 -77
  92. package/package.json +106 -106
  93. package/packages/big-table/src/BigTable.vue +3039 -3038
  94. package/packages/big-table/src/assets/style/table-base.less +370 -370
  95. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  96. package/packages/big-table/src/utils/batchEditing.js +610 -610
  97. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  98. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  99. package/packages/button/src/ButtonPrint/index.vue +728 -728
  100. package/packages/fabric-chart/src/components/TimeScaleValue.vue +113 -117
  101. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  102. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1035 -960
  103. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  104. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  105. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  106. package/packages/fabric-chart/src/mixins/draw.js +70 -62
  107. package/packages/fabric-chart/src/mixins/eventCommon.js +9 -10
  108. package/packages/multi-chat/chat/chatFooter.vue +1598 -1598
  109. package/packages/multi-chat/chat/chatMain.vue +1442 -1442
  110. package/packages/multi-chat/chat/quickReply.vue +439 -439
  111. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  112. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  113. package/packages/multi-chat/store/actions.js +448 -448
  114. package/packages/multi-chat/store/state.js +112 -112
  115. package/packages/scale-view/formitem/r-choice.vue +714 -714
  116. package/packages/scale-view/scaleView.vue +2010 -2010
  117. package/packages/select-person/select-person.vue +1658 -1658
  118. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2462 -2462
  119. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  120. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  121. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  122. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +3 -2
  123. package/packages/table-filter/src/const/dataOptions.js +43 -43
  124. package/packages/table-filter/src/mixins/mixins.js +695 -695
  125. package/packages/table-filter/src/quick-search/QuickSearch.vue +2083 -2083
  126. package/src/directive/preventReClick.js +12 -12
@@ -1,172 +1,172 @@
1
- <script>
2
- import fabricCommon from '../mixins/fabricCommon';
3
- import draw from '../mixins/draw';
4
- import defaultVaule from '../const/defaultVaule';
5
-
6
- export default {
7
- name: 'fabric-top2',
8
- mixins: [fabricCommon, draw],
9
- props: {
10
- templateData: {
11
- type: Object,
12
- required: true
13
- }
14
- },
15
- data() {
16
- return {};
17
- },
18
- mounted() {
19
- this.$nextTick(() => {
20
- this.init();
21
- });
22
- },
23
- computed: {
24
- girdLineStyle() {
25
- return Object.assign({}, defaultVaule.borderStyle, this.templateData.borderStyle || {});
26
- }
27
- },
28
- methods: {
29
- init() {
30
- this.drawTop(this.templateData.top);
31
- this.canvas.renderAll();
32
- },
33
- drawTop(top) {
34
- let list = [];
35
- // 日期
36
- this.drawTopDate(top, list);
37
- // 上午/下午
38
- this.drawTopDay(top, list);
39
- // 时间刻度
40
- this.drawTopTime(top, list);
41
- const group = list.length > 0 ? new this.fabric.Group([...list], { ...defaultVaule.style }) : null;
42
- group && group.sendToBack(); // 向下跳底层
43
- group && this.canvas.add(group);
44
- },
45
- drawTopTime(top, list) {
46
- const { originX, originY, xCellWidth, table } = this.propItems;
47
- const dateHeight = top.date?.height || 0;
48
- const dayHeight = top.dayHeight || 0;
49
- const height = originY - dateHeight - dayHeight;
50
- const titleHeight = dayHeight + height;
51
- // 标题
52
- const title = this.drawTextGroup(
53
- {
54
- width: originX,
55
- height: titleHeight,
56
- ...defaultVaule.rectStyle
57
- },
58
- {
59
- text: String(top.xScalevalue.title),
60
- ...defaultVaule.textStyle,
61
- ...top.textGroupStyle
62
- },
63
- {
64
- left: 0,
65
- top: dateHeight
66
- }
67
- );
68
- list.push(title);
69
-
70
- // 时间列表
71
- let timeList = [];
72
- for (let j = 0; j < table.mainXCell; j++) {
73
- timeList.push(top.xScalevalue.list);
74
- }
75
- timeList.flat().forEach((v, i) => {
76
- const left = originX + i * xCellWidth;
77
- const textGroup = this.drawTextGroup(
78
- {
79
- width: xCellWidth,
80
- height
81
- },
82
- {
83
- text: String(v),
84
- ...defaultVaule.textStyle,
85
- ...top.textGroupStyle
86
- },
87
- {
88
- left,
89
- top: dateHeight + dayHeight
90
- }
91
- );
92
- list.push(textGroup);
93
- });
94
- },
95
- drawTopDay(top, list) {
96
- if (!top.dayHeight) return false;
97
- const { originX, xCellWidth, gridXNumber, table } = this.propItems;
98
- const height = top.dayHeight;
99
- // 上午下午列表
100
- const width = xCellWidth * table.subSecondXCell;
101
- const dayList = gridXNumber / table.subSecondXCell;
102
- for (let i = 0; i < dayList; i++) {
103
- const left = originX + i * width;
104
- const value = i % 2 === 0 ? '上午' : '下午';
105
- const textGroup = this.drawTextGroup(
106
- {
107
- width,
108
- height
109
- },
110
- {
111
- text: String(value),
112
- ...defaultVaule.textStyle,
113
- ...top.textGroupStyle
114
- },
115
- {
116
- left,
117
- top: top.date.height || 0
118
- }
119
- );
120
- list.push(textGroup);
121
- }
122
- },
123
- drawTopDate(top, list) {
124
- if (!top.date.height) return false;
125
- const { originX, xCellWidth, table } = this.propItems;
126
- const height = top.date.height;
127
- // 标题
128
- const title = this.drawTextGroup(
129
- {
130
- width: originX,
131
- height,
132
- ...defaultVaule.rectStyle
133
- },
134
- {
135
- text: String(top.date.title),
136
- ...defaultVaule.textStyle,
137
- ...top.textGroupStyle
138
- },
139
- {
140
- left: 0,
141
- top: 0
142
- }
143
- );
144
- list.push(title);
145
- // 日期列表
146
- const width = xCellWidth * table.subXCell;
147
- top.date.list.forEach((v, i) => {
148
- const left = originX + i * width;
149
- const textGroup = this.drawTextGroup(
150
- {
151
- width,
152
- height
153
- },
154
- {
155
- text: String(v),
156
- ...defaultVaule.textStyle,
157
- ...top.textGroupStyle
158
- },
159
- {
160
- left,
161
- top: 0
162
- }
163
- );
164
- list.push(textGroup);
165
- });
166
- }
167
- },
168
- render(h) {
169
- return this.$slots.default ? h('div', this.$slots.default) : undefined;
170
- }
171
- };
172
- </script>
1
+ <script>
2
+ import fabricCommon from '../mixins/fabricCommon';
3
+ import draw from '../mixins/draw';
4
+ import defaultVaule from '../const/defaultVaule';
5
+
6
+ export default {
7
+ name: 'fabric-top2',
8
+ mixins: [fabricCommon, draw],
9
+ props: {
10
+ templateData: {
11
+ type: Object,
12
+ required: true
13
+ }
14
+ },
15
+ data() {
16
+ return {};
17
+ },
18
+ mounted() {
19
+ this.$nextTick(() => {
20
+ this.init();
21
+ });
22
+ },
23
+ computed: {
24
+ girdLineStyle() {
25
+ return Object.assign({}, defaultVaule.borderStyle, this.templateData.borderStyle || {});
26
+ }
27
+ },
28
+ methods: {
29
+ init() {
30
+ this.drawTop(this.templateData.top);
31
+ this.canvas.renderAll();
32
+ },
33
+ drawTop(top) {
34
+ let list = [];
35
+ // 日期
36
+ this.drawTopDate(top, list);
37
+ // 上午/下午
38
+ this.drawTopDay(top, list);
39
+ // 时间刻度
40
+ this.drawTopTime(top, list);
41
+ const group = list.length > 0 ? new this.fabric.Group([...list], { ...defaultVaule.style }) : null;
42
+ group && group.sendToBack(); // 向下跳底层
43
+ group && this.canvas.add(group);
44
+ },
45
+ drawTopTime(top, list) {
46
+ const { originX, originY, xCellWidth, table } = this.propItems;
47
+ const dateHeight = top.date?.height || 0;
48
+ const dayHeight = top.dayHeight || 0;
49
+ const height = originY - dateHeight - dayHeight;
50
+ const titleHeight = dayHeight + height;
51
+ // 标题
52
+ const title = this.drawTextGroup(
53
+ {
54
+ width: originX,
55
+ height: titleHeight,
56
+ ...defaultVaule.rectStyle
57
+ },
58
+ {
59
+ text: String(top.xScalevalue.title),
60
+ ...defaultVaule.textStyle,
61
+ ...top.textGroupStyle
62
+ },
63
+ {
64
+ left: 0,
65
+ top: dateHeight
66
+ }
67
+ );
68
+ list.push(title);
69
+
70
+ // 时间列表
71
+ let timeList = [];
72
+ for (let j = 0; j < table.mainXCell; j++) {
73
+ timeList.push(top.xScalevalue.list);
74
+ }
75
+ timeList.flat().forEach((v, i) => {
76
+ const left = originX + i * xCellWidth;
77
+ const textGroup = this.drawTextGroup(
78
+ {
79
+ width: xCellWidth,
80
+ height
81
+ },
82
+ {
83
+ text: String(v),
84
+ ...defaultVaule.textStyle,
85
+ ...top.textGroupStyle
86
+ },
87
+ {
88
+ left,
89
+ top: dateHeight + dayHeight
90
+ }
91
+ );
92
+ list.push(textGroup);
93
+ });
94
+ },
95
+ drawTopDay(top, list) {
96
+ if (!top.dayHeight) return false;
97
+ const { originX, xCellWidth, gridXNumber, table } = this.propItems;
98
+ const height = top.dayHeight;
99
+ // 上午下午列表
100
+ const width = xCellWidth * table.subSecondXCell;
101
+ const dayList = gridXNumber / table.subSecondXCell;
102
+ for (let i = 0; i < dayList; i++) {
103
+ const left = originX + i * width;
104
+ const value = i % 2 === 0 ? '上午' : '下午';
105
+ const textGroup = this.drawTextGroup(
106
+ {
107
+ width,
108
+ height
109
+ },
110
+ {
111
+ text: String(value),
112
+ ...defaultVaule.textStyle,
113
+ ...top.textGroupStyle
114
+ },
115
+ {
116
+ left,
117
+ top: top.date.height || 0
118
+ }
119
+ );
120
+ list.push(textGroup);
121
+ }
122
+ },
123
+ drawTopDate(top, list) {
124
+ if (!top.date.height) return false;
125
+ const { originX, xCellWidth, table } = this.propItems;
126
+ const height = top.date.height;
127
+ // 标题
128
+ const title = this.drawTextGroup(
129
+ {
130
+ width: originX,
131
+ height,
132
+ ...defaultVaule.rectStyle
133
+ },
134
+ {
135
+ text: String(top.date.title),
136
+ ...defaultVaule.textStyle,
137
+ ...top.textGroupStyle
138
+ },
139
+ {
140
+ left: 0,
141
+ top: 0
142
+ }
143
+ );
144
+ list.push(title);
145
+ // 日期列表
146
+ const width = xCellWidth * table.subXCell;
147
+ top.date.list.forEach((v, i) => {
148
+ const left = originX + i * width;
149
+ const textGroup = this.drawTextGroup(
150
+ {
151
+ width,
152
+ height
153
+ },
154
+ {
155
+ text: String(v),
156
+ ...defaultVaule.textStyle,
157
+ ...top.textGroupStyle
158
+ },
159
+ {
160
+ left,
161
+ top: 0
162
+ }
163
+ );
164
+ list.push(textGroup);
165
+ });
166
+ }
167
+ },
168
+ render(h) {
169
+ return this.$slots.default ? h('div', this.$slots.default) : undefined;
170
+ }
171
+ };
172
+ </script>
@@ -1,7 +1,4 @@
1
- import {
2
- isNumber,
3
- isObject
4
- } from './type';
1
+ import { isNumber, isObject } from './type';
5
2
 
6
3
  export default {
7
4
  name: 'draw',
@@ -33,7 +30,7 @@ export default {
33
30
  defaultGroupStyle: {
34
31
  evented: false,
35
32
  selectable: false
36
- },
33
+ }
37
34
  };
38
35
  },
39
36
  components: {},
@@ -43,9 +40,11 @@ export default {
43
40
  if (!Array.isArray(points)) return null; // 坐标点非数组
44
41
  if (points.length < 4) return null; // 坐标点位数不足 无法完成线的绘制
45
42
  if (points.filter(point => isNumber(point)).length < 4) return null; // 坐标点内可用数值不足 无法完成线的绘制
46
- const lineStyle = this.isObject(style) ? {
47
- ...style
48
- } : {};
43
+ const lineStyle = this.isObject(style)
44
+ ? {
45
+ ...style
46
+ }
47
+ : {};
49
48
  return new this.fabric.Line(points, {
50
49
  ...this.defaultLineStyle,
51
50
  ...lineStyle
@@ -57,18 +56,24 @@ export default {
57
56
  // },
58
57
  // 绘制文本区
59
58
  drawTextGroup(rectStyle, fontStyle, groupStyle) {
60
- const rect_style = this.isObject(rectStyle) ? {
61
- ...rectStyle
62
- } : {};
63
- const font_style = this.isObject(fontStyle) ? {
64
- ...fontStyle
65
- } : {};
66
- const group_style = this.isObject(groupStyle) ? {
67
- ...groupStyle
68
- } : {
69
- left: 0,
70
- top: 0
71
- };
59
+ const rect_style = this.isObject(rectStyle)
60
+ ? {
61
+ ...rectStyle
62
+ }
63
+ : {};
64
+ const font_style = this.isObject(fontStyle)
65
+ ? {
66
+ ...fontStyle
67
+ }
68
+ : {};
69
+ const group_style = this.isObject(groupStyle)
70
+ ? {
71
+ ...groupStyle
72
+ }
73
+ : {
74
+ left: 0,
75
+ top: 0
76
+ };
72
77
  if (!this.isNumber(rect_style.width) || !this.isNumber(rect_style.height)) return null; // rect容器宽高必须全部是可用数字类型 否则无法画出正确的容器
73
78
 
74
79
  !this.isNumber(group_style.left) && (group_style.left = 0);
@@ -121,8 +126,8 @@ export default {
121
126
  img.setAttribute('src', src);
122
127
  img.onload = () => {
123
128
  resolve(img);
124
- }
125
- })
129
+ };
130
+ });
126
131
  },
127
132
  // 画出+
128
133
  createAdd(data) {
@@ -138,8 +143,8 @@ export default {
138
143
  });
139
144
  return new this.fabric.Group([line1, line2], {
140
145
  scale: 1,
141
- ...data,
142
- })
146
+ ...data
147
+ });
143
148
  },
144
149
  // 画出圆边框
145
150
  createCircleBorder(data) {
@@ -149,37 +154,43 @@ export default {
149
154
  radius: data.width / 2,
150
155
  scale: 1,
151
156
  fill: '#fff',
152
- ...data,
157
+ ...data
153
158
  });
154
159
  },
155
160
  // 画出v
156
161
  createArrow(data) {
157
162
  const width = data.width || 10;
158
163
  const height = data.height || 10;
159
- return new this.fabric.Polyline([
160
- { x: 0, y: 0 },
161
- { x: width / 2, y: height },
162
- { x: width, y: 0 },
163
- ], {
164
- scale: 1,
165
- ...data,
166
- })
164
+ return new this.fabric.Polyline(
165
+ [
166
+ { x: 0, y: 0 },
167
+ { x: width / 2, y: height },
168
+ { x: width, y: 0 }
169
+ ],
170
+ {
171
+ scale: 1,
172
+ ...data
173
+ }
174
+ );
167
175
  },
168
176
  // 机械通气
169
177
  createJXTQ(data) {
170
178
  const width = data.width || 25;
171
179
  const height = data.height || 10;
172
- return new this.fabric.Polyline([
173
- { x: 0, y: height },
174
- { x: width / 5, y: 0 },
175
- { x: width / 5 * 2, y: height },
176
- { x: width / 5 * 3, y: 0 },
177
- { x: width / 5 * 4, y: height },
178
- { x: width / 5 * 5, y: 0 }
179
- ], {
180
- scale: 1,
181
- ...data,
182
- })
180
+ return new this.fabric.Polyline(
181
+ [
182
+ { x: 0, y: height },
183
+ { x: width / 5, y: 0 },
184
+ { x: (width / 5) * 2, y: height },
185
+ { x: (width / 5) * 3, y: 0 },
186
+ { x: (width / 5) * 4, y: height },
187
+ { x: (width / 5) * 5, y: 0 }
188
+ ],
189
+ {
190
+ scale: 1,
191
+ ...data
192
+ }
193
+ );
183
194
  },
184
195
  ceateLineArrow(data) {
185
196
  const line = new this.fabric.Line([data.left, data.top, data.left + data.width, data.top], {
@@ -199,10 +210,11 @@ export default {
199
210
  });
200
211
  return new this.fabric.Group([line, arrow], {
201
212
  scale: 1,
202
- ...data,
213
+ ...data
203
214
  });
204
215
  },
205
216
  async createPoint(type, data) {
217
+ data.hoverCursor = 'pointer';
206
218
  let obj1, obj2;
207
219
  switch (type) {
208
220
  case 'triangle':
@@ -228,21 +240,18 @@ export default {
228
240
  const common = {
229
241
  originX: 'center',
230
242
  originY: 'center',
231
- ...data,
243
+ ...data
232
244
  };
233
245
  if (data.url) {
234
- this.fabric.Image.fromURL(data.url, function (img) {
235
- const {
236
- width,
237
- height
238
- } = img;
246
+ this.fabric.Image.fromURL(data.url, function(img) {
247
+ const { width, height } = img;
239
248
  img.set({
240
249
  ...common,
241
250
  scaleX: (data.width || width) / width,
242
251
  scaleY: (data.height || height) / height,
243
252
  width: width || data.width,
244
253
  height: height || data.height,
245
- scale: (data.width || width) / width,
254
+ scale: (data.width || width) / width
246
255
  });
247
256
  resolve(img);
248
257
  });
@@ -266,7 +275,7 @@ export default {
266
275
  scale: 1,
267
276
  ...data,
268
277
  angle: 0
269
- })
278
+ });
270
279
  case 'shks':
271
280
  obj1 = new this.fabric.Circle({
272
281
  objectCaching: false,
@@ -280,15 +289,15 @@ export default {
280
289
  obj2 = this.createCircleBorder(data);
281
290
  return new this.fabric.Group([obj2, obj1], {
282
291
  scale: 1,
283
- ...data,
284
- })
292
+ ...data
293
+ });
285
294
  case 'cg':
286
295
  obj1 = this.ceateLineArrow(data);
287
296
  obj2 = this.createCircleBorder(data);
288
297
  return new this.fabric.Group([obj2, obj1], {
289
298
  scale: 1,
290
- ...data,
291
- })
299
+ ...data
300
+ });
292
301
  case 'jxtq':
293
302
  return this.createJXTQ(data);
294
303
  default:
@@ -299,10 +308,9 @@ export default {
299
308
  scale: 1,
300
309
  fontSize: 14,
301
310
  fill: '#000',
302
- ...data,
303
- })
304
-
311
+ ...data
312
+ });
305
313
  }
306
- },
314
+ }
307
315
  }
308
- };
316
+ };
@@ -1,9 +1,7 @@
1
-
2
1
  export default {
3
2
  name: 'eventCommon',
4
3
  data() {
5
- return {
6
- };
4
+ return {};
7
5
  },
8
6
  mounted() {
9
7
  if (this.eventStyle.evented) {
@@ -13,16 +11,17 @@ export default {
13
11
  },
14
12
  methods: {
15
13
  // 折线点移动限制 目前仅限制不能移动出画布
16
- pointMoveLimit(point) {
14
+ pointMoveLimit(point, isLimit = true) {
17
15
  point.setCoords(); // 需调用setCoords()才能重新计算控制位置(改变Object状态)
18
16
  // const objBoundingBox = point.getBoundingRect(); // 此方式会导致结果不精准,应该用point的top值判断
19
- const leftLimit = point.prevPoint ? point.prevPoint.get('left') : this.propItems.originX;
20
- const rightLimit = point.nextPoint ? point.nextPoint.get('left') : this.propItems.endX;
21
- if (point.top < this.propItems.originY) {
22
- point.set('top', this.propItems.originY);
17
+ const { originX, endX, originY, endY } = this.propItems;
18
+ const leftLimit = point.prevPoint?.get('left') || originX;
19
+ const rightLimit = (isLimit && point.nextPoint?.get('left')) || endX;
20
+ if (point.top < originY) {
21
+ point.set('top', originY);
23
22
  }
24
- if (point.top > this.propItems.endY) {
25
- point.set('top', this.propItems.endY);
23
+ if (point.top > endY) {
24
+ point.set('top', endY);
26
25
  }
27
26
  if (point.left < leftLimit) {
28
27
  point.set('left', leftLimit);