- Cataloghi: BestSeller, Novità
This commit is contained in:
@@ -74,7 +74,7 @@ export default defineComponent({
|
||||
type: Object as PropType<IMyScheda>,
|
||||
required: false,
|
||||
default: () => ({
|
||||
|
||||
|
||||
}),
|
||||
},
|
||||
},
|
||||
@@ -160,7 +160,7 @@ export default defineComponent({
|
||||
|
||||
if (myproduct.value) {
|
||||
const ris = await products.addtoCartBase({ $q, t, id: myproduct.value._id, order: myorder, addqty: add })
|
||||
updateproduct()
|
||||
updateproduct(false)
|
||||
if (ris && ris.myord) {
|
||||
|
||||
}
|
||||
@@ -217,10 +217,22 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
async function updateproduct() {
|
||||
async function updateproduct(atload: boolean) {
|
||||
|
||||
myproduct.value = null;
|
||||
myproduct.value = await products.getProductById(props.id)
|
||||
let carica = true
|
||||
|
||||
if (atload) {
|
||||
if (props.product) {
|
||||
myproduct.value = props.product
|
||||
carica = false
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
if (carica) {
|
||||
myproduct.value = null;
|
||||
myproduct.value = await products.getProductById(props.id)
|
||||
}
|
||||
|
||||
// products.updateQuantityAvailable(myproduct.value._id)
|
||||
}
|
||||
@@ -325,7 +337,7 @@ export default defineComponent({
|
||||
updateTimerLabel()
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
async function mounted() {
|
||||
await load()
|
||||
|
||||
// Start the timer when the component is mounted
|
||||
@@ -360,7 +372,7 @@ export default defineComponent({
|
||||
async function load() {
|
||||
indvariazSel.value = -1
|
||||
initproduct()
|
||||
await updateproduct()
|
||||
await updateproduct(true)
|
||||
labelDataArrivoMerce.value = ''
|
||||
labelDataRitiro.value = ''
|
||||
|
||||
@@ -512,6 +524,31 @@ export default defineComponent({
|
||||
return !escludiArticolo(variazione)
|
||||
}
|
||||
|
||||
function isProductNovita() {
|
||||
const monthsAgo = props.scheda.etichette?.novita?.months ?? 6; // Numero di mesi da considerare "recenti"
|
||||
|
||||
const publishingDate = new Date(myproduct.value!.productInfo.date_publishing!);
|
||||
|
||||
// Calcola i millisecondi corrispondenti a X mesi fa
|
||||
const monthsInMilliseconds = monthsAgo * 30 * 24 * 60 * 60 * 1000; // Approssimazione, non tutti i mesi hanno 30 giorni
|
||||
|
||||
// Crea una data che rappresenta X mesi fa
|
||||
const monthsAgoDate = new Date(tools.getTimeNow() - monthsInMilliseconds);
|
||||
|
||||
// Confronta la data di pubblicazione con la data X mesi fa
|
||||
return publishingDate > monthsAgoDate;
|
||||
}
|
||||
function isProductBestseller() {
|
||||
|
||||
try {
|
||||
//return myproduct.value!.productInfo.rank1Y! > 0 && (myproduct.value!.productInfo.rank1Y! < props.scheda.etichette?.bestseller?.primiNInClassifica!)
|
||||
return myproduct.value!.indiceRanking! > 0 && (myproduct.value!.indiceRanking! < props.scheda.etichette?.bestseller?.primiNInClassifica!)
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
onBeforeUnmount(beforeDestroy)
|
||||
|
||||
@@ -568,6 +605,8 @@ export default defineComponent({
|
||||
click_author,
|
||||
click_opendetail,
|
||||
checkIfVariazioneDaVisu,
|
||||
isProductNovita,
|
||||
isProductBestseller,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -76,13 +76,15 @@
|
||||
'flex', // Classi comuni
|
||||
'image-container',
|
||||
{ 'shadow-2': options.in_3d }, // Classe condizionale
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? 'flex-col'
|
||||
: 'flex-row', // Layout flessibile
|
||||
]"
|
||||
:style="{
|
||||
justifyContent:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? 'center'
|
||||
: 'flex-start',
|
||||
alignItems: 'stretch', // Cambiato in 'stretch' per occupare l'altezza
|
||||
@@ -113,6 +115,7 @@
|
||||
: myproduct.productInfo.image_link
|
||||
"
|
||||
:alt="myproduct.productInfo.name"
|
||||
:fit="scheda.dimensioni?.immagine_prodotto?.size?.fit ?? 'cover'"
|
||||
:class="{
|
||||
'book-image-fixed': complete,
|
||||
'cursor-pointer': !complete,
|
||||
@@ -120,10 +123,11 @@
|
||||
'image-wrapper': optcatalogo.pdf,
|
||||
}"
|
||||
:style="{
|
||||
zIndex: 9000,
|
||||
zIndex: 2,
|
||||
width:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '50%'
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? scheda.testo_right.font?.perc_text ?? '50%'
|
||||
: '45%',
|
||||
...(tools.adjustSize(
|
||||
optcatalogo,
|
||||
@@ -135,6 +139,12 @@
|
||||
scheda.dimensioni?.immagine_prodotto.size?.width
|
||||
) + ' !important',
|
||||
}),
|
||||
height: scheda.dimensioni?.immagine_prodotto?.size?.height
|
||||
? tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.dimensioni?.immagine_prodotto?.size?.height
|
||||
)
|
||||
: undefined,
|
||||
display: 'block',
|
||||
}"
|
||||
@click="click_opendetail()"
|
||||
@@ -143,12 +153,14 @@
|
||||
<div
|
||||
:style="{
|
||||
width:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '100%'
|
||||
: '50%',
|
||||
: scheda.testo_right.font?.perc_text ?? '50%',
|
||||
textAlign: 'center',
|
||||
marginTop:
|
||||
scheda.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '0.5rem'
|
||||
: '0',
|
||||
}"
|
||||
@@ -157,7 +169,7 @@
|
||||
v-if="scheda.testo_right && scheda.testo_right"
|
||||
:style="{
|
||||
'--scalecatalog': optcatalogo.areadistampa.scale,
|
||||
'line-height': scheda.line_height,
|
||||
'line-height': scheda.testo_right.font?.line_height,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
@@ -171,22 +183,50 @@
|
||||
scheda.testo_right
|
||||
)
|
||||
"
|
||||
style="display: flex; flex-direction: column; justify-content: space-between; height: 100%;"
|
||||
style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 100%;
|
||||
"
|
||||
></div>
|
||||
<div v-if="scheda.barcode && scheda.barcode.show">
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
:format="scheda.barcode.format"
|
||||
:fontsize="scheda.barcode.font?.size"
|
||||
:width="
|
||||
parseInt(
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.width)
|
||||
)
|
||||
"
|
||||
:widthlines="scheda.barcode.widthlines"
|
||||
:height="scheda.barcode.size?.height"
|
||||
>
|
||||
</CBarCode>
|
||||
<div class="row justify-center">
|
||||
<div v-if="scheda.barcode && scheda.barcode.show">
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
:format="scheda.barcode.format"
|
||||
:fontsize="scheda.barcode.font?.size"
|
||||
:width="
|
||||
parseInt(
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.barcode.size?.width
|
||||
)
|
||||
)
|
||||
"
|
||||
:widthlines="scheda.barcode.widthlines"
|
||||
:height="scheda.barcode.size?.height"
|
||||
>
|
||||
</CBarCode>
|
||||
</div>
|
||||
<div v-if="scheda.etichette?.bestseller?.show && isProductBestseller()">
|
||||
<q-img
|
||||
src="images/bestseller.png"
|
||||
alt="Bestseller"
|
||||
width="40px"
|
||||
height="40px"
|
||||
fit="contain"
|
||||
></q-img>
|
||||
</div>
|
||||
<div v-else-if="scheda.etichette?.novita?.show && isProductNovita()">
|
||||
<q-img
|
||||
src="images/novita.png"
|
||||
alt="Novita"
|
||||
width="40px"
|
||||
height="40px"
|
||||
fit="contain"
|
||||
></q-img>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -200,28 +240,7 @@
|
||||
<div
|
||||
:style="{
|
||||
'--scalecatalog': optcatalogo.areadistampa.scale,
|
||||
'line-height': scheda.line_height,
|
||||
}"
|
||||
v-html="
|
||||
products.replaceKeyWordsByProduct(
|
||||
optcatalogo,
|
||||
myproduct,
|
||||
scheda.testo_bottom
|
||||
)
|
||||
"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
v-if="scheda.testo_bottom && scheda.testo_bottom.contenuto"
|
||||
:style="{
|
||||
width: '100%',
|
||||
textAlign: 'center',
|
||||
}"
|
||||
>
|
||||
<div
|
||||
:style="{
|
||||
'--scalecatalog': optcatalogo.areadistampa.scale,
|
||||
'line-height': scheda.line_height,
|
||||
'line-height': scheda.testo_bottom.font?.line_height,
|
||||
}"
|
||||
v-html="
|
||||
products.replaceKeyWordsByProduct(
|
||||
|
||||
@@ -15,7 +15,7 @@ import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
import { ICatalogo, IMyScheda } from '@src/model'
|
||||
import { ICatalogo, IMyScheda, IProduct } from '@src/model'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -27,6 +27,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
product: {
|
||||
type: Object as PropType<IProduct | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
cosa: {
|
||||
type: Number,
|
||||
required: false,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<CCatalogoCard
|
||||
:id="id"
|
||||
:product="product"
|
||||
:complete="complete"
|
||||
:cosa="cosa"
|
||||
:options="options"
|
||||
@@ -21,6 +22,7 @@
|
||||
<div class="row justify-center">
|
||||
<CCatalogoCard
|
||||
:id="id"
|
||||
:product="product"
|
||||
:complete="true"
|
||||
:cosa="cosa"
|
||||
:options="{
|
||||
|
||||
@@ -16,7 +16,7 @@ import { shared_consts } from '@/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyDimensioni',
|
||||
emits: ['update:modelValue'],
|
||||
emits: ['update:modelValue', 'modifElem'],
|
||||
components: { CMySize, CBorders, CMyFieldRec },
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -59,6 +59,10 @@ export default defineComponent({
|
||||
function modifSize(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, size: value });
|
||||
}
|
||||
function modifElem() {
|
||||
emit('update:modelValue', { ...internalModel });
|
||||
emit('modifElem', null);
|
||||
}
|
||||
function modifMargini(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, margini: value });
|
||||
}
|
||||
@@ -90,6 +94,7 @@ export default defineComponent({
|
||||
modifMargini,
|
||||
modifPadding,
|
||||
saveFielDim,
|
||||
modifElem,
|
||||
costanti,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,17 @@
|
||||
|
||||
<div v-if="internalModel" class="sfondo_margine row">
|
||||
<CMySize
|
||||
label="Pagina:"
|
||||
label="Dinemsioni:"
|
||||
v-model="internalModel.size"
|
||||
@update:model-value="modifSize"
|
||||
></CMySize>
|
||||
<CBorders
|
||||
label="Margini Pagina:"
|
||||
label="Margini:"
|
||||
v-model="internalModel.margini"
|
||||
@update:model-value="modifMargini"
|
||||
></CBorders>
|
||||
<CBorders
|
||||
label="Padding Pagina:"
|
||||
label="Padding:"
|
||||
v-model="internalModel.padding"
|
||||
@update:model-value="modifPadding"
|
||||
></CBorders>
|
||||
|
||||
@@ -26,6 +26,7 @@ import { CSelectFontSize } from '@src/components/CSelectFontSize'
|
||||
import { CMySize } from '@src/components/CMySize'
|
||||
import { CBorders } from '@src/components/CBorders'
|
||||
import { CMyDimensioni } from '@src/components/CMyDimensioni'
|
||||
import { CMyText } from '@src/components/CMyText'
|
||||
|
||||
import MixinMetaTags from '@/mixins/mixin-metatags'
|
||||
import MixinBase from '@/mixins/mixin-base'
|
||||
@@ -42,7 +43,7 @@ export default defineComponent({
|
||||
CImgTitle, CTitle, LandingFooter, CEventsCalendar,
|
||||
CCardCarousel, COpenStreetMap, CMyPage, CMyPageIntro, CMyEditor, CMyFieldRec,
|
||||
CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider,
|
||||
CMySize, CBorders, CMyDimensioni,
|
||||
CMySize, CBorders, CMyDimensioni, CMyText,
|
||||
},
|
||||
emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage'],
|
||||
props: {
|
||||
@@ -81,28 +82,6 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
const posizTextOptions = ref([
|
||||
{ label: 'In basso', value: costanti.POSIZ_TESTO.IN_BASSO },
|
||||
{ label: 'A Destra', value: costanti.POSIZ_TESTO.A_DESTRA },
|
||||
])
|
||||
const formatOptions = ref([
|
||||
{ label: 'auto', value: 'CODE128' },
|
||||
{ label: 'EAN-13', value: 'EAN-13' },
|
||||
{ label: 'UPC', value: 'upc' },
|
||||
])
|
||||
const fontSizeOptions = ref([
|
||||
{ label: '9', value: '9' },
|
||||
{ label: '10', value: '10' },
|
||||
{ label: '11', value: '11' },
|
||||
{ label: '12', value: '12' },
|
||||
{ label: '13', value: '13' },
|
||||
{ label: '14', value: '14' },
|
||||
{ label: '15', value: '15' },
|
||||
{ label: '16', value: '16' },
|
||||
{ label: '18', value: '18' },
|
||||
{ label: '20', value: '20' },
|
||||
{ label: '22', value: '22' },
|
||||
])
|
||||
|
||||
const animare = ref(0)
|
||||
const slide = ref(0)
|
||||
@@ -243,6 +222,7 @@ export default defineComponent({
|
||||
function modifElem() {
|
||||
disableSave.value = false
|
||||
elemChanged.value = true
|
||||
|
||||
}
|
||||
function modifElemAndSchede() {
|
||||
modifElem()
|
||||
@@ -276,33 +256,57 @@ export default defineComponent({
|
||||
|
||||
if (myel.value.catalogo && myel.value.catalogo?.arrSchede) {
|
||||
for (const recscheda of myel.value.catalogo?.arrSchede) {
|
||||
if (recscheda.scheda && (!recscheda.scheda?.testo_bottom)) {
|
||||
recscheda.scheda.testo_bottom = { contenuto: '', maxlength: 100 }
|
||||
}
|
||||
if (recscheda.scheda && !recscheda.scheda.testo_bottom!.font) {
|
||||
recscheda.scheda.testo_bottom!.font = { name: '', size: ''}
|
||||
}
|
||||
if (recscheda.scheda && (!recscheda.scheda?.testo_right || !recscheda.scheda?.testo_right.font) ) {
|
||||
recscheda.scheda.testo_right = { contenuto: '', font: { name: '', size: ''} }
|
||||
}
|
||||
if (recscheda.scheda && (!recscheda.scheda?.dimensioni.pagina.imgsfondo)) {
|
||||
recscheda.scheda.dimensioni.pagina = tools.resetRecIDimensioni(recscheda.scheda?.dimensioni.pagina)
|
||||
}
|
||||
if (recscheda.scheda && (!recscheda.scheda?.barcode || !recscheda.scheda?.barcode.font)) {
|
||||
recscheda.scheda.barcode = {
|
||||
show: false,
|
||||
format: '',
|
||||
size: {
|
||||
width: '2',
|
||||
height: '33',
|
||||
},
|
||||
font: {
|
||||
name: '',
|
||||
size: '11',
|
||||
if (recscheda.scheda) {
|
||||
if ((!recscheda.scheda?.testo_bottom)) {
|
||||
recscheda.scheda.testo_bottom = { contenuto: '', maxlength: 100 }
|
||||
}
|
||||
if (!recscheda.scheda.testo_bottom!.font) {
|
||||
recscheda.scheda.testo_bottom!.font = { name: '', size: '' }
|
||||
}
|
||||
if ((!recscheda.scheda?.testo_right || !recscheda.scheda?.testo_right.font)) {
|
||||
recscheda.scheda.testo_right = { contenuto: '', font: { name: '', size: '' } }
|
||||
}
|
||||
if ((!recscheda.scheda?.dimensioni.pagina)) {
|
||||
recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
|
||||
}
|
||||
if ((!recscheda.scheda?.dimensioni.pagina.dimensioni)) {
|
||||
recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
|
||||
}
|
||||
if (!recscheda.scheda?.dimensioni?.pagina?.testo_up) {
|
||||
recscheda.scheda!.dimensioni.pagina.testo_up = tools.resetIText(null)
|
||||
}
|
||||
if (!recscheda.scheda?.dimensioni?.pagina?.testo_down) {
|
||||
recscheda.scheda!.dimensioni.pagina.testo_down = tools.resetIText(null)
|
||||
}
|
||||
|
||||
if (!recscheda.scheda?.etichette?.novita?.show) {
|
||||
recscheda.scheda.etichette!.novita = {
|
||||
show: false,
|
||||
months: 6,
|
||||
}
|
||||
recscheda.scheda.etichette!.bestseller = {
|
||||
show: false,
|
||||
primiNInClassifica: 0,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ((!recscheda.scheda?.barcode || !recscheda.scheda?.barcode.font)) {
|
||||
recscheda.scheda.barcode = {
|
||||
show: false,
|
||||
format: '',
|
||||
size: {
|
||||
width: '2',
|
||||
height: '33',
|
||||
},
|
||||
font: {
|
||||
name: '',
|
||||
size: '11',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +326,7 @@ export default defineComponent({
|
||||
if (myel.value.catalogo) {
|
||||
if (!myel.value.catalogo.areadistampa) {
|
||||
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(null)
|
||||
myel.value.catalogo.areadistampa.margini = { left: '0.59', top: '0.59', right: '0.59', bottom: '0.28'}
|
||||
myel.value.catalogo.areadistampa.margini = { left: '0.59', top: '0.59', right: '0.59', bottom: '0.28' }
|
||||
}
|
||||
|
||||
myel.value.catalogo.areadistampa = tools.resetRecIAreaDiStampa(myel.value.catalogo.areadistampa)
|
||||
@@ -449,15 +453,19 @@ export default defineComponent({
|
||||
show_separatore: true,
|
||||
name: 'Scheda Nuova',
|
||||
dimensioni,
|
||||
line_height: 100,
|
||||
numschede_perRiga: 2,
|
||||
numschede_perCol: 2,
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
testo_right: {
|
||||
contenuto: '',
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
},
|
||||
},
|
||||
testo_bottom: {
|
||||
contenuto: '',
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.IN_BASSO,
|
||||
}
|
||||
},
|
||||
barcode: {
|
||||
show: false,
|
||||
@@ -487,7 +495,7 @@ export default defineComponent({
|
||||
_id: objectId(),
|
||||
scheda: newscheda,
|
||||
order: maxorder + 10,
|
||||
numSchede: 1,
|
||||
numPagineMax: 0,
|
||||
}
|
||||
)
|
||||
// console.log('arrschede', myel.value.catalogo!.arrSchede)
|
||||
@@ -533,13 +541,14 @@ export default defineComponent({
|
||||
myschedadest.scheda = tools.jsonCopy(myschedatocopy.scheda!)
|
||||
myschedadest.scheda!._id = objectId()
|
||||
myschedadest.order = 20
|
||||
|
||||
|
||||
myschedadest.scheda!.name = myschedadest.scheda!.name + '_copia'
|
||||
myschedadest.scheda!.isTemplate = false
|
||||
myschedadest.scheda!.isTemplate = false
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function dupNewScheda(id: string) {
|
||||
if (!myel.value.catalogo!.arrSchede)
|
||||
return
|
||||
@@ -550,9 +559,9 @@ export default defineComponent({
|
||||
let myscheda = tools.jsonCopy(myfindscheda)
|
||||
delete myscheda._id
|
||||
delete myscheda.scheda!._id
|
||||
myscheda.numSchede = 1
|
||||
myscheda.numPagineMax = 0
|
||||
myscheda.order = myscheda.order + 10,
|
||||
myscheda._id = objectId()
|
||||
myscheda._id = objectId()
|
||||
myscheda.scheda!._id = objectId()
|
||||
myscheda.scheda!.name = myscheda.scheda!.name + '_copia'
|
||||
myscheda.scheda!.isTemplate = false
|
||||
@@ -759,6 +768,8 @@ export default defineComponent({
|
||||
|
||||
let arr: any = []
|
||||
|
||||
arr.push({ label: '[Nessuna]', value: '' })
|
||||
|
||||
if (arrschede) {
|
||||
arrschede.forEach((recscheda: ISchedaSingola) => {
|
||||
arr.push({ label: recscheda.scheda!.name, value: recscheda.scheda!._id })
|
||||
@@ -933,15 +944,12 @@ export default defineComponent({
|
||||
saveFieldElem,
|
||||
updateCatalogoSizeWidth,
|
||||
dupPage,
|
||||
posizTextOptions,
|
||||
tabScheda,
|
||||
addNewScheda,
|
||||
dupNewScheda,
|
||||
delRecScheda,
|
||||
SchedeOpt,
|
||||
addProdSpeciale,
|
||||
formatOptions,
|
||||
fontSizeOptions,
|
||||
idSchedaDaCopiare,
|
||||
copyfromTemplate,
|
||||
modifElemAndSchede,
|
||||
|
||||
@@ -979,7 +979,7 @@
|
||||
v-on:keyup.enter="saveElem"
|
||||
>
|
||||
</q-input>
|
||||
|
||||
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
@@ -1343,7 +1343,7 @@
|
||||
label="Selezione Collane/Editori"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.pdf"
|
||||
color="positive"
|
||||
@@ -1354,7 +1354,6 @@
|
||||
</q-toggle>
|
||||
|
||||
<q-input
|
||||
dense
|
||||
label="NomeFile PDF"
|
||||
@update:model-value="modifElem"
|
||||
v-model="myel.catalogo.pdf_filename"
|
||||
@@ -1366,6 +1365,21 @@
|
||||
<br />
|
||||
|
||||
<!--++AddCATALOGO_FIELDS-->
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="enableEdit && myel.catalogo"
|
||||
rounded
|
||||
outlined
|
||||
v-model="myel.catalogo.sort"
|
||||
:options="shared_consts.ORDINAMENTO_CATALOGHI"
|
||||
@update:model-value="modifElem"
|
||||
label="Ordinamento"
|
||||
style="width: 200px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
v-if="
|
||||
@@ -1377,9 +1391,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Includi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1398,9 +1411,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Escludi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1414,9 +1426,8 @@
|
||||
:options="Products.publishers"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Editori"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
option-value="_id"
|
||||
@@ -1439,6 +1450,7 @@
|
||||
<CMyDimensioni
|
||||
v-model="myel.catalogo.dimensioni_def.pagina"
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
@@ -1536,7 +1548,6 @@
|
||||
>
|
||||
</q-toggle>
|
||||
<q-input
|
||||
dense
|
||||
label="Nome Template"
|
||||
@update:model-value="modifElem"
|
||||
v-model="recscheda.scheda.name"
|
||||
@@ -1553,30 +1564,47 @@
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="idSchedaDaCopiare"
|
||||
v-model="recscheda.scheda.linkIdTemplate"
|
||||
:options="SchedeOpt()"
|
||||
@update:model-value="modifElem"
|
||||
dense
|
||||
label="Scegli Scheda"
|
||||
label="Scheda collegata:"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-btn
|
||||
icon="far fa-copy"
|
||||
label="Copia da Template"
|
||||
dense
|
||||
:disable="!idSchedaDaCopiare"
|
||||
color="primary"
|
||||
@click="copyfromTemplate(ind)"
|
||||
>
|
||||
</q-btn>
|
||||
<br />
|
||||
<div class="row">
|
||||
<q-select
|
||||
:behavior="
|
||||
$q.platform.is.ios === true ? 'dialog' : 'menu'
|
||||
"
|
||||
v-if="enableEdit"
|
||||
rounded
|
||||
outlined
|
||||
v-model="idSchedaDaCopiare"
|
||||
:options="SchedeOpt()"
|
||||
@update:model-value="modifElem"
|
||||
label="Scegli Scheda"
|
||||
style="width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-btn
|
||||
icon="far fa-copy"
|
||||
label="Copia da Template"
|
||||
:disable="!idSchedaDaCopiare"
|
||||
color="primary"
|
||||
@click="copyfromTemplate(ind)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<CMySlider
|
||||
label="Schede da ripetere"
|
||||
v-model="recscheda.numSchede"
|
||||
label="Pagine max da visualizzare"
|
||||
v-model="recscheda.numPagineMax"
|
||||
:min="1"
|
||||
:max="100"
|
||||
color="green"
|
||||
@@ -1588,9 +1616,26 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Filtri"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<q-select
|
||||
:behavior="
|
||||
$q.platform.is.ios === true ? 'dialog' : 'menu'
|
||||
"
|
||||
v-if="enableEdit && myel.catalogo"
|
||||
rounded
|
||||
outlined
|
||||
v-model="recscheda.scheda.sort"
|
||||
:options="shared_consts.ORDINAMENTO_CATALOGHI"
|
||||
@update:model-value="modifElem"
|
||||
label="Ordinamento"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
<q-select
|
||||
:behavior="
|
||||
$q.platform.is.ios === true ? 'dialog' : 'menu'
|
||||
@@ -1606,9 +1651,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Includi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1628,9 +1672,8 @@
|
||||
:options="shared_consts.VERSIONI_PRODOTTO"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Escludi"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
@@ -1646,9 +1689,8 @@
|
||||
:options="Products.publishers"
|
||||
@update:model-value="modifElem"
|
||||
multiple
|
||||
dense
|
||||
label="Editori"
|
||||
style="width: 150px"
|
||||
style="width: 300px"
|
||||
emit-value
|
||||
map-options
|
||||
option-value="_id"
|
||||
@@ -1670,7 +1712,6 @@
|
||||
filled
|
||||
use-input
|
||||
new-value-mode="add-unique"
|
||||
dense
|
||||
style="width: 350px"
|
||||
/>
|
||||
</div>
|
||||
@@ -1681,14 +1722,36 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Pagina"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<CMyDimensioni
|
||||
v-model="recscheda.scheda.dimensioni.pagina"
|
||||
v-model="
|
||||
recscheda.scheda.dimensioni.pagina.dimensioni
|
||||
"
|
||||
:path="costanti.DIR_SCHEDA"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.dimensioni.pagina.testo_up"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo in Alto"
|
||||
>
|
||||
</CMyText>
|
||||
<CMyText
|
||||
v-model="
|
||||
recscheda.scheda.dimensioni.pagina.testo_down
|
||||
"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo in Basso"
|
||||
>
|
||||
</CMyText>
|
||||
</q-expansion-item>
|
||||
|
||||
<q-expansion-item
|
||||
@@ -1696,11 +1759,13 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Righe"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<CMyDimensioni
|
||||
v-model="recscheda.scheda.dimensioni.riga"
|
||||
:path="costanti.DIR_SCHEDA"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="false"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
@@ -1711,6 +1776,7 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Schede"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-toggle
|
||||
@@ -1758,6 +1824,7 @@
|
||||
|
||||
<CMySize
|
||||
label="Immagini:"
|
||||
:fit="true"
|
||||
v-model="
|
||||
recscheda.scheda.dimensioni.immagine_prodotto.size
|
||||
"
|
||||
@@ -1771,93 +1838,26 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Testo"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-select
|
||||
v-model="recscheda.scheda.posiz_text"
|
||||
:options="posizTextOptions"
|
||||
label="Posizione"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 100px"
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.testo_right"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
label="Testo a Destra"
|
||||
>
|
||||
</q-select>
|
||||
<CMySlider
|
||||
label="Line Height:"
|
||||
v-model="recscheda.scheda.line_height"
|
||||
:min="0.5"
|
||||
:max="2"
|
||||
color="blue"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
</CMyText>
|
||||
|
||||
<div>
|
||||
Parole Chiave: {autore} {titolo} {descrizione}
|
||||
{descrizione_estesa} {prezzo}
|
||||
</div>
|
||||
|
||||
<q-select
|
||||
v-model="recscheda.scheda.testo_right.font.size"
|
||||
:options="fontSizeOptions"
|
||||
label="Font Size Titolo"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 100px"
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.testo_bottom"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
label="Testo in Basso"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<CMyFieldRec
|
||||
title="Testo a Destra:"
|
||||
table="text"
|
||||
:rec="recscheda.scheda.testo_right"
|
||||
field="contenuto"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:fieldtype="costanti.FieldType.html"
|
||||
@save="saveFieldElem"
|
||||
@update_col="update_col"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
|
||||
<q-select
|
||||
v-model="recscheda.scheda.testo_bottom.font.size"
|
||||
:options="fontSizeOptions"
|
||||
label="Dimensione Titolo"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 150px"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<CMyFieldRec
|
||||
title="Testo in Basso :"
|
||||
table="text"
|
||||
:rec="recscheda.scheda.testo_bottom"
|
||||
field="contenuto"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:fieldtype="costanti.FieldType.html"
|
||||
@save="saveFieldElem"
|
||||
@update_col="update_col"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
</CMyText>
|
||||
</q-expansion-item>
|
||||
|
||||
<q-expansion-item
|
||||
@@ -1865,6 +1865,7 @@
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Codice a Barre"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-toggle
|
||||
@@ -1877,7 +1878,7 @@
|
||||
</q-toggle>
|
||||
<q-select
|
||||
v-model="recscheda.scheda.barcode.format"
|
||||
:options="formatOptions"
|
||||
:options="tools.formatOptions"
|
||||
label="Formato"
|
||||
options-dense
|
||||
dense
|
||||
@@ -1914,6 +1915,49 @@
|
||||
:addstr="false"
|
||||
></CMySize>
|
||||
</q-expansion-item>
|
||||
|
||||
<q-expansion-item
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
label="Etichette Speciali"
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<q-toggle
|
||||
v-model="recscheda.scheda.etichette.novita.show"
|
||||
color="positive"
|
||||
label="Novità"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
<CMySlider
|
||||
label="Pubblicato meno di X mesi fà"
|
||||
v-model="recscheda.scheda.etichette.novita.months"
|
||||
:min="1"
|
||||
:max="24"
|
||||
color="green"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
<q-toggle
|
||||
v-model="recscheda.scheda.etichette.bestseller.show"
|
||||
color="positive"
|
||||
label="Bestseller"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
<CMySlider
|
||||
label="Primi N in Classifica"
|
||||
v-model="
|
||||
recscheda.scheda.etichette.bestseller
|
||||
.primiNInClassifica
|
||||
"
|
||||
:min="1"
|
||||
:max="100"
|
||||
color="green"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
@@ -1928,14 +1972,22 @@
|
||||
label="Prima Pagina"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
Prima Pagina: <br />
|
||||
<div class="row">
|
||||
<CMyDimensioni
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
v-model="myel.catalogo.first_page"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
<CMyText
|
||||
v-model="myel.catalogo.first_page.text_html"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo"
|
||||
>
|
||||
</CMyText>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
@@ -1948,12 +2000,23 @@
|
||||
label="Ultima Pagina"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<CMyDimensioni
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
v-model="myel.catalogo.last_page"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
<div class="row">
|
||||
<CMyDimensioni
|
||||
:path="costanti.DIR_CATALOGO"
|
||||
v-model="myel.catalogo.last_page"
|
||||
@modifElem="modifElem"
|
||||
:show_imgsfondo="true"
|
||||
@update:model-value="modifElem"
|
||||
></CMyDimensioni>
|
||||
<CMyText
|
||||
v-model="myel.catalogo.last_page.text_html"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo"
|
||||
>
|
||||
</CMyText>
|
||||
</div>
|
||||
</q-expansion-item>
|
||||
<div v-if="enableEdit">
|
||||
<q-expansion-item
|
||||
|
||||
@@ -12,7 +12,7 @@ import MixinBase from '@/mixins/mixin-base'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyFieldRec',
|
||||
emits: ['save', 'update:rec'],
|
||||
emits: ['save', 'update:rec', 'update_col'],
|
||||
props: {
|
||||
table: {
|
||||
type: String,
|
||||
@@ -177,6 +177,7 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showandsave(row: any, col: any, newval: any, valinitial: any) {
|
||||
console.log('showandsave CMyFieldDb', row, col, newval)
|
||||
emit('save', props.rec, newval, col)
|
||||
@@ -238,6 +239,8 @@ export default defineComponent({
|
||||
function update_col(name: string, val: any) {
|
||||
// console.log('update_col', name, val)
|
||||
myrec.value[name] = val
|
||||
|
||||
emit('update_col', name, val)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
@@ -21,6 +21,8 @@ export default defineComponent({
|
||||
default: () => ({
|
||||
width: '',
|
||||
height: '',
|
||||
gap: '',
|
||||
fit: '',
|
||||
}),
|
||||
},
|
||||
label: {
|
||||
@@ -37,6 +39,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
fit: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
addstr: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -75,6 +82,9 @@ export default defineComponent({
|
||||
function modifValueGap(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, gap: value });
|
||||
}
|
||||
function modifValueFit(value: any) {
|
||||
emit('update:modelValue', { ...internalModel, fit: value });
|
||||
}
|
||||
|
||||
function modifValueRatio(value: any) {
|
||||
// modifValueWidth(0)
|
||||
@@ -104,8 +114,10 @@ export default defineComponent({
|
||||
modifValueHeight,
|
||||
modifValueRatio,
|
||||
modifValueGap,
|
||||
modifValueFit,
|
||||
internalModel,
|
||||
ratio,
|
||||
tools,
|
||||
keepRatio,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
:disable="!keepRatio"
|
||||
@update:model-value="modifValueRatio"
|
||||
></CMySlider>
|
||||
|
||||
|
||||
<CMySlider
|
||||
label="Width:"
|
||||
v-model="internalModel.width"
|
||||
@@ -57,6 +57,21 @@
|
||||
addstr="px"
|
||||
@update:model-value="modifValueGap"
|
||||
></CMySlider>
|
||||
<q-select
|
||||
v-if="fit"
|
||||
v-model="internalModel.fit"
|
||||
:options="tools.SelectListFit"
|
||||
label="Dimensione Img"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 120px"
|
||||
@update:model-value="modifValueFit"
|
||||
fill-input
|
||||
text-color="white"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
0
src/components/CMyText/CMyText.scss
Executable file
0
src/components/CMyText/CMyText.scss
Executable file
79
src/components/CMyText/CMyText.ts
Executable file
79
src/components/CMyText/CMyText.ts
Executable file
@@ -0,0 +1,79 @@
|
||||
import { defineComponent, ref, computed, PropType, toRef, reactive, watch } from 'vue'
|
||||
import { IOperators, ISize, IText } from 'model'
|
||||
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
import { CMySlider } from '@src/components/CMySlider'
|
||||
import { CMyFieldRec } from '@src/components/CMyFieldRec'
|
||||
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyText',
|
||||
emits: ['update:modelValue', 'modifElem', 'saveFieldElem',],
|
||||
components: { CMySlider, CMyFieldRec },
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Object as PropType<IText>,
|
||||
required: true,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
disable: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
show_maxlength: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
|
||||
const internalModel = reactive({ ...props.modelValue })
|
||||
|
||||
function modifElem() {
|
||||
// console.log('modifElem')
|
||||
emit('update:modelValue', { ...internalModel });
|
||||
emit('modifElem', null);
|
||||
}
|
||||
function update_col() {
|
||||
// console.log('update_col')
|
||||
emit('update:modelValue', { ...internalModel });
|
||||
emit('modifElem', null);
|
||||
}
|
||||
|
||||
function saveFieldElem() {
|
||||
emit('update:modelValue', { ...internalModel });
|
||||
emit('saveFieldElem', null);
|
||||
}
|
||||
|
||||
// Sincronizzare i cambiamenti esterni con internalModel quando props cambiano
|
||||
watch(() => props.modelValue, (newModel: any) => {
|
||||
Object.assign(internalModel, newModel);
|
||||
|
||||
}, { immediate: true });
|
||||
|
||||
return {
|
||||
t,
|
||||
shared_consts,
|
||||
internalModel,
|
||||
modifElem,
|
||||
tools,
|
||||
costanti,
|
||||
saveFieldElem,
|
||||
update_col,
|
||||
}
|
||||
}
|
||||
})
|
||||
83
src/components/CMyText/CMyText.vue
Executable file
83
src/components/CMyText/CMyText.vue
Executable file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<CMyFieldRec
|
||||
:title="label"
|
||||
table="text"
|
||||
:rec="internalModel"
|
||||
field="contenuto"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:fieldtype="costanti.FieldType.html"
|
||||
@save="saveFieldElem"
|
||||
@update_col="update_col"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
<q-select
|
||||
v-model="internalModel.font.posiz_text"
|
||||
:options="tools.posizTextOptions"
|
||||
label="Posizione"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 100px"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
>
|
||||
</q-select>
|
||||
<CMySlider
|
||||
label="Margine tra l'immagine"
|
||||
v-model="internalModel.font.perc_text"
|
||||
:min="0"
|
||||
:max="100"
|
||||
color="blue"
|
||||
addstr="%"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
<CMySlider
|
||||
label="Line Height:"
|
||||
v-model="internalModel.font.line_height"
|
||||
:min="0.5"
|
||||
:max="2"
|
||||
color="blue"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
<CMySlider
|
||||
v-if="show_maxlength"
|
||||
label="Lunghezza Massima:"
|
||||
v-model="internalModel.maxlength"
|
||||
:min="0"
|
||||
:max="1000"
|
||||
color="blue"
|
||||
addstr=""
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
|
||||
<div>
|
||||
Parole Chiave: {autore} {titolo} {descrizione} {date_pub} {ranking}
|
||||
{descrizione_breve_macro} {descrizione_completa_macro} {sottotitolo} {prezzo}
|
||||
</div>
|
||||
|
||||
<q-select
|
||||
v-model="internalModel.font.size"
|
||||
:options="tools.fontSizeOptions"
|
||||
label="Size Titolo"
|
||||
options-dense
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
style="width: 120px"
|
||||
@update:model-value="modifElem"
|
||||
fill-input
|
||||
text-color="white"
|
||||
>
|
||||
</q-select>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyText.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyText.scss';
|
||||
</style>
|
||||
1
src/components/CMyText/index.ts
Executable file
1
src/components/CMyText/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMyText} from './CMyText.vue'
|
||||
Reference in New Issue
Block a user