bill 4 月之前
父節點
當前提交
dbd378abc4

+ 15 - 9
src/views/animation/bottom.vue

@@ -81,15 +81,15 @@
               :itemsRenderer="prop.component"
               @update="({ ndx, time }) => (am![prop.attr][ndx].time = time)"
               @add="
-                  (item) => {
-                    am![prop.attr].push({...item, id: onlyId()});
-                    $emit('update:active', {
-                      key: prop.attr,
-                      ndx: am![prop.attr].length - 1,
-                    });
-                  }
-                "
-              @del="(ndx) => am![prop.attr].splice(ndx, 1)"
+                (item) => {
+                  am![prop.attr].push({ ...item, id: onlyId() });
+                  $emit('update:active', {
+                    key: prop.attr,
+                    ndx: am![prop.attr].length - 1,
+                  });
+                }
+              "
+              @del="(ndx) => { if (prop.attr === active?.key && active.ndx === ndx) $emit('update:active', undefined); am![prop.attr].splice(ndx, 1); }"
               :active="prop.attr === active?.key ? am[prop.attr][active.ndx] : undefined"
               @update:active="(active: any) => $emit('update:active', active && { key: prop.attr, ndx: am![prop.attr].indexOf(active) })"
             />
@@ -189,14 +189,17 @@ watch(
   height: 40px;
   align-items: center;
   border-bottom: 1px solid rgba(255, 255, 255, 0.16);
+
   .play-bar {
     flex: 1;
     display: flex;
     justify-content: center;
+
     .icon {
       font-size: 16px;
     }
   }
+
   .scale-bar {
     width: 180px;
     flex: 0 0 auto;
@@ -204,6 +207,7 @@ watch(
     align-items: center;
     padding: 0 20px;
     position: relative;
+
     &::before {
       content: "";
       position: absolute;
@@ -216,12 +220,14 @@ watch(
     .slider {
       flex: 1;
     }
+
     .icon {
       margin: 0 5px;
       font-size: 16px;
     }
   }
 }
+
 .oper-bar {
   height: calc(100% - 40px);
 }

+ 4 - 3
src/views/animation/right/action.vue

@@ -17,12 +17,12 @@
         </ui-group-option>
         <ui-group-option>
           <SignItem label="幅度" not-apply>
-            <Slider v-model:value="data.amplitude" :min="0" :max="1" :step="0.1" />
+            <Slider v-model:value="data.amplitude" :min="0.1" :max="1" :step="0.1" />
           </SignItem>
         </ui-group-option>
         <ui-group-option>
           <SignItem label="速度" not-apply>
-            <Slider v-model:value="data.speed" :min="0.5" :max="60" :step="0.1" />
+            <Slider v-model:value="data.speed" :min="0.1" :max="10" :step="0.1" />
           </SignItem>
         </ui-group-option>
 
@@ -35,7 +35,8 @@
               ref="nameInput"
               placeholder="请输入"
               :modelValue="data.duration"
-              @update:modelValue="(dur: number) => $emit('updateDuration', dur)"
+              :min="0.1"
+              @change="(ev: any) => $emit('updateDuration', Math.max(0.1, Number(ev.target.value)))"
             />
             S
           </span>

+ 3 - 1
src/views/animation/right/path.vue

@@ -36,9 +36,11 @@
             <ui-input
               width="75px"
               type="number"
+              ref="nameInput"
               placeholder="请输入"
               :modelValue="data.duration"
-              @update:modelValue="(dur: number) => $emit('updateDuration', dur)"
+              :min="0.1"
+              @change="(ev: any) => $emit('updateDuration', Math.max(0.1, Number(ev.target.value)))"
             />
             S
           </span>

+ 3 - 1
src/views/animation/right/subtitle.vue

@@ -36,9 +36,11 @@
             <ui-input
               width="75px"
               type="number"
+              ref="nameInput"
               placeholder="请输入"
               :modelValue="data.duration"
-              @update:modelValue="(dur: number) => $emit('updateDuration', dur)"
+              :min="0.1"
+              @change="(ev: any) => $emit('updateDuration', Math.max(0.1, Number(ev.target.value)))"
             />
             S
           </span>