costy-plus 1.1.16-0 → 1.1.17-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.
- package/dist/es/src/EnlargeWaveView/index.vue_vue_type_script_lang.js +8 -8
- package/dist/es/src/MeasuringRuler/index.vue_vue_type_script_lang.js +115 -111
- package/dist/es/src/MeasuringRulerMore/index.vue_vue_type_script_lang.js +144 -139
- package/dist/lib/src/EnlargeWaveView/index.vue_vue_type_script_lang.js +1 -1
- package/dist/lib/src/MeasuringRuler/index.vue_vue_type_script_lang.js +2 -2
- package/dist/lib/src/MeasuringRulerMore/index.vue_vue_type_script_lang.js +2 -2
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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,
|
|
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
|
|
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 =
|
|
54
|
-
|
|
53
|
+
p = b([
|
|
54
|
+
l({
|
|
55
55
|
name: "EnlargeWaveView",
|
|
56
56
|
components: {
|
|
57
|
-
MXBackgroundGrid:
|
|
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
|
|
7
|
-
import { calcMs as T, calcMV as
|
|
8
|
-
var
|
|
9
|
-
for (var c =
|
|
10
|
-
(i = t[a]) && (c = (
|
|
11
|
-
return
|
|
6
|
+
import { Text as O, Group as Y, Rect as y, Circle as F, init as j } from "zrender";
|
|
7
|
+
import { calcMs as T, calcMV as $, calcBpm as k } 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
|
|
41
|
+
}), this.rectIns = new y({
|
|
42
42
|
name: "rect",
|
|
43
43
|
style: {
|
|
44
44
|
stroke: this.config.stroke,
|
|
@@ -55,7 +55,7 @@ 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
|
|
58
|
+
s > 3 ? t = new y({
|
|
59
59
|
name: `${s}_circle`,
|
|
60
60
|
style: {
|
|
61
61
|
stroke: this.config.circleLinestroke,
|
|
@@ -63,8 +63,8 @@ let o = class extends C {
|
|
|
63
63
|
fill: "transparent"
|
|
64
64
|
},
|
|
65
65
|
shape: {
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
66
|
+
width: 1,
|
|
67
|
+
height: 1
|
|
68
68
|
},
|
|
69
69
|
cursor: e[s],
|
|
70
70
|
zlevel: 1,
|
|
@@ -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
|
|
87
|
+
new y({
|
|
88
88
|
name: "main-box",
|
|
89
89
|
style: {
|
|
90
90
|
fill: "transparent"
|
|
@@ -114,23 +114,23 @@ 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
|
|
117
|
+
var h, c, a, i, r, n, g, p;
|
|
118
118
|
const t = T(
|
|
119
|
-
((
|
|
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 =
|
|
123
|
+
), e = $(
|
|
124
124
|
((c = this.rectIns) == null ? void 0 : c.shape.height) || 0,
|
|
125
125
|
this.sens,
|
|
126
126
|
this.magnification
|
|
127
|
-
), s = t !== 0 &&
|
|
127
|
+
), s = t !== 0 && k(t) || 0;
|
|
128
128
|
(p = this.textIns) == null || p.attr({
|
|
129
129
|
style: {
|
|
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) + (((
|
|
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
|
|
143
|
-
const t = (
|
|
144
|
-
|
|
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
|
-
(
|
|
149
|
-
var
|
|
150
|
-
(
|
|
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,
|
|
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,43 +185,43 @@ 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: (
|
|
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 - (((
|
|
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: (
|
|
193
|
-
y: t.offsetY - (((
|
|
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
|
-
x: ((m = this.rectIns) == null ? void 0 : m.shape.x) +
|
|
196
|
-
y: ((I = this.rectIns) == null ? void 0 : I.shape.y) -
|
|
199
|
+
x: ((m = this.rectIns) == null ? void 0 : m.shape.x) + 1,
|
|
200
|
+
y: ((I = this.rectIns) == null ? void 0 : I.shape.y) - 1,
|
|
197
201
|
shape: {
|
|
198
|
-
width: t.offsetX - this.rectIns.shape.x -
|
|
199
|
-
height:
|
|
202
|
+
width: t.offsetX - this.rectIns.shape.x - 2,
|
|
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) -
|
|
203
|
-
y: ((v = this.rectIns) == null ? void 0 : v.shape.y) +
|
|
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,
|
|
207
|
+
y: ((v = this.rectIns) == null ? void 0 : v.shape.y) + 1,
|
|
204
208
|
shape: {
|
|
205
|
-
width:
|
|
206
|
-
height: t.offsetY - ((D = this.rectIns) == null ? void 0 : D.shape.y) -
|
|
209
|
+
width: 2,
|
|
210
|
+
height: t.offsetY - ((D = this.rectIns) == null ? void 0 : D.shape.y) - 2
|
|
207
211
|
}
|
|
208
212
|
}), this.circleList[6].attr({
|
|
209
|
-
x: ((b = this.rectIns) == null ? void 0 : b.shape.x) +
|
|
210
|
-
y: t.offsetY - (((z = this.rectIns) == null ? void 0 : z.shape.y) || 0) + (((R = this.rectIns) == null ? void 0 : R.shape.y) || 0) -
|
|
213
|
+
x: ((b = this.rectIns) == null ? void 0 : b.shape.x) + 1,
|
|
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
|
-
width: t.offsetX - this.rectIns.shape.x -
|
|
213
|
-
height:
|
|
216
|
+
width: t.offsetX - this.rectIns.shape.x - 2,
|
|
217
|
+
height: 2
|
|
214
218
|
}
|
|
215
219
|
}), this.circleList[7].attr({
|
|
216
|
-
x: ((P = this.rectIns) == null ? void 0 : P.shape.x) -
|
|
217
|
-
y: ((M = this.rectIns) == null ? void 0 : M.shape.y) +
|
|
220
|
+
x: ((P = this.rectIns) == null ? void 0 : P.shape.x) - 1,
|
|
221
|
+
y: ((M = this.rectIns) == null ? void 0 : M.shape.y) + 1,
|
|
218
222
|
shape: {
|
|
219
|
-
width:
|
|
220
|
-
height: t.offsetY - ((X = this.rectIns) == null ? void 0 : X.shape.y) -
|
|
223
|
+
width: 2,
|
|
224
|
+
height: t.offsetY - ((X = this.rectIns) == null ? void 0 : X.shape.y) - 2
|
|
221
225
|
}
|
|
222
226
|
}), this.calcText(), this.circleHideOrShow(!0), this.sceneRemoveEventListener();
|
|
223
227
|
}
|
|
@@ -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,
|
|
238
|
-
|
|
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,172 +270,172 @@ 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,
|
|
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,
|
|
272
|
-
console.log("moveX", s,
|
|
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
|
-
x: t.target.x +
|
|
278
|
-
y: t.target.y -
|
|
281
|
+
x: t.target.x + 1,
|
|
282
|
+
y: t.target.y - 1,
|
|
279
283
|
shape: {
|
|
280
|
-
width: i -
|
|
284
|
+
width: i - 2
|
|
281
285
|
}
|
|
282
286
|
}), this.circleList[7].attr({
|
|
283
|
-
x: t.target.x -
|
|
284
|
-
y: t.target.y +
|
|
287
|
+
x: t.target.x - 1,
|
|
288
|
+
y: t.target.y + 1,
|
|
285
289
|
shape: {
|
|
286
|
-
height:
|
|
290
|
+
height: r - 2
|
|
287
291
|
}
|
|
288
292
|
}), this.circleList[5].attr({
|
|
289
|
-
y: t.target.y +
|
|
293
|
+
y: t.target.y + 1,
|
|
290
294
|
shape: {
|
|
291
|
-
height:
|
|
295
|
+
height: r - 2
|
|
292
296
|
}
|
|
293
297
|
}), this.circleList[6].attr({
|
|
294
|
-
x: t.target.x +
|
|
298
|
+
x: t.target.x + 1,
|
|
295
299
|
shape: {
|
|
296
|
-
width: i -
|
|
300
|
+
width: i - 2
|
|
297
301
|
}
|
|
298
|
-
})) : e === 1 ? (a +=
|
|
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
|
-
x: t.target.x - i +
|
|
304
|
-
y: t.target.y -
|
|
307
|
+
x: t.target.x - i + 1,
|
|
308
|
+
y: t.target.y - 1,
|
|
305
309
|
shape: {
|
|
306
|
-
width: i -
|
|
310
|
+
width: i - 2
|
|
307
311
|
}
|
|
308
312
|
}), this.circleList[5].attr({
|
|
309
|
-
x: t.target.x -
|
|
310
|
-
y: t.target.y +
|
|
313
|
+
x: t.target.x - 1,
|
|
314
|
+
y: t.target.y + 1,
|
|
311
315
|
shape: {
|
|
312
|
-
height:
|
|
316
|
+
height: r - 2
|
|
313
317
|
}
|
|
314
318
|
}), this.circleList[6].attr({
|
|
315
319
|
shape: {
|
|
316
|
-
width: i -
|
|
320
|
+
width: i - 2
|
|
317
321
|
}
|
|
318
322
|
}), this.circleList[7].attr({
|
|
319
|
-
y: t.target.y +
|
|
323
|
+
y: t.target.y + 1,
|
|
320
324
|
shape: {
|
|
321
|
-
height:
|
|
325
|
+
height: r - 2
|
|
322
326
|
}
|
|
323
|
-
})) : e === 2 ? (i += s,
|
|
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 -
|
|
332
|
+
x: t.target.x - 1,
|
|
329
333
|
shape: {
|
|
330
|
-
height:
|
|
334
|
+
height: r - 2
|
|
331
335
|
}
|
|
332
336
|
}), this.circleList[6].attr({
|
|
333
|
-
y: t.target.y -
|
|
337
|
+
y: t.target.y - 1,
|
|
334
338
|
shape: {
|
|
335
|
-
width: i -
|
|
339
|
+
width: i - 2
|
|
336
340
|
}
|
|
337
341
|
}), this.circleList[4].attr({
|
|
338
342
|
shape: {
|
|
339
|
-
width: i -
|
|
343
|
+
width: i - 2
|
|
340
344
|
}
|
|
341
345
|
}), this.circleList[7].attr({
|
|
342
346
|
shape: {
|
|
343
|
-
height:
|
|
347
|
+
height: r - 2
|
|
344
348
|
}
|
|
345
|
-
})) : e === 3 ? (c += s, s < 0 ? i += -s : i -= s,
|
|
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
|
-
x: t.target.x +
|
|
351
|
-
y: t.target.y -
|
|
354
|
+
x: t.target.x + 1,
|
|
355
|
+
y: t.target.y - 1,
|
|
352
356
|
shape: {
|
|
353
|
-
width: i -
|
|
357
|
+
width: i - 2
|
|
354
358
|
}
|
|
355
359
|
}), this.circleList[7].attr({
|
|
356
|
-
x: t.target.x -
|
|
360
|
+
x: t.target.x - 1,
|
|
357
361
|
shape: {
|
|
358
|
-
height:
|
|
362
|
+
height: r - 2
|
|
359
363
|
}
|
|
360
364
|
}), this.circleList[4].attr({
|
|
361
|
-
x: t.target.x +
|
|
365
|
+
x: t.target.x + 1,
|
|
362
366
|
shape: {
|
|
363
|
-
width: i -
|
|
367
|
+
width: i - 2
|
|
364
368
|
}
|
|
365
369
|
}), this.circleList[5].attr({
|
|
366
370
|
shape: {
|
|
367
|
-
height:
|
|
371
|
+
height: r - 2
|
|
368
372
|
}
|
|
369
|
-
})) : e === 4 ? (a +=
|
|
370
|
-
y: t.target.y +
|
|
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 +
|
|
376
|
+
y: t.target.y + 1
|
|
373
377
|
}), this.circleList[5].attr({
|
|
374
|
-
y: t.target.y +
|
|
378
|
+
y: t.target.y + 2,
|
|
375
379
|
shape: {
|
|
376
|
-
height:
|
|
380
|
+
height: r - 2
|
|
377
381
|
}
|
|
378
382
|
}), this.circleList[7].attr({
|
|
379
|
-
y: t.target.y +
|
|
383
|
+
y: t.target.y + 2,
|
|
380
384
|
shape: {
|
|
381
|
-
height:
|
|
385
|
+
height: r - 2
|
|
382
386
|
}
|
|
383
387
|
}), this.circleList[4].attr({
|
|
384
|
-
x: c +
|
|
388
|
+
x: c + 1
|
|
385
389
|
})) : e === 5 ? (i += s, this.circleList[1].attr({
|
|
386
|
-
x: t.target.x +
|
|
390
|
+
x: t.target.x + 1
|
|
387
391
|
}), this.circleList[2].attr({
|
|
388
|
-
x: t.target.x +
|
|
392
|
+
x: t.target.x + 1
|
|
389
393
|
}), this.circleList[4].attr({
|
|
390
394
|
shape: {
|
|
391
|
-
width: i -
|
|
395
|
+
width: i - 2
|
|
392
396
|
}
|
|
393
397
|
}), this.circleList[6].attr({
|
|
394
398
|
shape: {
|
|
395
|
-
width: i -
|
|
399
|
+
width: i - 2
|
|
396
400
|
}
|
|
397
401
|
}), this.circleList[5].attr({
|
|
398
|
-
y: a +
|
|
399
|
-
})) : e === 6 ? (
|
|
400
|
-
y: t.target.y +
|
|
402
|
+
y: a + 1
|
|
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 +
|
|
406
|
+
y: t.target.y + 1
|
|
403
407
|
}), this.circleList[5].attr({
|
|
404
408
|
shape: {
|
|
405
|
-
height:
|
|
409
|
+
height: r - 2
|
|
406
410
|
}
|
|
407
411
|
}), this.circleList[7].attr({
|
|
408
412
|
shape: {
|
|
409
|
-
height:
|
|
413
|
+
height: r - 2
|
|
410
414
|
}
|
|
411
415
|
}), this.circleList[6].attr({
|
|
412
|
-
x: c +
|
|
416
|
+
x: c + 1
|
|
413
417
|
})) : e === 7 && (c += s, s < 0 ? i += -s : i -= s, this.circleList[0].attr({
|
|
414
|
-
x: t.target.x +
|
|
418
|
+
x: t.target.x + 1
|
|
415
419
|
}), this.circleList[3].attr({
|
|
416
|
-
x: t.target.x +
|
|
420
|
+
x: t.target.x + 1
|
|
417
421
|
}), this.circleList[4].attr({
|
|
418
|
-
x: t.target.x +
|
|
422
|
+
x: t.target.x + 2,
|
|
419
423
|
shape: {
|
|
420
|
-
width: i -
|
|
424
|
+
width: i - 2
|
|
421
425
|
}
|
|
422
426
|
}), this.circleList[6].attr({
|
|
423
|
-
x: t.target.x +
|
|
427
|
+
x: t.target.x + 2,
|
|
424
428
|
shape: {
|
|
425
|
-
width: i -
|
|
429
|
+
width: i - 2
|
|
426
430
|
}
|
|
427
431
|
}), this.circleList[7].attr({
|
|
428
|
-
y: a +
|
|
432
|
+
y: a + 1
|
|
429
433
|
})), (n = this.rectIns) == null || n.attr({
|
|
430
434
|
shape: {
|
|
431
435
|
x: c,
|
|
432
436
|
y: a,
|
|
433
437
|
width: i,
|
|
434
|
-
height:
|
|
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
|
|
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
|
|
7
|
-
import { calcMs as
|
|
8
|
-
var A = Object.defineProperty, W = Object.getOwnPropertyDescriptor,
|
|
9
|
-
for (var i = r > 1 ? void 0 : r ? W(e, s) : e, o = t.length - 1,
|
|
10
|
-
(
|
|
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
|
|
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
|
|
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 =
|
|
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,
|
|
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 =
|
|
68
|
-
((
|
|
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: (((
|
|
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
|
|
101
|
-
const t = (
|
|
100
|
+
var s, r, i, o, n;
|
|
101
|
+
const t = (l) => {
|
|
102
102
|
var h;
|
|
103
|
-
|
|
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
|
-
(
|
|
108
|
-
var
|
|
109
|
-
(
|
|
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
|
|
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
|
|
144
|
-
|
|
145
|
-
name: `${
|
|
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:
|
|
154
|
-
height:
|
|
158
|
+
width: 1,
|
|
159
|
+
height: 1
|
|
155
160
|
},
|
|
156
|
-
cursor: l[
|
|
161
|
+
cursor: l[h],
|
|
157
162
|
zlevel: 1,
|
|
158
163
|
draggable: !0,
|
|
159
164
|
ondrag: this.circleDrag,
|
|
160
165
|
ondragstart: this.circleDragStart
|
|
161
|
-
}) :
|
|
162
|
-
name: `${
|
|
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[
|
|
177
|
+
cursor: l[h],
|
|
173
178
|
zlevel: 1,
|
|
174
179
|
draggable: !0,
|
|
175
180
|
ondrag: this.circleDrag,
|
|
176
181
|
ondragstart: this.circleDragStart
|
|
177
|
-
}),
|
|
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,
|
|
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,41 +234,41 @@ 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 - (((
|
|
233
|
-
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) + (((
|
|
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: ((
|
|
242
|
-
y: ((I = e.react) == null ? void 0 : I.shape.y) -
|
|
246
|
+
x: ((w = e.react) == null ? void 0 : w.shape.x) + 1,
|
|
247
|
+
y: ((I = e.react) == null ? void 0 : I.shape.y) - 1,
|
|
243
248
|
shape: {
|
|
244
|
-
width: t.offsetX - e.react.shape.x -
|
|
245
|
-
height:
|
|
249
|
+
width: t.offsetX - e.react.shape.x - 2,
|
|
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) -
|
|
249
|
-
y: ((b = e.react) == null ? void 0 : b.shape.y) +
|
|
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,
|
|
254
|
+
y: ((b = e.react) == null ? void 0 : b.shape.y) + 1,
|
|
250
255
|
shape: {
|
|
251
|
-
width:
|
|
252
|
-
height: t.offsetY - ((N = e.react) == null ? void 0 : N.shape.y) -
|
|
256
|
+
width: 2,
|
|
257
|
+
height: t.offsetY - ((N = e.react) == null ? void 0 : N.shape.y) - 2
|
|
253
258
|
}
|
|
254
259
|
}), e.circleList[6].attr({
|
|
255
|
-
x: ((
|
|
256
|
-
y: t.offsetY - (((
|
|
260
|
+
x: ((C = e.react) == null ? void 0 : C.shape.x) + 1,
|
|
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
|
-
width: t.offsetX - e.react.shape.x -
|
|
259
|
-
height:
|
|
263
|
+
width: t.offsetX - e.react.shape.x - 2,
|
|
264
|
+
height: 2
|
|
260
265
|
}
|
|
261
266
|
}), e.circleList[7].attr({
|
|
262
|
-
x: ((
|
|
263
|
-
y: ((
|
|
267
|
+
x: ((k = e.react) == null ? void 0 : k.shape.x) - 1,
|
|
268
|
+
y: ((X = e.react) == null ? void 0 : X.shape.y) + 1,
|
|
264
269
|
shape: {
|
|
265
|
-
width:
|
|
266
|
-
height: t.offsetY - ((Y = e.react) == null ? void 0 : Y.shape.y) -
|
|
270
|
+
width: 2,
|
|
271
|
+
height: t.offsetY - ((Y = e.react) == null ? void 0 : Y.shape.y) - 2
|
|
267
272
|
}
|
|
268
273
|
}), this.calcText(), this.circleHideOrShow(!0);
|
|
269
274
|
break;
|
|
@@ -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,
|
|
289
|
-
|
|
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,
|
|
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,167 +341,167 @@ 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
|
|
340
|
-
console.log("moveX", r, i), e === 0 ? (
|
|
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
|
-
x: t.target.x +
|
|
346
|
-
y: t.target.y -
|
|
350
|
+
x: t.target.x + 1,
|
|
351
|
+
y: t.target.y - 1,
|
|
347
352
|
shape: {
|
|
348
|
-
width: a -
|
|
353
|
+
width: a - 2
|
|
349
354
|
}
|
|
350
355
|
}), s.circleList[7].attr({
|
|
351
|
-
x: t.target.x -
|
|
352
|
-
y: t.target.y +
|
|
356
|
+
x: t.target.x - 1,
|
|
357
|
+
y: t.target.y + 1,
|
|
353
358
|
shape: {
|
|
354
|
-
height: c -
|
|
359
|
+
height: c - 2
|
|
355
360
|
}
|
|
356
361
|
}), s.circleList[5].attr({
|
|
357
|
-
y: t.target.y +
|
|
362
|
+
y: t.target.y + 1,
|
|
358
363
|
shape: {
|
|
359
|
-
height: c -
|
|
364
|
+
height: c - 2
|
|
360
365
|
}
|
|
361
366
|
}), s.circleList[6].attr({
|
|
362
|
-
x: t.target.x +
|
|
367
|
+
x: t.target.x + 1,
|
|
363
368
|
shape: {
|
|
364
|
-
width: a -
|
|
369
|
+
width: a - 2
|
|
365
370
|
}
|
|
366
371
|
})) : e === 1 ? (f += i, a += r, i < 0 ? c += -i : c -= i, s.circleList[0].attr({
|
|
367
372
|
y: t.target.y
|
|
368
373
|
}), s.circleList[2].attr({
|
|
369
374
|
x: t.target.x
|
|
370
375
|
}), s.circleList[4].attr({
|
|
371
|
-
x: t.target.x - a +
|
|
372
|
-
y: t.target.y -
|
|
376
|
+
x: t.target.x - a + 1,
|
|
377
|
+
y: t.target.y - 1,
|
|
373
378
|
shape: {
|
|
374
|
-
width: a -
|
|
379
|
+
width: a - 2
|
|
375
380
|
}
|
|
376
381
|
}), s.circleList[5].attr({
|
|
377
|
-
x: t.target.x -
|
|
378
|
-
y: t.target.y +
|
|
382
|
+
x: t.target.x - 1,
|
|
383
|
+
y: t.target.y + 1,
|
|
379
384
|
shape: {
|
|
380
|
-
height: c -
|
|
385
|
+
height: c - 2
|
|
381
386
|
}
|
|
382
387
|
}), s.circleList[6].attr({
|
|
383
388
|
shape: {
|
|
384
|
-
width: a -
|
|
389
|
+
width: a - 2
|
|
385
390
|
}
|
|
386
391
|
}), s.circleList[7].attr({
|
|
387
|
-
y: t.target.y +
|
|
392
|
+
y: t.target.y + 1,
|
|
388
393
|
shape: {
|
|
389
|
-
height: c -
|
|
394
|
+
height: c - 2
|
|
390
395
|
}
|
|
391
396
|
})) : e === 2 ? (a += r, c += i, s.circleList[3].attr({
|
|
392
397
|
y: t.target.y
|
|
393
398
|
}), s.circleList[1].attr({
|
|
394
399
|
x: t.target.x
|
|
395
400
|
}), s.circleList[5].attr({
|
|
396
|
-
x: t.target.x -
|
|
401
|
+
x: t.target.x - 1,
|
|
397
402
|
shape: {
|
|
398
|
-
height: c -
|
|
403
|
+
height: c - 2
|
|
399
404
|
}
|
|
400
405
|
}), s.circleList[6].attr({
|
|
401
|
-
y: t.target.y -
|
|
406
|
+
y: t.target.y - 1,
|
|
402
407
|
shape: {
|
|
403
|
-
width: a -
|
|
408
|
+
width: a - 2
|
|
404
409
|
}
|
|
405
410
|
}), s.circleList[4].attr({
|
|
406
411
|
shape: {
|
|
407
|
-
width: a -
|
|
412
|
+
width: a - 2
|
|
408
413
|
}
|
|
409
414
|
}), s.circleList[7].attr({
|
|
410
415
|
shape: {
|
|
411
|
-
height: c -
|
|
416
|
+
height: c - 2
|
|
412
417
|
}
|
|
413
|
-
})) : e === 3 ? (
|
|
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
|
-
x: t.target.x +
|
|
419
|
-
y: t.target.y -
|
|
423
|
+
x: t.target.x + 1,
|
|
424
|
+
y: t.target.y - 1,
|
|
420
425
|
shape: {
|
|
421
|
-
width: a -
|
|
426
|
+
width: a - 2
|
|
422
427
|
}
|
|
423
428
|
}), s.circleList[7].attr({
|
|
424
|
-
x: t.target.x -
|
|
429
|
+
x: t.target.x - 1,
|
|
425
430
|
shape: {
|
|
426
|
-
height: c -
|
|
431
|
+
height: c - 2
|
|
427
432
|
}
|
|
428
433
|
}), s.circleList[4].attr({
|
|
429
|
-
x: t.target.x +
|
|
434
|
+
x: t.target.x + 1,
|
|
430
435
|
shape: {
|
|
431
|
-
width: a -
|
|
436
|
+
width: a - 2
|
|
432
437
|
}
|
|
433
438
|
}), s.circleList[5].attr({
|
|
434
439
|
shape: {
|
|
435
|
-
height: c -
|
|
440
|
+
height: c - 2
|
|
436
441
|
}
|
|
437
442
|
})) : e === 4 ? (f += i, i < 0 ? c += -i : c -= i, s.circleList[0].attr({
|
|
438
|
-
y: t.target.y +
|
|
443
|
+
y: t.target.y + 1
|
|
439
444
|
}), s.circleList[1].attr({
|
|
440
|
-
y: t.target.y +
|
|
445
|
+
y: t.target.y + 1
|
|
441
446
|
}), s.circleList[5].attr({
|
|
442
|
-
y: t.target.y +
|
|
447
|
+
y: t.target.y + 2,
|
|
443
448
|
shape: {
|
|
444
|
-
height: c -
|
|
449
|
+
height: c - 2
|
|
445
450
|
}
|
|
446
451
|
}), s.circleList[7].attr({
|
|
447
|
-
y: t.target.y +
|
|
452
|
+
y: t.target.y + 2,
|
|
448
453
|
shape: {
|
|
449
|
-
height: c -
|
|
454
|
+
height: c - 2
|
|
450
455
|
}
|
|
451
456
|
}), s.circleList[4].attr({
|
|
452
|
-
x:
|
|
457
|
+
x: h + 1
|
|
453
458
|
})) : e === 5 ? (a += r, s.circleList[1].attr({
|
|
454
|
-
x: t.target.x +
|
|
459
|
+
x: t.target.x + 1
|
|
455
460
|
}), s.circleList[2].attr({
|
|
456
|
-
x: t.target.x +
|
|
461
|
+
x: t.target.x + 1
|
|
457
462
|
}), s.circleList[4].attr({
|
|
458
463
|
shape: {
|
|
459
|
-
width: a -
|
|
464
|
+
width: a - 2
|
|
460
465
|
}
|
|
461
466
|
}), s.circleList[6].attr({
|
|
462
467
|
shape: {
|
|
463
|
-
width: a -
|
|
468
|
+
width: a - 2
|
|
464
469
|
}
|
|
465
470
|
}), s.circleList[5].attr({
|
|
466
|
-
y: f +
|
|
471
|
+
y: f + 1
|
|
467
472
|
})) : e === 6 ? (c += i, s.circleList[2].attr({
|
|
468
|
-
y: t.target.y +
|
|
473
|
+
y: t.target.y + 1
|
|
469
474
|
}), s.circleList[3].attr({
|
|
470
|
-
y: t.target.y +
|
|
475
|
+
y: t.target.y + 1
|
|
471
476
|
}), s.circleList[5].attr({
|
|
472
477
|
shape: {
|
|
473
|
-
height: c -
|
|
478
|
+
height: c - 2
|
|
474
479
|
}
|
|
475
480
|
}), s.circleList[7].attr({
|
|
476
481
|
shape: {
|
|
477
|
-
height: c -
|
|
482
|
+
height: c - 2
|
|
478
483
|
}
|
|
479
484
|
}), s.circleList[6].attr({
|
|
480
|
-
x:
|
|
481
|
-
})) : e === 7 && (
|
|
482
|
-
x: t.target.x +
|
|
485
|
+
x: h + 1
|
|
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 +
|
|
489
|
+
x: t.target.x + 1
|
|
485
490
|
}), s.circleList[4].attr({
|
|
486
|
-
x: t.target.x +
|
|
491
|
+
x: t.target.x + 2,
|
|
487
492
|
shape: {
|
|
488
|
-
width: a -
|
|
493
|
+
width: a - 2
|
|
489
494
|
}
|
|
490
495
|
}), s.circleList[6].attr({
|
|
491
|
-
x: t.target.x +
|
|
496
|
+
x: t.target.x + 2,
|
|
492
497
|
shape: {
|
|
493
|
-
width: a -
|
|
498
|
+
width: a - 2
|
|
494
499
|
}
|
|
495
500
|
}), s.circleList[7].attr({
|
|
496
|
-
y: f +
|
|
497
|
-
})), (
|
|
501
|
+
y: f + 1
|
|
502
|
+
})), (n = s.react) == null || n.attr({
|
|
498
503
|
shape: {
|
|
499
|
-
x:
|
|
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
|
-
|
|
515
|
+
g([
|
|
511
516
|
p({
|
|
512
517
|
default: () => ""
|
|
513
518
|
})
|
|
514
|
-
],
|
|
515
|
-
|
|
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
|
-
],
|
|
522
|
-
|
|
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
|
-
],
|
|
529
|
-
|
|
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
|
-
],
|
|
541
|
-
|
|
545
|
+
], u.prototype, "config", 2);
|
|
546
|
+
g([
|
|
542
547
|
p({
|
|
543
548
|
required: !0
|
|
544
549
|
})
|
|
545
|
-
],
|
|
546
|
-
|
|
550
|
+
], u.prototype, "speedValue", 2);
|
|
551
|
+
g([
|
|
547
552
|
p({
|
|
548
553
|
required: !0
|
|
549
554
|
})
|
|
550
|
-
],
|
|
551
|
-
|
|
555
|
+
], u.prototype, "cellMg", 2);
|
|
556
|
+
g([
|
|
552
557
|
p({
|
|
553
558
|
default: 1
|
|
554
559
|
})
|
|
555
|
-
],
|
|
556
|
-
|
|
560
|
+
], u.prototype, "magnification", 2);
|
|
561
|
+
g([
|
|
557
562
|
p({
|
|
558
563
|
default: 1
|
|
559
564
|
})
|
|
560
|
-
],
|
|
561
|
-
|
|
565
|
+
], u.prototype, "sens", 2);
|
|
566
|
+
g([
|
|
562
567
|
p({ default: () => "" })
|
|
563
|
-
],
|
|
564
|
-
|
|
565
|
-
|
|
568
|
+
], u.prototype, "className", 2);
|
|
569
|
+
u = g([
|
|
570
|
+
G({
|
|
566
571
|
name: "MXMeasuringRuler"
|
|
567
572
|
})
|
|
568
|
-
],
|
|
573
|
+
], u);
|
|
569
574
|
export {
|
|
570
|
-
|
|
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
|
|
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
|
|
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"),f=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 f.Text({style:{lineHeight:this.config.textFontSize+4,fontSize:this.config.textFontSize,fill:this.config.textColor,fontFamily:this.fontFamily,fontWeight:"bold"}}),this.measuringRulerGroup=new f.Group({name:"measuringRuler"}),this.rectIns=new f.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 f.Rect({name:`${s}_circle`,style:{stroke:this.config.circleLinestroke,lineWidth:this.config.circleLineW,fill:"transparent"},shape:{width:1,height:1},cursor:e[s],zlevel:1,draggable:!0}):t=new f.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 f.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=f.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,p;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;(p=this.textIns)==null||p.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)+(((
|
|
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,p,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),(p=this.sceneIns)==null||p.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,p,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)+(((p=this.rectIns)==null?void 0:p.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)+1,y:((I=this.rectIns)==null?void 0:I.shape.y)-1,shape:{width:t.offsetX-this.rectIns.shape.x-2,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)+1,shape:{width:2,height:t.offsetY-((b=this.rectIns)==null?void 0:b.shape.y)-2}}),this.circleList[6].attr({x:((D=this.rectIns)==null?void 0:D.shape.x)+1,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-2,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)+1,shape:{width:2,height:t.offsetY-((M=this.rectIns)==null?void 0:M.shape.y)-2}}),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+1,y:t.target.y-1,shape:{width:i-2}}),this.circleList[7].attr({x:t.target.x-1,y:t.target.y+1,shape:{height:r-2}}),this.circleList[5].attr({y:t.target.y+1,shape:{height:r-2}}),this.circleList[6].attr({x:t.target.x+1,shape:{width:i-2}})):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+1,y:t.target.y-1,shape:{width:i-2}}),this.circleList[5].attr({x:t.target.x-1,y:t.target.y+1,shape:{height:r-2}}),this.circleList[6].attr({shape:{width:i-2}}),this.circleList[7].attr({y:t.target.y+1,shape:{height:r-2}})):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-2}}),this.circleList[6].attr({y:t.target.y-1,shape:{width:i-2}}),this.circleList[4].attr({shape:{width:i-2}}),this.circleList[7].attr({shape:{height:r-2}})):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+1,y:t.target.y-1,shape:{width:i-2}}),this.circleList[7].attr({x:t.target.x-1,shape:{height:r-2}}),this.circleList[4].attr({x:t.target.x+1,shape:{width:i-2}}),this.circleList[5].attr({shape:{height:r-2}})):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+2,shape:{height:r-2}}),this.circleList[7].attr({y:t.target.y+2,shape:{height:r-2}}),this.circleList[4].attr({x:c+1})):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-2}}),this.circleList[6].attr({shape:{width:i-2}}),this.circleList[5].attr({y:a+1})):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-2}}),this.circleList[7].attr({shape:{height:r-2}}),this.circleList[6].attr({x:c+1})):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+2,shape:{width:i-2}}),this.circleList[6].attr({x:t.target.x+2,shape:{width:i-2}}),this.circleList[7].attr({y:a+1})),(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
|
|
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)+1,y:((I=t.react)==null?void 0:I.shape.y)-1,shape:{width:e.offsetX-t.react.shape.x-2,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)+1,shape:{width:2,height:e.offsetY-((_=t.react)==null?void 0:_.shape.y)-2}}),t.circleList[6].attr({x:((N=t.react)==null?void 0:N.shape.x)+1,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-2,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)+1,shape:{width:2,height:e.offsetY-((k=t.react)==null?void 0:k.shape.y)-2}}),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+1,y:e.target.y-1,shape:{width:a-2}}),s.circleList[7].attr({x:e.target.x-1,y:e.target.y+1,shape:{height:c-2}}),s.circleList[5].attr({y:e.target.y+1,shape:{height:c-2}}),s.circleList[6].attr({x:e.target.x+1,shape:{width:a-2}})):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+1,y:e.target.y-1,shape:{width:a-2}}),s.circleList[5].attr({x:e.target.x-1,y:e.target.y+1,shape:{height:c-2}}),s.circleList[6].attr({shape:{width:a-2}}),s.circleList[7].attr({y:e.target.y+1,shape:{height:c-2}})):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-2}}),s.circleList[6].attr({y:e.target.y-1,shape:{width:a-2}}),s.circleList[4].attr({shape:{width:a-2}}),s.circleList[7].attr({shape:{height:c-2}})):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+1,y:e.target.y-1,shape:{width:a-2}}),s.circleList[7].attr({x:e.target.x-1,shape:{height:c-2}}),s.circleList[4].attr({x:e.target.x+1,shape:{width:a-2}}),s.circleList[5].attr({shape:{height:c-2}})):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+2,shape:{height:c-2}}),s.circleList[7].attr({y:e.target.y+2,shape:{height:c-2}}),s.circleList[4].attr({x:o+1})):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-2}}),s.circleList[6].attr({shape:{width:a-2}}),s.circleList[5].attr({y:u+1})):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-2}}),s.circleList[7].attr({shape:{height:c-2}}),s.circleList[6].attr({x:o+1})):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+2,shape:{width:a-2}}),s.circleList[6].attr({x:e.target.x+2,shape:{width:a-2}}),s.circleList[7].attr({y:u+1})),(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);
|