liwei 1 жил өмнө
parent
commit
0b7e3165ee

+ 3 - 1
src/modules/editor/module/actions/edit.tsx

@@ -617,12 +617,13 @@ export const editActions = EditorModule.action({
       //     comp.compKey
       //   )?.name,
       // });
+      const ddata = ctrl.toJson();
 
       const data = {
         title,
         type,
         thumbnail,
-        compMap: cloneDeep(ctrl.designData.compMap),
+        compMap: ddata.compMap,
       };
       this.helper.clearUnusedComps(data.compMap, comp.id);
       data.compMap.root = data.compMap[comp.id];
@@ -639,6 +640,7 @@ export const editActions = EditorModule.action({
       delete data.compMap[comp.id];
 
       queenApi.showLoading("保存中");
+      this.controls.uploader.ignoreDashField = true;
       await this.controls.uploader.uploadBlobs(data);
       await this.https.createComp(data);
       queenApi.messageSuccess("保存成功");

+ 2 - 2
src/modules/editor/module/helpers/index.ts

@@ -154,7 +154,7 @@ export const helpers = EditorModule.helper({
         const comp = compMap[id];
         if (!comp) return;
         used.add(id);
-        getUsedIds(comp.getChildIds());
+        getUsedIds(comp.children.default);
       });
       return used;
     };
@@ -174,7 +174,7 @@ export const helpers = EditorModule.helper({
         const comp = compMap[id];
         if (!comp) return;
         used.add(id);
-        getUsedIds(comp.getChildIds());
+        getUsedIds(comp.children.default);
       });
       return used;
     };