|
|
|
@ -12,6 +12,7 @@ export default {
|
|
|
|
|
if (state.modals.findIndex(x => x.name === data.name) === -1) {
|
|
|
|
|
state.modals.push(data);
|
|
|
|
|
let module = data.name.split("_");
|
|
|
|
|
if (module.length > 2) {
|
|
|
|
|
if (data.rel) {
|
|
|
|
|
rootState[module[1]].relation = data.rel;
|
|
|
|
|
state.rel.push(data.rel);
|
|
|
|
@ -22,16 +23,23 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
rootState[module[1]].page_type = data.page_type ? data.page_type : 'modal';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
$_closeModal({ state, rootState }) {
|
|
|
|
|
if (state.modals.length) {
|
|
|
|
|
let last_data = [...state.modals].pop();
|
|
|
|
|
let module = last_data.name.split("_")[1];
|
|
|
|
|
|
|
|
|
|
if (state.modals.length > 1) {
|
|
|
|
|
state.modals[state.modals.length - 2]['last_modal_data'] = last_data;
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (last_data.name.split("_").length > 2) {
|
|
|
|
|
|
|
|
|
|
let module = last_data.name.split("_")[1];
|
|
|
|
|
|
|
|
|
|
if(state.modals.length <= 1) {
|
|
|
|
|
rootState[module].page_type = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -51,6 +59,8 @@ export default {
|
|
|
|
|
rootState[module].current_model = {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
state.modals.pop();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|