costy-plus 1.1.16-0 → 1.1.18-0

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.
@@ -5,20 +5,20 @@ import "element-ui/lib/theme-chalk/descriptions.css";
5
5
  import "element-ui/lib/theme-chalk/descriptions-item.css";
6
6
  import "./style/index.css";
7
7
  import "vue";
8
- import u, { mixins as d } from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
8
+ import l, { mixins as u } from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
9
9
  import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
10
10
  import { Button as a, Checkbox as m, Descriptions as c, DescriptionsItem as h } from "element-ui";
11
- import l from "../BackgroundGrid/index2.js";
11
+ import d from "../BackgroundGrid/index2.js";
12
12
  import f from "../MeasuringRuler/index2.js";
13
13
  import g from "../MeasuringRulerMore/index2.js";
14
14
  import { init as x } from "zrender";
15
15
  import w from "./medthod.js";
16
- var M = Object.defineProperty, v = Object.getOwnPropertyDescriptor, W = (e, t, n, r) => {
16
+ var M = Object.defineProperty, v = Object.getOwnPropertyDescriptor, b = (e, t, n, r) => {
17
17
  for (var i = r > 1 ? void 0 : r ? v(t, n) : t, o = e.length - 1, s; o >= 0; o--)
18
18
  (s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
19
19
  return r && i && M(t, n, i), i;
20
20
  };
21
- let p = class extends d(w) {
21
+ let p = class extends u(w) {
22
22
  mounted() {
23
23
  this.init();
24
24
  }
@@ -40,7 +40,7 @@ let p = class extends d(w) {
40
40
  this.AssistCtx = t.getContext("2d");
41
41
  }
42
42
  notifyMeasuringRuler(e) {
43
- e.name === "contextmenu" && (this.isMeasureRule = !1), this.$emit("notifyMeasuringRuler", e);
43
+ (e.name === "contextmenu" || e.name === "dblclick") && (this.isMeasureRule = !1), this.$emit("notifyMeasuringRuler", e);
44
44
  }
45
45
  combinationDrawing() {
46
46
  this.createLeadHead(), this.createLeadName(), this.createSensAndSpeed(), this.createWaveFrom(), this.drawWaveFrom(), this.drawMeasureLine(), this.calculatedValue(), this.electricAxisAnalyse(), this.processEnlargeAnalysis();
@@ -50,11 +50,11 @@ let p = class extends d(w) {
50
50
  return !isNaN(t) && (e >= 4800 || e === -32768) || e !== 0 && !e ? "-" : e;
51
51
  }
52
52
  };
53
- p = W([
54
- u({
53
+ p = b([
54
+ l({
55
55
  name: "EnlargeWaveView",
56
56
  components: {
57
- MXBackgroundGrid: l,
57
+ MXBackgroundGrid: d,
58
58
  MXMeasuringRuler: f,
59
59
  MeasuringRulerMore: g,
60
60
  [a.name]: a,
@@ -3,12 +3,12 @@ import C from "vue";
3
3
  import E from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
4
4
  import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
5
5
  import { Prop as f } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js";
6
- import { Text as O, Group as Y, Rect as u, Circle as F, init as j } from "zrender";
7
- import { calcMs as T, calcMV as S, calcBpm as $ } from "@costy-plus/utils";
8
- var G = Object.defineProperty, W = Object.getOwnPropertyDescriptor, l = (t, e, s, r) => {
9
- for (var c = r > 1 ? void 0 : r ? W(e, s) : e, a = t.length - 1, i; a >= 0; a--)
10
- (i = t[a]) && (c = (r ? i(e, s, c) : i(c)) || c);
11
- return r && c && G(e, s, c), c;
6
+ import { Text as O, Group as Y, Rect as y, Circle as F, init as j } from "zrender";
7
+ import { calcMs as k, calcMV as T, calcBpm as $ } from "@costy-plus/utils";
8
+ var S = Object.defineProperty, G = Object.getOwnPropertyDescriptor, l = (t, e, s, h) => {
9
+ for (var c = h > 1 ? void 0 : h ? G(e, s) : e, a = t.length - 1, i; a >= 0; a--)
10
+ (i = t[a]) && (c = (h ? i(e, s, c) : i(c)) || c);
11
+ return h && c && S(e, s, c), c;
12
12
  };
13
13
  let o = class extends C {
14
14
  constructor() {
@@ -38,7 +38,7 @@ let o = class extends C {
38
38
  }
39
39
  }), this.measuringRulerGroup = new Y({
40
40
  name: "measuringRuler"
41
- }), this.rectIns = new u({
41
+ }), this.rectIns = new y({
42
42
  name: "rect",
43
43
  style: {
44
44
  stroke: this.config.stroke,
@@ -55,16 +55,16 @@ let o = class extends C {
55
55
  let t;
56
56
  const e = ["nw-resize", "ne-resize", "se-resize", "sw-resize", "n-resize", "e-resize", "s-resize", "w-resize"];
57
57
  for (let s = 0; s < 8; s++)
58
- s > 3 ? t = new u({
58
+ s > 3 ? t = new y({
59
59
  name: `${s}_circle`,
60
60
  style: {
61
61
  stroke: this.config.circleLinestroke,
62
62
  lineWidth: this.config.circleLineW,
63
- fill: "transparent"
63
+ fill: "red"
64
64
  },
65
65
  shape: {
66
- width: 12,
67
- height: 12
66
+ width: 1,
67
+ height: 1
68
68
  },
69
69
  cursor: e[s],
70
70
  zlevel: 1,
@@ -74,7 +74,7 @@ let o = class extends C {
74
74
  style: {
75
75
  stroke: this.config.circleLinestroke,
76
76
  lineWidth: this.config.circleLineW,
77
- fill: "transparent"
77
+ fill: "black"
78
78
  },
79
79
  shape: {
80
80
  r: 12
@@ -84,7 +84,7 @@ let o = class extends C {
84
84
  draggable: !0
85
85
  }), t.hide(), this.measuringRulerGroup.add(t), this.circleList.push(t);
86
86
  this.measuringRulerGroup.add(
87
- new u({
87
+ new y({
88
88
  name: "main-box",
89
89
  style: {
90
90
  fill: "transparent"
@@ -114,13 +114,13 @@ let o = class extends C {
114
114
  }), (e = this.sceneIns) == null || e.add(this.measuringRulerGroup), this.sceneAddToEventListener(), this.rectAddToEventListener(), this.circleAddToEventListener();
115
115
  }
116
116
  calcText() {
117
- var r, c, a, i, h, n, g, p;
118
- const t = T(
119
- ((r = this.rectIns) == null ? void 0 : r.shape.width) || 0,
117
+ var h, c, a, i, r, n, g, p;
118
+ const t = k(
119
+ ((h = this.rectIns) == null ? void 0 : h.shape.width) || 0,
120
120
  this.speedValue,
121
121
  this.cellMg,
122
122
  this.magnification
123
- ), e = S(
123
+ ), e = T(
124
124
  ((c = this.rectIns) == null ? void 0 : c.shape.height) || 0,
125
125
  this.sens,
126
126
  this.magnification
@@ -130,7 +130,7 @@ let o = class extends C {
130
130
  text: `${t} ms
131
131
  ${s} bpm
132
132
  ${e} mV`,
133
- x: (((a = this.rectIns) == null ? void 0 : a.x) || 0) + (((i = this.rectIns) == null ? void 0 : i.shape.x) || 0) + (((h = this.rectIns) == null ? void 0 : h.shape.width) || 0) + 20,
133
+ x: (((a = this.rectIns) == null ? void 0 : a.x) || 0) + (((i = this.rectIns) == null ? void 0 : i.shape.x) || 0) + (((r = this.rectIns) == null ? void 0 : r.shape.width) || 0) + 20,
134
134
  y: (((n = this.rectIns) == null ? void 0 : n.y) || 0) + (((g = this.rectIns) == null ? void 0 : g.shape.y) || 0)
135
135
  }
136
136
  });
@@ -139,15 +139,19 @@ let o = class extends C {
139
139
  this.circleList.forEach((e) => t ? e.show() : e.hide());
140
140
  }
141
141
  sceneAddToEventListener() {
142
- var e, s, r, c;
143
- const t = (a) => {
144
- a.event.preventDefault(), this.$emit("notifyMeasuringRuler", {
142
+ var s, h, c, a, i;
143
+ const t = (r) => {
144
+ r.event.preventDefault(), this.$emit("notifyMeasuringRuler", {
145
145
  name: "contextmenu"
146
146
  });
147
+ }, e = (r) => {
148
+ this.$emit("notifyMeasuringRuler", {
149
+ name: "dblclick"
150
+ });
147
151
  };
148
- (e = this.sceneIns) == null || e.on("contextmenu", t), (s = this.sceneIns) == null || s.on("mousedown", this.sceneMousedown), (r = this.sceneIns) == null || r.on("mousemove", this.scenemousemove), (c = this.sceneIns) == null || c.on("mouseup", this.scenemouseup), this.$once("hook:beforeDestroy", () => {
149
- var a, i, h, n;
150
- (a = this.sceneIns) == null || a.off("contextmenu", t), (i = this.sceneIns) == null || i.off("mousedown", this.sceneMousedown), (h = this.sceneIns) == null || h.off("mousemove", this.scenemousemove), (n = this.sceneIns) == null || n.off("mouseup", this.scenemouseup);
152
+ (s = this.sceneIns) == null || s.on("contextmenu", t), (h = this.sceneIns) == null || h.on("mousedown", this.sceneMousedown), (c = this.sceneIns) == null || c.on("mousemove", this.scenemousemove), (a = this.sceneIns) == null || a.on("mouseup", this.scenemouseup), (i = this.sceneIns) == null || i.on("dblclick", e), this.$once("hook:beforeDestroy", () => {
153
+ var r, n, g, p, u;
154
+ (r = this.sceneIns) == null || r.off("contextmenu", t), (n = this.sceneIns) == null || n.off("mousedown", this.sceneMousedown), (g = this.sceneIns) == null || g.off("mousemove", this.scenemousemove), (p = this.sceneIns) == null || p.off("mouseup", this.scenemouseup), (u = this.sceneIns) == null || u.off("dblclick", e);
151
155
  });
152
156
  }
153
157
  sceneRemoveEventListener() {
@@ -173,7 +177,7 @@ let o = class extends C {
173
177
  });
174
178
  }
175
179
  scenemouseup(t) {
176
- var e, s, r, c, a, i, h, n, g, p, x, y, d, m, I, L, w, v, D, b, z, R, P, M, X;
180
+ var e, s, h, c, a, i, r, n, g, p, u, x, d, m, I, L, w, v, D, b, z, R, P, M, X;
177
181
  this.isMouseDown = !1, (e = this.rectIns) == null || e.attr({
178
182
  shape: {
179
183
  width: t.offsetX - this.rectIns.shape.x,
@@ -181,42 +185,42 @@ let o = class extends C {
181
185
  }
182
186
  }), this.circleList[0].attr({
183
187
  x: (s = this.rectIns) == null ? void 0 : s.shape.x,
184
- y: (r = this.rectIns) == null ? void 0 : r.shape.y
188
+ y: (h = this.rectIns) == null ? void 0 : h.shape.y
185
189
  }), this.circleList[1].attr({
186
190
  x: t.offsetX - (((c = this.rectIns) == null ? void 0 : c.shape.x) || 0) + (((a = this.rectIns) == null ? void 0 : a.shape.x) || 0),
187
191
  y: (i = this.rectIns) == null ? void 0 : i.shape.y
188
192
  }), this.circleList[2].attr({
189
- x: t.offsetX - (((h = this.rectIns) == null ? void 0 : h.shape.x) || 0) + (((n = this.rectIns) == null ? void 0 : n.shape.x) || 0),
193
+ x: t.offsetX - (((r = this.rectIns) == null ? void 0 : r.shape.x) || 0) + (((n = this.rectIns) == null ? void 0 : n.shape.x) || 0),
190
194
  y: t.offsetY - (((g = this.rectIns) == null ? void 0 : g.shape.y) || 0) + (((p = this.rectIns) == null ? void 0 : p.shape.y) || 0)
191
195
  }), this.circleList[3].attr({
192
- x: (x = this.rectIns) == null ? void 0 : x.shape.x,
193
- y: t.offsetY - (((y = this.rectIns) == null ? void 0 : y.shape.y) || 0) + (((d = this.rectIns) == null ? void 0 : d.shape.y) || 0)
196
+ x: (u = this.rectIns) == null ? void 0 : u.shape.x,
197
+ y: t.offsetY - (((x = this.rectIns) == null ? void 0 : x.shape.y) || 0) + (((d = this.rectIns) == null ? void 0 : d.shape.y) || 0)
194
198
  }), this.circleList[4].attr({
195
199
  x: ((m = this.rectIns) == null ? void 0 : m.shape.x) + 12,
196
- y: ((I = this.rectIns) == null ? void 0 : I.shape.y) - 12,
200
+ y: ((I = this.rectIns) == null ? void 0 : I.shape.y) - 1,
197
201
  shape: {
198
202
  width: t.offsetX - this.rectIns.shape.x - 24,
199
- height: 24
203
+ height: 2
200
204
  }
201
205
  }), this.circleList[5].attr({
202
- x: t.offsetX - (((L = this.rectIns) == null ? void 0 : L.shape.x) || 0) + (((w = this.rectIns) == null ? void 0 : w.shape.x) || 0) - 12,
206
+ x: t.offsetX - (((L = this.rectIns) == null ? void 0 : L.shape.x) || 0) + (((w = this.rectIns) == null ? void 0 : w.shape.x) || 0) - 1,
203
207
  y: ((v = this.rectIns) == null ? void 0 : v.shape.y) + 12,
204
208
  shape: {
205
- width: 24,
209
+ width: 2,
206
210
  height: t.offsetY - ((D = this.rectIns) == null ? void 0 : D.shape.y) - 24
207
211
  }
208
212
  }), this.circleList[6].attr({
209
213
  x: ((b = this.rectIns) == null ? void 0 : b.shape.x) + 12,
210
- y: t.offsetY - (((z = this.rectIns) == null ? void 0 : z.shape.y) || 0) + (((R = this.rectIns) == null ? void 0 : R.shape.y) || 0) - 12,
214
+ y: t.offsetY - (((z = this.rectIns) == null ? void 0 : z.shape.y) || 0) + (((R = this.rectIns) == null ? void 0 : R.shape.y) || 0) - 1,
211
215
  shape: {
212
216
  width: t.offsetX - this.rectIns.shape.x - 24,
213
- height: 24
217
+ height: 2
214
218
  }
215
219
  }), this.circleList[7].attr({
216
- x: ((P = this.rectIns) == null ? void 0 : P.shape.x) - 12,
220
+ x: ((P = this.rectIns) == null ? void 0 : P.shape.x) - 1,
217
221
  y: ((M = this.rectIns) == null ? void 0 : M.shape.y) + 12,
218
222
  shape: {
219
- width: 24,
223
+ width: 2,
220
224
  height: t.offsetY - ((X = this.rectIns) == null ? void 0 : X.shape.y) - 24
221
225
  }
222
226
  }), this.calcText(), this.circleHideOrShow(!0), this.sceneRemoveEventListener();
@@ -234,8 +238,8 @@ let o = class extends C {
234
238
  (e = this.rectIns) == null || e.setPosition([this.originReactPostion[0], this.originReactPostion[1]]);
235
239
  return;
236
240
  }
237
- this.originReactPostion = [t.target.x, t.target.y], this.circleList.forEach((s, r) => {
238
- r > 3 ? s.attr({
241
+ this.originReactPostion = [t.target.x, t.target.y], this.circleList.forEach((s, h) => {
242
+ h > 3 ? s.attr({
239
243
  shape: {
240
244
  x: t.target.x,
241
245
  y: t.target.y
@@ -266,50 +270,50 @@ let o = class extends C {
266
270
  const e = parseInt(t.target.name);
267
271
  if (isNaN(e))
268
272
  return;
269
- const s = t.offsetX - this.circleDragPos.x, r = t.offsetY - this.circleDragPos.y;
273
+ const s = t.offsetX - this.circleDragPos.x, h = t.offsetY - this.circleDragPos.y;
270
274
  this.circleDragPos.x = t.offsetX, this.circleDragPos.y = t.offsetY;
271
- let c = this.rectIns.shape.x, a = this.rectIns.shape.y, i = this.rectIns.shape.width, h = this.rectIns.shape.height;
272
- console.log("moveX", s, r), e === 0 ? (c += s, a += r, s < 0 ? i += -s : i -= s, r < 0 ? h += -r : h -= r, this.circleList[1].attr({
275
+ let c = this.rectIns.shape.x, a = this.rectIns.shape.y, i = this.rectIns.shape.width, r = this.rectIns.shape.height;
276
+ console.log("moveX", s, h), e === 0 ? (c += s, a += h, s < 0 ? i += -s : i -= s, h < 0 ? r += -h : r -= h, this.circleList[1].attr({
273
277
  y: t.target.y
274
278
  }), this.circleList[3].attr({
275
279
  x: t.target.x
276
280
  }), this.circleList[4].attr({
277
281
  x: t.target.x + 12,
278
- y: t.target.y - 12,
282
+ y: t.target.y - 1,
279
283
  shape: {
280
284
  width: i - 24
281
285
  }
282
286
  }), this.circleList[7].attr({
283
- x: t.target.x - 12,
287
+ x: t.target.x - 1,
284
288
  y: t.target.y + 12,
285
289
  shape: {
286
- height: h - 24
290
+ height: r - 24
287
291
  }
288
292
  }), this.circleList[5].attr({
289
293
  y: t.target.y + 12,
290
294
  shape: {
291
- height: h - 24
295
+ height: r - 24
292
296
  }
293
297
  }), this.circleList[6].attr({
294
298
  x: t.target.x + 12,
295
299
  shape: {
296
300
  width: i - 24
297
301
  }
298
- })) : e === 1 ? (a += r, i += s, r < 0 ? h += -r : h -= r, this.circleList[0].attr({
302
+ })) : e === 1 ? (a += h, i += s, h < 0 ? r += -h : r -= h, this.circleList[0].attr({
299
303
  y: t.target.y
300
304
  }), this.circleList[2].attr({
301
305
  x: t.target.x
302
306
  }), this.circleList[4].attr({
303
307
  x: t.target.x - i + 12,
304
- y: t.target.y - 12,
308
+ y: t.target.y - 1,
305
309
  shape: {
306
310
  width: i - 24
307
311
  }
308
312
  }), this.circleList[5].attr({
309
- x: t.target.x - 12,
313
+ x: t.target.x - 1,
310
314
  y: t.target.y + 12,
311
315
  shape: {
312
- height: h - 24
316
+ height: r - 24
313
317
  }
314
318
  }), this.circleList[6].attr({
315
319
  shape: {
@@ -318,19 +322,19 @@ let o = class extends C {
318
322
  }), this.circleList[7].attr({
319
323
  y: t.target.y + 12,
320
324
  shape: {
321
- height: h - 24
325
+ height: r - 24
322
326
  }
323
- })) : e === 2 ? (i += s, h += r, this.circleList[3].attr({
327
+ })) : e === 2 ? (i += s, r += h, this.circleList[3].attr({
324
328
  y: t.target.y
325
329
  }), this.circleList[1].attr({
326
330
  x: t.target.x
327
331
  }), this.circleList[5].attr({
328
- x: t.target.x - 12,
332
+ x: t.target.x - 1,
329
333
  shape: {
330
- height: h - 24
334
+ height: r - 24
331
335
  }
332
336
  }), this.circleList[6].attr({
333
- y: t.target.y - 12,
337
+ y: t.target.y - 1,
334
338
  shape: {
335
339
  width: i - 24
336
340
  }
@@ -340,22 +344,22 @@ let o = class extends C {
340
344
  }
341
345
  }), this.circleList[7].attr({
342
346
  shape: {
343
- height: h - 24
347
+ height: r - 24
344
348
  }
345
- })) : e === 3 ? (c += s, s < 0 ? i += -s : i -= s, h += r, this.circleList[2].attr({
349
+ })) : e === 3 ? (c += s, s < 0 ? i += -s : i -= s, r += h, this.circleList[2].attr({
346
350
  y: t.target.y
347
351
  }), this.circleList[0].attr({
348
352
  x: t.target.x
349
353
  }), this.circleList[6].attr({
350
354
  x: t.target.x + 12,
351
- y: t.target.y - 12,
355
+ y: t.target.y - 1,
352
356
  shape: {
353
357
  width: i - 24
354
358
  }
355
359
  }), this.circleList[7].attr({
356
- x: t.target.x - 12,
360
+ x: t.target.x - 1,
357
361
  shape: {
358
- height: h - 24
362
+ height: r - 24
359
363
  }
360
364
  }), this.circleList[4].attr({
361
365
  x: t.target.x + 12,
@@ -364,28 +368,28 @@ let o = class extends C {
364
368
  }
365
369
  }), this.circleList[5].attr({
366
370
  shape: {
367
- height: h - 24
371
+ height: r - 24
368
372
  }
369
- })) : e === 4 ? (a += r, r < 0 ? h += -r : h -= r, this.circleList[0].attr({
370
- y: t.target.y + 12
373
+ })) : e === 4 ? (a += h, h < 0 ? r += -h : r -= h, this.circleList[0].attr({
374
+ y: t.target.y + 1
371
375
  }), this.circleList[1].attr({
372
- y: t.target.y + 12
376
+ y: t.target.y + 1
373
377
  }), this.circleList[5].attr({
374
- y: t.target.y + 24,
378
+ y: t.target.y + 12,
375
379
  shape: {
376
- height: h - 24
380
+ height: r - 24
377
381
  }
378
382
  }), this.circleList[7].attr({
379
- y: t.target.y + 24,
383
+ y: t.target.y + 12,
380
384
  shape: {
381
- height: h - 24
385
+ height: r - 24
382
386
  }
383
387
  }), this.circleList[4].attr({
384
388
  x: c + 12
385
389
  })) : e === 5 ? (i += s, this.circleList[1].attr({
386
- x: t.target.x + 12
390
+ x: t.target.x + 1
387
391
  }), this.circleList[2].attr({
388
- x: t.target.x + 12
392
+ x: t.target.x + 1
389
393
  }), this.circleList[4].attr({
390
394
  shape: {
391
395
  width: i - 24
@@ -396,31 +400,31 @@ let o = class extends C {
396
400
  }
397
401
  }), this.circleList[5].attr({
398
402
  y: a + 12
399
- })) : e === 6 ? (h += r, this.circleList[2].attr({
400
- y: t.target.y + 12
403
+ })) : e === 6 ? (r += h, this.circleList[2].attr({
404
+ y: t.target.y + 1
401
405
  }), this.circleList[3].attr({
402
- y: t.target.y + 12
406
+ y: t.target.y + 1
403
407
  }), this.circleList[5].attr({
404
408
  shape: {
405
- height: h - 24
409
+ height: r - 24
406
410
  }
407
411
  }), this.circleList[7].attr({
408
412
  shape: {
409
- height: h - 24
413
+ height: r - 24
410
414
  }
411
415
  }), this.circleList[6].attr({
412
416
  x: c + 12
413
417
  })) : e === 7 && (c += s, s < 0 ? i += -s : i -= s, this.circleList[0].attr({
414
- x: t.target.x + 12
418
+ x: t.target.x + 1
415
419
  }), this.circleList[3].attr({
416
- x: t.target.x + 12
420
+ x: t.target.x + 1
417
421
  }), this.circleList[4].attr({
418
- x: t.target.x + 24,
422
+ x: t.target.x + 12,
419
423
  shape: {
420
424
  width: i - 24
421
425
  }
422
426
  }), this.circleList[6].attr({
423
- x: t.target.x + 24,
427
+ x: t.target.x + 12,
424
428
  shape: {
425
429
  width: i - 24
426
430
  }
@@ -431,7 +435,7 @@ let o = class extends C {
431
435
  x: c,
432
436
  y: a,
433
437
  width: i,
434
- height: h
438
+ height: r
435
439
  }
436
440
  }), this.calcText();
437
441
  }
@@ -1,16 +1,16 @@
1
1
  import "./style/index.css";
2
2
  import E from "vue";
3
- import P from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
3
+ import G from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
4
4
  import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
5
5
  import { Prop as p } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js";
6
- import { Group as F, Rect as L, init as G, Text as O, Circle as S } from "zrender";
7
- import { calcMs as T, calcMV as $, calcBpm as _ } from "@costy-plus/utils";
8
- var A = Object.defineProperty, W = Object.getOwnPropertyDescriptor, u = (t, e, s, r) => {
9
- for (var i = r > 1 ? void 0 : r ? W(e, s) : e, o = t.length - 1, h; o >= 0; o--)
10
- (h = t[o]) && (i = (r ? h(e, s, i) : h(i)) || i);
6
+ import { Group as P, Rect as L, init as F, Text as O, Circle as $ } from "zrender";
7
+ import { calcMs as S, calcMV as T, calcBpm as _ } from "@costy-plus/utils";
8
+ var A = Object.defineProperty, W = Object.getOwnPropertyDescriptor, g = (t, e, s, r) => {
9
+ for (var i = r > 1 ? void 0 : r ? W(e, s) : e, o = t.length - 1, n; o >= 0; o--)
10
+ (n = t[o]) && (i = (r ? n(e, s, i) : n(i)) || i);
11
11
  return r && i && A(e, s, i), i;
12
12
  };
13
- let g = class extends E {
13
+ let u = class extends E {
14
14
  constructor() {
15
15
  super(...arguments), this.sceneIns = Object.freeze(null), this.measuringRulerGroup = Object.freeze(null), this.rectInsList = Object.freeze([]), this.fontFamily = Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"), this.isMouseDown = Object.freeze(!1), this.moveReactName = Object.freeze("");
16
16
  }
@@ -19,7 +19,7 @@ let g = class extends E {
19
19
  (t = this.measuringRulerGroup) == null || t.removeAll(), (e = this.sceneIns) == null || e.dispose();
20
20
  }
21
21
  created() {
22
- this.rectInsList = [], this.measuringRulerGroup = new F({
22
+ this.rectInsList = [], this.measuringRulerGroup = new P({
23
23
  name: "measuringRuler"
24
24
  }), this.initConfig();
25
25
  }
@@ -53,23 +53,23 @@ let g = class extends E {
53
53
  const t = document.getElementById(
54
54
  `${this.prefixId}mx-measuring-ruler`
55
55
  );
56
- this.sceneIns = G(t, {
56
+ this.sceneIns = F(t, {
57
57
  width: this.width,
58
58
  height: this.height,
59
59
  devicePixelRatio: 2
60
60
  }), (e = this.sceneIns) == null || e.add(this.measuringRulerGroup), this.sceneAddToEventListener(), this.rectAddToEventListener(), this.circleAddToEventListener();
61
61
  }
62
62
  calcText() {
63
- var i, o, h, l, n, f, a, c, d, x;
63
+ var i, o, n, l, h, f, a, c, d, x;
64
64
  let t, e = 0, s = "", r = 0;
65
65
  for (let m = 0; m < this.rectInsList.length; m++)
66
66
  if (t = this.rectInsList[m], ((i = t.react) == null ? void 0 : i.name) === this.moveReactName && ((o = t.react) == null ? void 0 : o.shape.width)) {
67
- e = T(
68
- ((h = t.react) == null ? void 0 : h.shape.width) || 0,
67
+ e = S(
68
+ ((n = t.react) == null ? void 0 : n.shape.width) || 0,
69
69
  this.speedValue,
70
70
  this.cellMg,
71
71
  this.magnification
72
- ), s = $(
72
+ ), s = T(
73
73
  ((l = t.react) == null ? void 0 : l.shape.height) || 0,
74
74
  this.sens,
75
75
  this.magnification
@@ -78,7 +78,7 @@ let g = class extends E {
78
78
  text: `${e} ms
79
79
  ${r} bpm
80
80
  ${s} mV`,
81
- x: (((n = t.react) == null ? void 0 : n.x) || 0) + (((f = t.react) == null ? void 0 : f.shape.x) || 0) + (((a = t.react) == null ? void 0 : a.shape.width) || 0) + 20,
81
+ x: (((h = t.react) == null ? void 0 : h.x) || 0) + (((f = t.react) == null ? void 0 : f.shape.x) || 0) + (((a = t.react) == null ? void 0 : a.shape.width) || 0) + 20,
82
82
  y: (((c = t.react) == null ? void 0 : c.y) || 0) + (((d = t.react) == null ? void 0 : d.shape.y) || 0)
83
83
  }
84
84
  });
@@ -97,16 +97,21 @@ let g = class extends E {
97
97
  e = null;
98
98
  }
99
99
  sceneAddToEventListener() {
100
- var e, s, r, i;
101
- const t = (o) => {
100
+ var s, r, i, o, n;
101
+ const t = (l) => {
102
102
  var h;
103
- o.event.preventDefault(), this.clearCanvas(), this.initConfig(), (h = this.sceneIns) == null || h.add(this.measuringRulerGroup), this.$emit("notifyMeasuringRuler", {
103
+ l.event.preventDefault(), this.clearCanvas(), this.initConfig(), (h = this.sceneIns) == null || h.add(this.measuringRulerGroup), this.$emit("notifyMeasuringRuler", {
104
104
  name: "contextmenu"
105
105
  });
106
+ }, e = (l) => {
107
+ var h;
108
+ this.clearCanvas(), this.initConfig(), (h = this.sceneIns) == null || h.add(this.measuringRulerGroup), this.$emit("notifyMeasuringRuler", {
109
+ name: "dblclick"
110
+ });
106
111
  };
107
- (e = this.sceneIns) == null || e.on("contextmenu", t), (s = this.sceneIns) == null || s.on("mousedown", this.sceneMousedown), (r = this.sceneIns) == null || r.on("mousemove", this.scenemousemove), (i = this.sceneIns) == null || i.on("mouseup", this.scenemouseup), this.$once("hook:beforeDestroy", () => {
108
- var o, h, l, n;
109
- (o = this.sceneIns) == null || o.off("contextmenu", t), (h = this.sceneIns) == null || h.off("mousedown", this.sceneMousedown), (l = this.sceneIns) == null || l.off("mousemove", this.scenemousemove), (n = this.sceneIns) == null || n.off("mouseup", this.scenemouseup);
112
+ (s = this.sceneIns) == null || s.on("contextmenu", t), (r = this.sceneIns) == null || r.on("mousedown", this.sceneMousedown), (i = this.sceneIns) == null || i.on("mousemove", this.scenemousemove), (o = this.sceneIns) == null || o.on("mouseup", this.scenemouseup), (n = this.sceneIns) == null || n.on("dblclick", e), this.$once("hook:beforeDestroy", () => {
113
+ var l, h, f, a, c;
114
+ (l = this.sceneIns) == null || l.off("contextmenu", t), (h = this.sceneIns) == null || h.off("mousedown", this.sceneMousedown), (f = this.sceneIns) == null || f.off("mousemove", this.scenemousemove), (a = this.sceneIns) == null || a.off("mouseup", this.scenemouseup), (c = this.sceneIns) == null || c.off("dblclick", e);
110
115
  });
111
116
  }
112
117
  sceneRemoveEventListener() {
@@ -138,11 +143,11 @@ let g = class extends E {
138
143
  fontWeight: "bold"
139
144
  }
140
145
  }), o = [];
141
- let h;
146
+ let n;
142
147
  const l = ["nw-resize", "ne-resize", "se-resize", "sw-resize", "n-resize", "e-resize", "s-resize", "w-resize"];
143
- for (let n = 0; n < 8; n++)
144
- n > 3 ? h = new L({
145
- name: `${n}_circle`,
148
+ for (let h = 0; h < 8; h++)
149
+ h > 3 ? n = new L({
150
+ name: `${h}_circle`,
146
151
  customName: t,
147
152
  style: {
148
153
  stroke: this.config.circleLinestroke,
@@ -150,16 +155,16 @@ let g = class extends E {
150
155
  fill: "transparent"
151
156
  },
152
157
  shape: {
153
- width: 12,
154
- height: 12
158
+ width: 1,
159
+ height: 1
155
160
  },
156
- cursor: l[n],
161
+ cursor: l[h],
157
162
  zlevel: 1,
158
163
  draggable: !0,
159
164
  ondrag: this.circleDrag,
160
165
  ondragstart: this.circleDragStart
161
- }) : h = new S({
162
- name: `${n}_circle`,
166
+ }) : n = new $({
167
+ name: `${h}_circle`,
163
168
  customName: t,
164
169
  style: {
165
170
  stroke: this.config.circleLinestroke,
@@ -169,12 +174,12 @@ let g = class extends E {
169
174
  shape: {
170
175
  r: 12
171
176
  },
172
- cursor: l[n],
177
+ cursor: l[h],
173
178
  zlevel: 1,
174
179
  draggable: !0,
175
180
  ondrag: this.circleDrag,
176
181
  ondragstart: this.circleDragStart
177
- }), h.hide(), this.measuringRulerGroup.add(h), o.push(h);
182
+ }), n.hide(), this.measuringRulerGroup.add(n), o.push(n);
178
183
  return this.measuringRulerGroup.add(i), this.measuringRulerGroup.add(r), {
179
184
  react: r,
180
185
  text: i,
@@ -215,7 +220,7 @@ let g = class extends E {
215
220
  e = null;
216
221
  }
217
222
  scenemouseup(t) {
218
- var s, r, i, o, h, l, n, f, a, c, d, x, m, w, v, I, R, D, b, N, z, C, M, X, k, Y;
223
+ var s, r, i, o, n, l, h, f, a, c, d, x, m, v, w, I, R, D, b, N, C, z, M, k, X, Y;
219
224
  this.isMouseDown = !1;
220
225
  let e;
221
226
  for (let y = 0; y < this.rectInsList.length; y++)
@@ -229,40 +234,40 @@ let g = class extends E {
229
234
  x: (i = e.react) == null ? void 0 : i.shape.x,
230
235
  y: (o = e.react) == null ? void 0 : o.shape.y
231
236
  }), e.circleList[1].attr({
232
- x: t.offsetX - (((h = e.react) == null ? void 0 : h.shape.x) || 0) + (((l = e.react) == null ? void 0 : l.shape.x) || 0),
233
- y: (n = e.react) == null ? void 0 : n.shape.y
237
+ x: t.offsetX - (((n = e.react) == null ? void 0 : n.shape.x) || 0) + (((l = e.react) == null ? void 0 : l.shape.x) || 0),
238
+ y: (h = e.react) == null ? void 0 : h.shape.y
234
239
  }), e.circleList[2].attr({
235
240
  x: t.offsetX - (((f = e.react) == null ? void 0 : f.shape.x) || 0) + (((a = e.react) == null ? void 0 : a.shape.x) || 0),
236
241
  y: t.offsetY - (((c = e.react) == null ? void 0 : c.shape.y) || 0) + (((d = e.react) == null ? void 0 : d.shape.y) || 0)
237
242
  }), e.circleList[3].attr({
238
243
  x: (x = e.react) == null ? void 0 : x.shape.x,
239
- y: t.offsetY - (((m = e.react) == null ? void 0 : m.shape.y) || 0) + (((w = e.react) == null ? void 0 : w.shape.y) || 0)
244
+ y: t.offsetY - (((m = e.react) == null ? void 0 : m.shape.y) || 0) + (((v = e.react) == null ? void 0 : v.shape.y) || 0)
240
245
  }), e.circleList[4].attr({
241
- x: ((v = e.react) == null ? void 0 : v.shape.x) + 12,
242
- y: ((I = e.react) == null ? void 0 : I.shape.y) - 12,
246
+ x: ((w = e.react) == null ? void 0 : w.shape.x) + 12,
247
+ y: ((I = e.react) == null ? void 0 : I.shape.y) - 1,
243
248
  shape: {
244
249
  width: t.offsetX - e.react.shape.x - 24,
245
- height: 24
250
+ height: 2
246
251
  }
247
252
  }), e.circleList[5].attr({
248
- x: t.offsetX - (((R = e.react) == null ? void 0 : R.shape.x) || 0) + (((D = e.react) == null ? void 0 : D.shape.x) || 0) - 12,
253
+ x: t.offsetX - (((R = e.react) == null ? void 0 : R.shape.x) || 0) + (((D = e.react) == null ? void 0 : D.shape.x) || 0) - 1,
249
254
  y: ((b = e.react) == null ? void 0 : b.shape.y) + 12,
250
255
  shape: {
251
- width: 24,
256
+ width: 2,
252
257
  height: t.offsetY - ((N = e.react) == null ? void 0 : N.shape.y) - 24
253
258
  }
254
259
  }), e.circleList[6].attr({
255
- x: ((z = e.react) == null ? void 0 : z.shape.x) + 12,
256
- y: t.offsetY - (((C = e.react) == null ? void 0 : C.shape.y) || 0) + (((M = e.react) == null ? void 0 : M.shape.y) || 0) - 12,
260
+ x: ((C = e.react) == null ? void 0 : C.shape.x) + 12,
261
+ y: t.offsetY - (((z = e.react) == null ? void 0 : z.shape.y) || 0) + (((M = e.react) == null ? void 0 : M.shape.y) || 0) - 1,
257
262
  shape: {
258
263
  width: t.offsetX - e.react.shape.x - 24,
259
- height: 24
264
+ height: 2
260
265
  }
261
266
  }), e.circleList[7].attr({
262
- x: ((X = e.react) == null ? void 0 : X.shape.x) - 12,
263
- y: ((k = e.react) == null ? void 0 : k.shape.y) + 12,
267
+ x: ((k = e.react) == null ? void 0 : k.shape.x) - 1,
268
+ y: ((X = e.react) == null ? void 0 : X.shape.y) + 12,
264
269
  shape: {
265
- width: 24,
270
+ width: 2,
266
271
  height: t.offsetY - ((Y = e.react) == null ? void 0 : Y.shape.y) - 24
267
272
  }
268
273
  }), this.calcText(), this.circleHideOrShow(!0);
@@ -285,8 +290,8 @@ let g = class extends E {
285
290
  let e;
286
291
  for (let i = 0; i < this.rectInsList.length; i++) {
287
292
  if (e = this.rectInsList[i], ((s = e.react) == null ? void 0 : s.name) === this.moveReactName) {
288
- e.circleList.forEach((o, h) => {
289
- h > 3 ? o.attr({
293
+ e.circleList.forEach((o, n) => {
294
+ n > 3 ? o.attr({
290
295
  shape: {
291
296
  x: t.target.x,
292
297
  y: t.target.y
@@ -327,7 +332,7 @@ let g = class extends E {
327
332
  e = null, this.moveReactName = "";
328
333
  }
329
334
  circleDrag(t) {
330
- var o, h;
335
+ var o, n;
331
336
  console.log("circleDrag--\u8FD9\u91CC", t), this.moveReactName = t.target.customName;
332
337
  const e = parseInt(t.target.name);
333
338
  if (isNaN(e))
@@ -336,19 +341,19 @@ let g = class extends E {
336
341
  for (let l = 0; l < this.rectInsList.length; l++)
337
342
  if (s = this.rectInsList[l], ((o = s.react) == null ? void 0 : o.name) === this.moveReactName) {
338
343
  r = t.offsetX - s.circleDragPos.x, i = t.offsetY - s.circleDragPos.y, s.circleDragPos.x = t.offsetX, s.circleDragPos.y = t.offsetY;
339
- let n = s.react.shape.x, f = s.react.shape.y, a = s.react.shape.width, c = s.react.shape.height;
340
- console.log("moveX", r, i), e === 0 ? (n += r, f += i, r < 0 ? a += -r : a -= r, i < 0 ? c += -i : c -= i, s.circleList[1].attr({
344
+ let h = s.react.shape.x, f = s.react.shape.y, a = s.react.shape.width, c = s.react.shape.height;
345
+ console.log("moveX", r, i), e === 0 ? (h += r, f += i, r < 0 ? a += -r : a -= r, i < 0 ? c += -i : c -= i, s.circleList[1].attr({
341
346
  y: t.target.y
342
347
  }), s.circleList[3].attr({
343
348
  x: t.target.x
344
349
  }), s.circleList[4].attr({
345
350
  x: t.target.x + 12,
346
- y: t.target.y - 12,
351
+ y: t.target.y - 1,
347
352
  shape: {
348
353
  width: a - 24
349
354
  }
350
355
  }), s.circleList[7].attr({
351
- x: t.target.x - 12,
356
+ x: t.target.x - 1,
352
357
  y: t.target.y + 12,
353
358
  shape: {
354
359
  height: c - 24
@@ -369,12 +374,12 @@ let g = class extends E {
369
374
  x: t.target.x
370
375
  }), s.circleList[4].attr({
371
376
  x: t.target.x - a + 12,
372
- y: t.target.y - 12,
377
+ y: t.target.y - 1,
373
378
  shape: {
374
379
  width: a - 24
375
380
  }
376
381
  }), s.circleList[5].attr({
377
- x: t.target.x - 12,
382
+ x: t.target.x - 1,
378
383
  y: t.target.y + 12,
379
384
  shape: {
380
385
  height: c - 24
@@ -393,12 +398,12 @@ let g = class extends E {
393
398
  }), s.circleList[1].attr({
394
399
  x: t.target.x
395
400
  }), s.circleList[5].attr({
396
- x: t.target.x - 12,
401
+ x: t.target.x - 1,
397
402
  shape: {
398
403
  height: c - 24
399
404
  }
400
405
  }), s.circleList[6].attr({
401
- y: t.target.y - 12,
406
+ y: t.target.y - 1,
402
407
  shape: {
403
408
  width: a - 24
404
409
  }
@@ -410,18 +415,18 @@ let g = class extends E {
410
415
  shape: {
411
416
  height: c - 24
412
417
  }
413
- })) : e === 3 ? (n += r, r < 0 ? a += -r : a -= r, c += i, s.circleList[2].attr({
418
+ })) : e === 3 ? (h += r, r < 0 ? a += -r : a -= r, c += i, s.circleList[2].attr({
414
419
  y: t.target.y
415
420
  }), s.circleList[0].attr({
416
421
  x: t.target.x
417
422
  }), s.circleList[6].attr({
418
423
  x: t.target.x + 12,
419
- y: t.target.y - 12,
424
+ y: t.target.y - 1,
420
425
  shape: {
421
426
  width: a - 24
422
427
  }
423
428
  }), s.circleList[7].attr({
424
- x: t.target.x - 12,
429
+ x: t.target.x - 1,
425
430
  shape: {
426
431
  height: c - 24
427
432
  }
@@ -435,25 +440,25 @@ let g = class extends E {
435
440
  height: c - 24
436
441
  }
437
442
  })) : e === 4 ? (f += i, i < 0 ? c += -i : c -= i, s.circleList[0].attr({
438
- y: t.target.y + 12
443
+ y: t.target.y + 1
439
444
  }), s.circleList[1].attr({
440
- y: t.target.y + 12
445
+ y: t.target.y + 1
441
446
  }), s.circleList[5].attr({
442
- y: t.target.y + 24,
447
+ y: t.target.y + 12,
443
448
  shape: {
444
449
  height: c - 24
445
450
  }
446
451
  }), s.circleList[7].attr({
447
- y: t.target.y + 24,
452
+ y: t.target.y + 12,
448
453
  shape: {
449
454
  height: c - 24
450
455
  }
451
456
  }), s.circleList[4].attr({
452
- x: n + 12
457
+ x: h + 12
453
458
  })) : e === 5 ? (a += r, s.circleList[1].attr({
454
- x: t.target.x + 12
459
+ x: t.target.x + 1
455
460
  }), s.circleList[2].attr({
456
- x: t.target.x + 12
461
+ x: t.target.x + 1
457
462
  }), s.circleList[4].attr({
458
463
  shape: {
459
464
  width: a - 24
@@ -465,9 +470,9 @@ let g = class extends E {
465
470
  }), s.circleList[5].attr({
466
471
  y: f + 12
467
472
  })) : e === 6 ? (c += i, s.circleList[2].attr({
468
- y: t.target.y + 12
473
+ y: t.target.y + 1
469
474
  }), s.circleList[3].attr({
470
- y: t.target.y + 12
475
+ y: t.target.y + 1
471
476
  }), s.circleList[5].attr({
472
477
  shape: {
473
478
  height: c - 24
@@ -477,26 +482,26 @@ let g = class extends E {
477
482
  height: c - 24
478
483
  }
479
484
  }), s.circleList[6].attr({
480
- x: n + 12
481
- })) : e === 7 && (n += r, r < 0 ? a += -r : a -= r, s.circleList[0].attr({
482
- x: t.target.x + 12
485
+ x: h + 12
486
+ })) : e === 7 && (h += r, r < 0 ? a += -r : a -= r, s.circleList[0].attr({
487
+ x: t.target.x + 1
483
488
  }), s.circleList[3].attr({
484
- x: t.target.x + 12
489
+ x: t.target.x + 1
485
490
  }), s.circleList[4].attr({
486
- x: t.target.x + 24,
491
+ x: t.target.x + 12,
487
492
  shape: {
488
493
  width: a - 24
489
494
  }
490
495
  }), s.circleList[6].attr({
491
- x: t.target.x + 24,
496
+ x: t.target.x + 12,
492
497
  shape: {
493
498
  width: a - 24
494
499
  }
495
500
  }), s.circleList[7].attr({
496
501
  y: f + 12
497
- })), (h = s.react) == null || h.attr({
502
+ })), (n = s.react) == null || n.attr({
498
503
  shape: {
499
- x: n,
504
+ x: h,
500
505
  y: f,
501
506
  width: a,
502
507
  height: c
@@ -507,26 +512,26 @@ let g = class extends E {
507
512
  s = null, this.moveReactName = "";
508
513
  }
509
514
  };
510
- u([
515
+ g([
511
516
  p({
512
517
  default: () => ""
513
518
  })
514
- ], g.prototype, "prefixId", 2);
515
- u([
519
+ ], u.prototype, "prefixId", 2);
520
+ g([
516
521
  p({
517
522
  required: !0,
518
523
  type: Number,
519
524
  validator: (t) => typeof t == "number"
520
525
  })
521
- ], g.prototype, "width", 2);
522
- u([
526
+ ], u.prototype, "width", 2);
527
+ g([
523
528
  p({
524
529
  required: !0,
525
530
  type: Number,
526
531
  validator: (t) => typeof t == "number"
527
532
  })
528
- ], g.prototype, "height", 2);
529
- u([
533
+ ], u.prototype, "height", 2);
534
+ g([
530
535
  p({
531
536
  default: () => ({
532
537
  lineW: 0.6,
@@ -537,35 +542,35 @@ u([
537
542
  textFontSize: 12
538
543
  })
539
544
  })
540
- ], g.prototype, "config", 2);
541
- u([
545
+ ], u.prototype, "config", 2);
546
+ g([
542
547
  p({
543
548
  required: !0
544
549
  })
545
- ], g.prototype, "speedValue", 2);
546
- u([
550
+ ], u.prototype, "speedValue", 2);
551
+ g([
547
552
  p({
548
553
  required: !0
549
554
  })
550
- ], g.prototype, "cellMg", 2);
551
- u([
555
+ ], u.prototype, "cellMg", 2);
556
+ g([
552
557
  p({
553
558
  default: 1
554
559
  })
555
- ], g.prototype, "magnification", 2);
556
- u([
560
+ ], u.prototype, "magnification", 2);
561
+ g([
557
562
  p({
558
563
  default: 1
559
564
  })
560
- ], g.prototype, "sens", 2);
561
- u([
565
+ ], u.prototype, "sens", 2);
566
+ g([
562
567
  p({ default: () => "" })
563
- ], g.prototype, "className", 2);
564
- g = u([
565
- P({
568
+ ], u.prototype, "className", 2);
569
+ u = g([
570
+ G({
566
571
  name: "MXMeasuringRuler"
567
572
  })
568
- ], g);
573
+ ], u);
569
574
  export {
570
- g as default
575
+ u as default
571
576
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("element-ui/lib/theme-chalk/button.css");require("element-ui/lib/theme-chalk/icon.css");require("element-ui/lib/theme-chalk/checkbox.css");require("element-ui/lib/theme-chalk/descriptions.css");require("element-ui/lib/theme-chalk/descriptions-item.css");require("./style/index.css");require("vue");const u=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const i=require("element-ui"),c=require("../BackgroundGrid/index2.js"),l=require("../MeasuringRuler/index2.js"),d=require("../MeasuringRulerMore/index2.js"),m=require("zrender"),h=require("./medthod.js");var p=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=(e,t,s,r)=>{for(var n=r>1?void 0:r?f(t,s):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(r?a(t,s,n):a(n))||n);return r&&n&&p(t,s,n),n};exports.default=class extends u.mixins(h.default){mounted(){this.init()}init(){this.initWaveFormPeer(),this.combinationDrawing()}initWaveFormPeer(){const e=document.getElementById(`${this.prefixId}enlarge-wave-from-box`);this.sceneIns=m.init(e,{width:this.containerWH.width,height:this.containerWH.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXEnlargeGrid`);this.AssistCtx=t.getContext("2d")}notifyMeasuringRuler(e){e.name==="contextmenu"&&(this.isMeasureRule=!1),this.$emit("notifyMeasuringRuler",e)}combinationDrawing(){this.createLeadHead(),this.createLeadName(),this.createSensAndSpeed(),this.createWaveFrom(),this.drawWaveFrom(),this.drawMeasureLine(),this.calculatedValue(),this.electricAxisAnalyse(),this.processEnlargeAnalysis()}renderEnlargeAnalysisData(e){const t=+e;return!isNaN(t)&&(e>=4800||e===-32768)||e!==0&&!e?"-":e}};exports.default=g([u.default({name:"EnlargeWaveView",components:{MXBackgroundGrid:c.default,MXMeasuringRuler:l.default,MeasuringRulerMore:d.default,[i.Button.name]:i.Button,[i.Checkbox.name]:i.Checkbox,[i.Descriptions.name]:i.Descriptions,[i.DescriptionsItem.name]:i.DescriptionsItem}})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("element-ui/lib/theme-chalk/button.css");require("element-ui/lib/theme-chalk/icon.css");require("element-ui/lib/theme-chalk/checkbox.css");require("element-ui/lib/theme-chalk/descriptions.css");require("element-ui/lib/theme-chalk/descriptions-item.css");require("./style/index.css");require("vue");const a=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const i=require("element-ui"),c=require("../BackgroundGrid/index2.js"),l=require("../MeasuringRuler/index2.js"),d=require("../MeasuringRulerMore/index2.js"),m=require("zrender"),h=require("./medthod.js");var p=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=(e,t,s,r)=>{for(var n=r>1?void 0:r?f(t,s):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(n=(r?u(t,s,n):u(n))||n);return r&&n&&p(t,s,n),n};exports.default=class extends a.mixins(h.default){mounted(){this.init()}init(){this.initWaveFormPeer(),this.combinationDrawing()}initWaveFormPeer(){const e=document.getElementById(`${this.prefixId}enlarge-wave-from-box`);this.sceneIns=m.init(e,{width:this.containerWH.width,height:this.containerWH.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXEnlargeGrid`);this.AssistCtx=t.getContext("2d")}notifyMeasuringRuler(e){(e.name==="contextmenu"||e.name==="dblclick")&&(this.isMeasureRule=!1),this.$emit("notifyMeasuringRuler",e)}combinationDrawing(){this.createLeadHead(),this.createLeadName(),this.createSensAndSpeed(),this.createWaveFrom(),this.drawWaveFrom(),this.drawMeasureLine(),this.calculatedValue(),this.electricAxisAnalyse(),this.processEnlargeAnalysis()}renderEnlargeAnalysisData(e){const t=+e;return!isNaN(t)&&(e>=4800||e===-32768)||e!==0&&!e?"-":e}};exports.default=g([a.default({name:"EnlargeWaveView",components:{MXBackgroundGrid:c.default,MXMeasuringRuler:l.default,MeasuringRulerMore:d.default,[i.Button.name]:i.Button,[i.Checkbox.name]:i.Checkbox,[i.Descriptions.name]:i.Descriptions,[i.DescriptionsItem.name]:i.DescriptionsItem}})],exports.default);
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const j=require("vue"),C=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const l=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),u=require("zrender"),g=require("@costy-plus/utils"),E=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},O=E(j);var X=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,n=(t,e,s,r)=>{for(var c=r>1?void 0:r?Y(e,s):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(c=(r?i(e,s,c):i(c))||c);return r&&c&&X(e,s,c),c};exports.default=class extends O.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectIns=Object.freeze(null),this.textIns=Object.freeze(null),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.circleList=Object.freeze([]),this.isMouseDown=Object.freeze(!1),this.originReactPostion=Object.freeze([]),this.circleDragPos=Object.freeze({x:0,y:0})}destroyed(){var t,e;(t=this.measuringRulerGroup)==null||t.removeAll(),(e=this.sceneIns)==null||e.dispose()}created(){this.initConfig()}initConfig(){this.circleList=[],this.circleDragPos={x:0,y:0},this.textIns=new u.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),this.measuringRulerGroup=new u.Group({name:"measuringRuler"}),this.rectIns=new u.Rect({name:"rect",style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:0,y:0},cursor:"move",draggable:!0});let t;const e=["nw-resize","ne-resize","se-resize","sw-resize","n-resize","e-resize","s-resize","w-resize"];for(let s=0;s<8;s++)s>3?t=new u.Rect({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{width:12,height:12},cursor:e[s],zlevel:1,draggable:!0}):t=new u.Circle({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:e[s],zlevel:1,draggable:!0}),t.hide(),this.measuringRulerGroup.add(t),this.circleList.push(t);this.measuringRulerGroup.add(new u.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"})),this.measuringRulerGroup.add(this.rectIns),this.measuringRulerGroup.add(this.textIns)}mounted(){this.init()}init(){var e;const t=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=u.init(t,{width:this.width,height:this.height,devicePixelRatio:2}),(e=this.sceneIns)==null||e.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var r,c,a,i,h,o,p,f;const t=g.calcMs(((r=this.rectIns)==null?void 0:r.shape.width)||0,this.speedValue,this.cellMg,this.magnification),e=g.calcMV(((c=this.rectIns)==null?void 0:c.shape.height)||0,this.sens,this.magnification),s=t!==0&&g.calcBpm(t)||0;(f=this.textIns)==null||f.attr({style:{text:`${t} ms
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const C=require("vue"),j=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const l=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),p=require("zrender"),d=require("@costy-plus/utils"),E=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},O=E(C);var X=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,n=(t,e,s,h)=>{for(var c=h>1?void 0:h?Y(e,s):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(c=(h?i(e,s,c):i(c))||c);return h&&c&&X(e,s,c),c};exports.default=class extends O.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectIns=Object.freeze(null),this.textIns=Object.freeze(null),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.circleList=Object.freeze([]),this.isMouseDown=Object.freeze(!1),this.originReactPostion=Object.freeze([]),this.circleDragPos=Object.freeze({x:0,y:0})}destroyed(){var t,e;(t=this.measuringRulerGroup)==null||t.removeAll(),(e=this.sceneIns)==null||e.dispose()}created(){this.initConfig()}initConfig(){this.circleList=[],this.circleDragPos={x:0,y:0},this.textIns=new p.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),this.measuringRulerGroup=new p.Group({name:"measuringRuler"}),this.rectIns=new p.Rect({name:"rect",style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:0,y:0},cursor:"move",draggable:!0});let t;const e=["nw-resize","ne-resize","se-resize","sw-resize","n-resize","e-resize","s-resize","w-resize"];for(let s=0;s<8;s++)s>3?t=new p.Rect({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"red"},shape:{width:1,height:1},cursor:e[s],zlevel:1,draggable:!0}):t=new p.Circle({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"black"},shape:{r:12},cursor:e[s],zlevel:1,draggable:!0}),t.hide(),this.measuringRulerGroup.add(t),this.circleList.push(t);this.measuringRulerGroup.add(new p.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"})),this.measuringRulerGroup.add(this.rectIns),this.measuringRulerGroup.add(this.textIns)}mounted(){this.init()}init(){var e;const t=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=p.init(t,{width:this.width,height:this.height,devicePixelRatio:2}),(e=this.sceneIns)==null||e.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var h,c,a,i,r,o,u,f;const t=d.calcMs(((h=this.rectIns)==null?void 0:h.shape.width)||0,this.speedValue,this.cellMg,this.magnification),e=d.calcMV(((c=this.rectIns)==null?void 0:c.shape.height)||0,this.sens,this.magnification),s=t!==0&&d.calcBpm(t)||0;(f=this.textIns)==null||f.attr({style:{text:`${t} ms
2
2
  ${s} bpm
3
- ${e} mV`,x:(((a=this.rectIns)==null?void 0:a.x)||0)+(((i=this.rectIns)==null?void 0:i.shape.x)||0)+(((h=this.rectIns)==null?void 0:h.shape.width)||0)+20,y:(((o=this.rectIns)==null?void 0:o.y)||0)+(((p=this.rectIns)==null?void 0:p.shape.y)||0)}})}circleHideOrShow(t){this.circleList.forEach(e=>t?e.show():e.hide())}sceneAddToEventListener(){var e,s,r,c;const t=a=>{a.event.preventDefault(),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})};(e=this.sceneIns)==null||e.on("contextmenu",t),(s=this.sceneIns)==null||s.on("mousedown",this.sceneMousedown),(r=this.sceneIns)==null||r.on("mousemove",this.scenemousemove),(c=this.sceneIns)==null||c.on("mouseup",this.scenemouseup),this.$once("hook:beforeDestroy",()=>{var a,i,h,o;(a=this.sceneIns)==null||a.off("contextmenu",t),(i=this.sceneIns)==null||i.off("mousedown",this.sceneMousedown),(h=this.sceneIns)==null||h.off("mousemove",this.scenemousemove),(o=this.sceneIns)==null||o.off("mouseup",this.scenemouseup)})}sceneRemoveEventListener(){var t,e,s;(t=this.sceneIns)==null||t.off("mousedown",this.sceneMousedown),(e=this.sceneIns)==null||e.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}sceneMousedown(t){var e;this.isMouseDown=!0,(e=this.rectIns)==null||e.attr({shape:{x:t.offsetX,y:t.offsetY}})}scenemousemove(t){var e;!this.isMouseDown||(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}})}scenemouseup(t){var e,s,r,c,a,i,h,o,p,f,d,y,x,m,I,L,w,v,D,b,P,_,z,R,M;this.isMouseDown=!1,(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}}),this.circleList[0].attr({x:(s=this.rectIns)==null?void 0:s.shape.x,y:(r=this.rectIns)==null?void 0:r.shape.y}),this.circleList[1].attr({x:t.offsetX-(((c=this.rectIns)==null?void 0:c.shape.x)||0)+(((a=this.rectIns)==null?void 0:a.shape.x)||0),y:(i=this.rectIns)==null?void 0:i.shape.y}),this.circleList[2].attr({x:t.offsetX-(((h=this.rectIns)==null?void 0:h.shape.x)||0)+(((o=this.rectIns)==null?void 0:o.shape.x)||0),y:t.offsetY-(((p=this.rectIns)==null?void 0:p.shape.y)||0)+(((f=this.rectIns)==null?void 0:f.shape.y)||0)}),this.circleList[3].attr({x:(d=this.rectIns)==null?void 0:d.shape.x,y:t.offsetY-(((y=this.rectIns)==null?void 0:y.shape.y)||0)+(((x=this.rectIns)==null?void 0:x.shape.y)||0)}),this.circleList[4].attr({x:((m=this.rectIns)==null?void 0:m.shape.x)+12,y:((I=this.rectIns)==null?void 0:I.shape.y)-12,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:24}}),this.circleList[5].attr({x:t.offsetX-(((L=this.rectIns)==null?void 0:L.shape.x)||0)+(((w=this.rectIns)==null?void 0:w.shape.x)||0)-12,y:((v=this.rectIns)==null?void 0:v.shape.y)+12,shape:{width:24,height:t.offsetY-((D=this.rectIns)==null?void 0:D.shape.y)-24}}),this.circleList[6].attr({x:((b=this.rectIns)==null?void 0:b.shape.x)+12,y:t.offsetY-(((P=this.rectIns)==null?void 0:P.shape.y)||0)+(((_=this.rectIns)==null?void 0:_.shape.y)||0)-12,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:24}}),this.circleList[7].attr({x:((z=this.rectIns)==null?void 0:z.shape.x)-12,y:((R=this.rectIns)==null?void 0:R.shape.y)+12,shape:{width:24,height:t.offsetY-((M=this.rectIns)==null?void 0:M.shape.y)-24}}),this.calcText(),this.circleHideOrShow(!0),this.sceneRemoveEventListener()}rectAddToEventListener(){var t;(t=this.rectIns)==null||t.on("drag",this.rectDrag),this.$once("hook:beforeDestroy",()=>{var e;(e=this.rectIns)==null||e.on("drag",this.rectDrag)})}rectDrag(t){var e;if(t.offsetX<=5||t.offsetX>=this.width-5||t.offsetY<=5||t.offsetY>=this.height-5){(e=this.rectIns)==null||e.setPosition([this.originReactPostion[0],this.originReactPostion[1]]);return}this.originReactPostion=[t.target.x,t.target.y],this.circleList.forEach((s,r)=>{r>3?s.attr({shape:{x:t.target.x,y:t.target.y}}):s.attr({shape:{cx:t.target.x,cy:t.target.y}})}),this.calcText(),console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.circleList.forEach(t=>{t.on("drag",this.circleDrag),t.on("dragstart",this.circleDragStart)}),this.$once("hook:beforeDestroy",()=>{this.circleList.forEach(t=>{t.off("drag",this.circleDrag),t.off("dragstart",this.circleDragStart)})})}circleDragStart(t){console.log("circleDragStart--\u8FD9\u91CC",t),this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY}circleDrag(t){var o;console.log("circleDrag--\u8FD9\u91CC",t);const e=parseInt(t.target.name);if(isNaN(e))return;const s=t.offsetX-this.circleDragPos.x,r=t.offsetY-this.circleDragPos.y;this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY;let c=this.rectIns.shape.x,a=this.rectIns.shape.y,i=this.rectIns.shape.width,h=this.rectIns.shape.height;console.log("moveX",s,r),e===0?(c+=s,a+=r,s<0?i+=-s:i-=s,r<0?h+=-r:h-=r,this.circleList[1].attr({y:t.target.y}),this.circleList[3].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x+12,y:t.target.y-12,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-12,y:t.target.y+12,shape:{height:h-24}}),this.circleList[5].attr({y:t.target.y+12,shape:{height:h-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}})):e===1?(a+=r,i+=s,r<0?h+=-r:h-=r,this.circleList[0].attr({y:t.target.y}),this.circleList[2].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x-i+12,y:t.target.y-12,shape:{width:i-24}}),this.circleList[5].attr({x:t.target.x-12,y:t.target.y+12,shape:{height:h-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:h-24}})):e===2?(i+=s,h+=r,this.circleList[3].attr({y:t.target.y}),this.circleList[1].attr({x:t.target.x}),this.circleList[5].attr({x:t.target.x-12,shape:{height:h-24}}),this.circleList[6].attr({y:t.target.y-12,shape:{width:i-24}}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[7].attr({shape:{height:h-24}})):e===3?(c+=s,s<0?i+=-s:i-=s,h+=r,this.circleList[2].attr({y:t.target.y}),this.circleList[0].attr({x:t.target.x}),this.circleList[6].attr({x:t.target.x+12,y:t.target.y-12,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-12,shape:{height:h-24}}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[5].attr({shape:{height:h-24}})):e===4?(a+=r,r<0?h+=-r:h-=r,this.circleList[0].attr({y:t.target.y+12}),this.circleList[1].attr({y:t.target.y+12}),this.circleList[5].attr({y:t.target.y+24,shape:{height:h-24}}),this.circleList[7].attr({y:t.target.y+24,shape:{height:h-24}}),this.circleList[4].attr({x:c+12})):e===5?(i+=s,this.circleList[1].attr({x:t.target.x+12}),this.circleList[2].attr({x:t.target.x+12}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[5].attr({y:a+12})):e===6?(h+=r,this.circleList[2].attr({y:t.target.y+12}),this.circleList[3].attr({y:t.target.y+12}),this.circleList[5].attr({shape:{height:h-24}}),this.circleList[7].attr({shape:{height:h-24}}),this.circleList[6].attr({x:c+12})):e===7&&(c+=s,s<0?i+=-s:i-=s,this.circleList[0].attr({x:t.target.x+12}),this.circleList[3].attr({x:t.target.x+12}),this.circleList[4].attr({x:t.target.x+24,shape:{width:i-24}}),this.circleList[6].attr({x:t.target.x+24,shape:{width:i-24}}),this.circleList[7].attr({y:a+12})),(o=this.rectIns)==null||o.attr({shape:{x:c,y:a,width:i,height:h}}),this.calcText()}};n([l.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"width",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"height",2);n([l.Prop({default:()=>({lineW:1,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);n([l.Prop({required:!0})],exports.default.prototype,"speedValue",2);n([l.Prop({required:!0})],exports.default.prototype,"cellMg",2);n([l.Prop({default:1})],exports.default.prototype,"magnification",2);n([l.Prop({default:1})],exports.default.prototype,"sens",2);n([l.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=n([C.default({name:"MXMeasuringRuler"})],exports.default);
3
+ ${e} mV`,x:(((a=this.rectIns)==null?void 0:a.x)||0)+(((i=this.rectIns)==null?void 0:i.shape.x)||0)+(((r=this.rectIns)==null?void 0:r.shape.width)||0)+20,y:(((o=this.rectIns)==null?void 0:o.y)||0)+(((u=this.rectIns)==null?void 0:u.shape.y)||0)}})}circleHideOrShow(t){this.circleList.forEach(e=>t?e.show():e.hide())}sceneAddToEventListener(){var s,h,c,a,i;const t=r=>{r.event.preventDefault(),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})},e=r=>{this.$emit("notifyMeasuringRuler",{name:"dblclick"})};(s=this.sceneIns)==null||s.on("contextmenu",t),(h=this.sceneIns)==null||h.on("mousedown",this.sceneMousedown),(c=this.sceneIns)==null||c.on("mousemove",this.scenemousemove),(a=this.sceneIns)==null||a.on("mouseup",this.scenemouseup),(i=this.sceneIns)==null||i.on("dblclick",e),this.$once("hook:beforeDestroy",()=>{var r,o,u,f,g;(r=this.sceneIns)==null||r.off("contextmenu",t),(o=this.sceneIns)==null||o.off("mousedown",this.sceneMousedown),(u=this.sceneIns)==null||u.off("mousemove",this.scenemousemove),(f=this.sceneIns)==null||f.off("mouseup",this.scenemouseup),(g=this.sceneIns)==null||g.off("dblclick",e)})}sceneRemoveEventListener(){var t,e,s;(t=this.sceneIns)==null||t.off("mousedown",this.sceneMousedown),(e=this.sceneIns)==null||e.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}sceneMousedown(t){var e;this.isMouseDown=!0,(e=this.rectIns)==null||e.attr({shape:{x:t.offsetX,y:t.offsetY}})}scenemousemove(t){var e;!this.isMouseDown||(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}})}scenemouseup(t){var e,s,h,c,a,i,r,o,u,f,g,y,x,m,I,L,w,v,b,D,P,_,z,R,M;this.isMouseDown=!1,(e=this.rectIns)==null||e.attr({shape:{width:t.offsetX-this.rectIns.shape.x,height:t.offsetY-this.rectIns.shape.y}}),this.circleList[0].attr({x:(s=this.rectIns)==null?void 0:s.shape.x,y:(h=this.rectIns)==null?void 0:h.shape.y}),this.circleList[1].attr({x:t.offsetX-(((c=this.rectIns)==null?void 0:c.shape.x)||0)+(((a=this.rectIns)==null?void 0:a.shape.x)||0),y:(i=this.rectIns)==null?void 0:i.shape.y}),this.circleList[2].attr({x:t.offsetX-(((r=this.rectIns)==null?void 0:r.shape.x)||0)+(((o=this.rectIns)==null?void 0:o.shape.x)||0),y:t.offsetY-(((u=this.rectIns)==null?void 0:u.shape.y)||0)+(((f=this.rectIns)==null?void 0:f.shape.y)||0)}),this.circleList[3].attr({x:(g=this.rectIns)==null?void 0:g.shape.x,y:t.offsetY-(((y=this.rectIns)==null?void 0:y.shape.y)||0)+(((x=this.rectIns)==null?void 0:x.shape.y)||0)}),this.circleList[4].attr({x:((m=this.rectIns)==null?void 0:m.shape.x)+12,y:((I=this.rectIns)==null?void 0:I.shape.y)-1,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:2}}),this.circleList[5].attr({x:t.offsetX-(((L=this.rectIns)==null?void 0:L.shape.x)||0)+(((w=this.rectIns)==null?void 0:w.shape.x)||0)-1,y:((v=this.rectIns)==null?void 0:v.shape.y)+12,shape:{width:2,height:t.offsetY-((b=this.rectIns)==null?void 0:b.shape.y)-24}}),this.circleList[6].attr({x:((D=this.rectIns)==null?void 0:D.shape.x)+12,y:t.offsetY-(((P=this.rectIns)==null?void 0:P.shape.y)||0)+(((_=this.rectIns)==null?void 0:_.shape.y)||0)-1,shape:{width:t.offsetX-this.rectIns.shape.x-24,height:2}}),this.circleList[7].attr({x:((z=this.rectIns)==null?void 0:z.shape.x)-1,y:((R=this.rectIns)==null?void 0:R.shape.y)+12,shape:{width:2,height:t.offsetY-((M=this.rectIns)==null?void 0:M.shape.y)-24}}),this.calcText(),this.circleHideOrShow(!0),this.sceneRemoveEventListener()}rectAddToEventListener(){var t;(t=this.rectIns)==null||t.on("drag",this.rectDrag),this.$once("hook:beforeDestroy",()=>{var e;(e=this.rectIns)==null||e.on("drag",this.rectDrag)})}rectDrag(t){var e;if(t.offsetX<=5||t.offsetX>=this.width-5||t.offsetY<=5||t.offsetY>=this.height-5){(e=this.rectIns)==null||e.setPosition([this.originReactPostion[0],this.originReactPostion[1]]);return}this.originReactPostion=[t.target.x,t.target.y],this.circleList.forEach((s,h)=>{h>3?s.attr({shape:{x:t.target.x,y:t.target.y}}):s.attr({shape:{cx:t.target.x,cy:t.target.y}})}),this.calcText(),console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.circleList.forEach(t=>{t.on("drag",this.circleDrag),t.on("dragstart",this.circleDragStart)}),this.$once("hook:beforeDestroy",()=>{this.circleList.forEach(t=>{t.off("drag",this.circleDrag),t.off("dragstart",this.circleDragStart)})})}circleDragStart(t){console.log("circleDragStart--\u8FD9\u91CC",t),this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY}circleDrag(t){var o;console.log("circleDrag--\u8FD9\u91CC",t);const e=parseInt(t.target.name);if(isNaN(e))return;const s=t.offsetX-this.circleDragPos.x,h=t.offsetY-this.circleDragPos.y;this.circleDragPos.x=t.offsetX,this.circleDragPos.y=t.offsetY;let c=this.rectIns.shape.x,a=this.rectIns.shape.y,i=this.rectIns.shape.width,r=this.rectIns.shape.height;console.log("moveX",s,h),e===0?(c+=s,a+=h,s<0?i+=-s:i-=s,h<0?r+=-h:r-=h,this.circleList[1].attr({y:t.target.y}),this.circleList[3].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-1,y:t.target.y+12,shape:{height:r-24}}),this.circleList[5].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}})):e===1?(a+=h,i+=s,h<0?r+=-h:r-=h,this.circleList[0].attr({y:t.target.y}),this.circleList[2].attr({x:t.target.x}),this.circleList[4].attr({x:t.target.x-i+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[5].attr({x:t.target.x-1,y:t.target.y+12,shape:{height:r-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:r-24}})):e===2?(i+=s,r+=h,this.circleList[3].attr({y:t.target.y}),this.circleList[1].attr({x:t.target.x}),this.circleList[5].attr({x:t.target.x-1,shape:{height:r-24}}),this.circleList[6].attr({y:t.target.y-1,shape:{width:i-24}}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[7].attr({shape:{height:r-24}})):e===3?(c+=s,s<0?i+=-s:i-=s,r+=h,this.circleList[2].attr({y:t.target.y}),this.circleList[0].attr({x:t.target.x}),this.circleList[6].attr({x:t.target.x+12,y:t.target.y-1,shape:{width:i-24}}),this.circleList[7].attr({x:t.target.x-1,shape:{height:r-24}}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[5].attr({shape:{height:r-24}})):e===4?(a+=h,h<0?r+=-h:r-=h,this.circleList[0].attr({y:t.target.y+1}),this.circleList[1].attr({y:t.target.y+1}),this.circleList[5].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[7].attr({y:t.target.y+12,shape:{height:r-24}}),this.circleList[4].attr({x:c+12})):e===5?(i+=s,this.circleList[1].attr({x:t.target.x+1}),this.circleList[2].attr({x:t.target.x+1}),this.circleList[4].attr({shape:{width:i-24}}),this.circleList[6].attr({shape:{width:i-24}}),this.circleList[5].attr({y:a+12})):e===6?(r+=h,this.circleList[2].attr({y:t.target.y+1}),this.circleList[3].attr({y:t.target.y+1}),this.circleList[5].attr({shape:{height:r-24}}),this.circleList[7].attr({shape:{height:r-24}}),this.circleList[6].attr({x:c+12})):e===7&&(c+=s,s<0?i+=-s:i-=s,this.circleList[0].attr({x:t.target.x+1}),this.circleList[3].attr({x:t.target.x+1}),this.circleList[4].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[6].attr({x:t.target.x+12,shape:{width:i-24}}),this.circleList[7].attr({y:a+12})),(o=this.rectIns)==null||o.attr({shape:{x:c,y:a,width:i,height:r}}),this.calcText()}};n([l.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"width",2);n([l.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"height",2);n([l.Prop({default:()=>({lineW:1,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);n([l.Prop({required:!0})],exports.default.prototype,"speedValue",2);n([l.Prop({required:!0})],exports.default.prototype,"cellMg",2);n([l.Prop({default:1})],exports.default.prototype,"magnification",2);n([l.Prop({default:1})],exports.default.prototype,"sens",2);n([l.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=n([j.default({name:"MXMeasuringRuler"})],exports.default);
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const k=require("vue"),E=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const p=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),g=require("zrender"),L=require("@costy-plus/utils"),Y=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},j=Y(k);var O=Object.defineProperty,S=Object.getOwnPropertyDescriptor,f=(e,t,s,r)=>{for(var i=r>1?void 0:r?S(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(r?o(t,s,i):o(i))||i);return r&&i&&O(t,s,i),i};exports.default=class extends j.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectInsList=Object.freeze([]),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.isMouseDown=Object.freeze(!1),this.moveReactName=Object.freeze("")}destroyed(){var e,t;(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.dispose()}created(){this.rectInsList=[],this.measuringRulerGroup=new g.Group({name:"measuringRuler"}),this.initConfig()}clearCanvas(){var e,t;this.rectInsList=[],(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.measuringRulerGroup)}initConfig(){var e;(e=this.measuringRulerGroup)==null||e.add(new g.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"}))}mounted(){this.init()}init(){var t;const e=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=g.init(e,{width:this.width,height:this.height,devicePixelRatio:2}),(t=this.sceneIns)==null||t.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var i,n,o,l,h,u,a,c,m,x;let e,t=0,s="",r=0;for(let d=0;d<this.rectInsList.length;d++)if(e=this.rectInsList[d],((i=e.react)==null?void 0:i.name)===this.moveReactName&&((n=e.react)==null?void 0:n.shape.width)){t=L.calcMs(((o=e.react)==null?void 0:o.shape.width)||0,this.speedValue,this.cellMg,this.magnification),s=L.calcMV(((l=e.react)==null?void 0:l.shape.height)||0,this.sens,this.magnification),r=t!==0&&L.calcBpm(t)||0,(x=e.text)==null||x.attr({style:{text:`${t} ms
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");const X=require("vue"),E=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const p=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),g=require("zrender"),L=require("@costy-plus/utils"),Y=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},j=Y(X);var G=Object.defineProperty,O=Object.getOwnPropertyDescriptor,f=(e,t,s,r)=>{for(var i=r>1?void 0:r?O(t,s):t,h=e.length-1,n;h>=0;h--)(n=e[h])&&(i=(r?n(t,s,i):n(i))||i);return r&&i&&G(t,s,i),i};exports.default=class extends j.default{constructor(){super(...arguments),this.sceneIns=Object.freeze(null),this.measuringRulerGroup=Object.freeze(null),this.rectInsList=Object.freeze([]),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.isMouseDown=Object.freeze(!1),this.moveReactName=Object.freeze("")}destroyed(){var e,t;(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.dispose()}created(){this.rectInsList=[],this.measuringRulerGroup=new g.Group({name:"measuringRuler"}),this.initConfig()}clearCanvas(){var e,t;this.rectInsList=[],(e=this.measuringRulerGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.measuringRulerGroup)}initConfig(){var e;(e=this.measuringRulerGroup)==null||e.add(new g.Rect({name:"main-box",style:{fill:"transparent"},shape:{x:0,y:0,width:this.width,height:this.height},cursor:"crosshair"}))}mounted(){this.init()}init(){var t;const e=document.getElementById(`${this.prefixId}mx-measuring-ruler`);this.sceneIns=g.init(e,{width:this.width,height:this.height,devicePixelRatio:2}),(t=this.sceneIns)==null||t.add(this.measuringRulerGroup),this.sceneAddToEventListener(),this.rectAddToEventListener(),this.circleAddToEventListener()}calcText(){var i,h,n,l,o,u,a,c,m,x;let e,t=0,s="",r=0;for(let d=0;d<this.rectInsList.length;d++)if(e=this.rectInsList[d],((i=e.react)==null?void 0:i.name)===this.moveReactName&&((h=e.react)==null?void 0:h.shape.width)){t=L.calcMs(((n=e.react)==null?void 0:n.shape.width)||0,this.speedValue,this.cellMg,this.magnification),s=L.calcMV(((l=e.react)==null?void 0:l.shape.height)||0,this.sens,this.magnification),r=t!==0&&L.calcBpm(t)||0,(x=e.text)==null||x.attr({style:{text:`${t} ms
2
2
  ${r} bpm
3
- ${s} mV`,x:(((h=e.react)==null?void 0:h.x)||0)+(((u=e.react)==null?void 0:u.shape.x)||0)+(((a=e.react)==null?void 0:a.shape.width)||0)+20,y:(((c=e.react)==null?void 0:c.y)||0)+(((m=e.react)==null?void 0:m.shape.y)||0)}});break}e=null}circleHideOrShow(e){var s;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach(i=>e?i.show():i.hide());break}t=null}sceneAddToEventListener(){var t,s,r,i;const e=n=>{var o;n.event.preventDefault(),this.clearCanvas(),this.initConfig(),(o=this.sceneIns)==null||o.add(this.measuringRulerGroup),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})};(t=this.sceneIns)==null||t.on("contextmenu",e),(s=this.sceneIns)==null||s.on("mousedown",this.sceneMousedown),(r=this.sceneIns)==null||r.on("mousemove",this.scenemousemove),(i=this.sceneIns)==null||i.on("mouseup",this.scenemouseup),this.$once("hook:beforeDestroy",()=>{var n,o,l,h;(n=this.sceneIns)==null||n.off("contextmenu",e),(o=this.sceneIns)==null||o.off("mousedown",this.sceneMousedown),(l=this.sceneIns)==null||l.off("mousemove",this.scenemousemove),(h=this.sceneIns)==null||h.off("mouseup",this.scenemouseup)})}sceneRemoveEventListener(){var e,t,s;(e=this.sceneIns)==null||e.off("mousedown",this.sceneMousedown),(t=this.sceneIns)==null||t.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}createRectBox(e,t,s){this.moveReactName=e;const r=new g.Rect({name:e,style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:t,y:s},ondrag:this.rectDrag,cursor:"move",draggable:!0}),i=new g.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),n=[];let o;const l=["nw-resize","ne-resize","se-resize","sw-resize","n-resize","e-resize","s-resize","w-resize"];for(let h=0;h<8;h++)h>3?o=new g.Rect({name:`${h}_circle`,customName:e,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{width:12,height:12},cursor:l[h],zlevel:1,draggable:!0,ondrag:this.circleDrag,ondragstart:this.circleDragStart}):o=new g.Circle({name:`${h}_circle`,customName:e,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:l[h],zlevel:1,draggable:!0,ondrag:this.circleDrag,ondragstart:this.circleDragStart}),o.hide(),this.measuringRulerGroup.add(o),n.push(o);return this.measuringRulerGroup.add(i),this.measuringRulerGroup.add(r),{react:r,text:i,circleList:n,circleDragPos:{x:0,y:0}}}sceneMousedown(e){var t;if(console.log("sceneMousedown",e),e.event.button===0)if(this.isMouseDown=!0,this.rectInsList.length===0)this.rectInsList.push(this.createRectBox("react_1",e.offsetX,e.offsetY));else{let s=!1,r;for(let i=0;i<this.rectInsList.length&&(r=this.rectInsList[i],s=((t=r.react)==null?void 0:t.contain(e.offsetX,e.offsetY))||!1,!s);i++);r=null,s||this.rectInsList.push(this.createRectBox(`react_${this.rectInsList.length+1}`,e.offsetX,e.offsetY)),console.log("isContain",s)}}scenemousemove(e){var s,r;if(!this.isMouseDown)return;let t;for(let i=0;i<this.rectInsList.length;i++)if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}});break}t=null}scenemouseup(e){var s,r,i,n,o,l,h,u,a,c,m,x,d,v,w,R,I,b,D,_,N,P,z,C,M,X;this.isMouseDown=!1;let t;for(let y=0;y<this.rectInsList.length;y++)if(t=this.rectInsList[y],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}}),t.circleList[0].attr({x:(i=t.react)==null?void 0:i.shape.x,y:(n=t.react)==null?void 0:n.shape.y}),t.circleList[1].attr({x:e.offsetX-(((o=t.react)==null?void 0:o.shape.x)||0)+(((l=t.react)==null?void 0:l.shape.x)||0),y:(h=t.react)==null?void 0:h.shape.y}),t.circleList[2].attr({x:e.offsetX-(((u=t.react)==null?void 0:u.shape.x)||0)+(((a=t.react)==null?void 0:a.shape.x)||0),y:e.offsetY-(((c=t.react)==null?void 0:c.shape.y)||0)+(((m=t.react)==null?void 0:m.shape.y)||0)}),t.circleList[3].attr({x:(x=t.react)==null?void 0:x.shape.x,y:e.offsetY-(((d=t.react)==null?void 0:d.shape.y)||0)+(((v=t.react)==null?void 0:v.shape.y)||0)}),t.circleList[4].attr({x:((w=t.react)==null?void 0:w.shape.x)+12,y:((R=t.react)==null?void 0:R.shape.y)-12,shape:{width:e.offsetX-t.react.shape.x-24,height:24}}),t.circleList[5].attr({x:e.offsetX-(((I=t.react)==null?void 0:I.shape.x)||0)+(((b=t.react)==null?void 0:b.shape.x)||0)-12,y:((D=t.react)==null?void 0:D.shape.y)+12,shape:{width:24,height:e.offsetY-((_=t.react)==null?void 0:_.shape.y)-24}}),t.circleList[6].attr({x:((N=t.react)==null?void 0:N.shape.x)+12,y:e.offsetY-(((P=t.react)==null?void 0:P.shape.y)||0)+(((z=t.react)==null?void 0:z.shape.y)||0)-12,shape:{width:e.offsetX-t.react.shape.x-24,height:24}}),t.circleList[7].attr({x:((C=t.react)==null?void 0:C.shape.x)-12,y:((M=t.react)==null?void 0:M.shape.y)+12,shape:{width:24,height:e.offsetY-((X=t.react)==null?void 0:X.shape.y)-24}}),this.calcText(),this.circleHideOrShow(!0);break}t=null,this.moveReactName=""}rectAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.react)==null||t.off("drag",this.rectDrag);e=null})}rectDrag(e){var s,r;console.log("rectDrag",e),this.moveReactName=e.target.name;let t;for(let i=0;i<this.rectInsList.length;i++){if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach((n,o)=>{o>3?n.attr({shape:{x:e.target.x,y:e.target.y}}):n.attr({shape:{cx:e.target.x,cy:e.target.y}})}),this.calcText();break}(r=t.react)==null||r.off("drag",this.rectDrag)}t=null,this.moveReactName="",console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.circleList)==null||t.forEach(r=>{r.off("drag",this.circleDrag),r.off("dragstart",this.circleDragStart)});e=null})}circleDragStart(e){var s;console.log("circleDragStart--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleDragPos.x=e.offsetX,t.circleDragPos.y=e.offsetY;break}t=null,this.moveReactName=""}circleDrag(e){var n,o;console.log("circleDrag--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;const t=parseInt(e.target.name);if(isNaN(t))return;let s,r=0,i=0;for(let l=0;l<this.rectInsList.length;l++)if(s=this.rectInsList[l],((n=s.react)==null?void 0:n.name)===this.moveReactName){r=e.offsetX-s.circleDragPos.x,i=e.offsetY-s.circleDragPos.y,s.circleDragPos.x=e.offsetX,s.circleDragPos.y=e.offsetY;let h=s.react.shape.x,u=s.react.shape.y,a=s.react.shape.width,c=s.react.shape.height;console.log("moveX",r,i),t===0?(h+=r,u+=i,r<0?a+=-r:a-=r,i<0?c+=-i:c-=i,s.circleList[1].attr({y:e.target.y}),s.circleList[3].attr({x:e.target.x}),s.circleList[4].attr({x:e.target.x+12,y:e.target.y-12,shape:{width:a-24}}),s.circleList[7].attr({x:e.target.x-12,y:e.target.y+12,shape:{height:c-24}}),s.circleList[5].attr({y:e.target.y+12,shape:{height:c-24}}),s.circleList[6].attr({x:e.target.x+12,shape:{width:a-24}})):t===1?(u+=i,a+=r,i<0?c+=-i:c-=i,s.circleList[0].attr({y:e.target.y}),s.circleList[2].attr({x:e.target.x}),s.circleList[4].attr({x:e.target.x-a+12,y:e.target.y-12,shape:{width:a-24}}),s.circleList[5].attr({x:e.target.x-12,y:e.target.y+12,shape:{height:c-24}}),s.circleList[6].attr({shape:{width:a-24}}),s.circleList[7].attr({y:e.target.y+12,shape:{height:c-24}})):t===2?(a+=r,c+=i,s.circleList[3].attr({y:e.target.y}),s.circleList[1].attr({x:e.target.x}),s.circleList[5].attr({x:e.target.x-12,shape:{height:c-24}}),s.circleList[6].attr({y:e.target.y-12,shape:{width:a-24}}),s.circleList[4].attr({shape:{width:a-24}}),s.circleList[7].attr({shape:{height:c-24}})):t===3?(h+=r,r<0?a+=-r:a-=r,c+=i,s.circleList[2].attr({y:e.target.y}),s.circleList[0].attr({x:e.target.x}),s.circleList[6].attr({x:e.target.x+12,y:e.target.y-12,shape:{width:a-24}}),s.circleList[7].attr({x:e.target.x-12,shape:{height:c-24}}),s.circleList[4].attr({x:e.target.x+12,shape:{width:a-24}}),s.circleList[5].attr({shape:{height:c-24}})):t===4?(u+=i,i<0?c+=-i:c-=i,s.circleList[0].attr({y:e.target.y+12}),s.circleList[1].attr({y:e.target.y+12}),s.circleList[5].attr({y:e.target.y+24,shape:{height:c-24}}),s.circleList[7].attr({y:e.target.y+24,shape:{height:c-24}}),s.circleList[4].attr({x:h+12})):t===5?(a+=r,s.circleList[1].attr({x:e.target.x+12}),s.circleList[2].attr({x:e.target.x+12}),s.circleList[4].attr({shape:{width:a-24}}),s.circleList[6].attr({shape:{width:a-24}}),s.circleList[5].attr({y:u+12})):t===6?(c+=i,s.circleList[2].attr({y:e.target.y+12}),s.circleList[3].attr({y:e.target.y+12}),s.circleList[5].attr({shape:{height:c-24}}),s.circleList[7].attr({shape:{height:c-24}}),s.circleList[6].attr({x:h+12})):t===7&&(h+=r,r<0?a+=-r:a-=r,s.circleList[0].attr({x:e.target.x+12}),s.circleList[3].attr({x:e.target.x+12}),s.circleList[4].attr({x:e.target.x+24,shape:{width:a-24}}),s.circleList[6].attr({x:e.target.x+24,shape:{width:a-24}}),s.circleList[7].attr({y:u+12})),(o=s.react)==null||o.attr({shape:{x:h,y:u,width:a,height:c}}),this.calcText();break}s=null,this.moveReactName=""}};f([p.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);f([p.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);f([p.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);f([p.Prop({default:()=>({lineW:.6,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);f([p.Prop({required:!0})],exports.default.prototype,"speedValue",2);f([p.Prop({required:!0})],exports.default.prototype,"cellMg",2);f([p.Prop({default:1})],exports.default.prototype,"magnification",2);f([p.Prop({default:1})],exports.default.prototype,"sens",2);f([p.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=f([E.default({name:"MXMeasuringRuler"})],exports.default);
3
+ ${s} mV`,x:(((o=e.react)==null?void 0:o.x)||0)+(((u=e.react)==null?void 0:u.shape.x)||0)+(((a=e.react)==null?void 0:a.shape.width)||0)+20,y:(((c=e.react)==null?void 0:c.y)||0)+(((m=e.react)==null?void 0:m.shape.y)||0)}});break}e=null}circleHideOrShow(e){var s;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach(i=>e?i.show():i.hide());break}t=null}sceneAddToEventListener(){var s,r,i,h,n;const e=l=>{var o;l.event.preventDefault(),this.clearCanvas(),this.initConfig(),(o=this.sceneIns)==null||o.add(this.measuringRulerGroup),this.$emit("notifyMeasuringRuler",{name:"contextmenu"})},t=l=>{var o;this.clearCanvas(),this.initConfig(),(o=this.sceneIns)==null||o.add(this.measuringRulerGroup),this.$emit("notifyMeasuringRuler",{name:"dblclick"})};(s=this.sceneIns)==null||s.on("contextmenu",e),(r=this.sceneIns)==null||r.on("mousedown",this.sceneMousedown),(i=this.sceneIns)==null||i.on("mousemove",this.scenemousemove),(h=this.sceneIns)==null||h.on("mouseup",this.scenemouseup),(n=this.sceneIns)==null||n.on("dblclick",t),this.$once("hook:beforeDestroy",()=>{var l,o,u,a,c;(l=this.sceneIns)==null||l.off("contextmenu",e),(o=this.sceneIns)==null||o.off("mousedown",this.sceneMousedown),(u=this.sceneIns)==null||u.off("mousemove",this.scenemousemove),(a=this.sceneIns)==null||a.off("mouseup",this.scenemouseup),(c=this.sceneIns)==null||c.off("dblclick",t)})}sceneRemoveEventListener(){var e,t,s;(e=this.sceneIns)==null||e.off("mousedown",this.sceneMousedown),(t=this.sceneIns)==null||t.off("mousemove",this.scenemousemove),(s=this.sceneIns)==null||s.off("mouseup",this.scenemouseup)}createRectBox(e,t,s){this.moveReactName=e;const r=new g.Rect({name:e,style:{stroke:this.config.stroke,lineWidth:this.config.lineW,fill:"transparent"},shape:{x:t,y:s},ondrag:this.rectDrag,cursor:"move",draggable:!0}),i=new g.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),h=[];let n;const l=["nw-resize","ne-resize","se-resize","sw-resize","n-resize","e-resize","s-resize","w-resize"];for(let o=0;o<8;o++)o>3?n=new g.Rect({name:`${o}_circle`,customName:e,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{width:1,height:1},cursor:l[o],zlevel:1,draggable:!0,ondrag:this.circleDrag,ondragstart:this.circleDragStart}):n=new g.Circle({name:`${o}_circle`,customName:e,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{r:12},cursor:l[o],zlevel:1,draggable:!0,ondrag:this.circleDrag,ondragstart:this.circleDragStart}),n.hide(),this.measuringRulerGroup.add(n),h.push(n);return this.measuringRulerGroup.add(i),this.measuringRulerGroup.add(r),{react:r,text:i,circleList:h,circleDragPos:{x:0,y:0}}}sceneMousedown(e){var t;if(console.log("sceneMousedown",e),e.event.button===0)if(this.isMouseDown=!0,this.rectInsList.length===0)this.rectInsList.push(this.createRectBox("react_1",e.offsetX,e.offsetY));else{let s=!1,r;for(let i=0;i<this.rectInsList.length&&(r=this.rectInsList[i],s=((t=r.react)==null?void 0:t.contain(e.offsetX,e.offsetY))||!1,!s);i++);r=null,s||this.rectInsList.push(this.createRectBox(`react_${this.rectInsList.length+1}`,e.offsetX,e.offsetY)),console.log("isContain",s)}}scenemousemove(e){var s,r;if(!this.isMouseDown)return;let t;for(let i=0;i<this.rectInsList.length;i++)if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}});break}t=null}scenemouseup(e){var s,r,i,h,n,l,o,u,a,c,m,x,d,v,w,I,R,b,D,_,N,C,P,z,M,k;this.isMouseDown=!1;let t;for(let y=0;y<this.rectInsList.length;y++)if(t=this.rectInsList[y],((s=t.react)==null?void 0:s.name)===this.moveReactName){(r=t.react)==null||r.attr({shape:{width:e.offsetX-t.react.shape.x,height:e.offsetY-t.react.shape.y}}),t.circleList[0].attr({x:(i=t.react)==null?void 0:i.shape.x,y:(h=t.react)==null?void 0:h.shape.y}),t.circleList[1].attr({x:e.offsetX-(((n=t.react)==null?void 0:n.shape.x)||0)+(((l=t.react)==null?void 0:l.shape.x)||0),y:(o=t.react)==null?void 0:o.shape.y}),t.circleList[2].attr({x:e.offsetX-(((u=t.react)==null?void 0:u.shape.x)||0)+(((a=t.react)==null?void 0:a.shape.x)||0),y:e.offsetY-(((c=t.react)==null?void 0:c.shape.y)||0)+(((m=t.react)==null?void 0:m.shape.y)||0)}),t.circleList[3].attr({x:(x=t.react)==null?void 0:x.shape.x,y:e.offsetY-(((d=t.react)==null?void 0:d.shape.y)||0)+(((v=t.react)==null?void 0:v.shape.y)||0)}),t.circleList[4].attr({x:((w=t.react)==null?void 0:w.shape.x)+12,y:((I=t.react)==null?void 0:I.shape.y)-1,shape:{width:e.offsetX-t.react.shape.x-24,height:2}}),t.circleList[5].attr({x:e.offsetX-(((R=t.react)==null?void 0:R.shape.x)||0)+(((b=t.react)==null?void 0:b.shape.x)||0)-1,y:((D=t.react)==null?void 0:D.shape.y)+12,shape:{width:2,height:e.offsetY-((_=t.react)==null?void 0:_.shape.y)-24}}),t.circleList[6].attr({x:((N=t.react)==null?void 0:N.shape.x)+12,y:e.offsetY-(((C=t.react)==null?void 0:C.shape.y)||0)+(((P=t.react)==null?void 0:P.shape.y)||0)-1,shape:{width:e.offsetX-t.react.shape.x-24,height:2}}),t.circleList[7].attr({x:((z=t.react)==null?void 0:z.shape.x)-1,y:((M=t.react)==null?void 0:M.shape.y)+12,shape:{width:2,height:e.offsetY-((k=t.react)==null?void 0:k.shape.y)-24}}),this.calcText(),this.circleHideOrShow(!0);break}t=null,this.moveReactName=""}rectAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.react)==null||t.off("drag",this.rectDrag);e=null})}rectDrag(e){var s,r;console.log("rectDrag",e),this.moveReactName=e.target.name;let t;for(let i=0;i<this.rectInsList.length;i++){if(t=this.rectInsList[i],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleList.forEach((h,n)=>{n>3?h.attr({shape:{x:e.target.x,y:e.target.y}}):h.attr({shape:{cx:e.target.x,cy:e.target.y}})}),this.calcText();break}(r=t.react)==null||r.off("drag",this.rectDrag)}t=null,this.moveReactName="",console.log("rectDrag--\u8FD9\u91CC")}circleAddToEventListener(){this.$once("hook:beforeDestroy",()=>{var t;let e;for(let s=0;s<this.rectInsList.length;s++)e=this.rectInsList[s],(t=e.circleList)==null||t.forEach(r=>{r.off("drag",this.circleDrag),r.off("dragstart",this.circleDragStart)});e=null})}circleDragStart(e){var s;console.log("circleDragStart--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;let t;for(let r=0;r<this.rectInsList.length;r++)if(t=this.rectInsList[r],((s=t.react)==null?void 0:s.name)===this.moveReactName){t.circleDragPos.x=e.offsetX,t.circleDragPos.y=e.offsetY;break}t=null,this.moveReactName=""}circleDrag(e){var h,n;console.log("circleDrag--\u8FD9\u91CC",e),this.moveReactName=e.target.customName;const t=parseInt(e.target.name);if(isNaN(t))return;let s,r=0,i=0;for(let l=0;l<this.rectInsList.length;l++)if(s=this.rectInsList[l],((h=s.react)==null?void 0:h.name)===this.moveReactName){r=e.offsetX-s.circleDragPos.x,i=e.offsetY-s.circleDragPos.y,s.circleDragPos.x=e.offsetX,s.circleDragPos.y=e.offsetY;let o=s.react.shape.x,u=s.react.shape.y,a=s.react.shape.width,c=s.react.shape.height;console.log("moveX",r,i),t===0?(o+=r,u+=i,r<0?a+=-r:a-=r,i<0?c+=-i:c-=i,s.circleList[1].attr({y:e.target.y}),s.circleList[3].attr({x:e.target.x}),s.circleList[4].attr({x:e.target.x+12,y:e.target.y-1,shape:{width:a-24}}),s.circleList[7].attr({x:e.target.x-1,y:e.target.y+12,shape:{height:c-24}}),s.circleList[5].attr({y:e.target.y+12,shape:{height:c-24}}),s.circleList[6].attr({x:e.target.x+12,shape:{width:a-24}})):t===1?(u+=i,a+=r,i<0?c+=-i:c-=i,s.circleList[0].attr({y:e.target.y}),s.circleList[2].attr({x:e.target.x}),s.circleList[4].attr({x:e.target.x-a+12,y:e.target.y-1,shape:{width:a-24}}),s.circleList[5].attr({x:e.target.x-1,y:e.target.y+12,shape:{height:c-24}}),s.circleList[6].attr({shape:{width:a-24}}),s.circleList[7].attr({y:e.target.y+12,shape:{height:c-24}})):t===2?(a+=r,c+=i,s.circleList[3].attr({y:e.target.y}),s.circleList[1].attr({x:e.target.x}),s.circleList[5].attr({x:e.target.x-1,shape:{height:c-24}}),s.circleList[6].attr({y:e.target.y-1,shape:{width:a-24}}),s.circleList[4].attr({shape:{width:a-24}}),s.circleList[7].attr({shape:{height:c-24}})):t===3?(o+=r,r<0?a+=-r:a-=r,c+=i,s.circleList[2].attr({y:e.target.y}),s.circleList[0].attr({x:e.target.x}),s.circleList[6].attr({x:e.target.x+12,y:e.target.y-1,shape:{width:a-24}}),s.circleList[7].attr({x:e.target.x-1,shape:{height:c-24}}),s.circleList[4].attr({x:e.target.x+12,shape:{width:a-24}}),s.circleList[5].attr({shape:{height:c-24}})):t===4?(u+=i,i<0?c+=-i:c-=i,s.circleList[0].attr({y:e.target.y+1}),s.circleList[1].attr({y:e.target.y+1}),s.circleList[5].attr({y:e.target.y+12,shape:{height:c-24}}),s.circleList[7].attr({y:e.target.y+12,shape:{height:c-24}}),s.circleList[4].attr({x:o+12})):t===5?(a+=r,s.circleList[1].attr({x:e.target.x+1}),s.circleList[2].attr({x:e.target.x+1}),s.circleList[4].attr({shape:{width:a-24}}),s.circleList[6].attr({shape:{width:a-24}}),s.circleList[5].attr({y:u+12})):t===6?(c+=i,s.circleList[2].attr({y:e.target.y+1}),s.circleList[3].attr({y:e.target.y+1}),s.circleList[5].attr({shape:{height:c-24}}),s.circleList[7].attr({shape:{height:c-24}}),s.circleList[6].attr({x:o+12})):t===7&&(o+=r,r<0?a+=-r:a-=r,s.circleList[0].attr({x:e.target.x+1}),s.circleList[3].attr({x:e.target.x+1}),s.circleList[4].attr({x:e.target.x+12,shape:{width:a-24}}),s.circleList[6].attr({x:e.target.x+12,shape:{width:a-24}}),s.circleList[7].attr({y:u+12})),(n=s.react)==null||n.attr({shape:{x:o,y:u,width:a,height:c}}),this.calcText();break}s=null,this.moveReactName=""}};f([p.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);f([p.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);f([p.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);f([p.Prop({default:()=>({lineW:.6,stroke:"#00C800",circleLineW:1,circleLinestroke:"blue",textColor:"#000",textFontSize:12})})],exports.default.prototype,"config",2);f([p.Prop({required:!0})],exports.default.prototype,"speedValue",2);f([p.Prop({required:!0})],exports.default.prototype,"cellMg",2);f([p.Prop({default:1})],exports.default.prototype,"magnification",2);f([p.Prop({default:1})],exports.default.prototype,"sens",2);f([p.Prop({default:()=>""})],exports.default.prototype,"className",2);exports.default=f([E.default({name:"MXMeasuringRuler"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.1.16-0",
3
+ "version": "1.1.18-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",