瀏覽代碼

feat: 修改bug

bill 3 周之前
父節點
當前提交
358180bc49

+ 1 - 1
profile/.env.xmfire

@@ -12,4 +12,4 @@ VITE_FUSE_VIEW='https://mix3d.4dkankan.com/'
 VITE_LOGIN_VIEW='https://test-mix3d.4dkankan.com/xmfire/index.html?redirect={redirect}#login'
 
 VITE_BUILD_DIR="xmfire"
-VITE_ICO="./icos/xmfire.ico"
+VITE_ICO="./icos/xmfire.png"

+ 1 - 1
profile/.env.xmfiretest

@@ -15,4 +15,4 @@ VITE_FUSE_VIEW='https://test-mix3d.4dkankan.com/'
 VITE_LOGIN_VIEW='https://test-mix3d.4dkankan.com/xmfire/index.html?redirect={redirect}#login'
 
 VITE_BUILD_DIR="xmfire"
-VITE_ICO="./icos/xmfire.ico"
+VITE_ICO="./icos/xmfire.png"

+ 8 - 3
src/core/components/group/group.vue

@@ -90,13 +90,18 @@ const changePropertyHandler = () => {
   history.onceTrack(() => {
     for (const item of setPropertyDatas.value) {
       const belong = getShapeBelong(item.id);
-      // getShapeBelong(item.id)
-      if (belong?.type) {
+      console.log(belong?.type);
+
+      if (belong?.item.id === item.id) {
         store.setItem(belong.type, { value: item, id: belong.item.id });
+      } else {
+        history.push(
+          JSON.stringify({ ...store.data, __currentLayer: store.currentLayer })
+        );
       }
     }
   });
-}; 
+};
 
 const { shape, tData, data } = useComponentStatus<Rect, GroupData>({
   emit,

+ 0 - 1
src/core/components/image/image.vue

@@ -49,7 +49,6 @@ const { shape, tData, data, operateMenus, describes } = useComponentStatus<
       },
       getRepShape(shape) {
         const imgShape = (shape as Group).findOne(".repShape") as Image;
-        console.log("---->", imgShape, shape);
         const rect = new Rect();
         const update = () => {
           rect.width(imgShape.width());

+ 1 - 2
src/core/components/line/single-point.vue

@@ -2,11 +2,10 @@
   <template v-for="(point, ndx) in points" :key="point.id">
     <!-- <v-text :text="point.id" :x="point.x" :y="point.y" :fontSize="18" /> -->
     <EditPoint
-      v-if="showEditPoint"
       :ref="(r: any) => shapes[ndx] = r?.shape"
       :size="line.strokeWidth"
       :points="points"
-      :opacity="1"
+      :opacity="showEditPoint ? 1 : 0"
       :drawIng="isDrawIng ? (drawMode ? point === drawMode : ndx === 1) : false"
       :ndx="ndx"
       :closed="false"

+ 6 - 2
src/core/hook/use-selection.ts

@@ -237,7 +237,11 @@ export const useStoreSelectionManage = installGlobalVar((): SelectionManage => {
 
   const canSelect = (shape: EntityShape) => {
     const id = shape.id();
-    return !!(id && store.items.some((item) => item.id === id));
+    if (!id) {
+      return false
+    }
+    const item = store.items.find((item) => item.id === id)
+    return !!(item && !item.lock);
   };
   const listener = (shape: EntityShape) => {
     const bus: SelectionManageBus = mitt();
@@ -304,7 +308,7 @@ export const useSelectionRevise = () => {
       }
     }
   );
-  useShapesIcon(computed(() => status.selects.concat(rectSelects.value || [])));
+  useShapesIcon(computed(() => status.selects));
 
   const filterSelect = debounce(() => {
     const selects = new Set<EntityShape>();

+ 0 - 1
src/core/hook/use-status.ts

@@ -1,7 +1,6 @@
 import { computed, reactive } from "vue";
 import { installGlobalVar, stackVar, useDownKeys, useStage } from "./use-global-vars";
 import { Mode } from "@/constant/mode";
-import { useInteractiveAdd } from "./use-draw";
 import { useInteractiveProps } from "./use-interactive";
 
 

+ 1 - 0
src/core/hook/use-transformer.ts

@@ -256,6 +256,7 @@ export const useShapeDrag = (shape: Ref<DC<EntityShape> | undefined>) => {
 
     let start: Pos | undefined;
     const enter = (position: Pos) => {
+      console.log('enter')
       mode.push(Mode.update);
       if (!start) {
         start = position;

+ 1 - 0
src/core/renderer-three/env/ground.vue

@@ -72,6 +72,7 @@ const ground = new Mesh(geometry, material);
 ground.receiveShadow = true;
 ground.name = subgroupName;
 ground.scale.set(size.x, size.y, 1);
+ground.position.set(bbox.value.center.x, -0.01, bbox.value.center.y);
 ground.rotateX(-Math.PI / 2);
 
 useTree().value = ground;

+ 4 - 0
src/core/store/store.ts

@@ -126,7 +126,11 @@ export const useStoreRaw = defineStore("draw-data", {
       const ndx = this.getItemNdx(type, playData.id);
       if (~ndx) {
         this.$patch(() => {
+          console.log()
+          const old = typeItems[type]![ndx]
           Object.assign(typeItems[type]![ndx], playData.value);
+          const newv = typeItems[type]![ndx]
+          console.log(old === newv)
         });
       }
     },

+ 1 - 0
src/example/fuse/enter.ts

@@ -313,6 +313,7 @@ const getTableTemp = () => {
   if (!title) {
     title = "默认标题";
   }
+  console.log(table, title)
   return { table, title };
 };