- Ricerca Titolo per nome o autore o ISBN o codice articolo
This commit is contained in:
@@ -84,7 +84,6 @@ body {
|
||||
.book-author {
|
||||
font-family: 'DINPro-Condensed-Regular', sans-serif;
|
||||
font-size: calc(16 * var(--scalecatalog) * 1px);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.book-descr {
|
||||
@@ -95,7 +94,7 @@ body {
|
||||
.book-details {
|
||||
font-family: 'DINPro-Condensed-Regular', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(13 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
@@ -121,8 +120,18 @@ body {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(20 * var(--scalecatalog) * 1px);
|
||||
height: calc(380 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
.book-text-down {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
.book-pagina-title {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
color: white;
|
||||
margin-top: calc(20 * var(--scalecatalog) * 1px);
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(35 * var(--scalecatalog) * 1px);
|
||||
height: calc(100 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
@@ -14,11 +14,13 @@ import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { CProductCard } from '@src/components/CProductCard'
|
||||
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CProductTable } from '@src/components/CProductTable'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import type {
|
||||
IOptCatalogo, IDimensioni, IFilterCatalogo,
|
||||
IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog, IImg
|
||||
IMyScheda, IProdView, IProduct, ISchedaSingola, ISearchList, ICatalog, IImg,
|
||||
IText
|
||||
} from 'model';
|
||||
import {
|
||||
IMyPage,
|
||||
@@ -28,10 +30,11 @@ import {
|
||||
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
import { useCatalogStore } from '@src/store/CatalogStore'
|
||||
import { Catalogo } from '.';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Catalogo',
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect, CProductTable },
|
||||
emits: ['update:modelValue', 'updateCatalogo'],
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -98,7 +101,7 @@ export default defineComponent({
|
||||
const catalogStore = useCatalogStore()
|
||||
|
||||
const tabvisu = ref('categorie')
|
||||
const tabcatalogo = ref('visu')
|
||||
const tabcatalogo = ref()
|
||||
|
||||
const searchList = ref([] as ISearchList[])
|
||||
|
||||
@@ -112,6 +115,10 @@ export default defineComponent({
|
||||
|
||||
const isFixed = ref(false);
|
||||
|
||||
watch(() => tabcatalogo.value, () => {
|
||||
tools.setCookie('TAB_CAT', tabcatalogo.value)
|
||||
})
|
||||
|
||||
const labelcombo = computed(() => (item: any) => {
|
||||
let lab = item.label
|
||||
if (item.showcount)
|
||||
@@ -150,10 +157,37 @@ export default defineComponent({
|
||||
|
||||
})
|
||||
|
||||
function getTextSostituito(testo: IText) {
|
||||
const replacements = {
|
||||
'{titolo_catalogo}': getTitoloCatalogo() || '',
|
||||
};
|
||||
|
||||
// Esegue le sostituzioni
|
||||
let result = testo.contenuto;
|
||||
for (const [key, value] of Object.entries(replacements)) {
|
||||
result = result.replace(new RegExp(key, 'g'), value);
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
const getTitoloPagina = computed(() => (product: IProduct, recscheda: ISchedaSingola) => {
|
||||
|
||||
let testo = getTextSostituito(recscheda.scheda!.dimensioni.pagina?.testo_title)
|
||||
|
||||
return testo
|
||||
|
||||
})
|
||||
|
||||
const getCatalogoByMyPage = computed(() => {
|
||||
return catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage)
|
||||
})
|
||||
|
||||
const lista_prodotti = computed(() => {
|
||||
const arr = catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage)
|
||||
return arr?.lista_prodotti
|
||||
})
|
||||
|
||||
const ispageCatalogata = computed(() => {
|
||||
return !!getCatalogoByMyPage.value
|
||||
})
|
||||
@@ -432,13 +466,13 @@ export default defineComponent({
|
||||
filtroProductTypes: number[],
|
||||
filtroExcludeProductTypes: number[],
|
||||
editore: string[],
|
||||
idCollane: string[],
|
||||
idCollane: number[],
|
||||
arrargomstr: any[],
|
||||
catstr: string,
|
||||
gasselstr: string,
|
||||
cosaValue: any,
|
||||
sortField?: string,
|
||||
sortDir?: string
|
||||
sortDir?: number
|
||||
): IProduct[] {
|
||||
const lowerSearchTexts = Array.isArray(searchtext)
|
||||
? searchtext.map((text: string) => text.toLowerCase().trim().replace(/[-@:=]/g, ''))
|
||||
@@ -449,9 +483,9 @@ export default defineComponent({
|
||||
const boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0;
|
||||
const boolfiltroVuotoEditore = editore.length === 0;
|
||||
const boolfiltroVuotoCollane = idCollane.length === 0;
|
||||
const boolfiltroVuotoArgomenti = arrargomstr.length === 0;
|
||||
// const boolfiltroVuotoArgomenti = arrargomstr.length === 0;
|
||||
|
||||
return products
|
||||
const arrris = products
|
||||
.filter((product: IProduct) => {
|
||||
if (!product || !product.productInfo) {
|
||||
console.error('product or product.productInfo is null');
|
||||
@@ -512,9 +546,9 @@ export default defineComponent({
|
||||
productgassel &&
|
||||
hasProductTypes &&
|
||||
(
|
||||
hasPublished ||
|
||||
hasCollana ||
|
||||
hasCategoria ||
|
||||
hasPublished &&
|
||||
hasCollana &&
|
||||
hasCategoria &&
|
||||
hasArgomentiCat
|
||||
)
|
||||
&&
|
||||
@@ -522,11 +556,19 @@ export default defineComponent({
|
||||
);
|
||||
})
|
||||
.sort((a, b) => getProductsSorted([a, b], sortField, sortDir)[0] === a ? -1 : 1);
|
||||
|
||||
console.log(' Filtro=' + arrargomstr)
|
||||
console.log(' idCollane=' + idCollane)
|
||||
console.log('PRODOTTI FILTRATI:', arrris.length)
|
||||
|
||||
return arrris
|
||||
}
|
||||
|
||||
function calcArrProducts() {
|
||||
function calcArrProducts(generalista?: boolean) {
|
||||
console.log('calcArrProducts (generalista=' + generalista + ')')
|
||||
|
||||
const searchtext = getSearchText();
|
||||
let arrprod = productStore.getProducts(cosa.value) || [];
|
||||
let arrprod = [];
|
||||
const filtroAuthor = filter.value.author || '';
|
||||
const filtroProductTypes = optcatalogo.value.productTypes || [0];
|
||||
const filtroExcludeProductTypes = optcatalogo.value.excludeproductTypes || [0];
|
||||
@@ -540,29 +582,52 @@ export default defineComponent({
|
||||
const catstr = cat.value || '';
|
||||
const gasselstr = cosa.value === shared_consts.PROD.GAS ? idGasSel.value || '' : '';
|
||||
|
||||
arrprod = filterProducts(
|
||||
arrprod,
|
||||
searchtext,
|
||||
filtroAuthor,
|
||||
filtroProductTypes,
|
||||
filtroExcludeProductTypes,
|
||||
filtroPublishers,
|
||||
filtroCollane,
|
||||
arrargomstr,
|
||||
catstr,
|
||||
gasselstr,
|
||||
cosa.value,
|
||||
filter.value.sort_field,
|
||||
filter.value.sort_dir
|
||||
);
|
||||
let salva = false
|
||||
// Se nel catalogo è stato già generato, allora gli passo quello.
|
||||
const trovatocatalogo = getCatalogoByMyPage.value
|
||||
|
||||
if (trovatocatalogo.lista_prodotti.length === 0) {
|
||||
generalista = true
|
||||
}
|
||||
|
||||
if (!generalista && (trovatocatalogo.lista_prodotti.length > 0)) {
|
||||
arrprod = trovatocatalogo.lista_prodotti
|
||||
} else {
|
||||
arrprod = productStore.getProducts(cosa.value)
|
||||
arrprod = filterProducts(
|
||||
arrprod,
|
||||
searchtext,
|
||||
filtroAuthor,
|
||||
filtroProductTypes,
|
||||
filtroExcludeProductTypes,
|
||||
filtroPublishers,
|
||||
filtroCollane,
|
||||
arrargomstr,
|
||||
catstr,
|
||||
gasselstr,
|
||||
cosa.value,
|
||||
filter.value.sort_field,
|
||||
filter.value.sort_dir
|
||||
);
|
||||
|
||||
salva = true
|
||||
}
|
||||
|
||||
arrProducts.value = arrprod;
|
||||
|
||||
console.log('arrprod', arrprod)
|
||||
|
||||
populateDataWithlinkIdTemplate();
|
||||
generatearrProdToViewSorted();
|
||||
generatearrProdToViewSorted(!generalista, salva);
|
||||
loaddata();
|
||||
|
||||
refreshpage.value = false;
|
||||
}
|
||||
|
||||
function generaListaLibri() {
|
||||
calcArrProducts(true)
|
||||
}
|
||||
|
||||
function getProductsFilteredByScheda(scheda: IMyScheda): IProduct[] {
|
||||
let arrprod = productStore.getProducts(cosa.value) || [];
|
||||
const filtroAuthor = filter.value.author || '';
|
||||
@@ -578,21 +643,27 @@ export default defineComponent({
|
||||
const catstr = cat.value || '';
|
||||
const gasselstr = cosa.value === shared_consts.PROD.GAS ? idGasSel.value || '' : '';
|
||||
|
||||
arrprod = filterProducts(
|
||||
arrprod,
|
||||
scheda.arrProdottiSpeciali || [],
|
||||
filtroAuthor,
|
||||
filtroProductTypes,
|
||||
filtroExcludeProductTypes,
|
||||
filtroPublishers,
|
||||
filtroCollane,
|
||||
arrargomstr,
|
||||
catstr,
|
||||
gasselstr,
|
||||
cosa.value,
|
||||
scheda?.sort_field,
|
||||
scheda?.sort_dir
|
||||
);
|
||||
const trovatocatalogo = getCatalogoByMyPage.value
|
||||
if (trovatocatalogo.lista_prodotti.length > 0) {
|
||||
arrprod = trovatocatalogo.lista_prodotti
|
||||
} else {
|
||||
|
||||
arrprod = filterProducts(
|
||||
arrprod,
|
||||
scheda.arrProdottiSpeciali || [],
|
||||
filtroAuthor,
|
||||
filtroProductTypes,
|
||||
filtroExcludeProductTypes,
|
||||
filtroPublishers,
|
||||
filtroCollane,
|
||||
arrargomstr,
|
||||
catstr,
|
||||
gasselstr,
|
||||
cosa.value,
|
||||
scheda?.sort_field,
|
||||
scheda?.sort_dir
|
||||
);
|
||||
}
|
||||
|
||||
return arrprod;
|
||||
}
|
||||
@@ -671,22 +742,31 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function generatearrProdToViewSorted() {
|
||||
// console.log('generatearrProdToViewSorted...')
|
||||
function generatearrProdToViewSorted(usaprodottiSalvati?: boolean, salva?: boolean) {
|
||||
console.log('generatearrProdToViewSorted... usaprodottiSalvati=', usaprodottiSalvati, ' salva=', salva)
|
||||
|
||||
try {
|
||||
|
||||
// Svuota
|
||||
arrProdToView.value = []
|
||||
|
||||
// gia filtrati
|
||||
const arrGeneraleProdotti = arrProducts.value;
|
||||
const trovatocatalogo = getCatalogoByMyPage.value
|
||||
|
||||
let arrGeneraleProdotti = []
|
||||
|
||||
if (usaprodottiSalvati) {
|
||||
|
||||
} else {
|
||||
arrGeneraleProdotti = arrProducts.value;
|
||||
}
|
||||
|
||||
let indprod = 0
|
||||
const indprodGenerale = 0
|
||||
|
||||
let indtotale = 0
|
||||
|
||||
let arrprod = []
|
||||
|
||||
for (const recscheda of optcatalogo.value.arrSchede!) {
|
||||
if (recscheda && recscheda.scheda) {
|
||||
const schedePerRiga = recscheda.scheda.numschede_perRiga || 1
|
||||
@@ -695,17 +775,21 @@ export default defineComponent({
|
||||
|
||||
let arrProdFiltrati: IProduct[] = []
|
||||
|
||||
if (recscheda.scheda.productTypes!.length > 0) {
|
||||
// Filtra i prodotti in base ai filtri impostati !
|
||||
arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
|
||||
indprod = 0
|
||||
if (usaprodottiSalvati && trovatocatalogo.lista_prodotti.length > 0) {
|
||||
arrProdFiltrati = trovatocatalogo.lista_prodotti
|
||||
} else {
|
||||
if (recscheda.scheda.sort_field!) {
|
||||
arrProdFiltrati = getProductsSorted(arrGeneraleProdotti, recscheda.scheda.sort_field, recscheda.scheda.sort_dir);
|
||||
if (recscheda.scheda.productTypes!.length > 0) {
|
||||
// Filtra i prodotti in base ai filtri impostati !
|
||||
arrProdFiltrati = getProductsFilteredByScheda(recscheda.scheda)
|
||||
indprod = 0
|
||||
} else {
|
||||
indprod = indprodGenerale
|
||||
arrProdFiltrati = arrGeneraleProdotti
|
||||
if (recscheda.scheda.sort_field!) {
|
||||
arrProdFiltrati = getProductsSorted(arrGeneraleProdotti, recscheda.scheda.sort_field, recscheda.scheda.sort_dir);
|
||||
indprod = 0
|
||||
} else {
|
||||
indprod = indprodGenerale
|
||||
arrProdFiltrati = arrGeneraleProdotti
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,6 +821,8 @@ export default defineComponent({
|
||||
|
||||
// console.log('RANKING: ', result.myrec.indiceRanking!)
|
||||
|
||||
arrprod.push(result.myrec)
|
||||
|
||||
recscheda.arrProdToShow[pagina][riga][col] = result.myrec
|
||||
|
||||
indadded++
|
||||
@@ -772,6 +858,13 @@ export default defineComponent({
|
||||
|
||||
// console.log(' FINE - generatearrProdToViewSorted !')
|
||||
|
||||
|
||||
if (!usaprodottiSalvati && salva) {
|
||||
trovatocatalogo.lista_prodotti = arrprod
|
||||
|
||||
salvaListaProdotti(false)
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Err', e)
|
||||
}
|
||||
@@ -779,6 +872,24 @@ export default defineComponent({
|
||||
// console.log('Fine...')
|
||||
}
|
||||
|
||||
function salvaListaProdotti(ricarica: boolean) {
|
||||
// Estrai solo gli ID dei prodotti filtrati
|
||||
const myarr = [...getCatalogoByMyPage.value.lista_prodotti]
|
||||
const productIds = myarr.map(product => product._id);
|
||||
|
||||
let mydata = {
|
||||
lista_prodotti: productIds
|
||||
}
|
||||
|
||||
// Salva gli ID dei prodotti nel catalogo
|
||||
tools.saveFieldToServer($q, 'catalogs', getCatalogoByMyPage.value._id, mydata, true, false)
|
||||
|
||||
|
||||
if (ricarica) {
|
||||
generatearrProdToViewSorted(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
function getNextProd() {
|
||||
const nextRecord = arrProdToView.value.find((rec: any) => !rec.showed)
|
||||
|
||||
@@ -810,6 +921,9 @@ export default defineComponent({
|
||||
|
||||
async function mounted() {
|
||||
// console.log('mounted Catalogo')
|
||||
|
||||
tabcatalogo.value = tools.getCookie('TAB_CAT', 'visu')
|
||||
|
||||
loadpage.value = false
|
||||
await productStore.loadProducts()
|
||||
|
||||
@@ -1119,6 +1233,12 @@ export default defineComponent({
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
function updateProducts(arr: any) {
|
||||
getCatalogoByMyPage.value.lista_prodotti = [...arr]
|
||||
|
||||
salvaListaProdotti(true)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -1174,6 +1294,10 @@ export default defineComponent({
|
||||
ispageCatalogata,
|
||||
naviga,
|
||||
getTitoloCatalogo,
|
||||
getTitoloPagina,
|
||||
generaListaLibri,
|
||||
lista_prodotti,
|
||||
updateProducts,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,7 +12,18 @@
|
||||
dense
|
||||
class="bg-green text-white"
|
||||
>
|
||||
<q-tab name="visu" icon="fas fa-eye" label="Visualizza"> </q-tab>
|
||||
<q-tab
|
||||
name="visu"
|
||||
icon="fas fa-eye"
|
||||
label="Visualizza"
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
name="lista"
|
||||
icon="fas fa-list"
|
||||
label="Lista"
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
v-if="tools.isGrafico()"
|
||||
name="sfondo"
|
||||
@@ -27,11 +38,39 @@
|
||||
label="Pagine"
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab name="tutorial" icon="fas fa-info" label="Tutorial"> </q-tab>
|
||||
<q-tab name="opzioni" icon="fas fa-save" label="Avanzati"> </q-tab>
|
||||
<q-tab
|
||||
name="tutorial"
|
||||
icon="fas fa-info"
|
||||
label="Tutorial"
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
name="opzioni"
|
||||
icon="fas fa-save"
|
||||
label="Avanzati"
|
||||
>
|
||||
</q-tab>
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tabcatalogo" animated class="" keep-alive>
|
||||
<q-tab-panel name="visu" v-if="optcatalogo">
|
||||
<q-tab-panels
|
||||
v-model="tabcatalogo"
|
||||
animated
|
||||
class=""
|
||||
keep-alive
|
||||
>
|
||||
<q-tab-panel
|
||||
name="lista"
|
||||
v-if="optcatalogo"
|
||||
>
|
||||
<CProductTable
|
||||
:lista_prodotti="lista_prodotti"
|
||||
@update:lista_prodotti="updateProducts"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel
|
||||
name="visu"
|
||||
v-if="optcatalogo"
|
||||
>
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div class="text-center">
|
||||
<q-spinner
|
||||
@@ -41,7 +80,10 @@
|
||||
:thickness="2"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="loadpage" class="panel">
|
||||
<div
|
||||
v-if="loadpage"
|
||||
class="panel"
|
||||
>
|
||||
<div class="container">
|
||||
<q-tabs
|
||||
v-if="!ispageCatalogata"
|
||||
@@ -54,7 +96,12 @@
|
||||
icon="fas fa-folder-open"
|
||||
label="Categorie"
|
||||
>
|
||||
<q-badge v-if="cat" color="red" floating>1</q-badge>
|
||||
<q-badge
|
||||
v-if="cat"
|
||||
color="red"
|
||||
floating
|
||||
>1</q-badge
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
v-if="!ispageCatalogata"
|
||||
@@ -62,7 +109,12 @@
|
||||
icon="fas fa-user"
|
||||
label="Autori"
|
||||
>
|
||||
<q-badge v-if="filter.author" color="red" floating>1</q-badge>
|
||||
<q-badge
|
||||
v-if="filter.author"
|
||||
color="red"
|
||||
floating
|
||||
>1</q-badge
|
||||
>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
v-if="!ispageCatalogata"
|
||||
@@ -70,15 +122,29 @@
|
||||
icon="fas fa-search"
|
||||
label="Cerca"
|
||||
>
|
||||
<q-badge v-if="getSearchText()" color="red" floating
|
||||
<q-badge
|
||||
v-if="getSearchText()"
|
||||
color="red"
|
||||
floating
|
||||
>1</q-badge
|
||||
>
|
||||
</q-tab>
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tabvisu" animated class="" keep-alive>
|
||||
<q-tab-panel v-if="!ispageCatalogata" name="categorie">
|
||||
<q-tab-panels
|
||||
v-model="tabvisu"
|
||||
animated
|
||||
class=""
|
||||
keep-alive
|
||||
>
|
||||
<q-tab-panel
|
||||
v-if="!ispageCatalogata"
|
||||
name="categorie"
|
||||
>
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div v-for="(reccat, index) in getCatProds()" :key="index">
|
||||
<div
|
||||
v-for="(reccat, index) in getCatProds()"
|
||||
:key="index"
|
||||
>
|
||||
<span
|
||||
:class="{
|
||||
category: true,
|
||||
@@ -150,26 +216,15 @@
|
||||
<CMySelect
|
||||
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
|
||||
v-if="
|
||||
item.type === costanti.FieldType.select ||
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:label="
|
||||
item.value && item.value._id > 0
|
||||
? undefined
|
||||
: labelcombo(item)
|
||||
item.type === costanti.FieldType.select || item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:label="item.value && item.value._id > 0 ? undefined : labelcombo(item)"
|
||||
v-model:value="item.value"
|
||||
:addall="item.addall"
|
||||
:addnone="item.addnone"
|
||||
:addlast="true"
|
||||
:tablesel="
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
? item.tablesel
|
||||
: ''
|
||||
"
|
||||
:pickup="
|
||||
item.type === costanti.FieldType.select_by_server
|
||||
"
|
||||
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
|
||||
:pickup="item.type === costanti.FieldType.select_by_server"
|
||||
:label-color="$q.dark.isActive ? 'white' : 'black'"
|
||||
myclass="comboselector"
|
||||
color="primary"
|
||||
@@ -181,10 +236,7 @@
|
||||
:filter="item.filter"
|
||||
:filter_extra="item.filter_extra"
|
||||
style="font-size: 0.8rem !important"
|
||||
:useinput="
|
||||
item.useinput &&
|
||||
item.type !== costanti.FieldType.select_by_server
|
||||
"
|
||||
:useinput="item.useinput && item.type !== costanti.FieldType.select_by_server"
|
||||
>
|
||||
</CMySelect>
|
||||
</div>
|
||||
@@ -220,17 +272,17 @@
|
||||
</div>
|
||||
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<span
|
||||
v-show="productStore.getNumProdTot() !== arrProducts.length"
|
||||
>{{
|
||||
t("ecomm.prodotti_trovati", {
|
||||
qta: arrProducts.length,
|
||||
qtatot: productStore.getNumProdTot(),
|
||||
})
|
||||
}}</span
|
||||
>
|
||||
<span v-show="productStore.getNumProdTot() !== arrProducts.length">{{
|
||||
t('ecomm.prodotti_trovati', {
|
||||
qta: arrProducts.length,
|
||||
qtatot: productStore.getNumProdTot(),
|
||||
})
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="row justify-around" v-if="tools.isManager() && false">
|
||||
<div
|
||||
class="row justify-around"
|
||||
v-if="tools.isManager() && false"
|
||||
>
|
||||
<q-toggle
|
||||
v-if="!optcatalogo.pdf"
|
||||
v-model="show_hide"
|
||||
@@ -254,20 +306,14 @@
|
||||
optcatalogo.first_page.text_html &&
|
||||
optcatalogo.first_page.text_html.contenuto
|
||||
"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.first_page)
|
||||
"
|
||||
:style="generateStyleByPageDim(optcatalogo, optcatalogo.first_page)"
|
||||
>
|
||||
<div
|
||||
v-html="optcatalogo.first_page.text_html.contenuto"
|
||||
></div>
|
||||
<div v-html="optcatalogo.first_page.text_html.contenuto"></div>
|
||||
</div>
|
||||
<div :style="generateStyleCatalogo(optcatalogo)">
|
||||
<div class="flex-container-book">
|
||||
<q-infinite-scroll
|
||||
v-if="
|
||||
!optcatalogo.pdf && arrLoaded && arrLoaded.length > 0
|
||||
"
|
||||
v-if="!optcatalogo.pdf && arrLoaded && arrLoaded.length > 0"
|
||||
ref="myinfscroll"
|
||||
:initial-index="0"
|
||||
@load="onLoadScroll"
|
||||
@@ -276,14 +322,14 @@
|
||||
class="row items-start"
|
||||
style="place-content: center"
|
||||
>
|
||||
<div v-for="(product, index) in arrLoaded" :key="index">
|
||||
<div
|
||||
v-for="(product, index) in arrLoaded"
|
||||
:key="index"
|
||||
>
|
||||
<CContainerCatalogoCard
|
||||
v-if="
|
||||
product.active ||
|
||||
(show_hide &&
|
||||
product.productInfo.productTypes.includes(
|
||||
shared_consts.PRODUCTTYPE.PRODUCT
|
||||
))
|
||||
(show_hide && product.productInfo.productTypes.includes(shared_consts.PRODUCTTYPE.PRODUCT))
|
||||
"
|
||||
:id="product._id"
|
||||
:product="product"
|
||||
@@ -310,16 +356,20 @@
|
||||
</div>
|
||||
<template v-slot:loading>
|
||||
<div class="text-center">
|
||||
<q-spinner-dots color="primary" size="40px" />
|
||||
<q-spinner-dots
|
||||
color="primary"
|
||||
size="40px"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</q-infinite-scroll>
|
||||
<div v-else class="cards-container">
|
||||
<div
|
||||
v-else
|
||||
class="cards-container"
|
||||
>
|
||||
<!-- Itera sulle schede -->
|
||||
<div
|
||||
v-for="(
|
||||
recscheda, schedaIndex
|
||||
) in optcatalogo.arrSchede"
|
||||
v-for="(recscheda, schedaIndex) in optcatalogo.arrSchede"
|
||||
:key="schedaIndex"
|
||||
>
|
||||
<div v-if="recscheda && recscheda.scheda">
|
||||
@@ -335,23 +385,34 @@
|
||||
'fixed-height': true,
|
||||
'card-page': false,
|
||||
}"
|
||||
:style="
|
||||
generateStylePageScheda(
|
||||
optcatalogo,
|
||||
recscheda.scheda
|
||||
)
|
||||
"
|
||||
:style="generateStylePageScheda(optcatalogo, recscheda.scheda)"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up
|
||||
?.contenuto
|
||||
"
|
||||
v-if="recscheda.scheda.dimensioni.pagina?.testo_title?.contenuto"
|
||||
:style="{
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height':
|
||||
recscheda.scheda.dimensioni.pagina?.testo_up
|
||||
?.font.line_height,
|
||||
'line-height': recscheda.scheda.dimensioni.pagina?.testo_title?.font.line_height,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
position: 'relative', // Posizionamento assoluto
|
||||
top: '0', // Posiziona in alto
|
||||
left: '50%', // Centra orizzontalmente
|
||||
transform: 'translateX(-50%)', // Correzione per centrare perfettamente
|
||||
width: '100%', // Assicura che il contenitore occupi l'intera larghezza
|
||||
textAlign: 'center', // Allinea il testo al centro
|
||||
zIndex: '10', // Assicura che il testo sia visibile sopra altri elementi
|
||||
}"
|
||||
>
|
||||
<div
|
||||
v-html="getTitoloPagina(null, recscheda)"
|
||||
style="display: flex; flex-direction: row; justify-content: center"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
v-if="recscheda.scheda.dimensioni.pagina?.testo_up?.contenuto"
|
||||
:style="{
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': recscheda.scheda.dimensioni.pagina?.testo_up?.font.line_height,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}"
|
||||
@@ -401,9 +462,7 @@
|
||||
@selauthor="selauthor"
|
||||
/>
|
||||
<CProductCard
|
||||
v-else-if="
|
||||
prod && (prod.active || show_hide)
|
||||
"
|
||||
v-else-if="prod && (prod.active || show_hide)"
|
||||
:id="prod._id"
|
||||
:complete="false"
|
||||
:cosa="cosa"
|
||||
@@ -414,18 +473,13 @@
|
||||
|
||||
<!-- Separatore -->
|
||||
<div
|
||||
v-if="
|
||||
recscheda.scheda?.show_separatore &&
|
||||
rowIndex !== page.length - 1
|
||||
"
|
||||
v-if="recscheda.scheda?.show_separatore && rowIndex !== page.length - 1"
|
||||
class="text-center"
|
||||
:style="getStyleRow(recscheda)"
|
||||
>
|
||||
<q-separator
|
||||
inset
|
||||
:size="
|
||||
tools.adjustSize(optcatalogo, '1px')
|
||||
"
|
||||
:size="tools.adjustSize(optcatalogo, '1px')"
|
||||
></q-separator>
|
||||
</div>
|
||||
</div>
|
||||
@@ -446,9 +500,7 @@
|
||||
optcatalogo.last_page.text_html &&
|
||||
optcatalogo.last_page.text_html.contenuto
|
||||
"
|
||||
:style="
|
||||
generateStyleByPageDim(optcatalogo, optcatalogo.last_page)
|
||||
"
|
||||
:style="generateStyleByPageDim(optcatalogo, optcatalogo.last_page)"
|
||||
>
|
||||
<div v-html="optcatalogo.last_page.text_html.contenuto"></div>
|
||||
</div>
|
||||
@@ -461,19 +513,13 @@
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div>
|
||||
Sfondo:
|
||||
{{
|
||||
tools.getDirUpload() +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
|
||||
}}
|
||||
{{ tools.getDirUpload() + costanti.DIR_CATALOGO + optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile }}
|
||||
</div>
|
||||
|
||||
<q-img
|
||||
v-if="optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile"
|
||||
:src="
|
||||
tools.getDirUpload() +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
|
||||
tools.getDirUpload() + costanti.DIR_CATALOGO + optcatalogo.dimensioni_def?.pagina.imgsfondo?.imagefile
|
||||
"
|
||||
>
|
||||
</q-img>
|
||||
@@ -483,37 +529,17 @@
|
||||
<div class="row justify-center q-mx-auto bg-blue-1">
|
||||
<div>
|
||||
Prima Pagina:
|
||||
{{
|
||||
tools.getDirUpload() +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.first_page.imgsfondo.imagefile
|
||||
}}
|
||||
{{ tools.getDirUpload() + costanti.DIR_CATALOGO + optcatalogo.first_page.imgsfondo.imagefile }}
|
||||
</div>
|
||||
|
||||
<q-img
|
||||
:src="
|
||||
tools.getDirUpload() +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.first_page.imgsfondo.imagefile
|
||||
"
|
||||
>
|
||||
<q-img :src="tools.getDirUpload() + costanti.DIR_CATALOGO + optcatalogo.first_page.imgsfondo.imagefile">
|
||||
</q-img>
|
||||
<div>
|
||||
Ultima Pagina:
|
||||
{{
|
||||
tools.getDirUpload() +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.last_page.imgsfondo.imagefile
|
||||
}}
|
||||
{{ tools.getDirUpload() + costanti.DIR_CATALOGO + optcatalogo.last_page.imgsfondo.imagefile }}
|
||||
</div>
|
||||
|
||||
<q-img
|
||||
:src="
|
||||
tools.getDirUpload() +
|
||||
costanti.DIR_CATALOGO +
|
||||
optcatalogo.last_page.imgsfondo.imagefile
|
||||
"
|
||||
>
|
||||
<q-img :src="tools.getDirUpload() + costanti.DIR_CATALOGO + optcatalogo.last_page.imgsfondo.imagefile">
|
||||
</q-img>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
@@ -528,6 +554,12 @@
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="opzioni">
|
||||
<q-btn
|
||||
rounded
|
||||
label="Genera Lista Libri"
|
||||
color="primary"
|
||||
@click="generaListaLibri()"
|
||||
></q-btn>
|
||||
<pre>
|
||||
<strong>PASSI DA COMPIERE PER FARE AGGIORNAMENTI :</strong>
|
||||
|
||||
@@ -606,9 +638,8 @@
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./catalogo.ts">
|
||||
</script>
|
||||
<script lang="ts" src="./catalogo.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./catalogo.scss";
|
||||
@import './catalogo.scss';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user