costy-plus 1.0.52-0 → 1.0.54-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.
|
@@ -2,7 +2,7 @@ var X = Object.defineProperty, T = Object.defineProperties;
|
|
|
2
2
|
var V = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var z = Object.getOwnPropertySymbols;
|
|
4
4
|
var Y = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var j = (e, t, i) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i,
|
|
5
|
+
var j = (e, t, i) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, y = (e, t) => {
|
|
6
6
|
for (var i in t || (t = {}))
|
|
7
7
|
Y.call(t, i) && j(e, i, t[i]);
|
|
8
8
|
if (z)
|
|
@@ -17,11 +17,11 @@ import { Prop as c } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2
|
|
|
17
17
|
import { flattenDeep as Q, max as K, min as U } from "lodash";
|
|
18
18
|
import { throttling as $, getStepForSpeed as W, getPrintLengthToPx as Z, getSens as S, getDataLenTimes as A, getPointIdxForPx as F, getActualY as H } from "@costy-plus/utils";
|
|
19
19
|
import * as J from "zrender";
|
|
20
|
-
import { Group as v, Polyline as x, Line as
|
|
20
|
+
import { Group as v, Polyline as x, Line as P, Text as I, Polygon as ee, util as te } from "zrender";
|
|
21
21
|
var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, u = (e, t, i, s) => {
|
|
22
|
-
for (var
|
|
23
|
-
(n = e[
|
|
24
|
-
return s &&
|
|
22
|
+
for (var a = s > 1 ? void 0 : s ? se(t, i) : t, o = e.length - 1, n; o >= 0; o--)
|
|
23
|
+
(n = e[o]) && (a = (s ? n(t, i, a) : n(a)) || a);
|
|
24
|
+
return s && a && ie(t, i, a), a;
|
|
25
25
|
};
|
|
26
26
|
let g = class extends E {
|
|
27
27
|
constructor() {
|
|
@@ -50,8 +50,8 @@ let g = class extends E {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
destroyed() {
|
|
53
|
-
var e, t, i, s,
|
|
54
|
-
this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (
|
|
53
|
+
var e, t, i, s, a, o, n, d, l, f, r;
|
|
54
|
+
this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (a = this.splitLineGroup) == null || a.removeAll(), (o = this.leadHeadNameGroup) == null || o.removeAll(), (n = this.leadHeadOffAndDelGroup) == null || n.removeAll(), (d = this.rulerGroup) == null || d.removeAll(), (l = this.arrowGroup) == null || l.removeAll(), (f = this.heardBeatLineGroup) == null || f.removeAll(), (r = this.sceneIns) == null || r.dispose();
|
|
55
55
|
}
|
|
56
56
|
initCreatedConfig() {
|
|
57
57
|
this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height, this.initConfig();
|
|
@@ -94,18 +94,18 @@ let g = class extends E {
|
|
|
94
94
|
initSlidingWindowInfo() {
|
|
95
95
|
const e = this.publicStep || 0, t = Math.ceil(this.splitPoint / e);
|
|
96
96
|
if (this.slidingWindowInfo = {
|
|
97
|
-
points: t,
|
|
98
|
-
startInd: 0,
|
|
99
|
-
endInd: t
|
|
97
|
+
points: this.slidingWindowInfo.points || t,
|
|
98
|
+
startInd: this.slidingWindowInfo.startInd || 0,
|
|
99
|
+
endInd: this.slidingWindowInfo.endInd || t
|
|
100
100
|
}, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
|
|
101
|
-
const s = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate),
|
|
102
|
-
this.vuescrollWH.width = this.canvasContainer.width + (
|
|
101
|
+
const s = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), a = this.dataTotalLength * s;
|
|
102
|
+
this.vuescrollWH.width = this.canvasContainer.width + (a || 0) - this.splitPoint;
|
|
103
103
|
}
|
|
104
104
|
const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
|
|
105
105
|
this.addSlidingWindowInfo = {
|
|
106
|
-
points: i,
|
|
107
|
-
startInd: 0,
|
|
108
|
-
endInd: i
|
|
106
|
+
points: this.addSlidingWindowInfo.points || i,
|
|
107
|
+
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
108
|
+
endInd: this.addSlidingWindowInfo.endInd || i
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
calcHighestAndLowestPoint() {
|
|
@@ -156,13 +156,13 @@ let g = class extends E {
|
|
|
156
156
|
width: e,
|
|
157
157
|
height: this.canvasContainer.height - this.bottomAreaHeight
|
|
158
158
|
}, this.slidingWindowInfo = {
|
|
159
|
-
points: 0,
|
|
160
|
-
startInd: 0,
|
|
161
|
-
endInd: 0
|
|
159
|
+
points: this.slidingWindowInfo.points || 0,
|
|
160
|
+
startInd: this.slidingWindowInfo.startInd || 0,
|
|
161
|
+
endInd: this.slidingWindowInfo.endInd || 0
|
|
162
162
|
}, this.addSlidingWindowInfo = {
|
|
163
|
-
points: 0,
|
|
164
|
-
startInd: 0,
|
|
165
|
-
endInd: 0
|
|
163
|
+
points: this.addSlidingWindowInfo.points || 0,
|
|
164
|
+
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
165
|
+
endInd: this.addSlidingWindowInfo.endInd || 0
|
|
166
166
|
}, this.loopArrowY = {
|
|
167
167
|
add: 0,
|
|
168
168
|
rowAndCol: 0
|
|
@@ -203,39 +203,39 @@ let g = class extends E {
|
|
|
203
203
|
(e = this.sceneIns) == null || e.off("mousemove", this.sceneInsMousemove), (t = this.sceneIns) == null || t.off("mousedown", this.sceneInsMouseDown), (i = this.sceneIns) == null || i.off("mouseup", this.sceneInsMouseUp);
|
|
204
204
|
}
|
|
205
205
|
drawLeadHead() {
|
|
206
|
-
var
|
|
207
|
-
(
|
|
206
|
+
var o, n, d, l, f;
|
|
207
|
+
(o = this.leadHeadGroup) == null || o.removeAll(), (n = this.sceneIns) == null || n.remove(this.leadHeadGroup), console.log("this.waveConfigs", this.waveConfigs);
|
|
208
208
|
let e = "", t = !1, i = 0, s = 0;
|
|
209
|
-
for (let
|
|
210
|
-
s =
|
|
209
|
+
for (let r = 0; r <= this.leadModel.column; r++) {
|
|
210
|
+
s = r * this.leadModel.line;
|
|
211
211
|
e:
|
|
212
|
-
for (let
|
|
213
|
-
if (!(this.waveConfigs || [])[
|
|
212
|
+
for (let h = 1; h <= this.leadModel.line; h++) {
|
|
213
|
+
if (!(this.waveConfigs || [])[h - 1 + s])
|
|
214
214
|
break e;
|
|
215
|
-
!this.waveConfigs[
|
|
215
|
+
!this.waveConfigs[h - 1 + s].isShowLeadHead || (t = !1, e = (this.leadNames || [])[h - 1 + s] || "", this.waveConfigs[h - 1 + s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = this.waveConfigs[h - 1 + s].posX ? this.waveConfigs[h - 1 + s].posX - this.leadHeadConfig.leadHedeWidth : 0, (d = this.leadHeadGroup) == null || d.add(
|
|
216
216
|
this.createLeadHead(
|
|
217
217
|
i,
|
|
218
|
-
this.waveConfigs[
|
|
219
|
-
S(this.waveConfigs[
|
|
218
|
+
this.waveConfigs[h - 1 + s].posY || h * this.splitBlockHeight,
|
|
219
|
+
S(this.waveConfigs[h - 1 + s].gain, this.gridConfig.cellMg),
|
|
220
220
|
t
|
|
221
221
|
)
|
|
222
222
|
));
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
let
|
|
226
|
-
for (let
|
|
227
|
-
!this.waveConfigs[this.longLeadConfig.leadIdxs[
|
|
225
|
+
let a = null;
|
|
226
|
+
for (let r = 0; r < this.leadModel.add; r++)
|
|
227
|
+
!this.waveConfigs[this.longLeadConfig.leadIdxs[r]] || (a = this.waveConfigs[this.longLeadConfig.leadIdxs[r]], e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]], t = !1, a.gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = a.posX ? a.posX - this.leadHeadConfig.leadHedeWidth : 0, (l = this.leadHeadGroup) == null || l.add(
|
|
228
228
|
this.createLeadHead(
|
|
229
229
|
i,
|
|
230
|
-
|
|
231
|
-
S(
|
|
230
|
+
a.posY || (r + 1 + this.leadModel.line) * this.splitBlockHeight,
|
|
231
|
+
S(a.gain, this.gridConfig.cellMg),
|
|
232
232
|
t
|
|
233
233
|
)
|
|
234
234
|
));
|
|
235
|
-
|
|
235
|
+
a = null, (f = this.sceneIns) == null || f.add(this.leadHeadGroup);
|
|
236
236
|
}
|
|
237
237
|
createLeadHead(e, t, i, s) {
|
|
238
|
-
const
|
|
238
|
+
const a = this.leadHeadConfig.leadHedeWidth / 4;
|
|
239
239
|
return i = s ? i / 2 : i, new x({
|
|
240
240
|
cursor: "",
|
|
241
241
|
shape: {
|
|
@@ -245,23 +245,23 @@ let g = class extends E {
|
|
|
245
245
|
0 + t
|
|
246
246
|
],
|
|
247
247
|
[
|
|
248
|
-
|
|
248
|
+
a + e,
|
|
249
249
|
0 + t
|
|
250
250
|
],
|
|
251
251
|
[
|
|
252
|
-
|
|
252
|
+
a + e,
|
|
253
253
|
-i + t
|
|
254
254
|
],
|
|
255
255
|
[
|
|
256
|
-
3 *
|
|
256
|
+
3 * a + e,
|
|
257
257
|
-i + t
|
|
258
258
|
],
|
|
259
259
|
[
|
|
260
|
-
3 *
|
|
260
|
+
3 * a + e,
|
|
261
261
|
0 + t
|
|
262
262
|
],
|
|
263
263
|
[
|
|
264
|
-
4 *
|
|
264
|
+
4 * a + e,
|
|
265
265
|
0 + t
|
|
266
266
|
]
|
|
267
267
|
]
|
|
@@ -273,51 +273,51 @@ let g = class extends E {
|
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
drawColSplitLine() {
|
|
276
|
-
var
|
|
277
|
-
(
|
|
276
|
+
var o, n, d, l, f;
|
|
277
|
+
(o = this.splitLineGroup) == null || o.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup);
|
|
278
278
|
const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
|
|
279
279
|
if (this.splitPoint = e, this.leadModel.isSingleMode) {
|
|
280
|
-
const
|
|
280
|
+
const r = W(
|
|
281
281
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
282
282
|
this.gridConfig.cellMg,
|
|
283
283
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
284
|
-
),
|
|
285
|
-
Math.ceil(this.splitPoint / (
|
|
284
|
+
), h = A(
|
|
285
|
+
Math.ceil(this.splitPoint / (r || 1)) || 0,
|
|
286
286
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0
|
|
287
|
-
), C = parseInt(`${
|
|
288
|
-
this.splitPoint = C * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (
|
|
287
|
+
), C = parseInt(`${h / 1e3 % 60}`, 10);
|
|
288
|
+
this.splitPoint = C * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (r || 0);
|
|
289
289
|
}
|
|
290
|
-
let t = 0, i = 0, s = 0,
|
|
291
|
-
for (let
|
|
292
|
-
t =
|
|
290
|
+
let t = 0, i = 0, s = 0, a = 0;
|
|
291
|
+
for (let r = 1; r <= this.leadModel.column - 1; r++) {
|
|
292
|
+
t = r * e + this.leadHeadConfig.leadHedeWidth, i = r * this.leadModel.line;
|
|
293
293
|
e:
|
|
294
|
-
for (let
|
|
295
|
-
if (!(this.waveConfigs || [])[
|
|
294
|
+
for (let h = 1; h <= this.leadModel.line; h++) {
|
|
295
|
+
if (!(this.waveConfigs || [])[h - 1 + i])
|
|
296
296
|
break e;
|
|
297
|
-
if ((this.waveConfigs || [])[
|
|
297
|
+
if ((this.waveConfigs || [])[h - 1 + i].isShowLeadHead)
|
|
298
298
|
continue e;
|
|
299
|
-
if ((this.waveConfigs || [])[
|
|
299
|
+
if ((this.waveConfigs || [])[h - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[h - 1 + i].posX), s = (this.waveConfigs || [])[h - 1 + i].leadIdx, s === void 0)
|
|
300
300
|
break;
|
|
301
|
-
|
|
301
|
+
a = S((this.waveConfigs || [])[h - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[h - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (d = this.splitLineGroup) == null || d.add(
|
|
302
302
|
this.creatSplitLine(
|
|
303
303
|
t,
|
|
304
|
-
((this.waveConfigs || [])[
|
|
305
|
-
|
|
304
|
+
((this.waveConfigs || [])[h - 1 + i].posY || h * this.splitBlockHeight) - (a || 0) / 2 * 0.5,
|
|
305
|
+
a,
|
|
306
306
|
!0
|
|
307
307
|
)
|
|
308
|
-
) : (
|
|
308
|
+
) : (l = this.splitLineGroup) == null || l.add(
|
|
309
309
|
this.creatSplitLine(
|
|
310
310
|
t,
|
|
311
|
-
((this.waveConfigs || [])[
|
|
312
|
-
|
|
311
|
+
((this.waveConfigs || [])[h - 1 + i].posY || h * this.splitBlockHeight) - (a || 0) * 0.5,
|
|
312
|
+
a
|
|
313
313
|
)
|
|
314
314
|
);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
(
|
|
317
|
+
(f = this.sceneIns) == null || f.add(this.splitLineGroup);
|
|
318
318
|
}
|
|
319
319
|
creatSplitLine(e, t, i, s) {
|
|
320
|
-
return new
|
|
320
|
+
return new P({
|
|
321
321
|
cursor: "",
|
|
322
322
|
shape: {
|
|
323
323
|
x1: 0 + e,
|
|
@@ -332,54 +332,54 @@ let g = class extends E {
|
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
drawRulerNotes() {
|
|
335
|
-
var s,
|
|
335
|
+
var s, a;
|
|
336
336
|
if (!this.rulerConfig.isShow)
|
|
337
337
|
return;
|
|
338
338
|
const e = {
|
|
339
339
|
fill: "#FF0080",
|
|
340
340
|
fontSize: 13,
|
|
341
341
|
fontFamily: this.fontFamily
|
|
342
|
-
}, t = new
|
|
342
|
+
}, t = new I({
|
|
343
343
|
cursor: "",
|
|
344
|
-
style:
|
|
344
|
+
style: y({
|
|
345
345
|
text: "(s)",
|
|
346
346
|
x: this.leadHeadConfig.leadHedeWidth / 2 - 8,
|
|
347
347
|
y: this.canvasContainer.height - 25
|
|
348
348
|
}, e)
|
|
349
|
-
}), i = new
|
|
350
|
-
style:
|
|
349
|
+
}), i = new I({
|
|
350
|
+
style: y({
|
|
351
351
|
text: `${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,
|
|
352
352
|
x: this.leadHeadConfig.leadHedeWidth / 2 + 20,
|
|
353
353
|
y: this.canvasContainer.height - this.ruleH
|
|
354
354
|
}, e)
|
|
355
355
|
});
|
|
356
|
-
(s = this.sceneIns) == null || s.add(i), (
|
|
356
|
+
(s = this.sceneIns) == null || s.add(i), (a = this.sceneIns) == null || a.add(t);
|
|
357
357
|
}
|
|
358
358
|
drawRuler(e = 0) {
|
|
359
|
-
var n,
|
|
359
|
+
var n, d, l;
|
|
360
360
|
if (this.timersCopy = e, !this.rulerConfig.isShow)
|
|
361
361
|
return;
|
|
362
362
|
const t = this.dataTotalTimes / 1e3;
|
|
363
|
-
let i = this.leadHeadConfig.leadHedeWidth, s = 0,
|
|
364
|
-
const
|
|
363
|
+
let i = this.leadHeadConfig.leadHedeWidth, s = 0, a = t;
|
|
364
|
+
const o = W(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
|
|
365
365
|
if (this.leadModel.isContinuous)
|
|
366
|
-
|
|
367
|
-
else if (!this.leadModel.add &&
|
|
368
|
-
const
|
|
369
|
-
|
|
366
|
+
a = t * 5;
|
|
367
|
+
else if (!this.leadModel.add && o) {
|
|
368
|
+
const f = F(this.splitPoint, o), r = A(f, this.rulerConfig.sampleRate || 0) / 1e3;
|
|
369
|
+
a = e + r;
|
|
370
370
|
}
|
|
371
|
-
for (let
|
|
372
|
-
|
|
371
|
+
for (let f = e; f <= a; f = +(f + 0.1).toFixed(1))
|
|
372
|
+
f !== e && (i += this.rulerStep), f % 1 === 0 ? (s = this.canvasContainer.height - 10, (n = this.rulerGroup) == null || n.add(new I({
|
|
373
373
|
cursor: "",
|
|
374
374
|
style: {
|
|
375
375
|
x: i,
|
|
376
376
|
y: s - 15,
|
|
377
|
-
text:
|
|
377
|
+
text: f + "",
|
|
378
378
|
fontSize: 13,
|
|
379
379
|
fontFamily: this.fontFamily,
|
|
380
380
|
fill: "#FF0080"
|
|
381
381
|
}
|
|
382
|
-
}))) : s = this.canvasContainer.height - 5, (
|
|
382
|
+
}))) : s = this.canvasContainer.height - 5, (d = this.rulerGroup) == null || d.add(new P({
|
|
383
383
|
cursor: "",
|
|
384
384
|
shape: {
|
|
385
385
|
x1: i,
|
|
@@ -392,7 +392,7 @@ let g = class extends E {
|
|
|
392
392
|
lineWidth: 2
|
|
393
393
|
}
|
|
394
394
|
}));
|
|
395
|
-
(
|
|
395
|
+
(l = this.sceneIns) == null || l.add(this.rulerGroup);
|
|
396
396
|
}
|
|
397
397
|
drawWaveFrom() {
|
|
398
398
|
var e, t, i;
|
|
@@ -401,39 +401,42 @@ let g = class extends E {
|
|
|
401
401
|
getRednerSinglePoints() {
|
|
402
402
|
let e = 0, t = 0;
|
|
403
403
|
const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
|
|
404
|
-
let s = this.slidingWindowInfo.startInd || 0,
|
|
405
|
-
const
|
|
404
|
+
let s = this.slidingWindowInfo.startInd || 0, a = this.slidingWindowInfo.endInd || 0;
|
|
405
|
+
const o = W(
|
|
406
406
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
407
407
|
this.gridConfig.cellMg,
|
|
408
408
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
409
|
-
), n = S(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg),
|
|
410
|
-
for (let
|
|
411
|
-
e =
|
|
412
|
-
for (let
|
|
413
|
-
t =
|
|
409
|
+
), n = S(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), d = [], l = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
|
|
410
|
+
for (let f = 0; f < 1; f++) {
|
|
411
|
+
e = f * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
|
|
412
|
+
for (let r = 1; r <= l; r++)
|
|
413
|
+
t = r * this.splitBlockHeight, r > 1 && (t *= 0.8, s = a, a = s + (this.slidingWindowInfo.points || 0)), r === 1 && (this.loopArrowY.rowAndCol = t), d.push({
|
|
414
414
|
pos: [e, t],
|
|
415
415
|
startInd: s,
|
|
416
|
-
endInd:
|
|
417
|
-
step:
|
|
416
|
+
endInd: a,
|
|
417
|
+
step: o,
|
|
418
418
|
sens: n,
|
|
419
|
-
data: i.slice(s,
|
|
419
|
+
data: i.slice(s, a).map((h, C) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? H(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, h, n / 2) : H(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, h, n)).map((h, C) => [C * (o || 0), -h])
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
return
|
|
422
|
+
return d;
|
|
423
423
|
}
|
|
424
424
|
createSingleWaveFrom() {
|
|
425
|
-
var o,
|
|
425
|
+
var o, n, d;
|
|
426
426
|
(o = this.singleWaveFromGroup) == null || o.removeAll();
|
|
427
|
-
let e = this.getRednerSinglePoints(), t = A(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0), i = 0, s = 0;
|
|
427
|
+
let e = this.getRednerSinglePoints(), t = A(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0), i = 0, s = 0, a = 0;
|
|
428
428
|
for (let l = 0; l < e.length && !(e[l].pos[1] > this.drawArea.height + this.bottomAreaHeight); l++)
|
|
429
|
-
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (i = parseInt(`${t / 1e3 / 60}`, 10), s = parseInt(`${t / 1e3 % 60}`, 10), i = s === 60 ? i += 1 : i, i = i === 0 ? "00" : i < 10 ? `0${i}` : i, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (
|
|
429
|
+
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (i = parseInt(`${t / 1e3 / 60}`, 10), s = parseInt(`${t / 1e3 % 60}`, 10), i = s === 60 ? i += 1 : i, i = i === 0 ? "00" : i < 10 ? `0${i}` : i, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (n = this.singleWaveFromGroup) == null || n.add(new x({
|
|
430
430
|
cursor: "",
|
|
431
431
|
name: this.singleModeConfig.defaultSelect + "_" + l,
|
|
432
432
|
shape: {
|
|
433
|
-
points: e[l].data.map(([f, h
|
|
433
|
+
points: e[l].data.map(([f, r], h) => isNaN(r) ? (a === 0 && (a = h - 1, a = a < 0 ? 0 : a), [
|
|
434
|
+
e[l].data[a][0] + e[l].pos[0],
|
|
435
|
+
e[l].data[a][1] + e[l].pos[1]
|
|
436
|
+
]) : (a = 0, [
|
|
434
437
|
f + e[l].pos[0],
|
|
435
|
-
|
|
436
|
-
])
|
|
438
|
+
r + e[l].pos[1]
|
|
439
|
+
]))
|
|
437
440
|
},
|
|
438
441
|
style: {
|
|
439
442
|
stroke: this.leadConfig.lineColor,
|
|
@@ -442,7 +445,7 @@ let g = class extends E {
|
|
|
442
445
|
onclick: (f) => {
|
|
443
446
|
this.onDbClickWaveFrom(f, "single");
|
|
444
447
|
}
|
|
445
|
-
})), (
|
|
448
|
+
})), (d = this.singleWaveFromGroup) == null || d.add(new I({
|
|
446
449
|
cursor: "",
|
|
447
450
|
style: {
|
|
448
451
|
x: e[l].pos[0],
|
|
@@ -461,7 +464,7 @@ let g = class extends E {
|
|
|
461
464
|
this.singleWaveDataCopy = e, e = null;
|
|
462
465
|
}
|
|
463
466
|
drawLoopArrow(e = 0) {
|
|
464
|
-
var
|
|
467
|
+
var l, f, r, h, C, w, m, G, B, O, N, R;
|
|
465
468
|
if (this.drawLoopArrowStartPosIdx = e, !this.heartFight.isShow)
|
|
466
469
|
return;
|
|
467
470
|
this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect] || null, this.drawHeardBeatLine());
|
|
@@ -471,8 +474,8 @@ let g = class extends E {
|
|
|
471
474
|
i = this.loopArrowY.add - (L || 0) - this.splitBlockHeight / 3.5;
|
|
472
475
|
} else
|
|
473
476
|
i = 20;
|
|
474
|
-
let s = 0,
|
|
475
|
-
const
|
|
477
|
+
let s = 0, a = 0;
|
|
478
|
+
const o = {
|
|
476
479
|
fontSize: 12,
|
|
477
480
|
fill: "red",
|
|
478
481
|
fontFamily: this.fontFamily
|
|
@@ -481,13 +484,13 @@ let g = class extends E {
|
|
|
481
484
|
this.gridConfig.cellMg,
|
|
482
485
|
this.waveConfigs[this.heartFight.showIdxPai].sampleRate
|
|
483
486
|
);
|
|
484
|
-
let
|
|
487
|
+
let d = 0;
|
|
485
488
|
for (let L = 0; L < (this.heartBeatPosition[this.heartFight.showIdxPai] || []).length; L++) {
|
|
486
489
|
const p = this.heartBeatPosition[this.heartFight.showIdxPai][L];
|
|
487
|
-
if (
|
|
490
|
+
if (d = ((p == null ? void 0 : p.position) || 0) - e, !(e > ((p == null ? void 0 : p.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && d > (this.slidingWindowInfo.points || 0)) && !(this.leadModel.isSingleMode && d > (this.slidingWindowInfo.points || 0))) {
|
|
488
491
|
if (((p == null ? void 0 : p.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
|
|
489
492
|
break;
|
|
490
|
-
t =
|
|
493
|
+
t = d * (n || 0) + this.leadHeadConfig.leadHedeWidth - 9.5, a = 0, (r = this.arrowGroup) == null || r.add(new ee({
|
|
491
494
|
name: "arrow_box",
|
|
492
495
|
shape: {
|
|
493
496
|
points: [
|
|
@@ -502,7 +505,7 @@ let g = class extends E {
|
|
|
502
505
|
]
|
|
503
506
|
},
|
|
504
507
|
style: {
|
|
505
|
-
fill: ((
|
|
508
|
+
fill: ((f = (l = this.currentHeardBeat) == null ? void 0 : l.heardBeat) == null ? void 0 : f.index) === (p == null ? void 0 : p.index) ? "blue" : "#ccc"
|
|
506
509
|
},
|
|
507
510
|
onclick: (b) => {
|
|
508
511
|
var k;
|
|
@@ -514,76 +517,76 @@ let g = class extends E {
|
|
|
514
517
|
});
|
|
515
518
|
}), this.arrowLoopClick(p, b.target));
|
|
516
519
|
}
|
|
517
|
-
})), this.heartFight.heartrate && (s = ((
|
|
520
|
+
})), this.heartFight.heartrate && (s = ((h = this.AssistCtx) == null ? void 0 : h.measureText(`${(p == null ? void 0 : p.heartrate) || ""}`).width) || 0, (C = this.arrowGroup) == null || C.add(new I({
|
|
518
521
|
cursor: "",
|
|
519
|
-
style:
|
|
522
|
+
style: y({
|
|
520
523
|
x: 4 + t - s * 1.5,
|
|
521
|
-
y:
|
|
524
|
+
y: a + i,
|
|
522
525
|
text: `${(p == null ? void 0 : p.heartrate) || ""}`
|
|
523
|
-
},
|
|
524
|
-
})),
|
|
526
|
+
}, o)
|
|
527
|
+
})), a += 12), this.heartFight.interval && (s = ((w = this.AssistCtx) == null ? void 0 : w.measureText(`${(p == null ? void 0 : p.interval) || ""}`).width) || 0, (m = this.arrowGroup) == null || m.add(new I({
|
|
525
528
|
cursor: "",
|
|
526
|
-
style:
|
|
529
|
+
style: y({
|
|
527
530
|
x: 4 + t - s * 1.5,
|
|
528
|
-
y:
|
|
531
|
+
y: a + i,
|
|
529
532
|
text: `${(p == null ? void 0 : p.interval) || ""}`
|
|
530
|
-
},
|
|
531
|
-
})),
|
|
533
|
+
}, o)
|
|
534
|
+
})), a += 12), this.heartFight.qrstCompany && (s = ((G = this.AssistCtx) == null ? void 0 : G.measureText(`${(p == null ? void 0 : p.qrstCompany) || ""}`).width) || 0, (B = this.arrowGroup) == null || B.add(new I({
|
|
532
535
|
cursor: "",
|
|
533
|
-
style:
|
|
536
|
+
style: y({
|
|
534
537
|
x: 4 + t - s * 1.5,
|
|
535
|
-
y:
|
|
538
|
+
y: a + i,
|
|
536
539
|
text: `${(p == null ? void 0 : p.qrstCompany) || ""}`
|
|
537
|
-
},
|
|
538
|
-
})),
|
|
540
|
+
}, o)
|
|
541
|
+
})), a += 12), this.heartFight.telectricalaxis && (s = ((O = this.AssistCtx) == null ? void 0 : O.measureText(`${(p == null ? void 0 : p.telectricalaxis) || ""}`).width) || 0, (N = this.arrowGroup) == null || N.add(new I({
|
|
539
542
|
cursor: "",
|
|
540
|
-
style:
|
|
543
|
+
style: y({
|
|
541
544
|
x: 4 + t - s * 1.5,
|
|
542
|
-
y:
|
|
545
|
+
y: a + i,
|
|
543
546
|
text: `${(p == null ? void 0 : p.telectricalaxis) || ""}`
|
|
544
|
-
},
|
|
547
|
+
}, o)
|
|
545
548
|
})));
|
|
546
549
|
}
|
|
547
550
|
}
|
|
548
|
-
(
|
|
551
|
+
(R = this.sceneIns) == null || R.add(this.arrowGroup);
|
|
549
552
|
}
|
|
550
553
|
arrowLoopClick(e, t) {
|
|
551
554
|
this.$emit("notifyHeardBeat", te.clone(e)), this.currentHeardBeat.heardBeat = e, this.currentHeardBeat.ele = t, this.drawHeardBeatLine();
|
|
552
555
|
}
|
|
553
556
|
drawHeardBeatLine(e = 0) {
|
|
554
|
-
var n, l, f,
|
|
557
|
+
var n, d, l, f, r, h, C;
|
|
555
558
|
if (!this.currentHeardBeat.heardBeat)
|
|
556
559
|
return;
|
|
557
|
-
(n = this.heardBeatLineGroup) == null || n.removeAll(), (
|
|
558
|
-
let t = {}, i = 0, s = this.getRednerPoints(),
|
|
560
|
+
(n = this.heardBeatLineGroup) == null || n.removeAll(), (d = this.sceneIns) == null || d.remove(this.heardBeatLineGroup);
|
|
561
|
+
let t = {}, i = 0, s = this.getRednerPoints(), a = this.getAddRednerPoints(), o;
|
|
559
562
|
e:
|
|
560
563
|
for (let w = 0; w < s.length; w++) {
|
|
561
|
-
t = ((
|
|
564
|
+
t = ((l = this.analyseValues[w]) == null ? void 0 : l[this.currentHeardBeat.heardBeat.index].KeyPosByBeat) || {};
|
|
562
565
|
for (const m in t)
|
|
563
566
|
if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(m) && Object.prototype.hasOwnProperty.call(t, m)) {
|
|
564
567
|
if (i = (t[m] - this.slidingWindowInfo.startInd) * (s[w].step || 0), this.isLeadOff(w) || this.isLeadDel(w))
|
|
565
568
|
continue;
|
|
566
|
-
if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (
|
|
569
|
+
if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (o = s[w], this.leadModel.isContinuous && w > this.leadModel.line - 1))
|
|
567
570
|
break e;
|
|
568
|
-
(
|
|
571
|
+
(f = this.heardBeatLineGroup) == null || f.add(this.createHeardBeatLine(o.pos[0] + i, o.pos[1]));
|
|
569
572
|
}
|
|
570
573
|
}
|
|
571
574
|
e:
|
|
572
|
-
for (let w = 0; w <
|
|
573
|
-
t = ((
|
|
575
|
+
for (let w = 0; w < a.length; w++) {
|
|
576
|
+
t = ((r = this.analyseValues[w]) == null ? void 0 : r[this.currentHeardBeat.heardBeat.index].KeyPosByBeat) || {};
|
|
574
577
|
for (const m in t)
|
|
575
578
|
if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(m)) {
|
|
576
|
-
if (i = (t[m] - this.slidingWindowInfo.startInd) * (
|
|
579
|
+
if (i = (t[m] - this.slidingWindowInfo.startInd) * (a[w].step || 0), this.isLeadOff(this.longLeadConfig.leadIdxs[w]) && this.isLeadDel(this.longLeadConfig.leadIdxs[w]))
|
|
577
580
|
continue;
|
|
578
581
|
if (e > t[m])
|
|
579
582
|
break e;
|
|
580
|
-
|
|
583
|
+
o = a[w], (h = this.heardBeatLineGroup) == null || h.add(this.createHeardBeatLine(o.pos[0] + i, o.pos[1]));
|
|
581
584
|
}
|
|
582
585
|
}
|
|
583
|
-
(C = this.sceneIns) == null || C.add(this.heardBeatLineGroup), t = null, s = null,
|
|
586
|
+
(C = this.sceneIns) == null || C.add(this.heardBeatLineGroup), t = null, s = null, a = null;
|
|
584
587
|
}
|
|
585
588
|
createHeardBeatLine(e, t) {
|
|
586
|
-
return new
|
|
589
|
+
return new P({
|
|
587
590
|
cursor: "",
|
|
588
591
|
shape: {
|
|
589
592
|
x1: e,
|
|
@@ -603,85 +606,91 @@ let g = class extends E {
|
|
|
603
606
|
}
|
|
604
607
|
getAddRednerPoints() {
|
|
605
608
|
const e = [];
|
|
606
|
-
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0,
|
|
607
|
-
for (let
|
|
608
|
-
s = this.longLeadConfig.leadIdxs[
|
|
609
|
+
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, a = [], o = 0, n = 0;
|
|
610
|
+
for (let d = 0; d < this.leadModel.add; d++)
|
|
611
|
+
s = this.longLeadConfig.leadIdxs[d], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, o = W(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = S(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (d + this.leadModel.line + 1) * this.splitBlockHeight, a = this.waveLists[s] || [], d === 0 && (this.loopArrowY.add = i), e.push({
|
|
609
612
|
pos: [t, i],
|
|
610
613
|
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
611
614
|
endInd: this.addSlidingWindowInfo.endInd || 0,
|
|
612
|
-
data:
|
|
615
|
+
data: a.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((l, f) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? H(this.waveConfigs[s].sensitivity, l, n / 2) : H(this.waveConfigs[s].sensitivity, l, n)).map((l, f) => [f * (o || 0), -l]),
|
|
613
616
|
sens: n,
|
|
614
|
-
step:
|
|
617
|
+
step: o
|
|
615
618
|
}));
|
|
616
619
|
return e;
|
|
617
620
|
}
|
|
618
621
|
createAddWaveFrom() {
|
|
619
|
-
var
|
|
620
|
-
let e = this.getAddRednerPoints();
|
|
621
|
-
for (let
|
|
622
|
-
this.isLeadDel(this.longLeadConfig.leadIdxs[
|
|
622
|
+
var i;
|
|
623
|
+
let e = this.getAddRednerPoints(), t = 0;
|
|
624
|
+
for (let s = 0; s < e.length; s++)
|
|
625
|
+
this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new x({
|
|
623
626
|
cursor: "",
|
|
624
|
-
name: this.longLeadConfig.leadIdxs[
|
|
627
|
+
name: this.longLeadConfig.leadIdxs[s] + "_" + s,
|
|
625
628
|
shape: {
|
|
626
|
-
points: e[
|
|
627
|
-
s + e[
|
|
628
|
-
|
|
629
|
-
])
|
|
629
|
+
points: e[s].data.map(([a, o], n) => isNaN(o) ? (t === 0 && (t = n - 1, t = t < 0 ? 0 : t), [
|
|
630
|
+
e[s].data[t][0] + e[s].pos[0],
|
|
631
|
+
e[s].data[t][1] + e[s].pos[1]
|
|
632
|
+
]) : (t = 0, [
|
|
633
|
+
a + e[s].pos[0],
|
|
634
|
+
o + e[s].pos[1]
|
|
635
|
+
]))
|
|
630
636
|
},
|
|
631
637
|
style: {
|
|
632
638
|
stroke: this.leadConfig.lineColor,
|
|
633
639
|
lineWidth: this.leadConfig.lineWidth
|
|
634
640
|
},
|
|
635
|
-
onclick: (
|
|
636
|
-
this.onDbClickWaveFrom(
|
|
641
|
+
onclick: (a) => {
|
|
642
|
+
this.onDbClickWaveFrom(a, "add");
|
|
637
643
|
}
|
|
638
|
-
})), this.createLeadName(this.longLeadConfig.leadNames[
|
|
644
|
+
})), this.createLeadName(this.longLeadConfig.leadNames[s], e[s].pos[0], e[s].pos[1] - 15, !0), this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s], e[s].pos[0] - 5, e[s].pos[1] - (e[s].sens || 0) / 2 - 15));
|
|
639
645
|
this.addWaveDataCopy = e, e = null;
|
|
640
646
|
}
|
|
641
647
|
getRednerPoints() {
|
|
642
|
-
let e = 0, t = 0, i = 0, s = [],
|
|
643
|
-
const
|
|
644
|
-
for (let
|
|
645
|
-
e =
|
|
646
|
-
for (let
|
|
647
|
-
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t,
|
|
648
|
+
let e = 0, t = 0, i = 0, s = [], a = 0, o = 0, n = this.slidingWindowInfo.startInd || 0, d = this.slidingWindowInfo.endInd || 0;
|
|
649
|
+
const l = [];
|
|
650
|
+
for (let f = 0; f < this.leadModel.column; f++) {
|
|
651
|
+
e = f * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && f > 0 && (n = d, d = n + (this.slidingWindowInfo.points || 0));
|
|
652
|
+
for (let r = 1; r <= this.leadModel.line && (t = r * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); r++)
|
|
653
|
+
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = W(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), o = S(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), l.push({
|
|
648
654
|
pos: [e, t],
|
|
649
655
|
startInd: n,
|
|
650
|
-
endInd:
|
|
651
|
-
sens:
|
|
652
|
-
step:
|
|
653
|
-
data: s.slice(n,
|
|
656
|
+
endInd: d,
|
|
657
|
+
sens: o,
|
|
658
|
+
step: a,
|
|
659
|
+
data: s.slice(n, d).map((h, C) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? H(this.waveConfigs[i].sensitivity, h, o / 2) : H(this.waveConfigs[i].sensitivity, h, o)).map((h, C) => [C * (a || 0), -h])
|
|
654
660
|
}), i++);
|
|
655
661
|
}
|
|
656
|
-
return
|
|
662
|
+
return l;
|
|
657
663
|
}
|
|
658
664
|
createRowAndColWaveFrom() {
|
|
659
|
-
var
|
|
660
|
-
|
|
661
|
-
let e = this.getRednerPoints(), t = 0;
|
|
665
|
+
var s, a;
|
|
666
|
+
(s = this.rowAndColwaveFromGroup) == null || s.removeAll();
|
|
667
|
+
let e = this.getRednerPoints(), t = 0, i = 0;
|
|
662
668
|
for (let o = 0; o < e.length; o++)
|
|
663
|
-
t = this.waveConfigs[o].leadIdx || 0, this.isLeadDel(t) || (
|
|
669
|
+
t = this.waveConfigs[o].leadIdx || 0, this.isLeadDel(t) || (a = this.rowAndColwaveFromGroup) == null || a.add(new x({
|
|
664
670
|
cursor: "",
|
|
665
671
|
name: o + "_" + o,
|
|
666
672
|
shape: {
|
|
667
|
-
points: e[o].data.map(([
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
])
|
|
673
|
+
points: e[o].data.map(([n, d], l) => isNaN(d) ? (i === 0 && (i = l - 1, i = i < 0 ? 0 : i), [
|
|
674
|
+
e[o].data[i][0] + e[o].pos[0],
|
|
675
|
+
e[o].data[i][1] + e[o].pos[1]
|
|
676
|
+
]) : (i = 0, [
|
|
677
|
+
n + e[o].pos[0],
|
|
678
|
+
d + e[o].pos[1]
|
|
679
|
+
]))
|
|
671
680
|
},
|
|
672
681
|
style: {
|
|
673
682
|
stroke: this.leadConfig.lineColor,
|
|
674
683
|
lineWidth: this.leadConfig.lineWidth
|
|
675
684
|
},
|
|
676
|
-
onclick: (
|
|
677
|
-
this.onDbClickWaveFrom(
|
|
685
|
+
onclick: (n) => {
|
|
686
|
+
this.onDbClickWaveFrom(n, "rowAndCol");
|
|
678
687
|
}
|
|
679
688
|
})), o < this.leadModel.line ? (this.createLeadName(t, e[o].pos[0], e[o].pos[1] - 15), this.createLeadOffAndDel(t, e[o].pos[0] - 5, e[o].pos[1] - (e[o].sens || 0) / 2 - 15)) : (this.createLeadName(t, e[o].pos[0] + 5, e[o].pos[1] - (e[o].sens || 0) / 2), this.createLeadOffAndDel(t, e[o].pos[0] - 5, e[o].pos[1] - (e[o].sens || 0) / 2 + 9));
|
|
680
689
|
this.waveDataCopy = e, e = null;
|
|
681
690
|
}
|
|
682
691
|
createLeadName(e, t, i, s = !1) {
|
|
683
|
-
var
|
|
684
|
-
(
|
|
692
|
+
var a;
|
|
693
|
+
(a = this.leadHeadNameGroup) == null || a.add(new I({
|
|
685
694
|
style: {
|
|
686
695
|
x: t,
|
|
687
696
|
y: i,
|
|
@@ -690,18 +699,18 @@ let g = class extends E {
|
|
|
690
699
|
fill: this.leadConfig.lineColor,
|
|
691
700
|
fontFamily: this.leadConfig.fontFamily
|
|
692
701
|
},
|
|
693
|
-
oncontextmenu: (
|
|
694
|
-
|
|
695
|
-
event: D(
|
|
702
|
+
oncontextmenu: (o) => {
|
|
703
|
+
o.event.preventDefault(), this.$emit("notiifyLeadName", {
|
|
704
|
+
event: D(y({}, o), {
|
|
696
705
|
name: this.leadNames[e],
|
|
697
706
|
idx: e
|
|
698
707
|
}),
|
|
699
708
|
isAdd: s
|
|
700
709
|
});
|
|
701
710
|
},
|
|
702
|
-
onclick: (
|
|
711
|
+
onclick: (o) => {
|
|
703
712
|
this.$emit("notiifyLeadName", {
|
|
704
|
-
event: D(
|
|
713
|
+
event: D(y({}, o), {
|
|
705
714
|
name: this.leadNames[e],
|
|
706
715
|
idx: e
|
|
707
716
|
}),
|
|
@@ -712,7 +721,7 @@ let g = class extends E {
|
|
|
712
721
|
}
|
|
713
722
|
createLeadOffAndDel(e, t, i) {
|
|
714
723
|
var s;
|
|
715
|
-
(this.isLeadOff(e) || this.isLeadDel(e)) && ((s = this.leadHeadOffAndDelGroup) == null || s.add(new
|
|
724
|
+
(this.isLeadOff(e) || this.isLeadDel(e)) && ((s = this.leadHeadOffAndDelGroup) == null || s.add(new I({
|
|
716
725
|
cursor: "",
|
|
717
726
|
style: {
|
|
718
727
|
x: t,
|
|
@@ -728,15 +737,15 @@ let g = class extends E {
|
|
|
728
737
|
onDbClickWaveFrom(e, t) {
|
|
729
738
|
console.log("onDbClickWaveFrom", e);
|
|
730
739
|
const i = Date.now(), s = () => {
|
|
731
|
-
const
|
|
732
|
-
this.activeLeadIdx = +
|
|
733
|
-
const
|
|
734
|
-
let n = 0,
|
|
735
|
-
t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[
|
|
736
|
-
sens:
|
|
737
|
-
step:
|
|
740
|
+
const a = e.target.name.split("_");
|
|
741
|
+
this.activeLeadIdx = +a[0];
|
|
742
|
+
const o = +a[1];
|
|
743
|
+
let n = 0, d = 0, l = 0, f = 0, r = 0;
|
|
744
|
+
t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[o].pos[0], d = this.singleWaveDataCopy[o].startInd, l = F(n, this.singleWaveDataCopy[o].step || 1), f = this.singleWaveDataCopy[o].sens, r = this.singleWaveDataCopy[o].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[o].pos[0], d = this.waveDataCopy[o].startInd || 0, l = F(n, this.waveDataCopy[o].step || 1), f = this.waveDataCopy[o].sens, r = this.waveDataCopy[o].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[o].pos[0], d = this.addWaveDataCopy[o].startInd || 0, l = F(n, this.addWaveDataCopy[o].step || 1), f = this.addWaveDataCopy[o].sens, r = this.addWaveDataCopy[o].step), l += d, this.$emit("notifyActiveEnlargr", {
|
|
745
|
+
sens: f,
|
|
746
|
+
step: r,
|
|
738
747
|
activeLeadIdx: this.activeLeadIdx,
|
|
739
|
-
pointIdx:
|
|
748
|
+
pointIdx: l
|
|
740
749
|
});
|
|
741
750
|
};
|
|
742
751
|
i - this.dbClickWaveFromTime < 400 ? (this.dbClickWaveFromTime = 0, s()) : this.dbClickWaveFromTime = i;
|
|
@@ -755,24 +764,24 @@ let g = class extends E {
|
|
|
755
764
|
});
|
|
756
765
|
}
|
|
757
766
|
scrollWaveFrom(e) {
|
|
758
|
-
var s,
|
|
767
|
+
var s, a;
|
|
759
768
|
this.slidingWindowInfo.startInd = e, this.slidingWindowInfo.endInd = e + (this.slidingWindowInfo.points || 0), this.addSlidingWindowInfo.startInd = e, this.addSlidingWindowInfo.endInd = e + (this.addSlidingWindowInfo.points || 0);
|
|
760
769
|
let t = this.getRednerPoints(), i = this.getAddRednerPoints();
|
|
761
|
-
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((
|
|
762
|
-
n = n || 0,
|
|
770
|
+
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((o, n) => {
|
|
771
|
+
n = n || 0, o.attr({
|
|
763
772
|
shape: {
|
|
764
|
-
points: t[n].data.map(([
|
|
765
|
-
|
|
766
|
-
|
|
773
|
+
points: t[n].data.map(([d, l]) => [
|
|
774
|
+
d + t[n].pos[0],
|
|
775
|
+
l + t[n].pos[1]
|
|
767
776
|
])
|
|
768
777
|
}
|
|
769
778
|
});
|
|
770
|
-
}), (
|
|
771
|
-
n = n || 0,
|
|
779
|
+
}), (a = this.addwaveFromGroup) == null || a.eachChild((o, n) => {
|
|
780
|
+
n = n || 0, o.attr({
|
|
772
781
|
shape: {
|
|
773
|
-
points: i[n].data.map(([
|
|
774
|
-
|
|
775
|
-
|
|
782
|
+
points: i[n].data.map(([d, l]) => [
|
|
783
|
+
d + i[n].pos[0],
|
|
784
|
+
l + i[n].pos[1]
|
|
776
785
|
])
|
|
777
786
|
}
|
|
778
787
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var O=Object.defineProperty,B=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var G=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))N.call(t,i)&&G(e,i,t[i]);if(D)for(var i of D(t))k.call(t,i)&&G(e,i,t[i]);return e},F=(e,t)=>B(e,R(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),z=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 w=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"),L=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),T=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function _(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const $=T(j),X=_(g);var V=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,c=(e,t,i,s)=>{for(var o=s>1?void 0:s?Y(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&V(t,i,o),o};exports.default=class extends $.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,o,a,n,l,f,h,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(o=this.splitLineGroup)==null||o.removeAll(),(a=this.leadHeadNameGroup)==null||a.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(f=this.arrowGroup)==null||f.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.sceneIns)==null||d.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollBy({dx:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate,interval:Math.round(60/this.analyseValues[t][i].AnabyBeat.VentricularRate*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),o=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(o||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:i,startInd:0,endInd:i}}calcHighestAndLowestPoint(){const e=L.flattenDeep(this.waveLists);return{maxPoints:L.max(e)||0,minPoints:L.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.addSlidingWindowInfo={points:0,startInd:0,endInd:0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=X.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var a,n,l,f,h;(a=this.leadHeadGroup)==null||a.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let d=0;d<=this.leadModel.column;d++){s=d*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+s])break e;!this.waveConfigs[r-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[r-1+s]||"",this.waveConfigs[r-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[r-1+s].posX?this.waveConfigs[r-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,this.waveConfigs[r-1+s].posY||r*this.splitBlockHeight,u.getSens(this.waveConfigs[r-1+s].gain,this.gridConfig.cellMg),t)))}}let o=null;for(let d=0;d<this.leadModel.add;d++)!this.waveConfigs[this.longLeadConfig.leadIdxs[d]]||(o=this.waveConfigs[this.longLeadConfig.leadIdxs[d]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]],t=!1,o.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=o.posX?o.posX-this.leadHeadConfig.leadHedeWidth:0,(f=this.leadHeadGroup)==null||f.add(this.createLeadHead(i,o.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,console.log("this.leadHeadGroup",this.leadHeadGroup),(h=this.sceneIns)==null||h.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[o+e,0+t],[o+e,-i+t],[3*o+e,-i+t],[3*o+e,0+t],[4*o+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var a,n,l,f,h;(a=this.splitLineGroup)==null||a.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const d=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),r=u.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${r/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(d||0)}let t=0,i=0,s=0,o=0;for(let d=1;d<=this.leadModel.column-1;d++){t=d*e+this.leadHeadConfig.leadHedeWidth,i=d*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+i])break e;if((this.waveConfigs||[])[r-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[r-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[r-1+i].posX),s=(this.waveConfigs||[])[r-1+i].leadIdx,s===void 0)break;o=u.getSens((this.waveConfigs||[])[r-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[r-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)*.5,o))}}(h=this.sceneIns)==null||h.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,o;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:y({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:y({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(o=this.sceneIns)==null||o.add(t)}drawRuler(e=0){var n,l,f;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const a=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&a){const h=u.getPointIdxForPx(this.splitPoint,a),d=u.getDataLenTimes(h,this.rulerConfig.sampleRate||0)/1e3;o=e+d}for(let h=e;h<=o;h=+(h+.1).toFixed(1))h!==e&&(i+=this.rulerStep),h%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:h+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(l=this.rulerGroup)==null||l.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow()}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const a=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),l=[],f=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let h=0;h<1;h++){e=h*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=f;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:s,endInd:o,step:a,sens:n,data:i.slice(s,o).map((r,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,n)).map((r,m)=>[m*(a||0),-r])})}return l}createSingleWaveFrom(){var o,a,n;(o=this.singleWaveFromGroup)==null||o.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(a=this.singleWaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,h])=>[f+e[l].pos[0],h+e[l].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{this.onDbClickWaveFrom(f,"single")}})),(n=this.singleWaveFromGroup)==null||n.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var f,h,d,r,m,C,v,H,x,P,A,M;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const I=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(I||0)-this.splitBlockHeight/3.5}else i=20;let s=0,o=0;const a={fontSize:12,fill:"red",fontFamily:this.fontFamily},n=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let l=0;for(let I=0;I<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;I++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][I];if(l=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&l>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&l>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=l*(n||0)+this.leadHeadConfig.leadHedeWidth-9.5,o=0,(d=this.arrowGroup)==null||d.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((h=(f=this.currentHeardBeat)==null?void 0:f.heardBeat)==null?void 0:h.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:W=>{var b;!this.heartFight.mode||(W.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(S=>S.name==="arrow_box").forEach(S=>{S.id!==W.target.id&&S.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,W.target))}})),this.heartFight.heartrate&&(s=((r=this.AssistCtx)==null?void 0:r.measureText(`${(p==null?void 0:p.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.heartrate)||""}`},a)})),o+=12),this.heartFight.interval&&(s=((C=this.AssistCtx)==null?void 0:C.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.interval)||""}`},a)})),o+=12),this.heartFight.qrstCompany&&(s=((H=this.AssistCtx)==null?void 0:H.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(x=this.arrowGroup)==null||x.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},a)})),o+=12),this.heartFight.telectricalaxis&&(s=((P=this.AssistCtx)==null?void 0:P.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(A=this.arrowGroup)==null||A.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},a)})))}}(M=this.sceneIns)==null||M.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",g.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var n,l,f,h,d,r,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t={},i=0,s=this.getRednerPoints(),o=this.getAddRednerPoints(),a;e:for(let C=0;C<s.length;C++){t=((f=this.analyseValues[C])==null?void 0:f[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(s[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(a=s[C],this.leadModel.isContinuous&&C>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(a.pos[0]+i,a.pos[1]))}}e:for(let C=0;C<o.length;C++){t=((d=this.analyseValues[C])==null?void 0:d[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(o[C].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[C])&&this.isLeadDel(this.longLeadConfig.leadIdxs[C]))continue;if(e>t[v])break e;a=o[C],(r=this.heardBeatLineGroup)==null||r.add(this.createHeardBeatLine(a.pos[0]+i,a.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,s=null,o=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,o=[],a=0,n=0;for(let l=0;l<this.leadModel.add;l++)s=this.longLeadConfig.leadIdxs[l],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,a=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(l+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],l===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:o.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((f,h)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,f,n/2):u.getActualY(this.waveConfigs[s].sensitivity,f,n)).map((f,h)=>[h*(a||0),-f]),sens:n,step:a}));return e}createAddWaveFrom(){var t;let e=this.getAddRednerPoints();for(let i=0;i<e.length;i++)this.isLeadDel(this.longLeadConfig.leadIdxs[i])||((t=this.addwaveFromGroup)==null||t.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[i]+"_"+i,shape:{points:e[i].data.map(([s,o])=>[s+e[i].pos[0],o+e[i].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:s=>{this.onDbClickWaveFrom(s,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[i],e[i].pos[0],e[i].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[i],e[i].pos[0]-5,e[i].pos[1]-(e[i].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,a=0,n=this.slidingWindowInfo.startInd||0,l=this.slidingWindowInfo.endInd||0;const f=[];for(let h=0;h<this.leadModel.column;h++){e=h*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&h>0&&(n=l,l=n+(this.slidingWindowInfo.points||0));for(let d=1;d<=this.leadModel.line&&(t=d*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));d++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,o=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),a=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),f.push({pos:[e,t],startInd:n,endInd:l,sens:a,step:o,data:s.slice(n,l).map((r,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,r,a/2):u.getActualY(this.waveConfigs[i].sensitivity,r,a)).map((r,m)=>[m*(o||0),-r])}),i++)}return f}createRowAndColWaveFrom(){var i,s;console.time("createRowAndColWaveFrom"),(i=this.rowAndColwaveFromGroup)==null||i.removeAll();let e=this.getRednerPoints(),t=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(s=this.rowAndColwaveFromGroup)==null||s.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([a,n])=>[a+e[o].pos[0],n+e[o].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:a=>{a.event.preventDefault(),this.$emit("notiifyLeadName",{event:F(y({},a),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:a=>{this.$emit("notiifyLeadName",{event:F(y({},a),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const o=e.target.name.split("_");this.activeLeadIdx=+o[0];const a=+o[1];let n=0,l=0,f=0,h=0,d=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[a].pos[0],l=this.singleWaveDataCopy[a].startInd,f=u.getPointIdxForPx(n,this.singleWaveDataCopy[a].step||1),h=this.singleWaveDataCopy[a].sens,d=this.singleWaveDataCopy[a].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[a].pos[0],l=this.waveDataCopy[a].startInd||0,f=u.getPointIdxForPx(n,this.waveDataCopy[a].step||1),h=this.waveDataCopy[a].sens,d=this.waveDataCopy[a].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[a].pos[0],l=this.addWaveDataCopy[a].startInd||0,f=u.getPointIdxForPx(n,this.addWaveDataCopy[a].step||1),h=this.addWaveDataCopy[a].sens,d=this.addWaveDataCopy[a].step),f+=l,this.$emit("notifyActiveEnlargr",{sens:h,step:d,activeLeadIdx:this.activeLeadIdx,pointIdx:f})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,o;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((a,n)=>{n=n||0,a.attr({shape:{points:t[n].data.map(([l,f])=>[l+t[n].pos[0],f+t[n].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((a,n)=>{n=n||0,a.attr({shape:{points:i[n].data.map(([l,f])=>[l+i[n].pos[0],f+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);c([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);c([w.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);c([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);c([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);c([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);c([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);c([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);c([w.Prop({default:()=>0})],exports.default.prototype,"posStart",2);c([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);c([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=c([z.default({name:"Methods"})],exports.default);
|
|
1
|
+
"use strict";var O=Object.defineProperty,B=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var G=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,I=(e,t)=>{for(var i in t||(t={}))R.call(t,i)&&G(e,i,t[i]);if(D)for(var i of D(t))k.call(t,i)&&G(e,i,t[i]);return e},F=(e,t)=>B(e,N(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),z=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 w=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"),L=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),T=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function _(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const $=T(j),X=_(g);var V=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,c=(e,t,i,s)=>{for(var a=s>1?void 0:s?Y(t,i):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(a=(s?n(t,i,a):n(a))||a);return s&&a&&V(t,i,a),a};exports.default=class extends $.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,d,l,f,r;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(d=this.rulerGroup)==null||d.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(r=this.sceneIns)==null||r.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollBy({dx:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate,interval:Math.round(60/this.analyseValues[t][i].AnabyBeat.VentricularRate*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points||t,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||t},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||i,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||i}}calcHighestAndLowestPoint(){const e=L.flattenDeep(this.waveLists);return{maxPoints:L.max(e)||0,minPoints:L.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=X.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var o,n,d,l,f;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let r=0;r<=this.leadModel.column;r++){s=r*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+s])break e;!this.waveConfigs[h-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[h-1+s]||"",this.waveConfigs[h-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[h-1+s].posX?this.waveConfigs[h-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(d=this.leadHeadGroup)==null||d.add(this.createLeadHead(i,this.waveConfigs[h-1+s].posY||h*this.splitBlockHeight,u.getSens(this.waveConfigs[h-1+s].gain,this.gridConfig.cellMg),t)))}}let a=null;for(let r=0;r<this.leadModel.add;r++)!this.waveConfigs[this.longLeadConfig.leadIdxs[r]]||(a=this.waveConfigs[this.longLeadConfig.leadIdxs[r]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]],t=!1,a.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=a.posX?a.posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,a.posY||(r+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t)));a=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const a=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[a+e,0+t],[a+e,-i+t],[3*a+e,-i+t],[3*a+e,0+t],[4*a+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var o,n,d,l,f;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const r=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),h=u.getDataLenTimes(Math.ceil(this.splitPoint/(r||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${h/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(r||0)}let t=0,i=0,s=0,a=0;for(let r=1;r<=this.leadModel.column-1;r++){t=r*e+this.leadHeadConfig.leadHedeWidth,i=r*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+i])break e;if((this.waveConfigs||[])[h-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[h-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[h-1+i].posX),s=(this.waveConfigs||[])[h-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[h-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[h-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(d=this.splitLineGroup)==null||d.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)*.5,a))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:I({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:I({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,d,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const f=u.getPointIdxForPx(this.splitPoint,o),r=u.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;a=e+r}for(let f=e;f<=a;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(d=this.rulerGroup)==null||d.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(l=this.sceneIns)==null||l.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow()}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),d=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=l;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),d.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((h,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n)).map((h,m)=>[m*(o||0),-h])})}return d}createSingleWaveFrom(){var o,n,d;(o=this.singleWaveFromGroup)==null||o.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,a=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(n=this.singleWaveFromGroup)==null||n.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,r],h)=>isNaN(r)?(a===0&&(a=h-1,a=a<0?0:a),[e[l].data[a][0]+e[l].pos[0],e[l].data[a][1]+e[l].pos[1]]):(a=0,[f+e[l].pos[0],r+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{this.onDbClickWaveFrom(f,"single")}})),(d=this.singleWaveFromGroup)==null||d.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var l,f,r,h,m,C,v,x,H,P,M,A;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const y=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(y||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily},n=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0;for(let y=0;y<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;y++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][y];if(d=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=d*(n||0)+this.leadHeadConfig.leadHedeWidth-9.5,a=0,(r=this.arrowGroup)==null||r.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((f=(l=this.currentHeardBeat)==null?void 0:l.heardBeat)==null?void 0:f.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:W=>{var b;!this.heartFight.mode||(W.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(S=>S.name==="arrow_box").forEach(S=>{S.id!==W.target.id&&S.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,W.target))}})),this.heartFight.heartrate&&(s=((h=this.AssistCtx)==null?void 0:h.measureText(`${(p==null?void 0:p.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((C=this.AssistCtx)==null?void 0:C.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((x=this.AssistCtx)==null?void 0:x.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(H=this.arrowGroup)==null||H.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((P=this.AssistCtx)==null?void 0:P.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(M=this.arrowGroup)==null||M.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},o)})))}}(A=this.sceneIns)==null||A.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",g.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var n,d,l,f,r,h,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(d=this.sceneIns)==null||d.remove(this.heardBeatLineGroup);let t={},i=0,s=this.getRednerPoints(),a=this.getAddRednerPoints(),o;e:for(let C=0;C<s.length;C++){t=((l=this.analyseValues[C])==null?void 0:l[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(s[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=s[C],this.leadModel.isContinuous&&C>this.leadModel.line-1))break e;(f=this.heardBeatLineGroup)==null||f.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}e:for(let C=0;C<a.length;C++){t=((r=this.analyseValues[C])==null?void 0:r[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(a[C].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[C])&&this.isLeadDel(this.longLeadConfig.leadIdxs[C]))continue;if(e>t[v])break e;o=a[C],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,s=null,a=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let d=0;d<this.leadModel.add;d++)s=this.longLeadConfig.leadIdxs[d],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(d+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],d===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((l,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,l,n/2):u.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,f)=>[f*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o],n)=>isNaN(o)?(t===0&&(t=n-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[a+e[s].pos[0],o+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,d=this.slidingWindowInfo.endInd||0;const l=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(n=d,d=n+(this.slidingWindowInfo.points||0));for(let r=1;r<=this.leadModel.line&&(t=r*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));r++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(r===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:d,sens:o,step:a,data:s.slice(n,d).map((h,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,h,o/2):u.getActualY(this.waveConfigs[i].sensitivity,h,o)).map((h,m)=>[m*(a||0),-h])}),i++)}return l}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,d],l)=>isNaN(d)?(i===0&&(i=l-1,i=i<0?0:i),[e[o].data[i][0]+e[o].pos[0],e[o].data[i][1]+e[o].pos[1]]):(i=0,[n+e[o].pos[0],d+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var a;(a=this.leadHeadNameGroup)==null||a.add(new g.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:F(I({},o),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:o=>{this.$emit("notiifyLeadName",{event:F(I({},o),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,d=0,l=0,f=0,r=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],d=this.singleWaveDataCopy[o].startInd,l=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),f=this.singleWaveDataCopy[o].sens,r=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],d=this.waveDataCopy[o].startInd||0,l=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),f=this.waveDataCopy[o].sens,r=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],d=this.addWaveDataCopy[o].startInd||0,l=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),f=this.addWaveDataCopy[o].sens,r=this.addWaveDataCopy[o].step),l+=d,this.$emit("notifyActiveEnlargr",{sens:f,step:r,activeLeadIdx:this.activeLeadIdx,pointIdx:l})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,a;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((o,n)=>{n=n||0,o.attr({shape:{points:t[n].data.map(([d,l])=>[d+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,o.attr({shape:{points:i[n].data.map(([d,l])=>[d+i[n].pos[0],l+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);c([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);c([w.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);c([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);c([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);c([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);c([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);c([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);c([w.Prop({default:()=>0})],exports.default.prototype,"posStart",2);c([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);c([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=c([z.default({name:"Methods"})],exports.default);
|