- 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

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

View File

@@ -34,7 +34,7 @@
:prop_showMap="false"
:heightcarousel="heightcarousel"
@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>
</div>

View File

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

View File

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

View File

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

View File

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

View File

@@ -217,7 +217,7 @@
<CMySlider
v-if="
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
"
label="Altezza Carosello:"
@@ -1391,6 +1391,15 @@
>
</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
label="NomeFile PDF"
@update:model-value="modifElem"
@@ -2176,6 +2185,7 @@
@update:model-value="modifElem"
>
</q-toggle>
<q-toggle
v-model="myel.catalogo.indebug"
color="positive"

View File

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

View File

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

View File

@@ -14,7 +14,7 @@ import { useRouter } from 'vue-router'
import { useCalendarStore } from '@src/store/CalendarStore'
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'
export default defineComponent({
@@ -62,6 +62,7 @@ export default defineComponent({
const statecolor = ref('negative')
const apriInfo = ref(false)
const collanestr = ref('')
const argomentistr = ref('')
const editorestr = ref('')
const products = useProducts()
@@ -106,6 +107,13 @@ export default defineComponent({
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 = ''
if (myrec.value.editore) {
for (const receditore of myrec.value.editore!) {
@@ -198,6 +206,7 @@ export default defineComponent({
editorestr,
pagina_collegata,
esiste_descrintro,
argomentistr,
}
},
})

View File

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

View File

@@ -1,5 +1,5 @@
<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">
<q-btn
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 { useI18n } from '@/boot/i18n'
@@ -71,6 +71,17 @@ export default defineComponent({
}, { immediate: true });
function mounted() {
if (!internalModel.font?.perc_text) {
internalModel.font!.perc_text = ''
}
if (!internalModel.maxlength) {
internalModel.maxlength = 0
}
}
onMounted(mounted)
return {
t,
shared_consts,

View File

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