costy-plus 1.1.34-0 → 1.1.35-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.
|
@@ -10,8 +10,8 @@ import u from "../ParallelRuler/index2.js";
|
|
|
10
10
|
import g from "../BackgroundGrid/index2.js";
|
|
11
11
|
import w from "./method.js";
|
|
12
12
|
var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, t = (i, a, s, n) => {
|
|
13
|
-
for (var o = n > 1 ? void 0 : n ? v(a, s) : a,
|
|
14
|
-
(
|
|
13
|
+
for (var o = n > 1 ? void 0 : n ? v(a, s) : a, h = i.length - 1, p; h >= 0; h--)
|
|
14
|
+
(p = i[h]) && (o = (n ? p(a, s, o) : p(o)) || o);
|
|
15
15
|
return n && o && C(a, s, o), o;
|
|
16
16
|
};
|
|
17
17
|
let e = class extends c(w) {
|
|
@@ -22,7 +22,10 @@ let e = class extends c(w) {
|
|
|
22
22
|
this.repaint();
|
|
23
23
|
}
|
|
24
24
|
watchAnalyseValues() {
|
|
25
|
-
this.
|
|
25
|
+
this.nearestHeartInfo = {
|
|
26
|
+
analyseValue: null,
|
|
27
|
+
insertInfo: null
|
|
28
|
+
}, this.repaint();
|
|
26
29
|
}
|
|
27
30
|
watchsingleModeConfig() {
|
|
28
31
|
this.repaint();
|
|
@@ -15,15 +15,15 @@ import J from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/nod
|
|
|
15
15
|
import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
|
|
16
16
|
import { Prop as v } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js";
|
|
17
17
|
import { flattenDeep as ee, max as te, min as ie, cloneDeep as _ } from "lodash";
|
|
18
|
-
import { throttling as Y, getStepForSpeed as b, getPrintLengthToPx as se, getPointIdxForPx as G, getSens as N, getDataLenTimes as V, getActualY as O, calcMs as ae, calcBpm as
|
|
19
|
-
import * as
|
|
18
|
+
import { throttling as Y, getStepForSpeed as b, getPrintLengthToPx as se, getPointIdxForPx as G, getSens as N, getDataLenTimes as V, getActualY as O, calcMs as ae, calcBpm as ne } from "@costy-plus/utils";
|
|
19
|
+
import * as oe from "zrender";
|
|
20
20
|
import { Group as P, Polyline as z, Line as X, Text as F, Rect as le, util as de } from "zrender";
|
|
21
21
|
var re = Object.defineProperty, he = Object.getOwnPropertyDescriptor, C = (e, t, i, s) => {
|
|
22
|
-
for (var a = s > 1 ? void 0 : s ? he(t, i) : t,
|
|
23
|
-
(
|
|
22
|
+
for (var a = s > 1 ? void 0 : s ? he(t, i) : t, n = e.length - 1, o; n >= 0; n--)
|
|
23
|
+
(o = e[n]) && (a = (s ? o(t, i, a) : o(a)) || a);
|
|
24
24
|
return s && a && re(t, i, a), a;
|
|
25
25
|
};
|
|
26
|
-
let
|
|
26
|
+
let c = class extends Z {
|
|
27
27
|
constructor() {
|
|
28
28
|
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.arrowHeartGroup = Object.freeze(null), this.heardBeatLineGroup = Object.freeze(null), this.bottomAreaHeight = Object.freeze(10), 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.nearestHeartInfo = Object.freeze({
|
|
29
29
|
analyseValue: null,
|
|
@@ -53,8 +53,8 @@ let w = class extends Z {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
destroyed() {
|
|
56
|
-
var e, t, i, s, a,
|
|
57
|
-
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(), (
|
|
56
|
+
var e, t, i, s, a, n, o, r, l, d, h, f;
|
|
57
|
+
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(), (n = this.leadHeadNameGroup) == null || n.removeAll(), (o = this.leadHeadOffAndDelGroup) == null || o.removeAll(), (r = this.rulerGroup) == null || r.removeAll(), (l = this.arrowGroup) == null || l.removeAll(), (d = this.arrowHeartGroup) == null || d.removeAll(), (h = this.heardBeatLineGroup) == null || h.removeAll(), (f = this.sceneIns) == null || f.dispose();
|
|
58
58
|
}
|
|
59
59
|
initCreatedConfig() {
|
|
60
60
|
this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height, this.calcHeartBeatPositions(), this.initConfig();
|
|
@@ -198,7 +198,7 @@ let w = class extends Z {
|
|
|
198
198
|
var i;
|
|
199
199
|
(i = this.sceneIns) == null || i.dispose(), this.AssistCtx = null;
|
|
200
200
|
const e = document.getElementById(`${this.prefixId}wave-from-box`);
|
|
201
|
-
this.sceneIns =
|
|
201
|
+
this.sceneIns = oe.init(e, {
|
|
202
202
|
width: this.canvasContainer.width,
|
|
203
203
|
height: this.canvasContainer.height,
|
|
204
204
|
devicePixelRatio: 1
|
|
@@ -219,7 +219,7 @@ let w = class extends Z {
|
|
|
219
219
|
if (s += i, s <= 0)
|
|
220
220
|
return;
|
|
221
221
|
const a = 0.15 * this.waveConfigs[this.heartFight.showIdxPai].sampleRate;
|
|
222
|
-
let
|
|
222
|
+
let n = null, o = -1, r = -1, l = 1 / 0;
|
|
223
223
|
for (let y = 0; y < this.analyseValues.length; y++) {
|
|
224
224
|
const W = this.analyseValues[y], x = y !== 1 ? W.filter((M, m) => {
|
|
225
225
|
var u;
|
|
@@ -231,12 +231,12 @@ let w = class extends Z {
|
|
|
231
231
|
if (u === void 0)
|
|
232
232
|
break;
|
|
233
233
|
const g = Math.abs(s - u);
|
|
234
|
-
g <= a && g < l && (l = g,
|
|
234
|
+
g <= a && g < l && (l = g, n = m, o = M, r = y), u < s ? L = M + 1 : H = M - 1;
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
if (console.log("currentHeat",
|
|
237
|
+
if (console.log("currentHeat", n, o, r, n == null ? void 0 : n.BeatID, a), n)
|
|
238
238
|
this.nearestHeartInfo = {
|
|
239
|
-
analyseValue:
|
|
239
|
+
analyseValue: n,
|
|
240
240
|
insertInfo: null
|
|
241
241
|
};
|
|
242
242
|
else {
|
|
@@ -350,7 +350,7 @@ let w = class extends Z {
|
|
|
350
350
|
(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), (s = this.sceneIns) == null || s.off("click", this.sceneInsClick), (a = this.sceneIns) == null || a.off("contextmenu", this.sceneInsContextmenu);
|
|
351
351
|
}
|
|
352
352
|
drawLeadHead() {
|
|
353
|
-
var i, s, a,
|
|
353
|
+
var i, s, a, n, o, r;
|
|
354
354
|
(i = this.leadHeadGroup) == null || i.removeAll(), (s = this.sceneIns) == null || s.remove(this.leadHeadGroup);
|
|
355
355
|
let e = "", t = !1;
|
|
356
356
|
e:
|
|
@@ -370,10 +370,10 @@ let w = class extends Z {
|
|
|
370
370
|
else if (l > this.leadModel.line && l - this.leadModel.line <= this.leadModel.add) {
|
|
371
371
|
if (!this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]])
|
|
372
372
|
continue;
|
|
373
|
-
e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l - this.leadModel.line - 1]]], this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), this.leadHeadConfig.isShowLeadCalibration !== !1 && ((
|
|
373
|
+
e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l - this.leadModel.line - 1]]], this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), this.leadHeadConfig.isShowLeadCalibration !== !1 && ((o = this.leadHeadGroup) == null || o.add(
|
|
374
374
|
this.createLeadHead(
|
|
375
375
|
0,
|
|
376
|
-
((
|
|
376
|
+
((n = this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]]) == null ? void 0 : n.posY) || l * this.splitBlockHeight,
|
|
377
377
|
N(this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].isFixedSquareWaveSize ? this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].fixedSquareWaveSizeGain : this.waveConfigs[this.longLeadConfig.leadIdxs[l - this.leadModel.line - 1]].gain, this.gridConfig.cellMg),
|
|
378
378
|
t
|
|
379
379
|
)
|
|
@@ -422,8 +422,8 @@ let w = class extends Z {
|
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
drawColSplitLine() {
|
|
425
|
-
var
|
|
426
|
-
(
|
|
425
|
+
var n, o, r, l, d;
|
|
426
|
+
(n = this.splitLineGroup) == null || n.removeAll(), (o = this.sceneIns) == null || o.remove(this.splitLineGroup);
|
|
427
427
|
const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
|
|
428
428
|
if (this.splitPoint = e, this.leadModel.isSingleMode) {
|
|
429
429
|
const h = b(
|
|
@@ -503,20 +503,20 @@ let w = class extends Z {
|
|
|
503
503
|
(s = this.sceneIns) == null || s.add(i), (a = this.sceneIns) == null || a.add(t);
|
|
504
504
|
}
|
|
505
505
|
drawRuler(e = 0) {
|
|
506
|
-
var
|
|
506
|
+
var o, r, l;
|
|
507
507
|
if (this.timersCopy = e, !this.rulerConfig.isShow)
|
|
508
508
|
return;
|
|
509
509
|
const t = this.dataTotalTimes * 2;
|
|
510
510
|
let i = this.leadHeadConfig.leadHedeWidth, s = 0, a = t;
|
|
511
|
-
const
|
|
511
|
+
const n = b(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
|
|
512
512
|
if (this.leadModel.isContinuous)
|
|
513
513
|
a = t * 1.1;
|
|
514
|
-
else if (!this.leadModel.add &&
|
|
515
|
-
const d = G(this.splitPoint * (this.leadModel.column || 1),
|
|
514
|
+
else if (!this.leadModel.add && n) {
|
|
515
|
+
const d = G(this.splitPoint * (this.leadModel.column || 1), n), h = V(d, this.rulerConfig.sampleRate || 0) / 1e3;
|
|
516
516
|
a = e + h;
|
|
517
517
|
}
|
|
518
518
|
for (let d = e; d <= a; d = +(d + 0.1).toFixed(1))
|
|
519
|
-
d !== e && (i += this.rulerStep), d % 1 === 0 ? (s = this.canvasContainer.height - 10, (
|
|
519
|
+
d !== e && (i += this.rulerStep), d % 1 === 0 ? (s = this.canvasContainer.height - 10, (o = this.rulerGroup) == null || o.add(new F({
|
|
520
520
|
cursor: "",
|
|
521
521
|
style: {
|
|
522
522
|
x: i,
|
|
@@ -549,11 +549,11 @@ let w = class extends Z {
|
|
|
549
549
|
let e = 0, t = 0;
|
|
550
550
|
const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
|
|
551
551
|
let s = this.slidingWindowInfo.startInd || 0, a = this.slidingWindowInfo.endInd || 0;
|
|
552
|
-
const
|
|
552
|
+
const n = b(
|
|
553
553
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
554
554
|
this.gridConfig.cellMg,
|
|
555
555
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
556
|
-
),
|
|
556
|
+
), o = N(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), r = [], l = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
|
|
557
557
|
for (let d = 0; d < 1; d++) {
|
|
558
558
|
e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
|
|
559
559
|
for (let h = 1; h <= l; h++)
|
|
@@ -561,29 +561,29 @@ let w = class extends Z {
|
|
|
561
561
|
pos: [e, t],
|
|
562
562
|
startInd: s,
|
|
563
563
|
endInd: a,
|
|
564
|
-
step:
|
|
565
|
-
sens:
|
|
566
|
-
data: i.slice(s, a).map((f, I) => this.waveConfigs[this.singleModeConfig.defaultSelect].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? O(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, f,
|
|
564
|
+
step: n,
|
|
565
|
+
sens: o,
|
|
566
|
+
data: i.slice(s, a).map((f, I) => this.waveConfigs[this.singleModeConfig.defaultSelect].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? O(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, f, o / 2) : O(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, f, o)).map((f, I) => [I * (n || 0), -f])
|
|
567
567
|
});
|
|
568
568
|
}
|
|
569
569
|
return r;
|
|
570
570
|
}
|
|
571
571
|
createSingleWaveFrom() {
|
|
572
|
-
var
|
|
573
|
-
(
|
|
572
|
+
var o, r, l;
|
|
573
|
+
(o = this.singleWaveFromGroup) == null || o.removeAll();
|
|
574
574
|
let e = this.getRednerSinglePoints(), t = V(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0);
|
|
575
575
|
const i = t;
|
|
576
|
-
let s = 0, a = 0,
|
|
576
|
+
let s = 0, a = 0, n = 0;
|
|
577
577
|
for (let d = 0; d < e.length && !(e[d].pos[1] > this.drawArea.height + this.bottomAreaHeight); d++)
|
|
578
578
|
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (s = parseInt(`${t / 1e3 / 60}`, 10), a = parseInt(`${t / 1e3 % 60}`, 10), s = a === 60 ? s += 1 : s, s = s === 0 ? "00" : s < 10 ? `0${s}` : s, a = a === 0 || a === 60 ? "00" : a < 10 ? `0${a}` : a, (r = this.singleWaveFromGroup) == null || r.add(new z({
|
|
579
579
|
cursor: "",
|
|
580
580
|
name: this.singleModeConfig.defaultSelect + "_" + d,
|
|
581
581
|
sens: e[d].sens,
|
|
582
582
|
shape: {
|
|
583
|
-
points: e[d].data.map(([h, f], I) => isNaN(f) ? (
|
|
584
|
-
e[d].data[
|
|
585
|
-
e[d].data[
|
|
586
|
-
]) : (
|
|
583
|
+
points: e[d].data.map(([h, f], I) => isNaN(f) ? (n === 0 && (n = I - 1, n = n < 0 ? 0 : n), [
|
|
584
|
+
e[d].data[n][0] + e[d].pos[0],
|
|
585
|
+
e[d].data[n][1] + e[d].pos[1]
|
|
586
|
+
]) : (n = 0, [
|
|
587
587
|
h + e[d].pos[0],
|
|
588
588
|
f + e[d].pos[1]
|
|
589
589
|
]))
|
|
@@ -617,7 +617,7 @@ let w = class extends Z {
|
|
|
617
617
|
this.singleWaveDataCopy = e, e = null;
|
|
618
618
|
}
|
|
619
619
|
drawHeartReact(e = 0) {
|
|
620
|
-
var a,
|
|
620
|
+
var a, n, o, r, l, d, h, f, I, y;
|
|
621
621
|
if ((a = this.arrowHeartGroup) == null || a.removeAll(), !this.heartFight.isShow)
|
|
622
622
|
return;
|
|
623
623
|
if (this.leadModel.line !== 12 && this.leadModel.column !== 1) {
|
|
@@ -635,7 +635,7 @@ let w = class extends Z {
|
|
|
635
635
|
this.waveConfigs[this.heartFight.showIdxPai].sampleRate
|
|
636
636
|
);
|
|
637
637
|
let i = 0;
|
|
638
|
-
const s = (((
|
|
638
|
+
const s = (((o = (n = this.nearestHeartInfo.analyseValue) == null ? void 0 : n.KeyPosByBeat) == null ? void 0 : o.Rpoint) || 0) - e;
|
|
639
639
|
if (!(e > (((l = (r = this.nearestHeartInfo.analyseValue) == null ? void 0 : r.KeyPosByBeat) == null ? void 0 : l.Rpoint) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && s > (this.slidingWindowInfo.points || 0)) && !(this.leadModel.isSingleMode && s > (this.slidingWindowInfo.points || 0)) && !((((h = (d = this.nearestHeartInfo.analyseValue) == null ? void 0 : d.KeyPosByBeat) == null ? void 0 : h.Rpoint) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))) {
|
|
640
640
|
if (this.nearestHeartInfo.insertInfo)
|
|
641
641
|
i = (s || 0) * t + this.leadHeadConfig.leadHedeWidth, (I = this.arrowHeartGroup) == null || I.add(new X({
|
|
@@ -686,12 +686,12 @@ let w = class extends Z {
|
|
|
686
686
|
} else
|
|
687
687
|
this.leadModel.column === 1 ? i = 0 : i = 20;
|
|
688
688
|
let s = 0, a = 0;
|
|
689
|
-
const
|
|
689
|
+
const n = {
|
|
690
690
|
fontSize: 12,
|
|
691
691
|
fill: "#FF0000",
|
|
692
692
|
fontFamily: this.fontFamily
|
|
693
693
|
};
|
|
694
|
-
let
|
|
694
|
+
let o = 0, r = 0;
|
|
695
695
|
const l = b(
|
|
696
696
|
this.waveConfigs[this.heartFight.showIdxPai].speed,
|
|
697
697
|
this.gridConfig.cellMg,
|
|
@@ -711,90 +711,90 @@ let w = class extends Z {
|
|
|
711
711
|
x: t,
|
|
712
712
|
y: i + 10,
|
|
713
713
|
text: `${(p == null ? void 0 : p.heart_style) || ""}`
|
|
714
|
-
},
|
|
714
|
+
}, n), {
|
|
715
715
|
fill: "#333"
|
|
716
716
|
}),
|
|
717
|
-
onclick: (
|
|
718
|
-
!this.heartFight.mode &&
|
|
717
|
+
onclick: (w) => {
|
|
718
|
+
!this.heartFight.mode && this.heartFight.isClickArrow;
|
|
719
719
|
},
|
|
720
|
-
oncontextmenu: (
|
|
721
|
-
|
|
720
|
+
oncontextmenu: (w) => {
|
|
721
|
+
w.event.preventDefault(), !this.heartFight.mode && this.heartFight.isClickArrow;
|
|
722
722
|
}
|
|
723
723
|
}));
|
|
724
724
|
let B = t, k = 0;
|
|
725
725
|
if (this.heartFight.isHeartRateCalculatedBasedOnInterval)
|
|
726
726
|
if (A > 0) {
|
|
727
|
-
const
|
|
728
|
-
if (
|
|
729
|
-
const R = (
|
|
727
|
+
const w = this.heartBeatPosition[this.heartFight.showIdxPai][A - 1];
|
|
728
|
+
if (w) {
|
|
729
|
+
const R = (w.position || 0) - e;
|
|
730
730
|
if (!this.leadModel.isContinuous && !this.leadModel.add && R > (this.slidingWindowInfo.points || 0))
|
|
731
731
|
continue;
|
|
732
732
|
B = R * (l || 0) + this.leadHeadConfig.leadHedeWidth, k = t, r = ae(
|
|
733
|
-
Math.abs(((p == null ? void 0 : p.position) || 0) - (
|
|
733
|
+
Math.abs(((p == null ? void 0 : p.position) || 0) - (w.position || 0)) * (l || 0),
|
|
734
734
|
this.waveConfigs[this.heartFight.showIdxPai].speed,
|
|
735
735
|
this.gridConfig.cellMg,
|
|
736
736
|
1
|
|
737
|
-
),
|
|
737
|
+
), o = r !== 0 && ne(r) || 0;
|
|
738
738
|
}
|
|
739
739
|
} else
|
|
740
740
|
continue;
|
|
741
741
|
else {
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
742
|
+
const w = this.heartBeatPosition[this.heartFight.showIdxPai][A + 1] || null;
|
|
743
|
+
if (!w || (h = ((w == null ? void 0 : w.position) || 0) - e, !this.leadModel.isContinuous && !this.leadModel.add && h > (this.slidingWindowInfo.points || 0)) || this.leadModel.isSingleMode && h > (this.slidingWindowInfo.points || 0))
|
|
744
744
|
continue;
|
|
745
|
-
if (((
|
|
745
|
+
if (((w == null ? void 0 : w.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
|
|
746
746
|
break;
|
|
747
|
-
B = t, k = h * (l || 0) + this.leadHeadConfig.leadHedeWidth,
|
|
747
|
+
B = t, k = h * (l || 0) + this.leadHeadConfig.leadHedeWidth, o = (p == null ? void 0 : p.heartrate) || 0;
|
|
748
748
|
}
|
|
749
749
|
if (a = 0, this.heartFight.heartrate) {
|
|
750
|
-
s = ((W = this.AssistCtx) == null ? void 0 : W.measureText(`${
|
|
751
|
-
const
|
|
750
|
+
s = ((W = this.AssistCtx) == null ? void 0 : W.measureText(`${o || ""}`).width) || 0;
|
|
751
|
+
const w = (k - B) / 2 - s / 2 + B;
|
|
752
752
|
(x = this.arrowGroup) == null || x.add(new F({
|
|
753
753
|
cursor: "",
|
|
754
754
|
style: D({
|
|
755
|
-
x:
|
|
755
|
+
x: w,
|
|
756
756
|
y: a + i + 5,
|
|
757
|
-
text: `${
|
|
758
|
-
},
|
|
757
|
+
text: `${o || ""}`
|
|
758
|
+
}, n)
|
|
759
759
|
})), a += 12;
|
|
760
760
|
}
|
|
761
761
|
if (this.heartFight.interval) {
|
|
762
|
-
|
|
763
|
-
s = ((L = this.AssistCtx) == null ? void 0 : L.measureText(
|
|
762
|
+
let w = `${(p == null ? void 0 : p.interval) || ""}`;
|
|
763
|
+
this.heartFight.isHeartRateCalculatedBasedOnInterval && (w = `${Math.round(6e4 / o)}`), s = ((L = this.AssistCtx) == null ? void 0 : L.measureText(w).width) || 0;
|
|
764
764
|
const R = (k - B) / 2 - s / 2 + B;
|
|
765
765
|
(H = this.arrowGroup) == null || H.add(new F({
|
|
766
766
|
cursor: "",
|
|
767
767
|
style: D({
|
|
768
768
|
x: R,
|
|
769
769
|
y: a + i + 5,
|
|
770
|
-
text:
|
|
771
|
-
},
|
|
770
|
+
text: w
|
|
771
|
+
}, n)
|
|
772
772
|
})), a += 12;
|
|
773
773
|
}
|
|
774
774
|
if (this.heartFight.qrstCompany) {
|
|
775
|
-
const
|
|
776
|
-
s = ((M = this.AssistCtx) == null ? void 0 : M.measureText(
|
|
775
|
+
const w = (p == null ? void 0 : p.qrstCompany) || "";
|
|
776
|
+
s = ((M = this.AssistCtx) == null ? void 0 : M.measureText(w).width) || 0;
|
|
777
777
|
const R = (k - B) / 2 - s / 2 + B;
|
|
778
778
|
(m = this.arrowGroup) == null || m.add(new F({
|
|
779
779
|
cursor: "",
|
|
780
780
|
style: D({
|
|
781
781
|
x: R,
|
|
782
782
|
y: a + i + 5,
|
|
783
|
-
text:
|
|
784
|
-
},
|
|
783
|
+
text: w
|
|
784
|
+
}, n)
|
|
785
785
|
})), a += 12;
|
|
786
786
|
}
|
|
787
787
|
if (this.heartFight.telectricalaxis) {
|
|
788
|
-
const
|
|
789
|
-
s = ((u = this.AssistCtx) == null ? void 0 : u.measureText(
|
|
788
|
+
const w = `${(p == null ? void 0 : p.telectricalaxis) || ""}`;
|
|
789
|
+
s = ((u = this.AssistCtx) == null ? void 0 : u.measureText(w).width) || 0;
|
|
790
790
|
const R = (k - B) / 2 - s / 2 + B;
|
|
791
791
|
(g = this.arrowGroup) == null || g.add(new F({
|
|
792
792
|
cursor: "",
|
|
793
793
|
style: D({
|
|
794
794
|
x: R,
|
|
795
795
|
y: a + i + 5,
|
|
796
|
-
text:
|
|
797
|
-
},
|
|
796
|
+
text: w
|
|
797
|
+
}, n)
|
|
798
798
|
}));
|
|
799
799
|
}
|
|
800
800
|
}
|
|
@@ -804,10 +804,10 @@ let w = class extends Z {
|
|
|
804
804
|
this.$emit("notifyHeardBeat", de.clone(e)), this.currentHeardBeat.heardBeat = e, this.currentHeardBeat.ele = t, this.drawHeardBeatLine();
|
|
805
805
|
}
|
|
806
806
|
drawHeardBeatLine(e = 0) {
|
|
807
|
-
var a,
|
|
807
|
+
var a, n, o, r, l, d, h, f, I, y, W, x, L, H, M;
|
|
808
808
|
if (!this.currentHeardBeat.heardBeat)
|
|
809
809
|
return;
|
|
810
|
-
(a = this.heardBeatLineGroup) == null || a.removeAll(), (
|
|
810
|
+
(a = this.heardBeatLineGroup) == null || a.removeAll(), (n = this.sceneIns) == null || n.remove(this.heardBeatLineGroup);
|
|
811
811
|
let t = {}, i = 0, s;
|
|
812
812
|
if (this.leadModel.isSingleMode) {
|
|
813
813
|
let m = this.getRednerSinglePoints();
|
|
@@ -815,7 +815,7 @@ let w = class extends Z {
|
|
|
815
815
|
for (let u = 0; u < m.length; u++) {
|
|
816
816
|
if (u >= 1 || this.leadNames[this.singleModeConfig.defaultSelect] === "M")
|
|
817
817
|
break e;
|
|
818
|
-
if ((
|
|
818
|
+
if ((o = this.analyseValues[this.singleModeConfig.defaultSelect]) != null && o[this.currentHeardBeat.heardBeat.index])
|
|
819
819
|
t = ((d = (l = this.analyseValues[this.singleModeConfig.defaultSelect]) == null ? void 0 : l[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : d.KeyPosByBeat) || t;
|
|
820
820
|
else {
|
|
821
821
|
let g = this.analyseValues.find((S) => {
|
|
@@ -892,15 +892,15 @@ let w = class extends Z {
|
|
|
892
892
|
}
|
|
893
893
|
getAddRednerPoints() {
|
|
894
894
|
const e = [];
|
|
895
|
-
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, a = [],
|
|
895
|
+
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, a = [], n = 0, o = 0;
|
|
896
896
|
for (let r = 0; r < this.leadModel.add; r++)
|
|
897
|
-
s = this.longLeadConfig.leadIdxs[r], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t,
|
|
897
|
+
s = this.longLeadConfig.leadIdxs[r], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, n = b(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), o = N(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (r + this.leadModel.line + 1) * this.splitBlockHeight, a = this.waveLists[s] || [], r === 0 && (this.loopArrowY.add = i), e.push({
|
|
898
898
|
pos: [t, i],
|
|
899
899
|
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
900
900
|
endInd: this.addSlidingWindowInfo.endInd || 0,
|
|
901
|
-
data: a.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((l, d) => this.waveConfigs[s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? O(this.waveConfigs[s].sensitivity, l,
|
|
902
|
-
sens:
|
|
903
|
-
step:
|
|
901
|
+
data: a.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((l, d) => this.waveConfigs[s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? O(this.waveConfigs[s].sensitivity, l, o / 2) : O(this.waveConfigs[s].sensitivity, l, o)).map((l, d) => [d * (n || 0), -l]),
|
|
902
|
+
sens: o,
|
|
903
|
+
step: n
|
|
904
904
|
}));
|
|
905
905
|
return e;
|
|
906
906
|
}
|
|
@@ -914,40 +914,40 @@ let w = class extends Z {
|
|
|
914
914
|
name: this.longLeadConfig.leadIdxs[a] + "_" + a,
|
|
915
915
|
sens: e[a].sens,
|
|
916
916
|
shape: {
|
|
917
|
-
points: e[a].data.map(([
|
|
917
|
+
points: e[a].data.map(([n, o], r) => isNaN(o) ? (t === 0 && (t = r - 1, t = t < 0 ? 0 : t), [
|
|
918
918
|
e[a].data[t][0] + e[a].pos[0],
|
|
919
919
|
e[a].data[t][1] + e[a].pos[1]
|
|
920
920
|
]) : (t = 0, [
|
|
921
|
-
|
|
922
|
-
|
|
921
|
+
n + e[a].pos[0],
|
|
922
|
+
o + e[a].pos[1]
|
|
923
923
|
]))
|
|
924
924
|
},
|
|
925
925
|
style: {
|
|
926
926
|
stroke: this.leadConfig.lineColor,
|
|
927
927
|
lineWidth: this.leadConfig.lineWidth
|
|
928
928
|
},
|
|
929
|
-
onclick: (
|
|
930
|
-
this.onDbClickWaveFrom(
|
|
929
|
+
onclick: (n) => {
|
|
930
|
+
this.onDbClickWaveFrom(n, "add");
|
|
931
931
|
},
|
|
932
|
-
oncontextmenu: (
|
|
933
|
-
this.onContextmenu(
|
|
932
|
+
oncontextmenu: (n) => {
|
|
933
|
+
this.onContextmenu(n, "add");
|
|
934
934
|
}
|
|
935
935
|
})), this.createLeadName(this.longLeadConfig.leadNames[a], e[a].pos[0], e[a].pos[1] - 15, !0), this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[a], e[a].pos[0] - 5, e[a].pos[1] - (e[a].sens || 0) / 2 - 15), this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens && this.createLeadSensNams(this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens, e[a].pos[0], e[a].pos[1] - 15));
|
|
936
936
|
this.addWaveDataCopy = e, e = null;
|
|
937
937
|
}
|
|
938
938
|
getRednerPoints() {
|
|
939
|
-
let e = 0, t = 0, i = 0, s = [], a = 0,
|
|
939
|
+
let e = 0, t = 0, i = 0, s = [], a = 0, n = 0, o = this.slidingWindowInfo.startInd || 0, r = this.slidingWindowInfo.endInd || 0;
|
|
940
940
|
const l = [];
|
|
941
941
|
for (let d = 0; d < this.leadModel.column; d++) {
|
|
942
|
-
e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && d > 0 && (
|
|
942
|
+
e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && d > 0 && (o = r, r = o + (this.slidingWindowInfo.points || 0));
|
|
943
943
|
for (let h = 1; h <= this.leadModel.line && (t = h * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); h++)
|
|
944
|
-
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = b(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate),
|
|
944
|
+
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, a = b(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), n = N(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (h === 1 && (this.loopArrowY.rowAndCol = t), l.push({
|
|
945
945
|
pos: [e, t],
|
|
946
|
-
startInd:
|
|
946
|
+
startInd: o,
|
|
947
947
|
endInd: r,
|
|
948
|
-
sens:
|
|
948
|
+
sens: n,
|
|
949
949
|
step: a,
|
|
950
|
-
data: s.slice(
|
|
950
|
+
data: s.slice(o, r).map((f, I) => this.waveConfigs[i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? O(this.waveConfigs[i].sensitivity, f, n / 2) : O(this.waveConfigs[i].sensitivity, f, n)).map((f, I) => [I * (a || 0), -f])
|
|
951
951
|
}), i++);
|
|
952
952
|
}
|
|
953
953
|
return l;
|
|
@@ -956,31 +956,31 @@ let w = class extends Z {
|
|
|
956
956
|
var s, a;
|
|
957
957
|
(s = this.rowAndColwaveFromGroup) == null || s.removeAll();
|
|
958
958
|
let e = this.getRednerPoints(), t = 0, i = 0;
|
|
959
|
-
for (let
|
|
960
|
-
t = this.waveConfigs[
|
|
959
|
+
for (let n = 0; n < e.length; n++)
|
|
960
|
+
t = this.waveConfigs[n].leadIdx || 0, this.isLeadDel(t) || (a = this.rowAndColwaveFromGroup) == null || a.add(new z({
|
|
961
961
|
cursor: "",
|
|
962
|
-
name:
|
|
963
|
-
sens: e[
|
|
962
|
+
name: n + "_" + n,
|
|
963
|
+
sens: e[n].sens,
|
|
964
964
|
shape: {
|
|
965
|
-
points: e[
|
|
966
|
-
e[
|
|
967
|
-
e[
|
|
965
|
+
points: e[n].data.map(([o, r], l) => isNaN(r) ? (i === 0 && (i = l - 1, i = i < 0 ? 0 : i), [
|
|
966
|
+
e[n].data[i][0] + e[n].pos[0],
|
|
967
|
+
e[n].data[i][1] + e[n].pos[1]
|
|
968
968
|
]) : (i = 0, [
|
|
969
|
-
|
|
970
|
-
r + e[
|
|
969
|
+
o + e[n].pos[0],
|
|
970
|
+
r + e[n].pos[1]
|
|
971
971
|
]))
|
|
972
972
|
},
|
|
973
973
|
style: {
|
|
974
974
|
stroke: this.leadConfig.lineColor,
|
|
975
975
|
lineWidth: this.leadConfig.lineWidth
|
|
976
976
|
},
|
|
977
|
-
onclick: (
|
|
978
|
-
this.onDbClickWaveFrom(
|
|
977
|
+
onclick: (o) => {
|
|
978
|
+
this.onDbClickWaveFrom(o, "rowAndCol");
|
|
979
979
|
},
|
|
980
|
-
oncontextmenu: (
|
|
981
|
-
this.onContextmenu(
|
|
980
|
+
oncontextmenu: (o) => {
|
|
981
|
+
this.onContextmenu(o, "rowAndCol");
|
|
982
982
|
}
|
|
983
|
-
})),
|
|
983
|
+
})), n < this.leadModel.line ? (console.log("this.leadNames[LeadNameTextIdx]1111", this.leadNames[t], e[n].pos[1], e[n].sens), this.createLeadName(t, e[n].pos[0], e[n].pos[1] - 15), this.createLeadOffAndDel(t, e[n].pos[0] - 5, e[n].pos[1] - (e[n].sens || 0) / 2 - 15), this.waveConfigs[n].squareWaveSens && this.createLeadSensNams(this.waveConfigs[n].squareWaveSens, e[n].pos[0], e[n].pos[1] - 15)) : (console.log("this.leadNames[LeadNameTextIdx]2222", this.leadNames[t], e[n].pos[1], e[n].sens), this.createLeadName(t, e[n].pos[0] + 5, e[n].pos[1] - 40), this.createLeadOffAndDel(t, e[n].pos[0] - 5, e[n].pos[1] - (e[n].sens || 0) / 2 + 9), this.waveConfigs[n].squareWaveSens && this.createLeadSensNams(this.waveConfigs[n].squareWaveSens, e[n].pos[0], e[n].pos[1] - 15));
|
|
984
984
|
this.waveDataCopy = e, e = null;
|
|
985
985
|
}
|
|
986
986
|
createLeadSensNams(e, t, i) {
|
|
@@ -998,9 +998,9 @@ let w = class extends Z {
|
|
|
998
998
|
}));
|
|
999
999
|
}
|
|
1000
1000
|
createLeadName(e, t, i, s = !1) {
|
|
1001
|
-
var
|
|
1001
|
+
var n;
|
|
1002
1002
|
let a = t;
|
|
1003
|
-
this.leadHeadConfig.isShowLeadCalibration === !1 && (this.leadModel.isSingleMode ? a = t - this.leadHeadConfig.leadHedeWidth + 12 : a = t - this.leadHeadConfig.leadHedeWidth + 5), this.leadHeadConfig.isShowLeadCalibration && this.leadHeadConfig.isCalibrationDisplayedBelow && (t <= this.leadHeadConfig.leadHedeWidth && (this.leadModel.isSingleMode ? a = t - this.leadHeadConfig.leadHedeWidth + 12 : a = t - this.leadHeadConfig.leadHedeWidth + 5), console.log("this.leadNames[LeadNameTextIdx]", this.leadNames[e], i), i = i + 20, console.log("this.leadNames[LeadNameTextIdx]", this.leadNames[e], i)), (
|
|
1003
|
+
this.leadHeadConfig.isShowLeadCalibration === !1 && (this.leadModel.isSingleMode ? a = t - this.leadHeadConfig.leadHedeWidth + 12 : a = t - this.leadHeadConfig.leadHedeWidth + 5), this.leadHeadConfig.isShowLeadCalibration && this.leadHeadConfig.isCalibrationDisplayedBelow && (t <= this.leadHeadConfig.leadHedeWidth && (this.leadModel.isSingleMode ? a = t - this.leadHeadConfig.leadHedeWidth + 12 : a = t - this.leadHeadConfig.leadHedeWidth + 5), console.log("this.leadNames[LeadNameTextIdx]", this.leadNames[e], i), i = i + 20, console.log("this.leadNames[LeadNameTextIdx]", this.leadNames[e], i)), (n = this.leadHeadNameGroup) == null || n.add(new F({
|
|
1004
1004
|
style: {
|
|
1005
1005
|
x: a,
|
|
1006
1006
|
y: i,
|
|
@@ -1009,18 +1009,18 @@ let w = class extends Z {
|
|
|
1009
1009
|
fill: this.leadConfig.lineColor,
|
|
1010
1010
|
fontFamily: this.leadConfig.fontFamily
|
|
1011
1011
|
},
|
|
1012
|
-
oncontextmenu: (
|
|
1013
|
-
|
|
1014
|
-
event: T(D({},
|
|
1012
|
+
oncontextmenu: (o) => {
|
|
1013
|
+
o.event.preventDefault(), this.$emit("notiifyLeadName", {
|
|
1014
|
+
event: T(D({}, o), {
|
|
1015
1015
|
name: this.leadNames[e],
|
|
1016
1016
|
idx: e
|
|
1017
1017
|
}),
|
|
1018
1018
|
isAdd: s
|
|
1019
1019
|
});
|
|
1020
1020
|
},
|
|
1021
|
-
onclick: (
|
|
1021
|
+
onclick: (o) => {
|
|
1022
1022
|
this.$emit("notiifyLeadName", {
|
|
1023
|
-
event: T(D({},
|
|
1023
|
+
event: T(D({}, o), {
|
|
1024
1024
|
name: this.leadNames[e],
|
|
1025
1025
|
idx: e
|
|
1026
1026
|
}),
|
|
@@ -1047,12 +1047,12 @@ let w = class extends Z {
|
|
|
1047
1047
|
onContextmenu(e, t) {
|
|
1048
1048
|
e.event.preventDefault(), e.event.stopPropagation(), console.log("onContextmenu", e);
|
|
1049
1049
|
const i = e.target.name.split("_"), s = +i[1];
|
|
1050
|
-
let a = 0,
|
|
1051
|
-
t === "single" ? (a = e.offsetX - this.singleWaveDataCopy[s].pos[0],
|
|
1050
|
+
let a = 0, n = 0, o = 0, r = 0, l = 0;
|
|
1051
|
+
t === "single" ? (a = e.offsetX - this.singleWaveDataCopy[s].pos[0], n = this.singleWaveDataCopy[s].startInd, o = G(a, this.singleWaveDataCopy[s].step || 1), r = this.singleWaveDataCopy[s].sens, l = this.singleWaveDataCopy[s].step) : t === "rowAndCol" ? (a = e.offsetX - this.waveDataCopy[s].pos[0], n = this.waveDataCopy[s].startInd || 0, o = G(a, this.waveDataCopy[s].step || 1), r = this.waveDataCopy[s].sens, l = this.waveDataCopy[s].step) : t === "add" && (a = e.offsetX - this.addWaveDataCopy[s].pos[0], n = this.addWaveDataCopy[s].startInd || 0, o = G(a, this.addWaveDataCopy[s].step || 1), r = this.addWaveDataCopy[s].sens, l = this.addWaveDataCopy[s].step), o += n, this.$emit("notifyOnContextmenu", {
|
|
1052
1052
|
sens: r,
|
|
1053
1053
|
step: l,
|
|
1054
1054
|
activeLeadIdx: +i[0],
|
|
1055
|
-
pointIdx:
|
|
1055
|
+
pointIdx: o,
|
|
1056
1056
|
offsetX: e.offsetX,
|
|
1057
1057
|
offsetY: e.offsetY,
|
|
1058
1058
|
pageX: e.event.pageX,
|
|
@@ -1064,9 +1064,9 @@ let w = class extends Z {
|
|
|
1064
1064
|
const i = Date.now(), s = () => {
|
|
1065
1065
|
const a = e.target.name.split("_");
|
|
1066
1066
|
this.activeLeadIdx = +a[0];
|
|
1067
|
-
const
|
|
1068
|
-
let
|
|
1069
|
-
t === "single" ? (
|
|
1067
|
+
const n = +a[1];
|
|
1068
|
+
let o = 0, r = 0, l = 0, d = 0, h = 0;
|
|
1069
|
+
t === "single" ? (o = e.offsetX - this.singleWaveDataCopy[n].pos[0], r = this.singleWaveDataCopy[n].startInd, l = G(o, this.singleWaveDataCopy[n].step || 1), d = this.singleWaveDataCopy[n].sens, h = this.singleWaveDataCopy[n].step) : t === "rowAndCol" ? (o = e.offsetX - this.waveDataCopy[n].pos[0], r = this.waveDataCopy[n].startInd || 0, l = G(o, this.waveDataCopy[n].step || 1), d = this.waveDataCopy[n].sens, h = this.waveDataCopy[n].step) : t === "add" && (o = e.offsetX - this.addWaveDataCopy[n].pos[0], r = this.addWaveDataCopy[n].startInd || 0, l = G(o, this.addWaveDataCopy[n].step || 1), d = this.addWaveDataCopy[n].sens, h = this.addWaveDataCopy[n].step), l += r, this.$emit("notifyActiveEnlargr", {
|
|
1070
1070
|
sens: d,
|
|
1071
1071
|
step: h,
|
|
1072
1072
|
activeLeadIdx: this.activeLeadIdx,
|
|
@@ -1092,21 +1092,21 @@ let w = class extends Z {
|
|
|
1092
1092
|
var s, a;
|
|
1093
1093
|
this.slidingWindowInfo.startInd = e, this.slidingWindowInfo.endInd = e + (this.slidingWindowInfo.points || 0), this.addSlidingWindowInfo.startInd = e, this.addSlidingWindowInfo.endInd = e + (this.addSlidingWindowInfo.points || 0);
|
|
1094
1094
|
let t = this.getRednerPoints(), i = this.getAddRednerPoints();
|
|
1095
|
-
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((
|
|
1096
|
-
|
|
1095
|
+
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((n, o) => {
|
|
1096
|
+
o = o || 0, !(!t[o] || !t[o].data) && n.attr({
|
|
1097
1097
|
shape: {
|
|
1098
|
-
points: t[
|
|
1099
|
-
r + t[
|
|
1100
|
-
l + t[
|
|
1098
|
+
points: t[o].data.map(([r, l]) => [
|
|
1099
|
+
r + t[o].pos[0],
|
|
1100
|
+
l + t[o].pos[1]
|
|
1101
1101
|
])
|
|
1102
1102
|
}
|
|
1103
1103
|
});
|
|
1104
|
-
}), (a = this.addwaveFromGroup) == null || a.eachChild((
|
|
1105
|
-
|
|
1104
|
+
}), (a = this.addwaveFromGroup) == null || a.eachChild((n, o) => {
|
|
1105
|
+
o = o || 0, !(!i[o] || !i[o].data) && n.attr({
|
|
1106
1106
|
shape: {
|
|
1107
|
-
points: i[
|
|
1108
|
-
r + i[
|
|
1109
|
-
l + i[
|
|
1107
|
+
points: i[o].data.map(([r, l]) => [
|
|
1108
|
+
r + i[o].pos[0],
|
|
1109
|
+
l + i[o].pos[1]
|
|
1110
1110
|
])
|
|
1111
1111
|
}
|
|
1112
1112
|
});
|
|
@@ -1127,41 +1127,41 @@ C([
|
|
|
1127
1127
|
v({
|
|
1128
1128
|
default: () => ["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"]
|
|
1129
1129
|
})
|
|
1130
|
-
],
|
|
1130
|
+
], c.prototype, "heardBeatLineKeys", 2);
|
|
1131
1131
|
C([
|
|
1132
1132
|
v({
|
|
1133
1133
|
required: !0,
|
|
1134
1134
|
type: Number,
|
|
1135
1135
|
validator: (e) => typeof e == "number"
|
|
1136
1136
|
})
|
|
1137
|
-
],
|
|
1137
|
+
], c.prototype, "width", 2);
|
|
1138
1138
|
C([
|
|
1139
1139
|
v({
|
|
1140
1140
|
required: !0,
|
|
1141
1141
|
type: Number,
|
|
1142
1142
|
validator: (e) => typeof e == "number"
|
|
1143
1143
|
})
|
|
1144
|
-
],
|
|
1144
|
+
], c.prototype, "height", 2);
|
|
1145
1145
|
C([
|
|
1146
1146
|
v({
|
|
1147
1147
|
default: () => []
|
|
1148
1148
|
})
|
|
1149
|
-
],
|
|
1149
|
+
], c.prototype, "waveConfigs", 2);
|
|
1150
1150
|
C([
|
|
1151
1151
|
v({
|
|
1152
1152
|
default: () => []
|
|
1153
1153
|
})
|
|
1154
|
-
],
|
|
1154
|
+
], c.prototype, "waveLists", 2);
|
|
1155
1155
|
C([
|
|
1156
1156
|
v({
|
|
1157
1157
|
default: () => []
|
|
1158
1158
|
})
|
|
1159
|
-
],
|
|
1159
|
+
], c.prototype, "leadNames", 2);
|
|
1160
1160
|
C([
|
|
1161
1161
|
v({
|
|
1162
1162
|
default: () => []
|
|
1163
1163
|
})
|
|
1164
|
-
],
|
|
1164
|
+
], c.prototype, "analyseValues", 2);
|
|
1165
1165
|
C([
|
|
1166
1166
|
v({
|
|
1167
1167
|
default: () => ({
|
|
@@ -1170,12 +1170,12 @@ C([
|
|
|
1170
1170
|
leadHedeLineWidth: 2
|
|
1171
1171
|
})
|
|
1172
1172
|
})
|
|
1173
|
-
],
|
|
1173
|
+
], c.prototype, "leadHeadConfig", 2);
|
|
1174
1174
|
C([
|
|
1175
1175
|
v({
|
|
1176
1176
|
required: !0
|
|
1177
1177
|
})
|
|
1178
|
-
],
|
|
1178
|
+
], c.prototype, "leadModel", 2);
|
|
1179
1179
|
C([
|
|
1180
1180
|
v({
|
|
1181
1181
|
default: () => ({
|
|
@@ -1184,7 +1184,7 @@ C([
|
|
|
1184
1184
|
speedName: ""
|
|
1185
1185
|
})
|
|
1186
1186
|
})
|
|
1187
|
-
],
|
|
1187
|
+
], c.prototype, "rulerConfig", 2);
|
|
1188
1188
|
C([
|
|
1189
1189
|
v({
|
|
1190
1190
|
default: () => ({
|
|
@@ -1194,12 +1194,12 @@ C([
|
|
|
1194
1194
|
fontSize: 15
|
|
1195
1195
|
})
|
|
1196
1196
|
})
|
|
1197
|
-
],
|
|
1197
|
+
], c.prototype, "leadConfig", 2);
|
|
1198
1198
|
C([
|
|
1199
1199
|
v({
|
|
1200
1200
|
required: !0
|
|
1201
1201
|
})
|
|
1202
|
-
],
|
|
1202
|
+
], c.prototype, "gridConfig", 2);
|
|
1203
1203
|
C([
|
|
1204
1204
|
v({
|
|
1205
1205
|
default: () => ({
|
|
@@ -1208,7 +1208,7 @@ C([
|
|
|
1208
1208
|
sens: 0
|
|
1209
1209
|
})
|
|
1210
1210
|
})
|
|
1211
|
-
],
|
|
1211
|
+
], c.prototype, "measurRulerConfig", 2);
|
|
1212
1212
|
C([
|
|
1213
1213
|
v({
|
|
1214
1214
|
default: () => ({
|
|
@@ -1218,7 +1218,7 @@ C([
|
|
|
1218
1218
|
sens: 0
|
|
1219
1219
|
})
|
|
1220
1220
|
})
|
|
1221
|
-
],
|
|
1221
|
+
], c.prototype, "paralleRulerConfig", 2);
|
|
1222
1222
|
C([
|
|
1223
1223
|
v({
|
|
1224
1224
|
default: () => ({
|
|
@@ -1226,7 +1226,7 @@ C([
|
|
|
1226
1226
|
speed: 0
|
|
1227
1227
|
})
|
|
1228
1228
|
})
|
|
1229
|
-
],
|
|
1229
|
+
], c.prototype, "magnifierRulerConfig", 2);
|
|
1230
1230
|
C([
|
|
1231
1231
|
v({
|
|
1232
1232
|
default: () => ({
|
|
@@ -1241,7 +1241,7 @@ C([
|
|
|
1241
1241
|
showIdxPai: 0
|
|
1242
1242
|
})
|
|
1243
1243
|
})
|
|
1244
|
-
],
|
|
1244
|
+
], c.prototype, "heartFight", 2);
|
|
1245
1245
|
C([
|
|
1246
1246
|
v({
|
|
1247
1247
|
default: () => ({
|
|
@@ -1249,14 +1249,14 @@ C([
|
|
|
1249
1249
|
leadNames: [1, 6, 10]
|
|
1250
1250
|
})
|
|
1251
1251
|
})
|
|
1252
|
-
],
|
|
1252
|
+
], c.prototype, "longLeadConfig", 2);
|
|
1253
1253
|
C([
|
|
1254
1254
|
v({
|
|
1255
1255
|
default: () => ({
|
|
1256
1256
|
defaultSelect: 1
|
|
1257
1257
|
})
|
|
1258
1258
|
})
|
|
1259
|
-
],
|
|
1259
|
+
], c.prototype, "singleModeConfig", 2);
|
|
1260
1260
|
C([
|
|
1261
1261
|
v({
|
|
1262
1262
|
default: () => ({
|
|
@@ -1271,38 +1271,38 @@ C([
|
|
|
1271
1271
|
}
|
|
1272
1272
|
})
|
|
1273
1273
|
})
|
|
1274
|
-
],
|
|
1274
|
+
], c.prototype, "scrollConfig", 2);
|
|
1275
1275
|
C([
|
|
1276
1276
|
v({
|
|
1277
1277
|
default: () => 0
|
|
1278
1278
|
})
|
|
1279
|
-
],
|
|
1279
|
+
], c.prototype, "dataTotalTimes", 2);
|
|
1280
1280
|
C([
|
|
1281
1281
|
v({
|
|
1282
1282
|
default: () => 0
|
|
1283
1283
|
})
|
|
1284
|
-
],
|
|
1284
|
+
], c.prototype, "dataTotalLength", 2);
|
|
1285
1285
|
C([
|
|
1286
1286
|
v({
|
|
1287
1287
|
default: () => ""
|
|
1288
1288
|
})
|
|
1289
|
-
],
|
|
1289
|
+
], c.prototype, "prefixId", 2);
|
|
1290
1290
|
C([
|
|
1291
1291
|
v({
|
|
1292
1292
|
default: () => 0
|
|
1293
1293
|
})
|
|
1294
|
-
],
|
|
1294
|
+
], c.prototype, "posStart", 2);
|
|
1295
1295
|
C([
|
|
1296
1296
|
Y(200)
|
|
1297
|
-
],
|
|
1297
|
+
], c.prototype, "nativeScrollFunc", 1);
|
|
1298
1298
|
C([
|
|
1299
1299
|
Y(200)
|
|
1300
|
-
],
|
|
1301
|
-
|
|
1300
|
+
], c.prototype, "handleScroll", 1);
|
|
1301
|
+
c = C([
|
|
1302
1302
|
J({
|
|
1303
1303
|
name: "Methods"
|
|
1304
1304
|
})
|
|
1305
|
-
],
|
|
1305
|
+
], c);
|
|
1306
1306
|
export {
|
|
1307
|
-
|
|
1307
|
+
c as default
|
|
1308
1308
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const l=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 a=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/Watch.js"),u=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.16/node_modules/vuescroll/dist/vuescroll-native.js"),c=require("../MeasuringRuler/index2.js"),h=require("../MagnifierWave/index.js"),p=require("../ParallelRuler/index2.js"),f=require("../BackgroundGrid/index2.js"),m=require("./method.js");var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,e=(t,r,i,s)=>{for(var o=s>1?void 0:s?g(r,i):r,n=t.length-1,d;n>=0;n--)(d=t[n])&&(o=(s?d(r,i,o):d(o))||o);return s&&o&&v(r,i,o),o};exports.default=class extends l.mixins(m.default){constructor(){super(...arguments),this.repaintTimer=Object.freeze(null)}watchVuescrollConfig(){this.repaint()}watchAnalyseValues(){this.nearestHeartInfo={analyseValue:null,insertInfo:null},this.repaint()}watchsingleModeConfig(){this.repaint()}watchWaveConfigs(){this.repaint()}watchWaveLists(){this.repaint(!1)}watchLeadHeadConfig(){var t,r;(t=this.leadHeadGroup)==null||t.removeAll(),(r=this.sceneIns)==null||r.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchLongLeadConfig(){var t;(t=this.sceneIns)==null||t.clear(),this.init()}watchPosStart(){this.registPostStart()}destroyed(){this.repaintTimer&&clearTimeout(this.repaintTimer)}repaint(t=!0){this.repaintTimer&&clearTimeout(this.repaintTimer),this.repaintTimer=setTimeout(()=>{var r,i;t&&((r=this.sceneIns)==null||r.clear(),(i=this.sceneIns)==null||i.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.initCreatedConfig()),this.combinationDrawing(t)},200)}created(){this.initCreatedConfig()}mounted(){this.init()}};e([a.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);e([a.Watch("analyseValues",{deep:!0})],exports.default.prototype,"watchAnalyseValues",1);e([a.Watch("singleModeConfig",{deep:!0})],exports.default.prototype,"watchsingleModeConfig",1);e([a.Watch("waveConfigs",{deep:!0})],exports.default.prototype,"watchWaveConfigs",1);e([a.Watch("waveLists",{deep:!0})],exports.default.prototype,"watchWaveLists",1);e([a.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);e([a.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);e([a.Watch("width")],exports.default.prototype,"watchWidth",1);e([a.Watch("height")],exports.default.prototype,"watchHeight",1);e([a.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);e([a.Watch("posStart")],exports.default.prototype,"watchPosStart",1);exports.default=e([l.default({name:"CommonWaveForm",components:{vueScroll:u.default,MXBackgroundGrid:f.default,MXMeasuringRuler:c.default,MXParallelRuler:p.default,MXMagnifierWave:h.default}})],exports.default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty,T=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var O=(e,t,i)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))V.call(t,i)&&O(e,i,t[i]);if(N)for(var i of N(t))z.call(t,i)&&O(e,i,t[i]);return e},R=(e,t)=>T(e,_(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),X=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const I=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),G=require("lodash"),p=require("@costy-plus/utils"),g=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function q(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 Y=$(j),E=q(g);var K=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,m=(e,t,i,s)=>{for(var a=s>1?void 0:s?Q(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&&K(t,i,a),a};exports.default=class extends Y.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.arrowHeartGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(10),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.nearestHeartInfo=Object.freeze({analyseValue:null,insertInfo:null}),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,r,l,d,h,f;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(),(r=this.rulerGroup)==null||r.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(d=this.arrowHeartGroup)==null||d.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(f=this.sceneIns)==null||f.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.calcHeartBeatPositions(),this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(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"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}handleNotifyMeasurintRectPostion(e){let t=null;this.leadModel.isSingleMode&&this.singleWaveFromGroup?(t=(this.singleWaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd)),console.log("handleNotifyMeasurintRectPostion333333",t)):(t=(this.rowAndColwaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd)),t||(t=(this.addwaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd))),console.log("handleNotifyMeasurintRectPostion44444",t)),t&&this.$emit("notifyMeasurintConfig",t.sens)}combinationDrawing(e=!0){e&&(this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes()),this.drawWaveFrom()}calcHeartBeatPositions(){this.heartBeatPosition=[];let e=[];console.log("this.analyseValues",this.analyseValues);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||this.analyseValues[t][i].AnabyBeat.AtrialRate,interval:Math.round(60/(this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate)*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",heart_style:this.analyseValues[t][i].heart_style});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||this.leadModel.isSingleMode?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:(this.slidingWindowInfo.startInd||0)+t},this.slidingWindowInfo.endInd>this.dataTotalLength&&(this.slidingWindowInfo.endInd=this.dataTotalLength),this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.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||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:(this.addSlidingWindowInfo.endInd||0)+i},this.addSlidingWindowInfo.endInd>this.dataTotalLength&&(this.addSlidingWindowInfo.endInd=this.dataTotalLength)}calcHighestAndLowestPoint(){const e=G.flattenDeep(this.waveLists);return{maxPoints:G.max(e)||0,minPoints:G.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.arrowHeartGroup=new g.Group({name:"arrowHeart"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=p.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=p.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-30},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=p.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=E.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:1});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),this.sceneIns.on("click",this.sceneInsClick),this.sceneIns.on("contextmenu",this.sceneInsContextmenu)}sceneInsClick(e){var d,h,f,y;if(!this.heartFight.isShow||!this.heartFight.isClickArrow)return;this.nearestHeartInfo={analyseValue:null,insertInfo:null};const t=e.offsetX-this.waveDataCopy[0].pos[0],i=this.waveDataCopy[0].startInd||0;let s=p.getPointIdxForPx(t,this.waveDataCopy[0].step||1);if(s+=i,s<=0)return;const a=.15*this.waveConfigs[this.heartFight.showIdxPai].sampleRate;let o=null,n=-1,r=-1,l=1/0;for(let S=0;S<this.analyseValues.length;S++){const W=this.analyseValues[S],P=S!==1?W.filter((M,v)=>{var w;return v===0||((w=M.KeyPosByBeat)==null?void 0:w.Rpoint)!==0}):W;let F=0,H=P.length-1;for(;F<=H;){const M=Math.floor((F+H)/2),v=P[M],w=(d=v.KeyPosByBeat)==null?void 0:d.Rpoint;if(w===void 0)break;const u=Math.abs(s-w);u<=a&&u<l&&(l=u,o=v,n=M,r=S),w<s?F=M+1:H=M-1}}if(console.log("currentHeat",o,n,r,o==null?void 0:o.BeatID,a),o)this.nearestHeartInfo={analyseValue:o,insertInfo:null};else{let S=-1,W=1/0,P=-1,F=-1;for(let H=0;H<this.analyseValues.length;H++){const M=this.analyseValues[H];for(let v=0;v<M.length;v++){const w=M[v];if(H!==1&&v>0&&((h=w.KeyPosByBeat)==null?void 0:h.Rpoint)===0)continue;const u=(f=w.KeyPosByBeat)==null?void 0:f.Rpoint;if(u===void 0)continue;const x=Math.abs(s-u);x<W&&(W=x,F=H,s<u?P=v:H!==1&&((y=w.KeyPosByBeat)==null?void 0:y.Rpoint)===0&&v===0?P=1:P=v+1)}}F!==-1&&(r=F,S=P,console.log("\u672A\u627E\u5230\u5339\u914D\u9879\uFF0CpointIdx\u5E94\u8BE5\u63D2\u5165\u5230\uFF1A",{listIndex:r,insertIndex:S,pointIdx:s,distanceToNearest:W}),this.nearestHeartInfo={analyseValue:{AnabyBeat:{QTd:0,QTc:0,SV3Amp:0,PR:0,QTcd:0,BeatType:-1,SV1Amp:0,QT:0,QRSAxis:0,SV5Amp:0,TAxis:0,AtrialRate:0,Td:0,RV5Amp:0,VentricularRate:0,Pd:0,QRSd:0,RV3Amp:0,PAxis:0,RV1Amp:0,QTdr:0,QRS_T:0},KeyPosByBeat:{Rpoint:s,PPpeak:0,Tend:0,PPstart:0,Tpeak:0,TPpeak:0,QRSend:0,Pend:0,Tstart:0,Ppeak:0,SPpoint:0,PPend:0,TPend:0,QRSstart:0,Pstart:0,TPstart:0},ecg_info_detail:[],BeatID:-1,heart_style:""},insertInfo:{listIndex:r,insertIndex:S,pointIdx:s,distanceToNearest:W}})}this.$emit("notifySceneClick",{event:e,offsetX:e.offsetX,offsetY:e.offsetY,nearestHeartInfo:G.cloneDeep(this.nearestHeartInfo)}),this.drawHeartReact(this.drawLoopArrowStartPosIdx)}sceneInsContextmenu(e){e.event.preventDefault(),this.$emit("notifySceneContextmenu",{event:e,offsetX:e.offsetX,offsetY:e.offsetY,nearestHeartInfo:G.cloneDeep(this.nearestHeartInfo)})}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,s,a;(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),(s=this.sceneIns)==null||s.off("click",this.sceneInsClick),(a=this.sceneIns)==null||a.off("contextmenu",this.sceneInsContextmenu)}drawLeadHead(){var i,s,a,o,n,r;(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.leadHeadGroup);let e="",t=!1;e:for(let l=1;l<=this.totalRows;l++){if(t=!1,!(this.waveConfigs||[])[l-1])break e;if(!!this.waveConfigs[l-1].isShowLeadHead){if(l<=this.leadModel.line)e=(this.leadNames||[])[l-1]||"",this.waveConfigs[l-1].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((a=this.leadHeadGroup)==null||a.add(this.createLeadHead(0,this.waveConfigs[l-1].posY||l*this.splitBlockHeight,p.getSens(this.waveConfigs[l-1].isFixedSquareWaveSize?this.waveConfigs[l-1].fixedSquareWaveSizeGain:this.waveConfigs[l-1].gain,this.gridConfig.cellMg),t)));else if(l>this.leadModel.line&&l-this.leadModel.line<=this.leadModel.add){if(!this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])continue;e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l-this.leadModel.line-1]]],this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((n=this.leadHeadGroup)==null||n.add(this.createLeadHead(0,((o=this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])==null?void 0:o.posY)||l*this.splitBlockHeight,p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].isFixedSquareWaveSize?this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].fixedSquareWaveSizeGain:this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gain,this.gridConfig.cellMg),t)))}}}(r=this.sceneIns)==null||r.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,r,l,d;(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 h=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),f=p.getDataLenTimes(Math.ceil(this.splitPoint/(h||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),y=parseInt(`${f/1e3%60}`,10);this.splitPoint=y*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(h||0)}let t=0,i=0,s=0,a=0;for(let h=1;h<=this.leadModel.column-1;h++){t=h*e+this.leadHeadConfig.leadHedeWidth,i=h*this.leadModel.line;e:for(let f=1;f<=this.leadModel.line;f++){if(!(this.waveConfigs||[])[f-1+i])break e;if((this.waveConfigs||[])[f-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[f-1+i].posX),s=(this.waveConfigs||[])[f-1+i].leadIdx,s===void 0)break;a=p.getSens((this.waveConfigs||[])[f-1+i].isFixedSquareWaveSize?(this.waveConfigs||[])[f-1+i].fixedSquareWaveSizeGain:(this.waveConfigs||[])[f-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[f-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[f-1+i].posY||f*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[f-1+i].posY||f*this.splitBlockHeight)-(a||0)*.5,a))}}(d=this.sceneIns)==null||d.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:b({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:b({text:this.rulerConfig.renderText||`${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,r,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes*2;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*1.1;else if(!this.leadModel.add&&o){const d=p.getPointIdxForPx(this.splitPoint*(this.leadModel.column||1),o),h=p.getDataLenTimes(d,this.rulerConfig.sampleRate||0)/1e3;a=e+h}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.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,s,a;(e=this.leadHeadNameGroup)==null||e.removeAll(),(t=this.leadHeadOffAndDelGroup)==null||t.removeAll(),this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(i=this.sceneIns)==null||i.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(s=this.sceneIns)==null||s.add(this.rowAndColwaveFromGroup),(a=this.sceneIns)==null||a.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(this.drawLoopArrowStartPosIdx),this.drawHeartReact(this.drawLoopArrowStartPosIdx)}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=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let d=0;d<1;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let h=1;h<=l;h++)t=h*this.splitBlockHeight,h>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),h===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((f,y)=>this.waveConfigs[this.singleModeConfig.defaultSelect].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,f,n/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,f,n)).map((f,y)=>[y*(o||0),-f])})}return r}createSingleWaveFrom(){var n,r,l;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=0,o=0;for(let d=0;d<e.length&&!(e[d].pos[1]>this.drawArea.height+this.bottomAreaHeight);d++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(s=parseInt(`${t/1e3/60}`,10),a=parseInt(`${t/1e3%60}`,10),s=a===60?s+=1:s,s=s===0?"00":s<10?`0${s}`:s,a=a===0||a===60?"00":a<10?`0${a}`:a,(r=this.singleWaveFromGroup)==null||r.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,sens:e[d].sens,shape:{points:e[d].data.map(([h,f],y)=>isNaN(f)?(o===0&&(o=y-1,o=o<0?0:o),[e[d].data[o][0]+e[d].pos[0],e[d].data[o][1]+e[d].pos[1]]):(o=0,[h+e[d].pos[0],f+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"single")},oncontextmenu:h=>{this.onContextmenu(h,"single")}})),t/1e3<this.dataTotalTimes&&((l=this.singleWaveFromGroup)==null||l.add(new g.Text({cursor:"",style:{x:e[d].pos[0],y:e[d].pos[1]-(e[d].sens||0)/2,text:d===0?"00:00 \u5FC3\u7387":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),d>0&&(t+=i)),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[d].sens||0)/2-15),this.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens,e[0].pos[0]-10,e[0].pos[1]+10);this.singleWaveDataCopy=e,e=null}drawHeartReact(e=0){var a,o,n,r,l,d,h,f,y,S;if((a=this.arrowHeartGroup)==null||a.removeAll(),!this.heartFight.isShow)return;if(this.leadModel.line!==12&&this.leadModel.column!==1){this.nearestHeartInfo={analyseValue:null,insertInfo:null};return}if(!this.nearestHeartInfo.analyseValue)return;const t=p.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let i=0;const s=(((n=(o=this.nearestHeartInfo.analyseValue)==null?void 0:o.KeyPosByBeat)==null?void 0:n.Rpoint)||0)-e;if(!(e>(((l=(r=this.nearestHeartInfo.analyseValue)==null?void 0:r.KeyPosByBeat)==null?void 0:l.Rpoint)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&s>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&s>(this.slidingWindowInfo.points||0))&&!((((h=(d=this.nearestHeartInfo.analyseValue)==null?void 0:d.KeyPosByBeat)==null?void 0:h.Rpoint)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))){if(this.nearestHeartInfo.insertInfo)i=(s||0)*t+this.leadHeadConfig.leadHedeWidth,(y=this.arrowHeartGroup)==null||y.add(new g.Line({name:"draw_heart_line",cursor:"",shape:{x1:i,y1:0,x2:i,y2:this.canvasContainer.height-2},style:{stroke:"#E07F26",lineWidth:2}}));else{const W=.1*this.waveConfigs[this.heartFight.showIdxPai].sampleRate;i=((s||0)-W/2)*t+this.leadHeadConfig.leadHedeWidth;const P=(W*2+1)*t;(f=this.arrowHeartGroup)==null||f.add(new g.Rect({name:"draw_heart_rect",style:{fill:"#FF87E5",opacity:.64},shape:{x:i,y:0,width:P,height:this.canvasContainer.height-2},cursor:""}))}(S=this.sceneIns)==null||S.add(this.arrowHeartGroup)}}drawLoopArrow(e=0){var f,y,S,W,P,F,H,M,v,w,u,x;if(this.drawLoopArrowStartPosIdx=e,console.log("this.heartFight",this.heartFight),!this.heartFight.isShow)return;(f=this.arrowGroup)==null||f.removeAll(),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 L=p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(L||0)-this.splitBlockHeight/3.5}else this.leadModel.column===1?i=0:i=20;let s=0,a=0;const o={fontSize:12,fill:"#FF0000",fontFamily:this.fontFamily};let n=0,r=0;const l=p.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0,h=0;for(let L=0;L<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;L++){const c=this.heartBeatPosition[this.heartFight.showIdxPai][L];if(d=((c==null?void 0:c.position)||0)-e,e>((c==null?void 0:c.position)||0)||!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0)||this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))continue;if(((c==null?void 0:c.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;s=((y=this.AssistCtx)==null?void 0:y.measureText(`${(c==null?void 0:c.heart_style)||""}`).width)||0,t=d*(l||0)+this.leadHeadConfig.leadHedeWidth-0,a=0,(S=this.arrowGroup)==null||S.add(new g.Text({name:"arrow_box",cursor:"",style:R(b({x:t,y:i+10,text:`${(c==null?void 0:c.heart_style)||""}`},o),{fill:"#333"}),onclick:C=>{!this.heartFight.mode&&!this.heartFight.isClickArrow||this.arrowLoopClick(c,C.target)},oncontextmenu:C=>{C.event.preventDefault(),!(!this.heartFight.mode&&!this.heartFight.isClickArrow)&&this.arrowLoopClick(c,C.target)}}));let A=t,B=0;if(this.heartFight.isHeartRateCalculatedBasedOnInterval)if(L>0){const C=this.heartBeatPosition[this.heartFight.showIdxPai][L-1];if(C){const D=(C.position||0)-e;if(!this.leadModel.isContinuous&&!this.leadModel.add&&D>(this.slidingWindowInfo.points||0))continue;A=D*(l||0)+this.leadHeadConfig.leadHedeWidth,B=t,r=p.calcMs(Math.abs(((c==null?void 0:c.position)||0)-(C.position||0))*(l||0),this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,1),n=r!==0&&p.calcBpm(r)||0}}else continue;else{const C=this.heartBeatPosition[this.heartFight.showIdxPai][L+1]||null;if(!C||(h=((C==null?void 0:C.position)||0)-e,!this.leadModel.isContinuous&&!this.leadModel.add&&h>(this.slidingWindowInfo.points||0))||this.leadModel.isSingleMode&&h>(this.slidingWindowInfo.points||0))continue;if(((C==null?void 0:C.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;A=t,B=h*(l||0)+this.leadHeadConfig.leadHedeWidth,n=(c==null?void 0:c.heartrate)||0}if(a=0,this.heartFight.heartrate){s=((W=this.AssistCtx)==null?void 0:W.measureText(`${n||""}`).width)||0;const C=(B-A)/2-s/2+A;(P=this.arrowGroup)==null||P.add(new g.Text({cursor:"",style:b({x:C,y:a+i+5,text:`${n||""}`},o)})),a+=12}if(this.heartFight.interval){const C=`${(c==null?void 0:c.interval)||""}`;s=((F=this.AssistCtx)==null?void 0:F.measureText(C).width)||0;const D=(B-A)/2-s/2+A;(H=this.arrowGroup)==null||H.add(new g.Text({cursor:"",style:b({x:D,y:a+i+5,text:C},o)})),a+=12}if(this.heartFight.qrstCompany){const C=(c==null?void 0:c.qrstCompany)||"";s=((M=this.AssistCtx)==null?void 0:M.measureText(C).width)||0;const D=(B-A)/2-s/2+A;(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:b({x:D,y:a+i+5,text:C},o)})),a+=12}if(this.heartFight.telectricalaxis){const C=`${(c==null?void 0:c.telectricalaxis)||""}`;s=((w=this.AssistCtx)==null?void 0:w.measureText(C).width)||0;const D=(B-A)/2-s/2+A;(u=this.arrowGroup)==null||u.add(new g.Text({cursor:"",style:b({x:D,y:a+i+5,text:C},o)}))}}(x=this.sceneIns)==null||x.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 a,o,n,r,l,d,h,f,y,S,W,P,F,H,M;if(!this.currentHeardBeat.heardBeat)return;(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.heardBeatLineGroup);let t={},i=0,s;if(this.leadModel.isSingleMode){let v=this.getRednerSinglePoints();e:for(let w=0;w<v.length;w++){if(w>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((d=(l=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:l[this.currentHeardBeat.heardBeat.index])==null?void 0:d.KeyPosByBeat)||t;else{let u=this.analyseValues.find(x=>{var L;return(L=x[this.currentHeardBeat.heardBeat.index])==null?void 0:L.KeyPosByBeat});if(!u)break e;u&&(t=(r=u[this.currentHeardBeat.heardBeat.index])==null?void 0:r.KeyPosByBeat),u=null}for(const u in t)if(this.heardBeatLineKeys.includes(u)){if(i=(t[u]-this.slidingWindowInfo.startInd)*(v[w].step||0),this.isLeadOff(w)||this.isLeadDel(w))continue;if(!this.leadModel.isContinuous&&t[u]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=v[w],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.singleModeConfig.defaultSelect+"_"+w,"single"))}}v=null}else{let v=this.getRednerPoints(),w=this.getAddRednerPoints();e:for(let u=0;u<v.length;u++){t=((y=(f=this.analyseValues[u])==null?void 0:f[this.currentHeardBeat.heardBeat.index])==null?void 0:y.KeyPosByBeat)||t;for(const x in t)if(this.heardBeatLineKeys.includes(x)&&Object.prototype.hasOwnProperty.call(t,x)){if(i=(t[x]-this.slidingWindowInfo.startInd)*(v[u].step||0),this.isLeadOff(u)||this.isLeadDel(u))continue;if(e>t[x]||!this.leadModel.isContinuous&&t[x]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=v[u],this.leadModel.isContinuous&&u>this.leadModel.line-1))break e;(S=this.heardBeatLineGroup)==null||S.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],u+"_"+u,"rowAndCol"))}}e:for(let u=0;u<w.length;u++)if(!!((W=this.analyseValues[u])!=null&&W[this.currentHeardBeat.heardBeat.index])){t=((F=(P=this.analyseValues[u])==null?void 0:P[this.currentHeardBeat.heardBeat.index])==null?void 0:F.KeyPosByBeat)||t;for(const x in t)if(this.heardBeatLineKeys.includes(x)){if(i=(t[x]-this.slidingWindowInfo.startInd)*(w[u].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[u])&&this.isLeadDel(this.longLeadConfig.leadIdxs[u]))continue;if(e>t[x])break e;s=w[u],(H=this.heardBeatLineGroup)==null||H.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.longLeadConfig.leadIdxs[u]+"_"+u,"add"))}}v=null,w=null}(M=this.sceneIns)==null||M.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t,i,s){return new g.Line({name:i,cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1},oncontextmenu:a=>{this.onContextmenu(a,s)}})}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 r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(r+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],r===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,d)=>this.waveConfigs[s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,l,n/2):p.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,d)=>[d*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i,s;(i=this.addwaveFromGroup)==null||i.removeAll();let e=this.getAddRednerPoints(),t=0;for(let a=0;a<e.length;a++)this.isLeadDel(this.longLeadConfig.leadIdxs[a])||((s=this.addwaveFromGroup)==null||s.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[a]+"_"+a,sens:e[a].sens,shape:{points:e[a].data.map(([o,n],r)=>isNaN(n)?(t===0&&(t=r-1,t=t<0?0:t),[e[a].data[t][0]+e[a].pos[0],e[a].data[t][1]+e[a].pos[1]]):(t=0,[o+e[a].pos[0],n+e[a].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{this.onDbClickWaveFrom(o,"add")},oncontextmenu:o=>{this.onContextmenu(o,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[a],e[a].pos[0],e[a].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[a],e[a].pos[0]-5,e[a].pos[1]-(e[a].sens||0)/2-15),this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens,e[a].pos[0],e[a].pos[1]-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const l=[];for(let d=0;d<this.leadModel.column;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&d>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let h=1;h<=this.leadModel.line&&(t=h*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));h++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(h===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((f,y)=>this.waveConfigs[i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,f,o/2):p.getActualY(this.waveConfigs[i].sensitivity,f,o)).map((f,y)=>[y*(a||0),-f])}),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,sens:e[o].sens,shape:{points:e[o].data.map(([n,r],l)=>isNaN(r)?(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],r+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")},oncontextmenu:n=>{this.onContextmenu(n,"rowAndCol")}})),o<this.leadModel.line?(console.log("this.leadNames[LeadNameTextIdx]1111",this.leadNames[t],e[o].pos[1],e[o].sens),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.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15)):(console.log("this.leadNames[LeadNameTextIdx]2222",this.leadNames[t],e[o].pos[1],e[o].sens),this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-40),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9),this.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15));this.waveDataCopy=e,e=null}createLeadSensNams(e,t,i){var a;let s=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),i=i+40),(a=this.leadHeadNameGroup)==null||a.add(new g.Text({style:{x:s,y:i,text:e,fontSize:this.leadConfig.squareWaveSensFontSize||this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}))}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i),i=i+20,console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i)),(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:a,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:R(b({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:R(b({},n),{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}})))}onContextmenu(e,t){e.event.preventDefault(),e.event.stopPropagation(),console.log("onContextmenu",e);const i=e.target.name.split("_"),s=+i[1];let a=0,o=0,n=0,r=0,l=0;t==="single"?(a=e.offsetX-this.singleWaveDataCopy[s].pos[0],o=this.singleWaveDataCopy[s].startInd,n=p.getPointIdxForPx(a,this.singleWaveDataCopy[s].step||1),r=this.singleWaveDataCopy[s].sens,l=this.singleWaveDataCopy[s].step):t==="rowAndCol"?(a=e.offsetX-this.waveDataCopy[s].pos[0],o=this.waveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.waveDataCopy[s].step||1),r=this.waveDataCopy[s].sens,l=this.waveDataCopy[s].step):t==="add"&&(a=e.offsetX-this.addWaveDataCopy[s].pos[0],o=this.addWaveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.addWaveDataCopy[s].step||1),r=this.addWaveDataCopy[s].sens,l=this.addWaveDataCopy[s].step),n+=o,this.$emit("notifyOnContextmenu",{sens:r,step:l,activeLeadIdx:+i[0],pointIdx:n,offsetX:e.offsetX,offsetY:e.offsetY,pageX:e.event.pageX,pageY:e.event.pageY})}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,r=0,l=0,d=0,h=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,l=p.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),d=this.singleWaveDataCopy[o].sens,h=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.waveDataCopy[o].step||1),d=this.waveDataCopy[o].sens,h=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),d=this.addWaveDataCopy[o].sens,h=this.addWaveDataCopy[o].step),l+=r,this.$emit("notifyActiveEnlargr",{sens:d,step:h,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=p.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,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([r,l])=>[r+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([r,l])=>[r+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=p.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i,s,a;(t=this.arrowGroup)==null||t.removeAll(),(i=this.arrowHeartGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.arrowGroup),(a=this.sceneIns)==null||a.remove(this.arrowHeartGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e),this.drawHeartReact(e)}};m([I.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);m([I.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);m([I.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);m([I.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);m([I.Prop({required:!0})],exports.default.prototype,"leadModel",2);m([I.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);m([I.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);m([I.Prop({required:!0})],exports.default.prototype,"gridConfig",2);m([I.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);m([I.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);m([I.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);m([I.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,isClickArrow:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);m([I.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);m([I.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);m([I.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);m([I.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);m([I.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);m([I.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);m([I.Prop({default:()=>0})],exports.default.prototype,"posStart",2);m([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);m([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=m([X.default({name:"Methods"})],exports.default);
|
|
1
|
+
"use strict";var T=Object.defineProperty,k=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var O=(e,t,i)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t)=>{for(var i in t||(t={}))V.call(t,i)&&O(e,i,t[i]);if(N)for(var i of N(t))z.call(t,i)&&O(e,i,t[i]);return e},R=(e,t)=>k(e,_(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),X=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const I=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),G=require("lodash"),p=require("@costy-plus/utils"),g=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function q(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 Y=$(j),E=q(g);var K=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,m=(e,t,i,s)=>{for(var a=s>1?void 0:s?Q(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&&K(t,i,a),a};exports.default=class extends Y.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.arrowHeartGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(10),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.nearestHeartInfo=Object.freeze({analyseValue:null,insertInfo:null}),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,r,l,d,h,f;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(),(r=this.rulerGroup)==null||r.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(d=this.arrowHeartGroup)==null||d.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(f=this.sceneIns)==null||f.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.calcHeartBeatPositions(),this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(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"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}handleNotifyMeasurintRectPostion(e){let t=null;this.leadModel.isSingleMode&&this.singleWaveFromGroup?(t=(this.singleWaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd)),console.log("handleNotifyMeasurintRectPostion333333",t)):(t=(this.rowAndColwaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd)),t||(t=(this.addwaveFromGroup._children||[]).find(i=>i.rectContain(e.x,e.y)||i.rectContain(e.x,e.yEnd))),console.log("handleNotifyMeasurintRectPostion44444",t)),t&&this.$emit("notifyMeasurintConfig",t.sens)}combinationDrawing(e=!0){e&&(this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes()),this.drawWaveFrom()}calcHeartBeatPositions(){this.heartBeatPosition=[];let e=[];console.log("this.analyseValues",this.analyseValues);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||this.analyseValues[t][i].AnabyBeat.AtrialRate,interval:Math.round(60/(this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate)*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",heart_style:this.analyseValues[t][i].heart_style});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||this.leadModel.isSingleMode?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:(this.slidingWindowInfo.startInd||0)+t},this.slidingWindowInfo.endInd>this.dataTotalLength&&(this.slidingWindowInfo.endInd=this.dataTotalLength),this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.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||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:(this.addSlidingWindowInfo.endInd||0)+i},this.addSlidingWindowInfo.endInd>this.dataTotalLength&&(this.addSlidingWindowInfo.endInd=this.dataTotalLength)}calcHighestAndLowestPoint(){const e=G.flattenDeep(this.waveLists);return{maxPoints:G.max(e)||0,minPoints:G.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.arrowHeartGroup=new g.Group({name:"arrowHeart"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=p.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=p.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-30},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=p.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=E.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:1});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),this.sceneIns.on("click",this.sceneInsClick),this.sceneIns.on("contextmenu",this.sceneInsContextmenu)}sceneInsClick(e){var d,h,f,y;if(!this.heartFight.isShow||!this.heartFight.isClickArrow)return;this.nearestHeartInfo={analyseValue:null,insertInfo:null};const t=e.offsetX-this.waveDataCopy[0].pos[0],i=this.waveDataCopy[0].startInd||0;let s=p.getPointIdxForPx(t,this.waveDataCopy[0].step||1);if(s+=i,s<=0)return;const a=.15*this.waveConfigs[this.heartFight.showIdxPai].sampleRate;let o=null,n=-1,r=-1,l=1/0;for(let S=0;S<this.analyseValues.length;S++){const W=this.analyseValues[S],P=S!==1?W.filter((M,v)=>{var w;return v===0||((w=M.KeyPosByBeat)==null?void 0:w.Rpoint)!==0}):W;let F=0,H=P.length-1;for(;F<=H;){const M=Math.floor((F+H)/2),v=P[M],w=(d=v.KeyPosByBeat)==null?void 0:d.Rpoint;if(w===void 0)break;const u=Math.abs(s-w);u<=a&&u<l&&(l=u,o=v,n=M,r=S),w<s?F=M+1:H=M-1}}if(console.log("currentHeat",o,n,r,o==null?void 0:o.BeatID,a),o)this.nearestHeartInfo={analyseValue:o,insertInfo:null};else{let S=-1,W=1/0,P=-1,F=-1;for(let H=0;H<this.analyseValues.length;H++){const M=this.analyseValues[H];for(let v=0;v<M.length;v++){const w=M[v];if(H!==1&&v>0&&((h=w.KeyPosByBeat)==null?void 0:h.Rpoint)===0)continue;const u=(f=w.KeyPosByBeat)==null?void 0:f.Rpoint;if(u===void 0)continue;const x=Math.abs(s-u);x<W&&(W=x,F=H,s<u?P=v:H!==1&&((y=w.KeyPosByBeat)==null?void 0:y.Rpoint)===0&&v===0?P=1:P=v+1)}}F!==-1&&(r=F,S=P,console.log("\u672A\u627E\u5230\u5339\u914D\u9879\uFF0CpointIdx\u5E94\u8BE5\u63D2\u5165\u5230\uFF1A",{listIndex:r,insertIndex:S,pointIdx:s,distanceToNearest:W}),this.nearestHeartInfo={analyseValue:{AnabyBeat:{QTd:0,QTc:0,SV3Amp:0,PR:0,QTcd:0,BeatType:-1,SV1Amp:0,QT:0,QRSAxis:0,SV5Amp:0,TAxis:0,AtrialRate:0,Td:0,RV5Amp:0,VentricularRate:0,Pd:0,QRSd:0,RV3Amp:0,PAxis:0,RV1Amp:0,QTdr:0,QRS_T:0},KeyPosByBeat:{Rpoint:s,PPpeak:0,Tend:0,PPstart:0,Tpeak:0,TPpeak:0,QRSend:0,Pend:0,Tstart:0,Ppeak:0,SPpoint:0,PPend:0,TPend:0,QRSstart:0,Pstart:0,TPstart:0},ecg_info_detail:[],BeatID:-1,heart_style:""},insertInfo:{listIndex:r,insertIndex:S,pointIdx:s,distanceToNearest:W}})}this.$emit("notifySceneClick",{event:e,offsetX:e.offsetX,offsetY:e.offsetY,nearestHeartInfo:G.cloneDeep(this.nearestHeartInfo)}),this.drawHeartReact(this.drawLoopArrowStartPosIdx)}sceneInsContextmenu(e){e.event.preventDefault(),this.$emit("notifySceneContextmenu",{event:e,offsetX:e.offsetX,offsetY:e.offsetY,nearestHeartInfo:G.cloneDeep(this.nearestHeartInfo)})}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,s,a;(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),(s=this.sceneIns)==null||s.off("click",this.sceneInsClick),(a=this.sceneIns)==null||a.off("contextmenu",this.sceneInsContextmenu)}drawLeadHead(){var i,s,a,o,n,r;(i=this.leadHeadGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.leadHeadGroup);let e="",t=!1;e:for(let l=1;l<=this.totalRows;l++){if(t=!1,!(this.waveConfigs||[])[l-1])break e;if(!!this.waveConfigs[l-1].isShowLeadHead){if(l<=this.leadModel.line)e=(this.leadNames||[])[l-1]||"",this.waveConfigs[l-1].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((a=this.leadHeadGroup)==null||a.add(this.createLeadHead(0,this.waveConfigs[l-1].posY||l*this.splitBlockHeight,p.getSens(this.waveConfigs[l-1].isFixedSquareWaveSize?this.waveConfigs[l-1].fixedSquareWaveSizeGain:this.waveConfigs[l-1].gain,this.gridConfig.cellMg),t)));else if(l>this.leadModel.line&&l-this.leadModel.line<=this.leadModel.add){if(!this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])continue;e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l-this.leadModel.line-1]]],this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),this.leadHeadConfig.isShowLeadCalibration!==!1&&((n=this.leadHeadGroup)==null||n.add(this.createLeadHead(0,((o=this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]])==null?void 0:o.posY)||l*this.splitBlockHeight,p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].isFixedSquareWaveSize?this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].fixedSquareWaveSizeGain:this.waveConfigs[this.longLeadConfig.leadIdxs[l-this.leadModel.line-1]].gain,this.gridConfig.cellMg),t)))}}}(r=this.sceneIns)==null||r.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,r,l,d;(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 h=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),f=p.getDataLenTimes(Math.ceil(this.splitPoint/(h||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),y=parseInt(`${f/1e3%60}`,10);this.splitPoint=y*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(h||0)}let t=0,i=0,s=0,a=0;for(let h=1;h<=this.leadModel.column-1;h++){t=h*e+this.leadHeadConfig.leadHedeWidth,i=h*this.leadModel.line;e:for(let f=1;f<=this.leadModel.line;f++){if(!(this.waveConfigs||[])[f-1+i])break e;if((this.waveConfigs||[])[f-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[f-1+i].posX),s=(this.waveConfigs||[])[f-1+i].leadIdx,s===void 0)break;a=p.getSens((this.waveConfigs||[])[f-1+i].isFixedSquareWaveSize?(this.waveConfigs||[])[f-1+i].fixedSquareWaveSizeGain:(this.waveConfigs||[])[f-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[f-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[f-1+i].posY||f*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[f-1+i].posY||f*this.splitBlockHeight)-(a||0)*.5,a))}}(d=this.sceneIns)==null||d.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:b({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:b({text:this.rulerConfig.renderText||`${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,r,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes*2;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*1.1;else if(!this.leadModel.add&&o){const d=p.getPointIdxForPx(this.splitPoint*(this.leadModel.column||1),o),h=p.getDataLenTimes(d,this.rulerConfig.sampleRate||0)/1e3;a=e+h}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.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,s,a;(e=this.leadHeadNameGroup)==null||e.removeAll(),(t=this.leadHeadOffAndDelGroup)==null||t.removeAll(),this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(i=this.sceneIns)==null||i.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(s=this.sceneIns)==null||s.add(this.rowAndColwaveFromGroup),(a=this.sceneIns)==null||a.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(this.drawLoopArrowStartPosIdx),this.drawHeartReact(this.drawLoopArrowStartPosIdx)}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=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let d=0;d<1;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let h=1;h<=l;h++)t=h*this.splitBlockHeight,h>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),h===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((f,y)=>this.waveConfigs[this.singleModeConfig.defaultSelect].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,f,n/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,f,n)).map((f,y)=>[y*(o||0),-f])})}return r}createSingleWaveFrom(){var n,r,l;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=0,o=0;for(let d=0;d<e.length&&!(e[d].pos[1]>this.drawArea.height+this.bottomAreaHeight);d++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(s=parseInt(`${t/1e3/60}`,10),a=parseInt(`${t/1e3%60}`,10),s=a===60?s+=1:s,s=s===0?"00":s<10?`0${s}`:s,a=a===0||a===60?"00":a<10?`0${a}`:a,(r=this.singleWaveFromGroup)==null||r.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,sens:e[d].sens,shape:{points:e[d].data.map(([h,f],y)=>isNaN(f)?(o===0&&(o=y-1,o=o<0?0:o),[e[d].data[o][0]+e[d].pos[0],e[d].data[o][1]+e[d].pos[1]]):(o=0,[h+e[d].pos[0],f+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:h=>{this.onDbClickWaveFrom(h,"single")},oncontextmenu:h=>{this.onContextmenu(h,"single")}})),t/1e3<this.dataTotalTimes&&((l=this.singleWaveFromGroup)==null||l.add(new g.Text({cursor:"",style:{x:e[d].pos[0],y:e[d].pos[1]-(e[d].sens||0)/2,text:d===0?"00:00 \u5FC3\u7387":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),d>0&&(t+=i)),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[d].sens||0)/2-15),this.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.singleModeConfig.defaultSelect].squareWaveSens,e[0].pos[0]-10,e[0].pos[1]+10);this.singleWaveDataCopy=e,e=null}drawHeartReact(e=0){var a,o,n,r,l,d,h,f,y,S;if((a=this.arrowHeartGroup)==null||a.removeAll(),!this.heartFight.isShow)return;if(this.leadModel.line!==12&&this.leadModel.column!==1){this.nearestHeartInfo={analyseValue:null,insertInfo:null};return}if(!this.nearestHeartInfo.analyseValue)return;const t=p.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let i=0;const s=(((n=(o=this.nearestHeartInfo.analyseValue)==null?void 0:o.KeyPosByBeat)==null?void 0:n.Rpoint)||0)-e;if(!(e>(((l=(r=this.nearestHeartInfo.analyseValue)==null?void 0:r.KeyPosByBeat)==null?void 0:l.Rpoint)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&s>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&s>(this.slidingWindowInfo.points||0))&&!((((h=(d=this.nearestHeartInfo.analyseValue)==null?void 0:d.KeyPosByBeat)==null?void 0:h.Rpoint)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))){if(this.nearestHeartInfo.insertInfo)i=(s||0)*t+this.leadHeadConfig.leadHedeWidth,(y=this.arrowHeartGroup)==null||y.add(new g.Line({name:"draw_heart_line",cursor:"",shape:{x1:i,y1:0,x2:i,y2:this.canvasContainer.height-2},style:{stroke:"#E07F26",lineWidth:2}}));else{const W=.1*this.waveConfigs[this.heartFight.showIdxPai].sampleRate;i=((s||0)-W/2)*t+this.leadHeadConfig.leadHedeWidth;const P=(W*2+1)*t;(f=this.arrowHeartGroup)==null||f.add(new g.Rect({name:"draw_heart_rect",style:{fill:"#FF87E5",opacity:.64},shape:{x:i,y:0,width:P,height:this.canvasContainer.height-2},cursor:""}))}(S=this.sceneIns)==null||S.add(this.arrowHeartGroup)}}drawLoopArrow(e=0){var f,y,S,W,P,F,H,M,v,w,u,x;if(this.drawLoopArrowStartPosIdx=e,console.log("this.heartFight",this.heartFight),!this.heartFight.isShow)return;(f=this.arrowGroup)==null||f.removeAll(),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 L=p.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(L||0)-this.splitBlockHeight/3.5}else this.leadModel.column===1?i=0:i=20;let s=0,a=0;const o={fontSize:12,fill:"#FF0000",fontFamily:this.fontFamily};let n=0,r=0;const l=p.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0,h=0;for(let L=0;L<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;L++){const c=this.heartBeatPosition[this.heartFight.showIdxPai][L];if(d=((c==null?void 0:c.position)||0)-e,e>((c==null?void 0:c.position)||0)||!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0)||this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))continue;if(((c==null?void 0:c.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;s=((y=this.AssistCtx)==null?void 0:y.measureText(`${(c==null?void 0:c.heart_style)||""}`).width)||0,t=d*(l||0)+this.leadHeadConfig.leadHedeWidth-0,a=0,(S=this.arrowGroup)==null||S.add(new g.Text({name:"arrow_box",cursor:"",style:R(b({x:t,y:i+10,text:`${(c==null?void 0:c.heart_style)||""}`},o),{fill:"#333"}),onclick:C=>{!this.heartFight.mode&&this.heartFight.isClickArrow},oncontextmenu:C=>{C.event.preventDefault(),!this.heartFight.mode&&this.heartFight.isClickArrow}}));let A=t,B=0;if(this.heartFight.isHeartRateCalculatedBasedOnInterval)if(L>0){const C=this.heartBeatPosition[this.heartFight.showIdxPai][L-1];if(C){const D=(C.position||0)-e;if(!this.leadModel.isContinuous&&!this.leadModel.add&&D>(this.slidingWindowInfo.points||0))continue;A=D*(l||0)+this.leadHeadConfig.leadHedeWidth,B=t,r=p.calcMs(Math.abs(((c==null?void 0:c.position)||0)-(C.position||0))*(l||0),this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,1),n=r!==0&&p.calcBpm(r)||0}}else continue;else{const C=this.heartBeatPosition[this.heartFight.showIdxPai][L+1]||null;if(!C||(h=((C==null?void 0:C.position)||0)-e,!this.leadModel.isContinuous&&!this.leadModel.add&&h>(this.slidingWindowInfo.points||0))||this.leadModel.isSingleMode&&h>(this.slidingWindowInfo.points||0))continue;if(((C==null?void 0:C.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;A=t,B=h*(l||0)+this.leadHeadConfig.leadHedeWidth,n=(c==null?void 0:c.heartrate)||0}if(a=0,this.heartFight.heartrate){s=((W=this.AssistCtx)==null?void 0:W.measureText(`${n||""}`).width)||0;const C=(B-A)/2-s/2+A;(P=this.arrowGroup)==null||P.add(new g.Text({cursor:"",style:b({x:C,y:a+i+5,text:`${n||""}`},o)})),a+=12}if(this.heartFight.interval){let C=`${(c==null?void 0:c.interval)||""}`;this.heartFight.isHeartRateCalculatedBasedOnInterval&&(C=`${Math.round(6e4/n)}`),s=((F=this.AssistCtx)==null?void 0:F.measureText(C).width)||0;const D=(B-A)/2-s/2+A;(H=this.arrowGroup)==null||H.add(new g.Text({cursor:"",style:b({x:D,y:a+i+5,text:C},o)})),a+=12}if(this.heartFight.qrstCompany){const C=(c==null?void 0:c.qrstCompany)||"";s=((M=this.AssistCtx)==null?void 0:M.measureText(C).width)||0;const D=(B-A)/2-s/2+A;(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:b({x:D,y:a+i+5,text:C},o)})),a+=12}if(this.heartFight.telectricalaxis){const C=`${(c==null?void 0:c.telectricalaxis)||""}`;s=((w=this.AssistCtx)==null?void 0:w.measureText(C).width)||0;const D=(B-A)/2-s/2+A;(u=this.arrowGroup)==null||u.add(new g.Text({cursor:"",style:b({x:D,y:a+i+5,text:C},o)}))}}(x=this.sceneIns)==null||x.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 a,o,n,r,l,d,h,f,y,S,W,P,F,H,M;if(!this.currentHeardBeat.heardBeat)return;(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.heardBeatLineGroup);let t={},i=0,s;if(this.leadModel.isSingleMode){let v=this.getRednerSinglePoints();e:for(let w=0;w<v.length;w++){if(w>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((d=(l=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:l[this.currentHeardBeat.heardBeat.index])==null?void 0:d.KeyPosByBeat)||t;else{let u=this.analyseValues.find(x=>{var L;return(L=x[this.currentHeardBeat.heardBeat.index])==null?void 0:L.KeyPosByBeat});if(!u)break e;u&&(t=(r=u[this.currentHeardBeat.heardBeat.index])==null?void 0:r.KeyPosByBeat),u=null}for(const u in t)if(this.heardBeatLineKeys.includes(u)){if(i=(t[u]-this.slidingWindowInfo.startInd)*(v[w].step||0),this.isLeadOff(w)||this.isLeadDel(w))continue;if(!this.leadModel.isContinuous&&t[u]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=v[w],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.singleModeConfig.defaultSelect+"_"+w,"single"))}}v=null}else{let v=this.getRednerPoints(),w=this.getAddRednerPoints();e:for(let u=0;u<v.length;u++){t=((y=(f=this.analyseValues[u])==null?void 0:f[this.currentHeardBeat.heardBeat.index])==null?void 0:y.KeyPosByBeat)||t;for(const x in t)if(this.heardBeatLineKeys.includes(x)&&Object.prototype.hasOwnProperty.call(t,x)){if(i=(t[x]-this.slidingWindowInfo.startInd)*(v[u].step||0),this.isLeadOff(u)||this.isLeadDel(u))continue;if(e>t[x]||!this.leadModel.isContinuous&&t[x]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=v[u],this.leadModel.isContinuous&&u>this.leadModel.line-1))break e;(S=this.heardBeatLineGroup)==null||S.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],u+"_"+u,"rowAndCol"))}}e:for(let u=0;u<w.length;u++)if(!!((W=this.analyseValues[u])!=null&&W[this.currentHeardBeat.heardBeat.index])){t=((F=(P=this.analyseValues[u])==null?void 0:P[this.currentHeardBeat.heardBeat.index])==null?void 0:F.KeyPosByBeat)||t;for(const x in t)if(this.heardBeatLineKeys.includes(x)){if(i=(t[x]-this.slidingWindowInfo.startInd)*(w[u].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[u])&&this.isLeadDel(this.longLeadConfig.leadIdxs[u]))continue;if(e>t[x])break e;s=w[u],(H=this.heardBeatLineGroup)==null||H.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1],this.longLeadConfig.leadIdxs[u]+"_"+u,"add"))}}v=null,w=null}(M=this.sceneIns)==null||M.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t,i,s){return new g.Line({name:i,cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1},oncontextmenu:a=>{this.onContextmenu(a,s)}})}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 r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(r+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],r===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,d)=>this.waveConfigs[s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,l,n/2):p.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,d)=>[d*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i,s;(i=this.addwaveFromGroup)==null||i.removeAll();let e=this.getAddRednerPoints(),t=0;for(let a=0;a<e.length;a++)this.isLeadDel(this.longLeadConfig.leadIdxs[a])||((s=this.addwaveFromGroup)==null||s.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[a]+"_"+a,sens:e[a].sens,shape:{points:e[a].data.map(([o,n],r)=>isNaN(n)?(t===0&&(t=r-1,t=t<0?0:t),[e[a].data[t][0]+e[a].pos[0],e[a].data[t][1]+e[a].pos[1]]):(t=0,[o+e[a].pos[0],n+e[a].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{this.onDbClickWaveFrom(o,"add")},oncontextmenu:o=>{this.onContextmenu(o,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[a],e[a].pos[0],e[a].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[a],e[a].pos[0]-5,e[a].pos[1]-(e[a].sens||0)/2-15),this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[this.longLeadConfig.leadIdxs[a]].squareWaveSens,e[a].pos[0],e[a].pos[1]-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const l=[];for(let d=0;d<this.leadModel.column;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&d>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let h=1;h<=this.leadModel.line&&(t=h*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));h++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(h===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((f,y)=>this.waveConfigs[i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,f,o/2):p.getActualY(this.waveConfigs[i].sensitivity,f,o)).map((f,y)=>[y*(a||0),-f])}),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,sens:e[o].sens,shape:{points:e[o].data.map(([n,r],l)=>isNaN(r)?(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],r+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")},oncontextmenu:n=>{this.onContextmenu(n,"rowAndCol")}})),o<this.leadModel.line?(console.log("this.leadNames[LeadNameTextIdx]1111",this.leadNames[t],e[o].pos[1],e[o].sens),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.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15)):(console.log("this.leadNames[LeadNameTextIdx]2222",this.leadNames[t],e[o].pos[1],e[o].sens),this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-40),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9),this.waveConfigs[o].squareWaveSens&&this.createLeadSensNams(this.waveConfigs[o].squareWaveSens,e[o].pos[0],e[o].pos[1]-15));this.waveDataCopy=e,e=null}createLeadSensNams(e,t,i){var a;let s=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?s=t-this.leadHeadConfig.leadHedeWidth+12:s=t-this.leadHeadConfig.leadHedeWidth+5),i=i+40),(a=this.leadHeadNameGroup)==null||a.add(new g.Text({style:{x:s,y:i,text:e,fontSize:this.leadConfig.squareWaveSensFontSize||this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}))}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),this.leadHeadConfig.isShowLeadCalibration&&this.leadHeadConfig.isCalibrationDisplayedBelow&&(t<=this.leadHeadConfig.leadHedeWidth&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i),i=i+20,console.log("this.leadNames[LeadNameTextIdx]",this.leadNames[e],i)),(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:a,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:R(b({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:R(b({},n),{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}})))}onContextmenu(e,t){e.event.preventDefault(),e.event.stopPropagation(),console.log("onContextmenu",e);const i=e.target.name.split("_"),s=+i[1];let a=0,o=0,n=0,r=0,l=0;t==="single"?(a=e.offsetX-this.singleWaveDataCopy[s].pos[0],o=this.singleWaveDataCopy[s].startInd,n=p.getPointIdxForPx(a,this.singleWaveDataCopy[s].step||1),r=this.singleWaveDataCopy[s].sens,l=this.singleWaveDataCopy[s].step):t==="rowAndCol"?(a=e.offsetX-this.waveDataCopy[s].pos[0],o=this.waveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.waveDataCopy[s].step||1),r=this.waveDataCopy[s].sens,l=this.waveDataCopy[s].step):t==="add"&&(a=e.offsetX-this.addWaveDataCopy[s].pos[0],o=this.addWaveDataCopy[s].startInd||0,n=p.getPointIdxForPx(a,this.addWaveDataCopy[s].step||1),r=this.addWaveDataCopy[s].sens,l=this.addWaveDataCopy[s].step),n+=o,this.$emit("notifyOnContextmenu",{sens:r,step:l,activeLeadIdx:+i[0],pointIdx:n,offsetX:e.offsetX,offsetY:e.offsetY,pageX:e.event.pageX,pageY:e.event.pageY})}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,r=0,l=0,d=0,h=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,l=p.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),d=this.singleWaveDataCopy[o].sens,h=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.waveDataCopy[o].step||1),d=this.waveDataCopy[o].sens,h=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,l=p.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),d=this.addWaveDataCopy[o].sens,h=this.addWaveDataCopy[o].step),l+=r,this.$emit("notifyActiveEnlargr",{sens:d,step:h,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=p.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,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([r,l])=>[r+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([r,l])=>[r+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=p.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i,s,a;(t=this.arrowGroup)==null||t.removeAll(),(i=this.arrowHeartGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.arrowGroup),(a=this.sceneIns)==null||a.remove(this.arrowHeartGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e),this.drawHeartReact(e)}};m([I.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);m([I.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);m([I.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);m([I.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);m([I.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);m([I.Prop({required:!0})],exports.default.prototype,"leadModel",2);m([I.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);m([I.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);m([I.Prop({required:!0})],exports.default.prototype,"gridConfig",2);m([I.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);m([I.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);m([I.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);m([I.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,isClickArrow:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);m([I.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);m([I.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);m([I.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);m([I.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);m([I.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);m([I.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);m([I.Prop({default:()=>0})],exports.default.prototype,"posStart",2);m([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);m([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=m([X.default({name:"Methods"})],exports.default);
|