- cataloghi...

- fix: condividi su Telegram non funzionava errore sull'immagine
This commit is contained in:
Surya Paolo
2024-11-02 18:06:27 +01:00
parent 2ea6468100
commit 1c63b5346b
91 changed files with 2105 additions and 306 deletions

View File

@@ -14,7 +14,7 @@ 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 { ICatalogo, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISearchList } from 'model'
import { ICatalogo, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model'
import html2canvas from 'html2canvas'
// import { VueHtmlToPaper } from 'vue-html-to-paper'
@@ -412,9 +412,9 @@ export default defineComponent({
}
}
function getProdBySchedaRigaCol(scheda: IMyScheda, riga: number, col: number) {
function getProdBySchedaRigaCol(recscheda: ISchedaSingola, riga: number, col: number) {
try {
return scheda.arrProdToShow![riga][col]
return recscheda.arrProdToShow![riga][col]
} catch (e) {
return null
}
@@ -436,10 +436,7 @@ export default defineComponent({
const arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
let indprod = 0
let indadded = 0
recscheda.scheda.arrProdToShow = []
let riga = 0
let col = 0
recscheda.arrProdToShow = []
for (let giro = 0; giro < schedePerPagina; giro++) {
// Aggiunge il prossimo prodotto che non è stato ancora inserito
@@ -450,21 +447,22 @@ export default defineComponent({
if (result.indprod)
indprod = result.indprod // Aggiorna indprod per il prossimo giro
if (result.myrec) {
indadded++
let riga = Math.floor(indadded / schedePerCol)
let col = indadded % schedePerCol
if (!recscheda.scheda.arrProdToShow[riga]) {
recscheda.scheda.arrProdToShow[riga] = [];
if (!recscheda.arrProdToShow[riga]) {
recscheda.arrProdToShow[riga] = [];
}
recscheda.scheda.arrProdToShow[riga][col] = result.myrec
recscheda.arrProdToShow[riga][col] = result.myrec
indadded++
}
}
}
console.log('*** arrProdToShow', recscheda.scheda.arrProdToShow)
console.log('*** arrProdToShow', recscheda.arrProdToShow)
}
}
}
@@ -712,6 +710,57 @@ export default defineComponent({
}
function generateStyleCatalogo(optcatalogo: ICatalogo) {
const fileimg = (optcatalogo.printable
? optcatalogo.backgroundimage_printable
: optcatalogo.backgroundimage)
const marginBottom = optcatalogo.dimensioni.pagina.margini!.bottom || ''
const backgroundImage = fileimg ? `url(${costanti.DIR_UPLOAD +
costanti.DIR_CATALOGO + fileimg})` : ''
const backgroundSize = `${optcatalogo.printable
? optcatalogo.backgroundSize_printable
: optcatalogo.backgroundSize}`;
const width = optcatalogo.dimensioni.pagina.size?.width
return {
backgroundImage,
backgroundSize,
marginBottom,
'--width': width
};
}
function generateStylePageScheda(optcatalogo: ICatalogo, scheda: IMyScheda) {
const marginTop = `${scheda.dimensioni.pagina.margini!.top}`
const marginBottom = scheda.dimensioni.pagina.margini!.bottom
const fileimg = (optcatalogo.printable
? scheda.bgimg_printable
: scheda.bgimg)
const backgroundImage = fileimg ? `url(${costanti.DIR_UPLOAD +
costanti.DIR_SCHEDA + fileimg})` : ''
const backgroundSize = `${optcatalogo.printable
? scheda.bgSize_printable
: scheda.bgSize}`;
const width = scheda.dimensioni.pagina.size?.width
return {
marginBottom,
marginTop,
backgroundImage,
backgroundSize,
'--width': width
};
}
onMounted(mounted)
@@ -754,6 +803,8 @@ export default defineComponent({
groupedPages,
getNextProd,
getProdBySchedaRigaCol,
generateStylePageScheda,
generateStyleCatalogo,
}
}
})