costy-plus 1.0.47-0 → 1.0.48-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/src/CommonWaveForm/index.vue.d.ts +1 -0
- package/dist/es/src/CommonWaveForm/index.vue_vue_type_script_lang.js +38 -32
- package/dist/es/src/CommonWaveForm/method.d.ts +3 -0
- package/dist/es/src/CommonWaveForm/method.js +130 -114
- package/dist/lib/src/CommonWaveForm/index.vue.d.ts +1 -0
- package/dist/lib/src/CommonWaveForm/index.vue_vue_type_script_lang.js +1 -1
- package/dist/lib/src/CommonWaveForm/method.d.ts +3 -0
- package/dist/lib/src/CommonWaveForm/method.js +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ declare class CommonWaveForm extends CommonWaveForm_base {
|
|
|
11
11
|
protected watchWidth(): void;
|
|
12
12
|
protected watchHeight(): void;
|
|
13
13
|
protected watchLongLeadConfig(): void;
|
|
14
|
+
protected watchPosStart(): void;
|
|
14
15
|
protected destroyed(): void;
|
|
15
16
|
protected repaint(): void;
|
|
16
17
|
created(): void;
|
|
@@ -9,12 +9,12 @@ import u from "../MagnifierWave/index.js";
|
|
|
9
9
|
import f from "../ParallelRuler/index2.js";
|
|
10
10
|
import g from "../BackgroundGrid/index2.js";
|
|
11
11
|
import w from "./method.js";
|
|
12
|
-
var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor,
|
|
13
|
-
for (var o =
|
|
14
|
-
(p =
|
|
15
|
-
return
|
|
12
|
+
var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (t, r, n, s) => {
|
|
13
|
+
for (var o = s > 1 ? void 0 : s ? v(r, n) : r, h = t.length - 1, p; h >= 0; h--)
|
|
14
|
+
(p = t[h]) && (o = (s ? p(r, n, o) : p(o)) || o);
|
|
15
|
+
return s && o && C(r, n, o), o;
|
|
16
16
|
};
|
|
17
|
-
let
|
|
17
|
+
let e = class extends c(w) {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments), this.repaintTimer = Object.freeze(null);
|
|
20
20
|
}
|
|
@@ -31,8 +31,8 @@ let t = class extends c(w) {
|
|
|
31
31
|
this.repaint();
|
|
32
32
|
}
|
|
33
33
|
watchLeadHeadConfig() {
|
|
34
|
-
var
|
|
35
|
-
(
|
|
34
|
+
var t, r;
|
|
35
|
+
(t = this.leadHeadGroup) == null || t.removeAll(), (r = this.sceneIns) == null || r.remove(this.leadHeadGroup), this.drawLeadHead();
|
|
36
36
|
}
|
|
37
37
|
watchLeadModel() {
|
|
38
38
|
this.repaint();
|
|
@@ -44,16 +44,19 @@ let t = class extends c(w) {
|
|
|
44
44
|
this.repaint();
|
|
45
45
|
}
|
|
46
46
|
watchLongLeadConfig() {
|
|
47
|
-
var
|
|
48
|
-
(
|
|
47
|
+
var t;
|
|
48
|
+
(t = this.sceneIns) == null || t.clear(), this.init();
|
|
49
|
+
}
|
|
50
|
+
watchPosStart() {
|
|
51
|
+
this.registPostStart();
|
|
49
52
|
}
|
|
50
53
|
destroyed() {
|
|
51
54
|
this.repaintTimer && clearTimeout(this.repaintTimer);
|
|
52
55
|
}
|
|
53
56
|
repaint() {
|
|
54
57
|
this.repaintTimer && clearTimeout(this.repaintTimer), this.repaintTimer = setTimeout(() => {
|
|
55
|
-
var
|
|
56
|
-
(
|
|
58
|
+
var t, r;
|
|
59
|
+
(t = this.sceneIns) == null || t.clear(), (r = this.sceneIns) == null || r.resize({
|
|
57
60
|
width: this.canvasContainer.width,
|
|
58
61
|
height: this.canvasContainer.height
|
|
59
62
|
}), this.initCreatedConfig(), this.combinationDrawing();
|
|
@@ -66,34 +69,37 @@ let t = class extends c(w) {
|
|
|
66
69
|
this.init();
|
|
67
70
|
}
|
|
68
71
|
};
|
|
69
|
-
|
|
72
|
+
i([
|
|
70
73
|
a("vuescrollConfig", { deep: !0 })
|
|
71
|
-
],
|
|
72
|
-
|
|
74
|
+
], e.prototype, "watchVuescrollConfig", 1);
|
|
75
|
+
i([
|
|
73
76
|
a("analyseValues", { deep: !0 })
|
|
74
|
-
],
|
|
75
|
-
|
|
77
|
+
], e.prototype, "watchAnalyseValues", 1);
|
|
78
|
+
i([
|
|
76
79
|
a("waveConfigs", { deep: !0 })
|
|
77
|
-
],
|
|
78
|
-
|
|
80
|
+
], e.prototype, "watchWaveConfigs", 1);
|
|
81
|
+
i([
|
|
79
82
|
a("waveLists", { deep: !0 })
|
|
80
|
-
],
|
|
81
|
-
|
|
83
|
+
], e.prototype, "watchWaveLists", 1);
|
|
84
|
+
i([
|
|
82
85
|
a("leadHeadConfig", { deep: !0 })
|
|
83
|
-
],
|
|
84
|
-
|
|
86
|
+
], e.prototype, "watchLeadHeadConfig", 1);
|
|
87
|
+
i([
|
|
85
88
|
a("leadModel", { deep: !0 })
|
|
86
|
-
],
|
|
87
|
-
|
|
89
|
+
], e.prototype, "watchLeadModel", 1);
|
|
90
|
+
i([
|
|
88
91
|
a("width")
|
|
89
|
-
],
|
|
90
|
-
|
|
92
|
+
], e.prototype, "watchWidth", 1);
|
|
93
|
+
i([
|
|
91
94
|
a("height")
|
|
92
|
-
],
|
|
93
|
-
|
|
95
|
+
], e.prototype, "watchHeight", 1);
|
|
96
|
+
i([
|
|
94
97
|
a("longLeadConfig", { deep: !0 })
|
|
95
|
-
],
|
|
96
|
-
|
|
98
|
+
], e.prototype, "watchLongLeadConfig", 1);
|
|
99
|
+
i([
|
|
100
|
+
a("posStart")
|
|
101
|
+
], e.prototype, "watchPosStart", 1);
|
|
102
|
+
e = i([
|
|
97
103
|
l({
|
|
98
104
|
name: "CommonWaveForm",
|
|
99
105
|
components: {
|
|
@@ -104,7 +110,7 @@ t = r([
|
|
|
104
110
|
MXMagnifierWave: u
|
|
105
111
|
}
|
|
106
112
|
})
|
|
107
|
-
],
|
|
113
|
+
], e);
|
|
108
114
|
export {
|
|
109
|
-
|
|
115
|
+
e as default
|
|
110
116
|
};
|
|
@@ -49,6 +49,8 @@ export default class Methods extends Vue {
|
|
|
49
49
|
protected dataTotalLength: number;
|
|
50
50
|
/** 前缀 id */
|
|
51
51
|
protected prefixId: string;
|
|
52
|
+
/** 起始位置 */
|
|
53
|
+
protected posStart: number;
|
|
52
54
|
protected AssistCtx: Readonly<CanvasRenderingContext2D | null>;
|
|
53
55
|
protected sceneIns: Readonly<ZRenderType | null>;
|
|
54
56
|
protected layerBgGroup: Readonly<Group | null>;
|
|
@@ -156,6 +158,7 @@ export default class Methods extends Vue {
|
|
|
156
158
|
/** 初始化配置 */
|
|
157
159
|
protected initCreatedConfig(): void;
|
|
158
160
|
protected init(): void;
|
|
161
|
+
protected registPostStart(): void;
|
|
159
162
|
protected combinationDrawing(): void;
|
|
160
163
|
/** 计算心拍 */
|
|
161
164
|
protected calcHeartBeatPositions(): void;
|
|
@@ -15,13 +15,13 @@ import q from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/nod
|
|
|
15
15
|
import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
|
|
16
16
|
import { Prop as c } from "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js";
|
|
17
17
|
import { flattenDeep as Q, max as K, min as U } from "lodash";
|
|
18
|
-
import { throttling as $, getStepForSpeed as W, getPrintLengthToPx as Z, getSens as
|
|
18
|
+
import { throttling as $, getStepForSpeed as W, getPrintLengthToPx as Z, getSens as S, getDataLenTimes as A, getPointIdxForPx as F, getActualY as H } from "@costy-plus/utils";
|
|
19
19
|
import * as J from "zrender";
|
|
20
20
|
import { Group as v, Polyline as x, Line as G, Text as y, Polygon as ee, util as te } from "zrender";
|
|
21
21
|
var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, u = (e, t, i, s) => {
|
|
22
|
-
for (var
|
|
23
|
-
(n = e[
|
|
24
|
-
return s &&
|
|
22
|
+
for (var o = s > 1 ? void 0 : s ? se(t, i) : t, a = e.length - 1, n; a >= 0; a--)
|
|
23
|
+
(n = e[a]) && (o = (s ? n(t, i, o) : n(o)) || o);
|
|
24
|
+
return s && o && ie(t, i, o), o;
|
|
25
25
|
};
|
|
26
26
|
let g = class extends E {
|
|
27
27
|
constructor() {
|
|
@@ -50,14 +50,25 @@ let g = class extends E {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
destroyed() {
|
|
53
|
-
var e, t, i, s,
|
|
54
|
-
this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (
|
|
53
|
+
var e, t, i, s, o, a, n, l, f, h, d;
|
|
54
|
+
this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (o = this.splitLineGroup) == null || o.removeAll(), (a = this.leadHeadNameGroup) == null || a.removeAll(), (n = this.leadHeadOffAndDelGroup) == null || n.removeAll(), (l = this.rulerGroup) == null || l.removeAll(), (f = this.arrowGroup) == null || f.removeAll(), (h = this.heardBeatLineGroup) == null || h.removeAll(), (d = this.sceneIns) == null || d.dispose();
|
|
55
55
|
}
|
|
56
56
|
initCreatedConfig() {
|
|
57
57
|
this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height, this.initConfig();
|
|
58
58
|
}
|
|
59
59
|
init() {
|
|
60
|
-
this.calcHeartBeatPositions(), this.initWaveFormPeer(), this.combinationDrawing();
|
|
60
|
+
this.calcHeartBeatPositions(), this.initWaveFormPeer(), this.combinationDrawing(), this.registPostStart();
|
|
61
|
+
}
|
|
62
|
+
registPostStart() {
|
|
63
|
+
this.posStart && (this.scrollConfig.isShow ? this.$nextTick(() => {
|
|
64
|
+
var e;
|
|
65
|
+
this.scrollConfig.isNativeScroll ? (e = this.$refs.nativeScroll) == null || e.scrollBy({
|
|
66
|
+
left: (this.posStart || 0) * (this.publicStep || 1),
|
|
67
|
+
top: 0
|
|
68
|
+
}) : this.$refs.vueScroll.scrollBy({
|
|
69
|
+
dx: (this.posStart || 0) * (this.publicStep || 1)
|
|
70
|
+
});
|
|
71
|
+
}) : (this.scrollWaveFrom(this.posStart), this.scrollRuler(this.posStart), this.scrollArrow(this.posStart)));
|
|
61
72
|
}
|
|
62
73
|
combinationDrawing() {
|
|
63
74
|
this.drawLeadHead(), this.drawColSplitLine(), this.initSlidingWindowInfo(), this.drawRulerNotes(), this.drawWaveFrom();
|
|
@@ -87,8 +98,8 @@ let g = class extends E {
|
|
|
87
98
|
startInd: 0,
|
|
88
99
|
endInd: t
|
|
89
100
|
}, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
|
|
90
|
-
const s = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate),
|
|
91
|
-
this.vuescrollWH.width = this.canvasContainer.width + (
|
|
101
|
+
const s = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), o = this.dataTotalLength * s;
|
|
102
|
+
this.vuescrollWH.width = this.canvasContainer.width + (o || 0) - this.splitPoint;
|
|
92
103
|
}
|
|
93
104
|
const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
|
|
94
105
|
this.addSlidingWindowInfo = {
|
|
@@ -192,8 +203,8 @@ let g = class extends E {
|
|
|
192
203
|
(e = this.sceneIns) == null || e.off("mousemove", this.sceneInsMousemove), (t = this.sceneIns) == null || t.off("mousedown", this.sceneInsMouseDown), (i = this.sceneIns) == null || i.off("mouseup", this.sceneInsMouseUp);
|
|
193
204
|
}
|
|
194
205
|
drawLeadHead() {
|
|
195
|
-
var
|
|
196
|
-
(
|
|
206
|
+
var a, n, l, f, h;
|
|
207
|
+
(a = this.leadHeadGroup) == null || a.removeAll(), (n = this.sceneIns) == null || n.remove(this.leadHeadGroup), console.log("this.waveConfigs", this.waveConfigs);
|
|
197
208
|
let e = "", t = !1, i = 0, s = 0;
|
|
198
209
|
for (let d = 0; d <= this.leadModel.column; d++) {
|
|
199
210
|
s = d * this.leadModel.line;
|
|
@@ -205,26 +216,26 @@ let g = class extends E {
|
|
|
205
216
|
this.createLeadHead(
|
|
206
217
|
i,
|
|
207
218
|
this.waveConfigs[r - 1 + s].posY || r * this.splitBlockHeight,
|
|
208
|
-
|
|
219
|
+
S(this.waveConfigs[r - 1 + s].gain, this.gridConfig.cellMg),
|
|
209
220
|
t
|
|
210
221
|
)
|
|
211
222
|
));
|
|
212
223
|
}
|
|
213
224
|
}
|
|
214
|
-
let
|
|
225
|
+
let o = null;
|
|
215
226
|
for (let d = 0; d < this.leadModel.add; d++)
|
|
216
|
-
!this.waveConfigs[this.longLeadConfig.leadIdxs[d]] || (
|
|
227
|
+
!this.waveConfigs[this.longLeadConfig.leadIdxs[d]] || (o = this.waveConfigs[this.longLeadConfig.leadIdxs[d]], e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]], t = !1, o.gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = o.posX ? o.posX - this.leadHeadConfig.leadHedeWidth : 0, (f = this.leadHeadGroup) == null || f.add(
|
|
217
228
|
this.createLeadHead(
|
|
218
229
|
i,
|
|
219
|
-
|
|
220
|
-
|
|
230
|
+
o.posY || (d + 1 + this.leadModel.line) * this.splitBlockHeight,
|
|
231
|
+
S(o.gain, this.gridConfig.cellMg),
|
|
221
232
|
t
|
|
222
233
|
)
|
|
223
234
|
));
|
|
224
|
-
|
|
235
|
+
o = null, console.log("this.leadHeadGroup", this.leadHeadGroup), (h = this.sceneIns) == null || h.add(this.leadHeadGroup);
|
|
225
236
|
}
|
|
226
237
|
createLeadHead(e, t, i, s) {
|
|
227
|
-
const
|
|
238
|
+
const o = this.leadHeadConfig.leadHedeWidth / 4;
|
|
228
239
|
return i = s ? i / 2 : i, new x({
|
|
229
240
|
cursor: "",
|
|
230
241
|
shape: {
|
|
@@ -234,23 +245,23 @@ let g = class extends E {
|
|
|
234
245
|
0 + t
|
|
235
246
|
],
|
|
236
247
|
[
|
|
237
|
-
|
|
248
|
+
o + e,
|
|
238
249
|
0 + t
|
|
239
250
|
],
|
|
240
251
|
[
|
|
241
|
-
|
|
252
|
+
o + e,
|
|
242
253
|
-i + t
|
|
243
254
|
],
|
|
244
255
|
[
|
|
245
|
-
3 *
|
|
256
|
+
3 * o + e,
|
|
246
257
|
-i + t
|
|
247
258
|
],
|
|
248
259
|
[
|
|
249
|
-
3 *
|
|
260
|
+
3 * o + e,
|
|
250
261
|
0 + t
|
|
251
262
|
],
|
|
252
263
|
[
|
|
253
|
-
4 *
|
|
264
|
+
4 * o + e,
|
|
254
265
|
0 + t
|
|
255
266
|
]
|
|
256
267
|
]
|
|
@@ -262,8 +273,8 @@ let g = class extends E {
|
|
|
262
273
|
});
|
|
263
274
|
}
|
|
264
275
|
drawColSplitLine() {
|
|
265
|
-
var
|
|
266
|
-
(
|
|
276
|
+
var a, n, l, f, h;
|
|
277
|
+
(a = this.splitLineGroup) == null || a.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup);
|
|
267
278
|
const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
|
|
268
279
|
if (this.splitPoint = e, this.leadModel.isSingleMode) {
|
|
269
280
|
const d = W(
|
|
@@ -276,7 +287,7 @@ let g = class extends E {
|
|
|
276
287
|
), C = parseInt(`${r / 1e3 % 60}`, 10);
|
|
277
288
|
this.splitPoint = C * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (d || 0);
|
|
278
289
|
}
|
|
279
|
-
let t = 0, i = 0, s = 0,
|
|
290
|
+
let t = 0, i = 0, s = 0, o = 0;
|
|
280
291
|
for (let d = 1; d <= this.leadModel.column - 1; d++) {
|
|
281
292
|
t = d * e + this.leadHeadConfig.leadHedeWidth, i = d * this.leadModel.line;
|
|
282
293
|
e:
|
|
@@ -287,18 +298,18 @@ let g = class extends E {
|
|
|
287
298
|
continue e;
|
|
288
299
|
if ((this.waveConfigs || [])[r - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[r - 1 + i].posX), s = (this.waveConfigs || [])[r - 1 + i].leadIdx, s === void 0)
|
|
289
300
|
break;
|
|
290
|
-
|
|
301
|
+
o = S((this.waveConfigs || [])[r - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[r - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (l = this.splitLineGroup) == null || l.add(
|
|
291
302
|
this.creatSplitLine(
|
|
292
303
|
t,
|
|
293
|
-
((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (
|
|
294
|
-
|
|
304
|
+
((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (o || 0) / 2 * 0.5,
|
|
305
|
+
o,
|
|
295
306
|
!0
|
|
296
307
|
)
|
|
297
308
|
) : (f = this.splitLineGroup) == null || f.add(
|
|
298
309
|
this.creatSplitLine(
|
|
299
310
|
t,
|
|
300
|
-
((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (
|
|
301
|
-
|
|
311
|
+
((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (o || 0) * 0.5,
|
|
312
|
+
o
|
|
302
313
|
)
|
|
303
314
|
);
|
|
304
315
|
}
|
|
@@ -321,7 +332,7 @@ let g = class extends E {
|
|
|
321
332
|
});
|
|
322
333
|
}
|
|
323
334
|
drawRulerNotes() {
|
|
324
|
-
var s,
|
|
335
|
+
var s, o;
|
|
325
336
|
if (!this.rulerConfig.isShow)
|
|
326
337
|
return;
|
|
327
338
|
const e = {
|
|
@@ -342,22 +353,22 @@ let g = class extends E {
|
|
|
342
353
|
y: this.canvasContainer.height - this.ruleH
|
|
343
354
|
}, e)
|
|
344
355
|
});
|
|
345
|
-
(s = this.sceneIns) == null || s.add(i), (
|
|
356
|
+
(s = this.sceneIns) == null || s.add(i), (o = this.sceneIns) == null || o.add(t);
|
|
346
357
|
}
|
|
347
358
|
drawRuler(e = 0) {
|
|
348
359
|
var n, l, f;
|
|
349
360
|
if (!this.rulerConfig.isShow)
|
|
350
361
|
return;
|
|
351
362
|
const t = this.dataTotalTimes / 1e3;
|
|
352
|
-
let i = this.leadHeadConfig.leadHedeWidth, s = 0,
|
|
353
|
-
const
|
|
363
|
+
let i = this.leadHeadConfig.leadHedeWidth, s = 0, o = t;
|
|
364
|
+
const a = W(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
|
|
354
365
|
if (this.leadModel.isContinuous)
|
|
355
|
-
|
|
356
|
-
else if (!this.leadModel.add &&
|
|
357
|
-
const h =
|
|
358
|
-
|
|
366
|
+
o = t * 5;
|
|
367
|
+
else if (!this.leadModel.add && a) {
|
|
368
|
+
const h = F(this.splitPoint, a), d = A(h, this.rulerConfig.sampleRate || 0) / 1e3;
|
|
369
|
+
o = e + d;
|
|
359
370
|
}
|
|
360
|
-
for (let h = e; h <=
|
|
371
|
+
for (let h = e; h <= o; h = +(h + 0.1).toFixed(1))
|
|
361
372
|
h !== e && (i += this.rulerStep), h % 1 === 0 ? (s = this.canvasContainer.height - 10, (n = this.rulerGroup) == null || n.add(new y({
|
|
362
373
|
cursor: "",
|
|
363
374
|
style: {
|
|
@@ -390,32 +401,32 @@ let g = class extends E {
|
|
|
390
401
|
getRednerSinglePoints() {
|
|
391
402
|
let e = 0, t = 0;
|
|
392
403
|
const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
|
|
393
|
-
let s = this.slidingWindowInfo.startInd || 0,
|
|
394
|
-
const
|
|
404
|
+
let s = this.slidingWindowInfo.startInd || 0, o = this.slidingWindowInfo.endInd || 0;
|
|
405
|
+
const a = W(
|
|
395
406
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
396
407
|
this.gridConfig.cellMg,
|
|
397
408
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
398
|
-
), n =
|
|
409
|
+
), n = S(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), l = [], f = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
|
|
399
410
|
for (let h = 0; h < 1; h++) {
|
|
400
411
|
e = h * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
|
|
401
412
|
for (let d = 1; d <= f; d++)
|
|
402
|
-
t = d * this.splitBlockHeight, d > 1 && (t *= 0.8, s =
|
|
413
|
+
t = d * this.splitBlockHeight, d > 1 && (t *= 0.8, s = o, o = s + (this.slidingWindowInfo.points || 0)), d === 1 && (this.loopArrowY.rowAndCol = t), l.push({
|
|
403
414
|
pos: [e, t],
|
|
404
415
|
startInd: s,
|
|
405
|
-
endInd:
|
|
406
|
-
step:
|
|
416
|
+
endInd: o,
|
|
417
|
+
step: a,
|
|
407
418
|
sens: n,
|
|
408
|
-
data: i.slice(s,
|
|
419
|
+
data: i.slice(s, o).map((r, C) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? H(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, r, n / 2) : H(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, r, n)).map((r, C) => [C * (a || 0), -r])
|
|
409
420
|
});
|
|
410
421
|
}
|
|
411
422
|
return l;
|
|
412
423
|
}
|
|
413
424
|
createSingleWaveFrom() {
|
|
414
|
-
var
|
|
415
|
-
(
|
|
425
|
+
var o, a, n;
|
|
426
|
+
(o = this.singleWaveFromGroup) == null || o.removeAll();
|
|
416
427
|
let e = this.getRednerSinglePoints(), t = A(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0), i = 0, s = 0;
|
|
417
428
|
for (let l = 0; l < e.length && !(e[l].pos[1] > this.drawArea.height + this.bottomAreaHeight); l++)
|
|
418
|
-
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (i = parseInt(`${t / 1e3 / 60}`, 10), s = parseInt(`${t / 1e3 % 60}`, 10), i = s === 60 ? i += 1 : i, i = i === 0 ? "00" : i < 10 ? `0${i}` : i, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (
|
|
429
|
+
this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (i = parseInt(`${t / 1e3 / 60}`, 10), s = parseInt(`${t / 1e3 % 60}`, 10), i = s === 60 ? i += 1 : i, i = i === 0 ? "00" : i < 10 ? `0${i}` : i, s = s === 0 || s === 60 ? "00" : s < 10 ? `0${s}` : s, (a = this.singleWaveFromGroup) == null || a.add(new x({
|
|
419
430
|
cursor: "",
|
|
420
431
|
name: this.singleModeConfig.defaultSelect + "_" + l,
|
|
421
432
|
shape: {
|
|
@@ -456,12 +467,12 @@ let g = class extends E {
|
|
|
456
467
|
this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect] || null, this.drawHeardBeatLine());
|
|
457
468
|
let t = 0, i = 0;
|
|
458
469
|
if (this.leadModel.add) {
|
|
459
|
-
const
|
|
460
|
-
i = this.loopArrowY.add - (
|
|
470
|
+
const L = S(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain, this.gridConfig.cellMg);
|
|
471
|
+
i = this.loopArrowY.add - (L || 0) - this.splitBlockHeight / 3.5;
|
|
461
472
|
} else
|
|
462
473
|
i = 20;
|
|
463
|
-
let s = 0,
|
|
464
|
-
const
|
|
474
|
+
let s = 0, o = 0;
|
|
475
|
+
const a = {
|
|
465
476
|
fontSize: 12,
|
|
466
477
|
fill: "red",
|
|
467
478
|
fontFamily: this.fontFamily
|
|
@@ -471,12 +482,12 @@ let g = class extends E {
|
|
|
471
482
|
this.waveConfigs[this.heartFight.showIdxPai].sampleRate
|
|
472
483
|
);
|
|
473
484
|
let l = 0;
|
|
474
|
-
for (let
|
|
475
|
-
const p = this.heartBeatPosition[this.heartFight.showIdxPai][
|
|
485
|
+
for (let L = 0; L < (this.heartBeatPosition[this.heartFight.showIdxPai] || []).length; L++) {
|
|
486
|
+
const p = this.heartBeatPosition[this.heartFight.showIdxPai][L];
|
|
476
487
|
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))) {
|
|
477
488
|
if (((p == null ? void 0 : p.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
|
|
478
489
|
break;
|
|
479
|
-
t = l * (n || 0) + this.leadHeadConfig.leadHedeWidth - 9.5,
|
|
490
|
+
t = l * (n || 0) + this.leadHeadConfig.leadHedeWidth - 9.5, o = 0, (d = this.arrowGroup) == null || d.add(new ee({
|
|
480
491
|
name: "arrow_box",
|
|
481
492
|
shape: {
|
|
482
493
|
points: [
|
|
@@ -497,8 +508,8 @@ let g = class extends E {
|
|
|
497
508
|
var k;
|
|
498
509
|
!this.heartFight.mode || (b.target.attr({
|
|
499
510
|
style: { fill: "blue" }
|
|
500
|
-
}), (k = this.arrowGroup) == null || k.children().filter((
|
|
501
|
-
|
|
511
|
+
}), (k = this.arrowGroup) == null || k.children().filter((M) => M.name === "arrow_box").forEach((M) => {
|
|
512
|
+
M.id !== b.target.id && M.attr({
|
|
502
513
|
style: { fill: "#ccc" }
|
|
503
514
|
});
|
|
504
515
|
}), this.arrowLoopClick(p, b.target));
|
|
@@ -507,30 +518,30 @@ let g = class extends E {
|
|
|
507
518
|
cursor: "",
|
|
508
519
|
style: I({
|
|
509
520
|
x: 4 + t - s * 1.5,
|
|
510
|
-
y:
|
|
521
|
+
y: o + i,
|
|
511
522
|
text: `${(p == null ? void 0 : p.heartrate) || ""}`
|
|
512
|
-
},
|
|
513
|
-
})),
|
|
523
|
+
}, a)
|
|
524
|
+
})), o += 12), this.heartFight.interval && (s = ((w = this.AssistCtx) == null ? void 0 : w.measureText(`${(p == null ? void 0 : p.interval) || ""}`).width) || 0, (m = this.arrowGroup) == null || m.add(new y({
|
|
514
525
|
cursor: "",
|
|
515
526
|
style: I({
|
|
516
527
|
x: 4 + t - s * 1.5,
|
|
517
|
-
y:
|
|
528
|
+
y: o + i,
|
|
518
529
|
text: `${(p == null ? void 0 : p.interval) || ""}`
|
|
519
|
-
},
|
|
520
|
-
})),
|
|
530
|
+
}, a)
|
|
531
|
+
})), o += 12), this.heartFight.qrstCompany && (s = ((P = this.AssistCtx) == null ? void 0 : P.measureText(`${(p == null ? void 0 : p.qrstCompany) || ""}`).width) || 0, (B = this.arrowGroup) == null || B.add(new y({
|
|
521
532
|
cursor: "",
|
|
522
533
|
style: I({
|
|
523
534
|
x: 4 + t - s * 1.5,
|
|
524
|
-
y:
|
|
535
|
+
y: o + i,
|
|
525
536
|
text: `${(p == null ? void 0 : p.qrstCompany) || ""}`
|
|
526
|
-
},
|
|
527
|
-
})),
|
|
537
|
+
}, a)
|
|
538
|
+
})), o += 12), this.heartFight.telectricalaxis && (s = ((O = this.AssistCtx) == null ? void 0 : O.measureText(`${(p == null ? void 0 : p.telectricalaxis) || ""}`).width) || 0, (R = this.arrowGroup) == null || R.add(new y({
|
|
528
539
|
cursor: "",
|
|
529
540
|
style: I({
|
|
530
541
|
x: 4 + t - s * 1.5,
|
|
531
|
-
y:
|
|
542
|
+
y: o + i,
|
|
532
543
|
text: `${(p == null ? void 0 : p.telectricalaxis) || ""}`
|
|
533
|
-
},
|
|
544
|
+
}, a)
|
|
534
545
|
})));
|
|
535
546
|
}
|
|
536
547
|
}
|
|
@@ -544,7 +555,7 @@ let g = class extends E {
|
|
|
544
555
|
if (!this.currentHeardBeat.heardBeat)
|
|
545
556
|
return;
|
|
546
557
|
(n = this.heardBeatLineGroup) == null || n.removeAll(), (l = this.sceneIns) == null || l.remove(this.heardBeatLineGroup);
|
|
547
|
-
let t = {}, i = 0, s = this.getRednerPoints(),
|
|
558
|
+
let t = {}, i = 0, s = this.getRednerPoints(), o = this.getAddRednerPoints(), a;
|
|
548
559
|
e:
|
|
549
560
|
for (let w = 0; w < s.length; w++) {
|
|
550
561
|
t = ((f = this.analyseValues[w]) == null ? void 0 : f[this.currentHeardBeat.heardBeat.index].KeyPosByBeat) || {};
|
|
@@ -552,24 +563,24 @@ let g = class extends E {
|
|
|
552
563
|
if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(m) && Object.prototype.hasOwnProperty.call(t, m)) {
|
|
553
564
|
if (i = (t[m] - this.slidingWindowInfo.startInd) * (s[w].step || 0), this.isLeadOff(w) || this.isLeadDel(w))
|
|
554
565
|
continue;
|
|
555
|
-
if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (
|
|
566
|
+
if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (a = s[w], this.leadModel.isContinuous && w > this.leadModel.line - 1))
|
|
556
567
|
break e;
|
|
557
|
-
(h = this.heardBeatLineGroup) == null || h.add(this.createHeardBeatLine(
|
|
568
|
+
(h = this.heardBeatLineGroup) == null || h.add(this.createHeardBeatLine(a.pos[0] + i, a.pos[1]));
|
|
558
569
|
}
|
|
559
570
|
}
|
|
560
571
|
e:
|
|
561
|
-
for (let w = 0; w <
|
|
572
|
+
for (let w = 0; w < o.length; w++) {
|
|
562
573
|
t = ((d = this.analyseValues[w]) == null ? void 0 : d[this.currentHeardBeat.heardBeat.index].KeyPosByBeat) || {};
|
|
563
574
|
for (const m in t)
|
|
564
575
|
if (["Pstart", "Pend", "QRSstart", "QRSend", "Tstart", "Tend"].includes(m)) {
|
|
565
|
-
if (i = (t[m] - this.slidingWindowInfo.startInd) * (
|
|
576
|
+
if (i = (t[m] - this.slidingWindowInfo.startInd) * (o[w].step || 0), this.isLeadOff(this.longLeadConfig.leadIdxs[w]) && this.isLeadDel(this.longLeadConfig.leadIdxs[w]))
|
|
566
577
|
continue;
|
|
567
578
|
if (e > t[m])
|
|
568
579
|
break e;
|
|
569
|
-
|
|
580
|
+
a = o[w], (r = this.heardBeatLineGroup) == null || r.add(this.createHeardBeatLine(a.pos[0] + i, a.pos[1]));
|
|
570
581
|
}
|
|
571
582
|
}
|
|
572
|
-
(C = this.sceneIns) == null || C.add(this.heardBeatLineGroup), t = null, s = null,
|
|
583
|
+
(C = this.sceneIns) == null || C.add(this.heardBeatLineGroup), t = null, s = null, o = null;
|
|
573
584
|
}
|
|
574
585
|
createHeardBeatLine(e, t) {
|
|
575
586
|
return new G({
|
|
@@ -592,15 +603,15 @@ let g = class extends E {
|
|
|
592
603
|
}
|
|
593
604
|
getAddRednerPoints() {
|
|
594
605
|
const e = [];
|
|
595
|
-
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0,
|
|
606
|
+
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, o = [], a = 0, n = 0;
|
|
596
607
|
for (let l = 0; l < this.leadModel.add; l++)
|
|
597
|
-
s = this.longLeadConfig.leadIdxs[l], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t,
|
|
608
|
+
s = this.longLeadConfig.leadIdxs[l], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, a = W(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = S(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (l + this.leadModel.line + 1) * this.splitBlockHeight, o = this.waveLists[s] || [], l === 0 && (this.loopArrowY.add = i), e.push({
|
|
598
609
|
pos: [t, i],
|
|
599
610
|
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
600
611
|
endInd: this.addSlidingWindowInfo.endInd || 0,
|
|
601
|
-
data:
|
|
612
|
+
data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((f, h) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? H(this.waveConfigs[s].sensitivity, f, n / 2) : H(this.waveConfigs[s].sensitivity, f, n)).map((f, h) => [h * (a || 0), -f]),
|
|
602
613
|
sens: n,
|
|
603
|
-
step:
|
|
614
|
+
step: a
|
|
604
615
|
}));
|
|
605
616
|
return e;
|
|
606
617
|
}
|
|
@@ -612,9 +623,9 @@ let g = class extends E {
|
|
|
612
623
|
cursor: "",
|
|
613
624
|
name: this.longLeadConfig.leadIdxs[i] + "_" + i,
|
|
614
625
|
shape: {
|
|
615
|
-
points: e[i].data.map(([s,
|
|
626
|
+
points: e[i].data.map(([s, o]) => [
|
|
616
627
|
s + e[i].pos[0],
|
|
617
|
-
|
|
628
|
+
o + e[i].pos[1]
|
|
618
629
|
])
|
|
619
630
|
},
|
|
620
631
|
style: {
|
|
@@ -628,18 +639,18 @@ let g = class extends E {
|
|
|
628
639
|
this.addWaveDataCopy = e, e = null;
|
|
629
640
|
}
|
|
630
641
|
getRednerPoints() {
|
|
631
|
-
let e = 0, t = 0, i = 0, s = [],
|
|
642
|
+
let e = 0, t = 0, i = 0, s = [], o = 0, a = 0, n = this.slidingWindowInfo.startInd || 0, l = this.slidingWindowInfo.endInd || 0;
|
|
632
643
|
const f = [];
|
|
633
644
|
for (let h = 0; h < this.leadModel.column; h++) {
|
|
634
645
|
e = h * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && h > 0 && (n = l, l = n + (this.slidingWindowInfo.points || 0));
|
|
635
646
|
for (let d = 1; d <= this.leadModel.line && (t = d * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); d++)
|
|
636
|
-
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t,
|
|
647
|
+
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o = W(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), a = S(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (d === 1 && (this.loopArrowY.rowAndCol = t), f.push({
|
|
637
648
|
pos: [e, t],
|
|
638
649
|
startInd: n,
|
|
639
650
|
endInd: l,
|
|
640
|
-
sens:
|
|
641
|
-
step:
|
|
642
|
-
data: s.slice(n, l).map((r, C) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ?
|
|
651
|
+
sens: a,
|
|
652
|
+
step: o,
|
|
653
|
+
data: s.slice(n, l).map((r, C) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? H(this.waveConfigs[i].sensitivity, r, a / 2) : H(this.waveConfigs[i].sensitivity, r, a)).map((r, C) => [C * (o || 0), -r])
|
|
643
654
|
}), i++);
|
|
644
655
|
}
|
|
645
656
|
return f;
|
|
@@ -648,29 +659,29 @@ let g = class extends E {
|
|
|
648
659
|
var i, s;
|
|
649
660
|
console.time("createRowAndColWaveFrom"), (i = this.rowAndColwaveFromGroup) == null || i.removeAll();
|
|
650
661
|
let e = this.getRednerPoints(), t = 0;
|
|
651
|
-
for (let
|
|
652
|
-
t = this.waveConfigs[
|
|
662
|
+
for (let o = 0; o < e.length; o++)
|
|
663
|
+
t = this.waveConfigs[o].leadIdx || 0, this.isLeadDel(t) || (s = this.rowAndColwaveFromGroup) == null || s.add(new x({
|
|
653
664
|
cursor: "",
|
|
654
|
-
name:
|
|
665
|
+
name: o + "_" + o,
|
|
655
666
|
shape: {
|
|
656
|
-
points: e[
|
|
657
|
-
|
|
658
|
-
n + e[
|
|
667
|
+
points: e[o].data.map(([a, n]) => [
|
|
668
|
+
a + e[o].pos[0],
|
|
669
|
+
n + e[o].pos[1]
|
|
659
670
|
])
|
|
660
671
|
},
|
|
661
672
|
style: {
|
|
662
673
|
stroke: this.leadConfig.lineColor,
|
|
663
674
|
lineWidth: this.leadConfig.lineWidth
|
|
664
675
|
},
|
|
665
|
-
onclick: (
|
|
666
|
-
this.onDbClickWaveFrom(
|
|
676
|
+
onclick: (a) => {
|
|
677
|
+
this.onDbClickWaveFrom(a, "rowAndCol");
|
|
667
678
|
}
|
|
668
|
-
})),
|
|
679
|
+
})), 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));
|
|
669
680
|
this.waveDataCopy = e, e = null;
|
|
670
681
|
}
|
|
671
682
|
createLeadName(e, t, i, s = !1) {
|
|
672
|
-
var
|
|
673
|
-
(
|
|
683
|
+
var o;
|
|
684
|
+
(o = this.leadHeadNameGroup) == null || o.add(new y({
|
|
674
685
|
style: {
|
|
675
686
|
x: t,
|
|
676
687
|
y: i,
|
|
@@ -679,18 +690,18 @@ let g = class extends E {
|
|
|
679
690
|
fill: this.leadConfig.lineColor,
|
|
680
691
|
fontFamily: this.leadConfig.fontFamily
|
|
681
692
|
},
|
|
682
|
-
oncontextmenu: (
|
|
683
|
-
|
|
684
|
-
event: D(I({},
|
|
693
|
+
oncontextmenu: (a) => {
|
|
694
|
+
a.event.preventDefault(), this.$emit("notiifyLeadName", {
|
|
695
|
+
event: D(I({}, a), {
|
|
685
696
|
name: this.leadNames[e],
|
|
686
697
|
idx: e
|
|
687
698
|
}),
|
|
688
699
|
isAdd: s
|
|
689
700
|
});
|
|
690
701
|
},
|
|
691
|
-
onclick: (
|
|
702
|
+
onclick: (a) => {
|
|
692
703
|
this.$emit("notiifyLeadName", {
|
|
693
|
-
event: D(I({},
|
|
704
|
+
event: D(I({}, a), {
|
|
694
705
|
name: this.leadNames[e],
|
|
695
706
|
idx: e
|
|
696
707
|
}),
|
|
@@ -717,11 +728,11 @@ let g = class extends E {
|
|
|
717
728
|
onDbClickWaveFrom(e, t) {
|
|
718
729
|
console.log("onDbClickWaveFrom", e);
|
|
719
730
|
const i = Date.now(), s = () => {
|
|
720
|
-
const
|
|
721
|
-
this.activeLeadIdx = +
|
|
722
|
-
const
|
|
731
|
+
const o = e.target.name.split("_");
|
|
732
|
+
this.activeLeadIdx = +o[0];
|
|
733
|
+
const a = +o[1];
|
|
723
734
|
let n = 0, l = 0, f = 0, h = 0, d = 0;
|
|
724
|
-
t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[
|
|
735
|
+
t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[a].pos[0], l = this.singleWaveDataCopy[a].startInd, f = F(n, this.singleWaveDataCopy[a].step || 1), h = this.singleWaveDataCopy[a].sens, d = this.singleWaveDataCopy[a].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[a].pos[0], l = this.waveDataCopy[a].startInd || 0, f = F(n, this.waveDataCopy[a].step || 1), h = this.waveDataCopy[a].sens, d = this.waveDataCopy[a].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[a].pos[0], l = this.addWaveDataCopy[a].startInd || 0, f = F(n, this.addWaveDataCopy[a].step || 1), h = this.addWaveDataCopy[a].sens, d = this.addWaveDataCopy[a].step), f += l, this.$emit("notifyActiveEnlargr", {
|
|
725
736
|
sens: h,
|
|
726
737
|
step: d,
|
|
727
738
|
activeLeadIdx: this.activeLeadIdx,
|
|
@@ -737,18 +748,18 @@ let g = class extends E {
|
|
|
737
748
|
t.type === "horizontal" && (t.scrollLeft = t.scrollLeft || 0, this.scrollCommon(t.scrollLeft));
|
|
738
749
|
}
|
|
739
750
|
scrollCommon(e) {
|
|
740
|
-
const t =
|
|
751
|
+
const t = F(e, this.publicStep || 1);
|
|
741
752
|
this.scrollWaveFrom(t), this.scrollRuler(t), this.scrollArrow(t), this.$emit("notifyScrollPointIdx", {
|
|
742
753
|
slidIdxs: t,
|
|
743
754
|
scrollLeft: e
|
|
744
755
|
});
|
|
745
756
|
}
|
|
746
757
|
scrollWaveFrom(e) {
|
|
747
|
-
var s,
|
|
758
|
+
var s, o;
|
|
748
759
|
this.slidingWindowInfo.startInd = e, this.slidingWindowInfo.endInd = e + (this.slidingWindowInfo.points || 0), this.addSlidingWindowInfo.startInd = e, this.addSlidingWindowInfo.endInd = e + (this.addSlidingWindowInfo.points || 0);
|
|
749
760
|
let t = this.getRednerPoints(), i = this.getAddRednerPoints();
|
|
750
|
-
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((
|
|
751
|
-
n = n || 0,
|
|
761
|
+
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((a, n) => {
|
|
762
|
+
n = n || 0, a.attr({
|
|
752
763
|
shape: {
|
|
753
764
|
points: t[n].data.map(([l, f]) => [
|
|
754
765
|
l + t[n].pos[0],
|
|
@@ -756,8 +767,8 @@ let g = class extends E {
|
|
|
756
767
|
])
|
|
757
768
|
}
|
|
758
769
|
});
|
|
759
|
-
}), (
|
|
760
|
-
n = n || 0,
|
|
770
|
+
}), (o = this.addwaveFromGroup) == null || o.eachChild((a, n) => {
|
|
771
|
+
n = n || 0, a.attr({
|
|
761
772
|
shape: {
|
|
762
773
|
points: i[n].data.map(([l, f]) => [
|
|
763
774
|
l + i[n].pos[0],
|
|
@@ -936,6 +947,11 @@ u([
|
|
|
936
947
|
default: () => ""
|
|
937
948
|
})
|
|
938
949
|
], g.prototype, "prefixId", 2);
|
|
950
|
+
u([
|
|
951
|
+
c({
|
|
952
|
+
default: () => 0
|
|
953
|
+
})
|
|
954
|
+
], g.prototype, "posStart", 2);
|
|
939
955
|
u([
|
|
940
956
|
$(200)
|
|
941
957
|
], g.prototype, "nativeScrollFunc", 1);
|
|
@@ -11,6 +11,7 @@ declare class CommonWaveForm extends CommonWaveForm_base {
|
|
|
11
11
|
protected watchWidth(): void;
|
|
12
12
|
protected watchHeight(): void;
|
|
13
13
|
protected watchLongLeadConfig(): void;
|
|
14
|
+
protected watchPosStart(): void;
|
|
14
15
|
protected destroyed(): void;
|
|
15
16
|
protected repaint(): void;
|
|
16
17
|
created(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const u=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const r=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),l=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js"),c=require("../MeasuringRuler/index2.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const u=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const r=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),l=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js"),c=require("../MeasuringRuler/index2.js"),h=require("../MagnifierWave/index.js"),p=require("../ParallelRuler/index2.js"),m=require("../BackgroundGrid/index2.js"),f=require("./method.js");var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,t=(e,a,s,i)=>{for(var o=i>1?void 0:i?g(a,s):a,n=e.length-1,d;n>=0;n--)(d=e[n])&&(o=(i?d(a,s,o):d(o))||o);return i&&o&&v(a,s,o),o};exports.default=class extends u.mixins(f.default){constructor(){super(...arguments),this.repaintTimer=Object.freeze(null)}watchVuescrollConfig(){this.repaint()}watchAnalyseValues(){this.repaint()}watchWaveConfigs(){this.repaint()}watchWaveLists(){this.repaint()}watchLeadHeadConfig(){var e,a;(e=this.leadHeadGroup)==null||e.removeAll(),(a=this.sceneIns)==null||a.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchPosStart(){this.registPostStart()}destroyed(){this.repaintTimer&&clearTimeout(this.repaintTimer)}repaint(){this.repaintTimer&&clearTimeout(this.repaintTimer),this.repaintTimer=setTimeout(()=>{var e,a;(e=this.sceneIns)==null||e.clear(),(a=this.sceneIns)==null||a.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.initCreatedConfig(),this.combinationDrawing()},200)}created(){this.initCreatedConfig()}mounted(){this.init()}};t([r.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);t([r.Watch("analyseValues",{deep:!0})],exports.default.prototype,"watchAnalyseValues",1);t([r.Watch("waveConfigs",{deep:!0})],exports.default.prototype,"watchWaveConfigs",1);t([r.Watch("waveLists",{deep:!0})],exports.default.prototype,"watchWaveLists",1);t([r.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);t([r.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);t([r.Watch("width")],exports.default.prototype,"watchWidth",1);t([r.Watch("height")],exports.default.prototype,"watchHeight",1);t([r.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);t([r.Watch("posStart")],exports.default.prototype,"watchPosStart",1);exports.default=t([u.default({name:"CommonWaveForm",components:{vueScroll:l.default,MXBackgroundGrid:m.default,MXMeasuringRuler:c.default,MXParallelRuler:p.default,MXMagnifierWave:h.default}})],exports.default);
|
|
@@ -49,6 +49,8 @@ export default class Methods extends Vue {
|
|
|
49
49
|
protected dataTotalLength: number;
|
|
50
50
|
/** 前缀 id */
|
|
51
51
|
protected prefixId: string;
|
|
52
|
+
/** 起始位置 */
|
|
53
|
+
protected posStart: number;
|
|
52
54
|
protected AssistCtx: Readonly<CanvasRenderingContext2D | null>;
|
|
53
55
|
protected sceneIns: Readonly<ZRenderType | null>;
|
|
54
56
|
protected layerBgGroup: Readonly<Group | null>;
|
|
@@ -156,6 +158,7 @@ export default class Methods extends Vue {
|
|
|
156
158
|
/** 初始化配置 */
|
|
157
159
|
protected initCreatedConfig(): void;
|
|
158
160
|
protected init(): void;
|
|
161
|
+
protected registPostStart(): void;
|
|
159
162
|
protected combinationDrawing(): void;
|
|
160
163
|
/** 计算心拍 */
|
|
161
164
|
protected calcHeartBeatPositions(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var O=Object.defineProperty,B=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var G=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))N.call(t,i)&&G(e,i,t[i]);if(D)for(var i of D(t))k.call(t,i)&&G(e,i,t[i]);return e},F=(e,t)=>B(e,R(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),z=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),L=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),T=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function _(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const $=T(j),X=_(g);var V=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,c=(e,t,i,s)=>{for(var o=s>1?void 0:s?Y(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&V(t,i,o),o};exports.default=class extends $.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,o,a,n,l,f,h,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(o=this.splitLineGroup)==null||o.removeAll(),(a=this.leadHeadNameGroup)==null||a.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(f=this.arrowGroup)==null||f.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.sceneIns)==null||d.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing()}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate,interval:Math.round(60/this.analyseValues[t][i].AnabyBeat.VentricularRate*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),o=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(o||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:i,startInd:0,endInd:i}}calcHighestAndLowestPoint(){const e=L.flattenDeep(this.waveLists);return{maxPoints:L.max(e)||0,minPoints:L.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.addSlidingWindowInfo={points:0,startInd:0,endInd:0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=X.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var a,n,l,f,h;(a=this.leadHeadGroup)==null||a.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let d=0;d<=this.leadModel.column;d++){s=d*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+s])break e;!this.waveConfigs[r-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[r-1+s]||"",this.waveConfigs[r-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[r-1+s].posX?this.waveConfigs[r-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,this.waveConfigs[r-1+s].posY||r*this.splitBlockHeight,u.getSens(this.waveConfigs[r-1+s].gain,this.gridConfig.cellMg),t)))}}let o=null;for(let d=0;d<this.leadModel.add;d++)!this.waveConfigs[this.longLeadConfig.leadIdxs[d]]||(o=this.waveConfigs[this.longLeadConfig.leadIdxs[d]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]],t=!1,o.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=o.posX?o.posX-this.leadHeadConfig.leadHedeWidth:0,(f=this.leadHeadGroup)==null||f.add(this.createLeadHead(i,o.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,console.log("this.leadHeadGroup",this.leadHeadGroup),(h=this.sceneIns)==null||h.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[o+e,0+t],[o+e,-i+t],[3*o+e,-i+t],[3*o+e,0+t],[4*o+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var a,n,l,f,h;(a=this.splitLineGroup)==null||a.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const d=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),r=u.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${r/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(d||0)}let t=0,i=0,s=0,o=0;for(let d=1;d<=this.leadModel.column-1;d++){t=d*e+this.leadHeadConfig.leadHedeWidth,i=d*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+i])break e;if((this.waveConfigs||[])[r-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[r-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[r-1+i].posX),s=(this.waveConfigs||[])[r-1+i].leadIdx,s===void 0)break;o=u.getSens((this.waveConfigs||[])[r-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[r-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)*.5,o))}}(h=this.sceneIns)==null||h.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,o;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:y({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:y({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(o=this.sceneIns)==null||o.add(t)}drawRuler(e=0){var n,l,f;if(!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const a=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&a){const h=u.getPointIdxForPx(this.splitPoint,a),d=u.getDataLenTimes(h,this.rulerConfig.sampleRate||0)/1e3;o=e+d}for(let h=e;h<=o;h=+(h+.1).toFixed(1))h!==e&&(i+=this.rulerStep),h%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:h+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(l=this.rulerGroup)==null||l.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(),this.drawLoopArrow()}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const a=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),l=[],f=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let h=0;h<1;h++){e=h*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=f;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:s,endInd:o,step:a,sens:n,data:i.slice(s,o).map((r,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,n)).map((r,m)=>[m*(a||0),-r])})}return l}createSingleWaveFrom(){var o,a,n;(o=this.singleWaveFromGroup)==null||o.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(a=this.singleWaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,h])=>[f+e[l].pos[0],h+e[l].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{this.onDbClickWaveFrom(f,"single")}})),(n=this.singleWaveFromGroup)==null||n.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var f,h,d,r,m,C,v,H,M,A,P,x;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const I=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(I||0)-this.splitBlockHeight/3.5}else i=20;let s=0,o=0;const a={fontSize:12,fill:"red",fontFamily:this.fontFamily},n=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let l=0;for(let I=0;I<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;I++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][I];if(l=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&l>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&l>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=l*(n||0)+this.leadHeadConfig.leadHedeWidth-9.5,o=0,(d=this.arrowGroup)==null||d.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((h=(f=this.currentHeardBeat)==null?void 0:f.heardBeat)==null?void 0:h.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:W=>{var b;!this.heartFight.mode||(W.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(S=>S.name==="arrow_box").forEach(S=>{S.id!==W.target.id&&S.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,W.target))}})),this.heartFight.heartrate&&(s=((r=this.AssistCtx)==null?void 0:r.measureText(`${(p==null?void 0:p.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.heartrate)||""}`},a)})),o+=12),this.heartFight.interval&&(s=((C=this.AssistCtx)==null?void 0:C.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.interval)||""}`},a)})),o+=12),this.heartFight.qrstCompany&&(s=((H=this.AssistCtx)==null?void 0:H.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(M=this.arrowGroup)==null||M.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},a)})),o+=12),this.heartFight.telectricalaxis&&(s=((A=this.AssistCtx)==null?void 0:A.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(P=this.arrowGroup)==null||P.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},a)})))}}(x=this.sceneIns)==null||x.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",g.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var n,l,f,h,d,r,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t={},i=0,s=this.getRednerPoints(),o=this.getAddRednerPoints(),a;e:for(let C=0;C<s.length;C++){t=((f=this.analyseValues[C])==null?void 0:f[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(s[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(a=s[C],this.leadModel.isContinuous&&C>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(a.pos[0]+i,a.pos[1]))}}e:for(let C=0;C<o.length;C++){t=((d=this.analyseValues[C])==null?void 0:d[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(o[C].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[C])&&this.isLeadDel(this.longLeadConfig.leadIdxs[C]))continue;if(e>t[v])break e;a=o[C],(r=this.heardBeatLineGroup)==null||r.add(this.createHeardBeatLine(a.pos[0]+i,a.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,s=null,o=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,o=[],a=0,n=0;for(let l=0;l<this.leadModel.add;l++)s=this.longLeadConfig.leadIdxs[l],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,a=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(l+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],l===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:o.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((f,h)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,f,n/2):u.getActualY(this.waveConfigs[s].sensitivity,f,n)).map((f,h)=>[h*(a||0),-f]),sens:n,step:a}));return e}createAddWaveFrom(){var t;let e=this.getAddRednerPoints();for(let i=0;i<e.length;i++)this.isLeadDel(this.longLeadConfig.leadIdxs[i])||((t=this.addwaveFromGroup)==null||t.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[i]+"_"+i,shape:{points:e[i].data.map(([s,o])=>[s+e[i].pos[0],o+e[i].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:s=>{this.onDbClickWaveFrom(s,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[i],e[i].pos[0],e[i].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[i],e[i].pos[0]-5,e[i].pos[1]-(e[i].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,a=0,n=this.slidingWindowInfo.startInd||0,l=this.slidingWindowInfo.endInd||0;const f=[];for(let h=0;h<this.leadModel.column;h++){e=h*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&h>0&&(n=l,l=n+(this.slidingWindowInfo.points||0));for(let d=1;d<=this.leadModel.line&&(t=d*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));d++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,o=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),a=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),f.push({pos:[e,t],startInd:n,endInd:l,sens:a,step:o,data:s.slice(n,l).map((r,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,r,a/2):u.getActualY(this.waveConfigs[i].sensitivity,r,a)).map((r,m)=>[m*(o||0),-r])}),i++)}return f}createRowAndColWaveFrom(){var i,s;console.time("createRowAndColWaveFrom"),(i=this.rowAndColwaveFromGroup)==null||i.removeAll();let e=this.getRednerPoints(),t=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(s=this.rowAndColwaveFromGroup)==null||s.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([a,n])=>[a+e[o].pos[0],n+e[o].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:a=>{a.event.preventDefault(),this.$emit("notiifyLeadName",{event:F(y({},a),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:a=>{this.$emit("notiifyLeadName",{event:F(y({},a),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const o=e.target.name.split("_");this.activeLeadIdx=+o[0];const a=+o[1];let n=0,l=0,f=0,h=0,d=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[a].pos[0],l=this.singleWaveDataCopy[a].startInd,f=u.getPointIdxForPx(n,this.singleWaveDataCopy[a].step||1),h=this.singleWaveDataCopy[a].sens,d=this.singleWaveDataCopy[a].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[a].pos[0],l=this.waveDataCopy[a].startInd||0,f=u.getPointIdxForPx(n,this.waveDataCopy[a].step||1),h=this.waveDataCopy[a].sens,d=this.waveDataCopy[a].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[a].pos[0],l=this.addWaveDataCopy[a].startInd||0,f=u.getPointIdxForPx(n,this.addWaveDataCopy[a].step||1),h=this.addWaveDataCopy[a].sens,d=this.addWaveDataCopy[a].step),f+=l,this.$emit("notifyActiveEnlargr",{sens:h,step:d,activeLeadIdx:this.activeLeadIdx,pointIdx:f})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,o;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((a,n)=>{n=n||0,a.attr({shape:{points:t[n].data.map(([l,f])=>[l+t[n].pos[0],f+t[n].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((a,n)=>{n=n||0,a.attr({shape:{points:i[n].data.map(([l,f])=>[l+i[n].pos[0],f+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);c([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);c([w.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);c([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);c([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);c([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);c([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);c([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);c([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);c([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=c([z.default({name:"Methods"})],exports.default);
|
|
1
|
+
"use strict";var O=Object.defineProperty,B=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var G=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(e,t)=>{for(var i in t||(t={}))N.call(t,i)&&G(e,i,t[i]);if(D)for(var i of D(t))k.call(t,i)&&G(e,i,t[i]);return e},F=(e,t)=>B(e,R(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),z=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),L=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),T=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function _(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const $=T(j),X=_(g);var V=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,c=(e,t,i,s)=>{for(var o=s>1?void 0:s?Y(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&V(t,i,o),o};exports.default=class extends $.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,o,a,n,l,f,h,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(o=this.splitLineGroup)==null||o.removeAll(),(a=this.leadHeadNameGroup)==null||a.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(l=this.rulerGroup)==null||l.removeAll(),(f=this.arrowGroup)==null||f.removeAll(),(h=this.heardBeatLineGroup)==null||h.removeAll(),(d=this.sceneIns)==null||d.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs.nativeScroll)==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs.vueScroll.scrollBy({dx:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate,interval:Math.round(60/this.analyseValues[t][i].AnabyBeat.VentricularRate*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:t,startInd:0,endInd:t},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),o=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(o||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:i,startInd:0,endInd:i}}calcHighestAndLowestPoint(){const e=L.flattenDeep(this.waveLists);return{maxPoints:L.max(e)||0,minPoints:L.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.addSlidingWindowInfo={points:0,startInd:0,endInd:0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=X.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var a,n,l,f,h;(a=this.leadHeadGroup)==null||a.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let d=0;d<=this.leadModel.column;d++){s=d*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+s])break e;!this.waveConfigs[r-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[r-1+s]||"",this.waveConfigs[r-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[r-1+s].posX?this.waveConfigs[r-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,this.waveConfigs[r-1+s].posY||r*this.splitBlockHeight,u.getSens(this.waveConfigs[r-1+s].gain,this.gridConfig.cellMg),t)))}}let o=null;for(let d=0;d<this.leadModel.add;d++)!this.waveConfigs[this.longLeadConfig.leadIdxs[d]]||(o=this.waveConfigs[this.longLeadConfig.leadIdxs[d]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]],t=!1,o.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=o.posX?o.posX-this.leadHeadConfig.leadHedeWidth:0,(f=this.leadHeadGroup)==null||f.add(this.createLeadHead(i,o.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,console.log("this.leadHeadGroup",this.leadHeadGroup),(h=this.sceneIns)==null||h.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[o+e,0+t],[o+e,-i+t],[3*o+e,-i+t],[3*o+e,0+t],[4*o+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var a,n,l,f,h;(a=this.splitLineGroup)==null||a.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const d=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),r=u.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${r/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(d||0)}let t=0,i=0,s=0,o=0;for(let d=1;d<=this.leadModel.column-1;d++){t=d*e+this.leadHeadConfig.leadHedeWidth,i=d*this.leadModel.line;e:for(let r=1;r<=this.leadModel.line;r++){if(!(this.waveConfigs||[])[r-1+i])break e;if((this.waveConfigs||[])[r-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[r-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[r-1+i].posX),s=(this.waveConfigs||[])[r-1+i].leadIdx,s===void 0)break;o=u.getSens((this.waveConfigs||[])[r-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[r-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)*.5,o))}}(h=this.sceneIns)==null||h.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,o;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:y({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:y({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(o=this.sceneIns)==null||o.add(t)}drawRuler(e=0){var n,l,f;if(!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const a=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&a){const h=u.getPointIdxForPx(this.splitPoint,a),d=u.getDataLenTimes(h,this.rulerConfig.sampleRate||0)/1e3;o=e+d}for(let h=e;h<=o;h=+(h+.1).toFixed(1))h!==e&&(i+=this.rulerStep),h%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:h+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(l=this.rulerGroup)==null||l.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(),this.drawLoopArrow()}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,o=this.slidingWindowInfo.endInd||0;const a=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),l=[],f=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let h=0;h<1;h++){e=h*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=f;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:s,endInd:o,step:a,sens:n,data:i.slice(s,o).map((r,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,n)).map((r,m)=>[m*(a||0),-r])})}return l}createSingleWaveFrom(){var o,a,n;(o=this.singleWaveFromGroup)==null||o.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(a=this.singleWaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,h])=>[f+e[l].pos[0],h+e[l].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{this.onDbClickWaveFrom(f,"single")}})),(n=this.singleWaveFromGroup)==null||n.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var f,h,d,r,m,C,v,H,P,x,A,M;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const I=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(I||0)-this.splitBlockHeight/3.5}else i=20;let s=0,o=0;const a={fontSize:12,fill:"red",fontFamily:this.fontFamily},n=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let l=0;for(let I=0;I<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;I++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][I];if(l=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&l>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&l>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=l*(n||0)+this.leadHeadConfig.leadHedeWidth-9.5,o=0,(d=this.arrowGroup)==null||d.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((h=(f=this.currentHeardBeat)==null?void 0:f.heardBeat)==null?void 0:h.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:W=>{var b;!this.heartFight.mode||(W.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(S=>S.name==="arrow_box").forEach(S=>{S.id!==W.target.id&&S.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,W.target))}})),this.heartFight.heartrate&&(s=((r=this.AssistCtx)==null?void 0:r.measureText(`${(p==null?void 0:p.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.heartrate)||""}`},a)})),o+=12),this.heartFight.interval&&(s=((C=this.AssistCtx)==null?void 0:C.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.interval)||""}`},a)})),o+=12),this.heartFight.qrstCompany&&(s=((H=this.AssistCtx)==null?void 0:H.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(P=this.arrowGroup)==null||P.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},a)})),o+=12),this.heartFight.telectricalaxis&&(s=((x=this.AssistCtx)==null?void 0:x.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(A=this.arrowGroup)==null||A.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:o+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},a)})))}}(M=this.sceneIns)==null||M.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",g.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var n,l,f,h,d,r,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.remove(this.heardBeatLineGroup);let t={},i=0,s=this.getRednerPoints(),o=this.getAddRednerPoints(),a;e:for(let C=0;C<s.length;C++){t=((f=this.analyseValues[C])==null?void 0:f[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(s[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(a=s[C],this.leadModel.isContinuous&&C>this.leadModel.line-1))break e;(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(a.pos[0]+i,a.pos[1]))}}e:for(let C=0;C<o.length;C++){t=((d=this.analyseValues[C])==null?void 0:d[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(o[C].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[C])&&this.isLeadDel(this.longLeadConfig.leadIdxs[C]))continue;if(e>t[v])break e;a=o[C],(r=this.heardBeatLineGroup)==null||r.add(this.createHeardBeatLine(a.pos[0]+i,a.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,s=null,o=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,o=[],a=0,n=0;for(let l=0;l<this.leadModel.add;l++)s=this.longLeadConfig.leadIdxs[l],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,a=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(l+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],l===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:o.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((f,h)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,f,n/2):u.getActualY(this.waveConfigs[s].sensitivity,f,n)).map((f,h)=>[h*(a||0),-f]),sens:n,step:a}));return e}createAddWaveFrom(){var t;let e=this.getAddRednerPoints();for(let i=0;i<e.length;i++)this.isLeadDel(this.longLeadConfig.leadIdxs[i])||((t=this.addwaveFromGroup)==null||t.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[i]+"_"+i,shape:{points:e[i].data.map(([s,o])=>[s+e[i].pos[0],o+e[i].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:s=>{this.onDbClickWaveFrom(s,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[i],e[i].pos[0],e[i].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[i],e[i].pos[0]-5,e[i].pos[1]-(e[i].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,a=0,n=this.slidingWindowInfo.startInd||0,l=this.slidingWindowInfo.endInd||0;const f=[];for(let h=0;h<this.leadModel.column;h++){e=h*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&h>0&&(n=l,l=n+(this.slidingWindowInfo.points||0));for(let d=1;d<=this.leadModel.line&&(t=d*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));d++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,o=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),a=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),f.push({pos:[e,t],startInd:n,endInd:l,sens:a,step:o,data:s.slice(n,l).map((r,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,r,a/2):u.getActualY(this.waveConfigs[i].sensitivity,r,a)).map((r,m)=>[m*(o||0),-r])}),i++)}return f}createRowAndColWaveFrom(){var i,s;console.time("createRowAndColWaveFrom"),(i=this.rowAndColwaveFromGroup)==null||i.removeAll();let e=this.getRednerPoints(),t=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(s=this.rowAndColwaveFromGroup)==null||s.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([a,n])=>[a+e[o].pos[0],n+e[o].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:a=>{a.event.preventDefault(),this.$emit("notiifyLeadName",{event:F(y({},a),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:a=>{this.$emit("notiifyLeadName",{event:F(y({},a),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const o=e.target.name.split("_");this.activeLeadIdx=+o[0];const a=+o[1];let n=0,l=0,f=0,h=0,d=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[a].pos[0],l=this.singleWaveDataCopy[a].startInd,f=u.getPointIdxForPx(n,this.singleWaveDataCopy[a].step||1),h=this.singleWaveDataCopy[a].sens,d=this.singleWaveDataCopy[a].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[a].pos[0],l=this.waveDataCopy[a].startInd||0,f=u.getPointIdxForPx(n,this.waveDataCopy[a].step||1),h=this.waveDataCopy[a].sens,d=this.waveDataCopy[a].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[a].pos[0],l=this.addWaveDataCopy[a].startInd||0,f=u.getPointIdxForPx(n,this.addWaveDataCopy[a].step||1),h=this.addWaveDataCopy[a].sens,d=this.addWaveDataCopy[a].step),f+=l,this.$emit("notifyActiveEnlargr",{sens:h,step:d,activeLeadIdx:this.activeLeadIdx,pointIdx:f})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,o;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((a,n)=>{n=n||0,a.attr({shape:{points:t[n].data.map(([l,f])=>[l+t[n].pos[0],f+t[n].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((a,n)=>{n=n||0,a.attr({shape:{points:i[n].data.map(([l,f])=>[l+i[n].pos[0],f+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);c([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);c([w.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);c([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);c([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);c([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);c([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);c([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);c([w.Prop({default:()=>0})],exports.default.prototype,"posStart",2);c([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);c([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=c([z.default({name:"Methods"})],exports.default);
|