kd-lane-chart-v3 0.1.2 → 0.1.3
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 +119 -46
- package/dist/esm/index.js.map +1 -1
- package/dist/kd-lane-chart-v3.css +71 -71
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -262,7 +262,7 @@ const _sfc_main$d = {
|
|
|
262
262
|
})
|
|
263
263
|
},
|
|
264
264
|
parentElement: {
|
|
265
|
-
type:
|
|
265
|
+
type: HTMLElement,
|
|
266
266
|
default: null
|
|
267
267
|
}
|
|
268
268
|
},
|
|
@@ -371,7 +371,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
371
371
|
])
|
|
372
372
|
]);
|
|
373
373
|
}
|
|
374
|
-
const VueSimpleContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-
|
|
374
|
+
const VueSimpleContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-5e769d89"]]);
|
|
375
375
|
class CustomStrategy {
|
|
376
376
|
constructor(strategy) {
|
|
377
377
|
this.strategy = strategy;
|
|
@@ -2430,7 +2430,6 @@ const _sfc_main$9 = {
|
|
|
2430
2430
|
} else {
|
|
2431
2431
|
const treeData = [];
|
|
2432
2432
|
this.inputTempates.forEach((template) => {
|
|
2433
|
-
console.log(template, "template");
|
|
2434
2433
|
const tData = { ...template, id: template.templateId, label: template.templateName };
|
|
2435
2434
|
tData.children = [];
|
|
2436
2435
|
if (!template.lanes) {
|
|
@@ -2602,7 +2601,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2602
2601
|
[_directive_loading, $data.curveConfigLoading]
|
|
2603
2602
|
]);
|
|
2604
2603
|
}
|
|
2605
|
-
const RealTimeCurveConfig = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-
|
|
2604
|
+
const RealTimeCurveConfig = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-3338a667"]]);
|
|
2606
2605
|
const ACTION_TYPE = {
|
|
2607
2606
|
UPSERT_LINE: "upsertLine",
|
|
2608
2607
|
DELETE_LINE: "delLine"
|
|
@@ -2969,7 +2968,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2969
2968
|
])
|
|
2970
2969
|
], 4);
|
|
2971
2970
|
}
|
|
2972
|
-
const LegendItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-
|
|
2971
|
+
const LegendItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-6190e06c"]]);
|
|
2973
2972
|
const _sfc_main$6 = {
|
|
2974
2973
|
name: "KdLaneContainer",
|
|
2975
2974
|
provide() {
|
|
@@ -3239,7 +3238,9 @@ const _sfc_main$6 = {
|
|
|
3239
3238
|
const headerEl = document.getElementById(`lane-header-${lane.laneId}`);
|
|
3240
3239
|
if (headerEl) {
|
|
3241
3240
|
const id = String(lane.laneId);
|
|
3242
|
-
const
|
|
3241
|
+
const flexWidth = headerEl.clientWidth;
|
|
3242
|
+
const minWidth = lane.minWidth || 40;
|
|
3243
|
+
const newWidth = Math.max(minWidth, flexWidth);
|
|
3243
3244
|
const oldWidth = this.laneWidthOverrides[id];
|
|
3244
3245
|
if (oldWidth !== newWidth) {
|
|
3245
3246
|
this.setLaneWidthOverride(lane.laneId, newWidth);
|
|
@@ -3270,7 +3271,7 @@ const _sfc_main$6 = {
|
|
|
3270
3271
|
(l) => l.laneId === this.currentLane.laneId
|
|
3271
3272
|
);
|
|
3272
3273
|
if (laneIndex === -1) return;
|
|
3273
|
-
const minWidth = 40;
|
|
3274
|
+
const minWidth = lanes[laneIndex].minWidth || 40;
|
|
3274
3275
|
const getWidth = (lane) => this.getEffectiveLaneWidthPx(lane);
|
|
3275
3276
|
const currentLane = lanes[laneIndex];
|
|
3276
3277
|
let currentWidth = getWidth(currentLane);
|
|
@@ -3344,6 +3345,9 @@ const _sfc_main$6 = {
|
|
|
3344
3345
|
},
|
|
3345
3346
|
onLaneDragStart() {
|
|
3346
3347
|
this.isLaneDragging = true;
|
|
3348
|
+
this._laneOrderBeforeDrag = (this.currentTemplate.lanes || []).map(
|
|
3349
|
+
(l) => l.laneId
|
|
3350
|
+
);
|
|
3347
3351
|
},
|
|
3348
3352
|
onLineDragEnd() {
|
|
3349
3353
|
this.syncLinesLaneIdsFromCurrent();
|
|
@@ -3357,15 +3361,22 @@ const _sfc_main$6 = {
|
|
|
3357
3361
|
},
|
|
3358
3362
|
onLaneDragEnd() {
|
|
3359
3363
|
const lanes = this.currentTemplate.lanes || [];
|
|
3364
|
+
const currentOrder = lanes.map((l) => l.laneId);
|
|
3365
|
+
const hasChanged = !this._laneOrderBeforeDrag || this._laneOrderBeforeDrag.length !== currentOrder.length || this._laneOrderBeforeDrag.some((id, i) => id !== currentOrder[i]);
|
|
3360
3366
|
lanes.forEach((lane, index2) => {
|
|
3361
3367
|
lane.sort = index2;
|
|
3362
3368
|
});
|
|
3363
3369
|
sortLanes(lanes);
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
this.
|
|
3370
|
+
if (hasChanged) {
|
|
3371
|
+
this.notifyTemplateChangeImmediately();
|
|
3372
|
+
Promise.all(lanes.map((lane) => this.dragUpdateLane(lane))).then(() => {
|
|
3373
|
+
this.setDefaultAndNotify();
|
|
3374
|
+
this.isLaneDragging = false;
|
|
3375
|
+
});
|
|
3376
|
+
} else {
|
|
3367
3377
|
this.isLaneDragging = false;
|
|
3368
|
-
}
|
|
3378
|
+
}
|
|
3379
|
+
this._laneOrderBeforeDrag = null;
|
|
3369
3380
|
},
|
|
3370
3381
|
// 拖拽更新曲线
|
|
3371
3382
|
dragUpdateLine(data) {
|
|
@@ -4046,6 +4057,12 @@ const _sfc_main$6 = {
|
|
|
4046
4057
|
}
|
|
4047
4058
|
}
|
|
4048
4059
|
},
|
|
4060
|
+
laneDragFilter() {
|
|
4061
|
+
if (this.isGeomechanical) {
|
|
4062
|
+
return ".no-drag, .kd-lane-chart-lane-container-echart, .kd-lane-chart-container-draw-area";
|
|
4063
|
+
}
|
|
4064
|
+
return ".no-drag";
|
|
4065
|
+
},
|
|
4049
4066
|
darwAreaStyle() {
|
|
4050
4067
|
const headerStyle = this.headerStyle;
|
|
4051
4068
|
const heightNum = pxToNumber(headerStyle.height);
|
|
@@ -4076,7 +4093,7 @@ const _hoisted_6$2 = ["onMousedown"];
|
|
|
4076
4093
|
const _hoisted_7$2 = ["id", "lane-id"];
|
|
4077
4094
|
const _hoisted_8$1 = ["onMousedown"];
|
|
4078
4095
|
const _hoisted_9$1 = {
|
|
4079
|
-
key:
|
|
4096
|
+
key: 0,
|
|
4080
4097
|
class: "kd-lane-chart-lane-container-echart"
|
|
4081
4098
|
};
|
|
4082
4099
|
const _hoisted_10$1 = ["onContextmenu"];
|
|
@@ -4140,11 +4157,10 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4140
4157
|
$props.isKdCurveV2 ? (openBlock(), createElementBlock("div", _hoisted_2$5, [
|
|
4141
4158
|
renderSlot(_ctx.$slots, `slotheader-content-${lane.laneId}`, { lane }, void 0, true)
|
|
4142
4159
|
])) : createCommentVNode("", true),
|
|
4143
|
-
|
|
4144
|
-
key: 1,
|
|
4160
|
+
createElementVNode("div", {
|
|
4145
4161
|
class: "kd-lane-resize-handle kd-lane-resize-handle-right",
|
|
4146
4162
|
onMousedown: ($event) => $options.startResize($event, lane, "right")
|
|
4147
|
-
}, null, 40, _hoisted_3$4)
|
|
4163
|
+
}, null, 40, _hoisted_3$4)
|
|
4148
4164
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
4149
4165
|
createElementVNode("div", {
|
|
4150
4166
|
class: normalizeClass(["kd-lane-chart-lane-header", {
|
|
@@ -4200,11 +4216,10 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4200
4216
|
$props.isKdCurveV2 ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
4201
4217
|
renderSlot(_ctx.$slots, `content-${lane.laneId}`, { lane }, void 0, true)
|
|
4202
4218
|
])) : createCommentVNode("", true),
|
|
4203
|
-
|
|
4204
|
-
key: 1,
|
|
4219
|
+
createElementVNode("div", {
|
|
4205
4220
|
class: "kd-lane-resize-handle kd-lane-resize-handle-right",
|
|
4206
4221
|
onMousedown: ($event) => $options.startResize($event, lane, "right")
|
|
4207
|
-
}, null, 40, _hoisted_6$2)
|
|
4222
|
+
}, null, 40, _hoisted_6$2)
|
|
4208
4223
|
], 64))
|
|
4209
4224
|
], 14, _hoisted_1$6);
|
|
4210
4225
|
}), 128)),
|
|
@@ -4219,7 +4234,8 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4219
4234
|
swapThreshold: 0.65,
|
|
4220
4235
|
group: { name: "laneGroup", pull: false, put: false },
|
|
4221
4236
|
"item-key": "laneId",
|
|
4222
|
-
filter:
|
|
4237
|
+
filter: $options.laneDragFilter,
|
|
4238
|
+
axis: "x"
|
|
4223
4239
|
}, {
|
|
4224
4240
|
default: withCtx(() => [
|
|
4225
4241
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.scrollableLanes || [], (lane, index2) => {
|
|
@@ -4252,11 +4268,10 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4252
4268
|
}, [
|
|
4253
4269
|
renderSlot(_ctx.$slots, `lane${lane.laneId}`, { lane }, void 0, true)
|
|
4254
4270
|
], 4),
|
|
4255
|
-
|
|
4256
|
-
key: 0,
|
|
4271
|
+
createElementVNode("div", {
|
|
4257
4272
|
class: "kd-lane-resize-handle kd-lane-resize-handle-right",
|
|
4258
4273
|
onMousedown: ($event) => $options.startResize($event, lane, "right")
|
|
4259
|
-
}, null, 40, _hoisted_8$1)
|
|
4274
|
+
}, null, 40, _hoisted_8$1),
|
|
4260
4275
|
$props.isKdCurveV2 ? (openBlock(), createElementBlock("div", _hoisted_9$1, [
|
|
4261
4276
|
renderSlot(_ctx.$slots, `slotheader-content-${lane.laneId}`, { lane }, void 0, true)
|
|
4262
4277
|
])) : createCommentVNode("", true)
|
|
@@ -4315,17 +4330,16 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4315
4330
|
$props.isKdCurveV2 ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
|
|
4316
4331
|
renderSlot(_ctx.$slots, `content-${lane.laneId}`, { lane }, void 0, true)
|
|
4317
4332
|
])) : createCommentVNode("", true),
|
|
4318
|
-
|
|
4319
|
-
key: 1,
|
|
4333
|
+
createElementVNode("div", {
|
|
4320
4334
|
class: "kd-lane-resize-handle kd-lane-resize-handle-right",
|
|
4321
4335
|
onMousedown: ($event) => $options.startResize($event, lane, "right")
|
|
4322
|
-
}, null, 40, _hoisted_12$1)
|
|
4336
|
+
}, null, 40, _hoisted_12$1)
|
|
4323
4337
|
], 64))
|
|
4324
4338
|
], 14, _hoisted_7$2);
|
|
4325
4339
|
}), 128))
|
|
4326
4340
|
]),
|
|
4327
4341
|
_: 3
|
|
4328
|
-
}, 8, ["onStart", "onEnd", "modelValue"])
|
|
4342
|
+
}, 8, ["onStart", "onEnd", "modelValue", "filter"])
|
|
4329
4343
|
], 64)) : (openBlock(), createElementBlock("div", _hoisted_13$1, [
|
|
4330
4344
|
createElementVNode("div", {
|
|
4331
4345
|
class: normalizeClass(["kd-lane-chart-lane-header", { "kd-lane-chart-lane-header-isKdCurveV2": $props.isKdCurveV2 }]),
|
|
@@ -4407,7 +4421,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4407
4421
|
}, 8, ["modelValue", "onClose"])
|
|
4408
4422
|
], 544);
|
|
4409
4423
|
}
|
|
4410
|
-
const KdLaneContainerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
|
4424
|
+
const KdLaneContainerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-dcac42f7"]]);
|
|
4411
4425
|
const SLIDER_GROUP_ID = "depthSliderGroup";
|
|
4412
4426
|
function pad2(n) {
|
|
4413
4427
|
return n < 10 ? "0" + n : "" + n;
|
|
@@ -6968,6 +6982,41 @@ const _sfc_main$3 = {
|
|
|
6968
6982
|
}
|
|
6969
6983
|
},
|
|
6970
6984
|
methods: {
|
|
6985
|
+
// 保存 dataZoom 状态,用于 setOption 后恢复
|
|
6986
|
+
_saveDataZoomState() {
|
|
6987
|
+
if (!this.chart || this.chart.isDisposed()) return null;
|
|
6988
|
+
try {
|
|
6989
|
+
const option = this.chart.getOption();
|
|
6990
|
+
if (option && option.dataZoom && option.dataZoom.length > 0) {
|
|
6991
|
+
return option.dataZoom.map((dz) => ({
|
|
6992
|
+
start: dz.start,
|
|
6993
|
+
end: dz.end,
|
|
6994
|
+
startValue: dz.startValue,
|
|
6995
|
+
endValue: dz.endValue
|
|
6996
|
+
}));
|
|
6997
|
+
}
|
|
6998
|
+
} catch (e) {
|
|
6999
|
+
}
|
|
7000
|
+
return null;
|
|
7001
|
+
},
|
|
7002
|
+
_restoreDataZoomState(savedState) {
|
|
7003
|
+
if (!savedState || !this.chart || this.chart.isDisposed()) return;
|
|
7004
|
+
try {
|
|
7005
|
+
const currentOption = this.chart.getOption();
|
|
7006
|
+
if (!currentOption.dataZoom || currentOption.dataZoom.length === 0) return;
|
|
7007
|
+
savedState.forEach((state, i) => {
|
|
7008
|
+
if (i < currentOption.dataZoom.length) {
|
|
7009
|
+
const dz = currentOption.dataZoom[i];
|
|
7010
|
+
if (state.start !== void 0) dz.start = state.start;
|
|
7011
|
+
if (state.end !== void 0) dz.end = state.end;
|
|
7012
|
+
if (state.startValue !== void 0) dz.startValue = state.startValue;
|
|
7013
|
+
if (state.endValue !== void 0) dz.endValue = state.endValue;
|
|
7014
|
+
}
|
|
7015
|
+
});
|
|
7016
|
+
this.chart.setOption({ dataZoom: currentOption.dataZoom });
|
|
7017
|
+
} catch (e) {
|
|
7018
|
+
}
|
|
7019
|
+
},
|
|
6971
7020
|
// provide an explicit merge option method
|
|
6972
7021
|
mergeOptions(options, notMerge, lazyUpdate, skipClone) {
|
|
6973
7022
|
if (this.manualUpdate) {
|
|
@@ -6977,7 +7026,11 @@ const _sfc_main$3 = {
|
|
|
6977
7026
|
this.init(options);
|
|
6978
7027
|
} else {
|
|
6979
7028
|
this._skipWatcher = true;
|
|
7029
|
+
const savedDataZoom = this._saveDataZoomState();
|
|
6980
7030
|
this.delegateMethod("setOption", this.getOptionsWithTheme(options, skipClone), notMerge, lazyUpdate);
|
|
7031
|
+
if (savedDataZoom) {
|
|
7032
|
+
this._restoreDataZoomState(savedDataZoom);
|
|
7033
|
+
}
|
|
6981
7034
|
this.$nextTick(() => {
|
|
6982
7035
|
this._skipWatcher = false;
|
|
6983
7036
|
});
|
|
@@ -7129,7 +7182,11 @@ const _sfc_main$3 = {
|
|
|
7129
7182
|
if (!this.chart) {
|
|
7130
7183
|
this.init(val);
|
|
7131
7184
|
} else {
|
|
7185
|
+
const savedDataZoom = this._saveDataZoomState();
|
|
7132
7186
|
this.chart.setOption(this.getOptionsWithTheme(val), val !== oldVal);
|
|
7187
|
+
if (savedDataZoom) {
|
|
7188
|
+
this._restoreDataZoomState(savedDataZoom);
|
|
7189
|
+
}
|
|
7133
7190
|
if (this.group) {
|
|
7134
7191
|
this.chart.group = this.group;
|
|
7135
7192
|
}
|
|
@@ -7213,7 +7270,7 @@ const _hoisted_1$3 = { class: "echarts" };
|
|
|
7213
7270
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7214
7271
|
return openBlock(), createElementBlock("div", _hoisted_1$3);
|
|
7215
7272
|
}
|
|
7216
|
-
const resizeEcharts = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
7273
|
+
const resizeEcharts = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-137d625e"]]);
|
|
7217
7274
|
const _sfc_main$2 = {
|
|
7218
7275
|
name: "LineChartContainer",
|
|
7219
7276
|
components: {
|
|
@@ -7743,11 +7800,13 @@ const _sfc_main$2 = {
|
|
|
7743
7800
|
if (scaleValues.length === 0) return;
|
|
7744
7801
|
const minScale = Math.min(...scaleValues);
|
|
7745
7802
|
const maxScale = Math.max(...scaleValues);
|
|
7803
|
+
const safeCm = this.pxToCm();
|
|
7804
|
+
const safeDepthInterval = this.depthInterval || 1;
|
|
7746
7805
|
this.minWindowSize = Math.round(
|
|
7747
|
-
|
|
7806
|
+
safeCm * (+minScale / safeDepthInterval)
|
|
7748
7807
|
);
|
|
7749
7808
|
this.maxWindowSize = Math.round(
|
|
7750
|
-
|
|
7809
|
+
safeCm * (+maxScale / safeDepthInterval)
|
|
7751
7810
|
);
|
|
7752
7811
|
this.updateSettings({
|
|
7753
7812
|
key: "scale",
|
|
@@ -7800,11 +7859,12 @@ const _sfc_main$2 = {
|
|
|
7800
7859
|
// 将当前页面px转换为cm
|
|
7801
7860
|
pxToCm() {
|
|
7802
7861
|
const container = this.$refs.targetDom;
|
|
7862
|
+
if (!container) return 4;
|
|
7803
7863
|
const rect = container.getBoundingClientRect();
|
|
7804
7864
|
const headerHeight = this.$refs.chartContainer && this.$refs.chartContainer.getLaneHeightPx() || 0;
|
|
7805
7865
|
const px = rect.height - headerHeight;
|
|
7806
7866
|
const cm = px / 25;
|
|
7807
|
-
return cm;
|
|
7867
|
+
return cm > 0 ? cm : 4;
|
|
7808
7868
|
},
|
|
7809
7869
|
// 获取当前可见数据的x轴范围
|
|
7810
7870
|
getXAxisRangeByHeader(lineInfo, validData = []) {
|
|
@@ -7981,6 +8041,7 @@ const _sfc_main$2 = {
|
|
|
7981
8041
|
},
|
|
7982
8042
|
// 处理鼠标滚轮事件
|
|
7983
8043
|
handleWheel(e) {
|
|
8044
|
+
if (this.isGeomechanical) return;
|
|
7984
8045
|
e.preventDefault();
|
|
7985
8046
|
const dataLength = this.realTimeData && this.realTimeData.length || 0;
|
|
7986
8047
|
this.wheelDelta = Math.sign(e.deltaY);
|
|
@@ -8132,14 +8193,20 @@ const _sfc_main$2 = {
|
|
|
8132
8193
|
// 处理工具栏设置变更
|
|
8133
8194
|
async updateSettings(settings) {
|
|
8134
8195
|
if (settings.key === "displayType") {
|
|
8196
|
+
cancelAnimationFrame(this.animationId);
|
|
8135
8197
|
this.toggleTooltip(settings.value == "float");
|
|
8136
8198
|
}
|
|
8137
8199
|
if (settings.key === "scale") {
|
|
8200
|
+
cancelAnimationFrame(this.animationId);
|
|
8201
|
+
this.targetStartIndex = this.startIndex;
|
|
8138
8202
|
this.scaleToDataSize(settings.value);
|
|
8203
|
+
this.targetWindowSize = this.windowSize;
|
|
8204
|
+
this.targetStartIndex = this.startIndex;
|
|
8139
8205
|
await this.$nextTick();
|
|
8140
8206
|
this.updateLanesChartOption();
|
|
8141
8207
|
}
|
|
8142
8208
|
if (settings.key === "depthRange" || settings.key === "timeRange") {
|
|
8209
|
+
cancelAnimationFrame(this.animationId);
|
|
8143
8210
|
if (this.realTimeData.length > 0) {
|
|
8144
8211
|
const axisType = this.formCache.axisType;
|
|
8145
8212
|
const axisKey = this.currentToolBarConfig.axisTypeList && this.currentToolBarConfig.axisTypeList[axisType];
|
|
@@ -8422,7 +8489,7 @@ const _sfc_main$2 = {
|
|
|
8422
8489
|
type: "inside",
|
|
8423
8490
|
orient: "vertical",
|
|
8424
8491
|
filterMode: "none",
|
|
8425
|
-
disabled:
|
|
8492
|
+
disabled: !this.isGeomechanical
|
|
8426
8493
|
}
|
|
8427
8494
|
],
|
|
8428
8495
|
tooltip: {
|
|
@@ -8432,6 +8499,7 @@ const _sfc_main$2 = {
|
|
|
8432
8499
|
axisPointer: {
|
|
8433
8500
|
type: "line",
|
|
8434
8501
|
axis: "y",
|
|
8502
|
+
z: 999,
|
|
8435
8503
|
snap: true,
|
|
8436
8504
|
label: {
|
|
8437
8505
|
backgroundColor: `${getCssVariable("--kd-lane-container-border-color")}99`,
|
|
@@ -10179,15 +10247,12 @@ const _sfc_main$2 = {
|
|
|
10179
10247
|
if (!areaItem.data || areaItem.data.length < 2) continue;
|
|
10180
10248
|
if (lineInfo.laneId !== this.activeLaneId && areaItem.type === "markArea")
|
|
10181
10249
|
continue;
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
}
|
|
10189
|
-
const startData = areaItem.data[0];
|
|
10190
|
-
const endData = areaItem.data[1];
|
|
10250
|
+
const hasTimestamp = areaItem.data[0].timestamp;
|
|
10251
|
+
const sortedData = hasTimestamp ? [...areaItem.data].sort(
|
|
10252
|
+
(a, b) => this.toMillisecondTimestamp(a.timestamp) - this.toMillisecondTimestamp(b.timestamp)
|
|
10253
|
+
) : [...areaItem.data].sort((a, b) => Number(a[axisKey]) - Number(b[axisKey]));
|
|
10254
|
+
const startData = sortedData[0];
|
|
10255
|
+
const endData = sortedData[1];
|
|
10191
10256
|
console.log("startData", startData, "endData", endData);
|
|
10192
10257
|
let startY, endY;
|
|
10193
10258
|
if (this.formCache.axisType === "depth") {
|
|
@@ -10237,6 +10302,8 @@ const _sfc_main$2 = {
|
|
|
10237
10302
|
const diff = Number(d[axisKey]) - Number(endDepth);
|
|
10238
10303
|
if (diff <= 0) {
|
|
10239
10304
|
closestEndItem = d;
|
|
10305
|
+
} else {
|
|
10306
|
+
break;
|
|
10240
10307
|
}
|
|
10241
10308
|
}
|
|
10242
10309
|
if (closestEndItem) {
|
|
@@ -10282,6 +10349,8 @@ const _sfc_main$2 = {
|
|
|
10282
10349
|
const diff = this.toMillisecondTimestamp(d[axisKey]) - endTimeMs;
|
|
10283
10350
|
if (diff < 0) {
|
|
10284
10351
|
closestEndItem = d;
|
|
10352
|
+
} else {
|
|
10353
|
+
break;
|
|
10285
10354
|
}
|
|
10286
10355
|
}
|
|
10287
10356
|
endY = closestEndItem ? endTimeMs : null;
|
|
@@ -10847,16 +10916,18 @@ const _sfc_main$2 = {
|
|
|
10847
10916
|
if (typeof scale == "string") {
|
|
10848
10917
|
scale = +scale.replace("1:", "") / 100;
|
|
10849
10918
|
}
|
|
10850
|
-
|
|
10919
|
+
const safeCm = this.pxToCm();
|
|
10920
|
+
const safeDepthInterval = this.depthInterval || 1;
|
|
10921
|
+
let size = Math.round(safeCm * (+scale / safeDepthInterval));
|
|
10851
10922
|
let maxSize = Math.max(
|
|
10852
|
-
Math.round(
|
|
10923
|
+
Math.round(safeCm * (1 / safeDepthInterval)),
|
|
10853
10924
|
this.realTimeData.length
|
|
10854
10925
|
);
|
|
10855
10926
|
if (size < maxSize) {
|
|
10856
10927
|
this.windowSize = size;
|
|
10857
10928
|
} else {
|
|
10858
10929
|
this.windowSize = maxSize;
|
|
10859
|
-
let newsize = Math.round(maxSize /
|
|
10930
|
+
let newsize = Math.round(maxSize / safeCm * safeDepthInterval);
|
|
10860
10931
|
let data = ((_b = (_a = this.currentToolBarConfig) == null ? void 0 : _a.scaleList) == null ? void 0 : _b.map((item) => item.value)) || [];
|
|
10861
10932
|
this.$emit(
|
|
10862
10933
|
"updateScale",
|
|
@@ -10983,7 +11054,9 @@ const _sfc_main$2 = {
|
|
|
10983
11054
|
}
|
|
10984
11055
|
if (newVal && this.formCache.axisType == "depth") {
|
|
10985
11056
|
let data = ((_b = (_a = this.currentToolBarConfig) == null ? void 0 : _a.scaleList) == null ? void 0 : _b.map((item) => item.value)) || [];
|
|
10986
|
-
|
|
11057
|
+
const safeCm = this.pxToCm();
|
|
11058
|
+
const safeDepthInterval = this.depthInterval || 1;
|
|
11059
|
+
let size = Math.round(newVal * safeDepthInterval / safeCm) < Math.max(...data) ? Math.round(newVal * safeDepthInterval / safeCm) : Math.max(...data);
|
|
10987
11060
|
this.$emit(
|
|
10988
11061
|
"updateScale",
|
|
10989
11062
|
data.includes(size) ? size : `1:${size * 100}`
|
|
@@ -11341,7 +11414,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11341
11414
|
])
|
|
11342
11415
|
], 512);
|
|
11343
11416
|
}
|
|
11344
|
-
const chartContainer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
11417
|
+
const chartContainer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-fa130d62"]]);
|
|
11345
11418
|
const _sfc_main$1 = {
|
|
11346
11419
|
name: "ParameterPanel",
|
|
11347
11420
|
props: {
|