+
{{
- shared_consts.VERSIONI_PRODOTTO[variazione.versione].label
+ shared_consts.VERSIONI_PRODOTTO[variazione.arrversioni[0]].label
}}
@@ -230,11 +244,9 @@
v-for="(variazione, index) of myproduct.arrvariazioni"
:key="index"
>
-
+
@@ -270,9 +282,9 @@
>
{{ $t('products.formato') }}:
{{ variazione.formato }}
{ }
+ },
+ optcatalogo: {
+ type: Object as PropType,
+ required: false,
+ default: () => ({
+ //++AddCATALOGO_FIELDS
+ productTypes: [0],
+ excludeproductTypes: [],
+ formato: [],
+ Categoria: [],
+ Editore: [],
+ }),
+ },
+ },
+ components: { CCatalogoCard },
+ setup(props, { emit }) {
+ const $q = useQuasar()
+ const { t } = useI18n()
+ const userStore = useUserStore()
+ const globalStore = useGlobalStore()
+
+ const opendetailbool = ref(false)
+
+ function selauthor(id: any, autore: any) {
+ emit('selauthor', id, autore)
+ }
+
+ function opendetail() {
+ opendetailbool.value = true
+ }
+
+ function mounted() {
+ //
+ }
+
+ onMounted(mounted)
+
+ return {
+ tools,
+ t,
+ func_tools,
+ toolsext,
+ shared_consts,
+ globalStore,
+ costanti,
+ selauthor,
+ opendetail,
+ opendetailbool,
+ }
+ }
+})
diff --git a/src/components/CContainerCatalogoCard/CContainerCatalogoCard.vue b/src/components/CContainerCatalogoCard/CContainerCatalogoCard.vue
new file mode 100755
index 00000000..20f364d4
--- /dev/null
+++ b/src/components/CContainerCatalogoCard/CContainerCatalogoCard.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CContainerCatalogoCard/index.ts b/src/components/CContainerCatalogoCard/index.ts
new file mode 100755
index 00000000..4708851d
--- /dev/null
+++ b/src/components/CContainerCatalogoCard/index.ts
@@ -0,0 +1 @@
+export {default as CContainerCatalogoCard} from './CContainerCatalogoCard.vue'
diff --git a/src/components/CMyCardService/CMyCardService.ts b/src/components/CMyCardService/CMyCardService.ts
index b1a7aa43..d5b7ee89 100644
--- a/src/components/CMyCardService/CMyCardService.ts
+++ b/src/components/CMyCardService/CMyCardService.ts
@@ -177,6 +177,8 @@ export default defineComponent({
// console.log('myrec', myrec)
myrec.value = ris
notifStore.setAsRead(idnotif.value)
+ }).catch((err) => {
+
})
} else {
diff --git a/src/components/CMyEditElem/CMyEditElem.ts b/src/components/CMyEditElem/CMyEditElem.ts
index 70dea306..c15b25a2 100755
--- a/src/components/CMyEditElem/CMyEditElem.ts
+++ b/src/components/CMyEditElem/CMyEditElem.ts
@@ -115,23 +115,7 @@ export default defineComponent({
visuadd.value = false
- const newrec: IMyElem = {
- _id: undefined,
- type: newtype.value,
- path: props.myelem.path,
- order: order ? order : 1000,
- active: true,
- container: ''
- }
-
- if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
- newrec.container2 = '8'
- newrec.height = 600
- } else if (newrec.type === shared_consts.ELEMTYPE.CARD) {
- newrec.class2 = 'row justify-center'
- }
-
- globalStore.addNewElem($q, t, newrec)
+ let newrec = globalStore.prepareAddNewElem(order, $q, t, props.myelem, newtype.value)
emit('selElemClick', newrec)
}
diff --git a/src/components/CMyEditElem/CMyEditElem.vue b/src/components/CMyEditElem/CMyEditElem.vue
index 454e88ab..8880f537 100755
--- a/src/components/CMyEditElem/CMyEditElem.vue
+++ b/src/components/CMyEditElem/CMyEditElem.vue
@@ -199,7 +199,7 @@
-
+
+
+
+
Cataloghi:
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CMyElem/CMyElem.ts b/src/components/CMyElem/CMyElem.ts
index 54b0910c..6252f82b 100755
--- a/src/components/CMyElem/CMyElem.ts
+++ b/src/components/CMyElem/CMyElem.ts
@@ -117,7 +117,7 @@ export default defineComponent({
const newtype = ref(
'')
- const isAppRunning = computed(() => globalStore.isAppRunning )
+ const isAppRunning = computed(() => globalStore.isAppRunning)
watch(() => myel.value.order, (value, oldval) => {
mounted()
@@ -150,21 +150,7 @@ export default defineComponent({
function addNewElem(order?: number) {
- const newrec: IMyElem = {
- _id: undefined,
- type: newtype.value,
- path: props.myelem.path,
- order: order ? order : 1000,
- active: true,
- container: ''
- }
-
- if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
- newrec.container2 = '8'
- newrec.height = 600
- }
-
- globalStore.addNewElem($q, t, newrec)
+ let newrec = globalStore.prepareAddNewElem(order, $q, t, props.myelem, newtype.value)
}
function dupElem(order?: number) {
diff --git a/src/components/CMyElem/CMyElem.vue b/src/components/CMyElem/CMyElem.vue
index c69be622..4921207a 100755
--- a/src/components/CMyElem/CMyElem.vue
+++ b/src/components/CMyElem/CMyElem.vue
@@ -559,7 +559,8 @@
MAPPA:
diff --git a/src/components/CMyPageElem/CMyPageElem.vue b/src/components/CMyPageElem/CMyPageElem.vue
index 46fedc81..de9550ed 100755
--- a/src/components/CMyPageElem/CMyPageElem.vue
+++ b/src/components/CMyPageElem/CMyPageElem.vue
@@ -121,7 +121,7 @@
-
+
diff --git a/src/components/CMySelect/CMySelect.ts b/src/components/CMySelect/CMySelect.ts
index 3b7c7cc5..3d10978f 100755
--- a/src/components/CMySelect/CMySelect.ts
+++ b/src/components/CMySelect/CMySelect.ts
@@ -440,6 +440,8 @@ export default defineComponent({
// if (!props.useinput) {
if (props.value) {
myvalue.value = props.value
+ } else {
+ myvalue.value = ''
}
// }
}
@@ -547,9 +549,9 @@ export default defineComponent({
function filterFn(val: any, update: any, abort: any) {
update(
async () => {
- console.log('Filter val', val, val.length)
+ console.log('Filter val:', val, 'len=', val.length)
console.log('props.filter_extra', props.filter_extra)
-
+ console.log('valori.value', valori.value)
let myarr: any = []
@@ -743,6 +745,10 @@ export default defineComponent({
return ''
}
+ function selectText(event: any) {
+ // Seleziona tutto il testo all'interno della casella di testo
+ event.target.select();
+ }
onMounted(mounted)
@@ -758,6 +764,7 @@ export default defineComponent({
newvaluefuncfirst,
getIcon,
tools,
+ selectText,
}
}
})
diff --git a/src/components/CMySelect/CMySelect.vue b/src/components/CMySelect/CMySelect.vue
index a2ee2709..21031c1a 100755
--- a/src/components/CMySelect/CMySelect.vue
+++ b/src/components/CMySelect/CMySelect.vue
@@ -79,6 +79,7 @@
+
-
+
diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts
index a9f24dcb..a5c95d07 100755
--- a/src/model/GlobalStore.ts
+++ b/src/model/GlobalStore.ts
@@ -157,6 +157,7 @@ export interface IMyElem {
styleadd?: string
list?: IImgGallery[]
listcards?: IMyCard[]
+ catalogo?: ICatalogo
elemsText?: IElemText[]
}
@@ -637,6 +638,16 @@ export interface IMyCard {
colorsub?: string
}
+export interface ICatalogo {
+ //++AddCATALOGO_FIELDS
+ productTypes: number[]
+ excludeproductTypes: number[]
+ formato: string[]
+ Categoria: string[]
+ Editore: string[]
+}
+
+
export interface IGallery {
_id?: string
author_username?: string
diff --git a/src/model/Products.ts b/src/model/Products.ts
index e24d06fe..8e24ee4b 100755
--- a/src/model/Products.ts
+++ b/src/model/Products.ts
@@ -38,12 +38,13 @@ export interface IProductInfo {
publisher?: IPublisher
date_publishing?: Date
numpages?: number
- productType?: number
+ productTypes?: number[]
+ versioneGM?: string
}
export interface IVariazione {
active?: boolean
- versione?: number
+ arrversioni?: number[]
status?: string,
price?: number
sale_price?: number
diff --git a/src/rootgen/admin/importdata/importdata.vue b/src/rootgen/admin/importdata/importdata.vue
index c3b85a1a..a3dc6855 100755
--- a/src/rootgen/admin/importdata/importdata.vue
+++ b/src/rootgen/admin/importdata/importdata.vue
@@ -28,7 +28,7 @@
{{ risraw }}
-
+
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 1181e2d5..532b1622 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -335,6 +335,7 @@ export const tools = {
},
],
+
SelectListColors: [
{ label: '[Nessuno]', value: '' },
{ label: 'aliceblue', value: '#f0f8ff' },
@@ -1391,6 +1392,13 @@ 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,
menuPopupTodo:
@@ -8644,8 +8652,9 @@ export const tools = {
},
// get the last 2 digit fraction part, of a decimal number
- getDecPart2Digit(number: number) {
- return Math.round(number * 100) % 100
+ getDecPart2Digit(number: number): string {
+ let parts = number.toFixed(2).split('.');
+ return parts.length > 1 ? parts[1] : '00';
},
getRecordByField(field: any, record: any) {
diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts
index 53f4c94e..303655a7 100644
--- a/src/store/globalStore.ts
+++ b/src/store/globalStore.ts
@@ -2096,5 +2096,38 @@ export const useGlobalStore = defineStore('GlobalStore', {
})
},
+ prepareAddNewElem(order: any, $q: any, t: any, myelem: any, newtype: any) {
+
+ const newrec: IMyElem = {
+ _id: undefined,
+ type: newtype,
+ path: myelem.path,
+ order: order ? order : 1000,
+ active: true,
+ container: ''
+ }
+
+ if (newrec.type === shared_consts.ELEMTYPE.CAROUSEL_IMGS) {
+ newrec.container2 = '8'
+ newrec.height = 600
+ } else if (newrec.type === shared_consts.ELEMTYPE.CARD) {
+ newrec.class2 = 'row justify-center'
+ } else if (newrec.type === shared_consts.ELEMTYPE.CATALOGO) {
+ newrec.catalogo = {
+ //++AddCATALOGO_FIELDS
+ productTypes: [0],
+ excludeproductTypes: [],
+ formato: [],
+ Categoria: [],
+ Editore: [],
+ }
+ }
+
+ this.addNewElem($q, t, newrec)
+
+ return newrec
+
+ }
+
},
})
diff --git a/src/views/admin/dbop/dbop.vue b/src/views/admin/dbop/dbop.vue
index 08eace46..230d0bda 100755
--- a/src/views/admin/dbop/dbop.vue
+++ b/src/views/admin/dbop/dbop.vue
@@ -551,6 +551,11 @@
color="primary"
@click="EseguiFunz('correggiCircuitiANull', '', '')"
>
+
diff --git a/src/views/ecommerce/catalogo/catalogo.ts b/src/views/ecommerce/catalogo/catalogo.ts
index 93755ad6..d729d3fd 100755
--- a/src/views/ecommerce/catalogo/catalogo.ts
+++ b/src/views/ecommerce/catalogo/catalogo.ts
@@ -1,4 +1,4 @@
-import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount } from 'vue'
+import { defineComponent, onMounted, ref, watch, computed, onBeforeUnmount, PropType } from 'vue'
import { tools } from '@store/Modules/tools'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
@@ -12,17 +12,30 @@ import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
import { CProductCard } from '@src/components/CProductCard'
import { CMySelect } from '@src/components/CMySelect'
-import { CCatalogoCard } from '@src/components/CCatalogoCard'
+import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
import { CSelectUserActive } from '@src/components/CSelectUserActive'
-import { IProduct, ISearchList } from 'model'
+import { ICatalogo, IProduct, ISearchList } from 'model'
import { fieldsTable } from '@store/Modules/fieldsTable'
export default defineComponent({
name: 'Catalogo',
- components: { CCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
- props: {},
- setup() {
+ components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect },
+ props: {
+ optcatalogo: {
+ type: Object as PropType
,
+ required: false,
+ default: () => ({
+ //++AddCATALOGO_FIELDS
+ productTypes: [0],
+ excludeproductTypes: [],
+ formato: [],
+ Categoria: [],
+ Editore: [],
+ }),
+ },
+ },
+ setup(props) {
const userStore = useUserStore()
const globalStore = useGlobalStore()
const productStore = useProducts()
@@ -49,6 +62,8 @@ export default defineComponent({
const mycolumns = ref([])
+ const tabvisu = ref('categorie')
+
const searchList = ref([] as ISearchList[])
const arrProducts = ref([])
@@ -67,13 +82,6 @@ export default defineComponent({
return lab
})
- const getlist = computed(() => {
- const mylist = searchList.value.find((rec: any) => rec.table === 'products')
-
- return mylist
- })
-
-
const arrLoaded = computed(() => {
if (arrProducts.value && numRecLoaded.value)
return arrProducts.value.slice(0, numRecLoaded.value)
@@ -96,8 +104,8 @@ export default defineComponent({
watch(() => cat.value, (newval, oldval) => {
if (cat.value) {
- filter.value.author = '' // disattivo il filtro autore
- search.value = '' // disattivo anche la ricerca per testo
+ filter.value.author = '' // disattivo il filtro autore
+ resetSearch()
}
calcArrProducts()
@@ -107,7 +115,7 @@ export default defineComponent({
calcArrProducts()
})
- watch(() => search.value, (newval, oldval) => {
+ watch(() => getSearchText(), (newval, oldval) => {
calcArrProducts()
if (tools.scrollTop() > 300) {
tools.scrollToTopValue(300)
@@ -118,7 +126,7 @@ export default defineComponent({
// Se filtroAuthor attivato, allora evito il filtro per Categoria
if (filter.value.author) {
cat.value = '' // disattivo il filtro categoria
- search.value = '' // disattivo anche la ricerca per testo
+ resetSearch()
}
calcArrProducts()
@@ -134,22 +142,52 @@ export default defineComponent({
calcArrProducts()
})
+ function resetSearch() {
+ const mialista = getSearchList()
+ if (mialista && mialista.value && mialista.value.hasOwnProperty('name')) {
+ mialista.value = null
+ }
+ search.value = ''
+ }
+
+ function getSearchList() {
+ const mylist = searchList.value.find((rec: any) => rec.table === 'products' && rec.key === 'titolo')
+
+ return mylist
+ }
+
+ function getSearchText(): string {
+ const lista = getSearchList()
+ return lista && lista.value && lista.value.hasOwnProperty('name') ? lista.value.name : ''
+ }
+
function calcArrProducts() {
// console.log('calcArrProducts')
+ const searchtext = getSearchText()
+
refreshpage.value = true
let arrprod = productStore.getProducts(cosa.value) || [];
let filtroAuthor = filter.value.author || '';
- let catstr = cat.value || '';
+ //++AddCATALOGO_FIELDS
+
+ let filtroProductTypes = props.optcatalogo.productTypes || [0]
+ let filtroExcludeProductTypes = props.optcatalogo.excludeproductTypes || [0]
+ let boolfiltroVuotoProductTypes = (filtroProductTypes.length === 0 || (filtroProductTypes.length === 1 && (filtroProductTypes[0] === 0)))
+ let boolfiltroVuotoExcludeProductTypes = filtroExcludeProductTypes.length === 0
+
+ //console.log('filtroVersione', filtroProductTypes)
+
+ let catstr = cat.value || ''
let gasselstr = ''
if (cosa.value === shared_consts.PROD.GAS) {
gasselstr = idGasSel.value || '';
}
- let lowerSearchText = (search.value || '').toLowerCase().trim();
+ let lowerSearchText = (searchtext || '').toLowerCase().trim();
lowerSearchText = lowerSearchText.replace(/[-@:=]/g, '');
- if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
+ if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
} else {
@@ -159,6 +197,21 @@ export default defineComponent({
let hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr));
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
+ let hasProductTypes = true
+ let hasExcludeProductTypes = false
+
+ //++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 (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)))
+ }
+
let productgassel = true
if (gasselstr || (cosa.value === shared_consts.PROD.GAS)) {
productgassel = (product.idGasordine === gasselstr)
@@ -171,7 +224,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;
+ return (codeMatch.test(product.productInfo.code || '') || allWordsPresent) && hasCategoria && hasAuthor && productgassel && hasProductTypes && !hasExcludeProductTypes;
} else {
console.error('product or product.productInfo is null');
return false;
@@ -214,7 +267,7 @@ export default defineComponent({
key: 'titolo',
type: costanti.FieldType.select_by_server,
value: '',
- addall: true,
+ // addall: true,
arrvalue: [],
useinput: true,
filter: null,
@@ -224,9 +277,12 @@ export default defineComponent({
optauthors.value = productStore.getAuthors()
- cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.GAS, true)
- if (cosa.value === shared_consts.PROD.TUTTI)
- cosa.value = shared_consts.PROD.GAS
+ //++Todo: Per ora visualizzo solo il "Negozio" e non i GAS...
+ cosa.value = shared_consts.PROD.BOTTEGA
+
+ //cosa.value = tools.getCookie(tools.COOK_COSA_PRODOTTI, shared_consts.PROD.GAS, true)
+ //if (cosa.value === shared_consts.PROD.TUTTI)
+
// Inizializza
loadpage.value = true
@@ -297,14 +353,16 @@ export default defineComponent({
filter.value.author = id
}
- function searchval(newval: any, table: any, tablesel: any) {
+ /*function searchval(newval: any, table: any, tablesel: any) {
console.log('REFRR searchval', newval, table, 'tablesel', tablesel)
- if (newval === '') {
- search.value = ''
+ if (newval) {
+ if (newval.hasOwnProperty('name')) {
+ search.value = newval.name
+ }
} else {
- search.value = newval.name
+ resetSearch()
}
- }
+ }*/
const valoriopt = computed(() => (item: any, addall: boolean, addnone: boolean) => {
// console.log('valoriopt', item.table)
@@ -342,10 +400,10 @@ export default defineComponent({
selauthor,
searchList,
fieldsTable,
- searchval,
valoriopt,
labelcombo,
mycolumns,
+ tabvisu,
}
}
})
diff --git a/src/views/ecommerce/catalogo/catalogo.vue b/src/views/ecommerce/catalogo/catalogo.vue
index ac1fd69a..53a88963 100755
--- a/src/views/ecommerce/catalogo/catalogo.vue
+++ b/src/views/ecommerce/catalogo/catalogo.vue
@@ -7,131 +7,25 @@
-
-
-
-
-
-
-
- {{
- t('ecomm.prodotti_trovati', {
- qta: arrProducts.length,
- qtatot: productStore.getNumProdTot(),
- })
- }}
-
-
-
-
-
-
-
-
Categorie
-
-
- {{ reccat.label }}
-
- |
-
+
-
-
- {{
- t('ecomm.prodotti_trovati', {
- qta: arrProducts.length,
- qtatot: productStore.getNumProdTot(),
- })
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+ {{
+ t('ecomm.prodotti_trovati', {
+ qta: arrProducts.length,
+ qtatot: productStore.getNumProdTot(),
+ })
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
diff --git a/src/views/user/mypagegood/mypagegood.ts b/src/views/user/mypagegood/mypagegood.ts
index 6b8e652f..59856e6b 100755
--- a/src/views/user/mypagegood/mypagegood.ts
+++ b/src/views/user/mypagegood/mypagegood.ts
@@ -8,6 +8,8 @@ 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: 'mypagegood',
@@ -19,6 +21,7 @@ export default defineComponent({
const $q = useQuasar()
const { t } = useI18n()
+
const idGood = computed(() => $route.params.idGood ? $route.params.idGood.toString() : 0)
return {
@@ -26,6 +29,7 @@ export default defineComponent({
idGood,
toolsext,
tools,
+ shared_consts,
}
}
})