- inizio di modifiche all'editor di Pagine Web
This commit is contained in:
@@ -64,6 +64,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
state: (): IGlobalState => ({
|
||||
showHeader: true,
|
||||
inStampa: false,
|
||||
updateMenu: false,
|
||||
finishLoading: false,
|
||||
conta: 0,
|
||||
wasAlreadySubscribed: false,
|
||||
@@ -791,7 +792,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
addDynamicPages($router: Router | null) {
|
||||
// console.log('this.mypage', this.mypage)
|
||||
/// console.log('addDynamicPages.........')
|
||||
// console.log('addDynamicPages.........')
|
||||
const arrpagesroute: IListRoutes[] = [];
|
||||
|
||||
for (const page of this.mypage) {
|
||||
@@ -886,10 +887,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
// Sort array
|
||||
static_data.routes = static_data.routes.sort((a, myb) => a.order - myb.order);
|
||||
|
||||
// console.log('static_data.routes', static_data.routes)
|
||||
|
||||
// console.log('$router', $router)
|
||||
|
||||
if ($router) {
|
||||
static_data.routes.forEach((route: any) => {
|
||||
if (!$router.hasRoute(route.name) && !route.noroute) {
|
||||
@@ -933,6 +930,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateMenu = true;
|
||||
},
|
||||
|
||||
async aggiornaMenu(router: Router) {
|
||||
@@ -1446,7 +1444,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
// console.log('mypage', mypage)
|
||||
|
||||
// Controlla se l'ho già caricato
|
||||
if ((!!mypage && (!!mypage.content || mypage.loadFirst || mypage.loaded)) && !forza) {
|
||||
if (!!mypage && (!!mypage.content || mypage.loadFirst || mypage.loaded) && !forza) {
|
||||
return mypage;
|
||||
}
|
||||
|
||||
@@ -1478,8 +1476,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
return Api.SendReq('/savepage', 'POST', { page })
|
||||
.then((res) => {
|
||||
if (res && res.data && res.data.ris) {
|
||||
return res.data.ris;
|
||||
if (res && res.data && res.data.mypage) {
|
||||
return res.data.mypage;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -1713,6 +1711,25 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
});
|
||||
},
|
||||
|
||||
async deletePage($q: any, idpage: string) {
|
||||
console.log('deletePage', idpage);
|
||||
|
||||
return Api.SendReq('/api/mypage/' + idpage, 'DELETE', null)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
if (res.data.code === serv_constants.RIS_CODE_OK) {
|
||||
tools.showPositiveNotif($q, t('db.deletedpage'));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
async DeleteRec({ table, id }: { table: string; id: string }) {
|
||||
console.log('DeleteRec', table, id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user