|
@@ -49,11 +49,23 @@ export const store = EditorModule.store({
|
|
|
},
|
|
|
previewImageList(state) {
|
|
|
const res: string[] = [];
|
|
|
- Object.values(state.designData.compMap)
|
|
|
- .filter((d) => d.compKey == "Image")
|
|
|
- .forEach((value) => {
|
|
|
- res.push(value.value?.url);
|
|
|
+
|
|
|
+ function findImg(comp: DesignComp) {
|
|
|
+ (comp?.children?.default
|
|
|
+ ? comp?.children?.default
|
|
|
+ : Object.values(comp?.children)
|
|
|
+ ).forEach((k: string) => {
|
|
|
+ const comp = state.designData.compMap[k];
|
|
|
+ if (comp.compKey == "Image") {
|
|
|
+ res.push(comp.value?.url);
|
|
|
+ } else {
|
|
|
+ findImg(comp);
|
|
|
+ }
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+ const root = state.designData.compMap["root"];
|
|
|
+ findImg(root);
|
|
|
return res;
|
|
|
},
|
|
|
},
|