|
|
|
|
@@ -16,30 +16,20 @@ import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
|
|
|
|
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
|
|
|
|
import { ICatalogo, IDimensioni, IFilterCatalogo, IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList } from 'model'
|
|
|
|
|
|
|
|
|
|
// import { VueHtmlToPaper } from 'vue-html-to-paper'
|
|
|
|
|
import html2pdf from 'html2pdf.js'
|
|
|
|
|
|
|
|
|
|
import { fieldsTable } from '@store/Modules/fieldsTable'
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'Catalogo',
|
|
|
|
|
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
|
|
|
|
|
emits: ['update:modelValue', 'updateCatalogo'],
|
|
|
|
|
props: {
|
|
|
|
|
optcatalogo: {
|
|
|
|
|
modelValue: {
|
|
|
|
|
type: Object as PropType<ICatalogo>,
|
|
|
|
|
required: false,
|
|
|
|
|
default: () => ({
|
|
|
|
|
//++AddCATALOGO_FIELDS
|
|
|
|
|
productTypes: [0],
|
|
|
|
|
excludeproductTypes: [],
|
|
|
|
|
formato: [],
|
|
|
|
|
Categoria: [],
|
|
|
|
|
Editore: [],
|
|
|
|
|
pdf: false,
|
|
|
|
|
}),
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
setup(props) {
|
|
|
|
|
setup(props, { emit }) {
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
const globalStore = useGlobalStore()
|
|
|
|
|
const productStore = useProducts()
|
|
|
|
|
@@ -52,6 +42,27 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
const pdfContent = ref(null);
|
|
|
|
|
|
|
|
|
|
const optcatalogo = ref(<ICatalogo>{ ...props.modelValue });
|
|
|
|
|
|
|
|
|
|
function updateCatalogoPadre() {
|
|
|
|
|
console.log('catalogo.ts PADRE')
|
|
|
|
|
emit('update:modelValue', optcatalogo.value);
|
|
|
|
|
//emit('updateCatalogo', optcatalogo.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Metodo per aggiornare optcatalogo
|
|
|
|
|
const updateOptCatalogo = <K extends keyof ICatalogo>(key: K, value: ICatalogo[K]) => {
|
|
|
|
|
optcatalogo.value[key] = value;
|
|
|
|
|
updateCatalogoPadre()
|
|
|
|
|
}
|
|
|
|
|
// Utile anche per sincronizzare con le modifiche ricevute da props
|
|
|
|
|
watch(() => props.modelValue, (newVal) => {
|
|
|
|
|
optcatalogo.value = { ...newVal };
|
|
|
|
|
}, { deep: true });
|
|
|
|
|
|
|
|
|
|
/*watch(optcatalogo, (newValue) => {
|
|
|
|
|
emit('update:modelValue', newValue);
|
|
|
|
|
}, { deep: true });*/
|
|
|
|
|
|
|
|
|
|
const filter = ref(<IFilterCatalogo>{
|
|
|
|
|
author: '',
|
|
|
|
|
@@ -167,7 +178,7 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
watch(() => props.optcatalogo.aggiorna, (newval, oldval) => {
|
|
|
|
|
watch(() => optcatalogo.value.aggiorna, (newval, oldval) => {
|
|
|
|
|
console.log('Aggiorna array...')
|
|
|
|
|
generatearrProdToViewSorted()
|
|
|
|
|
})
|
|
|
|
|
@@ -203,12 +214,12 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
//++AddCATALOGO_FIELDS
|
|
|
|
|
|
|
|
|
|
let filtroProductTypes = props.optcatalogo.productTypes || [0]
|
|
|
|
|
let filtroExcludeProductTypes = props.optcatalogo.excludeproductTypes || [0]
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
let filtroPublishers = props.optcatalogo.Editore || []
|
|
|
|
|
let filtroPublishers = optcatalogo.value.Editore || []
|
|
|
|
|
let boolfiltroVuotoEditore = (filtroPublishers.length === 0)
|
|
|
|
|
|
|
|
|
|
//console.log('filtroVersione', filtroProductTypes)
|
|
|
|
|
@@ -237,17 +248,17 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
//++AddCATALOGO_FIELDS
|
|
|
|
|
|
|
|
|
|
if (props.optcatalogo && !boolfiltroVuotoProductTypes) {
|
|
|
|
|
// check if productInfo.productTypes array includes some item in props.optcatalogo.ProductTypes array
|
|
|
|
|
hasProductTypes = !props.optcatalogo.productTypes || (props.optcatalogo.productTypes && (product.productInfo.productTypes || []).some((item: any) => props.optcatalogo.productTypes.includes(item)))
|
|
|
|
|
if (optcatalogo.value && !boolfiltroVuotoProductTypes) {
|
|
|
|
|
// check if productInfo.productTypes array includes some item in optcatalogo.value.ProductTypes array
|
|
|
|
|
hasProductTypes = !optcatalogo.value.productTypes || (optcatalogo.value.productTypes && (product.productInfo.productTypes || []).some((item: any) => optcatalogo.value.productTypes!.includes(item)))
|
|
|
|
|
}
|
|
|
|
|
if (props.optcatalogo && !boolfiltroVuotoEditore) {
|
|
|
|
|
hasPublished = !props.optcatalogo.Editore || (props.optcatalogo.Editore && props.optcatalogo.Editore.includes(product.productInfo.idPublisher!))
|
|
|
|
|
if (optcatalogo.value && !boolfiltroVuotoEditore) {
|
|
|
|
|
hasPublished = !optcatalogo.value.Editore || (optcatalogo.value.Editore && optcatalogo.value.Editore.includes(product.productInfo.idPublisher!))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (props.optcatalogo && !boolfiltroVuotoExcludeProductTypes) {
|
|
|
|
|
// check if productInfo.productTypes array exclude some item in props.optcatalogo.ProductTypes array
|
|
|
|
|
hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => props.optcatalogo.excludeproductTypes.includes(item)))
|
|
|
|
|
if (optcatalogo.value && !boolfiltroVuotoExcludeProductTypes) {
|
|
|
|
|
// check if productInfo.productTypes array exclude some item in optcatalogo.value.ProductTypes array
|
|
|
|
|
hasExcludeProductTypes = !optcatalogo.value.excludeproductTypes || (optcatalogo.value.excludeproductTypes && (product.productInfo.productTypes || []).every((item: any) => optcatalogo.value.excludeproductTypes!.includes(item)))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let productgassel = true
|
|
|
|
|
@@ -285,7 +296,7 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sovrascriviSchedaFromTemplate(idTemplate: string, origScheda: ISchedaSingola) {
|
|
|
|
|
if (!props.optcatalogo)
|
|
|
|
|
if (!optcatalogo.value)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
const arrschede: ISchedaSingola[] = globalStore.getMySchede()
|
|
|
|
|
@@ -314,9 +325,9 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
function populateDataWithlinkIdTemplate() {
|
|
|
|
|
|
|
|
|
|
if (props.optcatalogo) {
|
|
|
|
|
if (optcatalogo.value) {
|
|
|
|
|
|
|
|
|
|
for (const recscheda of props.optcatalogo.arrSchede!) {
|
|
|
|
|
for (const recscheda of optcatalogo.value.arrSchede!) {
|
|
|
|
|
if (recscheda.scheda?.linkIdTemplate) {
|
|
|
|
|
// ricopia da Template:
|
|
|
|
|
const myscheda = sovrascriviSchedaFromTemplate(recscheda.scheda?.linkIdTemplate, recscheda)
|
|
|
|
|
@@ -483,7 +494,7 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function generatearrProdToViewSorted() {
|
|
|
|
|
console.log('generatearrProdToViewSorted', arrProducts.value)
|
|
|
|
|
// console.log('generatearrProdToViewSorted', arrProducts.value)
|
|
|
|
|
|
|
|
|
|
// Svuota
|
|
|
|
|
arrProdToView.value = []
|
|
|
|
|
@@ -494,7 +505,7 @@ export default defineComponent({
|
|
|
|
|
let indprod = 0
|
|
|
|
|
let indprodGenerale = 0
|
|
|
|
|
|
|
|
|
|
for (const recscheda of props.optcatalogo.arrSchede!) {
|
|
|
|
|
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
|
|
|
|
|
@@ -725,98 +736,7 @@ export default defineComponent({
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const generatePDF = async () => {
|
|
|
|
|
//props.optcatalogo.generazionePDFInCorso = true
|
|
|
|
|
|
|
|
|
|
await nextTick()
|
|
|
|
|
|
|
|
|
|
$q.loading.show({
|
|
|
|
|
message: 'Caricamento immagini e generazione PDF in corso...'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
let defaultMargin = 0.1
|
|
|
|
|
if (props.optcatalogo.printable) {
|
|
|
|
|
defaultMargin = 0
|
|
|
|
|
} else {
|
|
|
|
|
defaultMargin = 0
|
|
|
|
|
}
|
|
|
|
|
const unit = props.optcatalogo.areadistampa!.unit
|
|
|
|
|
|
|
|
|
|
let myformat = { ...props.optcatalogo.areadistampa!.format }
|
|
|
|
|
|
|
|
|
|
let scale = props.optcatalogo.areadistampa!.scale
|
|
|
|
|
let scalecanvas = props.optcatalogo.areadistampa!.scalecanvas
|
|
|
|
|
|
|
|
|
|
if (tools.isObject(myformat) && scale > 0) {
|
|
|
|
|
} else {
|
|
|
|
|
myformat = [210, 297]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const formatwidth = (myformat[0] * scale)
|
|
|
|
|
const formatheight = (myformat[1] * scale)
|
|
|
|
|
|
|
|
|
|
let myfile = (props.optcatalogo.pdf_filename ?? 'catalogo_completo')
|
|
|
|
|
|
|
|
|
|
myfile += '_' + formatwidth + '_' + formatheight + '_' + unit + '_scale_' + scale
|
|
|
|
|
|
|
|
|
|
myfile += '.pdf'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const element = document.getElementById('pdf-content')
|
|
|
|
|
const opt = {
|
|
|
|
|
margin: [
|
|
|
|
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.top) || defaultMargin) : defaultMargin,
|
|
|
|
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.left) || defaultMargin) : defaultMargin,
|
|
|
|
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.bottom) || defaultMargin) : defaultMargin,
|
|
|
|
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.right) || defaultMargin) : defaultMargin
|
|
|
|
|
],
|
|
|
|
|
filename: myfile,
|
|
|
|
|
image: {
|
|
|
|
|
type: 'jpeg',
|
|
|
|
|
quality: 0.98
|
|
|
|
|
},
|
|
|
|
|
html2canvas: {
|
|
|
|
|
scale: scalecanvas,
|
|
|
|
|
useCORS: true,
|
|
|
|
|
letterRendering: true,
|
|
|
|
|
},
|
|
|
|
|
jsPDF: {
|
|
|
|
|
unit: unit,
|
|
|
|
|
format: [formatwidth, formatheight],
|
|
|
|
|
orientation: props.optcatalogo.areadistampa!.orientation,
|
|
|
|
|
compress: props.optcatalogo.areadistampa!.compress,
|
|
|
|
|
},
|
|
|
|
|
enableLinks: true,
|
|
|
|
|
pagebreak: { mode: 'avoid-all', before: '.card-page' }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log('opt di stampa', opt)
|
|
|
|
|
// a4: [595.28, 841.89]
|
|
|
|
|
|
|
|
|
|
await html2pdf().set(opt).from(element).save()
|
|
|
|
|
|
|
|
|
|
// props.optcatalogo.generazionePDFInCorso = false
|
|
|
|
|
|
|
|
|
|
$q.loading.hide()
|
|
|
|
|
$q.notify({
|
|
|
|
|
color: 'positive',
|
|
|
|
|
message: 'PDF generato con successo!',
|
|
|
|
|
icon: 'check'
|
|
|
|
|
})
|
|
|
|
|
} catch (error) {
|
|
|
|
|
$q.loading.hide()
|
|
|
|
|
$q.notify({
|
|
|
|
|
color: 'negative',
|
|
|
|
|
message: 'Errore nella generazione del PDF',
|
|
|
|
|
icon: 'error'
|
|
|
|
|
})
|
|
|
|
|
console.error('Errore nella generazione del PDF:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function groupedPages(recscheda: ISchedaSingola) {
|
|
|
|
|
return recscheda.arrProdToShow
|
|
|
|
|
@@ -829,15 +749,15 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function generateStylePageScheda(optcatalogo: ICatalogo, scheda: IMyScheda) {
|
|
|
|
|
const marginTop = scheda.dimensioni?.pagina?.dimensioni?.margini?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
|
|
|
|
|
const marginBottom = scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
|
|
|
|
|
const marginLeft = scheda.dimensioni?.pagina?.dimensioni?.margini?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
|
|
|
|
|
const marginRight = scheda.dimensioni?.pagina?.dimensioni?.margini?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) ?? '')
|
|
|
|
|
const marginTop = scheda.dimensioni?.pagina?.dimensioni?.margini?.top ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.top) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) || '')
|
|
|
|
|
const marginBottom = scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.bottom) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) || '')
|
|
|
|
|
const marginLeft = scheda.dimensioni?.pagina?.dimensioni?.margini?.left ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.left) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) || '')
|
|
|
|
|
const marginRight = scheda.dimensioni?.pagina?.dimensioni?.margini?.right ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.margini?.right) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.right) || '')
|
|
|
|
|
|
|
|
|
|
const paddingTop = scheda.dimensioni?.pagina?.dimensioni?.padding?.top ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
|
|
|
|
|
const paddingBottom = scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
|
|
|
|
|
const paddingLeft = scheda.dimensioni?.pagina?.dimensioni?.padding?.left ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
|
|
|
|
|
const paddingRight = scheda.dimensioni?.pagina?.dimensioni?.padding?.right ? tools.adjustSize(props.optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.right) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) ?? '')
|
|
|
|
|
const paddingTop = scheda.dimensioni?.pagina?.dimensioni?.padding?.top ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.top) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) || '')
|
|
|
|
|
const paddingBottom = scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.bottom) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) || '')
|
|
|
|
|
const paddingLeft = scheda.dimensioni?.pagina?.dimensioni?.padding?.left ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.left) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) || '')
|
|
|
|
|
const paddingRight = scheda.dimensioni?.pagina?.dimensioni?.padding?.right ? tools.adjustSize(optcatalogo, scheda.dimensioni?.pagina?.dimensioni?.padding?.right) : (tools.adjustSize(optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.right) || '')
|
|
|
|
|
|
|
|
|
|
// Esiste un immagine di sfondo specifica della singola pagina ?
|
|
|
|
|
let fileimg = scheda.dimensioni?.pagina?.dimensioni?.imgsfondo?.imagefile
|
|
|
|
|
@@ -877,15 +797,15 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function generateStyleByPageDim(optcatalogo: ICatalogo, mypage: IDimensioni) {
|
|
|
|
|
const marginTop = mypage!.margini?.top ? tools.adjustSize(props.optcatalogo, mypage!.margini?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.top) ?? '')
|
|
|
|
|
const marginBottom = mypage!.margini?.bottom ? tools.adjustSize(props.optcatalogo, mypage!.margini?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.bottom) ?? '')
|
|
|
|
|
const marginLeft = mypage!.margini?.left ? tools.adjustSize(props.optcatalogo, mypage!.margini?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.margini?.left) ?? '')
|
|
|
|
|
const marginRight = mypage!.margini?.right ? tools.adjustSize(props.optcatalogo, mypage!.margini?.right) : (tools.adjustSize(props.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(props.optcatalogo, mypage!.padding?.top) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.top) ?? '')
|
|
|
|
|
const paddingBottom = mypage!.padding?.bottom ? tools.adjustSize(props.optcatalogo, mypage!.padding?.bottom) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.bottom) ?? '')
|
|
|
|
|
const paddingLeft = mypage!.padding?.left ? tools.adjustSize(props.optcatalogo, mypage!.padding?.left) : (tools.adjustSize(props.optcatalogo, optcatalogo.dimensioni_def?.pagina?.padding?.left) ?? '')
|
|
|
|
|
const paddingRight = mypage!.padding?.right ? tools.adjustSize(props.optcatalogo, mypage!.padding?.right) : (tools.adjustSize(props.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 fileimg = mypage!.imgsfondo?.imagefile
|
|
|
|
|
@@ -932,8 +852,8 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getStyleRowSeparator(recscheda: ISchedaSingola) {
|
|
|
|
|
const paddingLeft = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.left) ?? '0px';
|
|
|
|
|
const paddingRight = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.right) ?? '0px';
|
|
|
|
|
const paddingLeft = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.left) ?? '0px';
|
|
|
|
|
const paddingRight = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.right) ?? '0px';
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
paddingLeft: `${paddingLeft}`,
|
|
|
|
|
@@ -944,18 +864,18 @@ export default defineComponent({
|
|
|
|
|
function getStyleRow(recscheda: ISchedaSingola) {
|
|
|
|
|
const placeContent = 'center';
|
|
|
|
|
|
|
|
|
|
const width = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.size?.width) ?? '';
|
|
|
|
|
const height = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.size?.height);
|
|
|
|
|
const width = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.size?.width) ?? '';
|
|
|
|
|
const height = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.size?.height);
|
|
|
|
|
|
|
|
|
|
const marginTop = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.margini?.top) ?? '0px';
|
|
|
|
|
const marginBottom = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.margini?.bottom) ?? '0px';
|
|
|
|
|
const marginLeft = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.margini?.left) ?? '0px';
|
|
|
|
|
const marginRight = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.margini?.right) ?? '0px';
|
|
|
|
|
const marginTop = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.margini?.top) || '0';
|
|
|
|
|
const marginBottom = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.margini?.bottom) || '0';
|
|
|
|
|
const marginLeft = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.margini?.left) || '0';
|
|
|
|
|
const marginRight = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.margini?.right) || '0';
|
|
|
|
|
|
|
|
|
|
const paddingTop = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.padding?.top) ?? '0px';
|
|
|
|
|
const paddingBottom = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.padding?.bottom) ?? '0px';
|
|
|
|
|
const paddingLeft = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.padding?.left) ?? '0px';
|
|
|
|
|
const paddingRight = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.riga?.padding?.right) ?? '0px';
|
|
|
|
|
const paddingTop = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.padding?.top) || '0';
|
|
|
|
|
const paddingBottom = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.padding?.bottom) || '0';
|
|
|
|
|
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';
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
placeContent,
|
|
|
|
|
@@ -971,18 +891,18 @@ export default defineComponent({
|
|
|
|
|
function getStyleSchedaProdotto(recscheda: ISchedaSingola) {
|
|
|
|
|
const placeContent = 'center';
|
|
|
|
|
|
|
|
|
|
const width = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.size?.width) ?? '100px';
|
|
|
|
|
const height = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.size?.height);
|
|
|
|
|
const width = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.size?.width) ?? '100px';
|
|
|
|
|
const height = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.size?.height);
|
|
|
|
|
|
|
|
|
|
const marginTop = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.top) ?? '0px';
|
|
|
|
|
const marginBottom = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.bottom) ?? '0px';
|
|
|
|
|
const marginLeft = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.left) ?? '0px';
|
|
|
|
|
const marginRight = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.right) ?? '0px';
|
|
|
|
|
const marginTop = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.top) || '0px';
|
|
|
|
|
const marginBottom = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.bottom) || '0px';
|
|
|
|
|
const marginLeft = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.left) || '0px';
|
|
|
|
|
const marginRight = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.margini?.right) || '0px';
|
|
|
|
|
|
|
|
|
|
const paddingTop = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.top) ?? '0px';
|
|
|
|
|
const paddingBottom = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.bottom) ?? '0px';
|
|
|
|
|
const paddingLeft = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.left) ?? '0px';
|
|
|
|
|
const paddingRight = tools.adjustSize(props.optcatalogo, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.right) ?? '0px';
|
|
|
|
|
const paddingTop = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.top) || '0px';
|
|
|
|
|
const paddingBottom = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.bottom) || '0px';
|
|
|
|
|
const paddingLeft = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.left) || '0px';
|
|
|
|
|
const paddingRight = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.scheda_prodotto?.padding?.right) || '0px';
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
placeContent,
|
|
|
|
|
@@ -997,7 +917,6 @@ export default defineComponent({
|
|
|
|
|
return page && page.length > 0 && page[0] && page[0].length > 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(mounted)
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
@@ -1033,7 +952,6 @@ export default defineComponent({
|
|
|
|
|
mycolumns,
|
|
|
|
|
tabvisu,
|
|
|
|
|
getSearchText,
|
|
|
|
|
generatePDF,
|
|
|
|
|
pdfContent,
|
|
|
|
|
tabcatalogo,
|
|
|
|
|
groupedPages,
|
|
|
|
|
@@ -1048,6 +966,8 @@ export default defineComponent({
|
|
|
|
|
getStyleRowSeparator,
|
|
|
|
|
generateStyleByPageDim,
|
|
|
|
|
containsProducts,
|
|
|
|
|
updateOptCatalogo,
|
|
|
|
|
optcatalogo,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|