costy-plus 1.0.67-0 → 1.0.68-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/method.js +4 -4
- package/dist/es/src/monitorWave/interface.d.ts +0 -17
- package/dist/es/src/monitorWave/method.d.ts +1 -4
- package/dist/es/src/monitorWave/method.js +109 -153
- package/dist/lib/src/CommonWaveForm/method.js +1 -1
- package/dist/lib/src/monitorWave/interface.d.ts +0 -17
- package/dist/lib/src/monitorWave/method.d.ts +1 -4
- package/dist/lib/src/monitorWave/method.js +1 -1
- package/package.json +1 -1
|
@@ -105,18 +105,18 @@ let g = class extends E {
|
|
|
105
105
|
initSlidingWindowInfo() {
|
|
106
106
|
const e = this.publicStep || 0, t = Math.ceil(this.splitPoint / e);
|
|
107
107
|
if (this.slidingWindowInfo = {
|
|
108
|
-
points: this.slidingWindowInfo.points
|
|
108
|
+
points: this.slidingWindowInfo.points <= t ? t : this.slidingWindowInfo.points,
|
|
109
109
|
startInd: this.slidingWindowInfo.startInd || 0,
|
|
110
|
-
endInd: this.slidingWindowInfo.endInd
|
|
110
|
+
endInd: this.slidingWindowInfo.endInd <= t ? t : this.slidingWindowInfo.endInd
|
|
111
111
|
}, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
|
|
112
112
|
const s = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), a = this.dataTotalLength * s;
|
|
113
113
|
this.vuescrollWH.width = this.canvasContainer.width + (a || 0) - this.splitPoint;
|
|
114
114
|
}
|
|
115
115
|
const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
|
|
116
116
|
this.addSlidingWindowInfo = {
|
|
117
|
-
points: this.addSlidingWindowInfo.points
|
|
117
|
+
points: this.addSlidingWindowInfo.points <= i ? i : this.addSlidingWindowInfo.points,
|
|
118
118
|
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
119
|
-
endInd: this.addSlidingWindowInfo.endInd
|
|
119
|
+
endInd: this.addSlidingWindowInfo.endInd <= i ? i : this.addSlidingWindowInfo.endInd
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
calcHighestAndLowestPoint() {
|
|
@@ -92,20 +92,3 @@ export interface BottomTimeConfig {
|
|
|
92
92
|
speed: number;
|
|
93
93
|
startTime: string;
|
|
94
94
|
}
|
|
95
|
-
/** 顶部时间线设置*/
|
|
96
|
-
export interface TopTimeLineConfig {
|
|
97
|
-
isShow: boolean;
|
|
98
|
-
/** 采样率 */
|
|
99
|
-
sampleRate: number;
|
|
100
|
-
/** 增益 */
|
|
101
|
-
gain: number;
|
|
102
|
-
/** 走纸 */
|
|
103
|
-
speed: number;
|
|
104
|
-
/** 颜色 */
|
|
105
|
-
color: string;
|
|
106
|
-
startTime: string;
|
|
107
|
-
/** 开始画线时间*/
|
|
108
|
-
startLineTime: string;
|
|
109
|
-
/** 结束画线时间*/
|
|
110
|
-
endLineTime: string;
|
|
111
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vue } from 'vue-property-decorator';
|
|
2
2
|
import type { Config as vueScrollConfig } from 'vuescroll';
|
|
3
3
|
import { ZRenderType, Group, Polyline, Line, ElementEvent } from 'zrender';
|
|
4
|
-
import { LeadModle, LongLeadConfig, SingleModeConfig, WaveConfig, BottomRulerConfig, BottomTimeConfig
|
|
4
|
+
import { LeadModle, LongLeadConfig, SingleModeConfig, WaveConfig, BottomRulerConfig, BottomTimeConfig } from './interface';
|
|
5
5
|
import { LeadHeadConfig, MXLeadConfig } from '../../types/EcgWave';
|
|
6
6
|
import { MXGridConfig } from '../../types/BackgroundGrid';
|
|
7
7
|
import { HandleScrollParams } from '../../types/Common';
|
|
@@ -21,7 +21,6 @@ export default class Methods extends Vue {
|
|
|
21
21
|
/** 底部导联尺子配置 */
|
|
22
22
|
protected rulerConfig: BottomRulerConfig;
|
|
23
23
|
protected timeConfig: BottomTimeConfig;
|
|
24
|
-
protected timeLineConfig: TopTimeLineConfig;
|
|
25
24
|
/** 导联配置 */
|
|
26
25
|
protected leadConfig: MXLeadConfig;
|
|
27
26
|
/** 网格配置 */
|
|
@@ -181,8 +180,6 @@ export default class Methods extends Vue {
|
|
|
181
180
|
protected drawRulerNotes(): void;
|
|
182
181
|
/** 绘制标尺 */
|
|
183
182
|
protected drawRuler(startTimes?: number): void;
|
|
184
|
-
/** 绘制标尺 */
|
|
185
|
-
protected drawTopTimeLine(startTimes?: number): void;
|
|
186
183
|
timestampToTime(timestamp?: number): string;
|
|
187
184
|
/** 绘制标尺 */
|
|
188
185
|
protected drawTimeLine(startTimes?: number): void;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
1
|
+
var G = Object.defineProperty, x = Object.defineProperties;
|
|
2
2
|
var D = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var A = (e, t, i) => t in e ?
|
|
3
|
+
var L = Object.getOwnPropertySymbols;
|
|
4
|
+
var O = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var A = (e, t, i) => t in e ? G(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, S = (e, t) => {
|
|
6
6
|
for (var i in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var i of
|
|
10
|
-
|
|
7
|
+
O.call(t, i) && A(e, i, t[i]);
|
|
8
|
+
if (L)
|
|
9
|
+
for (var i of L(t))
|
|
10
|
+
P.call(t, i) && A(e, i, t[i]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, H = (e, t) => x(e, D(t));
|
|
13
13
|
import N from "vue";
|
|
14
|
-
import
|
|
14
|
+
import R from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
|
|
15
15
|
import "../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js";
|
|
16
16
|
import { Prop as 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
|
-
import { flattenDeep as
|
|
18
|
-
import { throttling as
|
|
19
|
-
import * as
|
|
20
|
-
import { Group as
|
|
21
|
-
var
|
|
17
|
+
import { flattenDeep as z, max as j, min as $ } from "lodash";
|
|
18
|
+
import { throttling as b, getStepForSpeed as w, getPrintLengthToPx as B, getSens as v, getDataLenTimes as W, getPointIdxForPx as F, getActualY as I } from "@costy-plus/utils";
|
|
19
|
+
import * as k from "zrender";
|
|
20
|
+
import { Group as u, Polyline as M, Line as y, Text as C } from "zrender";
|
|
21
|
+
var T = Object.defineProperty, X = Object.getOwnPropertyDescriptor, g = (e, t, i, s) => {
|
|
22
22
|
for (var o = s > 1 ? void 0 : s ? X(t, i) : t, n = e.length - 1, a; n >= 0; n--)
|
|
23
23
|
(a = e[n]) && (o = (s ? a(t, i, o) : a(o)) || o);
|
|
24
|
-
return s && o &&
|
|
24
|
+
return s && o && T(t, i, o), o;
|
|
25
25
|
};
|
|
26
26
|
let p = class extends N {
|
|
27
27
|
constructor() {
|
|
@@ -47,8 +47,8 @@ let p = class extends N {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
destroyed() {
|
|
50
|
-
var e, t, i, s, o, n, a, h,
|
|
51
|
-
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(), (n = this.leadHeadNameGroup) == null || n.removeAll(), (a = this.leadHeadOffAndDelGroup) == null || a.removeAll(), (h = this.rulerGroup) == null || h.removeAll(), (
|
|
50
|
+
var e, t, i, s, o, n, a, h, l, f, d;
|
|
51
|
+
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(), (n = this.leadHeadNameGroup) == null || n.removeAll(), (a = this.leadHeadOffAndDelGroup) == null || a.removeAll(), (h = this.rulerGroup) == null || h.removeAll(), (l = this.arrowGroup) == null || l.removeAll(), (f = this.heardBeatLineGroup) == null || f.removeAll(), (d = this.sceneIns) == null || d.dispose();
|
|
52
52
|
}
|
|
53
53
|
initCreatedConfig() {
|
|
54
54
|
this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height, this.initConfig();
|
|
@@ -88,7 +88,7 @@ let p = class extends N {
|
|
|
88
88
|
startInd: this.slidingWindowInfo.startInd || 0,
|
|
89
89
|
endInd: this.slidingWindowInfo.endInd !== t ? t : this.slidingWindowInfo.endInd
|
|
90
90
|
}, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
|
|
91
|
-
const s =
|
|
91
|
+
const s = w(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), o = this.dataTotalLength * s;
|
|
92
92
|
this.vuescrollWH.width = this.canvasContainer.width + (o || 0) - this.splitPoint;
|
|
93
93
|
}
|
|
94
94
|
const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
|
|
@@ -99,10 +99,10 @@ let p = class extends N {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
calcHighestAndLowestPoint() {
|
|
102
|
-
const e =
|
|
102
|
+
const e = z(this.waveLists);
|
|
103
103
|
return {
|
|
104
|
-
maxPoints:
|
|
105
|
-
minPoints:
|
|
104
|
+
maxPoints: j(e) || 0,
|
|
105
|
+
minPoints: $(e) || 0
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
isLeadOff(e) {
|
|
@@ -113,33 +113,33 @@ let p = class extends N {
|
|
|
113
113
|
}
|
|
114
114
|
initConfig() {
|
|
115
115
|
var t;
|
|
116
|
-
this.rowAndColwaveFromGroup = new
|
|
116
|
+
this.rowAndColwaveFromGroup = new u({
|
|
117
117
|
name: "rowAndColwaveFrom"
|
|
118
|
-
}), this.singleWaveFromGroup = new
|
|
118
|
+
}), this.singleWaveFromGroup = new u({
|
|
119
119
|
name: "singleWaveFrom"
|
|
120
|
-
}), this.addwaveFromGroup = new
|
|
120
|
+
}), this.addwaveFromGroup = new u({
|
|
121
121
|
name: "addwaveFrom"
|
|
122
|
-
}), this.leadHeadGroup = new
|
|
122
|
+
}), this.leadHeadGroup = new u({
|
|
123
123
|
name: "leadHead"
|
|
124
|
-
}), this.splitLineGroup = new
|
|
124
|
+
}), this.splitLineGroup = new u({
|
|
125
125
|
name: "splitLine"
|
|
126
|
-
}), this.leadHeadNameGroup = new
|
|
126
|
+
}), this.leadHeadNameGroup = new u({
|
|
127
127
|
name: "leadHeadName"
|
|
128
|
-
}), this.leadHeadOffAndDelGroup = new
|
|
128
|
+
}), this.leadHeadOffAndDelGroup = new u({
|
|
129
129
|
name: "leadHeadOffAndDel"
|
|
130
|
-
}), this.rulerGroup = new
|
|
130
|
+
}), this.rulerGroup = new u({
|
|
131
131
|
name: "ruler"
|
|
132
|
-
}), this.arrowGroup = new
|
|
132
|
+
}), this.arrowGroup = new u({
|
|
133
133
|
name: "arrowLoop"
|
|
134
|
-
}), this.heardBeatLineGroup = new
|
|
134
|
+
}), this.heardBeatLineGroup = new u({
|
|
135
135
|
name: "heardBeatLine"
|
|
136
136
|
});
|
|
137
137
|
let e = this.canvasContainer.width;
|
|
138
138
|
if (this.leadModel.ecgareawidth === 1) {
|
|
139
|
-
const i =
|
|
139
|
+
const i = B(((t = this.waveConfigs[0]) == null ? void 0 : t.sampleRate) || 0) + this.leadHeadConfig.leadHedeWidth;
|
|
140
140
|
i <= e && (e = i);
|
|
141
141
|
} else if (this.leadModel.isContinuous) {
|
|
142
|
-
const i =
|
|
142
|
+
const i = w(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), s = this.dataTotalLength * i;
|
|
143
143
|
!this.leadModel.isSingleMode && (s || 0) < e - this.leadHeadConfig.leadHedeWidth && (e = (s || 0) + this.leadHeadConfig.leadHedeWidth);
|
|
144
144
|
}
|
|
145
145
|
this.drawArea = {
|
|
@@ -156,13 +156,13 @@ let p = class extends N {
|
|
|
156
156
|
}, this.loopArrowY = {
|
|
157
157
|
add: 0,
|
|
158
158
|
rowAndCol: 0
|
|
159
|
-
}, 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 =
|
|
159
|
+
}, 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 = w(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), this.rulerStep = (this.publicStep || 1) * (this.leadModel.publicSampleRate || 1) / (this.gridConfig.cellMg * 2 + 2);
|
|
160
160
|
}
|
|
161
161
|
initWaveFormPeer() {
|
|
162
162
|
var i;
|
|
163
163
|
(i = this.sceneIns) == null || i.dispose(), this.AssistCtx = null;
|
|
164
164
|
const e = document.getElementById(`${this.prefixId}wave-from-box`);
|
|
165
|
-
this.sceneIns =
|
|
165
|
+
this.sceneIns = k.init(e, {
|
|
166
166
|
width: this.canvasContainer.width,
|
|
167
167
|
height: this.canvasContainer.height,
|
|
168
168
|
devicePixelRatio: 2
|
|
@@ -190,11 +190,11 @@ let p = class extends N {
|
|
|
190
190
|
(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);
|
|
191
191
|
}
|
|
192
192
|
drawLeadHead() {
|
|
193
|
-
var n, a, h,
|
|
193
|
+
var n, a, h, l, f;
|
|
194
194
|
(n = this.leadHeadGroup) == null || n.removeAll(), (a = this.sceneIns) == null || a.remove(this.leadHeadGroup), console.log("this.waveConfigs", this.waveConfigs);
|
|
195
195
|
let e = "", t = !1, i = 0, s = 0;
|
|
196
|
-
for (let
|
|
197
|
-
s =
|
|
196
|
+
for (let d = 0; d <= this.leadModel.column; d++) {
|
|
197
|
+
s = d * this.leadModel.line;
|
|
198
198
|
e:
|
|
199
199
|
for (let r = 1; r <= this.leadModel.line; r++) {
|
|
200
200
|
if (!(this.waveConfigs || [])[r - 1 + s])
|
|
@@ -210,11 +210,11 @@ let p = class extends N {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
let o = null;
|
|
213
|
-
for (let
|
|
214
|
-
!this.waveConfigs[this.longLeadConfig.leadIdxs[
|
|
213
|
+
for (let d = 0; d < this.leadModel.add; d++)
|
|
214
|
+
!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, (l = this.leadHeadGroup) == null || l.add(
|
|
215
215
|
this.createLeadHead(
|
|
216
216
|
i,
|
|
217
|
-
o.posY || (
|
|
217
|
+
o.posY || (d + 1 + this.leadModel.line) * this.splitBlockHeight,
|
|
218
218
|
v(o.gain, this.gridConfig.cellMg),
|
|
219
219
|
t
|
|
220
220
|
)
|
|
@@ -223,7 +223,7 @@ let p = class extends N {
|
|
|
223
223
|
}
|
|
224
224
|
createLeadHead(e, t, i, s) {
|
|
225
225
|
const o = this.leadHeadConfig.leadHedeWidth / 4;
|
|
226
|
-
return i = s ? i / 2 : i, new
|
|
226
|
+
return i = s ? i / 2 : i, new M({
|
|
227
227
|
cursor: "",
|
|
228
228
|
shape: {
|
|
229
229
|
points: [
|
|
@@ -260,23 +260,23 @@ let p = class extends N {
|
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
drawColSplitLine() {
|
|
263
|
-
var n, a, h,
|
|
263
|
+
var n, a, h, l, f;
|
|
264
264
|
(n = this.splitLineGroup) == null || n.removeAll(), (a = this.sceneIns) == null || a.remove(this.splitLineGroup);
|
|
265
265
|
const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
|
|
266
266
|
if (this.splitPoint = e, this.leadModel.isSingleMode) {
|
|
267
|
-
const
|
|
267
|
+
const d = w(
|
|
268
268
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
269
269
|
this.gridConfig.cellMg,
|
|
270
270
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
271
|
-
), r =
|
|
272
|
-
Math.ceil(this.splitPoint / (
|
|
271
|
+
), r = W(
|
|
272
|
+
Math.ceil(this.splitPoint / (d || 1)) || 0,
|
|
273
273
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0
|
|
274
274
|
), m = parseInt(`${r / 1e3 % 60}`, 10);
|
|
275
|
-
this.splitPoint = m * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (
|
|
275
|
+
this.splitPoint = m * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (d || 0);
|
|
276
276
|
}
|
|
277
277
|
let t = 0, i = 0, s = 0, o = 0;
|
|
278
|
-
for (let
|
|
279
|
-
t =
|
|
278
|
+
for (let d = 1; d <= this.leadModel.column - 1; d++) {
|
|
279
|
+
t = d * e + this.leadHeadConfig.leadHedeWidth, i = d * this.leadModel.line;
|
|
280
280
|
e:
|
|
281
281
|
for (let r = 1; r <= this.leadModel.line; r++) {
|
|
282
282
|
if (!(this.waveConfigs || [])[r - 1 + i])
|
|
@@ -292,7 +292,7 @@ let p = class extends N {
|
|
|
292
292
|
o,
|
|
293
293
|
!0
|
|
294
294
|
)
|
|
295
|
-
) : (
|
|
295
|
+
) : (l = this.splitLineGroup) == null || l.add(
|
|
296
296
|
this.creatSplitLine(
|
|
297
297
|
t,
|
|
298
298
|
((this.waveConfigs || [])[r - 1 + i].posY || r * this.splitBlockHeight) - (o || 0) * 0.5,
|
|
@@ -304,7 +304,7 @@ let p = class extends N {
|
|
|
304
304
|
(f = this.sceneIns) == null || f.add(this.splitLineGroup);
|
|
305
305
|
}
|
|
306
306
|
creatSplitLine(e, t, i, s) {
|
|
307
|
-
return new
|
|
307
|
+
return new y({
|
|
308
308
|
cursor: "",
|
|
309
309
|
shape: {
|
|
310
310
|
x1: 0 + e,
|
|
@@ -328,13 +328,13 @@ let p = class extends N {
|
|
|
328
328
|
fontFamily: this.fontFamily
|
|
329
329
|
}, t = new C({
|
|
330
330
|
cursor: "",
|
|
331
|
-
style:
|
|
331
|
+
style: S({
|
|
332
332
|
text: "(s)",
|
|
333
333
|
x: this.leadHeadConfig.leadHedeWidth / 2 - 8,
|
|
334
334
|
y: this.canvasContainer.height - 25
|
|
335
335
|
}, e)
|
|
336
336
|
}), i = new C({
|
|
337
|
-
style:
|
|
337
|
+
style: S({
|
|
338
338
|
text: `${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,
|
|
339
339
|
x: this.leadHeadConfig.leadHedeWidth / 2 + 20,
|
|
340
340
|
y: this.canvasContainer.height - this.ruleH
|
|
@@ -343,17 +343,17 @@ let p = class extends N {
|
|
|
343
343
|
(s = this.sceneIns) == null || s.add(i), (o = this.sceneIns) == null || o.add(t);
|
|
344
344
|
}
|
|
345
345
|
drawRuler(e = 0) {
|
|
346
|
-
var a, h,
|
|
346
|
+
var a, h, l;
|
|
347
347
|
if (this.timersCopy = e, !this.rulerConfig.isShow)
|
|
348
348
|
return;
|
|
349
349
|
const t = this.dataTotalTimes / 1e3;
|
|
350
350
|
let i = this.leadHeadConfig.leadHedeWidth, s = 0, o = t;
|
|
351
|
-
const n =
|
|
351
|
+
const n = w(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
|
|
352
352
|
if (this.leadModel.isContinuous)
|
|
353
353
|
o = t * 5;
|
|
354
354
|
else if (!this.leadModel.add && n) {
|
|
355
|
-
const f =
|
|
356
|
-
o = e +
|
|
355
|
+
const f = F(this.splitPoint, n), d = W(f, this.rulerConfig.sampleRate || 0) / 1e3;
|
|
356
|
+
o = e + d;
|
|
357
357
|
}
|
|
358
358
|
for (let f = e; f <= o; f = +(f + 0.1).toFixed(1))
|
|
359
359
|
f !== e && (i += this.rulerStep), f % 1 === 0 ? (s = this.canvasContainer.height - 10, (a = this.rulerGroup) == null || a.add(new C({
|
|
@@ -366,7 +366,7 @@ let p = class extends N {
|
|
|
366
366
|
fontFamily: this.fontFamily,
|
|
367
367
|
fill: "#FF0080"
|
|
368
368
|
}
|
|
369
|
-
}))) : s = this.canvasContainer.height - 5, (h = this.rulerGroup) == null || h.add(new
|
|
369
|
+
}))) : s = this.canvasContainer.height - 5, (h = this.rulerGroup) == null || h.add(new y({
|
|
370
370
|
cursor: "",
|
|
371
371
|
shape: {
|
|
372
372
|
x1: i,
|
|
@@ -379,68 +379,38 @@ let p = class extends N {
|
|
|
379
379
|
lineWidth: 2
|
|
380
380
|
}
|
|
381
381
|
}));
|
|
382
|
-
(
|
|
383
|
-
}
|
|
384
|
-
drawTopTimeLine(e = 0) {
|
|
385
|
-
var d, f;
|
|
386
|
-
if (this.timersCopy = e, !this.timeLineConfig.isShow)
|
|
387
|
-
return;
|
|
388
|
-
const t = this.dataTotalTimes / 1e3;
|
|
389
|
-
let i = this.leadHeadConfig.leadHedeWidth, s = t;
|
|
390
|
-
const o = u(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
|
|
391
|
-
if (this.leadModel.isContinuous)
|
|
392
|
-
s = t * 5;
|
|
393
|
-
else if (!this.leadModel.add && o) {
|
|
394
|
-
const l = M(this.splitPoint, o), r = I(l, this.rulerConfig.sampleRate || 0) / 1e3;
|
|
395
|
-
s = e + r;
|
|
396
|
-
}
|
|
397
|
-
const n = new Date(this.timeLineConfig.startLineTime).getTime() - new Date(this.timeLineConfig.startTime).getTime(), a = Math.floor(n / 1e3), h = Math.floor((new Date(this.timeLineConfig.endLineTime).getTime() - new Date(this.timeLineConfig.startTime).getTime()) / 1e3);
|
|
398
|
-
for (let l = e; l <= s; l = +(l + 0.1).toFixed(1))
|
|
399
|
-
l !== e && (i += this.rulerStep), l >= a && l <= h && ((d = this.rulerGroup) == null || d.add(new H({
|
|
400
|
-
cursor: "",
|
|
401
|
-
shape: {
|
|
402
|
-
x1: i,
|
|
403
|
-
y1: 1,
|
|
404
|
-
x2: i + this.rulerStep,
|
|
405
|
-
y2: 1
|
|
406
|
-
},
|
|
407
|
-
style: {
|
|
408
|
-
stroke: this.timeLineConfig.color,
|
|
409
|
-
lineWidth: 1
|
|
410
|
-
}
|
|
411
|
-
})));
|
|
412
|
-
(f = this.sceneIns) == null || f.add(this.rulerGroup);
|
|
382
|
+
(l = this.sceneIns) == null || l.add(this.rulerGroup);
|
|
413
383
|
}
|
|
414
384
|
timestampToTime(e = 0) {
|
|
415
385
|
const t = new Date(e), i = t.getFullYear(), s = ("0" + (t.getMonth() + 1)).slice(-2), o = ("0" + t.getDate()).slice(-2), n = ("0" + t.getHours()).slice(-2), a = ("0" + t.getMinutes()).slice(-2), h = ("0" + t.getSeconds()).slice(-2);
|
|
416
386
|
return `${i}-${s}-${o} ${n}:${a}:${h}`;
|
|
417
387
|
}
|
|
418
388
|
drawTimeLine(e = 0) {
|
|
419
|
-
var h,
|
|
389
|
+
var h, l, f;
|
|
420
390
|
if (this.timersCopy = e, !this.timeConfig.isShow)
|
|
421
391
|
return;
|
|
422
392
|
const t = this.dataTotalTimes / 1e3;
|
|
423
393
|
let i = this.leadHeadConfig.leadHedeWidth, s = 0, o = t;
|
|
424
|
-
const n =
|
|
394
|
+
const n = w(this.timeConfig.speed, this.gridConfig.cellMg, this.timeConfig.sampleRate);
|
|
425
395
|
if (this.leadModel.isContinuous)
|
|
426
396
|
o = t * 5;
|
|
427
397
|
else if (!this.leadModel.add && n) {
|
|
428
|
-
const
|
|
398
|
+
const d = F(this.splitPoint, n), r = W(d, this.timeConfig.sampleRate || 0) / 1e3;
|
|
429
399
|
o = e + r;
|
|
430
400
|
}
|
|
431
401
|
const a = new Date(this.timeConfig.startTime).getTime();
|
|
432
|
-
for (let
|
|
433
|
-
|
|
402
|
+
for (let d = e; d <= o; d = +(d + 0.1).toFixed(1))
|
|
403
|
+
d !== e && (i += this.rulerStep), d % 1 === 0 ? (s = this.canvasContainer.height - 10, (h = this.rulerGroup) == null || h.add(new C({
|
|
434
404
|
cursor: "",
|
|
435
405
|
style: {
|
|
436
406
|
x: i,
|
|
437
407
|
y: s - 15,
|
|
438
|
-
text: this.timestampToTime(a +
|
|
408
|
+
text: this.timestampToTime(a + d * 1e3).slice(11),
|
|
439
409
|
fontSize: 13,
|
|
440
410
|
fontFamily: this.fontFamily,
|
|
441
411
|
fill: "#000"
|
|
442
412
|
}
|
|
443
|
-
})), (
|
|
413
|
+
})), (l = this.rulerGroup) == null || l.add(new y({
|
|
444
414
|
cursor: "",
|
|
445
415
|
shape: {
|
|
446
416
|
x1: i,
|
|
@@ -457,27 +427,27 @@ let p = class extends N {
|
|
|
457
427
|
}
|
|
458
428
|
drawWaveFrom() {
|
|
459
429
|
var e, t, i;
|
|
460
|
-
this.leadModel.isSingleMode ? (this.addWaveDataCopy = [], this.waveDataCopy = [], this.createSingleWaveFrom(), (e = this.sceneIns) == null || e.add(this.singleWaveFromGroup)) : (this.singleWaveDataCopy = [], this.createAddWaveFrom(), this.createRowAndColWaveFrom(), (t = this.sceneIns) == null || t.add(this.rowAndColwaveFromGroup), (i = this.sceneIns) == null || i.add(this.addwaveFromGroup)), this.drawLeadHeadNameAndOffOrDel(), this.drawRuler(this.timersCopy), this.drawTimeLine(this.timersCopy)
|
|
430
|
+
this.leadModel.isSingleMode ? (this.addWaveDataCopy = [], this.waveDataCopy = [], this.createSingleWaveFrom(), (e = this.sceneIns) == null || e.add(this.singleWaveFromGroup)) : (this.singleWaveDataCopy = [], this.createAddWaveFrom(), this.createRowAndColWaveFrom(), (t = this.sceneIns) == null || t.add(this.rowAndColwaveFromGroup), (i = this.sceneIns) == null || i.add(this.addwaveFromGroup)), this.drawLeadHeadNameAndOffOrDel(), this.drawRuler(this.timersCopy), this.drawTimeLine(this.timersCopy);
|
|
461
431
|
}
|
|
462
432
|
getRednerSinglePoints() {
|
|
463
433
|
let e = 0, t = 0;
|
|
464
434
|
const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
|
|
465
435
|
let s = this.slidingWindowInfo.startInd || 0, o = this.slidingWindowInfo.endInd || 0;
|
|
466
|
-
const n =
|
|
436
|
+
const n = w(
|
|
467
437
|
this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
|
|
468
438
|
this.gridConfig.cellMg,
|
|
469
439
|
this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
|
|
470
|
-
), a = v(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [],
|
|
440
|
+
), a = v(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [], l = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
|
|
471
441
|
for (let f = 0; f < 1; f++) {
|
|
472
442
|
e = f * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
|
|
473
|
-
for (let
|
|
474
|
-
t =
|
|
443
|
+
for (let d = 1; d <= l; d++)
|
|
444
|
+
t = d * this.splitBlockHeight, d > 1 && (t *= 0.8, s = o, o = s + (this.slidingWindowInfo.points || 0)), d === 1 && (this.loopArrowY.rowAndCol = t), h.push({
|
|
475
445
|
pos: [e, t],
|
|
476
446
|
startInd: s,
|
|
477
447
|
endInd: o,
|
|
478
448
|
step: n,
|
|
479
449
|
sens: a,
|
|
480
|
-
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) ?
|
|
450
|
+
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) ? I(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, r, a / 2) : I(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, r, a)).map((r, m) => [m * (n || 0), -r])
|
|
481
451
|
});
|
|
482
452
|
}
|
|
483
453
|
return h;
|
|
@@ -485,18 +455,18 @@ let p = class extends N {
|
|
|
485
455
|
createSingleWaveFrom() {
|
|
486
456
|
var n, a, h;
|
|
487
457
|
(n = this.singleWaveFromGroup) == null || n.removeAll();
|
|
488
|
-
let e = this.getRednerSinglePoints(), t =
|
|
489
|
-
for (let
|
|
490
|
-
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
|
|
458
|
+
let e = this.getRednerSinglePoints(), t = W(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0), i = 0, s = 0, o = 0;
|
|
459
|
+
for (let l = 0; l < e.length && !(e[l].pos[1] > this.drawArea.height + this.bottomAreaHeight); l++)
|
|
460
|
+
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 M({
|
|
491
461
|
cursor: "",
|
|
492
|
-
name: this.singleModeConfig.defaultSelect + "_" +
|
|
462
|
+
name: this.singleModeConfig.defaultSelect + "_" + l,
|
|
493
463
|
shape: {
|
|
494
|
-
points: e[
|
|
495
|
-
e[
|
|
496
|
-
e[
|
|
464
|
+
points: e[l].data.map(([f, d], r) => isNaN(d) ? (o === 0 && (o = r - 1, o = o < 0 ? 0 : o), [
|
|
465
|
+
e[l].data[o][0] + e[l].pos[0],
|
|
466
|
+
e[l].data[o][1] + e[l].pos[1]
|
|
497
467
|
]) : (o = 0, [
|
|
498
|
-
f + e[
|
|
499
|
-
|
|
468
|
+
f + e[l].pos[0],
|
|
469
|
+
d + e[l].pos[1]
|
|
500
470
|
]))
|
|
501
471
|
},
|
|
502
472
|
style: {
|
|
@@ -509,18 +479,18 @@ let p = class extends N {
|
|
|
509
479
|
})), (h = this.singleWaveFromGroup) == null || h.add(new C({
|
|
510
480
|
cursor: "",
|
|
511
481
|
style: {
|
|
512
|
-
x: e[
|
|
513
|
-
y: e[
|
|
514
|
-
text:
|
|
482
|
+
x: e[l].pos[0],
|
|
483
|
+
y: e[l].pos[1] - (e[l].sens || 0) / 2,
|
|
484
|
+
text: l === 0 ? "00:00 \u5FC3\u7387" : `${i}:${s} \u5FC3\u7387`,
|
|
515
485
|
fontWeight: "bold",
|
|
516
486
|
fontSize: 14,
|
|
517
487
|
fill: "#FF0080",
|
|
518
488
|
fontFamily: this.fontFamily
|
|
519
489
|
}
|
|
520
|
-
})),
|
|
490
|
+
})), l > 0 && (t += t)), this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx, e[0].pos[0] - 10, e[0].pos[1] + 10), this.createLeadOffAndDel(
|
|
521
491
|
this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,
|
|
522
492
|
e[0].pos[0] - 5,
|
|
523
|
-
e[0].pos[1] - (e[
|
|
493
|
+
e[0].pos[1] - (e[l].sens || 0) / 2 - 15
|
|
524
494
|
);
|
|
525
495
|
this.singleWaveDataCopy = e, e = null;
|
|
526
496
|
}
|
|
@@ -532,11 +502,11 @@ let p = class extends N {
|
|
|
532
502
|
const e = [];
|
|
533
503
|
let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, o = [], n = 0, a = 0;
|
|
534
504
|
for (let h = 0; h < this.leadModel.add; h++)
|
|
535
|
-
s = this.longLeadConfig.leadIdxs[h], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, n =
|
|
505
|
+
s = this.longLeadConfig.leadIdxs[h], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, n = w(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), a = v(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (h + this.leadModel.line + 1) * this.splitBlockHeight, o = this.waveLists[s] || [], h === 0 && (this.loopArrowY.add = i), e.push({
|
|
536
506
|
pos: [t, i],
|
|
537
507
|
startInd: this.addSlidingWindowInfo.startInd || 0,
|
|
538
508
|
endInd: this.addSlidingWindowInfo.endInd || 0,
|
|
539
|
-
data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((
|
|
509
|
+
data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((l, f) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? I(this.waveConfigs[s].sensitivity, l, a / 2) : I(this.waveConfigs[s].sensitivity, l, a)).map((l, f) => [f * (n || 0), -l]),
|
|
540
510
|
sens: a,
|
|
541
511
|
step: n
|
|
542
512
|
}));
|
|
@@ -546,7 +516,7 @@ let p = class extends N {
|
|
|
546
516
|
var i;
|
|
547
517
|
let e = this.getAddRednerPoints(), t = 0;
|
|
548
518
|
for (let s = 0; s < e.length; s++)
|
|
549
|
-
this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new
|
|
519
|
+
this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new M({
|
|
550
520
|
cursor: "",
|
|
551
521
|
name: this.longLeadConfig.leadIdxs[s] + "_" + s,
|
|
552
522
|
shape: {
|
|
@@ -570,31 +540,31 @@ let p = class extends N {
|
|
|
570
540
|
}
|
|
571
541
|
getRednerPoints() {
|
|
572
542
|
let e = 0, t = 0, i = 0, s = [], o = 0, n = 0, a = this.slidingWindowInfo.startInd || 0, h = this.slidingWindowInfo.endInd || 0;
|
|
573
|
-
const
|
|
543
|
+
const l = [];
|
|
574
544
|
for (let f = 0; f < this.leadModel.column; f++) {
|
|
575
545
|
e = f * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && f > 0 && (a = h, h = a + (this.slidingWindowInfo.points || 0));
|
|
576
|
-
for (let
|
|
577
|
-
e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o =
|
|
546
|
+
for (let d = 1; d <= this.leadModel.line && (t = d * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); d++)
|
|
547
|
+
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), n = v(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (d === 1 && (this.loopArrowY.rowAndCol = t), l.push({
|
|
578
548
|
pos: [e, t],
|
|
579
549
|
startInd: a,
|
|
580
550
|
endInd: h,
|
|
581
551
|
sens: n,
|
|
582
552
|
step: o,
|
|
583
|
-
data: s.slice(a, h).map((r, m) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ?
|
|
553
|
+
data: s.slice(a, h).map((r, m) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? I(this.waveConfigs[i].sensitivity, r, n / 2) : I(this.waveConfigs[i].sensitivity, r, n)).map((r, m) => [m * (o || 0), -r])
|
|
584
554
|
}), i++);
|
|
585
555
|
}
|
|
586
|
-
return
|
|
556
|
+
return l;
|
|
587
557
|
}
|
|
588
558
|
createRowAndColWaveFrom() {
|
|
589
559
|
var s, o;
|
|
590
560
|
(s = this.rowAndColwaveFromGroup) == null || s.removeAll();
|
|
591
561
|
let e = this.getRednerPoints(), t = 0, i = 0;
|
|
592
562
|
for (let n = 0; n < e.length; n++)
|
|
593
|
-
t = this.waveConfigs[n].leadIdx || 0, this.isLeadDel(t) || (o = this.rowAndColwaveFromGroup) == null || o.add(new
|
|
563
|
+
t = this.waveConfigs[n].leadIdx || 0, this.isLeadDel(t) || (o = this.rowAndColwaveFromGroup) == null || o.add(new M({
|
|
594
564
|
cursor: "",
|
|
595
565
|
name: n + "_" + n,
|
|
596
566
|
shape: {
|
|
597
|
-
points: e[n].data.map(([a, h],
|
|
567
|
+
points: e[n].data.map(([a, h], l) => isNaN(h) ? (i === 0 && (i = l - 1, i = i < 0 ? 0 : i), [
|
|
598
568
|
e[n].data[i][0] + e[n].pos[0],
|
|
599
569
|
e[n].data[i][1] + e[n].pos[1]
|
|
600
570
|
]) : (i = 0, [
|
|
@@ -625,7 +595,7 @@ let p = class extends N {
|
|
|
625
595
|
},
|
|
626
596
|
oncontextmenu: (n) => {
|
|
627
597
|
n.event.preventDefault(), this.$emit("notiifyLeadName", {
|
|
628
|
-
event:
|
|
598
|
+
event: H(S({}, n), {
|
|
629
599
|
name: this.leadNames[e],
|
|
630
600
|
idx: e
|
|
631
601
|
}),
|
|
@@ -634,7 +604,7 @@ let p = class extends N {
|
|
|
634
604
|
},
|
|
635
605
|
onclick: (n) => {
|
|
636
606
|
this.$emit("notiifyLeadName", {
|
|
637
|
-
event:
|
|
607
|
+
event: H(S({}, n), {
|
|
638
608
|
name: this.leadNames[e],
|
|
639
609
|
idx: e
|
|
640
610
|
}),
|
|
@@ -665,7 +635,7 @@ let p = class extends N {
|
|
|
665
635
|
t.type === "horizontal" && (t.scrollLeft = t.scrollLeft || 0, this.scrollCommon(t.scrollLeft));
|
|
666
636
|
}
|
|
667
637
|
scrollCommon(e) {
|
|
668
|
-
const t =
|
|
638
|
+
const t = F(e, this.publicStep || 1);
|
|
669
639
|
this.scrollWaveFrom(t), this.scrollRuler(t), this.scrollArrow(t), this.$emit("notifyScrollPointIdx", {
|
|
670
640
|
slidIdxs: t,
|
|
671
641
|
scrollLeft: e
|
|
@@ -678,18 +648,18 @@ let p = class extends N {
|
|
|
678
648
|
this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((n, a) => {
|
|
679
649
|
a = a || 0, !(!t[a] || !t[a].data) && n.attr({
|
|
680
650
|
shape: {
|
|
681
|
-
points: t[a].data.map(([h,
|
|
651
|
+
points: t[a].data.map(([h, l]) => [
|
|
682
652
|
h + t[a].pos[0],
|
|
683
|
-
|
|
653
|
+
l + t[a].pos[1]
|
|
684
654
|
])
|
|
685
655
|
}
|
|
686
656
|
});
|
|
687
657
|
}), (o = this.addwaveFromGroup) == null || o.eachChild((n, a) => {
|
|
688
658
|
a = a || 0, !(!i[a] || !i[a].data) && n.attr({
|
|
689
659
|
shape: {
|
|
690
|
-
points: i[a].data.map(([h,
|
|
660
|
+
points: i[a].data.map(([h, l]) => [
|
|
691
661
|
h + i[a].pos[0],
|
|
692
|
-
|
|
662
|
+
l + i[a].pos[1]
|
|
693
663
|
])
|
|
694
664
|
}
|
|
695
665
|
});
|
|
@@ -698,8 +668,8 @@ let p = class extends N {
|
|
|
698
668
|
scrollRuler(e) {
|
|
699
669
|
var i, s;
|
|
700
670
|
(i = this.rulerGroup) == null || i.removeAll(), (s = this.sceneIns) == null || s.remove(this.rulerGroup);
|
|
701
|
-
const t =
|
|
702
|
-
this.drawRuler(t), this.drawTimeLine(t)
|
|
671
|
+
const t = W(this.leadModel.isSingleMode ? 0 : e, this.leadModel.publicSampleRate || 0) / 1e3;
|
|
672
|
+
this.drawRuler(t), this.drawTimeLine(t);
|
|
703
673
|
}
|
|
704
674
|
scrollArrow(e) {
|
|
705
675
|
var t, i;
|
|
@@ -769,20 +739,6 @@ g([
|
|
|
769
739
|
})
|
|
770
740
|
})
|
|
771
741
|
], p.prototype, "timeConfig", 2);
|
|
772
|
-
g([
|
|
773
|
-
c({
|
|
774
|
-
default: () => ({
|
|
775
|
-
isShow: !1,
|
|
776
|
-
sampleRate: 500,
|
|
777
|
-
speed: 10,
|
|
778
|
-
gain: 10,
|
|
779
|
-
startTime: "",
|
|
780
|
-
startLineTime: "",
|
|
781
|
-
endLineTime: "",
|
|
782
|
-
color: ""
|
|
783
|
-
})
|
|
784
|
-
})
|
|
785
|
-
], p.prototype, "timeLineConfig", 2);
|
|
786
742
|
g([
|
|
787
743
|
c({
|
|
788
744
|
default: () => ({
|
|
@@ -849,13 +805,13 @@ g([
|
|
|
849
805
|
})
|
|
850
806
|
], p.prototype, "posStart", 2);
|
|
851
807
|
g([
|
|
852
|
-
|
|
808
|
+
b(200)
|
|
853
809
|
], p.prototype, "nativeScrollFunc", 1);
|
|
854
810
|
g([
|
|
855
|
-
|
|
811
|
+
b(200)
|
|
856
812
|
], p.prototype, "handleScroll", 1);
|
|
857
813
|
p = g([
|
|
858
|
-
|
|
814
|
+
R({
|
|
859
815
|
name: "Methods"
|
|
860
816
|
})
|
|
861
817
|
], p);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var O=Object.defineProperty,B=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var G=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,I=(e,t)=>{for(var i in t||(t={}))R.call(t,i)&&G(e,i,t[i]);if(D)for(var i of D(t))k.call(t,i)&&G(e,i,t[i]);return e},F=(e,t)=>B(e,N(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),z=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),x=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),T=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function _(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const $=T(j),X=_(g);var V=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,c=(e,t,i,s)=>{for(var a=s>1?void 0:s?Y(t,i):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(a=(s?n(t,i,a):n(a))||a);return s&&a&&V(t,i,a),a};exports.default=class extends $.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,d,l,f,r;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(d=this.rulerGroup)==null||d.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(r=this.sceneIns)==null||r.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate,interval:Math.round(60/this.analyseValues[t][i].AnabyBeat.VentricularRate*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd!==t?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points!==i?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd!==i?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=x.flattenDeep(this.waveLists);return{maxPoints:x.max(e)||0,minPoints:x.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=X.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var o,n,d,l,f;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let r=0;r<=this.leadModel.column;r++){s=r*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+s])break e;!this.waveConfigs[h-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[h-1+s]||"",this.waveConfigs[h-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[h-1+s].posX?this.waveConfigs[h-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(d=this.leadHeadGroup)==null||d.add(this.createLeadHead(i,this.waveConfigs[h-1+s].posY||h*this.splitBlockHeight,u.getSens(this.waveConfigs[h-1+s].gain,this.gridConfig.cellMg),t)))}}let a=null;for(let r=0;r<this.leadModel.add;r++)!this.waveConfigs[this.longLeadConfig.leadIdxs[r]]||(a=this.waveConfigs[this.longLeadConfig.leadIdxs[r]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]],t=!1,a.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=a.posX?a.posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,a.posY||(r+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t)));a=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const a=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[a+e,0+t],[a+e,-i+t],[3*a+e,-i+t],[3*a+e,0+t],[4*a+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var o,n,d,l,f;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const r=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),h=u.getDataLenTimes(Math.ceil(this.splitPoint/(r||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${h/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(r||0)}let t=0,i=0,s=0,a=0;for(let r=1;r<=this.leadModel.column-1;r++){t=r*e+this.leadHeadConfig.leadHedeWidth,i=r*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+i])break e;if((this.waveConfigs||[])[h-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[h-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[h-1+i].posX),s=(this.waveConfigs||[])[h-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[h-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[h-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(d=this.splitLineGroup)==null||d.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)*.5,a))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:I({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:I({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,d,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const f=u.getPointIdxForPx(this.splitPoint,o),r=u.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;a=e+r}for(let f=e;f<=a;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(d=this.rulerGroup)==null||d.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(l=this.sceneIns)==null||l.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow()}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),d=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=l;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),d.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((h,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n)).map((h,m)=>[m*(o||0),-h])})}return d}createSingleWaveFrom(){var o,n,d;(o=this.singleWaveFromGroup)==null||o.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,a=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(n=this.singleWaveFromGroup)==null||n.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,r],h)=>isNaN(r)?(a===0&&(a=h-1,a=a<0?0:a),[e[l].data[a][0]+e[l].pos[0],e[l].data[a][1]+e[l].pos[1]]):(a=0,[f+e[l].pos[0],r+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{this.onDbClickWaveFrom(f,"single")}})),(d=this.singleWaveFromGroup)==null||d.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var l,f,r,h,m,C,v,L,H,P,A,M;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const y=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(y||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily},n=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0;for(let y=0;y<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;y++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][y];if(d=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=d*(n||0)+this.leadHeadConfig.leadHedeWidth-9.5,a=0,(r=this.arrowGroup)==null||r.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((f=(l=this.currentHeardBeat)==null?void 0:l.heardBeat)==null?void 0:f.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:W=>{var b;!this.heartFight.mode||(W.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(S=>S.name==="arrow_box").forEach(S=>{S.id!==W.target.id&&S.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,W.target))}})),this.heartFight.heartrate&&(s=((h=this.AssistCtx)==null?void 0:h.measureText(`${(p==null?void 0:p.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((C=this.AssistCtx)==null?void 0:C.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(H=this.arrowGroup)==null||H.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((P=this.AssistCtx)==null?void 0:P.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(A=this.arrowGroup)==null||A.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},o)})))}}(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,d,l,f,r,h,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(d=this.sceneIns)==null||d.remove(this.heardBeatLineGroup);let t={},i=0,s=this.getRednerPoints(),a=this.getAddRednerPoints(),o;e:for(let C=0;C<s.length;C++){t=((l=this.analyseValues[C])==null?void 0:l[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(s[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=s[C],this.leadModel.isContinuous&&C>this.leadModel.line-1))break e;(f=this.heardBeatLineGroup)==null||f.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}e:for(let C=0;C<a.length;C++){t=((r=this.analyseValues[C])==null?void 0:r[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(a[C].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[C])&&this.isLeadDel(this.longLeadConfig.leadIdxs[C]))continue;if(e>t[v])break e;o=a[C],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,s=null,a=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let d=0;d<this.leadModel.add;d++)s=this.longLeadConfig.leadIdxs[d],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(d+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],d===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((l,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,l,n/2):u.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,f)=>[f*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o],n)=>isNaN(o)?(t===0&&(t=n-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[a+e[s].pos[0],o+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,d=this.slidingWindowInfo.endInd||0;const l=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(n=d,d=n+(this.slidingWindowInfo.points||0));for(let r=1;r<=this.leadModel.line&&(t=r*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));r++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(r===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:d,sens:o,step:a,data:s.slice(n,d).map((h,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,h,o/2):u.getActualY(this.waveConfigs[i].sensitivity,h,o)).map((h,m)=>[m*(a||0),-h])}),i++)}return l}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,d],l)=>isNaN(d)?(i===0&&(i=l-1,i=i<0?0:i),[e[o].data[i][0]+e[o].pos[0],e[o].data[i][1]+e[o].pos[1]]):(i=0,[n+e[o].pos[0],d+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var a;(a=this.leadHeadNameGroup)==null||a.add(new g.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:F(I({},o),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:o=>{this.$emit("notiifyLeadName",{event:F(I({},o),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,d=0,l=0,f=0,r=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],d=this.singleWaveDataCopy[o].startInd,l=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),f=this.singleWaveDataCopy[o].sens,r=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],d=this.waveDataCopy[o].startInd||0,l=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),f=this.waveDataCopy[o].sens,r=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],d=this.addWaveDataCopy[o].startInd||0,l=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),f=this.addWaveDataCopy[o].sens,r=this.addWaveDataCopy[o].step),l+=d,this.$emit("notifyActiveEnlargr",{sens:f,step:r,activeLeadIdx:this.activeLeadIdx,pointIdx:l})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,a;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((o,n)=>{n=n||0,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([d,l])=>[d+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([d,l])=>[d+i[n].pos[0],l+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);c([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);c([w.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);c([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);c([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);c([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);c([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);c([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);c([w.Prop({default:()=>0})],exports.default.prototype,"posStart",2);c([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);c([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=c([z.default({name:"Methods"})],exports.default);
|
|
1
|
+
"use strict";var O=Object.defineProperty,B=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var G=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,I=(e,t)=>{for(var i in t||(t={}))R.call(t,i)&&G(e,i,t[i]);if(D)for(var i of D(t))k.call(t,i)&&G(e,i,t[i]);return e},F=(e,t)=>B(e,N(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),z=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const w=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),x=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),T=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function _(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const $=T(j),X=_(g);var V=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,c=(e,t,i,s)=>{for(var a=s>1?void 0:s?Y(t,i):t,o=e.length-1,n;o>=0;o--)(n=e[o])&&(a=(s?n(t,i,a):n(a))||a);return s&&a&&V(t,i,a),a};exports.default=class extends $.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,d,l,f,r;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(d=this.rulerGroup)==null||d.removeAll(),(l=this.arrowGroup)==null||l.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(r=this.sceneIns)==null||r.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate,interval:Math.round(60/this.analyseValues[t][i].AnabyBeat.VentricularRate*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points<=t?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd<=t?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points<=i?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd<=i?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=x.flattenDeep(this.waveLists);return{maxPoints:x.max(e)||0,minPoints:x.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=X.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var o,n,d,l,f;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let r=0;r<=this.leadModel.column;r++){s=r*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+s])break e;!this.waveConfigs[h-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[h-1+s]||"",this.waveConfigs[h-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[h-1+s].posX?this.waveConfigs[h-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,(d=this.leadHeadGroup)==null||d.add(this.createLeadHead(i,this.waveConfigs[h-1+s].posY||h*this.splitBlockHeight,u.getSens(this.waveConfigs[h-1+s].gain,this.gridConfig.cellMg),t)))}}let a=null;for(let r=0;r<this.leadModel.add;r++)!this.waveConfigs[this.longLeadConfig.leadIdxs[r]]||(a=this.waveConfigs[this.longLeadConfig.leadIdxs[r]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]],t=!1,a.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=a.posX?a.posX-this.leadHeadConfig.leadHedeWidth:0,(l=this.leadHeadGroup)==null||l.add(this.createLeadHead(i,a.posY||(r+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t)));a=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const a=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[a+e,0+t],[a+e,-i+t],[3*a+e,-i+t],[3*a+e,0+t],[4*a+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var o,n,d,l,f;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const r=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),h=u.getDataLenTimes(Math.ceil(this.splitPoint/(r||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${h/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(r||0)}let t=0,i=0,s=0,a=0;for(let r=1;r<=this.leadModel.column-1;r++){t=r*e+this.leadHeadConfig.leadHedeWidth,i=r*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+i])break e;if((this.waveConfigs||[])[h-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[h-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[h-1+i].posX),s=(this.waveConfigs||[])[h-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[h-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[h-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(d=this.splitLineGroup)==null||d.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(l=this.splitLineGroup)==null||l.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)*.5,a))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:I({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:I({text:`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,d,l;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const f=u.getPointIdxForPx(this.splitPoint,o),r=u.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;a=e+r}for(let f=e;f<=a;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(d=this.rulerGroup)==null||d.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(l=this.sceneIns)==null||l.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow()}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),d=[],l=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=l;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),d.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((h,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n)).map((h,m)=>[m*(o||0),-h])})}return d}createSingleWaveFrom(){var o,n,d;(o=this.singleWaveFromGroup)==null||o.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,a=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(i=parseInt(`${t/1e3/60}`,10),s=parseInt(`${t/1e3%60}`,10),i=s===60?i+=1:i,i=i===0?"00":i<10?`0${i}`:i,s=s===0||s===60?"00":s<10?`0${s}`:s,(n=this.singleWaveFromGroup)==null||n.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([f,r],h)=>isNaN(r)?(a===0&&(a=h-1,a=a<0?0:a),[e[l].data[a][0]+e[l].pos[0],e[l].data[a][1]+e[l].pos[1]]):(a=0,[f+e[l].pos[0],r+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{this.onDbClickWaveFrom(f,"single")}})),(d=this.singleWaveFromGroup)==null||d.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),l>0&&(t+=t)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var l,f,r,h,m,C,v,L,H,P,A,M;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const y=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(y||0)-this.splitBlockHeight/3.5}else i=20;let s=0,a=0;const o={fontSize:12,fill:"red",fontFamily:this.fontFamily},n=u.getStepForSpeed(this.waveConfigs[this.heartFight.showIdxPai].speed,this.gridConfig.cellMg,this.waveConfigs[this.heartFight.showIdxPai].sampleRate);let d=0;for(let y=0;y<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;y++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][y];if(d=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&d>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&d>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=d*(n||0)+this.leadHeadConfig.leadHedeWidth-9.5,a=0,(r=this.arrowGroup)==null||r.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[15+t,0+i],[15+t,10+i],[19+t,10+i],[9.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((f=(l=this.currentHeardBeat)==null?void 0:l.heardBeat)==null?void 0:f.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:W=>{var b;!this.heartFight.mode||(W.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(S=>S.name==="arrow_box").forEach(S=>{S.id!==W.target.id&&S.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,W.target))}})),this.heartFight.heartrate&&(s=((h=this.AssistCtx)==null?void 0:h.measureText(`${(p==null?void 0:p.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((C=this.AssistCtx)==null?void 0:C.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(v=this.arrowGroup)==null||v.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(H=this.arrowGroup)==null||H.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((P=this.AssistCtx)==null?void 0:P.measureText(`${(p==null?void 0:p.telectricalaxis)||""}`).width)||0,(A=this.arrowGroup)==null||A.add(new g.Text({cursor:"",style:I({x:4+t-s*1.5,y:a+i,text:`${(p==null?void 0:p.telectricalaxis)||""}`},o)})))}}(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,d,l,f,r,h,m;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(d=this.sceneIns)==null||d.remove(this.heardBeatLineGroup);let t={},i=0,s=this.getRednerPoints(),a=this.getAddRednerPoints(),o;e:for(let C=0;C<s.length;C++){t=((l=this.analyseValues[C])==null?void 0:l[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(s[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(o=s[C],this.leadModel.isContinuous&&C>this.leadModel.line-1))break e;(f=this.heardBeatLineGroup)==null||f.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}e:for(let C=0;C<a.length;C++){t=((r=this.analyseValues[C])==null?void 0:r[this.currentHeardBeat.heardBeat.index].KeyPosByBeat)||{};for(const v in t)if(["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"].includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(a[C].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[C])&&this.isLeadDel(this.longLeadConfig.leadIdxs[C]))continue;if(e>t[v])break e;o=a[C],(h=this.heardBeatLineGroup)==null||h.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}(m=this.sceneIns)==null||m.add(this.heardBeatLineGroup),t=null,s=null,a=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-10,x2:e,y2:t+10},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let d=0;d<this.leadModel.add;d++)s=this.longLeadConfig.leadIdxs[d],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(d+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],d===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((l,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,l,n/2):u.getActualY(this.waveConfigs[s].sensitivity,l,n)).map((l,f)=>[f*(o||0),-l]),sens:n,step:o}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o],n)=>isNaN(o)?(t===0&&(t=n-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[a+e[s].pos[0],o+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,d=this.slidingWindowInfo.endInd||0;const l=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(n=d,d=n+(this.slidingWindowInfo.points||0));for(let r=1;r<=this.leadModel.line&&(t=r*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));r++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(r===1&&(this.loopArrowY.rowAndCol=t),l.push({pos:[e,t],startInd:n,endInd:d,sens:o,step:a,data:s.slice(n,d).map((h,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,h,o/2):u.getActualY(this.waveConfigs[i].sensitivity,h,o)).map((h,m)=>[m*(a||0),-h])}),i++)}return l}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,d],l)=>isNaN(d)?(i===0&&(i=l-1,i=i<0?0:i),[e[o].data[i][0]+e[o].pos[0],e[o].data[i][1]+e[o].pos[1]]):(i=0,[n+e[o].pos[0],d+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var a;(a=this.leadHeadNameGroup)==null||a.add(new g.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:o=>{o.event.preventDefault(),this.$emit("notiifyLeadName",{event:F(I({},o),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:o=>{this.$emit("notiifyLeadName",{event:F(I({},o),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,d=0,l=0,f=0,r=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],d=this.singleWaveDataCopy[o].startInd,l=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),f=this.singleWaveDataCopy[o].sens,r=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],d=this.waveDataCopy[o].startInd||0,l=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),f=this.waveDataCopy[o].sens,r=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],d=this.addWaveDataCopy[o].startInd||0,l=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),f=this.addWaveDataCopy[o].sens,r=this.addWaveDataCopy[o].step),l+=d,this.$emit("notifyActiveEnlargr",{sens:f,step:r,activeLeadIdx:this.activeLeadIdx,pointIdx:l})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,a;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((o,n)=>{n=n||0,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([d,l])=>[d+t[n].pos[0],l+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([d,l])=>[d+i[n].pos[0],l+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);c([w.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);c([w.Prop({default:()=>[]})],exports.default.prototype,"analyseValues",2);c([w.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"leadModel",2);c([w.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);c([w.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);c([w.Prop({required:!0})],exports.default.prototype,"gridConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0,sens:0})})],exports.default.prototype,"measurRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,heartRate:60,speed:0,sens:0})})],exports.default.prototype,"paralleRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,speed:0})})],exports.default.prototype,"magnifierRulerConfig",2);c([w.Prop({default:()=>({isShow:!1,mode:!1,defaultSelect:2,heartrate:!1,interval:!1,qrstCompany:!1,telectricalaxis:!1,showIdxPai:0})})],exports.default.prototype,"heartFight",2);c([w.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);c([w.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);c([w.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);c([w.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);c([w.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);c([w.Prop({default:()=>0})],exports.default.prototype,"posStart",2);c([u.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);c([u.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=c([z.default({name:"Methods"})],exports.default);
|
|
@@ -92,20 +92,3 @@ export interface BottomTimeConfig {
|
|
|
92
92
|
speed: number;
|
|
93
93
|
startTime: string;
|
|
94
94
|
}
|
|
95
|
-
/** 顶部时间线设置*/
|
|
96
|
-
export interface TopTimeLineConfig {
|
|
97
|
-
isShow: boolean;
|
|
98
|
-
/** 采样率 */
|
|
99
|
-
sampleRate: number;
|
|
100
|
-
/** 增益 */
|
|
101
|
-
gain: number;
|
|
102
|
-
/** 走纸 */
|
|
103
|
-
speed: number;
|
|
104
|
-
/** 颜色 */
|
|
105
|
-
color: string;
|
|
106
|
-
startTime: string;
|
|
107
|
-
/** 开始画线时间*/
|
|
108
|
-
startLineTime: string;
|
|
109
|
-
/** 结束画线时间*/
|
|
110
|
-
endLineTime: string;
|
|
111
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Vue } from 'vue-property-decorator';
|
|
2
2
|
import type { Config as vueScrollConfig } from 'vuescroll';
|
|
3
3
|
import { ZRenderType, Group, Polyline, Line, ElementEvent } from 'zrender';
|
|
4
|
-
import { LeadModle, LongLeadConfig, SingleModeConfig, WaveConfig, BottomRulerConfig, BottomTimeConfig
|
|
4
|
+
import { LeadModle, LongLeadConfig, SingleModeConfig, WaveConfig, BottomRulerConfig, BottomTimeConfig } from './interface';
|
|
5
5
|
import { LeadHeadConfig, MXLeadConfig } from '../../types/EcgWave';
|
|
6
6
|
import { MXGridConfig } from '../../types/BackgroundGrid';
|
|
7
7
|
import { HandleScrollParams } from '../../types/Common';
|
|
@@ -21,7 +21,6 @@ export default class Methods extends Vue {
|
|
|
21
21
|
/** 底部导联尺子配置 */
|
|
22
22
|
protected rulerConfig: BottomRulerConfig;
|
|
23
23
|
protected timeConfig: BottomTimeConfig;
|
|
24
|
-
protected timeLineConfig: TopTimeLineConfig;
|
|
25
24
|
/** 导联配置 */
|
|
26
25
|
protected leadConfig: MXLeadConfig;
|
|
27
26
|
/** 网格配置 */
|
|
@@ -181,8 +180,6 @@ export default class Methods extends Vue {
|
|
|
181
180
|
protected drawRulerNotes(): void;
|
|
182
181
|
/** 绘制标尺 */
|
|
183
182
|
protected drawRuler(startTimes?: number): void;
|
|
184
|
-
/** 绘制标尺 */
|
|
185
|
-
protected drawTopTimeLine(startTimes?: number): void;
|
|
186
183
|
timestampToTime(timestamp?: number): string;
|
|
187
184
|
/** 绘制标尺 */
|
|
188
185
|
protected drawTimeLine(startTimes?: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var W=Object.defineProperty,L=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var S=(e,t,i)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,w=(e,t)=>{for(var i in t||(t={}))y.call(t,i)&&S(e,i,t[i]);if(I)for(var i of I(t))F.call(t,i)&&S(e,i,t[i]);return e},C=(e,t)=>L(e,M(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("vue"),A=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const c=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("lodash"),p=require("@costy-plus/utils"),u=require("zrender"),P=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function b(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const x=P(H),G=b(u);var D=Object.defineProperty,O=Object.getOwnPropertyDescriptor,g=(e,t,i,s)=>{for(var o=s>1?void 0:s?O(t,i):t,n=e.length-1,a;n>=0;n--)(a=e[n])&&(o=(s?a(t,i,o):a(o))||o);return s&&o&&D(t,i,o),o};exports.default=class extends x.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.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,n,a,h,d,f,l;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(),(n=this.leadHeadNameGroup)==null||n.removeAll(),(a=this.leadHeadOffAndDelGroup)==null||a.removeAll(),(h=this.rulerGroup)==null||h.removeAll(),(d=this.arrowGroup)==null||d.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(l=this.sceneIns)==null||l.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd!==t?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.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:this.addSlidingWindowInfo.points!==i?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd!==i?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=v.flattenDeep(this.waveLists);return{maxPoints:v.max(e)||0,minPoints:v.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new u.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new u.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new u.Group({name:"addwaveFrom"}),this.leadHeadGroup=new u.Group({name:"leadHead"}),this.splitLineGroup=new u.Group({name:"splitLine"}),this.leadHeadNameGroup=new u.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new u.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new u.Group({name:"ruler"}),this.arrowGroup=new u.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new u.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=p.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=G.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 n,a,h,d,f;(n=this.leadHeadGroup)==null||n.removeAll(),(a=this.sceneIns)==null||a.remove(this.leadHeadGroup),console.log("this.waveConfigs",this.waveConfigs);let e="",t=!1,i=0,s=0;for(let l=0;l<=this.leadModel.column;l++){s=l*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,(h=this.leadHeadGroup)==null||h.add(this.createLeadHead(i,this.waveConfigs[r-1+s].posY||r*this.splitBlockHeight,p.getSens(this.waveConfigs[r-1+s].gain,this.gridConfig.cellMg),t)))}}let o=null;for(let l=0;l<this.leadModel.add;l++)!this.waveConfigs[this.longLeadConfig.leadIdxs[l]]||(o=this.waveConfigs[this.longLeadConfig.leadIdxs[l]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[l]]],t=!1,o.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=o.posX?o.posX-this.leadHeadConfig.leadHedeWidth:0,(d=this.leadHeadGroup)==null||d.add(this.createLeadHead(i,o.posY||(l+1+this.leadModel.line)*this.splitBlockHeight,p.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new u.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 n,a,h,d,f;(n=this.splitLineGroup)==null||n.removeAll(),(a=this.sceneIns)==null||a.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const l=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),r=p.getDataLenTimes(Math.ceil(this.splitPoint/(l||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)*(l||0)}let t=0,i=0,s=0,o=0;for(let l=1;l<=this.leadModel.column-1;l++){t=l*e+this.leadHeadConfig.leadHedeWidth,i=l*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=p.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])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(d=this.splitLineGroup)==null||d.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)*.5,o))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new u.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 u.Text({cursor:"",style:w({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new u.Text({style:w({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 a,h,d;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const f=p.getPointIdxForPx(this.splitPoint,n),l=p.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;o=e+l}for(let f=e;f<=o;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(a=this.rulerGroup)==null||a.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(h=this.rulerGroup)==null||h.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(d=this.sceneIns)==null||d.add(this.rulerGroup)}drawTopTimeLine(e=0){var d,f;if(this.timersCopy=e,!this.timeLineConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=t;const o=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)s=t*5;else if(!this.leadModel.add&&o){const l=p.getPointIdxForPx(this.splitPoint,o),r=p.getDataLenTimes(l,this.rulerConfig.sampleRate||0)/1e3;s=e+r}const n=new Date(this.timeLineConfig.startLineTime).getTime()-new Date(this.timeLineConfig.startTime).getTime(),a=Math.floor(n/1e3),h=Math.floor((new Date(this.timeLineConfig.endLineTime).getTime()-new Date(this.timeLineConfig.startTime).getTime())/1e3);for(let l=e;l<=s;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l>=a&&l<=h&&((d=this.rulerGroup)==null||d.add(new u.Line({cursor:"",shape:{x1:i,y1:1,x2:i+this.rulerStep,y2:1},style:{stroke:this.timeLineConfig.color,lineWidth:1}})));(f=this.sceneIns)==null||f.add(this.rulerGroup)}timestampToTime(e=0){const t=new Date(e),i=t.getFullYear(),s=("0"+(t.getMonth()+1)).slice(-2),o=("0"+t.getDate()).slice(-2),n=("0"+t.getHours()).slice(-2),a=("0"+t.getMinutes()).slice(-2),h=("0"+t.getSeconds()).slice(-2);return`${i}-${s}-${o} ${n}:${a}:${h}`}drawTimeLine(e=0){var h,d,f;if(this.timersCopy=e,!this.timeConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.timeConfig.speed,this.gridConfig.cellMg,this.timeConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const l=p.getPointIdxForPx(this.splitPoint,n),r=p.getDataLenTimes(l,this.timeConfig.sampleRate||0)/1e3;o=e+r}const a=new Date(this.timeConfig.startTime).getTime();for(let l=e;l<=o;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l%1===0?(s=this.canvasContainer.height-10,(h=this.rulerGroup)==null||h.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:this.timestampToTime(a+l*1e3).slice(11),fontSize:13,fontFamily:this.fontFamily,fill:"#000"}})),(d=this.rulerGroup)==null||d.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#000",lineWidth:1}}))):s=this.canvasContainer.height-5;(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawTimeLine(this.timersCopy),this.drawTopTimeLine(this.timersCopy)}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 n=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),a=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),h=[],d=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let l=1;l<=d;l++)t=l*this.splitBlockHeight,l>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),l===1&&(this.loopArrowY.rowAndCol=t),h.push({pos:[e,t],startInd:s,endInd:o,step:n,sens:a,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)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,a/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,a)).map((r,m)=>[m*(n||0),-r])})}return h}createSingleWaveFrom(){var n,a,h;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,o=0;for(let d=0;d<e.length&&!(e[d].pos[1]>this.drawArea.height+this.bottomAreaHeight);d++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(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 u.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,shape:{points:e[d].data.map(([f,l],r)=>isNaN(l)?(o===0&&(o=r-1,o=o<0?0:o),[e[d].data[o][0]+e[d].pos[0],e[d].data[o][1]+e[d].pos[1]]):(o=0,[f+e[d].pos[0],l+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{console.log(11,f)}})),(h=this.singleWaveFromGroup)==null||h.add(new u.Text({cursor:"",style:{x:e[d].pos[0],y:e[d].pos[1]-(e[d].sens||0)/2,text:d===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),d>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[d].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}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=[],n=0,a=0;for(let h=0;h<this.leadModel.add;h++)s=this.longLeadConfig.leadIdxs[h],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,n=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),a=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(h+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],h===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((d,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,d,a/2):p.getActualY(this.waveConfigs[s].sensitivity,d,a)).map((d,f)=>[f*(n||0),-d]),sens:a,step:n}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new u.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([o,n],a)=>isNaN(n)?(t===0&&(t=a-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[o+e[s].pos[0],n+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{console.log(22,o)}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,n=0,a=this.slidingWindowInfo.startInd||0,h=this.slidingWindowInfo.endInd||0;const d=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(a=h,h=a+(this.slidingWindowInfo.points||0));for(let l=1;l<=this.leadModel.line&&(t=l*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));l++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,o=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),n=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(l===1&&(this.loopArrowY.rowAndCol=t),d.push({pos:[e,t],startInd:a,endInd:h,sens:n,step:o,data:s.slice(a,h).map((r,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,r,n/2):p.getActualY(this.waveConfigs[i].sensitivity,r,n)).map((r,m)=>[m*(o||0),-r])}),i++)}return d}createRowAndColWaveFrom(){var s,o;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let n=0;n<e.length;n++)t=this.waveConfigs[n].leadIdx||0,this.isLeadDel(t)||(o=this.rowAndColwaveFromGroup)==null||o.add(new u.Polyline({cursor:"",name:n+"_"+n,shape:{points:e[n].data.map(([a,h],d)=>isNaN(h)?(i===0&&(i=d-1,i=i<0?0:i),[e[n].data[i][0]+e[n].pos[0],e[n].data[i][1]+e[n].pos[1]]):(i=0,[a+e[n].pos[0],h+e[n].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{console.log(33,a)}})),n<this.leadModel.line?(this.createLeadName(t,e[n].pos[0],e[n].pos[1]-15),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2-15)):(this.createLeadName(t,e[n].pos[0]+5,e[n].pos[1]-(e[n].sens||0)/2),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new u.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:C(w({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:C(w({},n),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new u.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=p.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,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((n,a)=>{a=a||0,!(!t[a]||!t[a].data)&&n.attr({shape:{points:t[a].data.map(([h,d])=>[h+t[a].pos[0],d+t[a].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((n,a)=>{a=a||0,!(!i[a]||!i[a].data)&&n.attr({shape:{points:i[a].data.map(([h,d])=>[h+i[a].pos[0],d+i[a].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=p.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t),this.drawTimeLine(t),this.drawTopTimeLine(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup)}};g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);g([c.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"leadModel",2);g([c.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);g([c.Prop({default:()=>({isShow:!0,sampleRate:500,speed:10,gain:10,startTime:""})})],exports.default.prototype,"timeConfig",2);g([c.Prop({default:()=>({isShow:!1,sampleRate:500,speed:10,gain:10,startTime:"",startLineTime:"",endLineTime:"",color:""})})],exports.default.prototype,"timeLineConfig",2);g([c.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"gridConfig",2);g([c.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);g([c.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);g([c.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);g([c.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);g([c.Prop({default:()=>0})],exports.default.prototype,"posStart",2);g([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);g([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([A.default({name:"Methods"})],exports.default);
|
|
1
|
+
"use strict";var W=Object.defineProperty,M=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var S=(e,t,i)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,m=(e,t)=>{for(var i in t||(t={}))F.call(t,i)&&S(e,i,t[i]);if(I)for(var i of I(t))H.call(t,i)&&S(e,i,t[i]);return e},C=(e,t)=>M(e,y(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("vue"),A=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const c=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Prop.js"),v=require("lodash"),p=require("@costy-plus/utils"),u=require("zrender"),P=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function b(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 G=P(L),x=b(u);var D=Object.defineProperty,O=Object.getOwnPropertyDescriptor,g=(e,t,i,s)=>{for(var o=s>1?void 0:s?O(t,i):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(o=(s?l(t,i,o):l(o))||o);return s&&o&&D(t,i,o),o};exports.default=class extends G.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.layerBgGroup=Object.freeze(null),this.leadHeadGroup=Object.freeze(null),this.splitLineGroup=Object.freeze(null),this.rowAndColwaveFromGroup=Object.freeze(null),this.singleWaveFromGroup=Object.freeze(null),this.addwaveFromGroup=Object.freeze(null),this.leadHeadNameGroup=Object.freeze(null),this.leadHeadOffAndDelGroup=Object.freeze(null),this.rulerGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.heardBeatLineGroup=Object.freeze(null),this.bottomAreaHeight=Object.freeze(55),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.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,n,l,h,a,f,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(),(n=this.leadHeadNameGroup)==null||n.removeAll(),(l=this.leadHeadOffAndDelGroup)==null||l.removeAll(),(h=this.rulerGroup)==null||h.removeAll(),(a=this.arrowGroup)==null||a.removeAll(),(f=this.heardBeatLineGroup)==null||f.removeAll(),(d=this.sceneIns)==null||d.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.initConfig()}init(){this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points!==t?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd!==t?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=p.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:this.addSlidingWindowInfo.points!==i?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd!==i?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=v.flattenDeep(this.waveLists);return{maxPoints:v.max(e)||0,minPoints:v.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new u.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new u.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new u.Group({name:"addwaveFrom"}),this.leadHeadGroup=new u.Group({name:"leadHead"}),this.splitLineGroup=new u.Group({name:"splitLine"}),this.leadHeadNameGroup=new u.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new u.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new u.Group({name:"ruler"}),this.arrowGroup=new u.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new u.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=p.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=p.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=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 n,l,h,a,f;(n=this.leadHeadGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.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,(h=this.leadHeadGroup)==null||h.add(this.createLeadHead(i,this.waveConfigs[r-1+s].posY||r*this.splitBlockHeight,p.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,(a=this.leadHeadGroup)==null||a.add(this.createLeadHead(i,o.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,p.getSens(o.gain,this.gridConfig.cellMg),t)));o=null,(f=this.sceneIns)==null||f.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const o=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new u.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 n,l,h,a,f;(n=this.splitLineGroup)==null||n.removeAll(),(l=this.sceneIns)==null||l.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const d=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),r=p.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),w=parseInt(`${r/1e3%60}`,10);this.splitPoint=w*(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=p.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])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)/2*.5,o,!0)):(a=this.splitLineGroup)==null||a.add(this.creatSplitLine(t,((this.waveConfigs||[])[r-1+i].posY||r*this.splitBlockHeight)-(o||0)*.5,o))}}(f=this.sceneIns)==null||f.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new u.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 u.Text({cursor:"",style:m({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new u.Text({style:m({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 l,h,a;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const f=p.getPointIdxForPx(this.splitPoint,n),d=p.getDataLenTimes(f,this.rulerConfig.sampleRate||0)/1e3;o=e+d}for(let f=e;f<=o;f=+(f+.1).toFixed(1))f!==e&&(i+=this.rulerStep),f%1===0?(s=this.canvasContainer.height-10,(l=this.rulerGroup)==null||l.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:f+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(h=this.rulerGroup)==null||h.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(a=this.sceneIns)==null||a.add(this.rulerGroup)}timestampToTime(e=0){const t=new Date(e),i=t.getFullYear(),s=("0"+(t.getMonth()+1)).slice(-2),o=("0"+t.getDate()).slice(-2),n=("0"+t.getHours()).slice(-2),l=("0"+t.getMinutes()).slice(-2),h=("0"+t.getSeconds()).slice(-2);return`${i}-${s}-${o} ${n}:${l}:${h}`}drawTimeLine(e=0){var h,a,f;if(this.timersCopy=e,!this.timeConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,o=t;const n=p.getStepForSpeed(this.timeConfig.speed,this.gridConfig.cellMg,this.timeConfig.sampleRate);if(this.leadModel.isContinuous)o=t*5;else if(!this.leadModel.add&&n){const d=p.getPointIdxForPx(this.splitPoint,n),r=p.getDataLenTimes(d,this.timeConfig.sampleRate||0)/1e3;o=e+r}const l=new Date(this.timeConfig.startTime).getTime();for(let d=e;d<=o;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d%1===0?(s=this.canvasContainer.height-10,(h=this.rulerGroup)==null||h.add(new u.Text({cursor:"",style:{x:i,y:s-15,text:this.timestampToTime(l+d*1e3).slice(11),fontSize:13,fontFamily:this.fontFamily,fill:"#000"}})),(a=this.rulerGroup)==null||a.add(new u.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#000",lineWidth:1}}))):s=this.canvasContainer.height-5;(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawTimeLine(this.timersCopy)}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 n=p.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),l=p.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),h=[],a=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let f=0;f<1;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=a;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=o,o=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),h.push({pos:[e,t],startInd:s,endInd:o,step:n,sens:l,data:i.slice(s,o).map((r,w)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,l/2):p.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,r,l)).map((r,w)=>[w*(n||0),-r])})}return h}createSingleWaveFrom(){var n,l,h;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=p.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),i=0,s=0,o=0;for(let a=0;a<e.length&&!(e[a].pos[1]>this.drawArea.height+this.bottomAreaHeight);a++)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,(l=this.singleWaveFromGroup)==null||l.add(new u.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+a,shape:{points:e[a].data.map(([f,d],r)=>isNaN(d)?(o===0&&(o=r-1,o=o<0?0:o),[e[a].data[o][0]+e[a].pos[0],e[a].data[o][1]+e[a].pos[1]]):(o=0,[f+e[a].pos[0],d+e[a].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:f=>{console.log(11,f)}})),(h=this.singleWaveFromGroup)==null||h.add(new u.Text({cursor:"",style:{x:e[a].pos[0],y:e[a].pos[1]-(e[a].sens||0)/2,text:a===0?"00:00 \u5FC3\u7387":`${i}:${s} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}})),a>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[a].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}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=[],n=0,l=0;for(let h=0;h<this.leadModel.add;h++)s=this.longLeadConfig.leadIdxs[h],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,n=p.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),l=p.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(h+this.leadModel.line+1)*this.splitBlockHeight,o=this.waveLists[s]||[],h===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((a,f)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?p.getActualY(this.waveConfigs[s].sensitivity,a,l/2):p.getActualY(this.waveConfigs[s].sensitivity,a,l)).map((a,f)=>[f*(n||0),-a]),sens:l,step:n}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new u.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([o,n],l)=>isNaN(n)?(t===0&&(t=l-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[o+e[s].pos[0],n+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:o=>{console.log(22,o)}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],o=0,n=0,l=this.slidingWindowInfo.startInd||0,h=this.slidingWindowInfo.endInd||0;const a=[];for(let f=0;f<this.leadModel.column;f++){e=f*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&f>0&&(l=h,h=l+(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=p.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),n=p.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),a.push({pos:[e,t],startInd:l,endInd:h,sens:n,step:o,data:s.slice(l,h).map((r,w)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?p.getActualY(this.waveConfigs[i].sensitivity,r,n/2):p.getActualY(this.waveConfigs[i].sensitivity,r,n)).map((r,w)=>[w*(o||0),-r])}),i++)}return a}createRowAndColWaveFrom(){var s,o;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let n=0;n<e.length;n++)t=this.waveConfigs[n].leadIdx||0,this.isLeadDel(t)||(o=this.rowAndColwaveFromGroup)==null||o.add(new u.Polyline({cursor:"",name:n+"_"+n,shape:{points:e[n].data.map(([l,h],a)=>isNaN(h)?(i===0&&(i=a-1,i=i<0?0:i),[e[n].data[i][0]+e[n].pos[0],e[n].data[i][1]+e[n].pos[1]]):(i=0,[l+e[n].pos[0],h+e[n].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:l=>{console.log(33,l)}})),n<this.leadModel.line?(this.createLeadName(t,e[n].pos[0],e[n].pos[1]-15),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2-15)):(this.createLeadName(t,e[n].pos[0]+5,e[n].pos[1]-(e[n].sens||0)/2),this.createLeadOffAndDel(t,e[n].pos[0]-5,e[n].pos[1]-(e[n].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;(o=this.leadHeadNameGroup)==null||o.add(new u.Text({style:{x:t,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:C(m({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:C(m({},n),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new u.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=p.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,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((n,l)=>{l=l||0,!(!t[l]||!t[l].data)&&n.attr({shape:{points:t[l].data.map(([h,a])=>[h+t[l].pos[0],a+t[l].pos[1]])}})}),(o=this.addwaveFromGroup)==null||o.eachChild((n,l)=>{l=l||0,!(!i[l]||!i[l].data)&&n.attr({shape:{points:i[l].data.map(([h,a])=>[h+i[l].pos[0],a+i[l].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=p.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t),this.drawTimeLine(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup)}};g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"width",2);g([c.Prop({required:!0,type:Number,validator:e=>typeof e=="number"})],exports.default.prototype,"height",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveConfigs",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"waveLists",2);g([c.Prop({default:()=>[]})],exports.default.prototype,"leadNames",2);g([c.Prop({default:()=>({leadHedeWidth:20,leadHedeColor:"#000",leadHedeLineWidth:2})})],exports.default.prototype,"leadHeadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"leadModel",2);g([c.Prop({default:()=>({isShow:!1,gainName:"",speedName:""})})],exports.default.prototype,"rulerConfig",2);g([c.Prop({default:()=>({isShow:!0,sampleRate:500,speed:10,gain:10,startTime:""})})],exports.default.prototype,"timeConfig",2);g([c.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);g([c.Prop({required:!0})],exports.default.prototype,"gridConfig",2);g([c.Prop({default:()=>({leadIdxs:[1,6,10],leadNames:[1,6,10]})})],exports.default.prototype,"longLeadConfig",2);g([c.Prop({default:()=>({defaultSelect:1})})],exports.default.prototype,"singleModeConfig",2);g([c.Prop({default:()=>({isShow:!0,isNativeScroll:!1,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"scrollConfig",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalTimes",2);g([c.Prop({default:()=>0})],exports.default.prototype,"dataTotalLength",2);g([c.Prop({default:()=>""})],exports.default.prototype,"prefixId",2);g([c.Prop({default:()=>0})],exports.default.prototype,"posStart",2);g([p.throttling(200)],exports.default.prototype,"nativeScrollFunc",1);g([p.throttling(200)],exports.default.prototype,"handleScroll",1);exports.default=g([A.default({name:"Methods"})],exports.default);
|