Pārlūkot izejas kodu

修复解组bug

liwei 1 gadu atpakaļ
vecāks
revīzija
5e400af15d

+ 3 - 1
src/modules/editor/controllers/SelectCtrl/index.ts

@@ -180,6 +180,8 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
   onDocMouseDown(e: MouseEvent) {
     this._mouseDownTimestamp = Date.now();
     if (e.button != 0 || !this.pageEl || !this.selCanvas || this.controls.editorCtrl.isMoving() ) return;
+    const id = this.getDivId(e.target as any);
+    if (id == "toolbar") return;
 
     document.addEventListener("mousemove", this.onDocMouseMove, {
       capture: true,
@@ -279,7 +281,7 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
       }
     } while (c);
   }
-
+  
   getDivTransformFlag(div: HTMLElement) {
     const id = this.getDivId(div);
     if (!id) return "";

+ 4 - 0
src/modules/editor/module/actions/edit.tsx

@@ -1019,6 +1019,10 @@ export const editActions = EditorModule.action({
       (item) => item != groupComp.id
     );
     parentChilds.push(...childs);
+    const page = this.controls.pageCtrl;
+    childs.forEach(item=>{
+      page.setCompPid(item, card.id);
+    })
     card.children.setDefault(parentChilds);
     this.controls.editorCtrl.clickPickComp(childs[0]);