- creato editor di Pagine (iniziato)

- fix: mancano i "t," su alcuni componenti...
This commit is contained in:
Surya Paolo
2025-09-02 16:22:13 +02:00
parent 4f4297ca21
commit 574f389200
324 changed files with 5838 additions and 759 deletions

View File

@@ -483,12 +483,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
return arrprov && arrprov.length > 0;
},
getIdCircuitToAssignByProv: (state: IGlobalState) => (myprov: string): string => {
const arrprov: any[] = state.provinces.filter(
(recprov: IProvince) => recprov.prov === myprov && !!recprov.idCircuitToAssign
);
return arrprov && arrprov.length > 0 ? arrprov[0].idCircuitToAssign : '';
},
getIdCircuitToAssignByProv:
(state: IGlobalState) =>
(myprov: string): string => {
const arrprov: any[] = state.provinces.filter(
(recprov: IProvince) => recprov.prov === myprov && !!recprov.idCircuitToAssign
);
return arrprov && arrprov.length > 0 ? arrprov[0].idCircuitToAssign : '';
},
getRespByUsername: (state: IGlobalState) => (username: string) => {
const rec = state.resps.find((recin: any) => recin.username === username);
@@ -1435,7 +1437,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
});
},
async loadPage(path: string, dove?: string) {
async loadPage(path: string, dove?: string, forza?: boolean) {
const userStore = useUserStore();
path = path.substring(1);
@@ -1444,7 +1446,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
// console.log('mypage', mypage)
// Controlla se l'ho già caricato
if (!!mypage && (!!mypage.content || mypage.loadFirst || mypage.loaded)) {
if ((!!mypage && (!!mypage.content || mypage.loadFirst || mypage.loaded)) && !forza) {
return mypage;
}
@@ -1471,6 +1473,24 @@ export const useGlobalStore = defineStore('GlobalStore', {
});
},
async savePage(page: IMyPage) {
const userStore = useUserStore();
return Api.SendReq('/savepage', 'POST', { page })
.then((res) => {
if (res && res.data && res.data.ris) {
return res.data.ris;
} else {
return null;
}
})
.catch((error: any) => {
console.log('error savePage', error);
userStore.setErrorCatch(error);
return null;
});
},
async duplicatePage(path: string, $q: any, t: any) {
const userStore = useUserStore();