Browse Source

不实时计算时间轴标度的透明度,以减少计算量

任一存 2 years ago
parent
commit
cd7c61b40c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/views/HistoryNew.vue

+ 7 - 2
src/views/HistoryNew.vue

@@ -48,7 +48,7 @@
         :style="{
         :style="{
           width: `${timeAxisScaleWidth}px`,
           width: `${timeAxisScaleWidth}px`,
           marginRight: `${timeAxisScaleMargin}px`,
           marginRight: `${timeAxisScaleMargin}px`,
-          opacity: computeTimeAxisScaleOpacity(index),
+          // opacity: computeTimeAxisScaleOpacity(index),
         }"
         }"
       />
       />
       <div
       <div
@@ -58,7 +58,7 @@
         :style="{
         :style="{
           width: `${timeAxisScaleWidth}px`,
           width: `${timeAxisScaleWidth}px`,
           marginRight: `${timeAxisScaleMargin}px`,
           marginRight: `${timeAxisScaleMargin}px`,
-          opacity: computeTimeAxisScaleOpacity(index + timeAxisScaleRepeat),
+          // opacity: computeTimeAxisScaleOpacity(index + timeAxisScaleRepeat),
         }"
         }"
       />
       />
     </div>
     </div>
@@ -288,6 +288,11 @@ export default {
      */
      */
     let isAutoMoving = ref(false)
     let isAutoMoving = ref(false)
     let beginAutoMoveIntervalId = null
     let beginAutoMoveIntervalId = null
+    beginAutoMoveIntervalId = setInterval(() => {
+      if (moveSpeed.value === 0) {
+        isAutoMoving.value = true
+      }
+    }, 2000)
     watch(isAutoMoving, (vNew) => {
     watch(isAutoMoving, (vNew) => {
       if (vNew) {
       if (vNew) {
         moveSpeed.value = 0.03
         moveSpeed.value = 0.03