kd-lane-chart-v3 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -342,7 +342,7 @@ const _sfc_main$e = {
342
342
  document.body.addEventListener("keyup", this.onEscKeyRelease);
343
343
  },
344
344
  beforeUnmount() {
345
- document.removeEventListener("keyup", this.onEscKeyRelease);
345
+ document.body.removeEventListener("keyup", this.onEscKeyRelease);
346
346
  }
347
347
  };
348
348
  const _hoisted_1$d = {
@@ -371,7 +371,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
371
371
  ])
372
372
  ]);
373
373
  }
374
- const VueSimpleContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-5e769d89"]]);
374
+ const VueSimpleContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-25d746bb"]]);
375
375
  class CustomStrategy {
376
376
  constructor(strategy) {
377
377
  this.strategy = strategy;
@@ -2607,7 +2607,304 @@ const ACTION_TYPE = {
2607
2607
  UPSERT_LINE: "upsertLine",
2608
2608
  DELETE_LINE: "delLine"
2609
2609
  };
2610
+ const LOG_AXIS_MIN_POSITIVE = 0.1;
2611
+ const LOG_AXIS_BASE = 10;
2612
+ function isLogScaleFlag(val) {
2613
+ return val === true || val === "true" || val === 1 || val === "1";
2614
+ }
2615
+ function isLaneLogScale(lane) {
2616
+ return !!(lane && isLogScaleFlag(lane.isLogScale));
2617
+ }
2618
+ function isLogAxisLabelVisible(formCache) {
2619
+ if (!formCache) return true;
2620
+ return formCache.showLogAxis !== false && formCache.showLogAxis !== "false" && formCache.showLogAxis !== 0 && formCache.showLogAxis !== "0";
2621
+ }
2622
+ function normalizeLogRange(min, max) {
2623
+ let lo = Number(min);
2624
+ let hi = Number(max);
2625
+ if (!Number.isFinite(lo) || lo <= 0) lo = LOG_AXIS_MIN_POSITIVE;
2626
+ if (!Number.isFinite(hi) || hi <= 0) hi = lo * LOG_AXIS_BASE;
2627
+ if (hi <= lo) hi = lo * LOG_AXIS_BASE;
2628
+ return { min: lo, max: hi };
2629
+ }
2630
+ function toLogDisplayValue(raw, digits = 3) {
2631
+ const n = Number(raw);
2632
+ if (!Number.isFinite(n) || n <= 0) return null;
2633
+ const logv = Math.log10(n);
2634
+ if (!Number.isFinite(logv)) return null;
2635
+ return Number(logv.toFixed(digits));
2636
+ }
2637
+ function toLogPlotX(raw) {
2638
+ const n = Number(raw);
2639
+ if (!Number.isFinite(n) || n <= 0) return null;
2640
+ const logv = Math.log10(n);
2641
+ return Number.isFinite(logv) ? logv : null;
2642
+ }
2643
+ function toLaneDrawX(plotX, lane, xAx, digits = 3) {
2644
+ if (!isLaneLogScale(lane)) return plotX;
2645
+ const n = Number(plotX);
2646
+ if (!Number.isFinite(n)) return plotX;
2647
+ return Number(n.toFixed(digits));
2648
+ }
2649
+ function axisIndexOf$1(val) {
2650
+ const n = Array.isArray(val) ? val[0] : val;
2651
+ return Number(n ?? 0);
2652
+ }
2653
+ function findLogTrendSeries(chart, paramId) {
2654
+ const option = chart.getOption() || {};
2655
+ return (option.series || []).find((s) => {
2656
+ if (!s || s.type !== "line") return false;
2657
+ const name = Array.isArray(s.name) ? s.name[0] : s.name;
2658
+ if (name === "helper" || name === "log-grid") return false;
2659
+ return String(s.paramId) === String(paramId);
2660
+ }) || null;
2661
+ }
2662
+ function pixelToLogTrendData(chart, paramId, offsetX, offsetY, lane, lineRange, digits = 3) {
2663
+ if (!chart || !isLaneLogScale(lane)) return null;
2664
+ const series = findLogTrendSeries(chart, paramId);
2665
+ const xAxisIndex = series ? axisIndexOf$1(series.xAxisIndex) : 0;
2666
+ const yAxisIndex = series ? axisIndexOf$1(series.yAxisIndex) : 0;
2667
+ const plot = resolveLaneLogPlotRange(lane, lineRange);
2668
+ const extent = toLogAxisExtent(plot.min, plot.max);
2669
+ let x0;
2670
+ let x1;
2671
+ let depth;
2672
+ try {
2673
+ x0 = chart.convertToPixel({ xAxisIndex }, extent.min);
2674
+ x1 = chart.convertToPixel({ xAxisIndex }, extent.max);
2675
+ } catch (e) {
2676
+ return null;
2677
+ }
2678
+ try {
2679
+ depth = chart.convertFromPixel({ yAxisIndex }, offsetY);
2680
+ } catch (e) {
2681
+ depth = null;
2682
+ }
2683
+ if (!Number.isFinite(x0) || !Number.isFinite(x1) || x1 === x0) return null;
2684
+ if (!Number.isFinite(depth)) return null;
2685
+ const lg = extent.min + (offsetX - x0) / (x1 - x0) * (extent.max - extent.min);
2686
+ if (!Number.isFinite(lg)) return null;
2687
+ return {
2688
+ value: Number(lg.toFixed(digits)),
2689
+ depth,
2690
+ xAxisIndex,
2691
+ yAxisIndex
2692
+ };
2693
+ }
2694
+ function seriesLogXAtDepth(chart, paramId, depth, digits = 3) {
2695
+ const series = findLogTrendSeries(chart, paramId);
2696
+ if (!series || !series.data || !Number.isFinite(Number(depth))) return null;
2697
+ let best = null;
2698
+ series.data.forEach((pt) => {
2699
+ const x = Array.isArray(pt) ? Number(pt[0]) : Number(pt && pt.value && pt.value[0]);
2700
+ const y = Array.isArray(pt) ? Number(pt[1]) : Number(pt && pt.value && pt.value[1]);
2701
+ if (!Number.isFinite(x) || !Number.isFinite(y)) return;
2702
+ const dist = Math.abs(y - Number(depth));
2703
+ if (!best || dist < best.dist) best = { x, dist };
2704
+ });
2705
+ if (!best) return null;
2706
+ return Number(best.x.toFixed(digits));
2707
+ }
2708
+ function logTrendDataToPixel(chart, paramId, lg, depth) {
2709
+ if (!chart) return null;
2710
+ const series = findLogTrendSeries(chart, paramId);
2711
+ const xAxisIndex = series ? axisIndexOf$1(series.xAxisIndex) : 0;
2712
+ const yAxisIndex = series ? axisIndexOf$1(series.yAxisIndex) : 0;
2713
+ try {
2714
+ const px = chart.convertToPixel({ xAxisIndex, yAxisIndex }, [lg, depth]);
2715
+ if (px && Number.isFinite(px[0]) && Number.isFinite(px[1])) return px;
2716
+ } catch (e) {
2717
+ }
2718
+ try {
2719
+ const x = chart.convertToPixel({ xAxisIndex }, lg);
2720
+ const y = chart.convertToPixel({ yAxisIndex }, depth);
2721
+ if (Number.isFinite(x) && Number.isFinite(y)) return [x, y];
2722
+ } catch (e) {
2723
+ return null;
2724
+ }
2725
+ return null;
2726
+ }
2727
+ function toLogAxisExtent(min, max) {
2728
+ const range = normalizeLogRange(min, max);
2729
+ return {
2730
+ min: Math.log10(range.min),
2731
+ max: Math.log10(range.max)
2732
+ };
2733
+ }
2734
+ function mapSeriesDataXToLog(data) {
2735
+ return (data || []).map((item) => {
2736
+ if (Array.isArray(item)) {
2737
+ return [toLogPlotX(item[0]), item[1], item[2]];
2738
+ }
2739
+ if (item && Array.isArray(item.value)) {
2740
+ return {
2741
+ ...item,
2742
+ value: [toLogPlotX(item.value[0]), item.value[1]]
2743
+ };
2744
+ }
2745
+ return item;
2746
+ });
2747
+ }
2748
+ function formatLanePointValue(raw, isLog, digits = 3) {
2749
+ if (raw === null || raw === void 0 || raw === "") return null;
2750
+ return toLogDisplayValue(raw, digits);
2751
+ }
2752
+ function niceLogDecadeRange(min, max) {
2753
+ const range = normalizeLogRange(min, max);
2754
+ let niceMin = 10 ** Math.floor(Math.log10(range.min) + 1e-9);
2755
+ let niceMax = 10 ** Math.ceil(Math.log10(range.max) - 1e-9);
2756
+ if (!Number.isFinite(niceMin) || niceMin <= 0) niceMin = LOG_AXIS_MIN_POSITIVE;
2757
+ if (!Number.isFinite(niceMax) || niceMax <= niceMin) {
2758
+ niceMax = niceMin * LOG_AXIS_BASE;
2759
+ }
2760
+ return { min: niceMin, max: niceMax };
2761
+ }
2762
+ function resolveLaneLogPlotRange(lane, lineRange = {}) {
2763
+ let lo = Infinity;
2764
+ let hi = -Infinity;
2765
+ (lane && lane.lines || []).forEach((line) => {
2766
+ if (!line) return;
2767
+ const r = lineRange[line.lineId] || {};
2768
+ const cfgMin = Number(line.min);
2769
+ const cfgMax = Number(line.max);
2770
+ const useMin = Number.isFinite(cfgMin) && cfgMin > 0 ? cfgMin : Number(r.min);
2771
+ const useMax = Number.isFinite(cfgMax) && cfgMax > 0 ? cfgMax : Number(r.max);
2772
+ if (Number.isFinite(useMin) && useMin > 0) lo = Math.min(lo, useMin);
2773
+ if (Number.isFinite(useMax) && useMax > 0) hi = Math.max(hi, useMax);
2774
+ });
2775
+ return niceLogDecadeRange(
2776
+ Number.isFinite(lo) ? lo : LOG_AXIS_MIN_POSITIVE,
2777
+ Number.isFinite(hi) ? hi : LOG_AXIS_MIN_POSITIVE * LOG_AXIS_BASE
2778
+ );
2779
+ }
2780
+ function buildLogLaneTenLineValues(min, max) {
2781
+ const range = niceLogDecadeRange(min, max);
2782
+ const ratio = range.max / range.min;
2783
+ const values = [];
2784
+ for (let m = 1; m <= 10; m++) {
2785
+ values.push(range.min * ratio ** Math.log10(m));
2786
+ }
2787
+ return values;
2788
+ }
2789
+ function buildLogLaneTenLineLgValues(min, max) {
2790
+ return buildLogLaneTenLineValues(min, max).map((v) => Math.log10(v)).filter((v) => Number.isFinite(v));
2791
+ }
2792
+ function buildLogDecadeTickMarks(min, max) {
2793
+ const range = niceLogDecadeRange(min, max);
2794
+ const loExp = Math.round(Math.log10(range.min));
2795
+ const hiExp = Math.round(Math.log10(range.max));
2796
+ const marks = [];
2797
+ for (let e = loExp; e <= hiExp; e++) {
2798
+ const value = 10 ** e;
2799
+ marks.push({
2800
+ value,
2801
+ label: String(e),
2802
+ percent: logValueToPercent(value, range.min, range.max)
2803
+ });
2804
+ }
2805
+ return marks;
2806
+ }
2807
+ function logValueToPercent(value, min, max) {
2808
+ const range = normalizeLogRange(min, max);
2809
+ const v = Number(value);
2810
+ if (!Number.isFinite(v) || v <= 0) return 0;
2811
+ const clamped = Math.max(range.min, Math.min(range.max, v));
2812
+ const span = Math.log(range.max) - Math.log(range.min);
2813
+ if (span <= 0) return 0;
2814
+ return (Math.log(clamped) - Math.log(range.min)) / span * 100;
2815
+ }
2816
+ function buildLogXAxisOption({
2817
+ gridIndex = 0,
2818
+ min,
2819
+ max,
2820
+ showSplitLine = true,
2821
+ splitLineColor
2822
+ } = {}) {
2823
+ const range = niceLogDecadeRange(min, max);
2824
+ const extent = toLogAxisExtent(range.min, range.max);
2825
+ const lineStyle = {
2826
+ color: splitLineColor,
2827
+ type: "dashed",
2828
+ width: 1
2829
+ };
2830
+ return {
2831
+ gridIndex,
2832
+ show: true,
2833
+ type: "value",
2834
+ min: extent.min,
2835
+ max: extent.max,
2836
+ minorTick: { show: false },
2837
+ minorSplitLine: {
2838
+ show: false,
2839
+ lineStyle
2840
+ },
2841
+ splitLine: {
2842
+ show: showSplitLine,
2843
+ showMaxLine: false,
2844
+ showMinLine: false,
2845
+ lineStyle
2846
+ },
2847
+ axisLabel: { show: false },
2848
+ axisLine: { show: false },
2849
+ axisTick: { show: false }
2850
+ };
2851
+ }
2610
2852
  const _sfc_main$9 = {
2853
+ name: "LogAxisRuler",
2854
+ props: {
2855
+ min: {
2856
+ type: [Number, String],
2857
+ default: 0.1
2858
+ },
2859
+ max: {
2860
+ type: [Number, String],
2861
+ default: 100
2862
+ },
2863
+ visible: {
2864
+ type: Boolean,
2865
+ default: true
2866
+ },
2867
+ // top:曲线上方;bottom:表头底沿。8.22对数轴
2868
+ placement: {
2869
+ type: String,
2870
+ default: "top"
2871
+ }
2872
+ },
2873
+ computed: {
2874
+ // 刻度随量程重算,标 lg;边控关显示时整尺隐藏。8.24
2875
+ marks() {
2876
+ return buildLogDecadeTickMarks(this.min, this.max);
2877
+ }
2878
+ },
2879
+ methods: {
2880
+ // 两端刻度贴边,避免 translateX(-50%) 被裁掉。8.22对数轴
2881
+ tickStyle(mark) {
2882
+ if (mark.percent <= 2) {
2883
+ return { left: "2px", transform: "none" };
2884
+ }
2885
+ if (mark.percent >= 98) {
2886
+ return { left: "auto", right: "2px", transform: "none" };
2887
+ }
2888
+ return { left: mark.percent + "%" };
2889
+ }
2890
+ }
2891
+ };
2892
+ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
2893
+ return $props.visible && $options.marks.length ? (openBlock(), createElementBlock("div", {
2894
+ key: 0,
2895
+ class: normalizeClass(["kd-log-axis-ruler", { "kd-log-axis-ruler--top": $props.placement === "top" }])
2896
+ }, [
2897
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.marks, (mark) => {
2898
+ return openBlock(), createElementBlock("span", {
2899
+ key: String(mark.value),
2900
+ class: "kd-log-axis-ruler__tick",
2901
+ style: normalizeStyle($options.tickStyle(mark))
2902
+ }, toDisplayString(mark.label), 5);
2903
+ }), 128))
2904
+ ], 2)) : createCommentVNode("", true);
2905
+ }
2906
+ const LogAxisRuler = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-17ebb571"]]);
2907
+ const _sfc_main$8 = {
2611
2908
  name: "HeaderItem",
2612
2909
  props: {
2613
2910
  lineRange: {
@@ -2654,6 +2951,11 @@ const _sfc_main$9 = {
2654
2951
  headerData: {
2655
2952
  type: Object,
2656
2953
  default: () => ({})
2954
+ },
2955
+ // 泳道开了对数轴时,表头当前值出 lg。8.24
2956
+ isLogScale: {
2957
+ type: [Boolean, String, Number],
2958
+ default: false
2657
2959
  }
2658
2960
  },
2659
2961
  methods: {
@@ -2692,7 +2994,7 @@ const _sfc_main$9 = {
2692
2994
  if (!Number.isFinite(max)) return false;
2693
2995
  return max > this.line.max || min < this.line.min;
2694
2996
  },
2695
- // 显示当前数据最新值
2997
+ // 显示当前数据最新值;对数道出 lg(x)。8.24
2696
2998
  getCurrentData() {
2697
2999
  if (this.formCache.displayType == "float") {
2698
3000
  return "";
@@ -2703,7 +3005,13 @@ const _sfc_main$9 = {
2703
3005
  )) {
2704
3006
  return "--";
2705
3007
  }
2706
- return this.headerData[this.line.paramId] !== null && this.headerData[this.line.paramId] !== void 0 && this.headerData[this.line.paramId] !== "" ? typeof +this.headerData[this.line.paramId] === "number" ? Number(Number(this.headerData[this.line.paramId]).toFixed(3)) : this.headerData[this.line.paramId] : "--";
3008
+ const raw = this.headerData[this.line.paramId];
3009
+ if (raw === null || raw === void 0 || raw === "") return "--";
3010
+ if (isLogScaleFlag(this.isLogScale)) {
3011
+ const lg = formatLanePointValue(raw);
3012
+ return lg == null ? "--" : lg;
3013
+ }
3014
+ return typeof +raw === "number" ? Number(Number(raw).toFixed(3)) : raw;
2707
3015
  },
2708
3016
  getParamName(line) {
2709
3017
  const nameConfig = this.paramsNameMap[line.paramId];
@@ -2792,7 +3100,7 @@ const _hoisted_1$8 = { class: "kd-lane-chart-container-text-container" };
2792
3100
  const _hoisted_2$7 = { class: "left" };
2793
3101
  const _hoisted_3$6 = { class: "center" };
2794
3102
  const _hoisted_4$6 = { class: "right" };
2795
- function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
3103
+ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2796
3104
  return openBlock(), createElementBlock("div", {
2797
3105
  class: normalizeClass(["kd-lane-chart-container-header-item", { "kd-lane-chart-container-header-item_warning": $options.isShowWarning() }]),
2798
3106
  style: normalizeStyle($options.headerItemStyle),
@@ -2819,8 +3127,8 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
2819
3127
  ])
2820
3128
  ], 6);
2821
3129
  }
2822
- const HeaderItem = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-3a2fbd9e"]]);
2823
- const _sfc_main$8 = {
3130
+ const HeaderItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-466dec24"]]);
3131
+ const _sfc_main$7 = {
2824
3132
  name: "LegendItem",
2825
3133
  props: {
2826
3134
  lineRange: {
@@ -2867,6 +3175,11 @@ const _sfc_main$8 = {
2867
3175
  headerData: {
2868
3176
  type: Object,
2869
3177
  default: () => ({})
3178
+ },
3179
+ // 泳道开了对数轴时,表头当前值出 lg。8.24
3180
+ isLogScale: {
3181
+ type: [Boolean, String, Number],
3182
+ default: false
2870
3183
  }
2871
3184
  },
2872
3185
  methods: {
@@ -2884,7 +3197,13 @@ const _sfc_main$8 = {
2884
3197
  if (!Object.prototype.hasOwnProperty.call(this.headerData, paramId)) {
2885
3198
  return "--";
2886
3199
  }
2887
- return this.headerData[paramId] !== null && this.headerData[paramId] !== void 0 && this.headerData[paramId] !== "" ? typeof +this.headerData[paramId] === "number" ? Number(Number(this.headerData[paramId]).toFixed(3)) : this.headerData[paramId] : "--";
3200
+ const raw = this.headerData[paramId];
3201
+ if (raw === null || raw === void 0 || raw === "") return "--";
3202
+ if (isLogScaleFlag(this.isLogScale)) {
3203
+ const lg = formatLanePointValue(raw);
3204
+ return lg == null ? "--" : lg;
3205
+ }
3206
+ return typeof +raw === "number" ? Number(Number(raw).toFixed(3)) : raw;
2888
3207
  },
2889
3208
  toggleLegend(label) {
2890
3209
  const temp = { ...this.line };
@@ -2945,7 +3264,7 @@ const _hoisted_7$3 = {
2945
3264
  class: "legend-data"
2946
3265
  };
2947
3266
  const _hoisted_8$2 = { class: "scale-right" };
2948
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
3267
+ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
2949
3268
  return openBlock(), createElementBlock("div", {
2950
3269
  class: "kd-lane-chart-container-legend-item",
2951
3270
  style: normalizeStyle($options.legendItemStyle)
@@ -2979,7 +3298,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
2979
3298
  ])
2980
3299
  ], 4);
2981
3300
  }
2982
- const LegendItem = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-9206b887"]]);
3301
+ const LegendItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-41c24d2f"]]);
2983
3302
  const TREND_LINE_STYLE = {
2984
3303
  stroke: "#FF9800",
2985
3304
  lineWidth: 2,
@@ -3341,8 +3660,8 @@ function findSeriesForDepth(chart, paramId, depth) {
3341
3660
  if (String(seriesParamId(s)) !== String(paramId)) continue;
3342
3661
  const info = {
3343
3662
  seriesIndex: i,
3344
- xAxisIndex: axisIndexOf$1(s.xAxisIndex),
3345
- yAxisIndex: axisIndexOf$1(s.yAxisIndex)
3663
+ xAxisIndex: axisIndexOf(s.xAxisIndex),
3664
+ yAxisIndex: axisIndexOf(s.yAxisIndex)
3346
3665
  };
3347
3666
  fallback = info;
3348
3667
  const yAx = yAxes[info.yAxisIndex];
@@ -3382,7 +3701,7 @@ function isPointerInAnyGrid(chart, offsetX, offsetY) {
3382
3701
  }
3383
3702
  return false;
3384
3703
  }
3385
- function axisIndexOf$1(val) {
3704
+ function axisIndexOf(val) {
3386
3705
  const n = Array.isArray(val) ? val[0] : val;
3387
3706
  return Number(n ?? 0);
3388
3707
  }
@@ -3394,12 +3713,12 @@ function pixelToData(chart, paramId, offsetX, offsetY, loose = false) {
3394
3713
  try {
3395
3714
  if (!loose && !chart.containPixel({ gridIndex: g }, [offsetX, offsetY])) continue;
3396
3715
  const seriesList = (option.series || []).filter(matchParam);
3397
- const series = seriesList.find((s) => axisIndexOf$1(s.yAxisIndex) === g) || seriesList[0];
3716
+ const series = seriesList.find((s) => axisIndexOf(s.yAxisIndex) === g) || seriesList[0];
3398
3717
  const finders = [];
3399
3718
  if (series) {
3400
3719
  finders.push({
3401
- xAxisIndex: axisIndexOf$1(series.xAxisIndex),
3402
- yAxisIndex: axisIndexOf$1(series.yAxisIndex)
3720
+ xAxisIndex: axisIndexOf(series.xAxisIndex),
3721
+ yAxisIndex: axisIndexOf(series.yAxisIndex)
3403
3722
  });
3404
3723
  const seriesIndex = (option.series || []).indexOf(series);
3405
3724
  if (seriesIndex >= 0) finders.push({ seriesIndex });
@@ -3436,347 +3755,50 @@ function pixelToData(chart, paramId, offsetX, offsetY, loose = false) {
3436
3755
  } catch (e) {
3437
3756
  }
3438
3757
  }
3439
- return null;
3440
- }
3441
- function dataToPixel(chart, paramId, value, depth) {
3442
- const finder = findSeriesForDepth(chart, paramId, depth);
3443
- const finders = [
3444
- { xAxisIndex: finder.xAxisIndex, yAxisIndex: finder.yAxisIndex },
3445
- { seriesIndex: finder.seriesIndex },
3446
- { gridIndex: finder.yAxisIndex ?? 0 }
3447
- ];
3448
- for (const f of finders) {
3449
- try {
3450
- const px = chart.convertToPixel(f, [value, depth]);
3451
- if (px && Number.isFinite(px[0]) && Number.isFinite(px[1])) return px;
3452
- } catch (e) {
3453
- }
3454
- }
3455
- return null;
3456
- }
3457
- function snapDepthToEdge(depth, depthMin, depthMax, tol) {
3458
- if (!Number.isFinite(depth)) return depth;
3459
- const lo = Number.isFinite(depthMin) && Number.isFinite(depthMax) ? Math.min(depthMin, depthMax) : depthMin;
3460
- const hi = Number.isFinite(depthMin) && Number.isFinite(depthMax) ? Math.max(depthMin, depthMax) : depthMax;
3461
- if (!Number.isFinite(lo) || !Number.isFinite(hi)) return depth;
3462
- let d = depth;
3463
- if (Math.abs(d - lo) <= tol) d = lo;
3464
- if (Math.abs(d - hi) <= tol) d = hi;
3465
- return Math.max(lo, Math.min(hi, d));
3466
- }
3467
- function getAxisRange(chart, paramId, depth) {
3468
- const option = chart.getOption() || {};
3469
- const finder = findSeriesForDepth(chart, paramId, depth);
3470
- const xAx = (option.xAxis || [])[finder.xAxisIndex] || {};
3471
- const yAx = (option.yAxis || [])[finder.yAxisIndex] || {};
3472
- const xMin = Number(xAx.min);
3473
- const xMax = Number(xAx.max);
3474
- const yMin = Number(yAx.min);
3475
- const yMax = Number(yAx.max);
3476
- return {
3477
- valueMin: Number.isFinite(xMin) ? xMin : 0,
3478
- valueMax: Number.isFinite(xMax) ? xMax : 100,
3479
- depthMin: Number.isFinite(yMin) ? Math.min(yMin, yMax) : 0,
3480
- depthMax: Number.isFinite(yMax) ? Math.max(yMin, yMax) : 100
3481
- };
3482
- }
3483
- const LOG_AXIS_MIN_POSITIVE = 0.1;
3484
- const LOG_AXIS_BASE = 10;
3485
- function isLogScaleFlag(val) {
3486
- return val === true || val === "true" || val === 1 || val === "1";
3487
- }
3488
- function isLaneLogScale(lane) {
3489
- return !!(lane && isLogScaleFlag(lane.isLogScale));
3490
- }
3491
- function isLogAxisLabelVisible(formCache) {
3492
- if (!formCache) return true;
3493
- return formCache.showLogAxis !== false && formCache.showLogAxis !== "false" && formCache.showLogAxis !== 0 && formCache.showLogAxis !== "0";
3494
- }
3495
- function normalizeLogRange(min, max) {
3496
- let lo = Number(min);
3497
- let hi = Number(max);
3498
- if (!Number.isFinite(lo) || lo <= 0) lo = LOG_AXIS_MIN_POSITIVE;
3499
- if (!Number.isFinite(hi) || hi <= 0) hi = lo * LOG_AXIS_BASE;
3500
- if (hi <= lo) hi = lo * LOG_AXIS_BASE;
3501
- return { min: lo, max: hi };
3502
- }
3503
- function toLogPlotX(raw) {
3504
- const n = Number(raw);
3505
- if (!Number.isFinite(n) || n <= 0) return null;
3506
- const logv = Math.log10(n);
3507
- return Number.isFinite(logv) ? logv : null;
3508
- }
3509
- function toLaneDrawX(plotX, lane, xAx, digits = 3) {
3510
- if (!isLaneLogScale(lane)) return plotX;
3511
- const n = Number(plotX);
3512
- if (!Number.isFinite(n)) return plotX;
3513
- return Number(n.toFixed(digits));
3514
- }
3515
- function axisIndexOf(val) {
3516
- const n = Array.isArray(val) ? val[0] : val;
3517
- return Number(n ?? 0);
3518
- }
3519
- function findLogTrendSeries(chart, paramId) {
3520
- const option = chart.getOption() || {};
3521
- return (option.series || []).find((s) => {
3522
- if (!s || s.type !== "line") return false;
3523
- const name = Array.isArray(s.name) ? s.name[0] : s.name;
3524
- if (name === "helper" || name === "log-grid") return false;
3525
- return String(s.paramId) === String(paramId);
3526
- }) || null;
3527
- }
3528
- function pixelToLogTrendData(chart, paramId, offsetX, offsetY, lane, lineRange, digits = 3) {
3529
- if (!chart || !isLaneLogScale(lane)) return null;
3530
- const series = findLogTrendSeries(chart, paramId);
3531
- const xAxisIndex = series ? axisIndexOf(series.xAxisIndex) : 0;
3532
- const yAxisIndex = series ? axisIndexOf(series.yAxisIndex) : 0;
3533
- const plot = resolveLaneLogPlotRange(lane, lineRange);
3534
- const extent = toLogAxisExtent(plot.min, plot.max);
3535
- let x0;
3536
- let x1;
3537
- let depth;
3538
- try {
3539
- x0 = chart.convertToPixel({ xAxisIndex }, extent.min);
3540
- x1 = chart.convertToPixel({ xAxisIndex }, extent.max);
3541
- } catch (e) {
3542
- return null;
3543
- }
3544
- try {
3545
- depth = chart.convertFromPixel({ yAxisIndex }, offsetY);
3546
- } catch (e) {
3547
- depth = null;
3548
- }
3549
- if (!Number.isFinite(x0) || !Number.isFinite(x1) || x1 === x0) return null;
3550
- if (!Number.isFinite(depth)) return null;
3551
- const lg = extent.min + (offsetX - x0) / (x1 - x0) * (extent.max - extent.min);
3552
- if (!Number.isFinite(lg)) return null;
3553
- return {
3554
- value: Number(lg.toFixed(digits)),
3555
- depth,
3556
- xAxisIndex,
3557
- yAxisIndex
3558
- };
3559
- }
3560
- function seriesLogXAtDepth(chart, paramId, depth, digits = 3) {
3561
- const series = findLogTrendSeries(chart, paramId);
3562
- if (!series || !series.data || !Number.isFinite(Number(depth))) return null;
3563
- let best = null;
3564
- series.data.forEach((pt) => {
3565
- const x = Array.isArray(pt) ? Number(pt[0]) : Number(pt && pt.value && pt.value[0]);
3566
- const y = Array.isArray(pt) ? Number(pt[1]) : Number(pt && pt.value && pt.value[1]);
3567
- if (!Number.isFinite(x) || !Number.isFinite(y)) return;
3568
- const dist = Math.abs(y - Number(depth));
3569
- if (!best || dist < best.dist) best = { x, dist };
3570
- });
3571
- if (!best) return null;
3572
- return Number(best.x.toFixed(digits));
3573
- }
3574
- function logTrendDataToPixel(chart, paramId, lg, depth) {
3575
- if (!chart) return null;
3576
- const series = findLogTrendSeries(chart, paramId);
3577
- const xAxisIndex = series ? axisIndexOf(series.xAxisIndex) : 0;
3578
- const yAxisIndex = series ? axisIndexOf(series.yAxisIndex) : 0;
3579
- try {
3580
- const px = chart.convertToPixel({ xAxisIndex, yAxisIndex }, [lg, depth]);
3581
- if (px && Number.isFinite(px[0]) && Number.isFinite(px[1])) return px;
3582
- } catch (e) {
3583
- }
3584
- try {
3585
- const x = chart.convertToPixel({ xAxisIndex }, lg);
3586
- const y = chart.convertToPixel({ yAxisIndex }, depth);
3587
- if (Number.isFinite(x) && Number.isFinite(y)) return [x, y];
3588
- } catch (e) {
3589
- return null;
3590
- }
3591
- return null;
3592
- }
3593
- function toLogAxisExtent(min, max) {
3594
- const range = normalizeLogRange(min, max);
3595
- return {
3596
- min: Math.log10(range.min),
3597
- max: Math.log10(range.max)
3598
- };
3599
- }
3600
- function mapSeriesDataXToLog(data) {
3601
- return (data || []).map((item) => {
3602
- if (Array.isArray(item)) {
3603
- return [toLogPlotX(item[0]), item[1], item[2]];
3604
- }
3605
- if (item && Array.isArray(item.value)) {
3606
- return {
3607
- ...item,
3608
- value: [toLogPlotX(item.value[0]), item.value[1]]
3609
- };
3610
- }
3611
- return item;
3612
- });
3613
- }
3614
- function formatLogTick(value) {
3615
- const n = Number(value);
3616
- if (n === 0) return "0";
3617
- if (!Number.isFinite(n) || n <= 0) return "";
3618
- const exp = Math.log10(n);
3619
- if (Math.abs(exp - Math.round(exp)) < 1e-6 && (n >= 1e3 || n < 0.01)) {
3620
- return `1e${Math.round(exp)}`;
3621
- }
3622
- if (n >= 1) return String(Number(n.toPrecision(4)));
3623
- return String(Number(n.toPrecision(3)));
3624
- }
3625
- function niceLogDecadeRange(min, max) {
3626
- const range = normalizeLogRange(min, max);
3627
- let niceMin = 10 ** Math.floor(Math.log10(range.min) + 1e-9);
3628
- let niceMax = 10 ** Math.ceil(Math.log10(range.max) - 1e-9);
3629
- if (!Number.isFinite(niceMin) || niceMin <= 0) niceMin = LOG_AXIS_MIN_POSITIVE;
3630
- if (!Number.isFinite(niceMax) || niceMax <= niceMin) {
3631
- niceMax = niceMin * LOG_AXIS_BASE;
3632
- }
3633
- return { min: niceMin, max: niceMax };
3634
- }
3635
- function resolveLaneLogPlotRange(lane, lineRange = {}) {
3636
- let lo = Infinity;
3637
- let hi = -Infinity;
3638
- (lane && lane.lines || []).forEach((line) => {
3639
- if (!line) return;
3640
- const r = lineRange[line.lineId] || {};
3641
- const cfgMin = Number(line.min);
3642
- const cfgMax = Number(line.max);
3643
- const useMin = Number.isFinite(cfgMin) && cfgMin > 0 ? cfgMin : Number(r.min);
3644
- const useMax = Number.isFinite(cfgMax) && cfgMax > 0 ? cfgMax : Number(r.max);
3645
- if (Number.isFinite(useMin) && useMin > 0) lo = Math.min(lo, useMin);
3646
- if (Number.isFinite(useMax) && useMax > 0) hi = Math.max(hi, useMax);
3647
- });
3648
- return niceLogDecadeRange(
3649
- Number.isFinite(lo) ? lo : LOG_AXIS_MIN_POSITIVE,
3650
- Number.isFinite(hi) ? hi : LOG_AXIS_MIN_POSITIVE * LOG_AXIS_BASE
3651
- );
3652
- }
3653
- function buildLogLaneTenLineValues(min, max) {
3654
- const range = niceLogDecadeRange(min, max);
3655
- const ratio = range.max / range.min;
3656
- const values = [];
3657
- for (let m = 1; m <= 10; m++) {
3658
- values.push(range.min * ratio ** Math.log10(m));
3659
- }
3660
- return values;
3661
- }
3662
- function buildLogLaneTenLineLgValues(min, max) {
3663
- return buildLogLaneTenLineValues(min, max).map((v) => Math.log10(v)).filter((v) => Number.isFinite(v));
3758
+ return null;
3664
3759
  }
3665
- function buildLogDecadeTickMarks(min, max) {
3666
- const range = niceLogDecadeRange(min, max);
3667
- const loExp = Math.round(Math.log10(range.min));
3668
- const hiExp = Math.round(Math.log10(range.max));
3669
- const marks = [];
3670
- for (let e = loExp; e <= hiExp; e++) {
3671
- const value = 10 ** e;
3672
- marks.push({
3673
- value,
3674
- label: formatLogTick(value),
3675
- percent: logValueToPercent(value, range.min, range.max)
3676
- });
3760
+ function dataToPixel(chart, paramId, value, depth) {
3761
+ const finder = findSeriesForDepth(chart, paramId, depth);
3762
+ const finders = [
3763
+ { xAxisIndex: finder.xAxisIndex, yAxisIndex: finder.yAxisIndex },
3764
+ { seriesIndex: finder.seriesIndex },
3765
+ { gridIndex: finder.yAxisIndex ?? 0 }
3766
+ ];
3767
+ for (const f of finders) {
3768
+ try {
3769
+ const px = chart.convertToPixel(f, [value, depth]);
3770
+ if (px && Number.isFinite(px[0]) && Number.isFinite(px[1])) return px;
3771
+ } catch (e) {
3772
+ }
3677
3773
  }
3678
- return marks;
3774
+ return null;
3679
3775
  }
3680
- function logValueToPercent(value, min, max) {
3681
- const range = normalizeLogRange(min, max);
3682
- const v = Number(value);
3683
- if (!Number.isFinite(v) || v <= 0) return 0;
3684
- const clamped = Math.max(range.min, Math.min(range.max, v));
3685
- const span = Math.log(range.max) - Math.log(range.min);
3686
- if (span <= 0) return 0;
3687
- return (Math.log(clamped) - Math.log(range.min)) / span * 100;
3776
+ function snapDepthToEdge(depth, depthMin, depthMax, tol) {
3777
+ if (!Number.isFinite(depth)) return depth;
3778
+ const lo = Number.isFinite(depthMin) && Number.isFinite(depthMax) ? Math.min(depthMin, depthMax) : depthMin;
3779
+ const hi = Number.isFinite(depthMin) && Number.isFinite(depthMax) ? Math.max(depthMin, depthMax) : depthMax;
3780
+ if (!Number.isFinite(lo) || !Number.isFinite(hi)) return depth;
3781
+ let d = depth;
3782
+ if (Math.abs(d - lo) <= tol) d = lo;
3783
+ if (Math.abs(d - hi) <= tol) d = hi;
3784
+ return Math.max(lo, Math.min(hi, d));
3688
3785
  }
3689
- function buildLogXAxisOption({
3690
- gridIndex = 0,
3691
- min,
3692
- max,
3693
- showSplitLine = true,
3694
- splitLineColor
3695
- } = {}) {
3696
- const range = niceLogDecadeRange(min, max);
3697
- const extent = toLogAxisExtent(range.min, range.max);
3698
- const lineStyle = {
3699
- color: splitLineColor,
3700
- type: "dashed",
3701
- width: 1
3702
- };
3786
+ function getAxisRange(chart, paramId, depth) {
3787
+ const option = chart.getOption() || {};
3788
+ const finder = findSeriesForDepth(chart, paramId, depth);
3789
+ const xAx = (option.xAxis || [])[finder.xAxisIndex] || {};
3790
+ const yAx = (option.yAxis || [])[finder.yAxisIndex] || {};
3791
+ const xMin = Number(xAx.min);
3792
+ const xMax = Number(xAx.max);
3793
+ const yMin = Number(yAx.min);
3794
+ const yMax = Number(yAx.max);
3703
3795
  return {
3704
- gridIndex,
3705
- show: true,
3706
- type: "value",
3707
- min: extent.min,
3708
- max: extent.max,
3709
- minorTick: { show: false },
3710
- minorSplitLine: {
3711
- show: false,
3712
- lineStyle
3713
- },
3714
- splitLine: {
3715
- show: showSplitLine,
3716
- showMaxLine: false,
3717
- showMinLine: false,
3718
- lineStyle
3719
- },
3720
- axisLabel: { show: false },
3721
- axisLine: { show: false },
3722
- axisTick: { show: false }
3796
+ valueMin: Number.isFinite(xMin) ? xMin : 0,
3797
+ valueMax: Number.isFinite(xMax) ? xMax : 100,
3798
+ depthMin: Number.isFinite(yMin) ? Math.min(yMin, yMax) : 0,
3799
+ depthMax: Number.isFinite(yMax) ? Math.max(yMin, yMax) : 100
3723
3800
  };
3724
3801
  }
3725
- const _sfc_main$7 = {
3726
- name: "LogAxisRuler",
3727
- props: {
3728
- min: {
3729
- type: [Number, String],
3730
- default: 0.1
3731
- },
3732
- max: {
3733
- type: [Number, String],
3734
- default: 100
3735
- },
3736
- visible: {
3737
- type: Boolean,
3738
- default: true
3739
- },
3740
- // top:曲线上方;bottom:表头底沿。8.22对数轴
3741
- placement: {
3742
- type: String,
3743
- default: "top"
3744
- }
3745
- },
3746
- computed: {
3747
- // 刻度随量程重算,边控关显示时整尺隐藏。8.22对数轴
3748
- marks() {
3749
- return buildLogDecadeTickMarks(this.min, this.max);
3750
- }
3751
- },
3752
- methods: {
3753
- // 两端刻度贴边,避免 translateX(-50%) 被裁掉。8.22对数轴
3754
- tickStyle(mark) {
3755
- if (mark.percent <= 2) {
3756
- return { left: "2px", transform: "none" };
3757
- }
3758
- if (mark.percent >= 98) {
3759
- return { left: "auto", right: "2px", transform: "none" };
3760
- }
3761
- return { left: mark.percent + "%" };
3762
- }
3763
- }
3764
- };
3765
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
3766
- return $props.visible && $options.marks.length ? (openBlock(), createElementBlock("div", {
3767
- key: 0,
3768
- class: normalizeClass(["kd-log-axis-ruler", { "kd-log-axis-ruler--top": $props.placement === "top" }])
3769
- }, [
3770
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.marks, (mark) => {
3771
- return openBlock(), createElementBlock("span", {
3772
- key: String(mark.value),
3773
- class: "kd-log-axis-ruler__tick",
3774
- style: normalizeStyle($options.tickStyle(mark))
3775
- }, toDisplayString(mark.label), 5);
3776
- }), 128))
3777
- ], 2)) : createCommentVNode("", true);
3778
- }
3779
- const LogAxisRuler = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-d5ed1748"]]);
3780
3802
  class TrendLineManager {
3781
3803
  constructor(host) {
3782
3804
  this.host = host;
@@ -3797,9 +3819,20 @@ class TrendLineManager {
3797
3819
  this._clearClickTimer();
3798
3820
  this._endDrag();
3799
3821
  Array.from(this.binds.keys()).forEach((laneId) => this.unbindChart(laneId));
3800
- if (this._raf) cancelAnimationFrame(this._raf);
3801
- if (this._zoomRaf) cancelAnimationFrame(this._zoomRaf);
3802
- if (this._zoomEndTimer) clearTimeout(this._zoomEndTimer);
3822
+ if (this._raf) {
3823
+ cancelAnimationFrame(this._raf);
3824
+ this._raf = null;
3825
+ }
3826
+ if (this._zoomRaf) {
3827
+ cancelAnimationFrame(this._zoomRaf);
3828
+ this._zoomRaf = null;
3829
+ }
3830
+ if (this._zoomEndTimer) {
3831
+ clearTimeout(this._zoomEndTimer);
3832
+ this._zoomEndTimer = null;
3833
+ }
3834
+ this.store = /* @__PURE__ */ Object.create(null);
3835
+ this._graphicIds = /* @__PURE__ */ Object.create(null);
3803
3836
  }
3804
3837
  /** 从模板 line.trendSegments 回显;已有 store 的曲线不覆盖,避免编辑中被模板刷新冲掉。8.21 */
3805
3838
  hydrateFromTemplate(template) {
@@ -5133,12 +5166,16 @@ const _sfc_main$6 = {
5133
5166
  }
5134
5167
  if (this.resizeObserver) {
5135
5168
  this.resizeObserver.disconnect();
5169
+ this.resizeObserver = null;
5136
5170
  }
5137
5171
  if (this.resizeObserverContainer) {
5138
5172
  this.resizeObserverContainer.disconnect();
5173
+ this.resizeObserverContainer = null;
5139
5174
  }
5140
5175
  },
5141
5176
  methods: {
5177
+ isLaneLogScale,
5178
+ // 模板里判断对数道。8.24
5142
5179
  initStrategy() {
5143
5180
  if (!this.config || !this.config.caseId) {
5144
5181
  return;
@@ -5183,6 +5220,10 @@ const _sfc_main$6 = {
5183
5220
  });
5184
5221
  },
5185
5222
  setupResizeObserver() {
5223
+ if (this.resizeObserver) {
5224
+ this.resizeObserver.disconnect();
5225
+ this.resizeObserver = null;
5226
+ }
5186
5227
  const container = this.$refs.targetDom;
5187
5228
  if (container) {
5188
5229
  this.resizeObserver = new ResizeObserver(() => {
@@ -6324,16 +6365,18 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
6324
6365
  line,
6325
6366
  paramsNameMap: $options.paramsNameMap
6326
6367
  }, { ref_for: true }, _ctx.$props, {
6368
+ "is-log-scale": $options.isLaneLogScale(lane),
6327
6369
  onContextmenu: withModifiers(($event) => $options.showContextMenu($event, line), ["prevent"]),
6328
6370
  onUpdateLine: $options.upsertLine
6329
- }), null, 16, ["line", "paramsNameMap", "onContextmenu", "onUpdateLine"])) : (openBlock(), createBlock(_component_LegendItem, mergeProps({
6371
+ }), null, 16, ["line", "paramsNameMap", "is-log-scale", "onContextmenu", "onUpdateLine"])) : (openBlock(), createBlock(_component_LegendItem, mergeProps({
6330
6372
  key: 1,
6331
6373
  line,
6332
6374
  paramsNameMap: $options.paramsNameMap
6333
6375
  }, { ref_for: true }, _ctx.$props, {
6376
+ "is-log-scale": $options.isLaneLogScale(lane),
6334
6377
  onContextmenu: withModifiers(($event) => $options.showContextMenu($event, line), ["prevent"]),
6335
6378
  onUpdateLine: $options.upsertLine
6336
- }), null, 16, ["line", "paramsNameMap", "onContextmenu", "onUpdateLine"]))
6379
+ }), null, 16, ["line", "paramsNameMap", "is-log-scale", "onContextmenu", "onUpdateLine"]))
6337
6380
  ], 2);
6338
6381
  }), 128))
6339
6382
  ]),
@@ -6440,16 +6483,18 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
6440
6483
  line,
6441
6484
  paramsNameMap: $options.paramsNameMap
6442
6485
  }, { ref_for: true }, _ctx.$props, {
6486
+ "is-log-scale": $options.isLaneLogScale(lane),
6443
6487
  onContextmenu: withModifiers(($event) => $options.showContextMenu($event, line), ["prevent"]),
6444
6488
  onUpdateLine: $options.upsertLine
6445
- }), null, 16, ["line", "paramsNameMap", "onContextmenu", "onUpdateLine"])) : (openBlock(), createBlock(_component_LegendItem, mergeProps({
6489
+ }), null, 16, ["line", "paramsNameMap", "is-log-scale", "onContextmenu", "onUpdateLine"])) : (openBlock(), createBlock(_component_LegendItem, mergeProps({
6446
6490
  key: 1,
6447
6491
  line,
6448
6492
  paramsNameMap: $options.paramsNameMap
6449
6493
  }, { ref_for: true }, _ctx.$props, {
6494
+ "is-log-scale": $options.isLaneLogScale(lane),
6450
6495
  onContextmenu: withModifiers(($event) => $options.showContextMenu($event, line), ["prevent"]),
6451
6496
  onUpdateLine: $options.upsertLine
6452
- }), null, 16, ["line", "paramsNameMap", "onContextmenu", "onUpdateLine"]))
6497
+ }), null, 16, ["line", "paramsNameMap", "is-log-scale", "onContextmenu", "onUpdateLine"]))
6453
6498
  ], 2);
6454
6499
  }), 128))
6455
6500
  ]),
@@ -6550,7 +6595,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
6550
6595
  }, 8, ["modelValue", "onClose"])
6551
6596
  ], 544);
6552
6597
  }
6553
- const KdLaneContainerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-afde8956"]]);
6598
+ const KdLaneContainerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-9d96e270"]]);
6554
6599
  const SLIDER_GROUP_ID = "depthSliderGroup";
6555
6600
  function pad2(n) {
6556
6601
  return n < 10 ? "0" + n : "" + n;
@@ -6683,10 +6728,12 @@ const _sfc_main$5 = {
6683
6728
  yName: curveConfig.yName,
6684
6729
  xCode,
6685
6730
  yCode,
6686
- data: this.cachedCurveData.map((item) => ({
6687
- time: item[xCode] || item.timestamp,
6688
- value: item[yCode] || 0
6689
- }))
6731
+ data: markRaw(
6732
+ this.cachedCurveData.map((item) => ({
6733
+ time: item[xCode] || item.timestamp,
6734
+ value: item[yCode] || 0
6735
+ }))
6736
+ )
6690
6737
  };
6691
6738
  })
6692
6739
  };
@@ -6732,24 +6779,28 @@ const _sfc_main$5 = {
6732
6779
  await this.$nextTick();
6733
6780
  if (newVal.type === "replace") {
6734
6781
  this.cachedCurveData = [];
6735
- let processedData = newVal && newVal.data ? Array.isArray(newVal.data) ? [...newVal.data] : [newVal.data] : [];
6782
+ let processedData = newVal && newVal.data ? Array.isArray(newVal.data) ? newVal.data : [newVal.data] : [];
6736
6783
  if (this.formCache.axisType == "time") {
6737
6784
  const axisKey = ((_c = (_b = (_a = this.getCurrentModeConfig()) == null ? void 0 : _a.datas) == null ? void 0 : _b[0]) == null ? void 0 : _c.xCode) || "timestamp";
6738
- processedData = processedData.map((item) => ({
6739
- ...item,
6740
- [axisKey]: this.toMillisecondTimestamp(item[axisKey] || item.timestamp)
6741
- }));
6742
- this.cachedCurveData = processedData;
6785
+ const firstT = processedData[0] && processedData[0][axisKey];
6786
+ if (!(typeof firstT === "number" && firstT > 1e11)) {
6787
+ processedData = processedData.map((item) => ({
6788
+ ...item,
6789
+ [axisKey]: this.toMillisecondTimestamp(item[axisKey] || item.timestamp)
6790
+ }));
6791
+ }
6792
+ this.cachedCurveData = markRaw(processedData);
6743
6793
  } else {
6744
6794
  const axisKey = ((_f = (_e = (_d = this.getCurrentModeConfig()) == null ? void 0 : _d.datas) == null ? void 0 : _e[0]) == null ? void 0 : _f.xCode) || "depth";
6745
- if (processedData[0] && processedData[0].timestamp) {
6795
+ const firstTs = processedData[0] && processedData[0].timestamp;
6796
+ if (firstTs && !(typeof firstTs === "number" && firstTs > 1e11)) {
6746
6797
  processedData = processedData.map((item) => ({
6747
6798
  ...item,
6748
6799
  timestamp: this.toMillisecondTimestamp(item.timestamp)
6749
6800
  }));
6750
- this.cachedCurveData = this.deduplicateByUniqueKey(this.cachedCurveData, processedData, "timestamp");
6801
+ this.cachedCurveData = markRaw(this.deduplicateByUniqueKey([], processedData, "timestamp"));
6751
6802
  } else {
6752
- this.cachedCurveData = this.deduplicateByUniqueKey(this.cachedCurveData, processedData, axisKey);
6803
+ this.cachedCurveData = markRaw(this.deduplicateByUniqueKey([], processedData, axisKey));
6753
6804
  }
6754
6805
  }
6755
6806
  if (this.cachedCurveData.length > 0) {
@@ -6804,11 +6855,11 @@ const _sfc_main$5 = {
6804
6855
  ...item,
6805
6856
  [axisKey]: this.toMillisecondTimestamp(item[axisKey] || item.timestamp)
6806
6857
  }));
6807
- this.cachedCurveData = this.deduplicateByUniqueKey(
6858
+ this.cachedCurveData = markRaw(this.deduplicateByUniqueKey(
6808
6859
  this.cachedCurveData,
6809
6860
  data,
6810
6861
  axisKey
6811
- );
6862
+ ));
6812
6863
  } else {
6813
6864
  data = data.map((item) => ({
6814
6865
  ...item,
@@ -6816,9 +6867,9 @@ const _sfc_main$5 = {
6816
6867
  }));
6817
6868
  if (direction === "top") {
6818
6869
  const tempData = [...data, ...this.cachedCurveData];
6819
- this.cachedCurveData = this.deduplicateByUniqueKey([], tempData, "timestamp");
6870
+ this.cachedCurveData = markRaw(this.deduplicateByUniqueKey([], tempData, "timestamp"));
6820
6871
  } else {
6821
- this.cachedCurveData = this.deduplicateByUniqueKey(this.cachedCurveData, data, "timestamp");
6872
+ this.cachedCurveData = markRaw(this.deduplicateByUniqueKey(this.cachedCurveData, data, "timestamp"));
6822
6873
  }
6823
6874
  }
6824
6875
  if (this.cachedCurveData.length > 0) {
@@ -6829,8 +6880,7 @@ const _sfc_main$5 = {
6829
6880
  this.renderChart();
6830
6881
  }
6831
6882
  },
6832
- immediate: true,
6833
- deep: true
6883
+ immediate: true
6834
6884
  },
6835
6885
  depthTimeChartData: {
6836
6886
  deep: true,
@@ -7863,7 +7913,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
7863
7913
  ], 512)
7864
7914
  ], 512);
7865
7915
  }
7866
- const DepthTimeChart = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-75a3a4e4"]]);
7916
+ const DepthTimeChart = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-9991a24b"]]);
7867
7917
  const curveExportIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAYAAACMRWrdAAAH+ElEQVRo3u1ZTWxU1xX+zpuxsRvbWLEBx6mFIcEOTWkChYZ00abdgNRKDVJRi1pVTvHYRCy6qsKilbLMoot0YRV7jGRVipSGLpAapV1UqRsSKKi0iAK1cRxIY4gJGNvEP2PPvPN1ce/7sz1vxsbTRJWvNPZ77/68c+4595zvOw9Ya2ttrZWySb6Ow4ePbpaE2/aZC0hOpNPdv17uvGS+DsfR5rqqzMtfb/mYpAhA8yKxF7aREO8ZCTF7RX/fRBjqQ2SNxXNNn3c9M5/E21eabgBYPcUAoK5qFt95+jogQtDal4SRx5ee9o+AntD0nYGEGHXJhc5CowhsV9AvQpC4+2mlvH2laUWWjlWMANSTmOaBEZlUK7kg2OHoXEb6fQUFBAGSYq2DxR7gr8iVunCsYkYAaye1LwRACAhS4Pullc9orhRxHNBIbcaSIg5A164jECrtYuKpJyICKmnfvWK9irCY0riL3T2NKMjIOSMhAoE4pGpo9wEhCQ25oQZC0z++YubZGzyAXvGKCUAIoSoiDmi2WBjspBFbBFS1ziNKqj1DDDbIuiTsCk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fc_main$3 = {
9196
9246
  const next = this.getOptionsWithTheme(options, skipClone);
9197
9247
  this._applySavedDataZoomToOptions(next, savedDataZoom);
9198
9248
  this._preserveGraphic(next);
9199
- this.delegateMethod("setOption", next, notMerge, lazyUpdate);
9249
+ this.delegateMethod("setOption", next, {
9250
+ notMerge: !!notMerge,
9251
+ lazyUpdate: !!lazyUpdate
9252
+ });
9200
9253
  this.$nextTick(() => {
9201
9254
  this._skipWatcher = false;
9202
9255
  });
@@ -9359,7 +9412,9 @@ const _sfc_main$3 = {
9359
9412
  const next = this.getOptionsWithTheme(val);
9360
9413
  this._applySavedDataZoomToOptions(next, savedDataZoom);
9361
9414
  this._preserveGraphic(next);
9362
- this.chart.setOption(next, val !== oldVal);
9415
+ this.chart.setOption(next, {
9416
+ notMerge: this.skipClone || val !== oldVal
9417
+ });
9363
9418
  if (this.group) {
9364
9419
  this.chart.group = this.group;
9365
9420
  }
@@ -9371,8 +9426,15 @@ const _sfc_main$3 = {
9371
9426
  },
9372
9427
  destroy() {
9373
9428
  this._unbindNativeDragGuard();
9429
+ if (this.__unwatchOptions) {
9430
+ this.__unwatchOptions();
9431
+ this.__unwatchOptions = null;
9432
+ }
9374
9433
  if (this.autoresize) {
9375
9434
  removeListener(this.$el, this.__resizeHandler);
9435
+ if (this.__resizeHandler && this.__resizeHandler.cancel) {
9436
+ this.__resizeHandler.cancel();
9437
+ }
9376
9438
  }
9377
9439
  this.dispose();
9378
9440
  this.chart = null;
@@ -9445,7 +9507,7 @@ const _hoisted_1$3 = { class: "echarts" };
9445
9507
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
9446
9508
  return openBlock(), createElementBlock("div", _hoisted_1$3);
9447
9509
  }
9448
- const resizeEcharts = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-0df7a705"]]);
9510
+ const resizeEcharts = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-8c9f410f"]]);
9449
9511
  const DRAW_POINT_MIN = 600;
9450
9512
  const DRAW_POINT_MAX = 1800;
9451
9513
  function getSeriesDrawThreshold(laneHeightPx) {
@@ -9836,6 +9898,7 @@ const _sfc_main$2 = {
9836
9898
  this.showTooltip = this.formCache.displayType == "float";
9837
9899
  },
9838
9900
  beforeUnmount() {
9901
+ this._isUnmounted = true;
9839
9902
  window.removeEventListener("keydown", this.handleKeyDown);
9840
9903
  window.removeEventListener("keyup", this.handleKeyUp);
9841
9904
  if (this.trendLineManager) this.trendLineManager.destroy();
@@ -9843,15 +9906,29 @@ const _sfc_main$2 = {
9843
9906
  cancelAnimationFrame(this._pointerRaf);
9844
9907
  this._pointerRaf = 0;
9845
9908
  }
9909
+ if (this._connectRaf) {
9910
+ cancelAnimationFrame(this._connectRaf);
9911
+ this._connectRaf = 0;
9912
+ }
9913
+ cancelAnimationFrame(this.animationId);
9914
+ this.animationId = null;
9915
+ if (this.debounceJudgeEdge && this.debounceJudgeEdge.cancel) {
9916
+ this.debounceJudgeEdge.cancel();
9917
+ }
9918
+ if (this.scheduleConnectAllCharts && this.scheduleConnectAllCharts.cancel) {
9919
+ this.scheduleConnectAllCharts.cancel();
9920
+ }
9846
9921
  this._pendingPointer = null;
9847
9922
  this.unbindChartPointerSync();
9848
9923
  echarts.disConnect(this.group);
9849
9924
  this.clearEcharts();
9850
9925
  if (this.resizeObserver) {
9851
9926
  this.resizeObserver.disconnect();
9927
+ this.resizeObserver = null;
9852
9928
  }
9853
9929
  if (this.resizeTimeout) {
9854
9930
  clearTimeout(this.resizeTimeout);
9931
+ this.resizeTimeout = null;
9855
9932
  }
9856
9933
  },
9857
9934
  methods: {
@@ -9872,6 +9949,10 @@ const _sfc_main$2 = {
9872
9949
  getLaneLogPlotRange(lane) {
9873
9950
  return resolveLaneLogPlotRange(lane, this.lineRange);
9874
9951
  },
9952
+ // 对数开关变化时重建该道图表,series 才能换成 lg 数据。8.24
9953
+ chartLaneKey(lane) {
9954
+ return `${lane && lane.laneId}-${isLaneLogScale(lane) ? "log" : "lin"}`;
9955
+ },
9875
9956
  // 整道 10 条竖线,样式跟普通泳道 splitLine 同一套。8.22对数轴
9876
9957
  getLogPaperGridSeries(lane, xAxisIndex, yAxisIndex) {
9877
9958
  const range = this.getLaneLogPlotRange(lane);
@@ -10207,7 +10288,7 @@ const _sfc_main$2 = {
10207
10288
  const item = Array.isArray(tip) ? tip[0] : tip;
10208
10289
  return !!(item && item.show === false);
10209
10290
  },
10210
- // 对数轴曲线 X 用 lg(x);轴是线性 lg 量程,允许负数。8.22对数轴
10291
+ // 对数轴曲线 X 用 lg(x);轴是线性 lg 量程,允许负数。不改原始行。8.24
10211
10292
  plotX(raw, isLogScale) {
10212
10293
  return isLogScale ? toLogPlotX(raw) : raw;
10213
10294
  },
@@ -10496,7 +10577,11 @@ const _sfc_main$2 = {
10496
10577
  // 联动所有泳道图表的十字准线与 tooltip(贯穿整个泳道区域)
10497
10578
  connectAllCharts() {
10498
10579
  this.$nextTick(() => {
10499
- requestAnimationFrame(() => {
10580
+ if (this._isUnmounted) return;
10581
+ if (this._connectRaf) cancelAnimationFrame(this._connectRaf);
10582
+ this._connectRaf = requestAnimationFrame(() => {
10583
+ this._connectRaf = 0;
10584
+ if (this._isUnmounted) return;
10500
10585
  const charts = this.getConnectedCharts();
10501
10586
  if (charts.length === 0) return;
10502
10587
  charts.forEach((chart) => {
@@ -10675,6 +10760,14 @@ const _sfc_main$2 = {
10675
10760
  });
10676
10761
  }
10677
10762
  this._pointerMetaGen++;
10763
+ this.flushLaneChartOption(lineId, cachedOption);
10764
+ },
10765
+ // skip-clone 浅监听可能不刷 series;对数切换时把 lg 数据直接打进图。8.24
10766
+ flushLaneChartOption(lineId, option) {
10767
+ const ref = this.getChartRefByLaneId(lineId);
10768
+ if (!ref || typeof ref.mergeOptions !== "function") return;
10769
+ if (!ref.chart || ref.chart.isDisposed()) return;
10770
+ ref.mergeOptions(option, true, false, true);
10678
10771
  },
10679
10772
  // 判断指定泳道是否应该显示tooltip内容
10680
10773
  // 地应力模式下:如果没有选中泳道,所有泳道正常显示;如果有选中泳道,只有选中的泳道显示
@@ -10726,6 +10819,14 @@ const _sfc_main$2 = {
10726
10819
  if (!Number.isFinite(min)) return { min: 0, max: 0 };
10727
10820
  return { min, max };
10728
10821
  },
10822
+ /** 井深/时间轴:没有有效轴值时不画 0、1 占位刻度。不改行数据。8.24 */
10823
+ shouldShowDepthAxisLabel(rows, axisKey) {
10824
+ if (!rows || !rows.length) return false;
10825
+ for (let i = 0; i < rows.length; i++) {
10826
+ if (Number.isFinite(Number(rows[i][axisKey]))) return true;
10827
+ }
10828
+ return false;
10829
+ },
10729
10830
  getGroupAxisExtents(groups, axisKey) {
10730
10831
  const extents = [];
10731
10832
  let totalRange = 0;
@@ -10812,12 +10913,15 @@ const _sfc_main$2 = {
10812
10913
  const h = this.$refs.chartContainer && this.$refs.chartContainer.getLaneHeightPx && this.$refs.chartContainer.getLaneHeightPx() || 400;
10813
10914
  return getSeriesDrawThreshold(h);
10814
10915
  },
10815
- /** 地应力全量进图不抽稀;其它模式只抽稀进图点。8.24 */
10916
+ /** 地应力也只画窗口抽稀点;数值仍从原始行取。8.24 */
10816
10917
  plotSeriesForDraw(data, isLogScale) {
10817
10918
  const plotted = this.plotSeries(data, isLogScale);
10818
- if (this.isGeomechanical) return plotted;
10819
10919
  return downsampleSeriesForDraw(plotted, this.getSeriesDrawThreshold());
10820
10920
  },
10921
+ /** 该道进图点:开了对数就用 lg 后的 X。8.24 */
10922
+ toDrawSeriesData(lane, rawPoints) {
10923
+ return this.plotSeriesForDraw(rawPoints, isLaneLogScale(lane));
10924
+ },
10821
10925
  findRowByAxisValue(axisValue) {
10822
10926
  const key = this.currentToolBarConfig.axisTypeList && this.currentToolBarConfig.axisTypeList[this.formCache.axisType] || (this.formCache.axisType === "time" ? "time" : "depth");
10823
10927
  return findNearestRow(this.visibleData, key, axisValue) || findNearestRow(this.realTimeData, key, axisValue);
@@ -10916,7 +11020,10 @@ const _sfc_main$2 = {
10916
11020
  axisKey,
10917
11021
  paramCodeMap
10918
11022
  );
10919
- data = downsampleSeriesForDraw(this.plotSeries(raw, isLog), threshold);
11023
+ data = downsampleSeriesForDraw(
11024
+ this.plotSeries(raw, isLog),
11025
+ threshold
11026
+ );
10920
11027
  groupSeriesCache.set(cacheKey, data);
10921
11028
  }
10922
11029
  return { data };
@@ -11761,7 +11868,8 @@ const _sfc_main$2 = {
11761
11868
  alignTicks: true,
11762
11869
  boundaryGap: false,
11763
11870
  axisLabel: {
11764
- show: true,
11871
+ show: this.shouldShowDepthAxisLabel(group, axisKey),
11872
+ // 无井深值不显示 0/1。8.24
11765
11873
  width: clientWidth,
11766
11874
  hideOverlap: true,
11767
11875
  height: 14,
@@ -11875,7 +11983,7 @@ const _sfc_main$2 = {
11875
11983
  axisTick: { show: false }
11876
11984
  }
11877
11985
  );
11878
- const seriesSource = lineInfo.isUsed === "1" ? this.plotSeriesForDraw(groupSeriesData, isLogScale) : [];
11986
+ const seriesSource = lineInfo.isUsed === "1" ? this.toDrawSeriesData(lane, groupSeriesData) : [];
11879
11987
  const baseSeries = {
11880
11988
  laneId: lineInfo.paramId,
11881
11989
  paramId: lineInfo.paramId,
@@ -11975,7 +12083,7 @@ const _sfc_main$2 = {
11975
12083
  axisKey,
11976
12084
  paramCodeMap
11977
12085
  );
11978
- const recommendSource = lineInfo.recommendIsUsed === "1" || lineInfo.recommendIsUsed == 1 ? this.plotSeriesForDraw(recommendGroupSeriesData, isLogScale) : [];
12086
+ const recommendSource = lineInfo.recommendIsUsed === "1" || lineInfo.recommendIsUsed == 1 ? this.toDrawSeriesData(lane, recommendGroupSeriesData) : [];
11979
12087
  const recommendSeries = {
11980
12088
  laneId: lineInfo.recommendParamId,
11981
12089
  data: recommendSource,
@@ -13534,6 +13642,12 @@ const _sfc_main$2 = {
13534
13642
  boundaryGap: false,
13535
13643
  interval: unifiedInterval
13536
13644
  };
13645
+ if (isDepthLane) {
13646
+ yAxisItem.axisLabel = {
13647
+ show: this.shouldShowDepthAxisLabel(group, axisKey)
13648
+ // 无井深值不显示 0/1。8.24
13649
+ };
13650
+ }
13537
13651
  const currentYAxis = currentOption.yAxis && currentOption.yAxis[gridIndex];
13538
13652
  if (!currentYAxis || currentYAxis.min !== groupMin || currentYAxis.max !== groupMax || currentYAxis.interval !== unifiedInterval) {
13539
13653
  needUpdate.yAxis = true;
@@ -13591,7 +13705,7 @@ const _sfc_main$2 = {
13591
13705
  lineInfo,
13592
13706
  axisKey
13593
13707
  );
13594
- const finalSeriesData = lineInfo.isUsed === "1" ? this.plotSeriesForDraw(seriesData, isLogScale) : [];
13708
+ const finalSeriesData = lineInfo.isUsed === "1" ? this.toDrawSeriesData(lane, seriesData) : [];
13595
13709
  needUpdate.series = true;
13596
13710
  newSeriesData.push({
13597
13711
  index: seriesIndex,
@@ -14066,7 +14180,7 @@ const _sfc_main$2 = {
14066
14180
  this.realTimeData = [];
14067
14181
  this.visibleData = [];
14068
14182
  if (!this.initialRealTimeData || !this.initialRealTimeData.data) {
14069
- this.initialRealTimeData = newVal || {};
14183
+ this.initialRealTimeData = markRaw(newVal || {});
14070
14184
  }
14071
14185
  let processedData = newVal && newVal.data || [];
14072
14186
  if (this.formCache.axisType == "time") {
@@ -14097,13 +14211,13 @@ const _sfc_main$2 = {
14097
14211
  await this.$nextTick();
14098
14212
  this.updateLanesChartOption();
14099
14213
  } else if (newVal.type === "supplementaryData") {
14100
- let data = cloneDeep(newVal && newVal.data) || [];
14214
+ let data = newVal && newVal.data || [];
14101
14215
  if (!Array.isArray(data)) {
14102
14216
  data = [data];
14103
14217
  }
14104
14218
  this.handleDataLoaded(data);
14105
14219
  } else if (newVal.type === "updateData") {
14106
- let data = cloneDeep(newVal && newVal.data) || [];
14220
+ let data = newVal && newVal.data || [];
14107
14221
  if (!Array.isArray(data)) {
14108
14222
  data = [data];
14109
14223
  }
@@ -14159,7 +14273,7 @@ const _sfc_main$2 = {
14159
14273
  this.updateLanesChartOption();
14160
14274
  } else {
14161
14275
  console.log(newVal, "newVal");
14162
- let data = cloneDeep(newVal && newVal.data) || [];
14276
+ let data = newVal && newVal.data || [];
14163
14277
  if (!Array.isArray(data)) {
14164
14278
  data = [data];
14165
14279
  }
@@ -14170,10 +14284,12 @@ const _sfc_main$2 = {
14170
14284
  ...item,
14171
14285
  [axisKey]: this.toMillisecondTimestamp(item[axisKey])
14172
14286
  }));
14173
- this.realTimeData = this.deduplicateByUniqueKey(
14174
- this.realTimeData,
14175
- data,
14176
- this.currentToolBarConfig.axisTypeList && this.currentToolBarConfig.axisTypeList[this.formCache.axisType]
14287
+ this.realTimeData = markRaw(
14288
+ this.deduplicateByUniqueKey(
14289
+ this.realTimeData,
14290
+ data,
14291
+ this.currentToolBarConfig.axisTypeList && this.currentToolBarConfig.axisTypeList[this.formCache.axisType]
14292
+ )
14177
14293
  );
14178
14294
  } else {
14179
14295
  data = data.map((item) => ({
@@ -14181,14 +14297,18 @@ const _sfc_main$2 = {
14181
14297
  timestamp: this.toMillisecondTimestamp(item.timestamp)
14182
14298
  }));
14183
14299
  if (direction === "top") {
14184
- this.realTimeData = this.uniqueByKeys(
14185
- [...data, ...this.realTimeData],
14186
- "timestamp"
14300
+ this.realTimeData = markRaw(
14301
+ this.uniqueByKeys(
14302
+ [...data, ...this.realTimeData],
14303
+ "timestamp"
14304
+ )
14187
14305
  );
14188
14306
  } else {
14189
- this.realTimeData = this.uniqueByKeys(
14190
- [...this.realTimeData, ...data],
14191
- "timestamp"
14307
+ this.realTimeData = markRaw(
14308
+ this.uniqueByKeys(
14309
+ [...this.realTimeData, ...data],
14310
+ "timestamp"
14311
+ )
14192
14312
  );
14193
14313
  }
14194
14314
  }
@@ -14206,8 +14326,7 @@ const _sfc_main$2 = {
14206
14326
  }
14207
14327
  }
14208
14328
  },
14209
- immediate: true,
14210
- deep: true
14329
+ immediate: true
14211
14330
  }
14212
14331
  }
14213
14332
  };
@@ -14283,7 +14402,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
14283
14402
  placement: "top"
14284
14403
  }, null, 8, ["min", "max"])) : createCommentVNode("", true),
14285
14404
  (openBlock(), createBlock(_component_resizeEcharts, {
14286
- key: lane.laneId,
14405
+ key: $options.chartLaneKey(lane),
14287
14406
  ref: (el) => $options.setChartRef(lane.laneId, el),
14288
14407
  autoresize: "",
14289
14408
  options: $options.getOptionsByLineId(lane.laneId),
@@ -14328,7 +14447,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
14328
14447
  placement: "top"
14329
14448
  }, null, 8, ["min", "max"])) : createCommentVNode("", true),
14330
14449
  (openBlock(), createBlock(_component_resizeEcharts, {
14331
- key: lane.laneId,
14450
+ key: $options.chartLaneKey(lane),
14332
14451
  ref: (el) => $options.setChartRef(lane.laneId, el),
14333
14452
  autoresize: "",
14334
14453
  options: $options.getOptionsByLineId(lane.laneId),
@@ -14397,7 +14516,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
14397
14516
  ])
14398
14517
  ], 544);
14399
14518
  }
14400
- const chartContainer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-5da40120"]]);
14519
+ const chartContainer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-aace7d52"]]);
14401
14520
  const _sfc_main$1 = {
14402
14521
  name: "ParameterPanel",
14403
14522
  props: {
@@ -15030,6 +15149,16 @@ const faultParameters = [
15030
15149
  paramId: ["8034"]
15031
15150
  }
15032
15151
  ];
15152
+ function holdCurveDatas(val) {
15153
+ if (!val || typeof val !== "object") {
15154
+ return markRaw({ data: markRaw([]) });
15155
+ }
15156
+ const data = Array.isArray(val.data) ? val.data : [];
15157
+ return markRaw({
15158
+ ...val,
15159
+ data: markRaw(data)
15160
+ });
15161
+ }
15033
15162
  const _sfc_main = {
15034
15163
  name: "frameLayout",
15035
15164
  components: {
@@ -15241,8 +15370,9 @@ const _sfc_main = {
15241
15370
  this.depthTimeChartData = this.WellBitDepthTimePlotConfig && this.WellBitDepthTimePlotConfig.data || [];
15242
15371
  this.initialFormCache = cloneDeep(this.currentToolBarConfig && this.currentToolBarConfig.form || {});
15243
15372
  this.formCache = cloneDeep(this.currentToolBarConfig && this.currentToolBarConfig.form || {});
15244
- this.cachedCurveDatas = cloneDeep(this.curveDatas || {});
15245
- this.initialCurveDatas = cloneDeep(this.curveDatas || {});
15373
+ this.cachedCurveDatas = holdCurveDatas(this.curveDatas);
15374
+ this.initialCurveDatas = holdCurveDatas(this.curveDatas);
15375
+ this._hasInitialCurveDatas = !!(this.curveDatas && this.curveDatas.type);
15246
15376
  let form = cloneDeep(this.currentToolBarConfig && this.currentToolBarConfig.form || {});
15247
15377
  const processedDepthConfig = this.processConfig(this.depthConfig);
15248
15378
  const processedTimeConfig = this.processConfig(this.timeConfig);
@@ -15379,13 +15509,24 @@ const _sfc_main = {
15379
15509
  this.containerWidth = this.$refs.container && this.$refs.container.offsetWidth || 800;
15380
15510
  this.initWidth();
15381
15511
  });
15382
- window.addEventListener("resize", () => {
15512
+ this._onWindowResize = () => {
15383
15513
  this.$nextTick(() => {
15514
+ if (this._isUnmounted) return;
15384
15515
  this.containerWidth = this.$refs.container && this.$refs.container.offsetWidth || 800;
15385
15516
  });
15386
- });
15517
+ };
15518
+ window.addEventListener("resize", this._onWindowResize);
15387
15519
  },
15388
15520
  methods: {
15521
+ // 延后显示图表;销毁时清掉,避免回调打到已卸载实例。8.24
15522
+ deferShowChart(fn) {
15523
+ if (this._showChartTimer) clearTimeout(this._showChartTimer);
15524
+ this._showChartTimer = setTimeout(() => {
15525
+ this._showChartTimer = null;
15526
+ if (this._isUnmounted) return;
15527
+ fn();
15528
+ }, 0);
15529
+ },
15389
15530
  // 处理单个对象,根据paramId匹配faultParameters并补充lineColor、max、min
15390
15531
  processSingleItem(item) {
15391
15532
  if (!item || !item.paramId) return;
@@ -15478,16 +15619,16 @@ const _sfc_main = {
15478
15619
  this.formCache = cloneDeep(this.initialFormCache);
15479
15620
  this.showChartContainer = false;
15480
15621
  this.enableCurveDatasWatch = false;
15481
- setTimeout(() => {
15622
+ this.deferShowChart(() => {
15482
15623
  const processedDepthConfig = this.processConfig(this.depthConfig);
15483
15624
  const processedTimeConfig = this.processConfig(this.timeConfig);
15484
15625
  this.config = this.formCache.axisType === "depth" ? processedDepthConfig : processedTimeConfig;
15485
15626
  if (JSON.stringify(this.config) !== "{}") {
15486
15627
  this.showChartContainer = true;
15487
15628
  }
15488
- this.cachedCurveDatas = cloneDeep(this.initialCurveDatas || {});
15629
+ this.cachedCurveDatas = this.initialCurveDatas;
15489
15630
  this.enableCurveDatasWatch = true;
15490
- }, 0);
15631
+ });
15491
15632
  },
15492
15633
  // 清空图表数据
15493
15634
  clearChartData() {
@@ -15534,14 +15675,14 @@ const _sfc_main = {
15534
15675
  }
15535
15676
  if (key === "axisType") {
15536
15677
  this.showChartContainer = false;
15537
- setTimeout(() => {
15678
+ this.deferShowChart(() => {
15538
15679
  const processedDepthConfig = this.processConfig(this.depthConfig);
15539
15680
  const processedTimeConfig = this.processConfig(this.timeConfig);
15540
15681
  this.config = this.formCache.axisType === "depth" ? processedDepthConfig : processedTimeConfig;
15541
15682
  if (JSON.stringify(this.config) !== "{}") {
15542
15683
  this.showChartContainer = true;
15543
15684
  }
15544
- }, 0);
15685
+ });
15545
15686
  this.$emit("updateSettings", { key, value, settings: cloneDeep(this.formCache) });
15546
15687
  }
15547
15688
  if (key === "dataType") {
@@ -15604,10 +15745,11 @@ const _sfc_main = {
15604
15745
  this.pendingEvent = e;
15605
15746
  if (!this.frameRequested) {
15606
15747
  this.frameRequested = true;
15607
- requestAnimationFrame(this.updateSize);
15748
+ this._panelResizeRaf = requestAnimationFrame(this.updateSize);
15608
15749
  }
15609
15750
  },
15610
15751
  updateSize() {
15752
+ this._panelResizeRaf = 0;
15611
15753
  const e = this.pendingEvent;
15612
15754
  if (!e) return;
15613
15755
  const dx = e.clientX - this.startX;
@@ -15670,10 +15812,19 @@ const _sfc_main = {
15670
15812
  this.isLoading = isLoading;
15671
15813
  }
15672
15814
  },
15673
- // 组件销毁时移除事件监听,防止内存泄漏
15674
15815
  beforeUnmount() {
15816
+ this._isUnmounted = true;
15817
+ window.removeEventListener("resize", this._onWindowResize);
15675
15818
  document.removeEventListener("mousemove", this.handleMove);
15676
15819
  document.removeEventListener("mouseup", this.stopResize);
15820
+ if (this._showChartTimer) {
15821
+ clearTimeout(this._showChartTimer);
15822
+ this._showChartTimer = null;
15823
+ }
15824
+ if (this._panelResizeRaf) {
15825
+ cancelAnimationFrame(this._panelResizeRaf);
15826
+ this._panelResizeRaf = 0;
15827
+ }
15677
15828
  },
15678
15829
  watch: {
15679
15830
  timeConfig: {
@@ -15682,9 +15833,9 @@ const _sfc_main = {
15682
15833
  this.showChartContainer = false;
15683
15834
  const processedConfig = this.processConfig(newVal);
15684
15835
  this.config = processedConfig;
15685
- setTimeout(() => {
15836
+ this.deferShowChart(() => {
15686
15837
  this.showChartContainer = true;
15687
- }, 0);
15838
+ });
15688
15839
  }
15689
15840
  },
15690
15841
  deep: true,
@@ -15699,9 +15850,9 @@ const _sfc_main = {
15699
15850
  this.showChartContainer = false;
15700
15851
  const processedConfig = this.processConfig(newVal);
15701
15852
  this.config = processedConfig;
15702
- setTimeout(() => {
15853
+ this.deferShowChart(() => {
15703
15854
  this.showChartContainer = true;
15704
- }, 0);
15855
+ });
15705
15856
  console.log(this.config, "depthConfig");
15706
15857
  }
15707
15858
  },
@@ -15732,23 +15883,22 @@ const _sfc_main = {
15732
15883
  deep: true,
15733
15884
  immediate: true
15734
15885
  },
15735
- // 监听curveDatas的变化
15886
+ // 只跟对象引用,不 deep 走进 markRaw 行数据。8.24
15736
15887
  curveDatas: {
15737
15888
  handler(newVal) {
15738
- if (this.enableCurveDatasWatch) {
15739
- if (JSON.stringify(this.initialCurveDatas) === "{}") {
15740
- this.initialCurveDatas = cloneDeep(newVal || {});
15741
- }
15742
- if (Object.prototype.hasOwnProperty.call(newVal, "dataType") && newVal.dataType !== this.formCache.dataType && newVal.dataType !== "" && newVal.dataType !== void 0 && newVal.dataType !== null) {
15743
- this.formCache.dataType = newVal.dataType;
15744
- if (this.$refs.functionControlPanel) {
15745
- this.$refs.functionControlPanel.form.dataType = newVal.dataType;
15746
- }
15889
+ if (!this.enableCurveDatasWatch || !newVal) return;
15890
+ if (!this._hasInitialCurveDatas && newVal.type) {
15891
+ this.initialCurveDatas = holdCurveDatas(newVal);
15892
+ this._hasInitialCurveDatas = true;
15893
+ }
15894
+ if (Object.prototype.hasOwnProperty.call(newVal, "dataType") && newVal.dataType !== this.formCache.dataType && newVal.dataType !== "" && newVal.dataType !== void 0 && newVal.dataType !== null) {
15895
+ this.formCache.dataType = newVal.dataType;
15896
+ if (this.$refs.functionControlPanel) {
15897
+ this.$refs.functionControlPanel.form.dataType = newVal.dataType;
15747
15898
  }
15748
- this.cachedCurveDatas = cloneDeep(newVal || {});
15749
15899
  }
15750
- },
15751
- deep: true
15900
+ this.cachedCurveDatas = holdCurveDatas(newVal);
15901
+ }
15752
15902
  },
15753
15903
  themeName: {
15754
15904
  handler(newVal) {
@@ -15881,7 +16031,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
15881
16031
  ])])) : createCommentVNode("", true)
15882
16032
  ]);
15883
16033
  }
15884
- const FrameLayoutComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bc2030c8"]]);
16034
+ const FrameLayoutComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-76b2334b"]]);
15885
16035
  KdLaneContainerComponent.install = function(app) {
15886
16036
  app.component(KdLaneContainerComponent.name, KdLaneContainerComponent);
15887
16037
  };