sctj-components 1.0.69 → 1.0.71

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.
@@ -9610,7 +9610,7 @@ const _sfc_main$4 = {
9610
9610
  }
9611
9611
  };
9612
9612
  const SCTJBusinessMapDrawingDialog = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d0bea808"]]);
9613
- const index_vue_vue_type_style_index_0_scoped_27971162_lang = "";
9613
+ const index_vue_vue_type_style_index_0_scoped_cceb9e08_lang = "";
9614
9614
  const _hoisted_1$2 = { class: "controls" };
9615
9615
  const _sfc_main$3 = {
9616
9616
  __name: "index",
@@ -9653,7 +9653,8 @@ const _sfc_main$3 = {
9653
9653
  required: true
9654
9654
  }
9655
9655
  },
9656
- setup(__props) {
9656
+ emits: ["moving"],
9657
+ setup(__props, { emit }) {
9657
9658
  const props = __props;
9658
9659
  const mapContainerRef = ref$1(null);
9659
9660
  const map = shallowRef(null);
@@ -9662,7 +9663,24 @@ const _sfc_main$3 = {
9662
9663
  const startMarker = ref$1(null);
9663
9664
  const endMarker = ref$1(null);
9664
9665
  const isPlaying = ref$1(false);
9666
+ const SPEED_OPTIONS = [100, 50, 25, 12.5];
9665
9667
  const playSpeed = ref$1(12.5);
9668
+ function getDefaultPlaySpeed(pointCount) {
9669
+ if (!pointCount || pointCount <= 0)
9670
+ return SPEED_OPTIONS[SPEED_OPTIONS.length - 1];
9671
+ const LOW_THRESHOLD = 100;
9672
+ const HIGH_THRESHOLD = 1500;
9673
+ if (pointCount <= LOW_THRESHOLD)
9674
+ return 100;
9675
+ if (pointCount >= HIGH_THRESHOLD)
9676
+ return 12.5;
9677
+ const linear = (pointCount - LOW_THRESHOLD) / (HIGH_THRESHOLD - LOW_THRESHOLD);
9678
+ const t = Math.pow(linear, 0.35);
9679
+ const raw = 100 - t * (100 - 12.5);
9680
+ return SPEED_OPTIONS.reduce(
9681
+ (prev, curr) => Math.abs(curr - raw) < Math.abs(prev - raw) ? curr : prev
9682
+ );
9683
+ }
9666
9684
  const passedPolyline = ref$1(null);
9667
9685
  const isPlayed = ref$1(false);
9668
9686
  let AMapInstance = null;
@@ -9753,6 +9771,7 @@ const _sfc_main$3 = {
9753
9771
  map.value.add([polyline.value, startMarker.value, endMarker.value, moveMarker.value, passedPolyline.value]);
9754
9772
  map.value.setFitView();
9755
9773
  moveMarker.value.on("moving", (e) => {
9774
+ emit("moving", e);
9756
9775
  });
9757
9776
  };
9758
9777
  const startPlay = () => {
@@ -9805,17 +9824,19 @@ const _sfc_main$3 = {
9805
9824
  if (!map.value)
9806
9825
  return;
9807
9826
  if (newVal && newVal.length > 0) {
9808
- drawTrack();
9809
- if (props.autoPlay) {
9810
- startPlay();
9811
- }
9827
+ playSpeed.value = getDefaultPlaySpeed(newVal.length);
9812
9828
  }
9813
- },
9814
- { immediate: true }
9829
+ drawTrack();
9830
+ props.autoPlay && startPlay();
9831
+ }
9815
9832
  );
9816
9833
  onMounted$1(async () => {
9817
9834
  await initMap();
9835
+ if (props.pathPoints && props.pathPoints.length > 0) {
9836
+ playSpeed.value = getDefaultPlaySpeed(props.pathPoints.length);
9837
+ }
9818
9838
  drawTrack();
9839
+ props.autoPlay && startPlay();
9819
9840
  });
9820
9841
  onBeforeUnmount(() => {
9821
9842
  if (moveMarker.value) {
@@ -9906,7 +9927,7 @@ const _sfc_main$3 = {
9906
9927
  };
9907
9928
  }
9908
9929
  };
9909
- const SCTJTrackPlayback = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-27971162"]]);
9930
+ const SCTJTrackPlayback = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-cceb9e08"]]);
9910
9931
  const BimViewer_vue_vue_type_style_index_0_scoped_89f55b38_lang = "";
9911
9932
  const _withScopeId$1 = (n) => (pushScopeId("data-v-89f55b38"), n = n(), popScopeId(), n);
9912
9933
  const _hoisted_1$1 = {