- modifiche al catalogo
- tolta la richiesta di accettazione dei RIS, che ora vengono accettati automaticamente.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
export const shared_consts = {
|
||||
|
||||
Accepted: {
|
||||
CHECK_READ_GUIDELINES: {
|
||||
value: 1,
|
||||
@@ -2173,18 +2172,7 @@ export const shared_consts = {
|
||||
PDF: 107,
|
||||
STREAMING: 108,
|
||||
},
|
||||
|
||||
VERSIONE: {
|
||||
NUOVO: 1,
|
||||
USATO: 2,
|
||||
DOWNLOAD: 3,
|
||||
DVD: 4,
|
||||
EPUB: 5,
|
||||
MOBI: 6,
|
||||
PDF: 7,
|
||||
STREAMING: 8,
|
||||
},
|
||||
|
||||
|
||||
VERSIONI_PRODOTTO: [
|
||||
{
|
||||
label: '[Nessuno]',
|
||||
@@ -2193,42 +2181,42 @@ export const shared_consts = {
|
||||
},
|
||||
{
|
||||
label: 'Nuovo',
|
||||
value: 1,
|
||||
value: 101,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
label: 'Usato',
|
||||
value: 2,
|
||||
value: 102,
|
||||
color: 'orange-9',
|
||||
},
|
||||
{
|
||||
label: 'Download',
|
||||
value: 3,
|
||||
value: 103,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
label: 'DVD',
|
||||
value: 4,
|
||||
value: 104,
|
||||
color: 'secondary',
|
||||
},
|
||||
{
|
||||
label: 'EPUB',
|
||||
value: 5,
|
||||
value: 105,
|
||||
color: 'orange',
|
||||
},
|
||||
{
|
||||
label: 'MOBI',
|
||||
value: 6,
|
||||
value: 106,
|
||||
color: 'indigo',
|
||||
},
|
||||
{
|
||||
label: 'PDF',
|
||||
value: 7,
|
||||
value: 107,
|
||||
color: 'purple',
|
||||
},
|
||||
{
|
||||
label: 'Streaming',
|
||||
value: 8,
|
||||
value: 108,
|
||||
color: 'red',
|
||||
},
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export default defineComponent({
|
||||
components: { Catalogo },
|
||||
props: {
|
||||
// add options ICatalogo
|
||||
options: {
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
|
||||
@@ -493,7 +493,7 @@ export default defineComponent({
|
||||
emit('opendetail')
|
||||
}
|
||||
function escludiArticolo(variazione: IVariazione) {
|
||||
let hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (variazione.arrversioni || []).every((item: any) => props.optcatalogo.excludeproductTypes.includes(item)))
|
||||
let hasExcludeProductTypes = !props.optcatalogo.excludeproductTypes || (props.optcatalogo.excludeproductTypes && (props.optcatalogo.excludeproductTypes.includes(variazione.versione!)))
|
||||
|
||||
return hasExcludeProductTypes
|
||||
}
|
||||
|
||||
@@ -23,8 +23,19 @@
|
||||
dense
|
||||
>
|
||||
</q-toggle>
|
||||
<q-page-sticky v-if="complete" position="bottom-right" :offset="[18, 0]">
|
||||
<q-btn fab icon="fas fa-arrow-up" class="semi-transparent" color="primary" v-close-popup/>
|
||||
<q-page-sticky
|
||||
v-if="complete"
|
||||
position="bottom-right"
|
||||
:offset="[18, 0]"
|
||||
style="z-index: 1000;"
|
||||
>
|
||||
<q-btn
|
||||
fab
|
||||
icon="fas fa-arrow-up"
|
||||
class="semi-transparent"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
/>
|
||||
</q-page-sticky>
|
||||
|
||||
<q-card-section>
|
||||
@@ -133,7 +144,7 @@
|
||||
Pagine: {{ myproduct.productInfo.numpages }}
|
||||
</div>
|
||||
<div v-if="myproduct.productInfo.publisher" class="book-pages">
|
||||
Casa Editrice: {{ myproduct.productInfo.publisher }}
|
||||
{{ myproduct.productInfo.publisher.name }}
|
||||
</div>
|
||||
<div
|
||||
v-if="myproduct.productInfo.date_publishing && complete"
|
||||
@@ -155,22 +166,23 @@
|
||||
:key="index"
|
||||
@click="setvariazioneSelected(index)"
|
||||
>
|
||||
<div v-if="checkIfVariazioneDaVisu(variazione)" class="flex justify-between items-center q-mx-sm">
|
||||
<div
|
||||
v-if="checkIfVariazioneDaVisu(variazione)"
|
||||
class="flex justify-between items-center q-mx-sm"
|
||||
>
|
||||
<q-badge
|
||||
class="q-badge--large"
|
||||
:color="
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]].color
|
||||
tools.getRecByVersioneProd(variazione.versione).color
|
||||
"
|
||||
>
|
||||
<q-icon
|
||||
v-if="variazione.arrversioni[0] > 0"
|
||||
:name="tools.getIconByVersione(variazione.arrversioni[0])"
|
||||
v-if="variazione.versione > 0"
|
||||
:name="tools.getIconByVersione(variazione.versione)"
|
||||
color="white"
|
||||
></q-icon
|
||||
>
|
||||
{{
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]].label
|
||||
}}
|
||||
{{ tools.getRecByVersioneProd(variazione.versione).label }}
|
||||
</q-badge>
|
||||
<div v-if="variazione.formato && false">
|
||||
formato: {{ variazione.formato }}
|
||||
@@ -178,9 +190,6 @@
|
||||
<div v-if="variazione.tipologia && false">
|
||||
tipologia: {{ variazione.tipologia }}
|
||||
</div>
|
||||
<div v-if="variazione.edizione && false">
|
||||
edizione: {{ variazione.edizione }}
|
||||
</div>
|
||||
<div v-if="variazione.status && false">
|
||||
status: {{ variazione.status }}
|
||||
</div>
|
||||
@@ -244,7 +253,11 @@
|
||||
v-for="(variazione, index) of myproduct.arrvariazioni"
|
||||
:key="index"
|
||||
>
|
||||
<div v-show="indvariazSel == index && checkIfVariazioneDaVisu(variazione)">
|
||||
<div
|
||||
v-show="
|
||||
indvariazSel == index && checkIfVariazioneDaVisu(variazione)
|
||||
"
|
||||
>
|
||||
<div
|
||||
v-show="tools.disponibStr(variazione.quantita)"
|
||||
class="row justify-center q-mt-sm vertical-middle"
|
||||
@@ -282,14 +295,42 @@
|
||||
>
|
||||
<span class="q-mr-sm">{{ $t('products.formato') }}:</span>
|
||||
<q-badge
|
||||
v-show="variazione.arrversioni[0] > 0"
|
||||
v-show="variazione.versione > 0"
|
||||
:color="
|
||||
shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]]
|
||||
.color
|
||||
tools.getRecByVersioneProd(variazione.versione).color
|
||||
"
|
||||
>{{ variazione.formato }}</q-badge
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-show="!!variazione.edizione"
|
||||
class="row justify-center q-ma-sm vertical-middle"
|
||||
style="align-items: center"
|
||||
>
|
||||
<span class="q-mr-sm">{{ $t('products.edizione') }}:</span>
|
||||
{{ variazione.edizione }}
|
||||
</div>
|
||||
<div
|
||||
v-show="!!myproduct.isbn"
|
||||
class="row justify-center q-ma-sm vertical-middle"
|
||||
style="align-items: center"
|
||||
>
|
||||
<span class="q-mr-sm">{{ $t('products.isbn') }}:</span>
|
||||
{{ myproduct.isbn }}
|
||||
</div>
|
||||
<div
|
||||
v-show="!!myproduct.productInfo.publisher"
|
||||
class="row justify-center q-ma-sm vertical-middle"
|
||||
style="align-items: center"
|
||||
>
|
||||
<span class="q-mr-sm">{{ $t('products.editore') }}:</span>
|
||||
<q-badge
|
||||
:color="
|
||||
tools.getRecByVersioneProd(variazione.versione).color
|
||||
"
|
||||
>{{ myproduct.productInfo.publisher.name }}</q-badge
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="row justify-center q-mt-sm">
|
||||
<q-btn
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
|
||||
<div v-if="small">
|
||||
|
||||
<q-chip
|
||||
dense
|
||||
class="cltexth4 chipbooked shadow-5 q-pa-sm2"
|
||||
|
||||
@@ -30,6 +30,7 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { emitKeypressEvents } from 'readline'
|
||||
import { costanti } from '@costanti'
|
||||
import objectId from '@src/js/objectId'
|
||||
import { useProducts } from '@src/store/Products'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyEditElem',
|
||||
@@ -82,6 +83,8 @@ export default defineComponent({
|
||||
const enableAdd = ref(true)
|
||||
const tabadd = ref('tools')
|
||||
|
||||
const Products = useProducts()
|
||||
|
||||
const neworder = ref(<number | undefined>0)
|
||||
|
||||
const myel = toRef(props, 'myelem')
|
||||
@@ -314,6 +317,7 @@ export default defineComponent({
|
||||
tabElemsText,
|
||||
visuadd,
|
||||
tabadd,
|
||||
Products,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -998,7 +998,7 @@
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.productTypes"
|
||||
:options="tools.SelectListVersione"
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
@@ -1015,7 +1015,7 @@
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.excludeproductTypes"
|
||||
:options="tools.SelectListVersione"
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
@@ -1025,6 +1025,25 @@
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.Editore"
|
||||
:options="Products.publishers"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Editori"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
option-value="_id"
|
||||
option-label="name"
|
||||
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<meta name="description" content="<%= productDescription %>">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="version" content="1.0.49">
|
||||
<meta name="version" content="1.0.51">
|
||||
<meta name="viewport"
|
||||
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ export interface IProductInfo {
|
||||
idPublisher?: string
|
||||
publisher?: IPublisher
|
||||
date_publishing?: Date
|
||||
date_publishing_ts: number
|
||||
numpages?: number
|
||||
productTypes?: number[]
|
||||
versioneGM?: string
|
||||
@@ -44,7 +45,7 @@ export interface IProductInfo {
|
||||
|
||||
export interface IVariazione {
|
||||
active?: boolean
|
||||
arrversioni?: number[]
|
||||
versione?: number
|
||||
status?: string,
|
||||
price?: number
|
||||
sale_price?: number
|
||||
@@ -143,6 +144,7 @@ export interface IOrder {
|
||||
export interface IProductsState {
|
||||
products: IProduct[]
|
||||
authors: IAuthor[]
|
||||
publishers: IPublisher[]
|
||||
cart: ICart
|
||||
orders: IOrderCart[]
|
||||
catprods: ICatProd[]
|
||||
|
||||
@@ -96,6 +96,9 @@ const msg_it = {
|
||||
link_scheda: 'Link Scheda',
|
||||
addtocart_ext: 'Aggiungi',
|
||||
formato: 'Formato',
|
||||
edizione: 'Edizione',
|
||||
editore: 'Ediitore',
|
||||
isbn: 'ISBN',
|
||||
},
|
||||
storehouses: {
|
||||
name: 'Magazzino',
|
||||
@@ -1427,6 +1430,7 @@ const msg_it = {
|
||||
question_sendcoinsto: 'Inviare {qty} {coin} a {dest}?',
|
||||
question_sendcoinsto_from: 'Inviare {qty} {coin} da {from} a {dest}?',
|
||||
coins_sendrequest_sent: 'Richiesta d\'invio RIS avvenuto',
|
||||
coins_sent: 'Inviati {qty} {symbol} a {dest}',
|
||||
coins_sendrequest_failed: 'Richiesta d\'invio RIS non avvenuta, riprovare',
|
||||
coins_accepted: 'RIS accettati',
|
||||
coins_refused: 'RIS rifiutate',
|
||||
|
||||
@@ -262,7 +262,7 @@ export const costanti = {
|
||||
small: true,
|
||||
table: '',
|
||||
},
|
||||
{
|
||||
/*{
|
||||
visible: false,
|
||||
title: ' Attività ',
|
||||
subtitle: 'Artigiani, Aziende, Società, Negozi',
|
||||
@@ -275,7 +275,7 @@ export const costanti = {
|
||||
visuonstat: true,
|
||||
small: false,
|
||||
showfavorite: true,
|
||||
},
|
||||
},*/
|
||||
],
|
||||
|
||||
GROUPCARDS: [
|
||||
@@ -461,4 +461,19 @@ export const costanti = {
|
||||
TESTO_BORDATO: 5,
|
||||
},
|
||||
|
||||
SORT_ALPHA: 0,
|
||||
SORT_PUBDATE: 1,
|
||||
|
||||
|
||||
ORDINAMENTO_CATALOGHI: [
|
||||
{
|
||||
label: 'Data di Uscita',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: 'Alfabetico',
|
||||
value: 0,
|
||||
},
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
@@ -1392,12 +1392,6 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
SelectListVersione: [
|
||||
{ label: '[Tutti]', value: 0 },
|
||||
{ label: 'Nuovi', value: shared_consts.PRODUCTTYPE.NUOVO },
|
||||
{ label: 'Usati', value: shared_consts.PRODUCTTYPE.USATO },
|
||||
{ label: 'DVD', value: shared_consts.PRODUCTTYPE.DVD },
|
||||
],
|
||||
|
||||
INDEX_MENU_DELETE: 4,
|
||||
|
||||
@@ -6567,7 +6561,8 @@ export const tools = {
|
||||
userStore.my.profile.useraccounts = res.useraccounts
|
||||
}
|
||||
$router.push('/circuits')
|
||||
tools.showPositiveNotif($q, t('circuit.coins_sendrequest_sent'))
|
||||
tools.showPositiveNotif($q, t('circuit.coins_sent', {qty: sendcoinrec.qty, symbol: circuit.symbol, dest}))
|
||||
//tools.showPositiveNotif($q, t('circuit.coins_sendrequest_sent'))
|
||||
} else {
|
||||
tools.showNegativeNotif($q, res.errormsg)
|
||||
}
|
||||
@@ -8624,23 +8619,23 @@ export const tools = {
|
||||
|
||||
getIconByVersione(versione: number) {
|
||||
let str = ''
|
||||
if (versione === shared_consts.VERSIONE.NUOVO)
|
||||
if (versione === shared_consts.PRODUCTTYPE.NUOVO)
|
||||
str = 'fas fa-book'
|
||||
else if (versione === shared_consts.VERSIONE.USATO)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.USATO)
|
||||
// Versione Libro usato
|
||||
str = 'fas fa-book-open'
|
||||
else if (versione === shared_consts.VERSIONE.DOWNLOAD)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.DOWNLOAD)
|
||||
str = 'fas fa-file-download'
|
||||
else if (versione === shared_consts.VERSIONE.DVD)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.DVD)
|
||||
str = 'fas fa-film'
|
||||
else if (versione === shared_consts.VERSIONE.PDF)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.PDF)
|
||||
str = 'fas fa-file-pdf'
|
||||
else if (versione === shared_consts.VERSIONE.EPUB)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.EPUB)
|
||||
// Libro elettronico EPUB
|
||||
str = 'fas fa-book-open-reader'
|
||||
else if (versione === shared_consts.VERSIONE.DVD)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.DVD)
|
||||
str = 'fas fa-video'
|
||||
else if (versione === shared_consts.VERSIONE.STREAMING)
|
||||
else if (versione === shared_consts.PRODUCTTYPE.STREAMING)
|
||||
str = 'fas fa-stream'
|
||||
|
||||
return str
|
||||
@@ -8691,6 +8686,11 @@ export const tools = {
|
||||
return record
|
||||
},
|
||||
|
||||
getRecByVersioneProd(versione: number) {
|
||||
|
||||
return shared_consts.VERSIONI_PRODOTTO.find((rec: any) => rec.value === versione)
|
||||
}
|
||||
|
||||
// FINE !
|
||||
|
||||
// getLocale() {
|
||||
|
||||
@@ -109,6 +109,7 @@ export const useProducts = defineStore('Products', {
|
||||
catprods: [],
|
||||
catprods_gas: [],
|
||||
authors: [],
|
||||
publishers: [],
|
||||
subcatprods: [],
|
||||
productInfos: [],
|
||||
userActive: { username: '', name: '', surname: '', _id: '' },
|
||||
|
||||
@@ -341,6 +341,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'subcatprods') ris = Products.subcatprods
|
||||
else if (table === 'catprods_gas') ris = Products.catprods_gas
|
||||
else if (table === 'authors') ris = Products.authors
|
||||
else if (table === 'publishers') ris = Products.publishers
|
||||
else if (table === 'catais') ris = state.catAI
|
||||
else if (table === 'queryais') ris = state.queryAIList
|
||||
else if (table === 'sharewithus') ris = state.sharewithus
|
||||
@@ -1577,6 +1578,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
Products.subcatprods = (res.data.subcatprods) ? [...res.data.subcatprods] : []
|
||||
Products.catprods_gas = (res.data.catprods_gas) ? [...res.data.catprods_gas] : []
|
||||
Products.authors = (res.data.authors) ? [...res.data.authors] : []
|
||||
Products.publishers = (res.data.publishers) ? [...res.data.publishers] : []
|
||||
|
||||
this.gasordines = (res.data.gasordines) ? [...res.data.gasordines] : []
|
||||
this.scontisticas = (res.data.scontisticas) ? [...res.data.scontisticas] : []
|
||||
|
||||
@@ -21,7 +21,7 @@ import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
export default defineComponent({
|
||||
name: 'Catalogo',
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
|
||||
props: {
|
||||
props: {
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: false,
|
||||
@@ -48,6 +48,7 @@ export default defineComponent({
|
||||
|
||||
const filter = ref(<any>{
|
||||
author: '',
|
||||
sort: 1,
|
||||
publisher: '',
|
||||
type: '',
|
||||
ageGroup: ''
|
||||
@@ -135,6 +136,14 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => filter.value.sort, (newval, oldval) => {
|
||||
|
||||
calcArrProducts()
|
||||
if (tools.scrollTop() > 300) {
|
||||
tools.scrollToTopValue(300)
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => cosa.value, (newval, oldval) => {
|
||||
tools.setCookie(tools.COOK_COSA_PRODOTTI, cosa.value.toString())
|
||||
if (cosa.value !== shared_consts.PROD.TUTTI)
|
||||
@@ -146,7 +155,7 @@ export default defineComponent({
|
||||
const mialista = getSearchList()
|
||||
if (mialista && mialista.value && mialista.value.hasOwnProperty('name')) {
|
||||
mialista.value = null
|
||||
}
|
||||
}
|
||||
search.value = ''
|
||||
}
|
||||
|
||||
@@ -170,6 +179,7 @@ export default defineComponent({
|
||||
let arrprod = productStore.getProducts(cosa.value) || [];
|
||||
let filtroAuthor = filter.value.author || '';
|
||||
|
||||
|
||||
//++AddCATALOGO_FIELDS
|
||||
|
||||
let filtroProductTypes = props.optcatalogo.productTypes || [0]
|
||||
@@ -177,6 +187,9 @@ export default defineComponent({
|
||||
let boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
|
||||
let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
|
||||
|
||||
let filtroPublishers = props.optcatalogo.Editore || []
|
||||
let boolfiltroVuotoEditore = (filtroPublishers.length === 0)
|
||||
|
||||
//console.log('filtroVersione', filtroProductTypes)
|
||||
|
||||
let catstr = cat.value || ''
|
||||
@@ -187,7 +200,7 @@ export default defineComponent({
|
||||
}
|
||||
let lowerSearchText = (searchtext || '').toLowerCase().trim();
|
||||
lowerSearchText = lowerSearchText.replace(/[-@:=]/g, '');
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoEditore && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
|
||||
|
||||
} else {
|
||||
|
||||
@@ -198,6 +211,7 @@ export default defineComponent({
|
||||
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
|
||||
|
||||
let hasProductTypes = true
|
||||
let hasPublished = true
|
||||
let hasExcludeProductTypes = false
|
||||
|
||||
//++AddCATALOGO_FIELDS
|
||||
@@ -206,6 +220,9 @@ export default defineComponent({
|
||||
// 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 (props.optcatalogo && !boolfiltroVuotoEditore) {
|
||||
hasPublished = !props.optcatalogo.Editore || (props.optcatalogo.Editore && props.optcatalogo.Editore.includes(product.productInfo.idPublisher!))
|
||||
}
|
||||
|
||||
if (props.optcatalogo && !boolfiltroVuotoExcludeProductTypes) {
|
||||
// check if productInfo.productTypes array exclude some item in props.optcatalogo.ProductTypes array
|
||||
@@ -224,7 +241,7 @@ export default defineComponent({
|
||||
// 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));
|
||||
|
||||
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasAuthor && productgassel && hasProductTypes && !hasExcludeProductTypes;
|
||||
return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasAuthor && productgassel && hasProductTypes && hasPublished && !hasExcludeProductTypes;
|
||||
} else {
|
||||
console.error('product or product.productInfo is null');
|
||||
return false;
|
||||
@@ -232,6 +249,18 @@ export default defineComponent({
|
||||
});
|
||||
}
|
||||
|
||||
console.log('filter.value.sort', filter.value.sort)
|
||||
// sort using filter.value.sort :
|
||||
if (filter.value.sort === costanti.SORT_PUBDATE) {
|
||||
|
||||
arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
|
||||
return b.productInfo.date_publishing_ts - a.productInfo.date_publishing_ts
|
||||
})
|
||||
|
||||
} else if (filter.value.sort === costanti.SORT_ALPHA) {
|
||||
|
||||
}
|
||||
|
||||
arrProducts.value = arrprod
|
||||
loaddata()
|
||||
refreshpage.value = false
|
||||
@@ -404,6 +433,7 @@ export default defineComponent({
|
||||
labelcombo,
|
||||
mycolumns,
|
||||
tabvisu,
|
||||
getSearchText,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,9 +8,15 @@
|
||||
|
||||
<div class="container">
|
||||
<q-tabs v-model="tabvisu" dense class="bg-indigo text-white">
|
||||
<q-tab name="categorie" icon="fas fa-folder-open" label="Categorie" />
|
||||
<q-tab name="autori" icon="fas fa-user" label="Autori" />
|
||||
<q-tab name="ricerca" icon="fas fa-search" label="Cerca" />
|
||||
<q-tab name="categorie" icon="fas fa-folder-open" label="Categorie">
|
||||
<q-badge v-if="cat" color="red" floating>1</q-badge>
|
||||
</q-tab>
|
||||
<q-tab name="autori" icon="fas fa-user" label="Autori">
|
||||
<q-badge v-if="filter.author" color="red" floating>1</q-badge>
|
||||
</q-tab>
|
||||
<q-tab name="ricerca" icon="fas fa-search" label="Cerca">
|
||||
<q-badge v-if="getSearchText()" color="red" floating>1</q-badge>
|
||||
</q-tab>
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tabvisu" animated class="">
|
||||
<q-tab-panel name="categorie">
|
||||
@@ -133,6 +139,22 @@
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
|
||||
|
||||
<div class="row justify-center q-mx-auto">
|
||||
<q-select
|
||||
v-model="filter.sort"
|
||||
dense
|
||||
:options="costanti.ORDINAMENTO_CATALOGHI"
|
||||
label="Ordinamento"
|
||||
placeholder=""
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
rounded
|
||||
></q-select>
|
||||
</div>
|
||||
|
||||
<div class="text-center q-py-sm prod_trov">
|
||||
<span v-show="productStore.getNumProdTot() !== arrProducts.length">{{
|
||||
t('ecomm.prodotti_trovati', {
|
||||
@@ -175,7 +197,6 @@
|
||||
productInfo.productTypes.includes(
|
||||
shared_consts.PRODUCTTYPE.PRODUCT
|
||||
))
|
||||
|
||||
"
|
||||
:id="product._id"
|
||||
:complete="false"
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CMyCardPopup } from '@/components/CMyCardPopup'
|
||||
import { CMyCardService } from '@/components/CMyCardService'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
@@ -27,6 +28,7 @@ export default defineComponent({
|
||||
idBacheca,
|
||||
toolsext,
|
||||
tools,
|
||||
shared_consts,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,6 +8,7 @@ import { CMyPage } from '@/components/CMyPage'
|
||||
import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'mypagehosp',
|
||||
@@ -26,6 +27,7 @@ export default defineComponent({
|
||||
idHosp,
|
||||
toolsext,
|
||||
tools,
|
||||
shared_consts,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user