PASSAGGIO A VITE !

AGG. 1.1.23
This commit is contained in:
Surya Paolo
2025-03-01 14:14:43 +01:00
parent f0098e57b2
commit bc960d38a1
1044 changed files with 5323 additions and 10823777 deletions

View File

@@ -1,24 +1,28 @@
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount, PropType, nextTick } from 'vue'
import { tools } from '@store/Modules/tools'
import type { PropType } from 'vue';
import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount, nextTick } from 'vue'
import { tools } from '@tools'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useProducts } from '@store/Products'
import { useI18n } from '@/boot/i18n'
import { useI18n } from 'vue-i18n'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
import { shared_consts } from '@src/common/shared_vuejs'
import { CProductCard } from '@src/components/CProductCard'
import { CMySelect } from '@src/components/CMySelect'
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
import { CSelectUserActive } from '@src/components/CSelectUserActive'
import {
import type {
IOptCatalogo, IDimensioni, IFilterCatalogo,
IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog, IImg, IMyPage,
IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog, IImg
} from 'model';
import {
IMyPage,
} from 'model'
@@ -169,7 +173,7 @@ export default defineComponent({
if (loadpage.value)
tools.setCookie(tools.COOK_CATEGORIA, cat.value.toString())
filter.value.author = '' // disattivo il filtro autore
filter.value.author = '' // disattivo il filtro autore
resetSearch()
calcArrProducts()
@@ -235,7 +239,7 @@ export default defineComponent({
function resetSearch() {
const mialista = getSearchList()
if (mialista && mialista.value && mialista.value.hasOwnProperty('name')) {
if (mialista && mialista.value && tools.existProp(mialista.value, 'name')) {
mialista.value = null
}
search.value = ''
@@ -249,11 +253,17 @@ export default defineComponent({
function getSearchText(): string {
const lista = getSearchList()
return lista && lista.value && lista.value.hasOwnProperty('name') ? lista.value.name : ''
return lista && lista.value && tools.existProp(lista.value, 'name') ? lista.value.name : ''
}
function getTitoloCatalogo(): string {
const trovatocatalogo = getCatalogoByMyPage.value
return trovatocatalogo ? trovatocatalogo.title : 'Catalogo'
}
function getImgIntroCatalogo(scheda: IMyScheda): IImg {
let trovatocatalogo = getCatalogoByMyPage.value
const trovatocatalogo = getCatalogoByMyPage.value
let imagefile = ''
let fit = ''
@@ -263,7 +273,7 @@ export default defineComponent({
if (recimg) {
imagefile = recimg.imagefile!
fit = recimg.fit! || 'contain'
imagefile = imagefile ? `url(${costanti.DIR_UPLOAD + shared_consts.getDirectoryByTable(shared_consts.TABLES_CATALOG) + '/' + trovatocatalogo._id + '/' + imagefile})` : ''
imagefile = imagefile ? `url(${tools.getDirUpload() + shared_consts.getDirectoryByTable(shared_consts.TABLES_CATALOG) + '/' + trovatocatalogo._id + '/' + imagefile})` : ''
}
}
@@ -271,14 +281,14 @@ export default defineComponent({
}
function getSfondoImgCatalogo(scheda?: IMyScheda | null, mypage?: IDimensioni): IImg {
let trovatocatalogo = getCatalogoByMyPage.value
const trovatocatalogo = getCatalogoByMyPage.value
let imagefile = ''
let fit = ''
if (trovatocatalogo) {
// Cerca prima se c'è un Immagine Introduttiva
const recimgintro = getImgIntroCatalogo(scheda!)
const recimgintro = getImgIntroCatalogo(scheda)
if (recimgintro.imagefile) {
imagefile = recimgintro.imagefile!
fit = recimgintro.fit! || 'contain'
@@ -289,18 +299,18 @@ export default defineComponent({
if (!imagefile && recimg) {
imagefile = recimg.imagefile!
fit = recimg.fit! || 'contain'
imagefile = imagefile ? `url(${costanti.DIR_UPLOAD + shared_consts.getDirectoryByTable(shared_consts.TABLES_CATALOG) + '/' + trovatocatalogo._id + '/' + imagefile})` : ''
imagefile = imagefile ? `url(${tools.getDirUpload() + shared_consts.getDirectoryByTable(shared_consts.TABLES_CATALOG) + '/' + trovatocatalogo._id + '/' + imagefile})` : ''
}
}
if (!imagefile && scheda) {
imagefile = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo!.imagefile!
imagefile = imagefile ? `url(${costanti.DIR_UPLOAD + costanti.DIR_SCHEDA + imagefile})` : ''
fit = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo!.fit!
imagefile = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo!.imagefile
imagefile = imagefile ? `url(${tools.getDirUpload() + costanti.DIR_SCHEDA + imagefile})` : ''
fit = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo!.fit
}
if (!imagefile && mypage) {
imagefile = mypage.imgsfondo!.imagefile!
imagefile = imagefile ? `url(${costanti.DIR_UPLOAD + costanti.DIR_CATALOGO + imagefile})` : ''
imagefile = imagefile ? `url(${tools.getDirUpload() + costanti.DIR_CATALOGO + imagefile})` : ''
fit = mypage.imgsfondo!.fit!
}
@@ -311,7 +321,7 @@ export default defineComponent({
let idCollane: number[] = []
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
let trovatocatalogo = getCatalogoByMyPage.value
const trovatocatalogo = getCatalogoByMyPage.value
if (trovatocatalogo) {
idCollane = trovatocatalogo.idCollane! || []
@@ -326,12 +336,16 @@ export default defineComponent({
let argomenti: string[] = []
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
let trovatocatalogo = getCatalogoByMyPage.value
const trovatocatalogo = getCatalogoByMyPage.value
if (trovatocatalogo) {
argomenti = trovatocatalogo.argomenti! || []
} else {
argomenti = def_argomenti || []
if (def_argomenti && def_argomenti.length > 0) {
argomenti = def_argomenti
} else {
argomenti = []
}
}
return argomenti
@@ -341,7 +355,7 @@ export default defineComponent({
let editore: string[] = []
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
let trovatocatalogo = getCatalogoByMyPage.value
const trovatocatalogo = getCatalogoByMyPage.value
if (trovatocatalogo) {
editore = trovatocatalogo.editore! || []
@@ -362,38 +376,38 @@ export default defineComponent({
const searchtext = getSearchText()
let arrprod = productStore.getProducts(cosa.value) || [];
let filtroAuthor = filter.value.author || '';
const filtroAuthor = filter.value.author || '';
//++AddCATALOGO_FIELDS
let filtroProductTypes = optcatalogo.value.productTypes || [0]
let filtroExcludeProductTypes = optcatalogo.value.excludeproductTypes || [0]
let boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
const filtroProductTypes = optcatalogo.value.productTypes || [0]
const filtroExcludeProductTypes = optcatalogo.value.excludeproductTypes || [0]
const boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
const boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
let editore = getEditoreDaFiltrare(optcatalogo.value.editore)
let filtroPublishers = editore || []
const editore = getEditoreDaFiltrare(optcatalogo.value.editore)
const filtroPublishers = editore || []
let idCollane = getIdCollaneDaFiltrare(optcatalogo.value.idCollane!)
let filtroCollane = idCollane || []
let boolfiltroVuotoEditore = (filtroPublishers.length === 0)
let boolfiltroVuotoCollane = (filtroCollane.length === 0)
const idCollane = getIdCollaneDaFiltrare(optcatalogo.value.idCollane)
const filtroCollane = idCollane || []
const boolfiltroVuotoEditore = (filtroPublishers.length === 0)
const boolfiltroVuotoCollane = (filtroCollane.length === 0)
//console.log('filtroVersione', filtroProductTypes)
let catstr = ''
const catstr = ''
if (optcatalogo.value.argomenti && optcatalogo.value.argomenti.length > 0) {
// ha la priorità questo scelto sul catalogo
arrargomstr = getArgomentiDaFiltrare(optcatalogo.value.argomenti!)
arrargomstr = getArgomentiDaFiltrare(optcatalogo.value.argomenti)
} else {
arrargomstr = getArgomentiDaFiltrare([cat.value || ''])
arrargomstr = getArgomentiDaFiltrare(cat.value ? [cat.value] : [])
// catstr = cat.value || ''
}
let filtroArgomenti = arrargomstr || []
let boolfiltroVuotoArgomenti = (filtroArgomenti.length === 0)
const filtroArgomenti = arrargomstr || []
const boolfiltroVuotoArgomenti = (filtroArgomenti.length === 0)
let gasselstr = ''
if (cosa.value === shared_consts.PROD.GAS) {
@@ -401,13 +415,13 @@ export default defineComponent({
}
let lowerSearchText = (searchtext || '').toLowerCase().trim();
lowerSearchText = lowerSearchText.replace(/[-@:=]/g, '');
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoArgomenti && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoCollane && boolfiltroVuotoEditore && boolfiltroVuotoCollana && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoArgomenti && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoCollane && boolfiltroVuotoEditore && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
} else {
arrprod = arrprod.filter((product: IProduct) => {
if (product && product.productInfo) {
let lowerName = (product.productInfo.name || '').toLowerCase();
const lowerName = (product.productInfo.name || '').toLowerCase();
let hasCategoria = false
let hasArgomentiCat = true
if (arrargomstr && arrargomstr.length > 0) {
@@ -417,7 +431,7 @@ export default defineComponent({
hasCategoria = (!catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr))) ? true : false
}
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
const hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
let hasProductTypes = true
let hasPublished = true
@@ -431,10 +445,10 @@ export default defineComponent({
hasProductTypes = !optcatalogo.value.productTypes || (optcatalogo.value.productTypes && (product.productInfo.productTypes || []).some((item: any) => optcatalogo.value.productTypes!.includes(item)))
}
if (optcatalogo.value && !boolfiltroVuotoEditore) {
hasPublished = !editore || (editore && editore.includes(product.productInfo.idPublisher!))
hasPublished = !editore || (editore && editore.includes(product.productInfo.idPublisher))
}
if (optcatalogo.value && !boolfiltroVuotoCollane) {
hasCollana = !idCollane || (idCollane && idCollane.includes(product.productInfo.idCollana!))
hasCollana = !idCollane || (idCollane && idCollane.includes(product.productInfo.idCollana))
}
if (optcatalogo.value && !boolfiltroVuotoExcludeProductTypes) {
@@ -448,11 +462,11 @@ export default defineComponent({
}
// Use a regular expression to match whole words
let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
const codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
// let nameMatch = new RegExp(`\\b(?=.*\\b${lowerSearchText.split(/\s+/).map(word => `(${word})\\b`).join('.*\\b')}\\b)`, 'i');
// Check if all words in lowerSearchText are present in lowerName
let allWordsPresent = lowerSearchText.split(/\s+/).every(word => new RegExp(`\\b${word}\\b`, 'i').test(lowerName));
const allWordsPresent = lowerSearchText.split(/\s+/).every(word => new RegExp(`\\b${word}\\b`, 'i').test(lowerName));
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasCollana && hasArgomentiCat && hasAuthor && productgassel && hasProductTypes && hasPublished && !hasExcludeProductTypes;
} else {
@@ -483,13 +497,13 @@ export default defineComponent({
const arrschede: ISchedaSingola[] = globalStore.getMySchede()
const myfindscheda = arrschede.find((recscheda: ISchedaSingola) => recscheda.scheda?._id === idTemplate)
let mynewscheda = tools.jsonCopy(origScheda)
const mynewscheda = tools.jsonCopy(origScheda)
const linkIdTemplate = origScheda.scheda?.linkIdTemplate
const precname = origScheda.scheda?.name
if (myfindscheda) {
let myschedatocopy = tools.jsonCopy(myfindscheda)
const myschedatocopy = tools.jsonCopy(myfindscheda)
if (myschedatocopy) {
myschedatocopy.scheda._id = origScheda.scheda?._id
@@ -505,7 +519,7 @@ export default defineComponent({
}
function populateDataWithlinkIdTemplate() {
console.log('populateDataWithlinkIdTemplate')
// console.log('populateDataWithlinkIdTemplate')
if (optcatalogo.value) {
@@ -521,7 +535,7 @@ export default defineComponent({
}
}
console.log(' FINE - populateDataWithlinkIdTemplate')
// console.log(' FINE - populateDataWithlinkIdTemplate')
}
@@ -532,20 +546,20 @@ export default defineComponent({
let arrargomstr: any = []
let arrprod = productStore.getProducts(cosa.value) || [];
let filtroAuthor = filter.value.author || '';
const filtroAuthor = filter.value.author || '';
let filtroProductTypes = scheda.productTypes || [0]
let filtroExcludeProductTypes = scheda.excludeproductTypes || [0]
let boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
const filtroProductTypes = scheda.productTypes || [0]
const filtroExcludeProductTypes = scheda.excludeproductTypes || [0]
const boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
const boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
let editore = getEditoreDaFiltrare(scheda.editore)
let filtroPublishers = editore || []
const editore = getEditoreDaFiltrare(scheda.editore)
const filtroPublishers = editore || []
let idCollane = getIdCollaneDaFiltrare(scheda.idCollane)
let filtroCollane = idCollane || []
let boolfiltroVuotoEditore = (filtroPublishers.length === 0)
let boolfiltroVuotoCollane = (filtroCollane.length === 0)
const idCollane = getIdCollaneDaFiltrare(scheda.idCollane)
const filtroCollane = idCollane || []
const boolfiltroVuotoEditore = (filtroPublishers.length === 0)
const boolfiltroVuotoCollane = (filtroCollane.length === 0)
//console.log('filtroVersione', filtroProductTypes)
@@ -553,7 +567,7 @@ export default defineComponent({
if (optcatalogo.value.argomenti && optcatalogo.value.argomenti.length > 0) {
// ha la priorità questo scelto sul catalogo
arrargomstr = getArgomentiDaFiltrare(optcatalogo.value.argomenti!)
arrargomstr = getArgomentiDaFiltrare(optcatalogo.value.argomenti)
} else {
catstr = cat.value || ''
}
@@ -562,15 +576,15 @@ export default defineComponent({
if (cosa.value === shared_consts.PROD.GAS) {
gasselstr = idGasSel.value || '';
}
let lowerSearchTexts = (searchtext || []).map((text: string) =>
const lowerSearchTexts = (searchtext || []).map((text: string) =>
text.toLowerCase().trim().replace(/[-@:=]/g, '')
)
// Remove the condition that skips filtering if search text is too short
// Now it will work with multiple search terms
arrprod = arrprod.filter((product: IProduct) => {
if (product && product.productInfo) {
let lowerName = (product.productInfo.name || '').toLowerCase();
let lowerCode = (product.productInfo.code || '').toLowerCase();
const lowerName = (product.productInfo.name || '').toLowerCase();
const lowerCode = (product.productInfo.code || '').toLowerCase();
let hasCategoria = false
let hasArgomentiCat = true
@@ -581,15 +595,15 @@ export default defineComponent({
hasCategoria = (!catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr))) ? true : false
}
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
const hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
// Check if ANY search term matches the product name or code
let searchMatch = lowerSearchTexts.length === 0 || lowerSearchTexts.some((searchTerm: any) => {
const searchMatch = lowerSearchTexts.length === 0 || lowerSearchTexts.some((searchTerm: any) => {
// Check if the entire search term is a whole word in name or code
let codeMatch = new RegExp(`\\b${searchTerm}\\b`, 'i').test(lowerCode);
const codeMatch = new RegExp(`\\b${searchTerm}\\b`, 'i').test(lowerCode);
// Check if all words in the search term are present in the name
let allWordsPresent = searchTerm.split(/\s+/).every((word: string) =>
const allWordsPresent = searchTerm.split(/\s+/).every((word: string) =>
new RegExp(`\\b${word}\\b`, 'i').test(lowerName)
);
@@ -606,11 +620,11 @@ export default defineComponent({
hasProductTypes = !scheda.productTypes || (scheda.productTypes && (product.productInfo.productTypes || []).some((item: any) => scheda.productTypes!.includes(item)))
}
if (!boolfiltroVuotoEditore) {
hasPublished = !editore || (editore && editore.includes(product.productInfo.idPublisher!))
hasPublished = !editore || (editore && editore.includes(product.productInfo.idPublisher))
}
if (optcatalogo.value && !boolfiltroVuotoCollane) {
hasCollane = !idCollane || (idCollane && idCollane.includes(product.productInfo.idCollana!))
hasCollane = !idCollane || (idCollane && idCollane.includes(product.productInfo.idCollana))
}
if (!boolfiltroVuotoExcludeProductTypes) {
@@ -625,7 +639,7 @@ export default defineComponent({
}
})
arrprod = getProductsSorted(arrprod, scheda?.sort_field!, scheda?.sort_dir!);
arrprod = getProductsSorted(arrprod, scheda?.sort_field, scheda?.sort_dir);
return arrprod
@@ -706,7 +720,7 @@ export default defineComponent({
}
function generatearrProdToViewSorted() {
console.log('generatearrProdToViewSorted...')
// console.log('generatearrProdToViewSorted...')
try {
@@ -717,15 +731,15 @@ export default defineComponent({
const arrGeneraleProdotti = arrProducts.value;
let indprod = 0
let indprodGenerale = 0
const indprodGenerale = 0
let indtotale = 0
for (const recscheda of optcatalogo.value.arrSchede!) {
if (recscheda && recscheda.scheda) {
let schedePerRiga = recscheda.scheda.numschede_perRiga || 1
let schedePerCol = recscheda.scheda.numschede_perCol || 1
let schedePerPagina = schedePerRiga * schedePerCol
const schedePerRiga = recscheda.scheda.numschede_perRiga || 1
const schedePerCol = recscheda.scheda.numschede_perCol || 1
const schedePerPagina = schedePerRiga * schedePerCol
let arrProdFiltrati: IProduct[] = []
@@ -734,8 +748,8 @@ export default defineComponent({
arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
indprod = 0
} else {
if (recscheda.scheda?.sort_field!) {
arrProdFiltrati = getProductsSorted(arrGeneraleProdotti, recscheda.scheda.sort_field!, recscheda.scheda.sort_dir!);
if (recscheda.scheda.sort_field!) {
arrProdFiltrati = getProductsSorted(arrGeneraleProdotti, recscheda.scheda.sort_field, recscheda.scheda.sort_dir);
indprod = 0
} else {
indprod = indprodGenerale
@@ -762,8 +776,8 @@ export default defineComponent({
indprod = result.indprod // Aggiorna indprod per il prossimo giro
if (result.myrec) {
let riga = Math.floor(indadded / schedePerCol)
let col = indadded % schedePerCol
const riga = Math.floor(indadded / schedePerCol)
const col = indadded % schedePerCol
if (!recscheda.arrProdToShow[pagina][riga]) {
recscheda.arrProdToShow[pagina][riga] = [];
@@ -779,12 +793,12 @@ export default defineComponent({
if (optcatalogo.value.maxnumlibri! > 0) {
if (indtotale > optcatalogo.value.maxnumlibri!)
return
} else {
if (indtotale > 200)
return
}
}
}
}
@@ -804,7 +818,7 @@ export default defineComponent({
// console.log('Fine Generazione')
}
console.log(' FINE - generatearrProdToViewSorted !')
// console.log(' FINE - generatearrProdToViewSorted !')
} catch (e) {
console.error('Err', e)
@@ -814,7 +828,7 @@ export default defineComponent({
}
function getNextProd() {
let nextRecord = arrProdToView.value.find((rec: any) => !rec.showed)
const nextRecord = arrProdToView.value.find((rec: any) => !rec.showed)
// Se un tale record esiste, impostalo su mostrato
if (nextRecord) {
@@ -831,10 +845,10 @@ export default defineComponent({
if (!search.value) {
return arrprod
}
let lowerSearchText = search.value.toLowerCase();
let catstr = cat.value;
return arrprod.filter((product: IProduct) => {
let lowerName = product.productInfo.name!.toLowerCase();
const hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
@@ -895,8 +909,8 @@ export default defineComponent({
});
function getCatProds() {
let arrcat = productStore.getCatProds(cosa.value)
let riscat: any = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
const arrcat = productStore.getCatProds(cosa.value)
const riscat: any = [{ label: 'Tutti', value: '', icon: undefined, color: undefined }]
for (const rec of arrcat) {
riscat.push({ label: rec.name, value: rec._id, icon: rec.icon, color: rec.color })
}
@@ -956,7 +970,7 @@ export default defineComponent({
}
}*/
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
const valoriopt = computed(() => (item: any, addall: boolean, addnone?: boolean = false) => {
// console.log('valoriopt', item.table)
return globalStore.getTableJoinByName(item.table, addall, addnone, item.filter)
})
@@ -995,12 +1009,12 @@ export default defineComponent({
// Esiste un immagine di sfondo specifica della singola pagina ?
let recimg = getSfondoImgCatalogo(scheda)
let backgroundImage = recimg.imagefile! ?? ''
let backgroundSize = recimg.fit
const recimg = getSfondoImgCatalogo(scheda)
const backgroundImage = recimg.imagefile! ?? ''
const backgroundSize = recimg.fit
let width = scheda.dimensioni?.pagina?.dimensioni?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
let height = scheda.dimensioni?.pagina?.dimensioni?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
const width = scheda.dimensioni?.pagina?.dimensioni?.size?.width ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
const height = scheda.dimensioni?.pagina?.dimensioni?.size?.height ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
return {
marginBottom,
@@ -1021,32 +1035,32 @@ export default defineComponent({
}
function generateStyleByPageDim(optcatalogo: IOptCatalogo, mypage: IDimensioni) {
const marginTop = mypage!.margini?.top ? tools.adjustSize(optcatalogo, mypage!.margini?.top) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) || '')
const marginBottom = mypage!.margini?.bottom ? tools.adjustSize(optcatalogo, mypage!.margini?.bottom) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) || '')
const marginLeft = mypage!.margini?.left ? tools.adjustSize(optcatalogo, mypage!.margini?.left) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) || '')
const marginRight = mypage!.margini?.right ? tools.adjustSize(optcatalogo, mypage!.margini?.right) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) || '')
const marginTop = mypage.margini?.top ? tools.adjustSize(optcatalogo, mypage.margini?.top) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) || '')
const marginBottom = mypage.margini?.bottom ? tools.adjustSize(optcatalogo, mypage.margini?.bottom) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) || '')
const marginLeft = mypage.margini?.left ? tools.adjustSize(optcatalogo, mypage.margini?.left) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) || '')
const marginRight = mypage.margini?.right ? tools.adjustSize(optcatalogo, mypage.margini?.right) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) || '')
const paddingTop = mypage!.padding?.top ? tools.adjustSize(optcatalogo, mypage!.padding?.top) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) || '')
const paddingBottom = mypage!.padding?.bottom ? tools.adjustSize(optcatalogo, mypage!.padding?.bottom) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
const paddingLeft = mypage!.padding?.left ? tools.adjustSize(optcatalogo, mypage!.padding?.left) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
const paddingRight = mypage!.padding?.right ? tools.adjustSize(optcatalogo, mypage!.padding?.right) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
const paddingTop = mypage.padding?.top ? tools.adjustSize(optcatalogo, mypage.padding?.top) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) || '')
const paddingBottom = mypage.padding?.bottom ? tools.adjustSize(optcatalogo, mypage.padding?.bottom) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
const paddingLeft = mypage.padding?.left ? tools.adjustSize(optcatalogo, mypage.padding?.left) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
const paddingRight = mypage.padding?.right ? tools.adjustSize(optcatalogo, mypage.padding?.right) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
// Esiste un immagine di sfondo specifica della singola pagina ?
let recimg = getSfondoImgCatalogo(null, mypage)
const recimg = getSfondoImgCatalogo(null, mypage)
let fileimg = recimg.imagefile! ?? ''
let backgroundSize = recimg.fit
if (!fileimg) {
// Esiste un immagine di sfondo uguali per tutte le pagine ?
fileimg = optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile!
backgroundSize = optcatalogo.dimensioni_def?.pagina.imgsfondo?.fit!
fileimg = fileimg ? `url(${costanti.DIR_UPLOAD + costanti.DIR_CATALOGO + fileimg})` : ''
fileimg = optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
backgroundSize = optcatalogo.dimensioni_def?.pagina.imgsfondo?.fit
fileimg = fileimg ? `url(${tools.getDirUpload() + costanti.DIR_CATALOGO + fileimg})` : ''
}
let backgroundImage = fileimg ?? ''
const backgroundImage = fileimg ?? ''
let width = mypage!.size?.width ? tools.adjustSize(optcatalogo, mypage!.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
let height = mypage!.size?.height ? tools.adjustSize(optcatalogo, mypage!.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
const width = mypage.size?.width ? tools.adjustSize(optcatalogo, mypage.size?.width) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.width) ?? '')
const height = mypage.size?.height ? tools.adjustSize(optcatalogo, mypage.size?.height) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.size?.height) ?? '')
return {
marginBottom,
@@ -1099,7 +1113,7 @@ export default defineComponent({
const paddingLeft = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.padding?.left) || '0';
const paddingRight = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.padding?.right) || '0';
let out: any = {
const out: any = {
placeContent,
flex: `0 1 ${width} !important`,
margin: `${marginTop} ${marginRight} ${marginBottom} ${marginLeft}`,
@@ -1207,6 +1221,7 @@ export default defineComponent({
getTestoIntroduttivo,
ispageCatalogata,
naviga,
getTitoloCatalogo,
}
}
})