add quick menu, header table
This commit is contained in:
@@ -8,6 +8,8 @@ const store = {
|
||||
menu_level_0: [],
|
||||
menu_level_1: [],
|
||||
menu_level_2: [],
|
||||
quick_menu: [],
|
||||
active_menu: {},
|
||||
drawer: false,
|
||||
bread_crumb: "",
|
||||
search_error_message: "",
|
||||
@@ -44,6 +46,12 @@ const store = {
|
||||
update_drawer(state, payload) {
|
||||
state.drawer = payload;
|
||||
},
|
||||
update_quick_menu(state, data) {
|
||||
state.quick_menu = data;
|
||||
},
|
||||
update_active_menu(state, data) {
|
||||
state.active_menu = data;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async loadMenuData(context) {
|
||||
@@ -76,6 +84,20 @@ const store = {
|
||||
console.error('Error loading menu data:', error);
|
||||
}
|
||||
},
|
||||
async loadQuickMenu(context) {
|
||||
try {
|
||||
let resp = await axios.get(URL);
|
||||
if (resp.data.status != "OK") {
|
||||
console.error('get api failed');
|
||||
} else {
|
||||
let item = resp.data.data;
|
||||
if (item[1])
|
||||
context.commit("update_quick_menu", item[1]['p_1'])
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error load quick menu data', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
export default store
|
||||
Reference in New Issue
Block a user