liwei 2 жил өмнө
parent
commit
fe1841873a

+ 2 - 2
src/dict/apis.ts

@@ -14,8 +14,8 @@ const Dict_Apis = {
   queentreeLocal: base,
   auth: `${baseURL}${baseVersion}/usercenter`,
   queentree: `${baseURL}${treeVersion}/assetcenter`,
-  promotion: `${baseURL}${baseVersion}/promotion`,
-  // promotion: `${localURL}/promotion`,
+  // promotion: `${baseURL}${baseVersion}/promotion`,
+  promotion: `${localURL}/promotion`,
 };
 
 export { Dict_Apis };

+ 17 - 2
src/modules/editor/components/CompUI/CompController.tsx

@@ -22,8 +22,23 @@ export class CompController{
         this.state.content = designData.content || [];
         const arr = this.state.content;
         this.designCompMap.clear();
-        while (arr.length) {
-            const item = arr[0];
+        
+        const ParseComp = (obj:any)=> {
+            if (typeof obj != "object") return;
+            //作为组件
+            if (obj.id && obj.compKey && obj.value) {
+               this.designCompMap.set(obj.id, obj);
+            } else {
+                for (const c in obj) {
+                    ParseComp(c);
+                }
+            }
+        }
+
+        let index = arr.length
+        while (index--) {
+            const item = arr[index];
+            ParseComp(item.value)
             this.designCompMap.set(item.id, item);
         }
     }