|
@@ -2,20 +2,41 @@ import { defineAsyncComponent } from "vue";
|
|
|
|
|
|
const mapModalState = (namespace, map) => {
|
|
|
const modalState = {};
|
|
|
+ // console.log("MAP MODAL STATE", namespace);
|
|
|
+
|
|
|
Object.entries(map).forEach(([mapKey, mapValue]) => {
|
|
|
modalState[mapKey] = function func() {
|
|
|
- return mapValue(
|
|
|
- namespace
|
|
|
- .replace(
|
|
|
- "MODAL_MODULE_PATH",
|
|
|
- namespace.indexOf("MODAL_MODULE_PATH") !== -1
|
|
|
- ? this.modalModulePath
|
|
|
- : null
|
|
|
- )
|
|
|
- .replace("MODAL_UUID", this.modalUuid)
|
|
|
- .split("/")
|
|
|
- .reduce((a, b) => a[b], this.$store.state)
|
|
|
- );
|
|
|
+ // console.log(
|
|
|
+ // 321,
|
|
|
+ // namespace
|
|
|
+ // .replace(
|
|
|
+ // "MODAL_MODULE_PATH",
|
|
|
+ // namespace.indexOf("MODAL_MODULE_PATH") !== -1
|
|
|
+ // ? this.modalModulePath
|
|
|
+ // : null
|
|
|
+ // )
|
|
|
+ // .replace("MODAL_UUID", this.modalUuid)
|
|
|
+ // .split("/")
|
|
|
+ // );
|
|
|
+ // console.log(3211, mapKey);
|
|
|
+
|
|
|
+ const state = namespace
|
|
|
+ .replace(
|
|
|
+ "MODAL_MODULE_PATH",
|
|
|
+ namespace.indexOf("MODAL_MODULE_PATH") !== -1
|
|
|
+ ? this.modalModulePath
|
|
|
+ : null
|
|
|
+ )
|
|
|
+ .replace("MODAL_UUID", this.modalUuid)
|
|
|
+ .split("/")
|
|
|
+ .reduce((a, b) => a[b], this.$store.state);
|
|
|
+
|
|
|
+ // console.log(32111, state);
|
|
|
+ // if (state) console.log(321111, mapValue(state));
|
|
|
+ // else console.log(321111, "NADA");
|
|
|
+
|
|
|
+ if (state) return mapValue(state);
|
|
|
+ return mapValue({});
|
|
|
};
|
|
|
});
|
|
|
return modalState;
|