- Cataloghi aggiornamento...

This commit is contained in:
Surya Paolo
2025-02-11 18:58:06 +01:00
parent 3d0e307e42
commit 0ad4dcff75
23 changed files with 272 additions and 99 deletions

View File

@@ -1,27 +1,27 @@
APP_VERSION="1.1.21" APP_VERSION="1.1.21"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="18"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet
DIRECTORY_SERVER=freeplanet_serverside DIRECTORY_SERVER=/var/www/freeplanet_serverside
SERVERDIR_WEBSITE=riso.app SERVERDIR_WEBSITE="/var/www/gruppomacro.app"
SERVERPW_WEBSITE=pwdadmin@1AOK SERVERPW_WEBSITE=pwdadmin@1AOK
APP_URL="https://riso.app" APP_URL="https://gruppomacro.app"
URL_FACEBOOK="" URL_FACEBOOK=""
PROVA_PAOLO="" PROVA_PAOLO=""
LANG_DEFAULT="it" LANG_DEFAULT="it"
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF" PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T" MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
MONGODB_HOST="https://www.freeplanet.app:3000" MONGODB_HOST="https://api.gruppomacro.app"
LOGO_REG='riso-logo-full.png' LOGO_REG='gruppomacro-logo-full.png'
TEST_NAME="" TEST_NAME=""
TEST_SURNAME="" TEST_SURNAME=""
TEST_EMAIL="" TEST_EMAIL=""
TEST_USERNAME="" TEST_USERNAME=""
TEST_PASSWORD="" TEST_PASSWORD=""
TEST_APORTADOR="------" TEST_APORTADOR="------"
PUBLICKEY_PUSH="BNM-cEpTbPVc_ujXf3QOC8ggf7b-X44P44esfJUWqNOFq1XhWCoZJpOi71_cbXC5SnfO9HassQ6OouAYgtBA9Pw" PUBLICKEY_PUSH="BJgo8XR_upbnbMLWgCAUELo6DK7dRXffYAnFOxbaMMz5favBgcQBKT-eISqouO-jRad4Sw8l5nd2wCF6KorGiTc"
DEBUG="1" DEBUG="1"
TELEGRAM_SUPPORT="" TELEGRAM_SUPPORT=""
PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a" PROJECT_ID_MAIN="5cc0a13fe5c9d156728f400a"
TEST_CELL="" TEST_CELL=""
VUE_APP_ISTEST=0 VUE_APP_ISTEST=0

View File

@@ -39,7 +39,7 @@ module.exports = configure((ctx) => ({
// --> boot files are part of "main.js" // --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files // https://v2.quasar.dev/quasar-cli/boot-files
// boot: ['vue-i18n', 'vue-meta', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'], // boot: ['vue-i18n', 'vue-meta', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'],
boot: ['i18n', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'calendar', 'social-sharing', 'timeago'], boot: ['i18n', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'calendar', 'social-sharing', 'timeago', 'guard'],
// https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css // https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-css
css: [ css: [

View File

@@ -288,6 +288,34 @@ export const shared_consts = {
PARAM_SHOW_PROVINCE: 1, PARAM_SHOW_PROVINCE: 1,
TABLES_ID_STRING: [
'circuits',
'accounts',
'movements',
'mygroups',
],
TABLES_ID_NUMBER: [
'permissions',
'levels',
'adtypes',
'adtypegoods',
'statusSkills',
'sectors',
'goods',
'sectorgoods',
'catgrps',
'skills',
'subskills',
'cities',
'provinces',
// 'myskills',
// 'mybachecas',
// 'myhosps',
// 'mygoods',
// 'mygroups'
],
TABLES_MYSKILLS: 'myskills', TABLES_MYSKILLS: 'myskills',
TABLES_MYBACHECAS: 'mybachecas', TABLES_MYBACHECAS: 'mybachecas',
TABLES_MYHOSPS: 'myhosps', TABLES_MYHOSPS: 'myhosps',

View File

@@ -42,6 +42,16 @@ export default defineComponent({
required: false, required: false,
default: 0, default: 0,
}, },
heightcard: {
type: String,
required: false,
default: '150px',
},
widthcard: {
type: String,
required: false,
default: '300px',
},
}, },
components: { components: {
CMyFieldDb, CGridTableRec, CTitlePage, CMyFieldDb, CGridTableRec, CTitlePage,

View File

@@ -34,7 +34,7 @@
:prop_showMap="false" :prop_showMap="false"
:heightcarousel="heightcarousel" :heightcarousel="heightcarousel"
@clickButtBar="clickButtBar" @clickButtBar="clickButtBar"
:opt="{rowclass: true, widthcard: $q.screen.gt.xs ? '300px' : '170px', heightcard: $q.screen.gt.xs ? '300px' : '170px'}" :opt="{rowclass: true, widthcard, heightcard}"
> >
</CGridTableRec> </CGridTableRec>
</div> </div>

View File

@@ -111,7 +111,7 @@ export default defineComponent({
watch(() => props.modelValue, (newVal) => { watch(() => props.modelValue, (newVal) => {
optcatalogo.value = { ...newVal }; optcatalogo.value = { ...newVal };
// updateCatalogoPadre() // updateCatalogoPadre()
}, { deep: true }); }, { deep: false });
function updateCatalogoPadre() { function updateCatalogoPadre() {
emit('update:modelValue', optcatalogo.value); emit('update:modelValue', optcatalogo.value);

View File

@@ -80,7 +80,7 @@ export default defineComponent({
watch(() => props.modelValue, (newVal) => { watch(() => props.modelValue, (newVal) => {
optcatalogo.value = { ...newVal }; optcatalogo.value = { ...newVal };
// updateCatalogoPadre() // updateCatalogoPadre()
}, { deep: true }); }, { deep: false });
function updateCatalogoPadre() { function updateCatalogoPadre() {
emit('update:modelValue', optcatalogo.value); emit('update:modelValue', optcatalogo.value);

View File

@@ -2213,59 +2213,64 @@ export default defineComponent({
const ok = true const ok = true
let myrec = null try {
if (newrec) {
myrec = { ...newRecord.value }
} else {
myrec = { ...recModif.value }
}
// mycolumns.value.forEach((col: IColGridTable) => { let myrec = null
let col: IColGridTable if (newrec) {
myrec = { ...newRecord.value }
} else {
myrec = { ...recModif.value }
}
let msg = '' // mycolumns.value.forEach((col: IColGridTable) => {
let col: IColGridTable
for (col of mycolumns.value) { let msg = ''
if (!msg) {
if (col.showonlyif_dipersona) {
const valori = myrec['idStatusSkill']
if (valori && (valori.length === 1) && valori.includes(shared_consts.STATUSSKILL_ONLINE)) { for (col of mycolumns.value) {
col.required = false if (!msg) {
} else { if (col.showonlyif_dipersona) {
col.required = true const valori = myrec['idStatusSkill']
}
col.visible = col.required if (valori && (valori.length === 1) && valori.includes(shared_consts.STATUSSKILL_ONLINE)) {
} col.required = false
if (col.required) { } else {
// console.log('newRecord.value', newRecord.value, newRecord.value[col.name]) col.required = true
if (tools.isArray(myrec[col.name])) {
if (myrec[col.name].length <= 0) {
msg = 'Si prega di compilare il campo \'' + getColMissing(myrec) + '\''
} }
} else {
if (!myrec[col.name]) { col.visible = col.required
msg = 'Si prega di compilare il campo \'' + getColMissing(myrec) + '\'' }
if (col.required) {
// console.log('newRecord.value', newRecord.value, newRecord.value[col.name])
if (tools.isArray(myrec[col.name])) {
if (myrec[col.name].length <= 0) {
msg = 'Si prega di compilare il campo \'' + getColMissing(myrec) + '\''
}
} else {
if (!myrec[col.name]) {
msg = 'Si prega di compilare il campo \'' + getColMissing(myrec) + '\''
}
} }
} }
} if (!msg && col.maxlength! > 0 && myrec && myrec[col.name]) {
if (!msg && col.maxlength! > 0) { if ((myrec[col.name].length > col.maxlength!) && (col.fieldtype !== costanti.FieldType.html)) {
if (myrec[col.name].length > col.maxlength!) { msg = t('annunci.maxlength', { name: translate(col.label_trans), maxlength: col.maxlength })
msg = t('annunci.maxlength', { name: translate(col.label_trans), maxlength: col.maxlength }) }
} }
} if (!msg && col.minlength! > 0 && myrec && myrec[col.name]) {
if (!msg && col.minlength! > 0) { if ((myrec[col.name].length < col.minlength!) && (col.fieldtype !== costanti.FieldType.html)) {
if (myrec[col.name].length < col.minlength!) { msg = t('annunci.minlength', { name: translate(col.label_trans), minlength: col.minlength })
msg = t('annunci.minlength', { name: translate(col.label_trans), minlength: col.minlength }) }
} }
} }
} }
}
if (showmsg && msg) { if (showmsg && msg) {
tools.showNegativeNotif($q, msg, 5000) tools.showNegativeNotif($q, msg, 5000)
return false return false
}
} catch (e) {
} }
return ok return ok

View File

@@ -455,6 +455,7 @@ export default defineComponent({
_id: objectId(), _id: objectId(),
idapp: tools.appid()!, idapp: tools.appid()!,
isTemplate: false, isTemplate: false,
isPagIntro: false,
show_separatore: true, show_separatore: true,
name: 'Scheda Nuova', name: 'Scheda Nuova',
dimensioni, dimensioni,

View File

@@ -217,7 +217,7 @@
<CMySlider <CMySlider
v-if=" v-if="
myel.type === shared_consts.ELEMTYPE.CARD || myel.type === shared_consts.ELEMTYPE.CARD ||
myel.type === shared_consts.ELEMTYPE.GRID_ORIZ|| myel.type === shared_consts.ELEMTYPE.GRID_ORIZ ||
myel.type === shared_consts.ELEMTYPE.CATALOGLIST myel.type === shared_consts.ELEMTYPE.CATALOGLIST
" "
label="Altezza Carosello:" label="Altezza Carosello:"
@@ -1391,6 +1391,15 @@
> >
</q-toggle> </q-toggle>
<CMySlider
label="Numero massimo libri:"
v-model="myel.catalogo.maxnumlibri"
:min="0"
:max="1000"
color="green"
@update:model-value="modifElem"
></CMySlider>
<q-input <q-input
label="NomeFile PDF" label="NomeFile PDF"
@update:model-value="modifElem" @update:model-value="modifElem"
@@ -2176,6 +2185,7 @@
@update:model-value="modifElem" @update:model-value="modifElem"
> >
</q-toggle> </q-toggle>
<q-toggle <q-toggle
v-model="myel.catalogo.indebug" v-model="myel.catalogo.indebug"
color="positive" color="positive"

View File

@@ -570,6 +570,8 @@
:prop_search="myel.parambool" :prop_search="myel.parambool"
:finder="myel.parambool2" :finder="myel.parambool2"
:heightcarousel="myel.heightcarousel" :heightcarousel="myel.heightcarousel"
:heightcard="myel.heightimg"
:widthcard="myel.widthimg"
></CCatalogList> ></CCatalogList>
</div> </div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.STATUSREG"> <div v-else-if="myel.type === shared_consts.ELEMTYPE.STATUSREG">

View File

@@ -1054,6 +1054,7 @@
:canModify="canModify" :canModify="canModify"
@update:value="changevalRec" @update:value="changevalRec"
@showandsave="Savedb" @showandsave="Savedb"
:maxlength="col.maxlength"
> >
</CMyEditor> </CMyEditor>
</div> </div>
@@ -1125,6 +1126,7 @@
:canModify="canModify" :canModify="canModify"
@showandsave="Savedb" @showandsave="Savedb"
@annulla="visueditor = false" @annulla="visueditor = false"
:maxlength="col.maxlength"
> >
</CMyEditor> </CMyEditor>
</q-card-section> </q-card-section>

View File

@@ -14,7 +14,7 @@ import { useRouter } from 'vue-router'
import { useCalendarStore } from '@src/store/CalendarStore' import { useCalendarStore } from '@src/store/CalendarStore'
import { useGlobalStore } from '@src/store/globalStore' import { useGlobalStore } from '@src/store/globalStore'
import { ICollana, IPublisher } from "@src/model/Products" import { ICatProd, ICollana, IPublisher } from "@src/model/Products"
import { useProducts } from '@src/store/Products' import { useProducts } from '@src/store/Products'
export default defineComponent({ export default defineComponent({
@@ -62,6 +62,7 @@ export default defineComponent({
const statecolor = ref('negative') const statecolor = ref('negative')
const apriInfo = ref(false) const apriInfo = ref(false)
const collanestr = ref('') const collanestr = ref('')
const argomentistr = ref('')
const editorestr = ref('') const editorestr = ref('')
const products = useProducts() const products = useProducts()
@@ -106,6 +107,13 @@ export default defineComponent({
collanestr.value += reccoll.title + ' ' collanestr.value += reccoll.title + ' '
} }
} }
argomentistr.value = ''
if (myrec.value.argomenti) {
for (const arg of myrec.value.argomenti!) {
const recargomento: ICatProd = products.catprods!.find((catprod: ICatProd) => catprod._id === arg)
argomentistr.value += recargomento.name + ' '
}
}
editorestr.value = '' editorestr.value = ''
if (myrec.value.editore) { if (myrec.value.editore) {
for (const receditore of myrec.value.editore!) { for (const receditore of myrec.value.editore!) {
@@ -198,6 +206,7 @@ export default defineComponent({
editorestr, editorestr,
pagina_collegata, pagina_collegata,
esiste_descrintro, esiste_descrintro,
argomentistr,
} }
}, },
}) })

View File

@@ -4,7 +4,7 @@
v-if="myrec" v-if="myrec"
flat flat
bordered bordered
:style="`width: ` + opt.widthcard + `; height: 540px;`" :style="`width: ` + opt.widthcard + `; `"
> >
<!--<q-skeleton <!--<q-skeleton
v-if="!myrec.foto_collana" v-if="!myrec.foto_collana"
@@ -17,6 +17,7 @@
@click="apriInfo = true" @click="apriInfo = true"
:height="opt.heightcard" :height="opt.heightcard"
class="clickable-image" class="clickable-image"
fit="cover"
:src=" :src="
tools.getFullFileName( tools.getFullFileName(
[myrec.foto_collana], [myrec.foto_collana],
@@ -31,21 +32,20 @@
immagine non impostata immagine non impostata
</div> </div>
</template> </template>
<div class="text-h6 absolute-bottom text-left"> <!--<div class="text-h6 absolute-bottom text-left">
{{ myrec.title }} {{ myrec.title }}
</div> </div>-->
</q-img> </q-img>
<q-card-section> <q-card-section>
<div <div
v-if="!myrec.foto_collana"
class="q-mt-sm q-mb-xs" class="q-mt-sm q-mb-xs"
style="font-size: 1.15rem" style="font-size: 1.15rem"
> >
{{ myrec.title }} {{ myrec.title }}
</div> </div>
<div class="text-caption text-h7 text-grey"> <div class="text-caption text-h7 text-grey">
<q-icon name="fas fa-user" /> Referente: <q-icon name="fas fa-user" /> {{$t('cataloglist.referenti')}}:
<span <span
v-if="myrec.referenti && myrec.referenti.length > 0" v-if="myrec.referenti && myrec.referenti.length > 0"
:class=" :class="
@@ -61,11 +61,15 @@
</span> </span>
</div> </div>
<div v-if="collanestr" class="text-caption text-h7 text-grey"> <div v-if="collanestr" class="text-caption text-h7 text-grey">
<q-icon name="fas fa-book" /> Collana: <q-icon name="fas fa-book" /> {{t('cataloglist.collane')}}:
<span class="text-blue">{{ collanestr }}</span> <span class="text-blue">{{ collanestr }}</span>
</div> </div>
<div v-if="argomentistr" class="text-caption text-h7 text-grey">
<q-icon name="fas fa-book" /> {{$t('cataloglist.argomenti')}}:
<span class="text-blue">{{ argomentistr }}</span>
</div>
<div v-if="editorestr" class="text-caption text-h7 text-grey"> <div v-if="editorestr" class="text-caption text-h7 text-grey">
<q-icon name="fas fa-book-open" /> Editore: <q-icon name="fas fa-book-open" /> {{$t('cataloglist.referenti')}}:
<span class="text-blue">{{ editorestr }}</span> <span class="text-blue">{{ editorestr }}</span>
</div> </div>
<div v-if="!esiste_descrintro" class="text-caption text-h7 text-grey"> <div v-if="!esiste_descrintro" class="text-caption text-h7 text-grey">
@@ -109,7 +113,7 @@
<!--<div class="text-overline text-orange-9">{{collanestr}}</div>--> <!--<div class="text-overline text-orange-9">{{collanestr}}</div>-->
</q-card-section> </q-card-section>
<q-card-actions> <q-card-actions align="center">
<div class="row justify-center"> <div class="row justify-center">
<q-fab <q-fab
color="primary" color="primary"
@@ -120,20 +124,22 @@
dense dense
> >
<q-fab-action <q-fab-action
v-if="tools.canModifyThisRec(myrec, table) || editOn" v-if="tools.canModifyThisRec(myrec, table) || tools.isManager() || editOn"
@click="cmdExt(costanti.CMD_DELETE, myrec._id, null)" @click="cmdExt(costanti.CMD_DELETE, myrec._id, null)"
color="negative" color="negative"
:label="$t('reg.elimina')" :label="$t('reg.elimina')"
icon="fas fa-trash-alt" icon="fas fa-trash-alt"
/> />
<q-fab-action <!--<q-fab-action
v-if="tools.canModifyThisRec(myrec, table) || editOn" v-if="tools.canModifyThisRec(myrec, table) || tools.isManager() || editOn"
@click="cmdExt(costanti.CMD_CLONE, myrec._id, null)" @click="cmdExt(costanti.CMD_CLONE, myrec._id, null)"
color="accent" color="accent"
:label="$t('event.duplicate')" :label="$t('event.duplicate')"
icon="fas fa-copy" icon="fas fa-copy"
/> />-->
<q-fab-action <q-fab-action
v-if="tools.canModifyThisRec(myrec, table) || editOn"
:disable="!pagina_collegata"
color="positive" color="positive"
label="Gestisci" label="Gestisci"
icon="fas fa-book-open" icon="fas fa-book-open"
@@ -154,14 +160,6 @@
icon="fas fa-info" icon="fas fa-info"
@click="apriInfo = true" @click="apriInfo = true"
/> />
<q-btn
flat
:color="statecolor"
label="PDF"
icon="fas fa-book"
:disable="!myrec.pdf_generato"
@click="naviga(myrec.pdf_generato)"
/>
</div> </div>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
@@ -191,7 +189,7 @@
? myrec.referenti.join(', ') ? myrec.referenti.join(', ')
: '[Non Assegnato]' : '[Non Assegnato]'
" "
label="Referente/i:" :label="$t('cataloglist.argomenti') + `:`"
:color=" :color="
myrec.referenti && myrec.referenti.length > 0 myrec.referenti && myrec.referenti.length > 0
? 'text-blue' ? 'text-blue'
@@ -199,8 +197,11 @@
" "
/> />
</div> </div>
<div style="width: 300px" class="q-ma-sm"> <div v-if="collanestr" style="width: 300px" class="q-ma-sm">
<CLabel v-if="collanestr" :value="collanestr" label="Collana/e:" /> <CLabel :value="collanestr" :label="$t('cataloglist.collane') + `:`" />
</div>
<div v-if="argomentistr" style="width: 300px" class="q-ma-sm">
<CLabel :value="argomentistr" :label="$t('cataloglist.argomenti') + `:`" />
</div> </div>
<div style="width: 300px" class="q-ma-sm"> <div style="width: 300px" class="q-ma-sm">
<CLabel <CLabel

View File

@@ -1,5 +1,5 @@
<template> <template>
<q-badge color="primary"> {{ label }} {{ modelValue }} </q-badge> <q-badge color="primary"> {{ label }} <span v-if="modelValue">{{ modelValue }}</span> </q-badge>
<div class="q-pa-xs row no-wrap"> <div class="q-pa-xs row no-wrap">
<q-btn <q-btn
icon="fas fa-minus" icon="fas fa-minus"

View File

@@ -1,4 +1,4 @@
import { defineComponent, ref, computed, PropType, toRef, reactive, watch } from 'vue' import { defineComponent, ref, computed, PropType, toRef, reactive, watch, onMounted } from 'vue'
import { IOperators, ISize, IText } from 'model' import { IOperators, ISize, IText } from 'model'
import { useI18n } from '@/boot/i18n' import { useI18n } from '@/boot/i18n'
@@ -71,6 +71,17 @@ export default defineComponent({
}, { immediate: true }); }, { immediate: true });
function mounted() {
if (!internalModel.font?.perc_text) {
internalModel.font!.perc_text = ''
}
if (!internalModel.maxlength) {
internalModel.maxlength = 0
}
}
onMounted(mounted)
return { return {
t, t,
shared_consts, shared_consts,

View File

@@ -205,7 +205,7 @@
> >
<q-img <q-img
ratio="1" ratio="1"
fit="conver" fit="cover"
:src="getMyImg()" :src="getMyImg()"
:alt="Username()" :alt="Username()"
img-class="imgprofile_small" img-class="imgprofile_small"

View File

@@ -6,23 +6,31 @@ export interface ICatalog {
_id: string _id: string
idapp: string idapp: string
active?: boolean active?: boolean
versione_perstampa?: boolean
title: string title: string
foto_collana?: IImg, foto_collana?: IImg,
idCollane?: number[] idCollane?: number[]
argomenti?: string[]
editore?: string[] editore?: string[]
collana_info?: ICollana collana_info?: ICollana
descr_introduttiva?: string descr_introduttiva?: string
idPageAssigned?: string idPageAssigned?: string
idPageAssigned_stampa?: string
referenti?: string[] referenti?: string[]
img_bordata?: IImg, img_bordata?: IImg,
img_intro?: IImg, img_intro?: IImg,
img_bordata_stampa?: IImg,
img_intro_stampa?: IImg,
pagina_introduttiva_sfondo_nero?: boolean pagina_introduttiva_sfondo_nero?: boolean
pdf_generato?: string pdf_generato?: string
data_generato?: Date data_generato?: Date
pdf_online?: string pdf_online?: string
data_online?: Date data_online?: Date
pdf_generato_stampa?: string
data_generato_stampa?: Date
pdf_online_stampa?: string
data_online_stampa?: Date
date_created?: Date, date_created?: Date,
date_updated?: Date, date_updated?: Date,

View File

@@ -834,6 +834,7 @@ export interface IOptCatalogo {
pdf_filename?: string pdf_filename?: string
printable?: boolean printable?: boolean
indebug?: boolean indebug?: boolean
maxnumlibri?: number
generazionePDFInCorso?: boolean generazionePDFInCorso?: boolean
first_page?: IDimensioni first_page?: IDimensioni

View File

@@ -2008,22 +2008,32 @@ const msg_it = {
link_macro: '{link_macro}', link_macro: '{link_macro}',
totVen: 'Totale Venduti', totVen: 'Totale Venduti',
totFat: 'Totale Fatturati', totFat: 'Totale Fatturati',
contenuto: 'Contenuto',
},
iimg: {
imagefile: 'File Immagine',
}, },
cataloglist: { cataloglist: {
foto_collana: 'Foto Collana', foto_collana: 'Foto Collana',
referenti: 'Referenti', referenti: 'Editori',
img_bordata: 'Immagine di sfondo', img_bordata: 'Immagine di sfondo',
img_intro: 'Immagine sfondo pagina introduttiva', img_intro: 'Copertina introduttiva',
img_bordata_stampa: 'Immagine di sfondo (per STAMPA)',
img_intro_stampa: 'Copertina introduttiva (per STAMPA)',
pagina_introduttiva_sfondo_nero: 'Pagina intro a sfondo nero', pagina_introduttiva_sfondo_nero: 'Pagina intro a sfondo nero',
collane: 'Collane', collane: 'Collane',
idPageAssigned: 'Pagina Assegnata', idPageAssigned: 'Pagina Assegnata',
idPageAssigned_stampa: 'Pagina Assegnata (per STAMPA)',
descr_introduttiva: 'Descrizione Introduttiva (circa 1300 battute)', descr_introduttiva: 'Descrizione Introduttiva (circa 1300 battute)',
editore: 'Editori', editore: 'Gruppo Editoriale',
versione_perstampa: 'Per Stampa', versione_perstampa: 'Per Stampa',
pdf_generato: 'Pdf generato', pdf_generato: 'Pdf generato',
pdf_online: 'Pdf online Ufficiale', pdf_online: 'Pdf online Ufficiale',
pdf_generato_stampa: 'Pdf generato (per STAMPA)',
pdf_online_stampa: 'Pdf online Ufficiale (per STAMPA)',
argomenti: 'Argomenti',
}, },
scheda: { scheda: {

View File

@@ -123,7 +123,6 @@ export const colmailinglist = [
export const colTableCatalogList = [ export const colTableCatalogList = [
AddCol({ name: 'active', label_trans: 'myelems.active', fieldtype: costanti.FieldType.boolean }), AddCol({ name: 'active', label_trans: 'myelems.active', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'versione_perstampa', label_trans: 'cataloglist.versione_perstampa', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'title', label_trans: 'gallery.title' }), AddCol({ name: 'title', label_trans: 'gallery.title' }),
AddCol({ AddCol({
name: 'foto_collana', name: 'foto_collana',
@@ -139,6 +138,12 @@ export const colTableCatalogList = [
fieldtype: costanti.FieldType.multiselect, fieldtype: costanti.FieldType.multiselect,
jointable: 'collanas', jointable: 'collanas',
}), }),
AddCol({
name: 'argomenti',
label_trans: 'cataloglist.argomenti',
fieldtype: costanti.FieldType.multiselect,
jointable: 'catprods',
}),
AddCol({ AddCol({
name: 'editore', name: 'editore',
label_trans: 'cataloglist.editore', label_trans: 'cataloglist.editore',
@@ -178,7 +183,6 @@ export const colTableCatalogList = [
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false, isadvanced_field: false,
}), }),
AddCol({ AddCol({
name: 'pdf_generato', name: 'pdf_generato',
label_trans: 'cataloglist.pdf_generato', label_trans: 'cataloglist.pdf_generato',
@@ -188,10 +192,44 @@ export const colTableCatalogList = [
name: 'pdf_online', name: 'pdf_online',
label_trans: 'cataloglist.pdf_online', label_trans: 'cataloglist.pdf_online',
}), }),
AddCol({
name: 'idPageAssigned_stampa',
label_trans: 'cataloglist.idPageAssigned_stampa',
fieldtype: costanti.FieldType.select,
jointable: 'mypages_id',
}),
AddCol({
name: 'img_bordata_stampa',
label_trans: 'cataloglist.img_bordata_stampa',
fieldtype: costanti.FieldType.image,
jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false,
}),
AddCol({
name: 'img_intro_stampa',
label_trans: 'cataloglist.img_intro_stampa',
fieldtype: costanti.FieldType.image,
jointable: '',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
isadvanced_field: false,
}),
AddCol({
name: 'pdf_generato_stampa',
label_trans: 'cataloglist.pdf_generato_stampa',
}),
// AddCol({ name: 'data_generato', label_trans: 'dataloglist.data_generato', fieldtype: costanti.FieldType.date }),
AddCol({
name: 'pdf_online_stampa',
label_trans: 'cataloglist.pdf_online_stampa',
}),
// AddCol({ name: 'data_online', label_trans: 'dataloglist.data_online', fieldtype: costanti.FieldType.date }), // AddCol({ name: 'data_online', label_trans: 'dataloglist.data_online', fieldtype: costanti.FieldType.date }),
AddCol(ModifRec), AddCol(ModifRec),
AddCol(DuplicateRec), // AddCol(DuplicateRec),
AddCol(DeleteRec), AddCol(DeleteRec),
] ]

View File

@@ -1304,7 +1304,6 @@ export const useProducts = defineStore('Products', {
const autori = this.getAutoriByArrayAuthors(myproduct.productInfo.authors) const autori = this.getAutoriByArrayAuthors(myproduct.productInfo.authors)
const collana = myproduct.productInfo.collana const collana = myproduct.productInfo.collana
const maxDescriptionLength = testo.maxlength ?? 100; const maxDescriptionLength = testo.maxlength ?? 100;
const description = myproduct.productInfo.short_descr || ''; const description = myproduct.productInfo.short_descr || '';
const long_descr = myproduct.productInfo.description || ''; const long_descr = myproduct.productInfo.description || '';
@@ -1389,8 +1388,7 @@ export const useProducts = defineStore('Products', {
'{ranking}': ranking || '', '{ranking}': ranking || '',
'{venduti}': venduti || '', '{venduti}': venduti || '',
'{formato}': formato || '', '{formato}': formato || '',
'{collana_title}': collana ? collana.descrizione || '' : '', '{collana_title}': collana ? collana.title || '' : '',
'{collana_descr}': collana ? collana.descrizione_estesa || '' : '',
'{prezzo}': prezzo || '', '{prezzo}': prezzo || '',
'{scale}': scale || '', '{scale}': scale || '',
'{prezzo_scontato}': prezzo_scontato || '', '{prezzo_scontato}': prezzo_scontato || '',

View File

@@ -64,7 +64,7 @@ export default defineComponent({
// Utile anche per sincronizzare con le modifiche ricevute da props // Utile anche per sincronizzare con le modifiche ricevute da props
watch(() => props.modelValue, (newVal) => { watch(() => props.modelValue, (newVal) => {
optcatalogo.value = { ...newVal }; optcatalogo.value = { ...newVal };
}, { deep: true }); }, { deep: false });
/*watch(optcatalogo, (newValue) => { /*watch(optcatalogo, (newValue) => {
emit('update:modelValue', newValue); emit('update:modelValue', newValue);
@@ -125,7 +125,7 @@ export default defineComponent({
if (recscheda.scheda!.isPagIntro) { if (recscheda.scheda!.isPagIntro) {
const catalogStore = useCatalogStore() const catalogStore = useCatalogStore()
const catalog = catalogStore.catalogs?.find((catalog: ICatalog) => catalog.idPageAssigned === props.idPage) const catalog = getCatalogoByMyPage.value
if (catalog && catalog.descr_introduttiva) { if (catalog && catalog.descr_introduttiva) {
// Cerca se la descrizione introduttiva è stata impostata // Cerca se la descrizione introduttiva è stata impostata
testo = catalog.descr_introduttiva testo = catalog.descr_introduttiva
@@ -313,6 +313,21 @@ export default defineComponent({
return idCollane return idCollane
} }
function getArgomentiDaFiltrare(def_argomenti?: string[]) {
let argomenti: string[] = []
// Cerca se nella lista cataloghi c'è la Collana di questa Pagina !
let trovatocatalogo = getCatalogoByMyPage.value
if (trovatocatalogo) {
argomenti = trovatocatalogo.argomenti! || []
} else {
argomenti = def_argomenti || []
}
return argomenti
}
function getEditoreDaFiltrare(def_editori?: string[]) { function getEditoreDaFiltrare(def_editori?: string[]) {
let editore: string[] = [] let editore: string[] = []
@@ -361,29 +376,35 @@ export default defineComponent({
if (optcatalogo.value.argomenti) { if (optcatalogo.value.argomenti) {
// ha la priorità questo scelto sul catalogo // ha la priorità questo scelto sul catalogo
arrargomstr = optcatalogo.value.argomenti arrargomstr = getArgomentiDaFiltrare(optcatalogo.value.argomenti!)
} else { } else {
catstr = cat.value || '' catstr = cat.value || ''
} }
let filtroArgomenti = arrargomstr || []
let boolfiltroVuotoArgomenti = (filtroArgomenti.length === 0)
let gasselstr = '' let gasselstr = ''
if (cosa.value === shared_consts.PROD.GAS) { if (cosa.value === shared_consts.PROD.GAS) {
gasselstr = idGasSel.value || ''; gasselstr = idGasSel.value || '';
} }
let lowerSearchText = (searchtext || '').toLowerCase().trim(); let lowerSearchText = (searchtext || '').toLowerCase().trim();
lowerSearchText = lowerSearchText.replace(/[-@:=]/g, ''); lowerSearchText = lowerSearchText.replace(/[-@:=]/g, '');
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoCollane && boolfiltroVuotoEditore && boolfiltroVuotoCollana && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) { if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr && boolfiltroVuotoArgomenti && boolfiltroVuotoProductTypes && boolfiltroVuotoExcludeProductTypes && boolfiltroVuotoCollane && boolfiltroVuotoEditore && boolfiltroVuotoCollana && !filtroAuthor && (!gasselstr && (cosa.value !== shared_consts.PROD.GAS))) {
} else { } else {
arrprod = arrprod.filter((product: IProduct) => { arrprod = arrprod.filter((product: IProduct) => {
if (product && product.productInfo) { if (product && product.productInfo) {
let lowerName = (product.productInfo.name || '').toLowerCase(); let lowerName = (product.productInfo.name || '').toLowerCase();
let hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr)); let hasCategoria = false
let hasArgomentiCat = true let hasArgomentiCat = true
if (arrargomstr && arrargomstr.length > 0) { if (arrargomstr && arrargomstr.length > 0) {
hasArgomentiCat = (product.productInfo.idCatProds || []).some(idCat => arrargomstr.includes(idCat)) hasArgomentiCat = (product.productInfo.idCatProds || []).some(idCat => arrargomstr.includes(idCat))
hasCategoria = true hasCategoria = true
} else {
hasCategoria = (!catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr))) ? true : false
} }
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor)); let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
@@ -463,7 +484,6 @@ export default defineComponent({
if (myschedatocopy) { if (myschedatocopy) {
myschedatocopy.scheda._id = origScheda.scheda?._id myschedatocopy.scheda._id = origScheda.scheda?._id
myschedatocopy.scheda.isTemplate = false myschedatocopy.scheda.isTemplate = false
myschedatocopy.scheda.isPagIntro = false
myschedatocopy.scheda.name = precname myschedatocopy.scheda.name = precname
myschedatocopy.scheda.linkIdTemplate = linkIdTemplate myschedatocopy.scheda.linkIdTemplate = linkIdTemplate
@@ -491,6 +511,7 @@ export default defineComponent({
} }
} }
console.log(' FINE - populateDataWithlinkIdTemplate')
} }
@@ -522,7 +543,7 @@ export default defineComponent({
if (optcatalogo.value.argomenti) { if (optcatalogo.value.argomenti) {
// ha la priorità questo scelto sul catalogo // ha la priorità questo scelto sul catalogo
arrargomstr = optcatalogo.value.argomenti arrargomstr = getArgomentiDaFiltrare(optcatalogo.value.argomenti!)
} else { } else {
catstr = cat.value || '' catstr = cat.value || ''
} }
@@ -541,11 +562,13 @@ export default defineComponent({
let lowerName = (product.productInfo.name || '').toLowerCase(); let lowerName = (product.productInfo.name || '').toLowerCase();
let lowerCode = (product.productInfo.code || '').toLowerCase(); let lowerCode = (product.productInfo.code || '').toLowerCase();
let hasCategoria = !catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr)); let hasCategoria = false
let hasArgomentiCat = true let hasArgomentiCat = true
if (arrargomstr && arrargomstr.length > 0) { if (arrargomstr && arrargomstr.length > 0) {
hasArgomentiCat = (product.productInfo.idCatProds || []).some(idCat => arrargomstr.includes(idCat)) hasArgomentiCat = (product.productInfo.idCatProds || []).some(idCat => arrargomstr.includes(idCat))
hasCategoria = true hasCategoria = true
} else {
hasCategoria = (!catstr || (catstr && (product.productInfo.idCatProds || []).includes(catstr))) ? true : false
} }
let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor)); let hasAuthor = !filtroAuthor || (filtroAuthor && (product.productInfo.idAuthors || []).includes(filtroAuthor));
@@ -673,7 +696,7 @@ export default defineComponent({
} }
function generatearrProdToViewSorted() { function generatearrProdToViewSorted() {
// console.log('generatearrProdToViewSorted', arrProducts.value) console.log('generatearrProdToViewSorted...')
try { try {
@@ -686,6 +709,8 @@ export default defineComponent({
let indprod = 0 let indprod = 0
let indprodGenerale = 0 let indprodGenerale = 0
let indtotale = 0
for (const recscheda of optcatalogo.value.arrSchede!) { for (const recscheda of optcatalogo.value.arrSchede!) {
if (recscheda && recscheda.scheda) { if (recscheda && recscheda.scheda) {
let schedePerRiga = recscheda.scheda.numschede_perRiga || 1 let schedePerRiga = recscheda.scheda.numschede_perRiga || 1
@@ -739,16 +764,28 @@ export default defineComponent({
recscheda.arrProdToShow[pagina][riga][col] = result.myrec recscheda.arrProdToShow[pagina][riga][col] = result.myrec
indadded++ indadded++
indtotale++
// console.log('indadded', indadded) // console.log('indadded', indadded)
if (optcatalogo.value.maxnumlibri! > 0) {
if (indtotale > optcatalogo.value.maxnumlibri!)
return
} else {
if (indtotale > 200)
return
}
} }
} }
} }
if (recscheda.numPagineMax! > 0) { if (recscheda.numPagineMax! > 0) {
if (pagina + 1 >= recscheda.numPagineMax!) if (pagina + 1 >= recscheda.numPagineMax!)
break; // fine pagine break; // fine pagine
} }
} }
// console.log('*** arrProdToShow', recscheda.arrProdToShow) // console.log('*** arrProdToShow', recscheda.arrProdToShow)
@@ -757,6 +794,8 @@ export default defineComponent({
// console.log('Fine Generazione') // console.log('Fine Generazione')
} }
console.log(' FINE - generatearrProdToViewSorted !')
} catch (e) { } catch (e) {
console.error('Err', e) console.error('Err', e)
} }