costy-plus 1.0.46-0 → 1.0.47-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.
@@ -2,12 +2,14 @@ import PropsMinix from './PropsMinix';
2
2
  declare const MXBackgroundGrid_base: import("vue-class-component/lib/declarations").VueClass<PropsMinix>;
3
3
  declare class MXBackgroundGrid extends MXBackgroundGrid_base {
4
4
  protected canvasIns: Readonly<CanvasRenderingContext2D | null>;
5
+ protected againInitGridTimer: any;
5
6
  protected watchWidth(): void;
6
7
  protected watchHeight(): void;
7
8
  protected watchGridConfig(): void;
8
9
  protected get cellMg(): number;
9
10
  protected mounted(): void;
10
- protected againInitGrid: import("lodash").DebouncedFunc<() => void>;
11
+ protected destroyed(): void;
12
+ protected againInitGrid(): void;
11
13
  protected initGrid(): void;
12
14
  protected drawPoints(): void;
13
15
  protected drawRowAndCol(): void;
@@ -1,19 +1,16 @@
1
1
  import "vue";
2
2
  import w, { mixins as m } 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";
3
3
  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";
4
- import { Watch 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/Watch.js";
5
- import { debounce as C } from "lodash";
4
+ import { Watch as d } 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/Watch.js";
6
5
  import I from "./PropsMinix.js";
7
- var p = Object.defineProperty, u = Object.getOwnPropertyDescriptor, g = (s, i, t, h) => {
8
- for (var e = h > 1 ? void 0 : h ? u(i, t) : i, n = s.length - 1, a; n >= 0; n--)
6
+ var C = Object.defineProperty, T = Object.getOwnPropertyDescriptor, g = (s, i, t, h) => {
7
+ for (var e = h > 1 ? void 0 : h ? T(i, t) : i, n = s.length - 1, a; n >= 0; n--)
9
8
  (a = s[n]) && (e = (h ? a(i, t, e) : a(e)) || e);
10
- return h && e && p(i, t, e), e;
9
+ return h && e && C(i, t, e), e;
11
10
  };
12
11
  let l = class extends m(I) {
13
12
  constructor() {
14
- super(...arguments), this.canvasIns = Object.freeze(null), this.againInitGrid = C(() => {
15
- this.initGrid();
16
- }, 100);
13
+ super(...arguments), this.canvasIns = Object.freeze(null), this.againInitGridTimer = Object.freeze(null);
17
14
  }
18
15
  watchWidth() {
19
16
  this.againInitGrid();
@@ -30,6 +27,14 @@ let l = class extends m(I) {
30
27
  mounted() {
31
28
  this.initGrid();
32
29
  }
30
+ destroyed() {
31
+ this.againInitGridTimer && clearTimeout(this.againInitGridTimer);
32
+ }
33
+ againInitGrid() {
34
+ this.againInitGridTimer && clearTimeout(this.againInitGridTimer), this.againInitGridTimer = setTimeout(() => {
35
+ this.initGrid();
36
+ }, 100);
37
+ }
33
38
  initGrid() {
34
39
  if (this.canvasIns)
35
40
  this.canvasIns.clearRect(0, 0, this.width, this.height);
@@ -40,7 +45,7 @@ let l = class extends m(I) {
40
45
  this.model === 0 ? (this.drawPoints(), this.drawRowAndCol()) : this.model === 1 && this.drawMesh();
41
46
  }
42
47
  drawPoints() {
43
- var a, r;
48
+ var a, o;
44
49
  let i = this.gridConfig.lineWidth === 1 ? 0.5 : 0, t = this.cellMg;
45
50
  const h = [], e = this.magnification > 1 ? this.gridConfig.lineWidth + 1 : this.gridConfig.lineWidth;
46
51
  for (this.beforeCtxDraw(
@@ -52,14 +57,14 @@ let l = class extends m(I) {
52
57
  let n = 0;
53
58
  for (; i < this.height; ) {
54
59
  if (n % this.cellPoints !== 0)
55
- for (let o = 0; o < h.length; o++)
56
- (o + 2) % this.cellPoints !== 0 && o % 2 === 0 && ((a = this.canvasIns) == null || a.moveTo(h[o], i), (r = this.canvasIns) == null || r.lineTo(h[o + 1], i));
60
+ for (let r = 0; r < h.length; r++)
61
+ (r + 2) % this.cellPoints !== 0 && r % 2 === 0 && ((a = this.canvasIns) == null || a.moveTo(h[r], i), (o = this.canvasIns) == null || o.lineTo(h[r + 1], i));
57
62
  i += this.cellMg, n++;
58
63
  }
59
64
  this.afterDrawOver(this.canvasIns);
60
65
  }
61
66
  drawRowAndCol() {
62
- var e, n, a, r;
67
+ var e, n, a, o;
63
68
  const s = this.gridConfig.lineWidth === 1 ? 0.5 : 0;
64
69
  let i = s, t = s, h = 0;
65
70
  for (this.beforeCtxDraw(
@@ -67,11 +72,11 @@ let l = class extends m(I) {
67
72
  this.gridConfig.bigCellColor,
68
73
  this.gridConfig.lineWidth
69
74
  ); i < this.width || t < this.height; )
70
- h % this.cellPoints === 0 && ((e = this.canvasIns) == null || e.moveTo(i, 0), (n = this.canvasIns) == null || n.lineTo(i, this.height), (a = this.canvasIns) == null || a.moveTo(0, t), (r = this.canvasIns) == null || r.lineTo(this.width, t)), i < this.width && (i += this.cellMg), t < this.height && (t += this.cellMg), h++;
75
+ h % this.cellPoints === 0 && ((e = this.canvasIns) == null || e.moveTo(i, 0), (n = this.canvasIns) == null || n.lineTo(i, this.height), (a = this.canvasIns) == null || a.moveTo(0, t), (o = this.canvasIns) == null || o.lineTo(this.width, t)), i < this.width && (i += this.cellMg), t < this.height && (t += this.cellMg), h++;
71
76
  this.afterDrawOver(this.canvasIns);
72
77
  }
73
78
  drawMesh() {
74
- var e, n, a, r, o, d, f, v;
79
+ var e, n, a, o, r, c, f, v;
75
80
  const s = this.gridConfig.lineWidth === 1 ? 0.5 : 0;
76
81
  let i = s, t = s, h = 0;
77
82
  for (this.beforeCtxDraw(
@@ -79,13 +84,13 @@ let l = class extends m(I) {
79
84
  this.gridConfig.smallCellColor,
80
85
  this.gridConfig.lineWidth
81
86
  ); i < this.width || t < this.height; )
82
- h % this.cellPoints !== 0 && ((e = this.canvasIns) == null || e.moveTo(i, 0), (n = this.canvasIns) == null || n.lineTo(i, this.height), (a = this.canvasIns) == null || a.moveTo(0, t), (r = this.canvasIns) == null || r.lineTo(this.width, t)), i < this.width && (i += this.cellMg), t < this.height && (t += this.cellMg), h++;
87
+ h % this.cellPoints !== 0 && ((e = this.canvasIns) == null || e.moveTo(i, 0), (n = this.canvasIns) == null || n.lineTo(i, this.height), (a = this.canvasIns) == null || a.moveTo(0, t), (o = this.canvasIns) == null || o.lineTo(this.width, t)), i < this.width && (i += this.cellMg), t < this.height && (t += this.cellMg), h++;
83
88
  for (this.afterDrawOver(this.canvasIns), i = t = s, h = 0, this.beforeCtxDraw(
84
89
  this.canvasIns,
85
90
  this.gridConfig.bigCellColor,
86
91
  this.gridConfig.lineWidth
87
92
  ); i < this.width || t < this.height; )
88
- h % this.cellPoints === 0 && ((o = this.canvasIns) == null || o.moveTo(i, 0), (d = this.canvasIns) == null || d.lineTo(i, this.height), (f = this.canvasIns) == null || f.moveTo(0, t), (v = this.canvasIns) == null || v.lineTo(this.width, t)), i < this.width && (i += this.cellMg), t < this.height && (t += this.cellMg), h++;
93
+ h % this.cellPoints === 0 && ((r = this.canvasIns) == null || r.moveTo(i, 0), (c = this.canvasIns) == null || c.lineTo(i, this.height), (f = this.canvasIns) == null || f.moveTo(0, t), (v = this.canvasIns) == null || v.lineTo(this.width, t)), i < this.width && (i += this.cellMg), t < this.height && (t += this.cellMg), h++;
89
94
  this.afterDrawOver(this.canvasIns);
90
95
  }
91
96
  beforeCtxDraw(s, i, t) {
@@ -96,13 +101,13 @@ let l = class extends m(I) {
96
101
  }
97
102
  };
98
103
  g([
99
- c("width")
104
+ d("width")
100
105
  ], l.prototype, "watchWidth", 1);
101
106
  g([
102
- c("height")
107
+ d("height")
103
108
  ], l.prototype, "watchHeight", 1);
104
109
  g([
105
- c("gridConfig", { deep: !0 })
110
+ d("gridConfig", { deep: !0 })
106
111
  ], l.prototype, "watchGridConfig", 1);
107
112
  l = g([
108
113
  w({
@@ -1,6 +1,7 @@
1
1
  import MethodsMinix from './method';
2
2
  declare const CommonWaveForm_base: import("vue-class-component/lib/declarations").VueClass<MethodsMinix>;
3
3
  declare class CommonWaveForm extends CommonWaveForm_base {
4
+ protected repaintTimer: any;
4
5
  protected watchVuescrollConfig(): void;
5
6
  protected watchAnalyseValues(): void;
6
7
  protected watchWaveConfigs(): void;
@@ -10,7 +11,8 @@ declare class CommonWaveForm extends CommonWaveForm_base {
10
11
  protected watchWidth(): void;
11
12
  protected watchHeight(): void;
12
13
  protected watchLongLeadConfig(): void;
13
- protected repaint: import("lodash").DebouncedFunc<() => void>;
14
+ protected destroyed(): void;
15
+ protected repaint(): void;
14
16
  created(): void;
15
17
  mounted(): void;
16
18
  }
@@ -1,29 +1,22 @@
1
1
  import "./style/index.css";
2
2
  import "vue";
3
- import d, { mixins as l } 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";
3
+ import l, { mixins as c } 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";
4
4
  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";
5
- import { Watch as r } 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/Watch.js";
6
- import c from "../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.14/node_modules/vuescroll/dist/vuescroll-native.js";
7
- import { debounce as m } from "lodash";
8
- import u from "../MeasuringRuler/index2.js";
9
- import f from "../MagnifierWave/index.js";
10
- import g from "../ParallelRuler/index2.js";
11
- import w from "../BackgroundGrid/index2.js";
12
- import C from "./method.js";
13
- var v = Object.defineProperty, L = Object.getOwnPropertyDescriptor, o = (e, i, s, n) => {
14
- for (var a = n > 1 ? void 0 : n ? L(i, s) : i, h = e.length - 1, p; h >= 0; h--)
15
- (p = e[h]) && (a = (n ? p(i, s, a) : p(a)) || a);
16
- return n && a && v(i, s, a), a;
5
+ import { Watch as a } 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/Watch.js";
6
+ import d from "../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js";
7
+ import m from "../MeasuringRuler/index2.js";
8
+ import u from "../MagnifierWave/index.js";
9
+ import f from "../ParallelRuler/index2.js";
10
+ import g from "../BackgroundGrid/index2.js";
11
+ import w from "./method.js";
12
+ var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, r = (e, i, s, n) => {
13
+ for (var o = n > 1 ? void 0 : n ? v(i, s) : i, h = e.length - 1, p; h >= 0; h--)
14
+ (p = e[h]) && (o = (n ? p(i, s, o) : p(o)) || o);
15
+ return n && o && C(i, s, o), o;
17
16
  };
18
- let t = class extends l(C) {
17
+ let t = class extends c(w) {
19
18
  constructor() {
20
- super(...arguments), this.repaint = m(() => {
21
- var e, i;
22
- (e = this.sceneIns) == null || e.clear(), (i = this.sceneIns) == null || i.resize({
23
- width: this.canvasContainer.width,
24
- height: this.canvasContainer.height
25
- }), this.initCreatedConfig(), this.combinationDrawing();
26
- }, 200);
19
+ super(...arguments), this.repaintTimer = Object.freeze(null);
27
20
  }
28
21
  watchVuescrollConfig() {
29
22
  this.repaint();
@@ -54,6 +47,18 @@ let t = class extends l(C) {
54
47
  var e;
55
48
  (e = this.sceneIns) == null || e.clear(), this.init();
56
49
  }
50
+ destroyed() {
51
+ this.repaintTimer && clearTimeout(this.repaintTimer);
52
+ }
53
+ repaint() {
54
+ this.repaintTimer && clearTimeout(this.repaintTimer), this.repaintTimer = setTimeout(() => {
55
+ var e, i;
56
+ (e = this.sceneIns) == null || e.clear(), (i = this.sceneIns) == null || i.resize({
57
+ width: this.canvasContainer.width,
58
+ height: this.canvasContainer.height
59
+ }), this.initCreatedConfig(), this.combinationDrawing();
60
+ }, 200);
61
+ }
57
62
  created() {
58
63
  this.initCreatedConfig();
59
64
  }
@@ -61,42 +66,42 @@ let t = class extends l(C) {
61
66
  this.init();
62
67
  }
63
68
  };
64
- o([
65
- r("vuescrollConfig", { deep: !0 })
69
+ r([
70
+ a("vuescrollConfig", { deep: !0 })
66
71
  ], t.prototype, "watchVuescrollConfig", 1);
67
- o([
68
- r("analyseValues", { deep: !0 })
72
+ r([
73
+ a("analyseValues", { deep: !0 })
69
74
  ], t.prototype, "watchAnalyseValues", 1);
70
- o([
71
- r("waveConfigs", { deep: !0 })
75
+ r([
76
+ a("waveConfigs", { deep: !0 })
72
77
  ], t.prototype, "watchWaveConfigs", 1);
73
- o([
74
- r("waveLists", { deep: !0 })
78
+ r([
79
+ a("waveLists", { deep: !0 })
75
80
  ], t.prototype, "watchWaveLists", 1);
76
- o([
77
- r("leadHeadConfig", { deep: !0 })
81
+ r([
82
+ a("leadHeadConfig", { deep: !0 })
78
83
  ], t.prototype, "watchLeadHeadConfig", 1);
79
- o([
80
- r("leadModel", { deep: !0 })
84
+ r([
85
+ a("leadModel", { deep: !0 })
81
86
  ], t.prototype, "watchLeadModel", 1);
82
- o([
83
- r("width")
87
+ r([
88
+ a("width")
84
89
  ], t.prototype, "watchWidth", 1);
85
- o([
86
- r("height")
90
+ r([
91
+ a("height")
87
92
  ], t.prototype, "watchHeight", 1);
88
- o([
89
- r("longLeadConfig", { deep: !0 })
93
+ r([
94
+ a("longLeadConfig", { deep: !0 })
90
95
  ], t.prototype, "watchLongLeadConfig", 1);
91
- t = o([
92
- d({
96
+ t = r([
97
+ l({
93
98
  name: "CommonWaveForm",
94
99
  components: {
95
- vueScroll: c,
96
- MXBackgroundGrid: w,
97
- MXMeasuringRuler: u,
98
- MXParallelRuler: g,
99
- MXMagnifierWave: f
100
+ vueScroll: d,
101
+ MXBackgroundGrid: g,
102
+ MXMeasuringRuler: m,
103
+ MXParallelRuler: f,
104
+ MXMagnifierWave: u
100
105
  }
101
106
  })
102
107
  ], t);
@@ -3,7 +3,7 @@ import "vue";
3
3
  import c, { mixins as l } 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";
4
4
  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";
5
5
  import { Watch as o } 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/Watch.js";
6
- import d from "../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.14/node_modules/vuescroll/dist/vuescroll-native.js";
6
+ import d from "../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js";
7
7
  import m from "../BackgroundGrid/index2.js";
8
8
  import g from "../MeasuringRuler/index2.js";
9
9
  import f from "../ParallelRuler/index2.js";
@@ -3,7 +3,7 @@ import x from "../../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/
3
3
  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";
4
4
  import { Prop as d } 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";
5
5
  import { Watch as m } 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/Watch.js";
6
- import P from "../../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.14/node_modules/vuescroll/dist/vuescroll-native.js";
6
+ import P from "../../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js";
7
7
  import { LeadNameTexts as G, getPointIdxForPx as B } from "@costy-plus/utils";
8
8
  import { Group as D, init as H, Text as S, Polyline as z, util as F, Polygon as A } from "zrender";
9
9
  import L from "../../BackgroundGrid/index2.js";
@@ -2,12 +2,14 @@ import PropsMinix from './PropsMinix';
2
2
  declare const MXBackgroundGrid_base: import("vue-class-component/lib/declarations").VueClass<PropsMinix>;
3
3
  declare class MXBackgroundGrid extends MXBackgroundGrid_base {
4
4
  protected canvasIns: Readonly<CanvasRenderingContext2D | null>;
5
+ protected againInitGridTimer: any;
5
6
  protected watchWidth(): void;
6
7
  protected watchHeight(): void;
7
8
  protected watchGridConfig(): void;
8
9
  protected get cellMg(): number;
9
10
  protected mounted(): void;
10
- protected againInitGrid: import("lodash").DebouncedFunc<() => void>;
11
+ protected destroyed(): void;
12
+ protected againInitGrid(): void;
11
13
  protected initGrid(): void;
12
14
  protected drawPoints(): void;
13
15
  protected drawRowAndCol(): void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("vue");const f=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 d=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),u=require("lodash"),w=require("./PropsMinix.js");var m=Object.defineProperty,p=Object.getOwnPropertyDescriptor,l=(s,i,t,e)=>{for(var h=e>1?void 0:e?p(i,t):i,n=s.length-1,o;n>=0;n--)(o=s[n])&&(h=(e?o(i,t,h):o(h))||h);return e&&h&&m(i,t,h),h};exports.default=class extends f.mixins(w.default){constructor(){super(...arguments),this.canvasIns=Object.freeze(null),this.againInitGrid=u.debounce(()=>{this.initGrid()},100)}watchWidth(){this.againInitGrid()}watchHeight(){this.againInitGrid()}watchGridConfig(){this.againInitGrid()}get cellMg(){return this.gridConfig.cellMg*this.magnification}mounted(){this.initGrid()}initGrid(){if(this.canvasIns)this.canvasIns.clearRect(0,0,this.width,this.height);else{const s=document.getElementById(this.layerId);this.canvasIns=s.getContext("2d")}this.model===0?(this.drawPoints(),this.drawRowAndCol()):this.model===1&&this.drawMesh()}drawPoints(){var o,r;let i=this.gridConfig.lineWidth===1?.5:0,t=this.cellMg;const e=[],h=this.magnification>1?this.gridConfig.lineWidth+1:this.gridConfig.lineWidth;for(this.beforeCtxDraw(this.canvasIns,this.gridConfig.smallCellColor,h);t<this.width;)e.push(t),t%this.cellMg===0?t+=h:t+=this.cellMg-h;let n=0;for(;i<this.height;){if(n%this.cellPoints!==0)for(let a=0;a<e.length;a++)(a+2)%this.cellPoints!==0&&a%2===0&&((o=this.canvasIns)==null||o.moveTo(e[a],i),(r=this.canvasIns)==null||r.lineTo(e[a+1],i));i+=this.cellMg,n++}this.afterDrawOver(this.canvasIns)}drawRowAndCol(){var h,n,o,r;const s=this.gridConfig.lineWidth===1?.5:0;let i=s,t=s,e=0;for(this.beforeCtxDraw(this.canvasIns,this.gridConfig.bigCellColor,this.gridConfig.lineWidth);i<this.width||t<this.height;)e%this.cellPoints===0&&((h=this.canvasIns)==null||h.moveTo(i,0),(n=this.canvasIns)==null||n.lineTo(i,this.height),(o=this.canvasIns)==null||o.moveTo(0,t),(r=this.canvasIns)==null||r.lineTo(this.width,t)),i<this.width&&(i+=this.cellMg),t<this.height&&(t+=this.cellMg),e++;this.afterDrawOver(this.canvasIns)}drawMesh(){var h,n,o,r,a,c,g,v;const s=this.gridConfig.lineWidth===1?.5:0;let i=s,t=s,e=0;for(this.beforeCtxDraw(this.canvasIns,this.gridConfig.smallCellColor,this.gridConfig.lineWidth);i<this.width||t<this.height;)e%this.cellPoints!==0&&((h=this.canvasIns)==null||h.moveTo(i,0),(n=this.canvasIns)==null||n.lineTo(i,this.height),(o=this.canvasIns)==null||o.moveTo(0,t),(r=this.canvasIns)==null||r.lineTo(this.width,t)),i<this.width&&(i+=this.cellMg),t<this.height&&(t+=this.cellMg),e++;for(this.afterDrawOver(this.canvasIns),i=t=s,e=0,this.beforeCtxDraw(this.canvasIns,this.gridConfig.bigCellColor,this.gridConfig.lineWidth);i<this.width||t<this.height;)e%this.cellPoints===0&&((a=this.canvasIns)==null||a.moveTo(i,0),(c=this.canvasIns)==null||c.lineTo(i,this.height),(g=this.canvasIns)==null||g.moveTo(0,t),(v=this.canvasIns)==null||v.lineTo(this.width,t)),i<this.width&&(i+=this.cellMg),t<this.height&&(t+=this.cellMg),e++;this.afterDrawOver(this.canvasIns)}beforeCtxDraw(s,i,t){s.save(),s.beginPath(),s.strokeStyle=i,s.lineWidth=t}afterDrawOver(s){s.stroke(),s.restore()}};l([d.Watch("width")],exports.default.prototype,"watchWidth",1);l([d.Watch("height")],exports.default.prototype,"watchHeight",1);l([d.Watch("gridConfig",{deep:!0})],exports.default.prototype,"watchGridConfig",1);exports.default=l([f.default({name:"MXBackgroundGrid"})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("vue");const v=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 d=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),u=require("./PropsMinix.js");var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,l=(e,i,t,s)=>{for(var n=s>1?void 0:s?w(i,t):i,h=e.length-1,a;h>=0;h--)(a=e[h])&&(n=(s?a(i,t,n):a(n))||n);return s&&n&&m(i,t,n),n};exports.default=class extends v.mixins(u.default){constructor(){super(...arguments),this.canvasIns=Object.freeze(null),this.againInitGridTimer=Object.freeze(null)}watchWidth(){this.againInitGrid()}watchHeight(){this.againInitGrid()}watchGridConfig(){this.againInitGrid()}get cellMg(){return this.gridConfig.cellMg*this.magnification}mounted(){this.initGrid()}destroyed(){this.againInitGridTimer&&clearTimeout(this.againInitGridTimer)}againInitGrid(){this.againInitGridTimer&&clearTimeout(this.againInitGridTimer),this.againInitGridTimer=setTimeout(()=>{this.initGrid()},100)}initGrid(){if(this.canvasIns)this.canvasIns.clearRect(0,0,this.width,this.height);else{const e=document.getElementById(this.layerId);this.canvasIns=e.getContext("2d")}this.model===0?(this.drawPoints(),this.drawRowAndCol()):this.model===1&&this.drawMesh()}drawPoints(){var a,r;let i=this.gridConfig.lineWidth===1?.5:0,t=this.cellMg;const s=[],n=this.magnification>1?this.gridConfig.lineWidth+1:this.gridConfig.lineWidth;for(this.beforeCtxDraw(this.canvasIns,this.gridConfig.smallCellColor,n);t<this.width;)s.push(t),t%this.cellMg===0?t+=n:t+=this.cellMg-n;let h=0;for(;i<this.height;){if(h%this.cellPoints!==0)for(let o=0;o<s.length;o++)(o+2)%this.cellPoints!==0&&o%2===0&&((a=this.canvasIns)==null||a.moveTo(s[o],i),(r=this.canvasIns)==null||r.lineTo(s[o+1],i));i+=this.cellMg,h++}this.afterDrawOver(this.canvasIns)}drawRowAndCol(){var n,h,a,r;const e=this.gridConfig.lineWidth===1?.5:0;let i=e,t=e,s=0;for(this.beforeCtxDraw(this.canvasIns,this.gridConfig.bigCellColor,this.gridConfig.lineWidth);i<this.width||t<this.height;)s%this.cellPoints===0&&((n=this.canvasIns)==null||n.moveTo(i,0),(h=this.canvasIns)==null||h.lineTo(i,this.height),(a=this.canvasIns)==null||a.moveTo(0,t),(r=this.canvasIns)==null||r.lineTo(this.width,t)),i<this.width&&(i+=this.cellMg),t<this.height&&(t+=this.cellMg),s++;this.afterDrawOver(this.canvasIns)}drawMesh(){var n,h,a,r,o,c,g,f;const e=this.gridConfig.lineWidth===1?.5:0;let i=e,t=e,s=0;for(this.beforeCtxDraw(this.canvasIns,this.gridConfig.smallCellColor,this.gridConfig.lineWidth);i<this.width||t<this.height;)s%this.cellPoints!==0&&((n=this.canvasIns)==null||n.moveTo(i,0),(h=this.canvasIns)==null||h.lineTo(i,this.height),(a=this.canvasIns)==null||a.moveTo(0,t),(r=this.canvasIns)==null||r.lineTo(this.width,t)),i<this.width&&(i+=this.cellMg),t<this.height&&(t+=this.cellMg),s++;for(this.afterDrawOver(this.canvasIns),i=t=e,s=0,this.beforeCtxDraw(this.canvasIns,this.gridConfig.bigCellColor,this.gridConfig.lineWidth);i<this.width||t<this.height;)s%this.cellPoints===0&&((o=this.canvasIns)==null||o.moveTo(i,0),(c=this.canvasIns)==null||c.lineTo(i,this.height),(g=this.canvasIns)==null||g.moveTo(0,t),(f=this.canvasIns)==null||f.lineTo(this.width,t)),i<this.width&&(i+=this.cellMg),t<this.height&&(t+=this.cellMg),s++;this.afterDrawOver(this.canvasIns)}beforeCtxDraw(e,i,t){e.save(),e.beginPath(),e.strokeStyle=i,e.lineWidth=t}afterDrawOver(e){e.stroke(),e.restore()}};l([d.Watch("width")],exports.default.prototype,"watchWidth",1);l([d.Watch("height")],exports.default.prototype,"watchHeight",1);l([d.Watch("gridConfig",{deep:!0})],exports.default.prototype,"watchGridConfig",1);exports.default=l([v.default({name:"MXBackgroundGrid"})],exports.default);
@@ -1,6 +1,7 @@
1
1
  import MethodsMinix from './method';
2
2
  declare const CommonWaveForm_base: import("vue-class-component/lib/declarations").VueClass<MethodsMinix>;
3
3
  declare class CommonWaveForm extends CommonWaveForm_base {
4
+ protected repaintTimer: any;
4
5
  protected watchVuescrollConfig(): void;
5
6
  protected watchAnalyseValues(): void;
6
7
  protected watchWaveConfigs(): void;
@@ -10,7 +11,8 @@ declare class CommonWaveForm extends CommonWaveForm_base {
10
11
  protected watchWidth(): void;
11
12
  protected watchHeight(): void;
12
13
  protected watchLongLeadConfig(): void;
13
- protected repaint: import("lodash").DebouncedFunc<() => void>;
14
+ protected destroyed(): void;
15
+ protected repaint(): void;
14
16
  created(): void;
15
17
  mounted(): void;
16
18
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const u=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const o=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),l=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.14/node_modules/vuescroll/dist/vuescroll-native.js"),c=require("lodash"),h=require("../MeasuringRuler/index2.js"),p=require("../MagnifierWave/index.js"),v=require("../ParallelRuler/index2.js"),f=require("../BackgroundGrid/index2.js"),m=require("./method.js");var g=Object.defineProperty,w=Object.getOwnPropertyDescriptor,a=(e,t,n,s)=>{for(var r=s>1?void 0:s?w(t,n):t,i=e.length-1,d;i>=0;i--)(d=e[i])&&(r=(s?d(t,n,r):d(r))||r);return s&&r&&g(t,n,r),r};exports.default=class extends u.mixins(m.default){constructor(){super(...arguments),this.repaint=c.debounce(()=>{var e,t;(e=this.sceneIns)==null||e.clear(),(t=this.sceneIns)==null||t.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.initCreatedConfig(),this.combinationDrawing()},200)}watchVuescrollConfig(){this.repaint()}watchAnalyseValues(){this.repaint()}watchWaveConfigs(){this.repaint()}watchWaveLists(){this.repaint()}watchLeadHeadConfig(){var e,t;(e=this.leadHeadGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}created(){this.initCreatedConfig()}mounted(){this.init()}};a([o.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);a([o.Watch("analyseValues",{deep:!0})],exports.default.prototype,"watchAnalyseValues",1);a([o.Watch("waveConfigs",{deep:!0})],exports.default.prototype,"watchWaveConfigs",1);a([o.Watch("waveLists",{deep:!0})],exports.default.prototype,"watchWaveLists",1);a([o.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);a([o.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);a([o.Watch("width")],exports.default.prototype,"watchWidth",1);a([o.Watch("height")],exports.default.prototype,"watchHeight",1);a([o.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);exports.default=a([u.default({name:"CommonWaveForm",components:{vueScroll:l.default,MXBackgroundGrid:f.default,MXMeasuringRuler:h.default,MXParallelRuler:v.default,MXMagnifierWave:p.default}})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const u=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const r=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),l=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js"),c=require("../MeasuringRuler/index2.js"),p=require("../MagnifierWave/index.js"),h=require("../ParallelRuler/index2.js"),m=require("../BackgroundGrid/index2.js"),v=require("./method.js");var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,a=(e,t,s,o)=>{for(var i=o>1?void 0:o?g(t,s):t,n=e.length-1,d;n>=0;n--)(d=e[n])&&(i=(o?d(t,s,i):d(i))||i);return o&&i&&f(t,s,i),i};exports.default=class extends u.mixins(v.default){constructor(){super(...arguments),this.repaintTimer=Object.freeze(null)}watchVuescrollConfig(){this.repaint()}watchAnalyseValues(){this.repaint()}watchWaveConfigs(){this.repaint()}watchWaveLists(){this.repaint()}watchLeadHeadConfig(){var e,t;(e=this.leadHeadGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}destroyed(){this.repaintTimer&&clearTimeout(this.repaintTimer)}repaint(){this.repaintTimer&&clearTimeout(this.repaintTimer),this.repaintTimer=setTimeout(()=>{var e,t;(e=this.sceneIns)==null||e.clear(),(t=this.sceneIns)==null||t.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.initCreatedConfig(),this.combinationDrawing()},200)}created(){this.initCreatedConfig()}mounted(){this.init()}};a([r.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);a([r.Watch("analyseValues",{deep:!0})],exports.default.prototype,"watchAnalyseValues",1);a([r.Watch("waveConfigs",{deep:!0})],exports.default.prototype,"watchWaveConfigs",1);a([r.Watch("waveLists",{deep:!0})],exports.default.prototype,"watchWaveLists",1);a([r.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);a([r.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);a([r.Watch("width")],exports.default.prototype,"watchWidth",1);a([r.Watch("height")],exports.default.prototype,"watchHeight",1);a([r.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);exports.default=a([u.default({name:"CommonWaveForm",components:{vueScroll:l.default,MXBackgroundGrid:m.default,MXMeasuringRuler:c.default,MXParallelRuler:h.default,MXMagnifierWave:p.default}})],exports.default);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const l=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const o=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),c=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.14/node_modules/vuescroll/dist/vuescroll-native.js"),u=require("../BackgroundGrid/index2.js"),h=require("../MeasuringRuler/index2.js"),p=require("../ParallelRuler/index2.js"),v=require("../MagnifierWave/index.js"),f=require("../EnlargeWave/index2.js"),g=require("./method.js");var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,a=(e,t,s,n)=>{for(var r=n>1?void 0:n?w(t,s):t,i=e.length-1,d;i>=0;i--)(d=e[i])&&(r=(n?d(t,s,r):d(r))||r);return n&&r&&m(t,s,r),r};exports.default=class extends l.mixins(g.default){watchFormatEcgData(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchVuescrollConfig(){this.repaint()}watchLeadHeadConfig(){var e,t;(e=this.leadHeadGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchHeartFight(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}mounted(){this.init()}repaint(){var e,t;(e=this.sceneIns)==null||e.clear(),(t=this.sceneIns)==null||t.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.combinationDrawing()}};a([o.Watch("formatEcgData",{deep:!0})],exports.default.prototype,"watchFormatEcgData",1);a([o.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);a([o.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);a([o.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);a([o.Watch("width")],exports.default.prototype,"watchWidth",1);a([o.Watch("height")],exports.default.prototype,"watchHeight",1);a([o.Watch("singleModeInfo",{deep:!0})],exports.default.prototype,"watchHeartFight",1);a([o.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);exports.default=a([l.default({name:"ECGWaveForm",components:{vueScroll:c.default,MXBackgroundGrid:u.default,MXMeasuringRuler:h.default,MXParallelRuler:p.default,MXMagnifierWave:v.default,MXEnlargeWave:f.default}})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./style/index.css");require("vue");const l=require("../../node_modules/.pnpm/vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-class-component/dist/vue-class-component.esm.js");require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Emit.js");const o=require("../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),c=require("../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js"),u=require("../BackgroundGrid/index2.js"),h=require("../MeasuringRuler/index2.js"),p=require("../ParallelRuler/index2.js"),v=require("../MagnifierWave/index.js"),f=require("../EnlargeWave/index2.js"),g=require("./method.js");var m=Object.defineProperty,w=Object.getOwnPropertyDescriptor,a=(e,t,s,n)=>{for(var r=n>1?void 0:n?w(t,s):t,i=e.length-1,d;i>=0;i--)(d=e[i])&&(r=(n?d(t,s,r):d(r))||r);return n&&r&&m(t,s,r),r};exports.default=class extends l.mixins(g.default){watchFormatEcgData(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchVuescrollConfig(){this.repaint()}watchLeadHeadConfig(){var e,t;(e=this.leadHeadGroup)==null||e.removeAll(),(t=this.sceneIns)==null||t.remove(this.leadHeadGroup),this.drawLeadHead()}watchLeadModel(){this.repaint()}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchHeartFight(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}watchLongLeadConfig(){var e;(e=this.sceneIns)==null||e.clear(),this.init()}mounted(){this.init()}repaint(){var e,t;(e=this.sceneIns)==null||e.clear(),(t=this.sceneIns)==null||t.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.combinationDrawing()}};a([o.Watch("formatEcgData",{deep:!0})],exports.default.prototype,"watchFormatEcgData",1);a([o.Watch("vuescrollConfig",{deep:!0})],exports.default.prototype,"watchVuescrollConfig",1);a([o.Watch("leadHeadConfig",{deep:!0})],exports.default.prototype,"watchLeadHeadConfig",1);a([o.Watch("leadModel",{deep:!0})],exports.default.prototype,"watchLeadModel",1);a([o.Watch("width")],exports.default.prototype,"watchWidth",1);a([o.Watch("height")],exports.default.prototype,"watchHeight",1);a([o.Watch("singleModeInfo",{deep:!0})],exports.default.prototype,"watchHeartFight",1);a([o.Watch("longLeadConfig",{deep:!0})],exports.default.prototype,"watchLongLeadConfig",1);exports.default=a([l.default({name:"ECGWaveForm",components:{vueScroll:c.default,MXBackgroundGrid:u.default,MXMeasuringRuler:h.default,MXParallelRuler:p.default,MXMagnifierWave:v.default,MXEnlargeWave:f.default}})],exports.default);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("vue"),P=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 h=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("../../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),D=require("../../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.14/node_modules/vuescroll/dist/vuescroll-native.js"),_=require("@costy-plus/utils"),d=require("zrender"),F=require("../../BackgroundGrid/index2.js"),x=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},G=x(b);var j=Object.defineProperty,B=Object.getOwnPropertyDescriptor,l=(t,e,o,r)=>{for(var i=r>1?void 0:r?B(e,o):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(i=(r?a(e,o,i):a(i))||i);return r&&i&&j(e,o,i),i};exports.default=class extends G.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.waveFormGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.scrollIdx=Object.freeze(0),this.currentHeardBeat=Object.freeze({heardBeat:null,ele:null}),this.slidingWindowInfo=Object.freeze({}),this.vuescrollWH={width:0,height:0}}get canvasContainer(){var t;return{width:this.width,height:this.height-(this.vuescrollConfig.isShow&&parseInt(`${(t=this.vuescrollConfig.bar)==null?void 0:t.size}`)||0)||0}}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchFormatData(){this.repaint()}repaint(){var t,e;(t=this.sceneIns)==null||t.clear(),(e=this.sceneIns)==null||e.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.combinationDrawing()}destroyed(){var t,e,o;(t=this.waveFormGroup)==null||t.removeAll(),(e=this.arrowGroup)==null||e.removeAll(),(o=this.sceneIns)==null||o.dispose()}created(){this.initConfig()}initConfig(){this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.currentHeardBeat={heardBeat:null,ele:null},this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.waveFormGroup=new d.Group({name:"waveForm"}),this.arrowGroup=new d.Group({name:"arrowGroup"}),this.initSlidingWindowInfo()}mounted(){this.initWaveFormPeer(),this.combinationDrawing()}combinationDrawing(){this.drawWaveFrom(),this.drawLoopArrow(this.scrollIdx)}initWaveFormPeer(){const t=document.getElementById("wave-from-box");this.sceneIns=d.init(t,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const e=document.getElementById("MXRoutine_Grid");this.AssistCtx=e.getContext("2d")}initSlidingWindowInfo(){var o,r;const t=((o=this.formatData)==null?void 0:o.step)||0;this.vuescrollConfig.isShow&&(this.vuescrollWH.width=this.canvasContainer.width+(((r=this.formatData)==null?void 0:r.dataPxLen)||0)-this.width);const e=Math.ceil(this.width/t);this.slidingWindowInfo={points:e,startInd:0,endInd:e}}drawWaveFrom(){var t;this.createLeadName(),this.createWaveFrom(),(t=this.sceneIns)==null||t.add(this.waveFormGroup)}createLeadName(){var t;(t=this.sceneIns)==null||t.add(new d.Text({style:{x:this.leadConfig.fontSize*.5,y:this.canvasContainer.height/2+this.leadConfig.fontSize*2,text:_.LeadNameTexts[1],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}))}getRednerPoints(){var r;const t=[],e=this.canvasContainer.height/2;let o=[];for(let i=1;i<=1;i++)o=((r=this.formatData)==null?void 0:r.processedData.handleData.Data[i])||[],t.push({pos:[0,e],startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0,data:o.slice(this.slidingWindowInfo.startInd,this.slidingWindowInfo.endInd).map((n,a)=>{var u;return[a*(((u=this.formatData)==null?void 0:u.step)||0),-n]})});return t}createWaveFrom(){var e,o;(e=this.waveFormGroup)==null||e.removeAll();let t=this.getRednerPoints();for(let r=0;r<t.length;r++)(o=this.waveFormGroup)==null||o.add(new d.Polyline({cursor:"",shape:{points:t[r].data.map(([i,n])=>[i+t[r].pos[0],n+t[r].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth}}));t=null}drawLoopArrow(t=0){var i,n,a,u,w,v,g,I,y,W;(i=this.arrowGroup)==null||i.removeAll(),this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=((n=this.formatData)==null?void 0:n.heartBeatPosition[0])||null,this.$emit("notifyHeardBeat",d.util.clone(((a=this.formatData)==null?void 0:a.heartBeatPosition[0])||null)));let e=0;const o=20;let r=0;for(let p=0;p<(((u=this.formatData)==null?void 0:u.heartBeatPosition)||[]).length;p++){const s=(w=this.formatData)==null?void 0:w.heartBeatPosition[p];if(r=((s==null?void 0:s.position)||0)-t,!(t>((s==null?void 0:s.position)||0))){if(((s==null?void 0:s.position)||0)-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break;e=r*(((v=this.formatData)==null?void 0:v.step)||0)-9.5,(y=this.arrowGroup)==null||y.add(new d.Polygon({name:"arrow_box",shape:{points:[[4+e,0+o],[15+e,0+o],[15+e,10+o],[19+e,10+o],[9.5+e,22+o],[0+e,10+o],[4+e,10+o],[4+e,0+o]]},style:{fill:((I=(g=this.currentHeardBeat)==null?void 0:g.heardBeat)==null?void 0:I.index)===(s==null?void 0:s.index)?"blue":"#ccc"},onclick:f=>{var C;f.target.attr({style:{fill:"blue"}}),(C=this.arrowGroup)==null||C.children().filter(c=>c.name==="arrow_box").forEach(c=>{c.id!==f.target.id&&c.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(s,f.target)}}))}}(W=this.sceneIns)==null||W.add(this.arrowGroup)}arrowLoopClick(t,e){this.$emit("notifyHeardBeat",d.util.clone(t)),this.currentHeardBeat.heardBeat=t,this.currentHeardBeat.ele=e}handleScroll(t,e,o){var r;if(e.type==="horizontal"){e.scrollLeft=e.scrollLeft||0;const i=_.getPointIdxForPx(e.scrollLeft,((r=this.formatData)==null?void 0:r.step)||1);this.scrollIdx=i,this.scrollWaveFrom(i),this.scrollArrow(i),this.$emit("notifyScrollPointIdx",i)}}scrollWaveFrom(t){var o;this.slidingWindowInfo.startInd=t,this.slidingWindowInfo.endInd=t+(this.slidingWindowInfo.points||0);let e=this.getRednerPoints();(o=this.waveFormGroup)==null||o.eachChild((r,i)=>{i=i||0,r.attr({shape:{points:e[i].data.map(([n,a])=>[n+e[i].pos[0],a+e[i].pos[1]])}})}),e=null}scrollArrow(t){var e,o;(e=this.arrowGroup)==null||e.removeAll(),(o=this.sceneIns)==null||o.remove(this.arrowGroup),this.drawLoopArrow(t)}};l([h.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"width",2);l([h.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"height",2);l([h.Prop({required:!0})],exports.default.prototype,"gridConfig",2);l([h.Prop({default:()=>({isShow:!0,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"vuescrollConfig",2);l([h.Prop({required:!0})],exports.default.prototype,"formatData",2);l([h.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);l([m.Watch("width")],exports.default.prototype,"watchWidth",1);l([m.Watch("height")],exports.default.prototype,"watchHeight",1);l([m.Watch("formatData",{deep:!0})],exports.default.prototype,"watchFormatData",1);exports.default=l([P.default({name:"Routine",components:{vueScroll:D.default,MXBackgroundGrid:F.default}})],exports.default);
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("vue"),P=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 h=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("../../../node_modules/.pnpm/vue-property-decorator@9.1.2_vue-class-component@7.2.6_vue@2.6.14/node_modules/vue-property-decorator/lib/decorators/Watch.js"),D=require("../../../node_modules/.pnpm/vuescroll@4.17.5_vue@2.7.15/node_modules/vuescroll/dist/vuescroll-native.js"),_=require("@costy-plus/utils"),d=require("zrender"),F=require("../../BackgroundGrid/index2.js"),x=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},G=x(b);var j=Object.defineProperty,B=Object.getOwnPropertyDescriptor,l=(t,e,o,r)=>{for(var i=r>1?void 0:r?B(e,o):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(i=(r?a(e,o,i):a(i))||i);return r&&i&&j(e,o,i),i};exports.default=class extends G.default{constructor(){super(...arguments),this.AssistCtx=Object.freeze(null),this.sceneIns=Object.freeze(null),this.waveFormGroup=Object.freeze(null),this.arrowGroup=Object.freeze(null),this.scrollIdx=Object.freeze(0),this.currentHeardBeat=Object.freeze({heardBeat:null,ele:null}),this.slidingWindowInfo=Object.freeze({}),this.vuescrollWH={width:0,height:0}}get canvasContainer(){var t;return{width:this.width,height:this.height-(this.vuescrollConfig.isShow&&parseInt(`${(t=this.vuescrollConfig.bar)==null?void 0:t.size}`)||0)||0}}watchWidth(){this.repaint()}watchHeight(){this.repaint()}watchFormatData(){this.repaint()}repaint(){var t,e;(t=this.sceneIns)==null||t.clear(),(e=this.sceneIns)==null||e.resize({width:this.canvasContainer.width,height:this.canvasContainer.height}),this.combinationDrawing()}destroyed(){var t,e,o;(t=this.waveFormGroup)==null||t.removeAll(),(e=this.arrowGroup)==null||e.removeAll(),(o=this.sceneIns)==null||o.dispose()}created(){this.initConfig()}initConfig(){this.slidingWindowInfo={points:0,startInd:0,endInd:0},this.currentHeardBeat={heardBeat:null,ele:null},this.vuescrollWH.width=this.width,this.vuescrollWH.height=this.height,this.waveFormGroup=new d.Group({name:"waveForm"}),this.arrowGroup=new d.Group({name:"arrowGroup"}),this.initSlidingWindowInfo()}mounted(){this.initWaveFormPeer(),this.combinationDrawing()}combinationDrawing(){this.drawWaveFrom(),this.drawLoopArrow(this.scrollIdx)}initWaveFormPeer(){const t=document.getElementById("wave-from-box");this.sceneIns=d.init(t,{width:this.canvasContainer.width,height:this.canvasContainer.height,devicePixelRatio:2});const e=document.getElementById("MXRoutine_Grid");this.AssistCtx=e.getContext("2d")}initSlidingWindowInfo(){var o,r;const t=((o=this.formatData)==null?void 0:o.step)||0;this.vuescrollConfig.isShow&&(this.vuescrollWH.width=this.canvasContainer.width+(((r=this.formatData)==null?void 0:r.dataPxLen)||0)-this.width);const e=Math.ceil(this.width/t);this.slidingWindowInfo={points:e,startInd:0,endInd:e}}drawWaveFrom(){var t;this.createLeadName(),this.createWaveFrom(),(t=this.sceneIns)==null||t.add(this.waveFormGroup)}createLeadName(){var t;(t=this.sceneIns)==null||t.add(new d.Text({style:{x:this.leadConfig.fontSize*.5,y:this.canvasContainer.height/2+this.leadConfig.fontSize*2,text:_.LeadNameTexts[1],fontSize:this.leadConfig.fontSize,fill:this.leadConfig.lineColor,fontFamily:this.leadConfig.fontFamily}}))}getRednerPoints(){var r;const t=[],e=this.canvasContainer.height/2;let o=[];for(let i=1;i<=1;i++)o=((r=this.formatData)==null?void 0:r.processedData.handleData.Data[i])||[],t.push({pos:[0,e],startInd:this.slidingWindowInfo.startInd||0,endInd:this.slidingWindowInfo.endInd||0,data:o.slice(this.slidingWindowInfo.startInd,this.slidingWindowInfo.endInd).map((n,a)=>{var u;return[a*(((u=this.formatData)==null?void 0:u.step)||0),-n]})});return t}createWaveFrom(){var e,o;(e=this.waveFormGroup)==null||e.removeAll();let t=this.getRednerPoints();for(let r=0;r<t.length;r++)(o=this.waveFormGroup)==null||o.add(new d.Polyline({cursor:"",shape:{points:t[r].data.map(([i,n])=>[i+t[r].pos[0],n+t[r].pos[1]])},style:{stroke:this.leadConfig.lineColor,lineWidth:this.leadConfig.lineWidth}}));t=null}drawLoopArrow(t=0){var i,n,a,u,w,v,g,I,y,W;(i=this.arrowGroup)==null||i.removeAll(),this.currentHeardBeat.heardBeat===null&&(this.currentHeardBeat.heardBeat=((n=this.formatData)==null?void 0:n.heartBeatPosition[0])||null,this.$emit("notifyHeardBeat",d.util.clone(((a=this.formatData)==null?void 0:a.heartBeatPosition[0])||null)));let e=0;const o=20;let r=0;for(let p=0;p<(((u=this.formatData)==null?void 0:u.heartBeatPosition)||[]).length;p++){const s=(w=this.formatData)==null?void 0:w.heartBeatPosition[p];if(r=((s==null?void 0:s.position)||0)-t,!(t>((s==null?void 0:s.position)||0))){if(((s==null?void 0:s.position)||0)-this.slidingWindowInfo.startInd>(this.slidingWindowInfo.points||0))break;e=r*(((v=this.formatData)==null?void 0:v.step)||0)-9.5,(y=this.arrowGroup)==null||y.add(new d.Polygon({name:"arrow_box",shape:{points:[[4+e,0+o],[15+e,0+o],[15+e,10+o],[19+e,10+o],[9.5+e,22+o],[0+e,10+o],[4+e,10+o],[4+e,0+o]]},style:{fill:((I=(g=this.currentHeardBeat)==null?void 0:g.heardBeat)==null?void 0:I.index)===(s==null?void 0:s.index)?"blue":"#ccc"},onclick:f=>{var C;f.target.attr({style:{fill:"blue"}}),(C=this.arrowGroup)==null||C.children().filter(c=>c.name==="arrow_box").forEach(c=>{c.id!==f.target.id&&c.attr({style:{fill:"#ccc"}})}),this.arrowLoopClick(s,f.target)}}))}}(W=this.sceneIns)==null||W.add(this.arrowGroup)}arrowLoopClick(t,e){this.$emit("notifyHeardBeat",d.util.clone(t)),this.currentHeardBeat.heardBeat=t,this.currentHeardBeat.ele=e}handleScroll(t,e,o){var r;if(e.type==="horizontal"){e.scrollLeft=e.scrollLeft||0;const i=_.getPointIdxForPx(e.scrollLeft,((r=this.formatData)==null?void 0:r.step)||1);this.scrollIdx=i,this.scrollWaveFrom(i),this.scrollArrow(i),this.$emit("notifyScrollPointIdx",i)}}scrollWaveFrom(t){var o;this.slidingWindowInfo.startInd=t,this.slidingWindowInfo.endInd=t+(this.slidingWindowInfo.points||0);let e=this.getRednerPoints();(o=this.waveFormGroup)==null||o.eachChild((r,i)=>{i=i||0,r.attr({shape:{points:e[i].data.map(([n,a])=>[n+e[i].pos[0],a+e[i].pos[1]])}})}),e=null}scrollArrow(t){var e,o;(e=this.arrowGroup)==null||e.removeAll(),(o=this.sceneIns)==null||o.remove(this.arrowGroup),this.drawLoopArrow(t)}};l([h.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"width",2);l([h.Prop({required:!0,type:Number,validator:t=>typeof t=="number"})],exports.default.prototype,"height",2);l([h.Prop({required:!0})],exports.default.prototype,"gridConfig",2);l([h.Prop({default:()=>({isShow:!0,scrollPanel:{scrollingY:!1},bar:{keepShow:!0,size:"10px"}})})],exports.default.prototype,"vuescrollConfig",2);l([h.Prop({required:!0})],exports.default.prototype,"formatData",2);l([h.Prop({default:()=>({lineColor:"#000",lineWidth:1,fontFamily:"\u5FAE\u8F6F\u96C5\u9ED1",fontSize:15})})],exports.default.prototype,"leadConfig",2);l([m.Watch("width")],exports.default.prototype,"watchWidth",1);l([m.Watch("height")],exports.default.prototype,"watchHeight",1);l([m.Watch("formatData",{deep:!0})],exports.default.prototype,"watchFormatData",1);exports.default=l([P.default({name:"Routine",components:{vueScroll:D.default,MXBackgroundGrid:F.default}})],exports.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costy-plus",
3
- "version": "1.0.46-0",
3
+ "version": "1.0.47-0",
4
4
  "main": "dist/lib/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",