costy-plus 1.0.92-0 → 1.0.93-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
- var T = Object.defineProperty, V = Object.defineProperties;
1
+ var V = Object.defineProperty, T = Object.defineProperties;
2
2
  var X = Object.getOwnPropertyDescriptors;
3
3
  var z = Object.getOwnPropertySymbols;
4
4
  var Y = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
5
- var j = (e, t, i) => t in e ? T(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, y = (e, t) => {
5
+ var j = (e, t, i) => t in e ? V(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
7
  Y.call(t, i) && j(e, i, t[i]);
8
8
  if (z)
9
9
  for (var i of z(t))
10
10
  _.call(t, i) && j(e, i, t[i]);
11
11
  return e;
12
- }, B = (e, t) => V(e, X(t));
12
+ }, R = (e, t) => T(e, X(t));
13
13
  import E from "vue";
14
- import q from "../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js";
14
+ import K 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 K, max as Q, min as U } from "lodash";
18
- import { throttling as $, getStepForSpeed as S, getPrintLengthToPx as Z, getSens as W, getDataLenTimes as D, getPointIdxForPx as x, getActualY as H } from "@costy-plus/utils";
17
+ import { flattenDeep as q, max as Q, min as U } from "lodash";
18
+ import { throttling as $, getStepForSpeed as W, getPrintLengthToPx as Z, getSens as H, getDataLenTimes as O, getPointIdxForPx as P, getActualY as M } from "@costy-plus/utils";
19
19
  import * as J from "zrender";
20
- import { Group as v, Polyline as P, Line as O, Text as I, Polygon as ee, util as te } from "zrender";
20
+ import { Group as I, Polyline as N, Line as k, Text as y, Polygon as ee, util as te } from "zrender";
21
21
  var ie = Object.defineProperty, se = Object.getOwnPropertyDescriptor, u = (e, t, i, s) => {
22
22
  for (var o = s > 1 ? void 0 : s ? se(t, i) : t, a = e.length - 1, n; a >= 0; a--)
23
23
  (n = e[a]) && (o = (s ? n(t, i, o) : n(o)) || o);
@@ -50,8 +50,8 @@ let g = class extends E {
50
50
  };
51
51
  }
52
52
  destroyed() {
53
- var e, t, i, s, o, a, n, r, f, l, d;
54
- this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (o = this.splitLineGroup) == null || o.removeAll(), (a = this.leadHeadNameGroup) == null || a.removeAll(), (n = this.leadHeadOffAndDelGroup) == null || n.removeAll(), (r = this.rulerGroup) == null || r.removeAll(), (f = this.arrowGroup) == null || f.removeAll(), (l = this.heardBeatLineGroup) == null || l.removeAll(), (d = this.sceneIns) == null || d.dispose();
53
+ var e, t, i, s, o, a, n, h, p, d, r;
54
+ this.sceneInsEventOff(), (e = this.rowAndColwaveFromGroup) == null || e.removeAll(), (t = this.singleWaveFromGroup) == null || t.removeAll(), (i = this.addwaveFromGroup) == null || i.removeAll(), (s = this.leadHeadGroup) == null || s.removeAll(), (o = this.splitLineGroup) == null || o.removeAll(), (a = this.leadHeadNameGroup) == null || a.removeAll(), (n = this.leadHeadOffAndDelGroup) == null || n.removeAll(), (h = this.rulerGroup) == null || h.removeAll(), (p = this.arrowGroup) == null || p.removeAll(), (d = this.heardBeatLineGroup) == null || d.removeAll(), (r = this.sceneIns) == null || r.dispose();
55
55
  }
56
56
  initCreatedConfig() {
57
57
  this.vuescrollWH.width = this.width, this.vuescrollWH.height = this.height, this.calcHeartBeatPositions(), this.initConfig();
@@ -110,7 +110,7 @@ let g = class extends E {
110
110
  startInd: this.slidingWindowInfo.startInd || 0,
111
111
  endInd: this.slidingWindowInfo.endInd <= t || this.leadModel.isSingleMode ? t : this.slidingWindowInfo.endInd
112
112
  }, this.scrollConfig.isShow && !this.leadModel.isSingleMode) {
113
- const s = S(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), o = this.dataTotalLength * s;
113
+ const s = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), o = this.dataTotalLength * s;
114
114
  this.vuescrollWH.width = this.canvasContainer.width + (o || 0) - this.splitPoint;
115
115
  }
116
116
  const i = Math.ceil((this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / e);
@@ -121,7 +121,7 @@ let g = class extends E {
121
121
  };
122
122
  }
123
123
  calcHighestAndLowestPoint() {
124
- const e = K(this.waveLists);
124
+ const e = q(this.waveLists);
125
125
  return {
126
126
  maxPoints: Q(e) || 0,
127
127
  minPoints: U(e) || 0
@@ -135,25 +135,25 @@ let g = class extends E {
135
135
  }
136
136
  initConfig() {
137
137
  var t;
138
- this.rowAndColwaveFromGroup = new v({
138
+ this.rowAndColwaveFromGroup = new I({
139
139
  name: "rowAndColwaveFrom"
140
- }), this.singleWaveFromGroup = new v({
140
+ }), this.singleWaveFromGroup = new I({
141
141
  name: "singleWaveFrom"
142
- }), this.addwaveFromGroup = new v({
142
+ }), this.addwaveFromGroup = new I({
143
143
  name: "addwaveFrom"
144
- }), this.leadHeadGroup = new v({
144
+ }), this.leadHeadGroup = new I({
145
145
  name: "leadHead"
146
- }), this.splitLineGroup = new v({
146
+ }), this.splitLineGroup = new I({
147
147
  name: "splitLine"
148
- }), this.leadHeadNameGroup = new v({
148
+ }), this.leadHeadNameGroup = new I({
149
149
  name: "leadHeadName"
150
- }), this.leadHeadOffAndDelGroup = new v({
150
+ }), this.leadHeadOffAndDelGroup = new I({
151
151
  name: "leadHeadOffAndDel"
152
- }), this.rulerGroup = new v({
152
+ }), this.rulerGroup = new I({
153
153
  name: "ruler"
154
- }), this.arrowGroup = new v({
154
+ }), this.arrowGroup = new I({
155
155
  name: "arrowLoop"
156
- }), this.heardBeatLineGroup = new v({
156
+ }), this.heardBeatLineGroup = new I({
157
157
  name: "heardBeatLine"
158
158
  });
159
159
  let e = this.canvasContainer.width;
@@ -161,7 +161,7 @@ let g = class extends E {
161
161
  const i = Z(((t = this.waveConfigs[0]) == null ? void 0 : t.sampleRate) || 0) + this.leadHeadConfig.leadHedeWidth;
162
162
  i <= e && (e = i);
163
163
  } else if (this.leadModel.isContinuous) {
164
- const i = S(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), s = this.dataTotalLength * i;
164
+ const i = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), s = this.dataTotalLength * i;
165
165
  !this.leadModel.isSingleMode && (s || 0) < e - this.leadHeadConfig.leadHedeWidth && (e = (s || 0) + this.leadHeadConfig.leadHedeWidth);
166
166
  }
167
167
  this.drawArea = {
@@ -181,7 +181,7 @@ let g = class extends E {
181
181
  }, this.currentHeardBeat = {
182
182
  heardBeat: null,
183
183
  ele: null
184
- }, this.leadNameList = this.leadNames.map((i, s) => s) || [], this.totalRows = this.leadModel.line + this.leadModel.add || 1, this.highestAndLowestPoint = this.calcHighestAndLowestPoint(), this.leadModel.isSingleMode ? (this.splitBlockHeight = Math.abs(this.highestAndLowestPoint.maxPoints) + Math.abs(this.highestAndLowestPoint.minPoints) + 22, this.splitBlockHeight > this.drawArea.height && (this.splitBlockHeight = this.drawArea.height / 6)) : this.splitBlockHeight = this.drawArea.height / this.totalRows, this.publicStep = S(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), this.rulerStep = (this.publicStep || 1) * (this.leadModel.publicSampleRate || 1) / (this.gridConfig.cellMg * 2 + 2);
184
+ }, this.leadNameList = this.leadNames.map((i, s) => s) || [], this.totalRows = this.leadModel.line + this.leadModel.add || 1, this.highestAndLowestPoint = this.calcHighestAndLowestPoint(), this.leadModel.isSingleMode ? (this.splitBlockHeight = Math.abs(this.highestAndLowestPoint.maxPoints) + Math.abs(this.highestAndLowestPoint.minPoints) + 22, this.splitBlockHeight > this.drawArea.height && (this.splitBlockHeight = this.drawArea.height / 6)) : this.splitBlockHeight = this.drawArea.height / this.totalRows, this.publicStep = W(this.leadModel.publicSpeed, this.gridConfig.cellMg, this.leadModel.publicSampleRate), this.rulerStep = (this.publicStep || 1) * (this.leadModel.publicSampleRate || 1) / (this.gridConfig.cellMg * 2 + 2);
185
185
  }
186
186
  initWaveFormPeer() {
187
187
  var i;
@@ -215,40 +215,40 @@ let g = class extends E {
215
215
  (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);
216
216
  }
217
217
  drawLeadHead() {
218
- var a, n, r, f, l;
218
+ var a, n, h, p, d;
219
219
  (a = this.leadHeadGroup) == null || a.removeAll(), (n = this.sceneIns) == null || n.remove(this.leadHeadGroup);
220
220
  let e = "", t = !1, i = 0, s = 0;
221
- for (let d = 0; d <= this.leadModel.column; d++) {
222
- s = d * this.leadModel.line;
221
+ for (let r = 0; r <= this.leadModel.column; r++) {
222
+ s = r * this.leadModel.line;
223
223
  e:
224
- for (let h = 1; h <= this.leadModel.line; h++) {
225
- if (!(this.waveConfigs || [])[h - 1 + s])
224
+ for (let f = 1; f <= this.leadModel.line; f++) {
225
+ if (!(this.waveConfigs || [])[f - 1 + s])
226
226
  break e;
227
- !this.waveConfigs[h - 1 + s].isShowLeadHead || (t = !1, e = (this.leadNames || [])[h - 1 + s] || "", this.waveConfigs[h - 1 + s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = this.waveConfigs[h - 1 + s].posX ? this.waveConfigs[h - 1 + s].posX - this.leadHeadConfig.leadHedeWidth : 0, this.leadHeadConfig.isShowLeadCalibration !== !1 && ((r = this.leadHeadGroup) == null || r.add(
227
+ !this.waveConfigs[f - 1 + s].isShowLeadHead || (t = !1, e = (this.leadNames || [])[f - 1 + s] || "", this.waveConfigs[f - 1 + s].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = this.waveConfigs[f - 1 + s].posX ? this.waveConfigs[f - 1 + s].posX - this.leadHeadConfig.leadHedeWidth : 0, this.leadHeadConfig.isShowLeadCalibration !== !1 && ((h = this.leadHeadGroup) == null || h.add(
228
228
  this.createLeadHead(
229
229
  i,
230
- this.waveConfigs[h - 1 + s].posY || h * this.splitBlockHeight,
231
- W(this.waveConfigs[h - 1 + s].gain, this.gridConfig.cellMg),
230
+ this.waveConfigs[f - 1 + s].posY || f * this.splitBlockHeight,
231
+ H(this.waveConfigs[f - 1 + s].gain, this.gridConfig.cellMg),
232
232
  t
233
233
  )
234
234
  )));
235
235
  }
236
236
  }
237
237
  let o = null;
238
- for (let d = 0; d < this.leadModel.add; d++)
239
- !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, this.leadHeadConfig.isShowLeadCalibration !== !1 && ((f = this.leadHeadGroup) == null || f.add(
238
+ for (let r = 0; r < this.leadModel.add; r++)
239
+ !this.waveConfigs[this.longLeadConfig.leadIdxs[r]] || (o = this.waveConfigs[this.longLeadConfig.leadIdxs[r]], e = this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[r]]], t = !1, o.gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(e) && (t = !0), i = o.posX ? o.posX - this.leadHeadConfig.leadHedeWidth : 0, this.leadHeadConfig.isShowLeadCalibration !== !1 && ((p = this.leadHeadGroup) == null || p.add(
240
240
  this.createLeadHead(
241
241
  i,
242
- o.posY || (d + 1 + this.leadModel.line) * this.splitBlockHeight,
243
- W(o.gain, this.gridConfig.cellMg),
242
+ o.posY || (r + 1 + this.leadModel.line) * this.splitBlockHeight,
243
+ H(o.gain, this.gridConfig.cellMg),
244
244
  t
245
245
  )
246
246
  )));
247
- o = null, (l = this.sceneIns) == null || l.add(this.leadHeadGroup);
247
+ o = null, (d = this.sceneIns) == null || d.add(this.leadHeadGroup);
248
248
  }
249
249
  createLeadHead(e, t, i, s) {
250
250
  const o = this.leadHeadConfig.leadHedeWidth / 4;
251
- return i = s ? i / 2 : i, new P({
251
+ return i = s ? i / 2 : i, new N({
252
252
  cursor: "",
253
253
  shape: {
254
254
  points: [
@@ -285,51 +285,51 @@ let g = class extends E {
285
285
  });
286
286
  }
287
287
  drawColSplitLine() {
288
- var a, n, r, f, l;
288
+ var a, n, h, p, d;
289
289
  (a = this.splitLineGroup) == null || a.removeAll(), (n = this.sceneIns) == null || n.remove(this.splitLineGroup);
290
290
  const e = (this.drawArea.width - this.leadHeadConfig.leadHedeWidth) / (this.leadModel.column || 1);
291
291
  if (this.splitPoint = e, this.leadModel.isSingleMode) {
292
- const d = S(
292
+ const r = W(
293
293
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
294
294
  this.gridConfig.cellMg,
295
295
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
296
- ), h = D(
297
- Math.ceil(this.splitPoint / (d || 1)) || 0,
296
+ ), f = O(
297
+ Math.ceil(this.splitPoint / (r || 1)) || 0,
298
298
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0
299
- ), C = parseInt(`${h / 1e3 % 60}`, 10);
300
- this.splitPoint = C * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (d || 0);
299
+ ), C = parseInt(`${f / 1e3 % 60}`, 10);
300
+ this.splitPoint = C * (this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0) * (r || 0);
301
301
  }
302
302
  let t = 0, i = 0, s = 0, o = 0;
303
- for (let d = 1; d <= this.leadModel.column - 1; d++) {
304
- t = d * e + this.leadHeadConfig.leadHedeWidth, i = d * this.leadModel.line;
303
+ for (let r = 1; r <= this.leadModel.column - 1; r++) {
304
+ t = r * e + this.leadHeadConfig.leadHedeWidth, i = r * this.leadModel.line;
305
305
  e:
306
- for (let h = 1; h <= this.leadModel.line; h++) {
307
- if (!(this.waveConfigs || [])[h - 1 + i])
306
+ for (let f = 1; f <= this.leadModel.line; f++) {
307
+ if (!(this.waveConfigs || [])[f - 1 + i])
308
308
  break e;
309
- if ((this.waveConfigs || [])[h - 1 + i].isShowLeadHead)
309
+ if ((this.waveConfigs || [])[f - 1 + i].isShowLeadHead)
310
310
  continue e;
311
- if ((this.waveConfigs || [])[h - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[h - 1 + i].posX), s = (this.waveConfigs || [])[h - 1 + i].leadIdx, s === void 0)
311
+ if ((this.waveConfigs || [])[f - 1 + i].posX !== void 0 && (t = (this.waveConfigs || [])[f - 1 + i].posX), s = (this.waveConfigs || [])[f - 1 + i].leadIdx, s === void 0)
312
312
  break;
313
- o = W((this.waveConfigs || [])[h - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[h - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (r = this.splitLineGroup) == null || r.add(
313
+ o = H((this.waveConfigs || [])[f - 1 + i].gain, this.gridConfig.cellMg), (this.waveConfigs || [])[f - 1 + i].gainName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.leadNames[s]) ? (h = this.splitLineGroup) == null || h.add(
314
314
  this.creatSplitLine(
315
315
  t,
316
- ((this.waveConfigs || [])[h - 1 + i].posY || h * this.splitBlockHeight) - (o || 0) / 2 * 0.5,
316
+ ((this.waveConfigs || [])[f - 1 + i].posY || f * this.splitBlockHeight) - (o || 0) / 2 * 0.5,
317
317
  o,
318
318
  !0
319
319
  )
320
- ) : (f = this.splitLineGroup) == null || f.add(
320
+ ) : (p = this.splitLineGroup) == null || p.add(
321
321
  this.creatSplitLine(
322
322
  t,
323
- ((this.waveConfigs || [])[h - 1 + i].posY || h * this.splitBlockHeight) - (o || 0) * 0.5,
323
+ ((this.waveConfigs || [])[f - 1 + i].posY || f * this.splitBlockHeight) - (o || 0) * 0.5,
324
324
  o
325
325
  )
326
326
  );
327
327
  }
328
328
  }
329
- (l = this.sceneIns) == null || l.add(this.splitLineGroup);
329
+ (d = this.sceneIns) == null || d.add(this.splitLineGroup);
330
330
  }
331
331
  creatSplitLine(e, t, i, s) {
332
- return new O({
332
+ return new k({
333
333
  cursor: "",
334
334
  shape: {
335
335
  x1: 0 + e,
@@ -351,15 +351,15 @@ let g = class extends E {
351
351
  fill: "#FF0080",
352
352
  fontSize: 13,
353
353
  fontFamily: this.fontFamily
354
- }, t = new I({
354
+ }, t = new y({
355
355
  cursor: "",
356
- style: y({
356
+ style: S({
357
357
  text: "(s)",
358
358
  x: this.leadHeadConfig.leadHedeWidth / 2 - 8,
359
359
  y: this.canvasContainer.height - 25
360
360
  }, e)
361
- }), i = new I({
362
- style: y({
361
+ }), i = new y({
362
+ style: S({
363
363
  text: this.rulerConfig.renderText || `${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,
364
364
  x: this.leadHeadConfig.leadHedeWidth / 2 + 20,
365
365
  y: this.canvasContainer.height - this.ruleH
@@ -368,30 +368,30 @@ let g = class extends E {
368
368
  (s = this.sceneIns) == null || s.add(i), (o = this.sceneIns) == null || o.add(t);
369
369
  }
370
370
  drawRuler(e = 0) {
371
- var n, r, f;
371
+ var n, h, p;
372
372
  if (this.timersCopy = e, !this.rulerConfig.isShow)
373
373
  return;
374
374
  const t = this.dataTotalTimes / 1e3;
375
375
  let i = this.leadHeadConfig.leadHedeWidth, s = 0, o = t;
376
- const a = S(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
376
+ const a = W(this.rulerConfig.speed, this.gridConfig.cellMg, this.rulerConfig.sampleRate);
377
377
  if (this.leadModel.isContinuous)
378
378
  o = t * 5;
379
379
  else if (!this.leadModel.add && a) {
380
- const l = x(this.splitPoint, a), d = D(l, this.rulerConfig.sampleRate || 0) / 1e3;
381
- o = e + d;
380
+ const d = P(this.splitPoint, a), r = O(d, this.rulerConfig.sampleRate || 0) / 1e3;
381
+ o = e + r;
382
382
  }
383
- for (let l = e; l <= o; l = +(l + 0.1).toFixed(1))
384
- l !== e && (i += this.rulerStep), l % 1 === 0 ? (s = this.canvasContainer.height - 10, (n = this.rulerGroup) == null || n.add(new I({
383
+ for (let d = e; d <= o; d = +(d + 0.1).toFixed(1))
384
+ d !== e && (i += this.rulerStep), d % 1 === 0 ? (s = this.canvasContainer.height - 10, (n = this.rulerGroup) == null || n.add(new y({
385
385
  cursor: "",
386
386
  style: {
387
387
  x: i,
388
388
  y: s - 15,
389
- text: l + "",
389
+ text: d + "",
390
390
  fontSize: 13,
391
391
  fontFamily: this.fontFamily,
392
392
  fill: "#FF0080"
393
393
  }
394
- }))) : s = this.canvasContainer.height - 5, (r = this.rulerGroup) == null || r.add(new O({
394
+ }))) : s = this.canvasContainer.height - 5, (h = this.rulerGroup) == null || h.add(new k({
395
395
  cursor: "",
396
396
  shape: {
397
397
  x1: i,
@@ -404,7 +404,7 @@ let g = class extends E {
404
404
  lineWidth: 2
405
405
  }
406
406
  }));
407
- (f = this.sceneIns) == null || f.add(this.rulerGroup);
407
+ (p = this.sceneIns) == null || p.add(this.rulerGroup);
408
408
  }
409
409
  drawWaveFrom() {
410
410
  var e, t, i;
@@ -414,78 +414,78 @@ let g = class extends E {
414
414
  let e = 0, t = 0;
415
415
  const i = this.waveLists[this.singleModeConfig.defaultSelect] || [];
416
416
  let s = this.slidingWindowInfo.startInd || 0, o = this.slidingWindowInfo.endInd || 0;
417
- const a = S(
417
+ const a = W(
418
418
  this.waveConfigs[this.singleModeConfig.defaultSelect].speed,
419
419
  this.gridConfig.cellMg,
420
420
  this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate
421
- ), n = W(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), r = [], f = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
422
- for (let l = 0; l < 1; l++) {
423
- e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
424
- for (let d = 1; d <= f; d++)
425
- t = d * this.splitBlockHeight, d > 1 && (t *= 0.8, s = o, o = s + (this.slidingWindowInfo.points || 0)), d === 1 && (this.loopArrowY.rowAndCol = t), r.push({
421
+ ), n = H(this.waveConfigs[this.singleModeConfig.defaultSelect].gain, this.gridConfig.cellMg), h = [], p = Math.ceil(i.length / (this.slidingWindowInfo.points || 1));
422
+ for (let d = 0; d < 1; d++) {
423
+ e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0;
424
+ for (let r = 1; r <= p; r++)
425
+ t = r * this.splitBlockHeight, r > 1 && (t *= 0.8, s = o, o = s + (this.slidingWindowInfo.points || 0)), r === 1 && (this.loopArrowY.rowAndCol = t), h.push({
426
426
  pos: [e, t],
427
427
  startInd: s,
428
428
  endInd: o,
429
429
  step: a,
430
430
  sens: n,
431
- data: i.slice(s, o).map((h, C) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? H(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, h, n / 2) : H(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, h, n)).map((h, C) => [C * (a || 0), -h])
431
+ data: i.slice(s, o).map((f, C) => this.waveConfigs[this.singleModeConfig.defaultSelect].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName) ? M(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, f, n / 2) : M(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity, f, n)).map((f, C) => [C * (a || 0), -f])
432
432
  });
433
433
  }
434
- return r;
434
+ return h;
435
435
  }
436
436
  createSingleWaveFrom() {
437
- var n, r, f;
437
+ var n, h, p;
438
438
  (n = this.singleWaveFromGroup) == null || n.removeAll();
439
- let e = this.getRednerSinglePoints(), t = D(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0);
439
+ let e = this.getRednerSinglePoints(), t = O(this.slidingWindowInfo.points || 0, this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate || 0);
440
440
  const i = t;
441
441
  let s = 0, o = 0, a = 0;
442
- for (let l = 0; l < e.length && !(e[l].pos[1] > this.drawArea.height + this.bottomAreaHeight); l++)
443
- this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (s = parseInt(`${t / 1e3 / 60}`, 10), o = parseInt(`${t / 1e3 % 60}`, 10), s = o === 60 ? s += 1 : s, s = s === 0 ? "00" : s < 10 ? `0${s}` : s, o = o === 0 || o === 60 ? "00" : o < 10 ? `0${o}` : o, (r = this.singleWaveFromGroup) == null || r.add(new P({
442
+ for (let d = 0; d < e.length && !(e[d].pos[1] > this.drawArea.height + this.bottomAreaHeight); d++)
443
+ this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx) || (s = parseInt(`${t / 1e3 / 60}`, 10), o = parseInt(`${t / 1e3 % 60}`, 10), s = o === 60 ? s += 1 : s, s = s === 0 ? "00" : s < 10 ? `0${s}` : s, o = o === 0 || o === 60 ? "00" : o < 10 ? `0${o}` : o, (h = this.singleWaveFromGroup) == null || h.add(new N({
444
444
  cursor: "",
445
- name: this.singleModeConfig.defaultSelect + "_" + l,
445
+ name: this.singleModeConfig.defaultSelect + "_" + d,
446
446
  shape: {
447
- points: e[l].data.map(([d, h], C) => isNaN(h) ? (a === 0 && (a = C - 1, a = a < 0 ? 0 : a), [
448
- e[l].data[a][0] + e[l].pos[0],
449
- e[l].data[a][1] + e[l].pos[1]
447
+ points: e[d].data.map(([r, f], C) => isNaN(f) ? (a === 0 && (a = C - 1, a = a < 0 ? 0 : a), [
448
+ e[d].data[a][0] + e[d].pos[0],
449
+ e[d].data[a][1] + e[d].pos[1]
450
450
  ]) : (a = 0, [
451
- d + e[l].pos[0],
452
- h + e[l].pos[1]
451
+ r + e[d].pos[0],
452
+ f + e[d].pos[1]
453
453
  ]))
454
454
  },
455
455
  style: {
456
456
  stroke: this.leadConfig.lineColor,
457
457
  lineWidth: this.leadConfig.lineWidth
458
458
  },
459
- onclick: (d) => {
460
- this.onDbClickWaveFrom(d, "single");
459
+ onclick: (r) => {
460
+ this.onDbClickWaveFrom(r, "single");
461
461
  }
462
- })), t / 1e3 < this.dataTotalTimes && ((f = this.singleWaveFromGroup) == null || f.add(new I({
462
+ })), t / 1e3 < this.dataTotalTimes && ((p = this.singleWaveFromGroup) == null || p.add(new y({
463
463
  cursor: "",
464
464
  style: {
465
- x: e[l].pos[0],
466
- y: e[l].pos[1] - (e[l].sens || 0) / 2,
467
- text: l === 0 ? "00:00 \u5FC3\u7387" : `${s}:${o} \u5FC3\u7387`,
465
+ x: e[d].pos[0],
466
+ y: e[d].pos[1] - (e[d].sens || 0) / 2,
467
+ text: d === 0 ? "00:00 \u5FC3\u7387" : `${s}:${o} \u5FC3\u7387`,
468
468
  fontWeight: "bold",
469
469
  fontSize: 14,
470
470
  fill: "#FF0080",
471
471
  fontFamily: this.fontFamily
472
472
  }
473
- }))), l > 0 && (t += i)), this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx, e[0].pos[0] - 10, e[0].pos[1] + 10), this.createLeadOffAndDel(
473
+ }))), d > 0 && (t += i)), this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx, e[0].pos[0] - 10, e[0].pos[1] + 10), this.createLeadOffAndDel(
474
474
  this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,
475
475
  e[0].pos[0] - 5,
476
- e[0].pos[1] - (e[l].sens || 0) / 2 - 15
476
+ e[0].pos[1] - (e[d].sens || 0) / 2 - 15
477
477
  );
478
478
  this.singleWaveDataCopy = e, e = null;
479
479
  }
480
480
  drawLoopArrow(e = 0) {
481
- var f, l, d, h, C, L, M, A, w, m, N, R;
481
+ var p, d, r, f, C, L, A, x, F, b, D, v;
482
482
  if (this.drawLoopArrowStartPosIdx = e, !this.heartFight.isShow)
483
483
  return;
484
484
  this.heartFight.mode && this.currentHeardBeat.heardBeat === null && (this.currentHeardBeat.heardBeat = this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect] || null, this.drawHeardBeatLine());
485
485
  let t = 0, i = 0;
486
486
  if (this.leadModel.add) {
487
- const F = W(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain, this.gridConfig.cellMg);
488
- i = this.loopArrowY.add - (F || 0) - this.splitBlockHeight / 3.5;
487
+ const w = H(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain, this.gridConfig.cellMg);
488
+ i = this.loopArrowY.add - (w || 0) - this.splitBlockHeight / 3.5;
489
489
  } else
490
490
  i = 20;
491
491
  let s = 0, o = 0;
@@ -493,18 +493,18 @@ let g = class extends E {
493
493
  fontSize: 12,
494
494
  fill: "red",
495
495
  fontFamily: this.fontFamily
496
- }, n = S(
496
+ }, n = W(
497
497
  this.waveConfigs[this.heartFight.showIdxPai].speed,
498
498
  this.gridConfig.cellMg,
499
499
  this.waveConfigs[this.heartFight.showIdxPai].sampleRate
500
500
  );
501
- let r = 0;
502
- for (let F = 0; F < (this.heartBeatPosition[this.heartFight.showIdxPai] || []).length; F++) {
503
- const p = this.heartBeatPosition[this.heartFight.showIdxPai][F];
504
- if (r = ((p == null ? void 0 : p.position) || 0) - e, !(e > ((p == null ? void 0 : p.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && r > (this.slidingWindowInfo.points || 0)) && !(this.leadModel.isSingleMode && r > (this.slidingWindowInfo.points || 0))) {
505
- if (((p == null ? void 0 : p.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
501
+ let h = 0;
502
+ for (let w = 0; w < (this.heartBeatPosition[this.heartFight.showIdxPai] || []).length; w++) {
503
+ const l = this.heartBeatPosition[this.heartFight.showIdxPai][w];
504
+ if (h = ((l == null ? void 0 : l.position) || 0) - e, !(e > ((l == null ? void 0 : l.position) || 0)) && !(!this.leadModel.isContinuous && !this.leadModel.add && h > (this.slidingWindowInfo.points || 0)) && !(this.leadModel.isSingleMode && h > (this.slidingWindowInfo.points || 0))) {
505
+ if (((l == null ? void 0 : l.position) || 0) - this.addSlidingWindowInfo.startInd > (this.addSlidingWindowInfo.points || 0))
506
506
  break;
507
- t = r * (n || 0) + this.leadHeadConfig.leadHedeWidth - 8.5, o = 0, (d = this.arrowGroup) == null || d.add(new ee({
507
+ t = h * (n || 0) + this.leadHeadConfig.leadHedeWidth - 8.5, o = 0, (r = this.arrowGroup) == null || r.add(new ee({
508
508
  name: "arrow_box",
509
509
  shape: {
510
510
  points: [
@@ -519,89 +519,120 @@ let g = class extends E {
519
519
  ]
520
520
  },
521
521
  style: {
522
- fill: ((l = (f = this.currentHeardBeat) == null ? void 0 : f.heardBeat) == null ? void 0 : l.index) === (p == null ? void 0 : p.index) ? "blue" : "#ccc"
522
+ fill: ((d = (p = this.currentHeardBeat) == null ? void 0 : p.heardBeat) == null ? void 0 : d.index) === (l == null ? void 0 : l.index) ? "blue" : "#ccc"
523
523
  },
524
- onclick: (G) => {
525
- var k;
526
- !this.heartFight.mode && !this.heartFight.isClickArrow || (G.target.attr({
524
+ onclick: (m) => {
525
+ var B;
526
+ !this.heartFight.mode && !this.heartFight.isClickArrow || (m.target.attr({
527
527
  style: { fill: "blue" }
528
- }), (k = this.arrowGroup) == null || k.children().filter((b) => b.name === "arrow_box").forEach((b) => {
529
- b.id !== G.target.id && b.attr({
528
+ }), (B = this.arrowGroup) == null || B.children().filter((G) => G.name === "arrow_box").forEach((G) => {
529
+ G.id !== m.target.id && G.attr({
530
530
  style: { fill: "#ccc" }
531
531
  });
532
- }), this.arrowLoopClick(p, G.target));
532
+ }), this.arrowLoopClick(l, m.target));
533
533
  }
534
- })), this.heartFight.heartrate && (s = ((h = this.AssistCtx) == null ? void 0 : h.measureText(`${(p == null ? void 0 : p.heartrate) || ""}`).width) || 0, (C = this.arrowGroup) == null || C.add(new I({
534
+ })), this.heartFight.heartrate && (s = ((f = this.AssistCtx) == null ? void 0 : f.measureText(`${(l == null ? void 0 : l.heartrate) || ""}`).width) || 0, (C = this.arrowGroup) == null || C.add(new y({
535
535
  cursor: "",
536
- style: y({
536
+ style: S({
537
537
  x: 4 + t - s * 1.4,
538
538
  y: o + i,
539
- text: `${(p == null ? void 0 : p.heartrate) || ""}`
539
+ text: `${(l == null ? void 0 : l.heartrate) || ""}`
540
540
  }, a)
541
- })), o += 12), this.heartFight.interval && (s = ((L = this.AssistCtx) == null ? void 0 : L.measureText(`${(p == null ? void 0 : p.interval) || ""}`).width) || 0, (M = this.arrowGroup) == null || M.add(new I({
541
+ })), o += 12), this.heartFight.interval && (s = ((L = this.AssistCtx) == null ? void 0 : L.measureText(`${(l == null ? void 0 : l.interval) || ""}`).width) || 0, (A = this.arrowGroup) == null || A.add(new y({
542
542
  cursor: "",
543
- style: y({
543
+ style: S({
544
544
  x: 4 + t - s * 1.5,
545
545
  y: o + i,
546
- text: `${(p == null ? void 0 : p.interval) || ""}`
546
+ text: `${(l == null ? void 0 : l.interval) || ""}`
547
547
  }, a)
548
- })), o += 12), this.heartFight.qrstCompany && (s = ((A = this.AssistCtx) == null ? void 0 : A.measureText(`${(p == null ? void 0 : p.qrstCompany) || ""}`).width) || 0, (w = this.arrowGroup) == null || w.add(new I({
548
+ })), o += 12), this.heartFight.qrstCompany && (s = ((x = this.AssistCtx) == null ? void 0 : x.measureText(`${(l == null ? void 0 : l.qrstCompany) || ""}`).width) || 0, (F = this.arrowGroup) == null || F.add(new y({
549
549
  cursor: "",
550
- style: y({
550
+ style: S({
551
551
  x: 4 + t - s * 1.5,
552
552
  y: o + i,
553
- text: `${(p == null ? void 0 : p.qrstCompany) || ""}`
553
+ text: `${(l == null ? void 0 : l.qrstCompany) || ""}`
554
554
  }, a)
555
- })), o += 12), this.heartFight.telectricalaxis && (s = ((m = this.AssistCtx) == null ? void 0 : m.measureText(`${(p == null ? void 0 : p.telectricalaxis) || ""}`).width) || 0, (N = this.arrowGroup) == null || N.add(new I({
555
+ })), o += 12), this.heartFight.telectricalaxis && (s = ((b = this.AssistCtx) == null ? void 0 : b.measureText(`${(l == null ? void 0 : l.telectricalaxis) || ""}`).width) || 0, (D = this.arrowGroup) == null || D.add(new y({
556
556
  cursor: "",
557
- style: y({
557
+ style: S({
558
558
  x: 4 + t - s * 1.5,
559
559
  y: o + i,
560
- text: `${(p == null ? void 0 : p.telectricalaxis) || ""}`
560
+ text: `${(l == null ? void 0 : l.telectricalaxis) || ""}`
561
561
  }, a)
562
562
  })));
563
563
  }
564
564
  }
565
- (R = this.sceneIns) == null || R.add(this.arrowGroup);
565
+ (v = this.sceneIns) == null || v.add(this.arrowGroup);
566
566
  }
567
567
  arrowLoopClick(e, t) {
568
568
  this.$emit("notifyHeardBeat", te.clone(e)), this.currentHeardBeat.heardBeat = e, this.currentHeardBeat.ele = t, this.drawHeardBeatLine();
569
569
  }
570
570
  drawHeardBeatLine(e = 0) {
571
- var n, r, f, l, d, h, C, L, M, A;
571
+ var o, a, n, h, p, d, r, f, C, L, A, x, F, b, D;
572
572
  if (!this.currentHeardBeat.heardBeat)
573
573
  return;
574
- (n = this.heardBeatLineGroup) == null || n.removeAll(), (r = this.sceneIns) == null || r.remove(this.heardBeatLineGroup);
575
- let t = {}, i = 0, s = this.getRednerPoints(), o = this.getAddRednerPoints(), a;
576
- e:
577
- for (let w = 0; w < s.length; w++) {
578
- t = ((l = (f = this.analyseValues[w]) == null ? void 0 : f[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : l.KeyPosByBeat) || t;
579
- for (const m in t)
580
- if (this.heardBeatLineKeys.includes(m) && Object.prototype.hasOwnProperty.call(t, m)) {
581
- if (i = (t[m] - this.slidingWindowInfo.startInd) * (s[w].step || 0), this.isLeadOff(w) || this.isLeadDel(w))
582
- continue;
583
- if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (a = s[w], this.leadModel.isContinuous && w > this.leadModel.line - 1))
574
+ (o = this.heardBeatLineGroup) == null || o.removeAll(), (a = this.sceneIns) == null || a.remove(this.heardBeatLineGroup);
575
+ let t = {}, i = 0, s;
576
+ if (this.leadModel.isSingleMode) {
577
+ let v = this.getRednerSinglePoints();
578
+ e:
579
+ for (let w = 0; w < v.length; w++) {
580
+ if (w >= 1 || this.leadNames[this.singleModeConfig.defaultSelect] === "M")
581
+ break e;
582
+ if ((n = this.analyseValues[this.singleModeConfig.defaultSelect]) != null && n[this.currentHeardBeat.heardBeat.index])
583
+ t = ((d = (p = this.analyseValues[this.singleModeConfig.defaultSelect]) == null ? void 0 : p[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : d.KeyPosByBeat) || t;
584
+ else {
585
+ let l = this.analyseValues.find((m) => {
586
+ var B;
587
+ return (B = m[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : B.KeyPosByBeat;
588
+ });
589
+ if (!l)
584
590
  break e;
585
- (d = this.heardBeatLineGroup) == null || d.add(this.createHeardBeatLine(a.pos[0] + i, a.pos[1]));
591
+ l && (t = (h = l[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : h.KeyPosByBeat), l = null;
586
592
  }
587
- }
588
- e:
589
- for (let w = 0; w < o.length; w++)
590
- if (!!((h = this.analyseValues[w]) != null && h[this.currentHeardBeat.heardBeat.index])) {
591
- t = ((L = (C = this.analyseValues[w]) == null ? void 0 : C[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : L.KeyPosByBeat) || t;
593
+ for (const l in t)
594
+ if (this.heardBeatLineKeys.includes(l)) {
595
+ if (i = (t[l] - this.slidingWindowInfo.startInd) * (v[w].step || 0), this.isLeadOff(w) || this.isLeadDel(w))
596
+ continue;
597
+ if (!this.leadModel.isContinuous && t[l] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0))
598
+ break e;
599
+ s = v[w], (r = this.heardBeatLineGroup) == null || r.add(this.createHeardBeatLine(s.pos[0] + i, s.pos[1]));
600
+ }
601
+ }
602
+ v = null;
603
+ } else {
604
+ let v = this.getRednerPoints(), w = this.getAddRednerPoints();
605
+ e:
606
+ for (let l = 0; l < v.length; l++) {
607
+ t = ((C = (f = this.analyseValues[l]) == null ? void 0 : f[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : C.KeyPosByBeat) || t;
592
608
  for (const m in t)
593
- if (this.heardBeatLineKeys.includes(m)) {
594
- if (i = (t[m] - this.slidingWindowInfo.startInd) * (o[w].step || 0), this.isLeadOff(this.longLeadConfig.leadIdxs[w]) && this.isLeadDel(this.longLeadConfig.leadIdxs[w]))
609
+ if (this.heardBeatLineKeys.includes(m) && Object.prototype.hasOwnProperty.call(t, m)) {
610
+ if (i = (t[m] - this.slidingWindowInfo.startInd) * (v[l].step || 0), this.isLeadOff(l) || this.isLeadDel(l))
595
611
  continue;
596
- if (e > t[m])
612
+ if (e > t[m] || !this.leadModel.isContinuous && t[m] - this.slidingWindowInfo.startInd > (this.slidingWindowInfo.points || 0) || (s = v[l], this.leadModel.isContinuous && l > this.leadModel.line - 1))
597
613
  break e;
598
- a = o[w], (M = this.heardBeatLineGroup) == null || M.add(this.createHeardBeatLine(a.pos[0] + i, a.pos[1]));
614
+ (L = this.heardBeatLineGroup) == null || L.add(this.createHeardBeatLine(s.pos[0] + i, s.pos[1]));
599
615
  }
600
616
  }
601
- (A = this.sceneIns) == null || A.add(this.heardBeatLineGroup), t = null, s = null, o = null;
617
+ e:
618
+ for (let l = 0; l < w.length; l++)
619
+ if (!!((A = this.analyseValues[l]) != null && A[this.currentHeardBeat.heardBeat.index])) {
620
+ t = ((F = (x = this.analyseValues[l]) == null ? void 0 : x[this.currentHeardBeat.heardBeat.index]) == null ? void 0 : F.KeyPosByBeat) || t;
621
+ for (const m in t)
622
+ if (this.heardBeatLineKeys.includes(m)) {
623
+ if (i = (t[m] - this.slidingWindowInfo.startInd) * (w[l].step || 0), this.isLeadOff(this.longLeadConfig.leadIdxs[l]) && this.isLeadDel(this.longLeadConfig.leadIdxs[l]))
624
+ continue;
625
+ if (e > t[m])
626
+ break e;
627
+ s = w[l], (b = this.heardBeatLineGroup) == null || b.add(this.createHeardBeatLine(s.pos[0] + i, s.pos[1]));
628
+ }
629
+ }
630
+ v = null, w = null;
631
+ }
632
+ (D = this.sceneIns) == null || D.add(this.heardBeatLineGroup), t = null;
602
633
  }
603
634
  createHeardBeatLine(e, t) {
604
- return new O({
635
+ return new k({
605
636
  cursor: "",
606
637
  shape: {
607
638
  x1: e,
@@ -622,12 +653,12 @@ let g = class extends E {
622
653
  getAddRednerPoints() {
623
654
  const e = [];
624
655
  let t = this.leadHeadConfig.leadHedeWidth, i = 0, s = 0, o = [], a = 0, n = 0;
625
- for (let r = 0; r < this.leadModel.add; r++)
626
- s = this.longLeadConfig.leadIdxs[r], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, a = S(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = W(this.waveConfigs[s].gain, this.gridConfig.cellMg), i = this.waveConfigs[s].addPosY || (r + this.leadModel.line + 1) * this.splitBlockHeight, o = this.waveLists[s] || [], r === 0 && (this.loopArrowY.add = i), e.push({
656
+ for (let h = 0; h < this.leadModel.add; h++)
657
+ s = this.longLeadConfig.leadIdxs[h], this.waveConfigs[s] && (t = this.waveConfigs[s].addPosX || t, a = W(this.waveConfigs[s].speed, this.gridConfig.cellMg, this.waveConfigs[s].sampleRate), n = H(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({
627
658
  pos: [t, i],
628
659
  startInd: this.addSlidingWindowInfo.startInd || 0,
629
660
  endInd: this.addSlidingWindowInfo.endInd || 0,
630
- data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((f, l) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? H(this.waveConfigs[s].sensitivity, f, n / 2) : H(this.waveConfigs[s].sensitivity, f, n)).map((f, l) => [l * (a || 0), -f]),
661
+ data: o.slice(this.addSlidingWindowInfo.startInd, this.addSlidingWindowInfo.endInd).map((p, d) => this.waveConfigs[s].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[s].leadName) ? M(this.waveConfigs[s].sensitivity, p, n / 2) : M(this.waveConfigs[s].sensitivity, p, n)).map((p, d) => [d * (a || 0), -p]),
631
662
  sens: n,
632
663
  step: a
633
664
  }));
@@ -637,7 +668,7 @@ let g = class extends E {
637
668
  var i;
638
669
  let e = this.getAddRednerPoints(), t = 0;
639
670
  for (let s = 0; s < e.length; s++)
640
- this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new P({
671
+ this.isLeadDel(this.longLeadConfig.leadIdxs[s]) || ((i = this.addwaveFromGroup) == null || i.add(new N({
641
672
  cursor: "",
642
673
  name: this.longLeadConfig.leadIdxs[s] + "_" + s,
643
674
  shape: {
@@ -660,37 +691,37 @@ let g = class extends E {
660
691
  this.addWaveDataCopy = e, e = null;
661
692
  }
662
693
  getRednerPoints() {
663
- let e = 0, t = 0, i = 0, s = [], o = 0, a = 0, n = this.slidingWindowInfo.startInd || 0, r = this.slidingWindowInfo.endInd || 0;
664
- const f = [];
665
- for (let l = 0; l < this.leadModel.column; l++) {
666
- e = l * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && l > 0 && (n = r, r = n + (this.slidingWindowInfo.points || 0));
667
- for (let d = 1; d <= this.leadModel.line && (t = d * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); d++)
668
- e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o = S(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), a = W(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (d === 1 && (this.loopArrowY.rowAndCol = t), f.push({
694
+ let e = 0, t = 0, i = 0, s = [], o = 0, a = 0, n = this.slidingWindowInfo.startInd || 0, h = this.slidingWindowInfo.endInd || 0;
695
+ const p = [];
696
+ for (let d = 0; d < this.leadModel.column; d++) {
697
+ e = d * this.splitPoint + this.leadHeadConfig.leadHedeWidth, t = 0, this.leadModel.isContinuous && d > 0 && (n = h, h = n + (this.slidingWindowInfo.points || 0));
698
+ for (let r = 1; r <= this.leadModel.line && (t = r * this.splitBlockHeight, !(i > (this.waveLists || []).length - 1)); r++)
699
+ e = this.waveConfigs[i].posX || e, t = this.waveConfigs[i].posY || t, o = W(this.waveConfigs[i].speed, this.gridConfig.cellMg, this.waveConfigs[i].sampleRate), a = H(this.waveConfigs[i].gain, this.gridConfig.cellMg), s = this.waveLists[i] || [], this.waveConfigs[i] && (r === 1 && (this.loopArrowY.rowAndCol = t), p.push({
669
700
  pos: [e, t],
670
701
  startInd: n,
671
- endInd: r,
702
+ endInd: h,
672
703
  sens: a,
673
704
  step: o,
674
- data: s.slice(n, r).map((h, C) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? H(this.waveConfigs[i].sensitivity, h, a / 2) : H(this.waveConfigs[i].sensitivity, h, a)).map((h, C) => [C * (o || 0), -h])
705
+ data: s.slice(n, h).map((f, C) => this.waveConfigs[i].leadName === "\u80F8\u5BFC\u51CF\u534A" && /^V\w+/.test(this.waveConfigs[i].leadName) ? M(this.waveConfigs[i].sensitivity, f, a / 2) : M(this.waveConfigs[i].sensitivity, f, a)).map((f, C) => [C * (o || 0), -f])
675
706
  }), i++);
676
707
  }
677
- return f;
708
+ return p;
678
709
  }
679
710
  createRowAndColWaveFrom() {
680
711
  var s, o;
681
712
  (s = this.rowAndColwaveFromGroup) == null || s.removeAll();
682
713
  let e = this.getRednerPoints(), t = 0, i = 0;
683
714
  for (let a = 0; a < e.length; a++)
684
- t = this.waveConfigs[a].leadIdx || 0, this.isLeadDel(t) || (o = this.rowAndColwaveFromGroup) == null || o.add(new P({
715
+ t = this.waveConfigs[a].leadIdx || 0, this.isLeadDel(t) || (o = this.rowAndColwaveFromGroup) == null || o.add(new N({
685
716
  cursor: "",
686
717
  name: a + "_" + a,
687
718
  shape: {
688
- points: e[a].data.map(([n, r], f) => isNaN(r) ? (i === 0 && (i = f - 1, i = i < 0 ? 0 : i), [
719
+ points: e[a].data.map(([n, h], p) => isNaN(h) ? (i === 0 && (i = p - 1, i = i < 0 ? 0 : i), [
689
720
  e[a].data[i][0] + e[a].pos[0],
690
721
  e[a].data[i][1] + e[a].pos[1]
691
722
  ]) : (i = 0, [
692
723
  n + e[a].pos[0],
693
- r + e[a].pos[1]
724
+ h + e[a].pos[1]
694
725
  ]))
695
726
  },
696
727
  style: {
@@ -706,7 +737,7 @@ let g = class extends E {
706
737
  createLeadName(e, t, i, s = !1) {
707
738
  var a;
708
739
  let o = t;
709
- this.leadHeadConfig.isShowLeadCalibration === !1 && (o = t - this.leadHeadConfig.leadHedeWidth + 5), (a = this.leadHeadNameGroup) == null || a.add(new I({
740
+ this.leadHeadConfig.isShowLeadCalibration === !1 && (this.leadModel.isSingleMode ? o = t - this.leadHeadConfig.leadHedeWidth + 12 : o = t - this.leadHeadConfig.leadHedeWidth + 5), (a = this.leadHeadNameGroup) == null || a.add(new y({
710
741
  style: {
711
742
  x: o,
712
743
  y: i,
@@ -717,7 +748,7 @@ let g = class extends E {
717
748
  },
718
749
  oncontextmenu: (n) => {
719
750
  n.event.preventDefault(), this.$emit("notiifyLeadName", {
720
- event: B(y({}, n), {
751
+ event: R(S({}, n), {
721
752
  name: this.leadNames[e],
722
753
  idx: e
723
754
  }),
@@ -726,7 +757,7 @@ let g = class extends E {
726
757
  },
727
758
  onclick: (n) => {
728
759
  this.$emit("notiifyLeadName", {
729
- event: B(y({}, n), {
760
+ event: R(S({}, n), {
730
761
  name: this.leadNames[e],
731
762
  idx: e
732
763
  }),
@@ -737,7 +768,7 @@ let g = class extends E {
737
768
  }
738
769
  createLeadOffAndDel(e, t, i) {
739
770
  var s;
740
- (this.isLeadOff(e) || this.isLeadDel(e)) && ((s = this.leadHeadOffAndDelGroup) == null || s.add(new I({
771
+ (this.isLeadOff(e) || this.isLeadDel(e)) && ((s = this.leadHeadOffAndDelGroup) == null || s.add(new y({
741
772
  cursor: "",
742
773
  style: {
743
774
  x: t,
@@ -756,12 +787,12 @@ let g = class extends E {
756
787
  const o = e.target.name.split("_");
757
788
  this.activeLeadIdx = +o[0];
758
789
  const a = +o[1];
759
- let n = 0, r = 0, f = 0, l = 0, d = 0;
760
- t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[a].pos[0], r = this.singleWaveDataCopy[a].startInd, f = x(n, this.singleWaveDataCopy[a].step || 1), l = this.singleWaveDataCopy[a].sens, d = this.singleWaveDataCopy[a].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[a].pos[0], r = this.waveDataCopy[a].startInd || 0, f = x(n, this.waveDataCopy[a].step || 1), l = this.waveDataCopy[a].sens, d = this.waveDataCopy[a].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[a].pos[0], r = this.addWaveDataCopy[a].startInd || 0, f = x(n, this.addWaveDataCopy[a].step || 1), l = this.addWaveDataCopy[a].sens, d = this.addWaveDataCopy[a].step), f += r, this.$emit("notifyActiveEnlargr", {
761
- sens: l,
762
- step: d,
790
+ let n = 0, h = 0, p = 0, d = 0, r = 0;
791
+ t === "single" ? (n = e.offsetX - this.singleWaveDataCopy[a].pos[0], h = this.singleWaveDataCopy[a].startInd, p = P(n, this.singleWaveDataCopy[a].step || 1), d = this.singleWaveDataCopy[a].sens, r = this.singleWaveDataCopy[a].step) : t === "rowAndCol" ? (n = e.offsetX - this.waveDataCopy[a].pos[0], h = this.waveDataCopy[a].startInd || 0, p = P(n, this.waveDataCopy[a].step || 1), d = this.waveDataCopy[a].sens, r = this.waveDataCopy[a].step) : t === "add" && (n = e.offsetX - this.addWaveDataCopy[a].pos[0], h = this.addWaveDataCopy[a].startInd || 0, p = P(n, this.addWaveDataCopy[a].step || 1), d = this.addWaveDataCopy[a].sens, r = this.addWaveDataCopy[a].step), p += h, this.$emit("notifyActiveEnlargr", {
792
+ sens: d,
793
+ step: r,
763
794
  activeLeadIdx: this.activeLeadIdx,
764
- pointIdx: f
795
+ pointIdx: p
765
796
  });
766
797
  };
767
798
  i - this.dbClickWaveFromTime < 400 ? (this.dbClickWaveFromTime = 0, s()) : this.dbClickWaveFromTime = i;
@@ -773,7 +804,7 @@ let g = class extends E {
773
804
  t.type === "horizontal" && (t.scrollLeft = t.scrollLeft || 0, this.scrollCommon(t.scrollLeft));
774
805
  }
775
806
  scrollCommon(e) {
776
- const t = x(e, this.publicStep || 1);
807
+ const t = P(e, this.publicStep || 1);
777
808
  this.scrollWaveFrom(t), this.scrollRuler(t), this.scrollArrow(t), this.$emit("notifyScrollPointIdx", {
778
809
  slidIdxs: t,
779
810
  scrollLeft: e
@@ -786,18 +817,18 @@ let g = class extends E {
786
817
  this.waveDataCopy = t, this.addWaveDataCopy = i, (s = this.rowAndColwaveFromGroup) == null || s.eachChild((a, n) => {
787
818
  n = n || 0, !(!t[n] || !t[n].data) && a.attr({
788
819
  shape: {
789
- points: t[n].data.map(([r, f]) => [
790
- r + t[n].pos[0],
791
- f + t[n].pos[1]
820
+ points: t[n].data.map(([h, p]) => [
821
+ h + t[n].pos[0],
822
+ p + t[n].pos[1]
792
823
  ])
793
824
  }
794
825
  });
795
826
  }), (o = this.addwaveFromGroup) == null || o.eachChild((a, n) => {
796
827
  n = n || 0, !(!i[n] || !i[n].data) && a.attr({
797
828
  shape: {
798
- points: i[n].data.map(([r, f]) => [
799
- r + i[n].pos[0],
800
- f + i[n].pos[1]
829
+ points: i[n].data.map(([h, p]) => [
830
+ h + i[n].pos[0],
831
+ p + i[n].pos[1]
801
832
  ])
802
833
  }
803
834
  });
@@ -806,7 +837,7 @@ let g = class extends E {
806
837
  scrollRuler(e) {
807
838
  var i, s;
808
839
  (i = this.rulerGroup) == null || i.removeAll(), (s = this.sceneIns) == null || s.remove(this.rulerGroup);
809
- const t = D(this.leadModel.isSingleMode ? 0 : e, this.leadModel.publicSampleRate || 0) / 1e3;
840
+ const t = O(this.leadModel.isSingleMode ? 0 : e, this.leadModel.publicSampleRate || 0) / 1e3;
810
841
  this.drawRuler(t);
811
842
  }
812
843
  scrollArrow(e) {
@@ -990,7 +1021,7 @@ u([
990
1021
  $(200)
991
1022
  ], g.prototype, "handleScroll", 1);
992
1023
  g = u([
993
- q({
1024
+ K({
994
1025
  name: "Methods"
995
1026
  })
996
1027
  ], g);
@@ -1 +1 @@
1
- "use strict";var B=Object.defineProperty,O=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?B(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},H=(e,t)=>O(e,N(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),T=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"),M=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),z=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 $=z(j),V=_(g);var X=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&&X(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(60),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,r,f,l,d;this.sceneInsEventOff(),(e=this.rowAndColwaveFromGroup)==null||e.removeAll(),(t=this.singleWaveFromGroup)==null||t.removeAll(),(i=this.addwaveFromGroup)==null||i.removeAll(),(s=this.leadHeadGroup)==null||s.removeAll(),(a=this.splitLineGroup)==null||a.removeAll(),(o=this.leadHeadNameGroup)==null||o.removeAll(),(n=this.leadHeadOffAndDelGroup)==null||n.removeAll(),(r=this.rulerGroup)==null||r.removeAll(),(f=this.arrowGroup)==null||f.removeAll(),(l=this.heardBeatLineGroup)==null||l.removeAll(),(d=this.sceneIns)==null||d.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.calcHeartBeatPositions(),this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];console.log("this.analyseValues",this.analyseValues);for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate,interval:Math.round(60/(this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate)*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points<=t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd<=t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=M.flattenDeep(this.waveLists);return{maxPoints:M.max(e)||0,minPoints:M.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight-30},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=V.init(e,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const t=document.getElementById(`${this.prefixId}MXGrid`);this.AssistCtx=t.getContext("2d"),this.sceneInsEventOff(),this.sceneIns.on("mousemove",this.sceneInsMousemove),this.sceneIns.on("mousedown",this.sceneInsMouseDown),this.sceneIns.on("mouseup",this.sceneInsMouseUp)}sceneInsMousemove(e){var t;this.sceneIsMouseDown&&(this.scrollConfig.isNativeScroll?(t=this.$refs[`${this.prefixId}nativeScroll`])==null||t.scrollBy({left:e.offsetX-this.sceneIsMouseDownX,top:0}):this.$refs[`${this.prefixId}vueScroll`].scrollBy({dx:e.offsetX-this.sceneIsMouseDownX}))}sceneInsMouseDown(e){this.sceneIsMouseDown=!0,this.sceneIsMouseDownX=e.offsetX}sceneInsMouseUp(e){this.sceneIsMouseDown=!1}sceneInsEventOff(){var e,t,i;(e=this.sceneIns)==null||e.off("mousemove",this.sceneInsMousemove),(t=this.sceneIns)==null||t.off("mousedown",this.sceneInsMouseDown),(i=this.sceneIns)==null||i.off("mouseup",this.sceneInsMouseUp)}drawLeadHead(){var o,n,r,f,l;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup);let e="",t=!1,i=0,s=0;for(let d=0;d<=this.leadModel.column;d++){s=d*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+s])break e;!this.waveConfigs[h-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[h-1+s]||"",this.waveConfigs[h-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[h-1+s].posX?this.waveConfigs[h-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((r=this.leadHeadGroup)==null||r.add(this.createLeadHead(i,this.waveConfigs[h-1+s].posY||h*this.splitBlockHeight,u.getSens(this.waveConfigs[h-1+s].gain,this.gridConfig.cellMg),t))))}}let a=null;for(let d=0;d<this.leadModel.add;d++)!this.waveConfigs[this.longLeadConfig.leadIdxs[d]]||(a=this.waveConfigs[this.longLeadConfig.leadIdxs[d]],e=this.leadNames[this.longLeadConfig.leadNames[this.longLeadConfig.leadNames[d]]],t=!1,a.gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=a.posX?a.posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((f=this.leadHeadGroup)==null||f.add(this.createLeadHead(i,a.posY||(d+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t))));a=null,(l=this.sceneIns)==null||l.add(this.leadHeadGroup)}createLeadHead(e,t,i,s){const a=this.leadHeadConfig.leadHedeWidth/4;return i=s?i/2:i,new g.Polyline({cursor:"",shape:{points:[[0+e,0+t],[a+e,0+t],[a+e,-i+t],[3*a+e,-i+t],[3*a+e,0+t],[4*a+e,0+t]]},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawColSplitLine(){var o,n,r,f,l;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const d=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),h=u.getDataLenTimes(Math.ceil(this.splitPoint/(d||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${h/1e3%60}`,10);this.splitPoint=m*(this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0)*(d||0)}let t=0,i=0,s=0,a=0;for(let d=1;d<=this.leadModel.column-1;d++){t=d*e+this.leadHeadConfig.leadHedeWidth,i=d*this.leadModel.line;e:for(let h=1;h<=this.leadModel.line;h++){if(!(this.waveConfigs||[])[h-1+i])break e;if((this.waveConfigs||[])[h-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[h-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[h-1+i].posX),s=(this.waveConfigs||[])[h-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[h-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[h-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(r=this.splitLineGroup)==null||r.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(f=this.splitLineGroup)==null||f.add(this.creatSplitLine(t,((this.waveConfigs||[])[h-1+i].posY||h*this.splitBlockHeight)-(a||0)*.5,a))}}(l=this.sceneIns)==null||l.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:I({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:I({text:this.rulerConfig.renderText||`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,r,f;if(this.timersCopy=e,!this.rulerConfig.isShow)return;const t=this.dataTotalTimes/1e3;let i=this.leadHeadConfig.leadHedeWidth,s=0,a=t;const o=u.getStepForSpeed(this.rulerConfig.speed,this.gridConfig.cellMg,this.rulerConfig.sampleRate);if(this.leadModel.isContinuous)a=t*5;else if(!this.leadModel.add&&o){const l=u.getPointIdxForPx(this.splitPoint,o),d=u.getDataLenTimes(l,this.rulerConfig.sampleRate||0)/1e3;a=e+d}for(let l=e;l<=a;l=+(l+.1).toFixed(1))l!==e&&(i+=this.rulerStep),l%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:l+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(r=this.rulerGroup)==null||r.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(f=this.sceneIns)==null||f.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(this.drawLoopArrowStartPosIdx)}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),r=[],f=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let l=0;l<1;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let d=1;d<=f;d++)t=d*this.splitBlockHeight,d>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),d===1&&(this.loopArrowY.rowAndCol=t),r.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((h,m)=>this.waveConfigs[this.singleModeConfig.defaultSelect].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[this.singleModeConfig.defaultSelect].leadName)?u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,h,n)).map((h,m)=>[m*(o||0),-h])})}return r}createSingleWaveFrom(){var n,r,f;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=0,o=0;for(let l=0;l<e.length&&!(e[l].pos[1]>this.drawArea.height+this.bottomAreaHeight);l++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(s=parseInt(`${t/1e3/60}`,10),a=parseInt(`${t/1e3%60}`,10),s=a===60?s+=1:s,s=s===0?"00":s<10?`0${s}`:s,a=a===0||a===60?"00":a<10?`0${a}`:a,(r=this.singleWaveFromGroup)==null||r.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+l,shape:{points:e[l].data.map(([d,h],m)=>isNaN(h)?(o===0&&(o=m-1,o=o<0?0:o),[e[l].data[o][0]+e[l].pos[0],e[l].data[o][1]+e[l].pos[1]]):(o=0,[d+e[l].pos[0],h+e[l].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:d=>{this.onDbClickWaveFrom(d,"single")}})),t/1e3<this.dataTotalTimes&&((f=this.singleWaveFromGroup)==null||f.add(new g.Text({cursor:"",style:{x:e[l].pos[0],y:e[l].pos[1]-(e[l].sens||0)/2,text:l===0?"00:00 \u5FC3\u7387":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),l>0&&(t+=i)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[l].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var f,l,d,h,m,y,S,W,C,v,A,P;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 L=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(L||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 r=0;for(let L=0;L<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;L++){const p=this.heartBeatPosition[this.heartFight.showIdxPai][L];if(r=((p==null?void 0:p.position)||0)-e,!(e>((p==null?void 0:p.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&r>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&r>(this.slidingWindowInfo.points||0))){if(((p==null?void 0:p.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=r*(n||0)+this.leadHeadConfig.leadHedeWidth-8.5,a=0,(d=this.arrowGroup)==null||d.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[13+t,0+i],[13+t,10+i],[17+t,10+i],[8.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((l=(f=this.currentHeardBeat)==null?void 0:f.heardBeat)==null?void 0:l.index)===(p==null?void 0:p.index)?"blue":"#ccc"},onclick:F=>{var b;!this.heartFight.mode&&!this.heartFight.isClickArrow||(F.target.attr({style:{fill:"blue"}}),(b=this.arrowGroup)==null||b.children().filter(x=>x.name==="arrow_box").forEach(x=>{x.id!==F.target.id&&x.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(p,F.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.4,y:a+i,text:`${(p==null?void 0:p.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((y=this.AssistCtx)==null?void 0:y.measureText(`${(p==null?void 0:p.interval)||""}`).width)||0,(S=this.arrowGroup)==null||S.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=((W=this.AssistCtx)==null?void 0:W.measureText(`${(p==null?void 0:p.qrstCompany)||""}`).width)||0,(C=this.arrowGroup)==null||C.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=((v=this.AssistCtx)==null?void 0:v.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)})))}}(P=this.sceneIns)==null||P.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,r,f,l,d,h,m,y,S,W;if(!this.currentHeardBeat.heardBeat)return;(n=this.heardBeatLineGroup)==null||n.removeAll(),(r=this.sceneIns)==null||r.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=(f=this.analyseValues[C])==null?void 0:f[this.currentHeardBeat.heardBeat.index])==null?void 0:l.KeyPosByBeat)||t;for(const v in t)if(this.heardBeatLineKeys.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;(d=this.heardBeatLineGroup)==null||d.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}e:for(let C=0;C<a.length;C++)if(!!((h=this.analyseValues[C])!=null&&h[this.currentHeardBeat.heardBeat.index])){t=((y=(m=this.analyseValues[C])==null?void 0:m[this.currentHeardBeat.heardBeat.index])==null?void 0:y.KeyPosByBeat)||t;for(const v in t)if(this.heardBeatLineKeys.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],(S=this.heardBeatLineGroup)==null||S.add(this.createHeardBeatLine(o.pos[0]+i,o.pos[1]))}}(W=this.sceneIns)==null||W.add(this.heardBeatLineGroup),t=null,s=null,a=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let r=0;r<this.leadModel.add;r++)s=this.longLeadConfig.leadIdxs[r],this.waveConfigs[s]&&(t=this.waveConfigs[s].addPosX||t,o=u.getStepForSpeed(this.waveConfigs[s].speed,this.gridConfig.cellMg,this.waveConfigs[s].sampleRate),n=u.getSens(this.waveConfigs[s].gain,this.gridConfig.cellMg),i=this.waveConfigs[s].addPosY||(r+this.leadModel.line+1)*this.splitBlockHeight,a=this.waveLists[s]||[],r===0&&(this.loopArrowY.add=i),e.push({pos:[t,i],startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0,data:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((f,l)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,f,n/2):u.getActualY(this.waveConfigs[s].sensitivity,f,n)).map((f,l)=>[l*(o||0),-f]),sens:n,step:o}));return e}createAddWaveFrom(){var i;let e=this.getAddRednerPoints(),t=0;for(let s=0;s<e.length;s++)this.isLeadDel(this.longLeadConfig.leadIdxs[s])||((i=this.addwaveFromGroup)==null||i.add(new g.Polyline({cursor:"",name:this.longLeadConfig.leadIdxs[s]+"_"+s,shape:{points:e[s].data.map(([a,o],n)=>isNaN(o)?(t===0&&(t=n-1,t=t<0?0:t),[e[s].data[t][0]+e[s].pos[0],e[s].data[t][1]+e[s].pos[1]]):(t=0,[a+e[s].pos[0],o+e[s].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:a=>{this.onDbClickWaveFrom(a,"add")}})),this.createLeadName(this.longLeadConfig.leadNames[s],e[s].pos[0],e[s].pos[1]-15,!0),this.createLeadOffAndDel(this.longLeadConfig.leadIdxs[s],e[s].pos[0]-5,e[s].pos[1]-(e[s].sens||0)/2-15));this.addWaveDataCopy=e,e=null}getRednerPoints(){let e=0,t=0,i=0,s=[],a=0,o=0,n=this.slidingWindowInfo.startInd||0,r=this.slidingWindowInfo.endInd||0;const f=[];for(let l=0;l<this.leadModel.column;l++){e=l*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&l>0&&(n=r,r=n+(this.slidingWindowInfo.points||0));for(let d=1;d<=this.leadModel.line&&(t=d*this.splitBlockHeight,!(i>(this.waveLists||[]).length-1));d++)e=this.waveConfigs[i].posX||e,t=this.waveConfigs[i].posY||t,a=u.getStepForSpeed(this.waveConfigs[i].speed,this.gridConfig.cellMg,this.waveConfigs[i].sampleRate),o=u.getSens(this.waveConfigs[i].gain,this.gridConfig.cellMg),s=this.waveLists[i]||[],this.waveConfigs[i]&&(d===1&&(this.loopArrowY.rowAndCol=t),f.push({pos:[e,t],startInd:n,endInd:r,sens:o,step:a,data:s.slice(n,r).map((h,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,h,o/2):u.getActualY(this.waveConfigs[i].sensitivity,h,o)).map((h,m)=>[m*(a||0),-h])}),i++)}return f}createRowAndColWaveFrom(){var s,a;(s=this.rowAndColwaveFromGroup)==null||s.removeAll();let e=this.getRednerPoints(),t=0,i=0;for(let o=0;o<e.length;o++)t=this.waveConfigs[o].leadIdx||0,this.isLeadDel(t)||(a=this.rowAndColwaveFromGroup)==null||a.add(new g.Polyline({cursor:"",name:o+"_"+o,shape:{points:e[o].data.map(([n,r],f)=>isNaN(r)?(i===0&&(i=f-1,i=i<0?0:i),[e[o].data[i][0]+e[o].pos[0],e[o].data[i][1]+e[o].pos[1]]):(i=0,[n+e[o].pos[0],r+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(a=t-this.leadHeadConfig.leadHedeWidth+5),(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:a,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:H(I({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:H(I({},n),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,r=0,f=0,l=0,d=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],r=this.singleWaveDataCopy[o].startInd,f=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),l=this.singleWaveDataCopy[o].sens,d=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],r=this.waveDataCopy[o].startInd||0,f=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),l=this.waveDataCopy[o].sens,d=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],r=this.addWaveDataCopy[o].startInd||0,f=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),l=this.addWaveDataCopy[o].sens,d=this.addWaveDataCopy[o].step),f+=r,this.$emit("notifyActiveEnlargr",{sens:l,step:d,activeLeadIdx:this.activeLeadIdx,pointIdx:f})};i-this.dbClickWaveFromTime<400?(this.dbClickWaveFromTime=0,s()):this.dbClickWaveFromTime=i}nativeScrollFunc(e){console.log("event",e,e.target.scrollLeft),this.scrollCommon(e.target.scrollLeft||0)}handleScroll(e,t,i){t.type==="horizontal"&&(t.scrollLeft=t.scrollLeft||0,this.scrollCommon(t.scrollLeft))}scrollCommon(e){const t=u.getPointIdxForPx(e,this.publicStep||1);this.scrollWaveFrom(t),this.scrollRuler(t),this.scrollArrow(t),this.$emit("notifyScrollPointIdx",{slidIdxs:t,scrollLeft:e})}scrollWaveFrom(e){var s,a;this.slidingWindowInfo.startInd=e,this.slidingWindowInfo.endInd=e+(this.slidingWindowInfo.points||0),this.addSlidingWindowInfo.startInd=e,this.addSlidingWindowInfo.endInd=e+(this.addSlidingWindowInfo.points||0);let t=this.getRednerPoints(),i=this.getAddRednerPoints();this.waveDataCopy=t,this.addWaveDataCopy=i,(s=this.rowAndColwaveFromGroup)==null||s.eachChild((o,n)=>{n=n||0,!(!t[n]||!t[n].data)&&o.attr({shape:{points:t[n].data.map(([r,f])=>[r+t[n].pos[0],f+t[n].pos[1]])}})}),(a=this.addwaveFromGroup)==null||a.eachChild((o,n)=>{n=n||0,!(!i[n]||!i[n].data)&&o.attr({shape:{points:i[n].data.map(([r,f])=>[r+i[n].pos[0],f+i[n].pos[1]])}})}),t=null,i=null}scrollRuler(e){var i,s;(i=this.rulerGroup)==null||i.removeAll(),(s=this.sceneIns)==null||s.remove(this.rulerGroup);const t=u.getDataLenTimes(this.leadModel.isSingleMode?0:e,this.leadModel.publicSampleRate||0)/1e3;this.drawRuler(t)}scrollArrow(e){var t,i;(t=this.arrowGroup)==null||t.removeAll(),(i=this.sceneIns)==null||i.remove(this.arrowGroup),this.drawLoopArrow(e),this.drawHeardBeatLine(e)}};c([w.Prop({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);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,isClickArrow:!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([T.default({name:"Methods"})],exports.default);
1
+ "use strict";var B=Object.defineProperty,O=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?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,y=(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},P=(e,t)=>O(e,N(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("vue"),T=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"),b=require("lodash"),u=require("@costy-plus/utils"),g=require("zrender"),z=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 $=z(j),V=_(g);var X=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&&X(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(60),this.totalRows=Object.freeze(0),this.rulerStep=Object.freeze(0),this.drawLoopArrowStartPosIdx=Object.freeze(0),this.dbClickWaveFromTime=Object.freeze(0),this.timersCopy=Object.freeze(0),this.range=Object.freeze(5e3),this.heartBeatPosition=[],this.currentHeardBeat={heardBeat:null,ele:null},this.loopArrowY=Object.freeze({add:0,rowAndCol:0}),this.fontFamily=Object.freeze("\u5FAE\u8F6F\u96C5\u9ED1"),this.ruleH=Object.freeze(40),this.splitBlockHeight=0,this.splitPoint=0,this.slidingWindowInfo=Object.freeze({}),this.addSlidingWindowInfo=Object.freeze({}),this.highestAndLowestPoint=Object.freeze({maxPoints:0,minPoints:0}),this.drawArea=Object.freeze({width:0,height:0}),this.vuescrollWH={width:0,height:0},this.waveDataCopy=[],this.addWaveDataCopy=[],this.singleWaveDataCopy=[],this.leadNameList=[],this.activeLeadIdx=Object.freeze(-1),this.publicStep=Object.freeze(0),this.sceneIsMouseDown=Object.freeze(!1),this.sceneIsMouseDownX=Object.freeze(0)}get canvasContainer(){var e;return{width:this.width,height:this.height-(this.scrollConfig.isShow&&parseInt(`${(e=this.scrollConfig.bar)==null?void 0:e.size}`)||0)||0}}destroyed(){var e,t,i,s,a,o,n,h,p,d,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(),(h=this.rulerGroup)==null||h.removeAll(),(p=this.arrowGroup)==null||p.removeAll(),(d=this.heardBeatLineGroup)==null||d.removeAll(),(r=this.sceneIns)==null||r.dispose()}initCreatedConfig(){this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.calcHeartBeatPositions(),this.initConfig()}init(){this.calcHeartBeatPositions(),this.initWaveFormPeer(),this.combinationDrawing(),this.registPostStart()}registPostStart(){this.posStart!==void 0&&this.posStart!==null&&(this.scrollConfig.isShow?this.$nextTick(()=>{var e;this.scrollConfig.isNativeScroll?(e=this.$refs[this.prefixId+"nativeScroll"])==null||e.scrollBy({left:(this.posStart||0)*(this.publicStep||1),top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:(this.posStart||0)*(this.publicStep||1)})}):(this.scrollWaveFrom(this.posStart),this.scrollRuler(this.posStart),this.scrollArrow(this.posStart)))}resetScroll(e=0){this.scrollConfig.isShow?this.$nextTick(()=>{var t;this.scrollConfig.isNativeScroll?(t=this.$refs[this.prefixId+"nativeScroll"])==null||t.scrollBy({left:e,top:0}):this.$refs[this.prefixId+"vueScroll"].scrollTo({x:e})}):(this.scrollWaveFrom(e),this.scrollRuler(e),this.scrollArrow(e))}combinationDrawing(){this.drawLeadHead(),this.drawColSplitLine(),this.initSlidingWindowInfo(),this.drawRulerNotes(),this.drawWaveFrom()}calcHeartBeatPositions(){let e=[];console.log("this.analyseValues",this.analyseValues);for(let t=0;t<this.analyseValues.length;t++){for(let i=1;i<this.analyseValues[t].length;i++)t!==1&&this.analyseValues[t][i].KeyPosByBeat.Rpoint===0||e.push({index:this.analyseValues[t][i].BeatID,position:this.analyseValues[t][i].KeyPosByBeat.Rpoint,heartrate:this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate,interval:Math.round(60/(this.analyseValues[t][i].AnabyBeat.VentricularRate||this.analyseValues[t][i].AnabyBeat.AtrialRate)*1e3),telectricalaxis:this.analyseValues[t][i].AnabyBeat.TAxis===9999?this.range:this.analyseValues[t][i].AnabyBeat.TAxis,qrstCompany:(this.analyseValues[t][i].AnabyBeat.QRS_T===9999?this.range:this.analyseValues[t][i].AnabyBeat.QRS_T)+"\xB0"});this.heartBeatPosition.push(e)}e=null}initSlidingWindowInfo(){const e=this.publicStep||0,t=Math.ceil(this.splitPoint/e);if(this.slidingWindowInfo={points:this.slidingWindowInfo.points<=t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.points,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd<=t||this.leadModel.isSingleMode?t:this.slidingWindowInfo.endInd},this.scrollConfig.isShow&&!this.leadModel.isSingleMode){const s=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),a=this.dataTotalLength*s;this.vuescrollWH.width=this.canvasContainer.width+(a||0)-this.splitPoint}const i=Math.ceil((this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/e);this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.points,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd<=i||this.leadModel.isSingleMode?i:this.addSlidingWindowInfo.endInd}}calcHighestAndLowestPoint(){const e=b.flattenDeep(this.waveLists);return{maxPoints:b.max(e)||0,minPoints:b.min(e)||0}}isLeadOff(e){return!!this.waveConfigs[e].isLeadOff}isLeadDel(e){return!!this.waveConfigs[e].isLeadDelete}initConfig(){var t;this.rowAndColwaveFromGroup=new g.Group({name:"rowAndColwaveFrom"}),this.singleWaveFromGroup=new g.Group({name:"singleWaveFrom"}),this.addwaveFromGroup=new g.Group({name:"addwaveFrom"}),this.leadHeadGroup=new g.Group({name:"leadHead"}),this.splitLineGroup=new g.Group({name:"splitLine"}),this.leadHeadNameGroup=new g.Group({name:"leadHeadName"}),this.leadHeadOffAndDelGroup=new g.Group({name:"leadHeadOffAndDel"}),this.rulerGroup=new g.Group({name:"ruler"}),this.arrowGroup=new g.Group({name:"arrowLoop"}),this.heardBeatLineGroup=new g.Group({name:"heardBeatLine"});let e=this.canvasContainer.width;if(this.leadModel.ecgareawidth===1){const i=u.getPrintLengthToPx(((t=this.waveConfigs[0])==null?void 0:t.sampleRate)||0)+this.leadHeadConfig.leadHedeWidth;i<=e&&(e=i)}else if(this.leadModel.isContinuous){const i=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),s=this.dataTotalLength*i;!this.leadModel.isSingleMode&&(s||0)<e-this.leadHeadConfig.leadHedeWidth&&(e=(s||0)+this.leadHeadConfig.leadHedeWidth)}this.drawArea={width:e,height:this.canvasContainer.height-this.bottomAreaHeight-30},this.slidingWindowInfo={points:this.slidingWindowInfo.points||0,startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0},this.addSlidingWindowInfo={points:this.addSlidingWindowInfo.points||0,startInd:this.addSlidingWindowInfo.startInd||0,endInd:this.addSlidingWindowInfo.endInd||0},this.loopArrowY={add:0,rowAndCol:0},this.currentHeardBeat={heardBeat:null,ele:null},this.leadNameList=this.leadNames.map((i,s)=>s)||[],this.totalRows=this.leadModel.line+this.leadModel.add||1,this.highestAndLowestPoint=this.calcHighestAndLowestPoint(),this.leadModel.isSingleMode?(this.splitBlockHeight=Math.abs(this.highestAndLowestPoint.maxPoints)+Math.abs(this.highestAndLowestPoint.minPoints)+22,this.splitBlockHeight>this.drawArea.height&&(this.splitBlockHeight=this.drawArea.height/6)):this.splitBlockHeight=this.drawArea.height/this.totalRows,this.publicStep=u.getStepForSpeed(this.leadModel.publicSpeed,this.gridConfig.cellMg,this.leadModel.publicSampleRate),this.rulerStep=(this.publicStep||1)*(this.leadModel.publicSampleRate||1)/(this.gridConfig.cellMg*2+2)}initWaveFormPeer(){var i;(i=this.sceneIns)==null||i.dispose(),this.AssistCtx=null;const e=document.getElementById(`${this.prefixId}wave-from-box`);this.sceneIns=V.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,h,p,d;(o=this.leadHeadGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.leadHeadGroup);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 f=1;f<=this.leadModel.line;f++){if(!(this.waveConfigs||[])[f-1+s])break e;!this.waveConfigs[f-1+s].isShowLeadHead||(t=!1,e=(this.leadNames||[])[f-1+s]||"",this.waveConfigs[f-1+s].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(e)&&(t=!0),i=this.waveConfigs[f-1+s].posX?this.waveConfigs[f-1+s].posX-this.leadHeadConfig.leadHedeWidth:0,this.leadHeadConfig.isShowLeadCalibration!==!1&&((h=this.leadHeadGroup)==null||h.add(this.createLeadHead(i,this.waveConfigs[f-1+s].posY||f*this.splitBlockHeight,u.getSens(this.waveConfigs[f-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,this.leadHeadConfig.isShowLeadCalibration!==!1&&((p=this.leadHeadGroup)==null||p.add(this.createLeadHead(i,a.posY||(r+1+this.leadModel.line)*this.splitBlockHeight,u.getSens(a.gain,this.gridConfig.cellMg),t))));a=null,(d=this.sceneIns)==null||d.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,h,p,d;(o=this.splitLineGroup)==null||o.removeAll(),(n=this.sceneIns)==null||n.remove(this.splitLineGroup);const e=(this.drawArea.width-this.leadHeadConfig.leadHedeWidth)/(this.leadModel.column||1);if(this.splitPoint=e,this.leadModel.isSingleMode){const r=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),f=u.getDataLenTimes(Math.ceil(this.splitPoint/(r||1))||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0),m=parseInt(`${f/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 f=1;f<=this.leadModel.line;f++){if(!(this.waveConfigs||[])[f-1+i])break e;if((this.waveConfigs||[])[f-1+i].isShowLeadHead)continue e;if((this.waveConfigs||[])[f-1+i].posX!==void 0&&(t=(this.waveConfigs||[])[f-1+i].posX),s=(this.waveConfigs||[])[f-1+i].leadIdx,s===void 0)break;a=u.getSens((this.waveConfigs||[])[f-1+i].gain,this.gridConfig.cellMg),(this.waveConfigs||[])[f-1+i].gainName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.leadNames[s])?(h=this.splitLineGroup)==null||h.add(this.creatSplitLine(t,((this.waveConfigs||[])[f-1+i].posY||f*this.splitBlockHeight)-(a||0)/2*.5,a,!0)):(p=this.splitLineGroup)==null||p.add(this.creatSplitLine(t,((this.waveConfigs||[])[f-1+i].posY||f*this.splitBlockHeight)-(a||0)*.5,a))}}(d=this.sceneIns)==null||d.add(this.splitLineGroup)}creatSplitLine(e,t,i,s){return new g.Line({cursor:"",shape:{x1:0+e,y1:0+t,x2:0+e,y2:(s?(i||0)/2:i||0)+t},style:{stroke:this.leadHeadConfig.leadHedeColor,lineWidth:this.leadHeadConfig.leadHedeLineWidth}})}drawRulerNotes(){var s,a;if(!this.rulerConfig.isShow)return;const e={fill:"#FF0080",fontSize:13,fontFamily:this.fontFamily},t=new g.Text({cursor:"",style:y({text:"(s)",x:this.leadHeadConfig.leadHedeWidth/2-8,y:this.canvasContainer.height-25},e)}),i=new g.Text({style:y({text:this.rulerConfig.renderText||`${this.rulerConfig.gainName} ${this.rulerConfig.speedName}`,x:this.leadHeadConfig.leadHedeWidth/2+20,y:this.canvasContainer.height-this.ruleH},e)});(s=this.sceneIns)==null||s.add(i),(a=this.sceneIns)==null||a.add(t)}drawRuler(e=0){var n,h,p;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 d=u.getPointIdxForPx(this.splitPoint,o),r=u.getDataLenTimes(d,this.rulerConfig.sampleRate||0)/1e3;a=e+r}for(let d=e;d<=a;d=+(d+.1).toFixed(1))d!==e&&(i+=this.rulerStep),d%1===0?(s=this.canvasContainer.height-10,(n=this.rulerGroup)==null||n.add(new g.Text({cursor:"",style:{x:i,y:s-15,text:d+"",fontSize:13,fontFamily:this.fontFamily,fill:"#FF0080"}}))):s=this.canvasContainer.height-5,(h=this.rulerGroup)==null||h.add(new g.Line({cursor:"",shape:{x1:i,y1:s,x2:i,y2:this.canvasContainer.height},style:{stroke:"#FF0080",lineWidth:2}}));(p=this.sceneIns)==null||p.add(this.rulerGroup)}drawWaveFrom(){var e,t,i;this.leadModel.isSingleMode?(this.addWaveDataCopy=[],this.waveDataCopy=[],this.createSingleWaveFrom(),(e=this.sceneIns)==null||e.add(this.singleWaveFromGroup)):(this.singleWaveDataCopy=[],this.createAddWaveFrom(),this.createRowAndColWaveFrom(),(t=this.sceneIns)==null||t.add(this.rowAndColwaveFromGroup),(i=this.sceneIns)==null||i.add(this.addwaveFromGroup)),this.drawLeadHeadNameAndOffOrDel(),this.drawRuler(this.timersCopy),this.drawLoopArrow(this.drawLoopArrowStartPosIdx)}getRednerSinglePoints(){let e=0,t=0;const i=this.waveLists[this.singleModeConfig.defaultSelect]||[];let s=this.slidingWindowInfo.startInd||0,a=this.slidingWindowInfo.endInd||0;const o=u.getStepForSpeed(this.waveConfigs[this.singleModeConfig.defaultSelect].speed,this.gridConfig.cellMg,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate),n=u.getSens(this.waveConfigs[this.singleModeConfig.defaultSelect].gain,this.gridConfig.cellMg),h=[],p=Math.ceil(i.length/(this.slidingWindowInfo.points||1));for(let d=0;d<1;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0;for(let r=1;r<=p;r++)t=r*this.splitBlockHeight,r>1&&(t*=.8,s=a,a=s+(this.slidingWindowInfo.points||0)),r===1&&(this.loopArrowY.rowAndCol=t),h.push({pos:[e,t],startInd:s,endInd:a,step:o,sens:n,data:i.slice(s,a).map((f,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,f,n/2):u.getActualY(this.waveConfigs[this.singleModeConfig.defaultSelect].sensitivity,f,n)).map((f,m)=>[m*(o||0),-f])})}return h}createSingleWaveFrom(){var n,h,p;(n=this.singleWaveFromGroup)==null||n.removeAll();let e=this.getRednerSinglePoints(),t=u.getDataLenTimes(this.slidingWindowInfo.points||0,this.waveConfigs[this.singleModeConfig.defaultSelect].sampleRate||0);const i=t;let s=0,a=0,o=0;for(let d=0;d<e.length&&!(e[d].pos[1]>this.drawArea.height+this.bottomAreaHeight);d++)this.isLeadDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx)||(s=parseInt(`${t/1e3/60}`,10),a=parseInt(`${t/1e3%60}`,10),s=a===60?s+=1:s,s=s===0?"00":s<10?`0${s}`:s,a=a===0||a===60?"00":a<10?`0${a}`:a,(h=this.singleWaveFromGroup)==null||h.add(new g.Polyline({cursor:"",name:this.singleModeConfig.defaultSelect+"_"+d,shape:{points:e[d].data.map(([r,f],m)=>isNaN(f)?(o===0&&(o=m-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,[r+e[d].pos[0],f+e[d].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:r=>{this.onDbClickWaveFrom(r,"single")}})),t/1e3<this.dataTotalTimes&&((p=this.singleWaveFromGroup)==null||p.add(new g.Text({cursor:"",style:{x:e[d].pos[0],y:e[d].pos[1]-(e[d].sens||0)/2,text:d===0?"00:00 \u5FC3\u7387":`${s}:${a} \u5FC3\u7387`,fontWeight:"bold",fontSize:14,fill:"#FF0080",fontFamily:this.fontFamily}}))),d>0&&(t+=i)),this.createLeadName(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-10,e[0].pos[1]+10),this.createLeadOffAndDel(this.waveConfigs[this.singleModeConfig.defaultSelect].leadIdx,e[0].pos[0]-5,e[0].pos[1]-(e[d].sens||0)/2-15);this.singleWaveDataCopy=e,e=null}drawLoopArrow(e=0){var p,d,r,f,m,S,W,L,H,M,x,I;if(this.drawLoopArrowStartPosIdx=e,!this.heartFight.isShow)return;this.heartFight.mode&&this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=this.heartBeatPosition[this.heartFight.showIdxPai][this.heartFight.defaultSelect]||null,this.drawHeardBeatLine());let t=0,i=0;if(this.leadModel.add){const C=u.getSens(this.waveConfigs[this.longLeadConfig.leadIdxs[0]].gain,this.gridConfig.cellMg);i=this.loopArrowY.add-(C||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 h=0;for(let C=0;C<(this.heartBeatPosition[this.heartFight.showIdxPai]||[]).length;C++){const l=this.heartBeatPosition[this.heartFight.showIdxPai][C];if(h=((l==null?void 0:l.position)||0)-e,!(e>((l==null?void 0:l.position)||0))&&!(!this.leadModel.isContinuous&&!this.leadModel.add&&h>(this.slidingWindowInfo.points||0))&&!(this.leadModel.isSingleMode&&h>(this.slidingWindowInfo.points||0))){if(((l==null?void 0:l.position)||0)-this.addSlidingWindowInfo.startInd>(this.addSlidingWindowInfo.points||0))break;t=h*(n||0)+this.leadHeadConfig.leadHedeWidth-8.5,a=0,(r=this.arrowGroup)==null||r.add(new g.Polygon({name:"arrow_box",shape:{points:[[4+t,0+i],[13+t,0+i],[13+t,10+i],[17+t,10+i],[8.5+t,22+i],[0+t,10+i],[4+t,10+i],[4+t,0+i]]},style:{fill:((d=(p=this.currentHeardBeat)==null?void 0:p.heardBeat)==null?void 0:d.index)===(l==null?void 0:l.index)?"blue":"#ccc"},onclick:v=>{var F;!this.heartFight.mode&&!this.heartFight.isClickArrow||(v.target.attr({style:{fill:"blue"}}),(F=this.arrowGroup)==null||F.children().filter(A=>A.name==="arrow_box").forEach(A=>{A.id!==v.target.id&&A.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(l,v.target))}})),this.heartFight.heartrate&&(s=((f=this.AssistCtx)==null?void 0:f.measureText(`${(l==null?void 0:l.heartrate)||""}`).width)||0,(m=this.arrowGroup)==null||m.add(new g.Text({cursor:"",style:y({x:4+t-s*1.4,y:a+i,text:`${(l==null?void 0:l.heartrate)||""}`},o)})),a+=12),this.heartFight.interval&&(s=((S=this.AssistCtx)==null?void 0:S.measureText(`${(l==null?void 0:l.interval)||""}`).width)||0,(W=this.arrowGroup)==null||W.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(l==null?void 0:l.interval)||""}`},o)})),a+=12),this.heartFight.qrstCompany&&(s=((L=this.AssistCtx)==null?void 0:L.measureText(`${(l==null?void 0:l.qrstCompany)||""}`).width)||0,(H=this.arrowGroup)==null||H.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(l==null?void 0:l.qrstCompany)||""}`},o)})),a+=12),this.heartFight.telectricalaxis&&(s=((M=this.AssistCtx)==null?void 0:M.measureText(`${(l==null?void 0:l.telectricalaxis)||""}`).width)||0,(x=this.arrowGroup)==null||x.add(new g.Text({cursor:"",style:y({x:4+t-s*1.5,y:a+i,text:`${(l==null?void 0:l.telectricalaxis)||""}`},o)})))}}(I=this.sceneIns)==null||I.add(this.arrowGroup)}arrowLoopClick(e,t){this.$emit("notifyHeardBeat",g.util.clone(e)),this.currentHeardBeat.heardBeat=e,this.currentHeardBeat.ele=t,this.drawHeardBeatLine()}drawHeardBeatLine(e=0){var a,o,n,h,p,d,r,f,m,S,W,L,H,M,x;if(!this.currentHeardBeat.heardBeat)return;(a=this.heardBeatLineGroup)==null||a.removeAll(),(o=this.sceneIns)==null||o.remove(this.heardBeatLineGroup);let t={},i=0,s;if(this.leadModel.isSingleMode){let I=this.getRednerSinglePoints();e:for(let C=0;C<I.length;C++){if(C>=1||this.leadNames[this.singleModeConfig.defaultSelect]==="M")break e;if((n=this.analyseValues[this.singleModeConfig.defaultSelect])!=null&&n[this.currentHeardBeat.heardBeat.index])t=((d=(p=this.analyseValues[this.singleModeConfig.defaultSelect])==null?void 0:p[this.currentHeardBeat.heardBeat.index])==null?void 0:d.KeyPosByBeat)||t;else{let l=this.analyseValues.find(v=>{var F;return(F=v[this.currentHeardBeat.heardBeat.index])==null?void 0:F.KeyPosByBeat});if(!l)break e;l&&(t=(h=l[this.currentHeardBeat.heardBeat.index])==null?void 0:h.KeyPosByBeat),l=null}for(const l in t)if(this.heardBeatLineKeys.includes(l)){if(i=(t[l]-this.slidingWindowInfo.startInd)*(I[C].step||0),this.isLeadOff(C)||this.isLeadDel(C))continue;if(!this.leadModel.isContinuous&&t[l]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break e;s=I[C],(r=this.heardBeatLineGroup)==null||r.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}I=null}else{let I=this.getRednerPoints(),C=this.getAddRednerPoints();e:for(let l=0;l<I.length;l++){t=((m=(f=this.analyseValues[l])==null?void 0:f[this.currentHeardBeat.heardBeat.index])==null?void 0:m.KeyPosByBeat)||t;for(const v in t)if(this.heardBeatLineKeys.includes(v)&&Object.prototype.hasOwnProperty.call(t,v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(I[l].step||0),this.isLeadOff(l)||this.isLeadDel(l))continue;if(e>t[v]||!this.leadModel.isContinuous&&t[v]-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0)||(s=I[l],this.leadModel.isContinuous&&l>this.leadModel.line-1))break e;(S=this.heardBeatLineGroup)==null||S.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}e:for(let l=0;l<C.length;l++)if(!!((W=this.analyseValues[l])!=null&&W[this.currentHeardBeat.heardBeat.index])){t=((H=(L=this.analyseValues[l])==null?void 0:L[this.currentHeardBeat.heardBeat.index])==null?void 0:H.KeyPosByBeat)||t;for(const v in t)if(this.heardBeatLineKeys.includes(v)){if(i=(t[v]-this.slidingWindowInfo.startInd)*(C[l].step||0),this.isLeadOff(this.longLeadConfig.leadIdxs[l])&&this.isLeadDel(this.longLeadConfig.leadIdxs[l]))continue;if(e>t[v])break e;s=C[l],(M=this.heardBeatLineGroup)==null||M.add(this.createHeardBeatLine(s.pos[0]+i,s.pos[1]))}}I=null,C=null}(x=this.sceneIns)==null||x.add(this.heardBeatLineGroup),t=null}createHeardBeatLine(e,t){return new g.Line({cursor:"",shape:{x1:e,y1:t-15,x2:e,y2:t+15},style:{stroke:"blue",lineWidth:1}})}drawLeadHeadNameAndOffOrDel(){var e,t;(e=this.sceneIns)==null||e.add(this.leadHeadNameGroup),(t=this.sceneIns)==null||t.add(this.leadHeadOffAndDelGroup)}getAddRednerPoints(){const e=[];let t=this.leadHeadConfig.leadHedeWidth,i=0,s=0,a=[],o=0,n=0;for(let h=0;h<this.leadModel.add;h++)s=this.longLeadConfig.leadIdxs[h],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||(h+this.leadModel.line+1)*this.splitBlockHeight,a=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:a.slice(this.addSlidingWindowInfo.startInd,this.addSlidingWindowInfo.endInd).map((p,d)=>this.waveConfigs[s].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[s].leadName)?u.getActualY(this.waveConfigs[s].sensitivity,p,n/2):u.getActualY(this.waveConfigs[s].sensitivity,p,n)).map((p,d)=>[d*(o||0),-p]),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,h=this.slidingWindowInfo.endInd||0;const p=[];for(let d=0;d<this.leadModel.column;d++){e=d*this.splitPoint+this.leadHeadConfig.leadHedeWidth,t=0,this.leadModel.isContinuous&&d>0&&(n=h,h=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),p.push({pos:[e,t],startInd:n,endInd:h,sens:o,step:a,data:s.slice(n,h).map((f,m)=>this.waveConfigs[i].leadName==="\u80F8\u5BFC\u51CF\u534A"&&/^V\w+/.test(this.waveConfigs[i].leadName)?u.getActualY(this.waveConfigs[i].sensitivity,f,o/2):u.getActualY(this.waveConfigs[i].sensitivity,f,o)).map((f,m)=>[m*(a||0),-f])}),i++)}return p}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,h],p)=>isNaN(h)?(i===0&&(i=p-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],h+e[o].pos[1]]))},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth},onclick:n=>{this.onDbClickWaveFrom(n,"rowAndCol")}})),o<this.leadModel.line?(this.createLeadName(t,e[o].pos[0],e[o].pos[1]-15),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2-15)):(this.createLeadName(t,e[o].pos[0]+5,e[o].pos[1]-(e[o].sens||0)/2),this.createLeadOffAndDel(t,e[o].pos[0]-5,e[o].pos[1]-(e[o].sens||0)/2+9));this.waveDataCopy=e,e=null}createLeadName(e,t,i,s=!1){var o;let a=t;this.leadHeadConfig.isShowLeadCalibration===!1&&(this.leadModel.isSingleMode?a=t-this.leadHeadConfig.leadHedeWidth+12:a=t-this.leadHeadConfig.leadHedeWidth+5),(o=this.leadHeadNameGroup)==null||o.add(new g.Text({style:{x:a,y:i,text:this.leadNames[e],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily},oncontextmenu:n=>{n.event.preventDefault(),this.$emit("notiifyLeadName",{event:P(y({},n),{name:this.leadNames[e],idx:e}),isAdd:s})},onclick:n=>{this.$emit("notiifyLeadName",{event:P(y({},n),{name:this.leadNames[e],idx:e}),isAdd:s})}}))}createLeadOffAndDel(e,t,i){var s;(this.isLeadOff(e)||this.isLeadDel(e))&&((s=this.leadHeadOffAndDelGroup)==null||s.add(new g.Text({cursor:"",style:{x:t,y:i,text:"X",fontWeight:"bold",fontSize:18,fill:"#E42c03",fontFamily:this.fontFamily}})))}onDbClickWaveFrom(e,t){console.log("onDbClickWaveFrom",e);const i=Date.now(),s=()=>{const a=e.target.name.split("_");this.activeLeadIdx=+a[0];const o=+a[1];let n=0,h=0,p=0,d=0,r=0;t==="single"?(n=e.offsetX-this.singleWaveDataCopy[o].pos[0],h=this.singleWaveDataCopy[o].startInd,p=u.getPointIdxForPx(n,this.singleWaveDataCopy[o].step||1),d=this.singleWaveDataCopy[o].sens,r=this.singleWaveDataCopy[o].step):t==="rowAndCol"?(n=e.offsetX-this.waveDataCopy[o].pos[0],h=this.waveDataCopy[o].startInd||0,p=u.getPointIdxForPx(n,this.waveDataCopy[o].step||1),d=this.waveDataCopy[o].sens,r=this.waveDataCopy[o].step):t==="add"&&(n=e.offsetX-this.addWaveDataCopy[o].pos[0],h=this.addWaveDataCopy[o].startInd||0,p=u.getPointIdxForPx(n,this.addWaveDataCopy[o].step||1),d=this.addWaveDataCopy[o].sens,r=this.addWaveDataCopy[o].step),p+=h,this.$emit("notifyActiveEnlargr",{sens:d,step:r,activeLeadIdx:this.activeLeadIdx,pointIdx:p})};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(([h,p])=>[h+t[n].pos[0],p+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(([h,p])=>[h+i[n].pos[0],p+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({default:()=>["Pstart","Pend","QRSstart","QRSend","Tstart","Tend"]})],exports.default.prototype,"heardBeatLineKeys",2);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,isClickArrow:!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([T.default({name:"Methods"})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.0.92-0",
3
+ "version": "1.0.93-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",