Procházet zdrojové kódy

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

xzw před 4 měsíci
rodič
revize
06b0c8aa85

+ 12 - 2
src/hook/ids.ts

@@ -5,6 +5,7 @@ export const useSelects = <T extends { id: any }>(items: Ref<T[]>, test = false)
   const selects = ref<T[]>([]);
 
   const updateSelect = (item: T, select: boolean) => {
+    console.error('select', item.id, select)
     const ndx = selects.value.findIndex((s) => s.id === item.id);
     if (select) {
       ~ndx || selects.value.push(item as any);
@@ -13,10 +14,17 @@ export const useSelects = <T extends { id: any }>(items: Ref<T[]>, test = false)
     }
   };
   const updateSelectId = (id: any, select: boolean) => {
-    console.log('===>', id)
+    console.log('===>', [...items.value], id, select)
     const item = items.value.find((s) => s.id === id);
     console.log('===>', item)
-    item && updateSelect(item, select);
+    if (item) {
+      updateSelect(item, select);
+    } else {
+      const ndx = selects.value.findIndex((s) => s.id === id);
+      if (~ndx) {
+        selects.value.splice(ndx, 1);
+      } 
+    }
   };
 
   const oldItems: T[] = [];
@@ -27,6 +35,7 @@ export const useSelects = <T extends { id: any }>(items: Ref<T[]>, test = false)
         items.map((item) => item.id),
         oldItems.map((item) => item.id)
       );
+      console.error([...items], 'itemChange', added, deleted)
       added.forEach((id) => updateSelectId(id, true));
       deleted.forEach((id) => updateSelectId(id, false));
       oldItems.length = 0;
@@ -41,6 +50,7 @@ export const useSelects = <T extends { id: any }>(items: Ref<T[]>, test = false)
     all: computed({
       get: () => items.value.length === selects.value.length,
       set: (select: boolean) => {
+        console.error('select', select)
         items.value.forEach(item => updateSelect(item, select))
       } 
     }),

+ 2 - 0
src/layout/show/index.vue

@@ -48,6 +48,7 @@ import {
   initialPaths,
   initMonitors,
 } from "@/store";
+import { initialAnimationModels } from "@/store/animation";
 
 const hasSingle = new URLSearchParams(location.search).has("single");
 
@@ -70,6 +71,7 @@ const initialSys = async () => {
     initialTaggings(),
     initialGuides(),
     initMonitors(),
+    initialAnimationModels(),
   ]);
   await initialPaths();
   await initialMeasures();

+ 1 - 1
src/views/guide/path/edit.vue

@@ -15,7 +15,7 @@
     <div v-for="path in paths" :key="path.id" class="path-item">
       <ui-input
         type="checkbox"
-        :modelValue="selects.includes(path)"
+        :modelValue="selects.some((item) => item.id === path.id)"
         @update:modelValue="(select: boolean) => updateSelect(path, select)"
       />
       <PathSign

+ 1 - 1
src/views/merge/index.vue

@@ -173,7 +173,7 @@ useViewStack(() =>
           unMount = useRMenus(pixel, [
             {
               label: "移动到这里",
-              icon: "close",
+              icon: "move",
               handler() {
                 getSceneModel(custom.currentModel!)?.moveModelTo(pixel, pos?.worldPos);
               },