costy-plus 1.0.94-0 → 1.0.95-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.
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var X = Object.defineProperty, Y = Object.defineProperties;
|
|
2
|
+
var _ = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var $ = Object.getOwnPropertySymbols;
|
|
4
|
+
var E = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var V = (e, t, i) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, W = (e, t) => {
|
|
6
6
|
for (var i in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var i of
|
|
10
|
-
|
|
7
|
+
E.call(t, i) && V(e, i, t[i]);
|
|
8
|
+
if ($)
|
|
9
|
+
for (var i of $(t))
|
|
10
|
+
K.call(t, i) && V(e, i, t[i]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
}, k = (e, t) => Y(e, _(t));
|
|
13
|
+
import q from "vue";
|
|
14
|
+
import Q from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
|
|
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 w } 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
|
-
import { flattenDeep as
|
|
18
|
-
import { throttling as
|
|
19
|
-
import * as
|
|
20
|
-
import { Group as y, Polyline as
|
|
21
|
-
var
|
|
22
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
17
|
+
import { flattenDeep as U, max as Z, min as J } from "lodash";
|
|
18
|
+
import { throttling as T, getStepForSpeed as H, getPrintLengthToPx as ee, getSens as M, getDataLenTimes as O, getPointIdxForPx as P, getActualY as L, calcMs as te, calcBpm as ie } from "@costy-plus/utils";
|
|
19
|
+
import * as se from "zrender";
|
|
20
|
+
import { Group as y, Polyline as R, Line as z, Text as S, Polygon as ae, util as oe } from "zrender";
|
|
21
|
+
var ne = Object.defineProperty, le = Object.getOwnPropertyDescriptor, c = (e, t, i, s) => {
|
|
22
|
+
for (var o = s > 1 ? void 0 : s ? le(t, i) : t, a = e.length - 1, n; a >= 0; a--)
|
|
23
23
|
(n = e[a]) && (o = (s ? n(t, i, o) : n(o)) || o);
|
|
24
|
-
return s && o &&
|
|
24
|
+
return s && o && ne(t, i, o), o;
|
|
25
25
|
};
|
|
26
|
-
let u = class extends
|
|
26
|
+
let u = class extends q {
|
|
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.heardBeatLineGroup = Object.freeze(null), this.bottomAreaHeight = Object.freeze(60), this.totalRows = Object.freeze(0), this.rulerStep = Object.freeze(0), this.drawLoopArrowStartPosIdx = Object.freeze(0), this.dbClickWaveFromTime = Object.freeze(0), this.timersCopy = Object.freeze(0), this.range = Object.freeze(5e3), this.heartBeatPosition = [], this.currentHeardBeat = {
|
|
29
29
|
heardBeat: null,
|
|
@@ -110,7 +110,7 @@ let u = class extends Q {
|
|
|
110
110
|
startInd: this.slidingWindowInfo.startInd || 0,
|
|
111
111
|
endInd: this.slidingWindowInfo.endInd <= t || this.leadModel.isSingleMode ? t : this.slidingWindowInfo.endInd
|
|
112
112
|
}, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
|
|
113
|
-
const s =
|
|
113
|
+
const s = H(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), o = this.dataTotalLength * s;
|
|
114
114
|
this.vuescrollWH.width = this.canvasContainer.width + (o || 0) - this.splitPoint;
|
|
115
115
|
}
|
|
116
116
|
const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
|
|
@@ -121,10 +121,10 @@ let u = class extends Q {
|
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
calcHighestAndLowestPoint() {
|
|
124
|
-
const e =
|
|
124
|
+
const e = U(this.waveLists);
|
|
125
125
|
return {
|
|
126
|
-
maxPoints:
|
|
127
|
-
minPoints:
|
|
126
|
+
maxPoints: Z(e) || 0,
|
|
127
|
+
minPoints: J(e) || 0
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
isLeadOff(e) {
|
|
@@ -158,10 +158,10 @@ let u = class extends Q {
|
|
|
158
158
|
});
|
|
159
159
|
let e = this.canvasContainer.width;
|
|
160
160
|
if (this.leadModel.ecgareawidth === 1) {
|
|
161
|
-
const i =
|
|
161
|
+
const i = ee(((t = this.waveConfigs[0]) == null ? void 0 : t.sampleRate) || 0) + this.leadHeadConfig.leadHedeWidth;
|
|
162
162
|
i <= e && (e = i);
|
|
163
163
|
} else if (this.leadModel.isContinuous) {
|
|
164
|
-
const i =
|
|
164
|
+
const i = H(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), s = this.dataTotalLength * i;
|
|
165
165
|
!this.leadModel.isSingleMode && (s || 0) < e - this.leadHeadConfig.leadHedeWidth && (e = (s || 0) + this.leadHeadConfig.leadHedeWidth);
|
|
166
166
|
}
|
|
167
167
|
this.drawArea = {
|
|
@@ -181,13 +181,13 @@ let u = class extends Q {
|
|
|
181
181
|
}, this.currentHeardBeat = {
|
|
182
182
|
heardBeat: null,
|
|
183
183
|
ele: null
|
|
184
|
-
}, 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 =
|
|
184
|
+
}, 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 = H(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), this.rulerStep = (this.publicStep || 1) * (this.leadModel.publicSampleRate || 1) / (this.gridConfig.cellMg * 2 + 2);
|
|
185
185
|
}
|
|
186
186
|
initWaveFormPeer() {
|
|
187
187
|
var i;
|
|
188
188
|
(i = this.sceneIns) == null || i.dispose(), this.AssistCtx = null;
|
|
189
189
|
const e = document.getElementById(`${this.prefixId}wave-from-box`);
|
|
190
|
-
this.sceneIns =
|
|
190
|
+
this.sceneIns = se.init(e, {
|
|
191
191
|
width: this.canvasContainer.width,
|
|
192
192
|
height: this.canvasContainer.height,
|
|
193
193
|
devicePixelRatio: 2
|
|
@@ -228,7 +228,7 @@ let u = class extends Q {
|
|
|
228
228
|
this.createLeadHead(
|
|
229
229
|
i,
|
|
230
230
|
this.waveConfigs[h - 1 + s].posY || h * this.splitBlockHeight,
|
|
231
|
-
|
|
231
|
+
M(this.waveConfigs[h - 1 + s].gain, this.gridConfig.cellMg),
|
|
232
232
|
t
|
|
233
233
|
)
|
|
234
234
|
)));
|
|
@@ -240,7 +240,7 @@ let u = class extends Q {
|
|
|
240
240
|
this.createLeadHead(
|
|
241
241
|
i,
|
|
242
242
|
o.posY || (d + 1 + this.leadModel.line) * this.splitBlockHeight,
|
|
243
|
-
|
|
243
|
+
M(o.gain, this.gridConfig.cellMg),
|
|
244
244
|
t
|
|
245
245
|
)
|
|
246
246
|
)));
|
|
@@ -248,7 +248,7 @@ let u = class extends Q {
|
|
|
248
248
|
}
|
|
249
249
|
createLeadHead(e, t, i, s) {
|
|
250
250
|
const o = this.leadHeadConfig.leadHedeWidth / 4;
|
|
251
|
-
return i = s ? i / 2 : i, new
|
|
251
|
+
return i = s ? i / 2 : i, new R({
|
|
252
252
|
cursor: "",
|
|
253
253
|
shape: {
|
|
254
254
|
points: [
|
|
@@ -289,15 +289,15 @@ let u = class extends Q {
|
|
|
289
289
|
(a = this.splitLineGroup) == null || a.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup);
|
|
290
290
|
const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
|
|
291
291
|
if (this.splitPoint = e, this.leadModel.isSingleMode) {
|
|
292
|
-
const d =
|
|
292
|
+
const d = H(
|
|
293
293
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
294
294
|
this.gridConfig.cellMg,
|
|
295
295
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
296
|
-
), h =
|
|
296
|
+
), h = O(
|
|
297
297
|
Math.ceil(this.splitPoint / (d || 1)) || 0,
|
|
298
298
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0
|
|
299
|
-
),
|
|
300
|
-
this.splitPoint =
|
|
299
|
+
), m = parseInt(`${h / 1e3 % 60}`, 10);
|
|
300
|
+
this.splitPoint = m * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (d || 0);
|
|
301
301
|
}
|
|
302
302
|
let t = 0, i = 0, s = 0, o = 0;
|
|
303
303
|
for (let d = 1; d <= this.leadModel.column - 1; d++) {
|
|
@@ -310,7 +310,7 @@ let u = class extends Q {
|
|
|
310
310
|
continue e;
|
|
311
311
|
if ((this.waveConfigs || [])[h - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[h - 1 + i].posX), s = (this.waveConfigs || [])[h - 1 + i].leadIdx, s === void 0)
|
|
312
312
|
break;
|
|
313
|
-
o =
|
|
313
|
+
o = M((this.waveConfigs || [])[h - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[h - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (r = this.splitLineGroup) == null || r.add(
|
|
314
314
|
this.creatSplitLine(
|
|
315
315
|
t,
|
|
316
316
|
((this.waveConfigs || [])[h - 1 + i].posY || h * this.splitBlockHeight) - (o || 0) / 2 * 0.5,
|
|
@@ -329,7 +329,7 @@ let u = class extends Q {
|
|
|
329
329
|
(l = this.sceneIns) == null || l.add(this.splitLineGroup);
|
|
330
330
|
}
|
|
331
331
|
creatSplitLine(e, t, i, s) {
|
|
332
|
-
return new
|
|
332
|
+
return new z({
|
|
333
333
|
cursor: "",
|
|
334
334
|
shape: {
|
|
335
335
|
x1: 0 + e,
|
|
@@ -353,13 +353,13 @@ let u = class extends Q {
|
|
|
353
353
|
fontFamily: this.fontFamily
|
|
354
354
|
}, t = new S({
|
|
355
355
|
cursor: "",
|
|
356
|
-
style:
|
|
356
|
+
style: W({
|
|
357
357
|
text: "(s)",
|
|
358
358
|
x: this.leadHeadConfig.leadHedeWidth / 2 - 8,
|
|
359
359
|
y: this.canvasContainer.height - 25
|
|
360
360
|
}, e)
|
|
361
361
|
}), i = new S({
|
|
362
|
-
style:
|
|
362
|
+
style: W({
|
|
363
363
|
text: this.rulerConfig.renderText || `${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,
|
|
364
364
|
x: this.leadHeadConfig.leadHedeWidth / 2 + 20,
|
|
365
365
|
y: this.canvasContainer.height - this.ruleH
|
|
@@ -373,11 +373,11 @@ let u = class extends Q {
|
|
|
373
373
|
return;
|
|
374
374
|
const t = this.dataTotalTimes / 1e3;
|
|
375
375
|
let i = this.leadHeadConfig.leadHedeWidth, s = 0, o = t;
|
|
376
|
-
const a =
|
|
376
|
+
const a = H(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
|
|
377
377
|
if (this.leadModel.isContinuous)
|
|
378
378
|
o = t * 5;
|
|
379
379
|
else if (!this.leadModel.add && a) {
|
|
380
|
-
const l =
|
|
380
|
+
const l = P(this.splitPoint, a), d = O(l, this.rulerConfig.sampleRate || 0) / 1e3;
|
|
381
381
|
o = e + d;
|
|
382
382
|
}
|
|
383
383
|
for (let l = e; l <= o; l = +(l + 0.1).toFixed(1))
|
|
@@ -391,7 +391,7 @@ let u = class extends Q {
|
|
|
391
391
|
fontFamily: this.fontFamily,
|
|
392
392
|
fill: "#FF0080"
|
|
393
393
|
}
|
|
394
|
-
}))) : s = this.canvasContainer.height - 5, (r = this.rulerGroup) == null || r.add(new
|
|
394
|
+
}))) : s = this.canvasContainer.height - 5, (r = this.rulerGroup) == null || r.add(new z({
|
|
395
395
|
cursor: "",
|
|
396
396
|
shape: {
|
|
397
397
|
x1: i,
|
|
@@ -414,11 +414,11 @@ let u = class extends Q {
|
|
|
414
414
|
let e = 0, t = 0;
|
|
415
415
|
const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
|
|
416
416
|
let s = this.slidingWindowInfo.startInd || 0, o = this.slidingWindowInfo.endInd || 0;
|
|
417
|
-
const a =
|
|
417
|
+
const a = H(
|
|
418
418
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
419
419
|
this.gridConfig.cellMg,
|
|
420
420
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
421
|
-
), n =
|
|
421
|
+
), n = M(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), r = [], f = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
|
|
422
422
|
for (let l = 0; l < 1; l++) {
|
|
423
423
|
e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
|
|
424
424
|
for (let d = 1; d <= f; d++)
|
|
@@ -428,7 +428,7 @@ let u = class extends Q {
|
|
|
428
428
|
endInd: o,
|
|
429
429
|
step: a,
|
|
430
430
|
sens: n,
|
|
431
|
-
data: i.slice(s, o).map((h,
|
|
431
|
+
data: i.slice(s, o).map((h, m) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? L(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, h, n / 2) : L(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, h, n)).map((h, m) => [m * (a || 0), -h])
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
return r;
|
|
@@ -436,15 +436,15 @@ let u = class extends Q {
|
|
|
436
436
|
createSingleWaveFrom() {
|
|
437
437
|
var n, r, f;
|
|
438
438
|
(n = this.singleWaveFromGroup) == null || n.removeAll();
|
|
439
|
-
let e = this.getRednerSinglePoints(), t =
|
|
439
|
+
let e = this.getRednerSinglePoints(), t = O(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0);
|
|
440
440
|
const i = t;
|
|
441
441
|
let s = 0, o = 0, a = 0;
|
|
442
442
|
for (let l = 0; l < e.length && !(e[l].pos[1] > this.drawArea.height + this.bottomAreaHeight); l++)
|
|
443
|
-
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (s = parseInt(`${t / 1e3 / 60}`, 10), o = parseInt(`${t / 1e3 % 60}`, 10), s = o === 60 ? s += 1 : s, s = s === 0 ? "00" : s < 10 ? `0${s}` : s, o = o === 0 || o === 60 ? "00" : o < 10 ? `0${o}` : o, (r = this.singleWaveFromGroup) == null || r.add(new
|
|
443
|
+
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (s = parseInt(`${t / 1e3 / 60}`, 10), o = parseInt(`${t / 1e3 % 60}`, 10), s = o === 60 ? s += 1 : s, s = s === 0 ? "00" : s < 10 ? `0${s}` : s, o = o === 0 || o === 60 ? "00" : o < 10 ? `0${o}` : o, (r = this.singleWaveFromGroup) == null || r.add(new R({
|
|
444
444
|
cursor: "",
|
|
445
445
|
name: this.singleModeConfig.defaultSelect + "_" + l,
|
|
446
446
|
shape: {
|
|
447
|
-
points: e[l].data.map(([d, h],
|
|
447
|
+
points: e[l].data.map(([d, h], m) => isNaN(h) ? (a === 0 && (a = m - 1, a = a < 0 ? 0 : a), [
|
|
448
448
|
e[l].data[a][0] + e[l].pos[0],
|
|
449
449
|
e[l].data[a][1] + e[l].pos[1]
|
|
450
450
|
]) : (a = 0, [
|
|
@@ -478,14 +478,14 @@ let u = class extends Q {
|
|
|
478
478
|
this.singleWaveDataCopy = e, e = null;
|
|
479
479
|
}
|
|
480
480
|
drawLoopArrow(e = 0) {
|
|
481
|
-
var h,
|
|
481
|
+
var d, h, m, A, F, x, b, B, D, I, v, g;
|
|
482
482
|
if (this.drawLoopArrowStartPosIdx = e, !this.heartFight.isShow)
|
|
483
483
|
return;
|
|
484
484
|
this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect] || null, this.drawHeardBeatLine());
|
|
485
485
|
let t = 0, i = 0;
|
|
486
486
|
if (this.leadModel.add) {
|
|
487
|
-
const
|
|
488
|
-
i = this.loopArrowY.add - (
|
|
487
|
+
const C = M(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain, this.gridConfig.cellMg);
|
|
488
|
+
i = this.loopArrowY.add - (C || 0) - this.splitBlockHeight / 3.5;
|
|
489
489
|
} else
|
|
490
490
|
i = 20;
|
|
491
491
|
let s = 0, o = 0;
|
|
@@ -494,19 +494,19 @@ let u = class extends Q {
|
|
|
494
494
|
fill: "red",
|
|
495
495
|
fontFamily: this.fontFamily
|
|
496
496
|
};
|
|
497
|
-
let n = 0, r = 0
|
|
498
|
-
const
|
|
497
|
+
let n = 0, r = 0;
|
|
498
|
+
const f = H(
|
|
499
499
|
this.waveConfigs[this.heartFight.showIdxPai].speed,
|
|
500
500
|
this.gridConfig.cellMg,
|
|
501
501
|
this.waveConfigs[this.heartFight.showIdxPai].sampleRate
|
|
502
502
|
);
|
|
503
|
-
let
|
|
504
|
-
for (let
|
|
505
|
-
const p = this.heartBeatPosition[this.heartFight.showIdxPai][
|
|
506
|
-
if (
|
|
503
|
+
let l = 0;
|
|
504
|
+
for (let C = 0; C < (this.heartBeatPosition[this.heartFight.showIdxPai] || []).length; C++) {
|
|
505
|
+
const p = this.heartBeatPosition[this.heartFight.showIdxPai][C];
|
|
506
|
+
if (l = ((p == null ? void 0 : p.position) || 0) - e, !(e > ((p == null ? void 0 : p.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && l > (this.slidingWindowInfo.points || 0)) && !(this.leadModel.isSingleMode && l > (this.slidingWindowInfo.points || 0))) {
|
|
507
507
|
if (((p == null ? void 0 : p.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
|
|
508
508
|
break;
|
|
509
|
-
t =
|
|
509
|
+
t = l * (f || 0) + this.leadHeadConfig.leadHedeWidth - 8.5, o = 0, (m = this.arrowGroup) == null || m.add(new ae({
|
|
510
510
|
name: "arrow_box",
|
|
511
511
|
shape: {
|
|
512
512
|
points: [
|
|
@@ -521,47 +521,47 @@ let u = class extends Q {
|
|
|
521
521
|
]
|
|
522
522
|
},
|
|
523
523
|
style: {
|
|
524
|
-
fill: ((
|
|
524
|
+
fill: ((h = (d = this.currentHeardBeat) == null ? void 0 : d.heardBeat) == null ? void 0 : h.index) === (p == null ? void 0 : p.index) ? "blue" : "#ccc"
|
|
525
525
|
},
|
|
526
|
-
onclick: (
|
|
527
|
-
var
|
|
528
|
-
!this.heartFight.mode && !this.heartFight.isClickArrow || (
|
|
526
|
+
onclick: (N) => {
|
|
527
|
+
var j;
|
|
528
|
+
!this.heartFight.mode && !this.heartFight.isClickArrow || (N.target.attr({
|
|
529
529
|
style: { fill: "blue" }
|
|
530
|
-
}), (
|
|
531
|
-
|
|
530
|
+
}), (j = this.arrowGroup) == null || j.children().filter((G) => G.name === "arrow_box").forEach((G) => {
|
|
531
|
+
G.id !== N.target.id && G.attr({
|
|
532
532
|
style: { fill: "#ccc" }
|
|
533
533
|
});
|
|
534
|
-
}), this.arrowLoopClick(p,
|
|
534
|
+
}), this.arrowLoopClick(p, N.target));
|
|
535
535
|
}
|
|
536
|
-
})), this.heartFight.heartrate && (
|
|
537
|
-
Math.abs((p == null ? void 0 : p.position) * (
|
|
536
|
+
})), this.heartFight.heartrate && (n = p == null ? void 0 : p.heartrate, this.heartFight.isHeartRateCalculatedBasedOnInterval && C !== 0 && (r = te(
|
|
537
|
+
Math.abs((p == null ? void 0 : p.position) * (f || 0) - this.heartBeatPosition[this.heartFight.showIdxPai][C - 1].position * (f || 0)),
|
|
538
538
|
this.waveConfigs[this.heartFight.showIdxPai].speed,
|
|
539
539
|
this.gridConfig.cellMg,
|
|
540
540
|
1
|
|
541
|
-
),
|
|
541
|
+
), n = r !== 0 && ie(r) || 0), s = ((A = this.AssistCtx) == null ? void 0 : A.measureText(`${n || ""}`).width) || 0, (F = this.arrowGroup) == null || F.add(new S({
|
|
542
542
|
cursor: "",
|
|
543
|
-
style:
|
|
543
|
+
style: W({
|
|
544
544
|
x: 4 + t - s * 1.4,
|
|
545
545
|
y: o + i,
|
|
546
|
-
text: `${
|
|
546
|
+
text: `${n || ""}`
|
|
547
547
|
}, a)
|
|
548
|
-
})), o += 12), this.heartFight.interval && (s = ((
|
|
548
|
+
})), o += 12), this.heartFight.interval && (s = ((x = this.AssistCtx) == null ? void 0 : x.measureText(`${(p == null ? void 0 : p.interval) || ""}`).width) || 0, (b = this.arrowGroup) == null || b.add(new S({
|
|
549
549
|
cursor: "",
|
|
550
|
-
style:
|
|
550
|
+
style: W({
|
|
551
551
|
x: 4 + t - s * 1.5,
|
|
552
552
|
y: o + i,
|
|
553
553
|
text: `${(p == null ? void 0 : p.interval) || ""}`
|
|
554
554
|
}, a)
|
|
555
|
-
})), o += 12), this.heartFight.qrstCompany && (s = ((
|
|
555
|
+
})), o += 12), this.heartFight.qrstCompany && (s = ((B = this.AssistCtx) == null ? void 0 : B.measureText(`${(p == null ? void 0 : p.qrstCompany) || ""}`).width) || 0, (D = this.arrowGroup) == null || D.add(new S({
|
|
556
556
|
cursor: "",
|
|
557
|
-
style:
|
|
557
|
+
style: W({
|
|
558
558
|
x: 4 + t - s * 1.5,
|
|
559
559
|
y: o + i,
|
|
560
560
|
text: `${(p == null ? void 0 : p.qrstCompany) || ""}`
|
|
561
561
|
}, a)
|
|
562
|
-
})), o += 12), this.heartFight.telectricalaxis && (s = ((
|
|
562
|
+
})), o += 12), this.heartFight.telectricalaxis && (s = ((I = this.AssistCtx) == null ? void 0 : I.measureText(`${(p == null ? void 0 : p.telectricalaxis) || ""}`).width) || 0, (v = this.arrowGroup) == null || v.add(new S({
|
|
563
563
|
cursor: "",
|
|
564
|
-
style:
|
|
564
|
+
style: W({
|
|
565
565
|
x: 4 + t - s * 1.5,
|
|
566
566
|
y: o + i,
|
|
567
567
|
text: `${(p == null ? void 0 : p.telectricalaxis) || ""}`
|
|
@@ -569,13 +569,13 @@ let u = class extends Q {
|
|
|
569
569
|
})));
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
(
|
|
572
|
+
(g = this.sceneIns) == null || g.add(this.arrowGroup);
|
|
573
573
|
}
|
|
574
574
|
arrowLoopClick(e, t) {
|
|
575
|
-
this.$emit("notifyHeardBeat",
|
|
575
|
+
this.$emit("notifyHeardBeat", oe.clone(e)), this.currentHeardBeat.heardBeat = e, this.currentHeardBeat.ele = t, this.drawHeardBeatLine();
|
|
576
576
|
}
|
|
577
577
|
drawHeardBeatLine(e = 0) {
|
|
578
|
-
var o, a, n, r, f, l, d, h,
|
|
578
|
+
var o, a, n, r, f, l, d, h, m, A, F, x, b, B, D;
|
|
579
579
|
if (!this.currentHeardBeat.heardBeat)
|
|
580
580
|
return;
|
|
581
581
|
(o = this.heardBeatLineGroup) == null || o.removeAll(), (a = this.sceneIns) == null || a.remove(this.heardBeatLineGroup);
|
|
@@ -583,15 +583,15 @@ let u = class extends Q {
|
|
|
583
583
|
if (this.leadModel.isSingleMode) {
|
|
584
584
|
let I = this.getRednerSinglePoints();
|
|
585
585
|
e:
|
|
586
|
-
for (let
|
|
587
|
-
if (
|
|
586
|
+
for (let v = 0; v < I.length; v++) {
|
|
587
|
+
if (v >= 1 || this.leadNames[this.singleModeConfig.defaultSelect] === "M")
|
|
588
588
|
break e;
|
|
589
589
|
if ((n = this.analyseValues[this.singleModeConfig.defaultSelect]) != null && n[this.currentHeardBeat.heardBeat.index])
|
|
590
590
|
t = ((l = (f = this.analyseValues[this.singleModeConfig.defaultSelect]) == null ? void 0 : f[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : l.KeyPosByBeat) || t;
|
|
591
591
|
else {
|
|
592
|
-
let g = this.analyseValues.find((
|
|
593
|
-
var
|
|
594
|
-
return (
|
|
592
|
+
let g = this.analyseValues.find((C) => {
|
|
593
|
+
var p;
|
|
594
|
+
return (p = C[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : p.KeyPosByBeat;
|
|
595
595
|
});
|
|
596
596
|
if (!g)
|
|
597
597
|
break e;
|
|
@@ -599,47 +599,47 @@ let u = class extends Q {
|
|
|
599
599
|
}
|
|
600
600
|
for (const g in t)
|
|
601
601
|
if (this.heardBeatLineKeys.includes(g)) {
|
|
602
|
-
if (i = (t[g] - this.slidingWindowInfo.startInd) * (I[
|
|
602
|
+
if (i = (t[g] - this.slidingWindowInfo.startInd) * (I[v].step || 0), this.isLeadOff(v) || this.isLeadDel(v))
|
|
603
603
|
continue;
|
|
604
604
|
if (!this.leadModel.isContinuous && t[g] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0))
|
|
605
605
|
break e;
|
|
606
|
-
s = I[
|
|
606
|
+
s = I[v], (d = this.heardBeatLineGroup) == null || d.add(this.createHeardBeatLine(s.pos[0] + i, s.pos[1]));
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
I = null;
|
|
610
610
|
} else {
|
|
611
|
-
let I = this.getRednerPoints(),
|
|
611
|
+
let I = this.getRednerPoints(), v = this.getAddRednerPoints();
|
|
612
612
|
e:
|
|
613
613
|
for (let g = 0; g < I.length; g++) {
|
|
614
|
-
t = ((
|
|
615
|
-
for (const
|
|
616
|
-
if (this.heardBeatLineKeys.includes(
|
|
617
|
-
if (i = (t[
|
|
614
|
+
t = ((m = (h = this.analyseValues[g]) == null ? void 0 : h[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : m.KeyPosByBeat) || t;
|
|
615
|
+
for (const C in t)
|
|
616
|
+
if (this.heardBeatLineKeys.includes(C) && Object.prototype.hasOwnProperty.call(t, C)) {
|
|
617
|
+
if (i = (t[C] - this.slidingWindowInfo.startInd) * (I[g].step || 0), this.isLeadOff(g) || this.isLeadDel(g))
|
|
618
618
|
continue;
|
|
619
|
-
if (e > t[
|
|
619
|
+
if (e > t[C] || !this.leadModel.isContinuous && t[C] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (s = I[g], this.leadModel.isContinuous && g > this.leadModel.line - 1))
|
|
620
620
|
break e;
|
|
621
|
-
(
|
|
621
|
+
(A = this.heardBeatLineGroup) == null || A.add(this.createHeardBeatLine(s.pos[0] + i, s.pos[1]));
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
e:
|
|
625
|
-
for (let g = 0; g <
|
|
626
|
-
if (!!((
|
|
627
|
-
t = ((
|
|
628
|
-
for (const
|
|
629
|
-
if (this.heardBeatLineKeys.includes(
|
|
630
|
-
if (i = (t[
|
|
625
|
+
for (let g = 0; g < v.length; g++)
|
|
626
|
+
if (!!((F = this.analyseValues[g]) != null && F[this.currentHeardBeat.heardBeat.index])) {
|
|
627
|
+
t = ((b = (x = this.analyseValues[g]) == null ? void 0 : x[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : b.KeyPosByBeat) || t;
|
|
628
|
+
for (const C in t)
|
|
629
|
+
if (this.heardBeatLineKeys.includes(C)) {
|
|
630
|
+
if (i = (t[C] - this.slidingWindowInfo.startInd) * (v[g].step || 0), this.isLeadOff(this.longLeadConfig.leadIdxs[g]) && this.isLeadDel(this.longLeadConfig.leadIdxs[g]))
|
|
631
631
|
continue;
|
|
632
|
-
if (e > t[
|
|
632
|
+
if (e > t[C])
|
|
633
633
|
break e;
|
|
634
|
-
s =
|
|
634
|
+
s = v[g], (B = this.heardBeatLineGroup) == null || B.add(this.createHeardBeatLine(s.pos[0] + i, s.pos[1]));
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
I = null,
|
|
637
|
+
I = null, v = null;
|
|
638
638
|
}
|
|
639
|
-
(
|
|
639
|
+
(D = this.sceneIns) == null || D.add(this.heardBeatLineGroup), t = null;
|
|
640
640
|
}
|
|
641
641
|
createHeardBeatLine(e, t) {
|
|
642
|
-
return new
|
|
642
|
+
return new z({
|
|
643
643
|
cursor: "",
|
|
644
644
|
shape: {
|
|
645
645
|
x1: e,
|
|
@@ -661,11 +661,11 @@ let u = class extends Q {
|
|
|
661
661
|
const e = [];
|
|
662
662
|
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, o = [], a = 0, n = 0;
|
|
663
663
|
for (let r = 0; r < this.leadModel.add; r++)
|
|
664
|
-
s = this.longLeadConfig.leadIdxs[r], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, a =
|
|
664
|
+
s = this.longLeadConfig.leadIdxs[r], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, a = H(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = M(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (r + this.leadModel.line + 1) * this.splitBlockHeight, o = this.waveLists[s] || [], r === 0 && (this.loopArrowY.add = i), e.push({
|
|
665
665
|
pos: [t, i],
|
|
666
666
|
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
667
667
|
endInd: this.addSlidingWindowInfo.endInd || 0,
|
|
668
|
-
data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((f, l) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ?
|
|
668
|
+
data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((f, l) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? L(this.waveConfigs[s].sensitivity, f, n / 2) : L(this.waveConfigs[s].sensitivity, f, n)).map((f, l) => [l * (a || 0), -f]),
|
|
669
669
|
sens: n,
|
|
670
670
|
step: a
|
|
671
671
|
}));
|
|
@@ -675,7 +675,7 @@ let u = class extends Q {
|
|
|
675
675
|
var i;
|
|
676
676
|
let e = this.getAddRednerPoints(), t = 0;
|
|
677
677
|
for (let s = 0; s < e.length; s++)
|
|
678
|
-
this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new
|
|
678
|
+
this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new R({
|
|
679
679
|
cursor: "",
|
|
680
680
|
name: this.longLeadConfig.leadIdxs[s] + "_" + s,
|
|
681
681
|
shape: {
|
|
@@ -703,13 +703,13 @@ let u = class extends Q {
|
|
|
703
703
|
for (let l = 0; l < this.leadModel.column; l++) {
|
|
704
704
|
e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && l > 0 && (n = r, r = n + (this.slidingWindowInfo.points || 0));
|
|
705
705
|
for (let d = 1; d <= this.leadModel.line && (t = d * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); d++)
|
|
706
|
-
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o =
|
|
706
|
+
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o = H(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), a = M(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (d === 1 && (this.loopArrowY.rowAndCol = t), f.push({
|
|
707
707
|
pos: [e, t],
|
|
708
708
|
startInd: n,
|
|
709
709
|
endInd: r,
|
|
710
710
|
sens: a,
|
|
711
711
|
step: o,
|
|
712
|
-
data: s.slice(n, r).map((h,
|
|
712
|
+
data: s.slice(n, r).map((h, m) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? L(this.waveConfigs[i].sensitivity, h, a / 2) : L(this.waveConfigs[i].sensitivity, h, a)).map((h, m) => [m * (o || 0), -h])
|
|
713
713
|
}), i++);
|
|
714
714
|
}
|
|
715
715
|
return f;
|
|
@@ -719,7 +719,7 @@ let u = class extends Q {
|
|
|
719
719
|
(s = this.rowAndColwaveFromGroup) == null || s.removeAll();
|
|
720
720
|
let e = this.getRednerPoints(), t = 0, i = 0;
|
|
721
721
|
for (let a = 0; a < e.length; a++)
|
|
722
|
-
t = this.waveConfigs[a].leadIdx || 0, this.isLeadDel(t) || (o = this.rowAndColwaveFromGroup) == null || o.add(new
|
|
722
|
+
t = this.waveConfigs[a].leadIdx || 0, this.isLeadDel(t) || (o = this.rowAndColwaveFromGroup) == null || o.add(new R({
|
|
723
723
|
cursor: "",
|
|
724
724
|
name: a + "_" + a,
|
|
725
725
|
shape: {
|
|
@@ -755,7 +755,7 @@ let u = class extends Q {
|
|
|
755
755
|
},
|
|
756
756
|
oncontextmenu: (n) => {
|
|
757
757
|
n.event.preventDefault(), this.$emit("notiifyLeadName", {
|
|
758
|
-
event:
|
|
758
|
+
event: k(W({}, n), {
|
|
759
759
|
name: this.leadNames[e],
|
|
760
760
|
idx: e
|
|
761
761
|
}),
|
|
@@ -764,7 +764,7 @@ let u = class extends Q {
|
|
|
764
764
|
},
|
|
765
765
|
onclick: (n) => {
|
|
766
766
|
this.$emit("notiifyLeadName", {
|
|
767
|
-
event:
|
|
767
|
+
event: k(W({}, n), {
|
|
768
768
|
name: this.leadNames[e],
|
|
769
769
|
idx: e
|
|
770
770
|
}),
|
|
@@ -795,7 +795,7 @@ let u = class extends Q {
|
|
|
795
795
|
this.activeLeadIdx = +o[0];
|
|
796
796
|
const a = +o[1];
|
|
797
797
|
let n = 0, r = 0, f = 0, l = 0, d = 0;
|
|
798
|
-
t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[a].pos[0], r = this.singleWaveDataCopy[a].startInd, f =
|
|
798
|
+
t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[a].pos[0], r = this.singleWaveDataCopy[a].startInd, f = P(n, this.singleWaveDataCopy[a].step || 1), l = this.singleWaveDataCopy[a].sens, d = this.singleWaveDataCopy[a].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[a].pos[0], r = this.waveDataCopy[a].startInd || 0, f = P(n, this.waveDataCopy[a].step || 1), l = this.waveDataCopy[a].sens, d = this.waveDataCopy[a].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[a].pos[0], r = this.addWaveDataCopy[a].startInd || 0, f = P(n, this.addWaveDataCopy[a].step || 1), l = this.addWaveDataCopy[a].sens, d = this.addWaveDataCopy[a].step), f += r, this.$emit("notifyActiveEnlargr", {
|
|
799
799
|
sens: l,
|
|
800
800
|
step: d,
|
|
801
801
|
activeLeadIdx: this.activeLeadIdx,
|
|
@@ -811,7 +811,7 @@ let u = class extends Q {
|
|
|
811
811
|
t.type === "horizontal" && (t.scrollLeft = t.scrollLeft || 0, this.scrollCommon(t.scrollLeft));
|
|
812
812
|
}
|
|
813
813
|
scrollCommon(e) {
|
|
814
|
-
const t =
|
|
814
|
+
const t = P(e, this.publicStep || 1);
|
|
815
815
|
this.scrollWaveFrom(t), this.scrollRuler(t), this.scrollArrow(t), this.$emit("notifyScrollPointIdx", {
|
|
816
816
|
slidIdxs: t,
|
|
817
817
|
scrollLeft: e
|
|
@@ -844,7 +844,7 @@ let u = class extends Q {
|
|
|
844
844
|
scrollRuler(e) {
|
|
845
845
|
var i, s;
|
|
846
846
|
(i = this.rulerGroup) == null || i.removeAll(), (s = this.sceneIns) == null || s.remove(this.rulerGroup);
|
|
847
|
-
const t =
|
|
847
|
+
const t = O(this.leadModel.isSingleMode ? 0 : e, this.leadModel.publicSampleRate || 0) / 1e3;
|
|
848
848
|
this.drawRuler(t);
|
|
849
849
|
}
|
|
850
850
|
scrollArrow(e) {
|
|
@@ -1022,13 +1022,13 @@ c([
|
|
|
1022
1022
|
})
|
|
1023
1023
|
], u.prototype, "posStart", 2);
|
|
1024
1024
|
c([
|
|
1025
|
-
|
|
1025
|
+
T(200)
|
|
1026
1026
|
], u.prototype, "nativeScrollFunc", 1);
|
|
1027
1027
|
c([
|
|
1028
|
-
|
|
1028
|
+
T(200)
|
|
1029
1029
|
], u.prototype, "handleScroll", 1);
|
|
1030
1030
|
u = c([
|
|
1031
|
-
|
|
1031
|
+
Q({
|
|
1032
1032
|
name: "Methods"
|
|
1033
1033
|
})
|
|
1034
1034
|
], u);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty,k=Object.defineProperties;var j=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var R=(e,t,i)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,W=(e,t)=>{for(var i in t||(t={}))T.call(t,i)&&R(e,i,t[i]);if(O)for(var i of O(t))z.call(t,i)&&R(e,i,t[i]);return e},D=(e,t)=>k(e,j(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("vue"),$=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 C=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"),u=require("@costy-plus/utils"),g=require("zrender"),V=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function X(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=V(_),q=X(g);var E=Object.defineProperty,K=Object.getOwnPropertyDescriptor,w=(e,t,i,s)=>{for(var a=s>1?void 0:s?K(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&&E(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.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(60),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,r,f,l,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(r=this.rulerGroup)==null||r.removeAll(),(f=this.arrowGroup)==null||f.removeAll(),(l=this.heardBeatLineGroup)==null||l.removeAll(),(d=this.sceneIns)==null||d.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))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){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"});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.endInd<=t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.endInd}}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.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight-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=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=q.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var o,n,r,f,l;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup);let e="",t=!1,i=0,s=0;for(let d=0;d<=this.leadModel.column;d++){s=d*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+s])break e;!this.waveConfigs[h-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[h-1+s]||"",this.waveConfigs[h-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[h-1+s].posX?this.waveConfigs[h-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((r=this.leadHeadGroup)==null||r.add(this.createLeadHead(i,this.waveConfigs[h-1+s].posY||h*this.splitBlockHeight,u.getSens(this.waveConfigs[h-1+s].gain,this.gridConfig.cellMg),t))))}}let a=null;for(let d=0;d<this.leadModel.add;d++)!this.waveConfigs[this.longLeadConfig.leadIdxs[d]]||(a=this.waveConfigs[this.longLeadConfig.leadIdxs[d]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]],t=!1,a.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=a.posX?a.posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((f=this.leadHeadGroup)==null||f.add(this.createLeadHead(i,a.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t))));a=null,(l=this.sceneIns)==null||l.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,f,l;(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 d=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),h=u.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${h/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(d||0)}let t=0,i=0,s=0,a=0;for(let d=1;d<=this.leadModel.column-1;d++){t=d*e+this.leadHeadConfig.leadHedeWidth,i=d*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+i])break e;if((this.waveConfigs||[])[h-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[h-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[h-1+i].posX),s=(this.waveConfigs||[])[h-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[h-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[h-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)*.5,a))}}(l=this.sceneIns)==null||l.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:W({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:W({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,f;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const l=u.getPointIdxForPx(this.splitPoint,o),d=u.getDataLenTimes(l,this.rulerConfig.sampleRate||0)/1e3;a=e+d}for(let l=e;l<=a;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:l+"",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}}));(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(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=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],f=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=f;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((h,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n)).map((h,m)=>[m*(o||0),-h])})}return r}createSingleWaveFrom(){var n,r,f;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=0,o=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(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+"_"+l,shape:{points:e[l].data.map(([d,h],m)=>isNaN(h)?(o===0&&(o=m-1,o=o<0?0:o),[e[l].data[o][0]+e[l].pos[0],e[l].data[o][1]+e[l].pos[1]]):(o=0,[d+e[l].pos[0],h+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:d=>{this.onDbClickWaveFrom(d,"single")}})),t/1e3<this.dataTotalTimes&&((f=this.singleWaveFromGroup)==null||f.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),l>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[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var h,m,H,M,L,x,F,P,y,v,c,I;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const S=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(S||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let n=0,r=0,f=0;const l=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0;for(let S=0;S<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;S++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][S];if(d=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=d*(l||0)+this.leadHeadConfig.leadHedeWidth-8.5,a=0,(H=this.arrowGroup)==null||H.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[13+t,0+i],[13+t,10+i],[17+t,10+i],[8.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((m=(h=this.currentHeardBeat)==null?void 0:h.heardBeat)==null?void 0:m.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:b=>{var B;!this.heartFight.mode&&!this.heartFight.isClickArrow||(b.target.attr({style:{fill:"blue"}}),(B=this.arrowGroup)==null||B.children().filter(A=>A.name==="arrow_box").forEach(A=>{A.id!==b.target.id&&A.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,b.target))}})),this.heartFight.heartrate&&(r=p==null?void 0:p.heartrate,this.heartFight.isHeartRateCalculatedBasedOnInterval&&S!==0&&(f=u.calcMs(Math.abs((p==null?void 0:p.position)*(l||0)-n),this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,1),r=f!==0&&u.calcBpm(f)||0),n=(p==null?void 0:p.position)*(l||0),s=((M=this.AssistCtx)==null?void 0:M.measureText(`${r||""}`).width)||0,(L=this.arrowGroup)==null||L.add(new g.Text({cursor:"",style:W({x:4+t-s*1.4,y:a+i,text:`${r||""}`},o)})),a+=12),this.heartFight.interval&&(s=((x=this.AssistCtx)==null?void 0:x.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(F=this.arrowGroup)==null||F.add(new g.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((P=this.AssistCtx)==null?void 0:P.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(y=this.arrowGroup)==null||y.add(new g.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((v=this.AssistCtx)==null?void 0:v.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(c=this.arrowGroup)==null||c.add(new g.Text({cursor:"",style:W({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},o)})))}}(I=this.sceneIns)==null||I.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,f,l,d,h,m,H,M,L,x,F,P;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 y=this.getRednerSinglePoints();e:for(let v=0;v<y.length;v++){if(v>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((l=(f=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:f[this.currentHeardBeat.heardBeat.index])==null?void 0:l.KeyPosByBeat)||t;else{let c=this.analyseValues.find(I=>{var S;return(S=I[this.currentHeardBeat.heardBeat.index])==null?void 0:S.KeyPosByBeat});if(!c)break e;c&&(t=(r=c[this.currentHeardBeat.heardBeat.index])==null?void 0:r.KeyPosByBeat),c=null}for(const c in t)if(this.heardBeatLineKeys.includes(c)){if(i=(t[c]-this.slidingWindowInfo.startInd)*(y[v].step||0),this.isLeadOff(v)||this.isLeadDel(v))continue;if(!this.leadModel.isContinuous&&t[c]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=y[v],(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}y=null}else{let y=this.getRednerPoints(),v=this.getAddRednerPoints();e:for(let c=0;c<y.length;c++){t=((m=(h=this.analyseValues[c])==null?void 0:h[this.currentHeardBeat.heardBeat.index])==null?void 0:m.KeyPosByBeat)||t;for(const I in t)if(this.heardBeatLineKeys.includes(I)&&Object.prototype.hasOwnProperty.call(t,I)){if(i=(t[I]-this.slidingWindowInfo.startInd)*(y[c].step||0),this.isLeadOff(c)||this.isLeadDel(c))continue;if(e>t[I]||!this.leadModel.isContinuous&&t[I]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=y[c],this.leadModel.isContinuous&&c>this.leadModel.line-1))break e;(H=this.heardBeatLineGroup)==null||H.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}e:for(let c=0;c<v.length;c++)if(!!((M=this.analyseValues[c])!=null&&M[this.currentHeardBeat.heardBeat.index])){t=((x=(L=this.analyseValues[c])==null?void 0:L[this.currentHeardBeat.heardBeat.index])==null?void 0:x.KeyPosByBeat)||t;for(const I in t)if(this.heardBeatLineKeys.includes(I)){if(i=(t[I]-this.slidingWindowInfo.startInd)*(v[c].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[c])&&this.isLeadDel(this.longLeadConfig.leadIdxs[c]))continue;if(e>t[I])break e;s=v[c],(F=this.heardBeatLineGroup)==null||F.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}y=null,v=null}(P=this.sceneIns)==null||P.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(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((f,l)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,f,n/2):u.getActualY(this.waveConfigs[s].sensitivity,f,n)).map((f,l)=>[l*(o||0),-f]),sens:n,step:o}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o],n)=>isNaN(o)?(t===0&&(t=n-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[a+e[s].pos[0],o+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const f=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let d=1;d<=this.leadModel.line&&(t=d*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));d++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),f.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((h,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,h,o/2):u.getActualY(this.waveConfigs[i].sensitivity,h,o)).map((h,m)=>[m*(a||0),-h])}),i++)}return f}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,r],f)=>isNaN(r)?(i===0&&(i=f-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")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),(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:D(W({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:D(W({},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}})))}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,f=0,l=0,d=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,f=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),l=this.singleWaveDataCopy[o].sens,d=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,f=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),l=this.waveDataCopy[o].sens,d=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,f=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),l=this.addWaveDataCopy[o].sens,d=this.addWaveDataCopy[o].step),f+=r,this.$emit("notifyActiveEnlargr",{sens:l,step:d,activeLeadIdx:this.activeLeadIdx,pointIdx:f})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,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,f])=>[r+t[n].pos[0],f+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,f])=>[r+i[n].pos[0],f+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};w([C.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);w([C.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"leadModel",2);w([C.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);w([C.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"gridConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);w([C.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);w([C.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);w([C.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);w([C.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);w([C.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);w([C.Prop({default:()=>0})],exports.default.prototype,"posStart",2);w([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);w([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=w([$.default({name:"Methods"})],exports.default);
|
|
1
|
+
"use strict";var N=Object.defineProperty,R=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var O=(e,t,i)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,S=(e,t)=>{for(var i in t||(t={}))j.call(t,i)&&O(e,i,t[i]);if(G)for(var i of G(t))T.call(t,i)&&O(e,i,t[i]);return e},b=(e,t)=>R(e,k(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const z=require("vue"),_=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 C=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"),D=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),$=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function V(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 X=$(z),Y=V(g);var q=Object.defineProperty,E=Object.getOwnPropertyDescriptor,w=(e,t,i,s)=>{for(var a=s>1?void 0:s?E(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&&q(t,i,a),a};exports.default=class extends X.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(60),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,r,f,l,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(r=this.rulerGroup)==null||r.removeAll(),(f=this.arrowGroup)==null||f.removeAll(),(l=this.heardBeatLineGroup)==null||l.removeAll(),(d=this.sceneIns)==null||d.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))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){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"});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.endInd<=t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=D.flattenDeep(this.waveLists);return{maxPoints:D.max(e)||0,minPoints:D.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight-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=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=Y.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var o,n,r,f,l;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup);let e="",t=!1,i=0,s=0;for(let d=0;d<=this.leadModel.column;d++){s=d*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+s])break e;!this.waveConfigs[h-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[h-1+s]||"",this.waveConfigs[h-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[h-1+s].posX?this.waveConfigs[h-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((r=this.leadHeadGroup)==null||r.add(this.createLeadHead(i,this.waveConfigs[h-1+s].posY||h*this.splitBlockHeight,u.getSens(this.waveConfigs[h-1+s].gain,this.gridConfig.cellMg),t))))}}let a=null;for(let d=0;d<this.leadModel.add;d++)!this.waveConfigs[this.longLeadConfig.leadIdxs[d]]||(a=this.waveConfigs[this.longLeadConfig.leadIdxs[d]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]],t=!1,a.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=a.posX?a.posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((f=this.leadHeadGroup)==null||f.add(this.createLeadHead(i,a.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t))));a=null,(l=this.sceneIns)==null||l.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,f,l;(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 d=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),h=u.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),v=parseInt(`${h/1e3%60}`,10);this.splitPoint=v*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(d||0)}let t=0,i=0,s=0,a=0;for(let d=1;d<=this.leadModel.column-1;d++){t=d*e+this.leadHeadConfig.leadHedeWidth,i=d*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+i])break e;if((this.waveConfigs||[])[h-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[h-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[h-1+i].posX),s=(this.waveConfigs||[])[h-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[h-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[h-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)*.5,a))}}(l=this.sceneIns)==null||l.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:S({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:S({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,f;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const l=u.getPointIdxForPx(this.splitPoint,o),d=u.getDataLenTimes(l,this.rulerConfig.sampleRate||0)/1e3;a=e+d}for(let l=e;l<=a;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:l+"",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}}));(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(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=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],f=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=f;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((h,v)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n)).map((h,v)=>[v*(o||0),-h])})}return r}createSingleWaveFrom(){var n,r,f;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=0,o=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(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+"_"+l,shape:{points:e[l].data.map(([d,h],v)=>isNaN(h)?(o===0&&(o=v-1,o=o<0?0:o),[e[l].data[o][0]+e[l].pos[0],e[l].data[o][1]+e[l].pos[1]]):(o=0,[d+e[l].pos[0],h+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:d=>{this.onDbClickWaveFrom(d,"single")}})),t/1e3<this.dataTotalTimes&&((f=this.singleWaveFromGroup)==null||f.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),l>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[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var d,h,v,W,M,H,L,x,F,y,I,c;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const m=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(m||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily};let n=0,r=0;const f=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let l=0;for(let m=0;m<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;m++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][m];if(l=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&l>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&l>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=l*(f||0)+this.leadHeadConfig.leadHedeWidth-8.5,a=0,(v=this.arrowGroup)==null||v.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[13+t,0+i],[13+t,10+i],[17+t,10+i],[8.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((h=(d=this.currentHeardBeat)==null?void 0:d.heardBeat)==null?void 0:h.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:A=>{var B;!this.heartFight.mode&&!this.heartFight.isClickArrow||(A.target.attr({style:{fill:"blue"}}),(B=this.arrowGroup)==null||B.children().filter(P=>P.name==="arrow_box").forEach(P=>{P.id!==A.target.id&&P.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,A.target))}})),this.heartFight.heartrate&&(n=p==null?void 0:p.heartrate,this.heartFight.isHeartRateCalculatedBasedOnInterval&&m!==0&&(r=u.calcMs(Math.abs((p==null?void 0:p.position)*(f||0)-this.heartBeatPosition[this.heartFight.showIdxPai][m-1].position*(f||0)),this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,1),n=r!==0&&u.calcBpm(r)||0),s=((W=this.AssistCtx)==null?void 0:W.measureText(`${n||""}`).width)||0,(M=this.arrowGroup)==null||M.add(new g.Text({cursor:"",style:S({x:4+t-s*1.4,y:a+i,text:`${n||""}`},o)})),a+=12),this.heartFight.interval&&(s=((H=this.AssistCtx)==null?void 0:H.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(L=this.arrowGroup)==null||L.add(new g.Text({cursor:"",style:S({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((x=this.AssistCtx)==null?void 0:x.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(F=this.arrowGroup)==null||F.add(new g.Text({cursor:"",style:S({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((y=this.AssistCtx)==null?void 0:y.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(I=this.arrowGroup)==null||I.add(new g.Text({cursor:"",style:S({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},o)})))}}(c=this.sceneIns)==null||c.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,f,l,d,h,v,W,M,H,L,x,F;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 y=this.getRednerSinglePoints();e:for(let I=0;I<y.length;I++){if(I>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((l=(f=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:f[this.currentHeardBeat.heardBeat.index])==null?void 0:l.KeyPosByBeat)||t;else{let c=this.analyseValues.find(m=>{var p;return(p=m[this.currentHeardBeat.heardBeat.index])==null?void 0:p.KeyPosByBeat});if(!c)break e;c&&(t=(r=c[this.currentHeardBeat.heardBeat.index])==null?void 0:r.KeyPosByBeat),c=null}for(const c in t)if(this.heardBeatLineKeys.includes(c)){if(i=(t[c]-this.slidingWindowInfo.startInd)*(y[I].step||0),this.isLeadOff(I)||this.isLeadDel(I))continue;if(!this.leadModel.isContinuous&&t[c]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=y[I],(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}y=null}else{let y=this.getRednerPoints(),I=this.getAddRednerPoints();e:for(let c=0;c<y.length;c++){t=((v=(h=this.analyseValues[c])==null?void 0:h[this.currentHeardBeat.heardBeat.index])==null?void 0:v.KeyPosByBeat)||t;for(const m in t)if(this.heardBeatLineKeys.includes(m)&&Object.prototype.hasOwnProperty.call(t,m)){if(i=(t[m]-this.slidingWindowInfo.startInd)*(y[c].step||0),this.isLeadOff(c)||this.isLeadDel(c))continue;if(e>t[m]||!this.leadModel.isContinuous&&t[m]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=y[c],this.leadModel.isContinuous&&c>this.leadModel.line-1))break e;(W=this.heardBeatLineGroup)==null||W.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}e:for(let c=0;c<I.length;c++)if(!!((M=this.analyseValues[c])!=null&&M[this.currentHeardBeat.heardBeat.index])){t=((L=(H=this.analyseValues[c])==null?void 0:H[this.currentHeardBeat.heardBeat.index])==null?void 0:L.KeyPosByBeat)||t;for(const m in t)if(this.heardBeatLineKeys.includes(m)){if(i=(t[m]-this.slidingWindowInfo.startInd)*(I[c].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[c])&&this.isLeadDel(this.longLeadConfig.leadIdxs[c]))continue;if(e>t[m])break e;s=I[c],(x=this.heardBeatLineGroup)==null||x.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}y=null,I=null}(F=this.sceneIns)==null||F.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(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((f,l)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,f,n/2):u.getActualY(this.waveConfigs[s].sensitivity,f,n)).map((f,l)=>[l*(o||0),-f]),sens:n,step:o}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o],n)=>isNaN(o)?(t===0&&(t=n-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[a+e[s].pos[0],o+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const f=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let d=1;d<=this.leadModel.line&&(t=d*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));d++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),f.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((h,v)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,h,o/2):u.getActualY(this.waveConfigs[i].sensitivity,h,o)).map((h,v)=>[v*(a||0),-h])}),i++)}return f}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,r],f)=>isNaN(r)?(i===0&&(i=f-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")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),(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:b(S({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:b(S({},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}})))}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,f=0,l=0,d=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,f=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),l=this.singleWaveDataCopy[o].sens,d=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,f=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),l=this.waveDataCopy[o].sens,d=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,f=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),l=this.addWaveDataCopy[o].sens,d=this.addWaveDataCopy[o].step),f+=r,this.$emit("notifyActiveEnlargr",{sens:l,step:d,activeLeadIdx:this.activeLeadIdx,pointIdx:f})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,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,f])=>[r+t[n].pos[0],f+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,f])=>[r+i[n].pos[0],f+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};w([C.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);w([C.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);w([C.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);w([C.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"leadModel",2);w([C.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);w([C.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);w([C.Prop({required:!0})],exports.default.prototype,"gridConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);w([C.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);w([C.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);w([C.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);w([C.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);w([C.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);w([C.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);w([C.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);w([C.Prop({default:()=>0})],exports.default.prototype,"posStart",2);w([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);w([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=w([_.default({name:"Methods"})],exports.default);
|