فهرست منبع

Merge branch 'v1.2.0-ga' of http://192.168.0.115:3000/bill/fuse-code into v1.2.0-ga

xzw 4 ماه پیش
والد
کامیت
ea07c9648f

+ 19 - 7
src/components/drawing-time/current.vue

@@ -2,7 +2,6 @@
   <v-arrow
     :ref="(r: any) => arrow[0] = r"
     :config="{
-      points: [currentX, 0, currentX, 10],
       fill: currentColor,
       stroke: currentColor,
       strokeWidth: 1,
@@ -16,12 +15,11 @@
     v-if="!hideLine"
     :ref="(r: any) => arrow[1] = r"
     :config="{
-        points: [currentX, size!.height, currentX, 10],
-        stroke: currentColor,
-        strokeWidth: 2,
-        hitStrokeWidth: 4,
-        ...currentMat
-      }"
+      stroke: currentColor,
+      strokeWidth: 2,
+      hitStrokeWidth: 4,
+      ...currentMat,
+    }"
   />
 </template>
 
@@ -92,4 +90,18 @@ watch(
     viewer.movePixel({ x: offsetX, y: 0 });
   }
 );
+
+watch(
+  () => ({
+    x: currentX.value,
+    h: size.value!.height,
+    shapes: arrow.value.map((item) => item.getNode()),
+  }),
+  ({ x, shapes }) => {
+    if (shapes[0] && shapes[1]) {
+      shapes[0].points([x, 0, x, 10]);
+      shapes[1].points([x, size.value!.height, x, 10]);
+    }
+  }
+);
 </script>

+ 2 - 2
src/components/drawing-time/time.vue

@@ -63,7 +63,7 @@ const timeRange = computed(() => {
   return { startTime, endTime };
 });
 
-const strokeWidth = 2;
+const strokeWidth = 1;
 const color = "#999";
 
 const shapeConfig = computed(() => {
@@ -95,7 +95,7 @@ const shapeConfig = computed(() => {
           .scale(invConfig.value.scaleX, 1)
           .decompose(),
         text: getText(i),
-        fontSize: strokeWidth * 6,
+        fontSize: strokeWidth * 12,
         fill: color,
         align: "left",
         verticalAlign: "top",

+ 6 - 1
src/views/animation/index.vue

@@ -215,7 +215,12 @@ const add = <T extends Active["key"]>(
   key: T,
   preset: Partial<AnimationModel[T][0]> = {}
 ) => {
-  const attr = getAddTLItemAttr(focusAM.value![key], currentTime.value, 10, 1);
+  const attr = getAddTLItemAttr(
+    focusAM.value![key],
+    currentTime.value,
+    preset.duration || 10,
+    1
+  );
   if (!attr) {
     Message.error("当前时间已存在其他" + title[key]);
   } else {

+ 10 - 0
src/views/animation/right/am.vue

@@ -89,6 +89,7 @@
                   speed: 1,
                   key: action.action,
                   name: action.title,
+                  duration: getActionDur(action.action),
                 })
               "
             />
@@ -134,6 +135,7 @@ import { Switch, Slider, TabPane, Tabs } from "ant-design-vue";
 import { AnimationModel } from "@/api";
 import SignItem from "@/views/tagging-position/sign-item.vue";
 import { computed, ref } from "vue";
+import { round } from "@/utils";
 import { paths } from "@/store/path";
 import Message from "bill/components/message/message.vue";
 import { Modal } from "ant-design-vue";
@@ -195,6 +197,14 @@ const selectPathHandler = () => {
   emit("addPath", { name, pathId: pathId.value });
   visibleSelectPath.value = false;
 };
+
+const getActionDur = (key: string) => {
+  const actions = amMap[props.am.id].am?.getSupportActions() || [];
+  const action = actions.find((item) => item.name === key);
+  if (action?.duration) {
+    return round(action?.duration);
+  }
+};
 </script>
 
 <style scoped lang="scss">