- Aggiornati margini.

- Cataloghi: Export ed Import di una pagine ed i suoi elementi !
This commit is contained in:
Surya Paolo
2024-12-13 18:10:04 +01:00
parent 29c59588c7
commit 8baf1e99f0
39 changed files with 752 additions and 141 deletions

View File

@@ -3527,6 +3527,13 @@ export const tools = {
return mydate
},
getDateYYYYMMDD_Today() {
// Ottieni la data attuale nel formato YYYY-MM-DD
const today = new Date();
const formattedDate = today.toISOString().split('T')[0]; // Format YYYY-MM-DD
return formattedDate
},
isDateArrived(mydate: Date | number | string | undefined) {
const datenow = this.getDateNow()
const diff = date.getDateDiff(datenow, mydate)
@@ -8012,9 +8019,9 @@ export const tools = {
} else if (!!myrow && !!myrow.directory) {
ris = myrow.directory
} else if (table === 'myelems') {
ris = 'pages/' + myrow.path
ris = 'pages/' + (path ? path : myrow.path)
} else if (table === 'listcards') {
ris = 'pages/' + myrow.path
ris = 'pages/' + (path ? path : myrow.path)
} else if (table === 'imgcards') {
ris = 'pages/' + path
} else if (table === 'productInfos') {
@@ -8024,10 +8031,11 @@ export const tools = {
} else {
ris = table
}
} catch (e) {
console.error('err getDirectoryGall', e)
}
// console.log('getDirectoryGall', ris)
console.log('getDirectoryGall', ris, 'mypath', path, 'myrow', myrow)
return ris
},
@@ -8035,7 +8043,7 @@ export const tools = {
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + filename
},
getImgFileByElem(elem: IMyElem, reccard?: IMyCard) {
getImgFileByElem(elem: IMyElem, reccard?: IMyCard, path?: string) {
if (elem) {
let addtourl = ''
@@ -8043,21 +8051,23 @@ export const tools = {
addtourl = '?v=' + elem.vers_img
}
const mypath = (path ? path : elem.path)
if (elem.type === shared_consts.ELEMTYPE.CARD) {
if (reccard?.imagefile) {
if (reccard.vers_img) {
addtourl = '?v=' + reccard.vers_img
}
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + reccard.imagefile + addtourl
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + reccard.imagefile + addtourl
} else
return ''
} else if (elem.type === shared_consts.ELEMTYPE.IMAGE) {
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + elem.container + addtourl
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + elem.container + addtourl
} else if (elem.type === shared_consts.ELEMTYPE.QRCODE) {
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + elem.image + addtourl
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + elem.image + addtourl
} else {
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + elem.image + addtourl
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + elem.image + addtourl
}
}
},
@@ -8910,8 +8920,8 @@ export const tools = {
num = number.toFixed(2)
} catch (e) {
return number
}
}
return num
},
@@ -9300,6 +9310,9 @@ export const tools = {
size: '14px',
}
}
if (!rec.size) {
rec.size = this.resetISize(rec.size!)
}
return rec
},