- Aggiornati margini.
- Cataloghi: Export ed Import di una pagine ed i suoi elementi !
This commit is contained in:
@@ -3,7 +3,7 @@ SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="18"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
DIRECTORY_SERVER=/var/www/freeplanet_serverside
|
||||
SERVERDIR_WEBSITE="/var/www/test.gruppomacro.app"
|
||||
SERVERDIR_WEBSITE="/var/www/gruppomacro.app"
|
||||
SERVERPW_WEBSITE=pwdadmin@1AOK
|
||||
APP_URL="https://gruppomacro.app"
|
||||
URL_FACEBOOK=""
|
||||
|
||||
@@ -34,11 +34,21 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: 2,
|
||||
},
|
||||
show_at_right: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 100,
|
||||
},
|
||||
gap: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
fontsize: {
|
||||
type: Number,
|
||||
required: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="row barcode-container">
|
||||
<div class="text-center" :style="`font-size: ${fontsize}px`">
|
||||
<div class="row barcode-container" :style="{ marginTop: gap ? gap : '0'}">
|
||||
<div v-if="text" class="text-center" :style="`font-size: ${fontsize}px`">
|
||||
{{ text }}
|
||||
</div>
|
||||
<img :style="`width:${width}px !important;`" :id="`C${value}`"/>
|
||||
|
||||
@@ -385,3 +385,12 @@ $grigioscuro: rgb(120, 120, 120);
|
||||
padding: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.flex-details_and_barcode {
|
||||
display: flex; /* Rende il div un container flex per allineare i contenuti */
|
||||
align-items: center; /* Allineamento verticale al centro */
|
||||
padding-top: calc(5 * var(--scalecatalog) * 1px);
|
||||
justify-content: space-between !important;
|
||||
flex-grow: 0; /* Opzionale: permette agli elementi di crescere uniformemente */
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { CCardState } from '../CCardState'
|
||||
import { CCopyBtn } from '../CCopyBtn'
|
||||
import { CMyValueDb } from '../CMyValueDb'
|
||||
import { CPrice } from '../CPrice'
|
||||
import { CText } from '../CText'
|
||||
import { CLabel } from '@src/components/CLabel'
|
||||
|
||||
import { CBarCode } from '../CBarCode'
|
||||
@@ -73,7 +74,10 @@ export default defineComponent({
|
||||
}),
|
||||
},
|
||||
},
|
||||
components: { CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice, CBarCode, CLabel },
|
||||
components: {
|
||||
CTitleBanner, CCardState, CCopyBtn, CMyValueDb, VuePdfApp, CPrice, CBarCode, CLabel,
|
||||
CText
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
@@ -151,6 +155,13 @@ export default defineComponent({
|
||||
props.scheda!.testo_right!
|
||||
)
|
||||
})
|
||||
const getTesto_Right_attaccato = computed(() => {
|
||||
return products.replaceKeyWordsByProduct(
|
||||
optcatalogo.value,
|
||||
myproduct.value!,
|
||||
props.scheda!.testo_right_attaccato!
|
||||
)
|
||||
})
|
||||
const getTesto_Debug = computed(() => {
|
||||
return products.replaceKeyWordsByProduct(
|
||||
optcatalogo.value,
|
||||
@@ -657,6 +668,7 @@ export default defineComponent({
|
||||
modifOn,
|
||||
modifProd,
|
||||
getTesto_Right,
|
||||
getTesto_Right_attaccato,
|
||||
getTesto_Bottom,
|
||||
getTesto_Debug,
|
||||
getScale,
|
||||
|
||||
@@ -40,25 +40,18 @@
|
||||
</q-page-sticky>
|
||||
|
||||
<q-card-section>
|
||||
<!-- per immagine di ombra -->
|
||||
<div
|
||||
v-if="scheda.testo_right && scheda.testo_right?.font"
|
||||
v-if="scheda.testo_right_attaccato || scheda.testo_right"
|
||||
:class="[
|
||||
'flex', // Classi comuni
|
||||
'image-container',
|
||||
{ 'shadow-2': options.in_3d && !optcatalogo.pdf }, // Classe condizionale
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
scheda.testo_right_attaccato.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? 'flex-col'
|
||||
: 'flex-row', // Layout flessibile
|
||||
? ''
|
||||
: 'flex flex-row', // Layout flessibile
|
||||
]"
|
||||
:style="{
|
||||
justifyContent:
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? 'center'
|
||||
: 'flex-start',
|
||||
alignItems: 'stretch', // Cambiato in 'stretch' per occupare l'altezza
|
||||
gap:
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
@@ -75,7 +68,7 @@
|
||||
),
|
||||
}"
|
||||
>
|
||||
<div style="position: relative; display: inline-block">
|
||||
<div>
|
||||
<a :href="myproduct.productInfo.link_macro" target="_blank">
|
||||
<q-img
|
||||
v-if="myproduct.productInfo"
|
||||
@@ -139,46 +132,49 @@
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<!-- Testo associato all'immagine -->
|
||||
|
||||
<!-- Testo sotto all'immagine -->
|
||||
<CText
|
||||
:rectext="scheda.testo_right_attaccato"
|
||||
:myproduct="myproduct"
|
||||
:optcatalogo="optcatalogo"
|
||||
:scheda="scheda"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
scheda.testo_right_attaccato.font?.posiz_text !==
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
"
|
||||
:style="{
|
||||
width:
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
alignSelf:
|
||||
scheda.testo_right_attaccato.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '100%'
|
||||
: scheda.testo_right.font?.perc_text ?? '50%',
|
||||
? ''
|
||||
: 'end',
|
||||
marginTop:
|
||||
scheda.testo_right.font?.posiz_text ===
|
||||
scheda.testo_right_attaccato.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
? '0.5rem'
|
||||
? 'auto'
|
||||
: '0',
|
||||
}"
|
||||
>
|
||||
<div
|
||||
v-if="scheda.testo_right && scheda.testo_right"
|
||||
:style="{
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': scheda.testo_right.font?.line_height,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}"
|
||||
<CText
|
||||
:rectext="scheda.testo_right"
|
||||
:myproduct="myproduct"
|
||||
:optcatalogo="optcatalogo"
|
||||
:show_at_right="scheda.barcode.show_at_right"
|
||||
>
|
||||
<div
|
||||
v-html="getTesto_Right"
|
||||
style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 100%;
|
||||
"
|
||||
></div>
|
||||
<div class="row">
|
||||
<div class="row no-wrap items-center">
|
||||
<div v-if="scheda.barcode && scheda.barcode.show">
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
:format="scheda.barcode.format"
|
||||
:fontsize="scheda.barcode.font?.size"
|
||||
:fontsize="
|
||||
scheda.barcode.font?.size
|
||||
"
|
||||
:gap="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.gap)
|
||||
"
|
||||
:width="
|
||||
parseInt(
|
||||
tools.adjustSize(
|
||||
@@ -187,8 +183,89 @@
|
||||
)
|
||||
)
|
||||
"
|
||||
:widthlines="scheda.barcode.widthlines"
|
||||
:height="scheda.barcode.size?.height"
|
||||
:widthlines="tools.adjustSize(optcatalogo, scheda.barcode.widthlines)"
|
||||
:height="
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.barcode.size?.height
|
||||
)
|
||||
"
|
||||
:show_at_right="scheda.barcode.show_at_right"
|
||||
>
|
||||
</CBarCode>
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
scheda.etichette?.bestseller?.show &&
|
||||
isProductBestseller()
|
||||
"
|
||||
>
|
||||
<q-img
|
||||
src="images/bestseller.png"
|
||||
alt="Bestseller"
|
||||
:width="40 * tools.getScale(optcatalogo) + 'px'"
|
||||
:height="40 * tools.getScale(optcatalogo) + 'px'"
|
||||
fit="contain"
|
||||
></q-img>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
scheda.etichette?.novita?.show && isProductNovita()
|
||||
"
|
||||
>
|
||||
<q-img
|
||||
src="images/novita.png"
|
||||
alt="Novita"
|
||||
:width="40 * tools.getScale(optcatalogo) + 'px'"
|
||||
:height="40 * tools.getScale(optcatalogo) + 'px'"
|
||||
fit="contain"
|
||||
></q-img>
|
||||
</div>
|
||||
</div>
|
||||
</CText>
|
||||
</div>
|
||||
</CText>
|
||||
<div
|
||||
v-if="
|
||||
scheda.testo_right_attaccato.font?.posiz_text ===
|
||||
costanti.POSIZ_TESTO.IN_BASSO
|
||||
"
|
||||
class="flexible-width"
|
||||
:style="{
|
||||
marginTop: 'auto',
|
||||
}"
|
||||
>
|
||||
<CText
|
||||
:rectext="scheda.testo_right"
|
||||
:myproduct="myproduct"
|
||||
:optcatalogo="optcatalogo"
|
||||
:scheda="scheda"
|
||||
:show_at_right="scheda.barcode.show_at_right"
|
||||
>
|
||||
<div class="row no-wrap items-center">
|
||||
<div v-if="scheda.barcode && scheda.barcode.show">
|
||||
<CBarCode
|
||||
:value="myproduct.productInfo.code"
|
||||
:format="scheda.barcode.format"
|
||||
:fontsize="
|
||||
scheda.barcode.font?.size
|
||||
"
|
||||
:gap="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.gap)
|
||||
"
|
||||
:width="
|
||||
parseInt(
|
||||
tools.adjustSize(
|
||||
optcatalogo,
|
||||
scheda.barcode.size?.width
|
||||
)
|
||||
)
|
||||
"
|
||||
:widthlines="tools.adjustSize(optcatalogo, scheda.barcode.widthlines)"
|
||||
:height="
|
||||
tools.adjustSize(optcatalogo, scheda.barcode.size?.height)
|
||||
"
|
||||
:show_at_right="scheda.barcode.show_at_right"
|
||||
>
|
||||
</CBarCode>
|
||||
</div>
|
||||
@@ -219,8 +296,9 @@
|
||||
></q-img>
|
||||
</div>
|
||||
</div>
|
||||
</CText>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="optcatalogo.indebug"
|
||||
:style="{
|
||||
@@ -235,20 +313,15 @@
|
||||
v-html="getTesto_Debug"
|
||||
></div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="scheda.testo_bottom && scheda.testo_bottom.contenuto"
|
||||
:style="{
|
||||
width: '100%',
|
||||
}"
|
||||
>
|
||||
<div
|
||||
:style="{
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': scheda.testo_bottom.font?.line_height,
|
||||
}"
|
||||
v-html="getTesto_Bottom"
|
||||
></div>
|
||||
</div>
|
||||
<!-- Testo sotto al testo attaccato, allineato al fondo -->
|
||||
<CText
|
||||
v-else-if="scheda.testo_bottom && getTesto_Bottom"
|
||||
:rectext="scheda.testo_bottom"
|
||||
:scheda="scheda"
|
||||
:myproduct="myproduct"
|
||||
:optcatalogo="optcatalogo"
|
||||
></CText>
|
||||
<div v-if="optcatalogo.indebug">testo: "{{ getTesto_Bottom }}"</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator v-if="complete" class="q-my-sm"></q-separator>
|
||||
@@ -674,7 +747,10 @@
|
||||
:type="costanti.FieldType.number"
|
||||
>
|
||||
</CMyValueDb>
|
||||
<CLabel :value="myproduct.indiceRanking" label="N° in Classifica:" />
|
||||
<CLabel
|
||||
:value="myproduct.indiceRanking"
|
||||
label="N° in Classifica:"
|
||||
/>
|
||||
|
||||
<div class="etichetta">3 Mesi:</div>
|
||||
<CMyValueDb
|
||||
|
||||
0
src/components/CDownloadJsonFile/CDownloadJsonFile.scss
Executable file
0
src/components/CDownloadJsonFile/CDownloadJsonFile.scss
Executable file
55
src/components/CDownloadJsonFile/CDownloadJsonFile.ts
Executable file
55
src/components/CDownloadJsonFile/CDownloadJsonFile.ts
Executable file
@@ -0,0 +1,55 @@
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CDownloadJsonFile',
|
||||
props: {
|
||||
testoJson: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
nomefile: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
setup(props) {
|
||||
const $q = useQuasar()
|
||||
|
||||
const downloadJsonFile = () => {
|
||||
// Crea un blob dalla jsonString passata come proprietà
|
||||
const blob = new Blob([props.testoJson], { type: 'application/json' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
// Crea un link temporaneo
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
const fileName = `${props.nomefile}-${tools.getDateYYYYMMDD_Today()}.json`;
|
||||
link.download = fileName; // Nome del file da scaricare
|
||||
|
||||
// Aggiungi il link al DOM e clicca per scaricare
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// Rimuovi il link dal DOM e libera l'oggetto URL
|
||||
document.body.removeChild(link);
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
return {
|
||||
tools,
|
||||
downloadJsonFile,
|
||||
}
|
||||
},
|
||||
})
|
||||
13
src/components/CDownloadJsonFile/CDownloadJsonFile.vue
Executable file
13
src/components/CDownloadJsonFile/CDownloadJsonFile.vue
Executable file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="testoJson">
|
||||
<button @click="downloadJsonFile">{{ title }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CDownloadJsonFile.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CDownloadJsonFile.scss';
|
||||
</style>
|
||||
1
src/components/CDownloadJsonFile/index.ts
Executable file
1
src/components/CDownloadJsonFile/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CDownloadJsonFile} from './CDownloadJsonFile.vue'
|
||||
0
src/components/CExportPage/CExportPage.scss
Executable file
0
src/components/CExportPage/CExportPage.scss
Executable file
91
src/components/CExportPage/CExportPage.ts
Executable file
91
src/components/CExportPage/CExportPage.ts
Executable file
@@ -0,0 +1,91 @@
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { CDownloadJsonFile } from '@/components/CDownloadJsonFile'
|
||||
import { PropType, defineComponent, onMounted, ref } from 'vue'
|
||||
import { IMyPage } from '@src/model'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CExportPage',
|
||||
props: {
|
||||
idPage: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
nomefile: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
components: {CDownloadJsonFile},
|
||||
setup(props) {
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const myrec = ref(<IMyPage | undefined>{})
|
||||
|
||||
const nomefile = ref(<string>'')
|
||||
const testoJson = ref(<any>'')
|
||||
let fileContent = ref('')
|
||||
|
||||
const ris = ref('')
|
||||
|
||||
const onFileChange = (event: any) => {
|
||||
const file = event.target.files[0];
|
||||
if (file && file.type === "application/json") {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e: any) => {
|
||||
fileContent.value = e.target.result; // Carica il contenuto del file JSON
|
||||
};
|
||||
reader.readAsText(file);
|
||||
} else {
|
||||
tools.showNotif($q, 'Seleziona un file JSON valido.', { color: 'negative', icon: 'notifications' })
|
||||
}
|
||||
}
|
||||
|
||||
const importaPagina = async () => {
|
||||
try {
|
||||
if (!fileContent.value) {
|
||||
tools.showNotif($q, 'Nessun file JSON caricato.', { color: 'negative', icon: 'notifications' })
|
||||
return
|
||||
}
|
||||
|
||||
// Chiama la funzione di importazione passandole il contenuto del file
|
||||
ris.value = await globalStore.importPage(fileContent.value, $q, t);
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
async function esportaPagina() {
|
||||
|
||||
if (myrec.value) {
|
||||
testoJson.value = await globalStore.exportPage(myrec.value.path!, $q, t)
|
||||
}
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
nomefile.value = props.nomefile
|
||||
|
||||
myrec.value = globalStore.getPageById(props.idPage)
|
||||
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
myrec,
|
||||
tools,
|
||||
testoJson,
|
||||
esportaPagina,
|
||||
importaPagina,
|
||||
nomefile,
|
||||
onFileChange,
|
||||
ris,
|
||||
}
|
||||
},
|
||||
})
|
||||
51
src/components/CExportPage/CExportPage.vue
Executable file
51
src/components/CExportPage/CExportPage.vue
Executable file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div v-if="myrec && myrec.path" style="width: 800px;" class="">
|
||||
<h2>Pagina '{{ myrec.path }}'</h2>
|
||||
<br />
|
||||
|
||||
<div class="column">
|
||||
Esporta:
|
||||
<q-input
|
||||
outlined
|
||||
autofocus
|
||||
v-model="nomefile"
|
||||
label="Nome File"
|
||||
></q-input>
|
||||
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="Esporta Pagina"
|
||||
@click="esportaPagina"
|
||||
></q-btn>
|
||||
<CDownloadJsonFile
|
||||
v-if="testoJson"
|
||||
:testoJson="testoJson"
|
||||
:title="`Scarica file ${nomefile}`"
|
||||
:nomefile="nomefile"
|
||||
>
|
||||
</CDownloadJsonFile>
|
||||
</div>
|
||||
<div class="column">
|
||||
Importa file JSON:
|
||||
<input
|
||||
type="file"
|
||||
@change="onFileChange"
|
||||
outlined
|
||||
></input>
|
||||
fileContent: {{fileContent}}
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="Importa file"
|
||||
@click="importaPagina"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div class="row">Risultato:<br>
|
||||
{{ ris }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CExportPage.ts"></script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CExportPage.scss';
|
||||
</style>
|
||||
1
src/components/CExportPage/index.ts
Executable file
1
src/components/CExportPage/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CExportPage} from './CExportPage.vue'
|
||||
@@ -49,7 +49,7 @@ export default defineComponent({
|
||||
CSelectColor, CSelectFontSize, CSelectImage, CImgPoster, CSelectAnimation, CMySlider,
|
||||
CMySize, CBorders, CMyDimensioni, CMyText,
|
||||
},
|
||||
emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage'],
|
||||
emits: ['saveElem', 'selElemClick', 'toggleSize', 'deleteElem', 'dupPage', 'expPage'],
|
||||
props: {
|
||||
myelem: {
|
||||
type: Object as PropType<IMyElem>,
|
||||
@@ -60,7 +60,7 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
IdPath: {
|
||||
idPage: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
@@ -142,7 +142,7 @@ export default defineComponent({
|
||||
let neword = 0
|
||||
if (myelem) {
|
||||
neword = myelem.order!
|
||||
const recfound = globalStore.getMyElemNextThisElemId(props.path, myelem._id!)
|
||||
const recfound = globalStore.getMyElemNextThisElemId(props.idPage, myelem._id!)
|
||||
|
||||
if (recfound) {
|
||||
neword = Math.round((recfound.order! + myelem.order!) / 2)
|
||||
@@ -161,10 +161,10 @@ export default defineComponent({
|
||||
|
||||
if (direz === -1) { // Sopra
|
||||
// ottieni l'elemento precedente, mantenendo l'ordinamento
|
||||
recfound = globalStore.getMyElemPrecThisElemId(props.path, elemsel._id)
|
||||
recfound = globalStore.getMyElemPrecThisElemId(props.idPage, elemsel._id)
|
||||
} else if (direz === 1) { // Sotto
|
||||
// ottieni l'elemento precedente, mantenendo l'ordinamento
|
||||
recfound = globalStore.getMyElemNextThisElemId(props.path, elemsel._id)
|
||||
recfound = globalStore.getMyElemNextThisElemId(props.idPage, elemsel._id)
|
||||
}
|
||||
|
||||
if (recfound) {
|
||||
@@ -182,6 +182,9 @@ export default defineComponent({
|
||||
async function dupPage() {
|
||||
emit('dupPage', null)
|
||||
}
|
||||
async function exportPage() {
|
||||
emit('expPage', null)
|
||||
}
|
||||
async function dupElem(order?: number) {
|
||||
|
||||
const newrec: IMyElem = tools.jsonCopy(props.myelem)
|
||||
@@ -246,7 +249,7 @@ export default defineComponent({
|
||||
// @ts-ignore
|
||||
label: page.title,
|
||||
// @ts-ignore
|
||||
value: page.path
|
||||
value: page.idPage
|
||||
}
|
||||
arrPages.value.push(rec)
|
||||
}
|
||||
@@ -261,15 +264,10 @@ export default defineComponent({
|
||||
if (myel.value.catalogo && myel.value.catalogo?.arrSchede) {
|
||||
for (const recscheda of myel.value.catalogo?.arrSchede) {
|
||||
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: '' } }
|
||||
}
|
||||
recscheda.scheda.testo_right_attaccato = tools.resetIText(recscheda.scheda?.testo_right_attaccato!)
|
||||
recscheda.scheda.testo_right = tools.resetIText(recscheda.scheda?.testo_right!)
|
||||
recscheda.scheda.testo_bottom = tools.resetIText(recscheda.scheda?.testo_bottom!)
|
||||
|
||||
if ((!recscheda.scheda?.dimensioni.pagina)) {
|
||||
recscheda.scheda.dimensioni.pagina = tools.resetRecIPagina(recscheda.scheda?.dimensioni.pagina)
|
||||
}
|
||||
@@ -459,6 +457,12 @@ export default defineComponent({
|
||||
dimensioni,
|
||||
numschede_perRiga: 2,
|
||||
numschede_perCol: 2,
|
||||
testo_right_attaccato: {
|
||||
contenuto: '',
|
||||
font: {
|
||||
posiz_text: costanti.POSIZ_TESTO.A_DESTRA,
|
||||
},
|
||||
},
|
||||
testo_right: {
|
||||
contenuto: '',
|
||||
font: {
|
||||
@@ -827,8 +831,11 @@ export default defineComponent({
|
||||
async function moveElem(direz: any) {
|
||||
let myelem = props.myelem
|
||||
|
||||
const elemprec = globalStore.getMyElemPrecThisElemId(props.path, myelem._id!)
|
||||
const elemnext = globalStore.getMyElemNextThisElemId(props.path, myelem._id!)
|
||||
const elemprec = globalStore.getMyElemPrecThisElemId(props.idPage, myelem._id!)
|
||||
const elemnext = globalStore.getMyElemNextThisElemId(props.idPage, myelem._id!)
|
||||
|
||||
if (!elemprec || !elemnext)
|
||||
return false
|
||||
|
||||
let neworder = 0
|
||||
let oldorder = myelem.order!
|
||||
@@ -839,7 +846,7 @@ export default defineComponent({
|
||||
elemprec.order = oldorder
|
||||
|
||||
if (oldorder === elemprec.order!) {
|
||||
const elemprec2 = globalStore.getMyElemPrecThisElemId(props.path, elemprec._id!)
|
||||
const elemprec2 = globalStore.getMyElemPrecThisElemId(props.idPage, elemprec._id!)
|
||||
|
||||
neworder = (elemprec2.order! + elemprec.order) / 2
|
||||
elemprec.order = Math.round((oldorder + neworder) / 2)
|
||||
@@ -853,7 +860,7 @@ export default defineComponent({
|
||||
elemnext.order = oldorder
|
||||
|
||||
if (oldorder === elemnext.order!) {
|
||||
const elemnext2 = globalStore.getMyElemNextThisElemId(props.path, elemnext._id!)
|
||||
const elemnext2 = globalStore.getMyElemNextThisElemId(props.idPage, elemnext._id!)
|
||||
|
||||
neworder = (elemnext2.order! + elemnext.order) / 2
|
||||
elemnext.order = Math.round((oldorder + neworder) / 2)
|
||||
@@ -1082,6 +1089,7 @@ export default defineComponent({
|
||||
idSchedaDaCopiare,
|
||||
copyfromTemplate,
|
||||
modifElemAndSchede,
|
||||
exportPage,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -44,24 +44,33 @@
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-bar v-if="enableEdit" class="q-pa-md bg-light-blue text-white">
|
||||
<!--<q-toggle v-if="tools.isManager()"
|
||||
v-model="enableAdd"
|
||||
icon="fas fa-plus"
|
||||
</q-toggle>
|
||||
>-->
|
||||
|
||||
<q-bar v-if="enableEdit" class="q-pa-md bg-orange text-white">
|
||||
Pagina:
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="far fa-copy"
|
||||
label="Duplica Pagina"
|
||||
label="Duplica"
|
||||
dense
|
||||
size="sm"
|
||||
color="fuchsia"
|
||||
color="primary"
|
||||
@click="dupPage()"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
icon="fas fa-expand-alt"
|
||||
label="Esporta"
|
||||
dense
|
||||
size="sm"
|
||||
color="primary"
|
||||
@click="exportPage()"
|
||||
>
|
||||
</q-btn>
|
||||
</q-bar>
|
||||
<q-bar v-if="enableEdit" class="q-pa-md bg-light-blue text-white">
|
||||
Elemento:
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="fas fa-trash-alt"
|
||||
color="negative"
|
||||
@@ -484,7 +493,7 @@
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:nosaveToDb="true"
|
||||
:path="myel.path"
|
||||
:path="path"
|
||||
:fieldtype="costanti.FieldType.imgcard"
|
||||
@save="saveCard"
|
||||
>
|
||||
@@ -922,7 +931,7 @@
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
:canModify="true"
|
||||
:path="myel.path"
|
||||
:path="path"
|
||||
:fieldtype="costanti.FieldType.image"
|
||||
>
|
||||
</CMyFieldRec>
|
||||
@@ -945,6 +954,7 @@
|
||||
table="myelems"
|
||||
:id="myel._id"
|
||||
:rec="myel"
|
||||
:path="path"
|
||||
field="image"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
@@ -1144,6 +1154,7 @@
|
||||
table="myelems"
|
||||
:id="myel._id"
|
||||
:rec="myel"
|
||||
:path="path"
|
||||
field="list"
|
||||
@update:model-value="modifElem"
|
||||
:canEdit="true"
|
||||
@@ -1850,6 +1861,14 @@
|
||||
:disabled="recscheda.scheda.linkIdTemplate"
|
||||
icon="fas fa-play-circle"
|
||||
>
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.testo_right_attaccato"
|
||||
@modifElem="modifElem"
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo a Destra attaccato"
|
||||
>
|
||||
</CMyText>
|
||||
<CMyText
|
||||
v-model="recscheda.scheda.testo_right"
|
||||
@modifElem="modifElem"
|
||||
@@ -1865,6 +1884,7 @@
|
||||
@saveFieldElem="saveFieldElem"
|
||||
@update:model-value="modifElem"
|
||||
label="Testo in Basso"
|
||||
:show_dimensioni="true"
|
||||
>
|
||||
</CMyText>
|
||||
</q-expansion-item>
|
||||
@@ -1907,6 +1927,14 @@
|
||||
color="green"
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
<q-toggle
|
||||
v-model="recscheda.scheda.barcode.show_at_right"
|
||||
color="positive"
|
||||
label="Mostra a Destra"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
|
||||
<CMySlider
|
||||
label="Font Size:"
|
||||
v-model="recscheda.scheda.barcode.font.size"
|
||||
@@ -1922,6 +1950,7 @@
|
||||
v-model="recscheda.scheda.barcode.size"
|
||||
@update:model-value="modifElem"
|
||||
:addstr="false"
|
||||
:gap="true"
|
||||
></CMySize>
|
||||
</q-expansion-item>
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
:class="
|
||||
tools.getClassAnim(myel.anim2) + ` ` + myel.class4
|
||||
"
|
||||
:src="tools.getImgFileByElem(myel, rec)"
|
||||
:src="tools.getImgFileByElem(myel, rec, path)"
|
||||
/>
|
||||
</div>
|
||||
<q-card-section class="q-card-section-small">
|
||||
@@ -197,7 +197,7 @@
|
||||
>
|
||||
<CImgTitle
|
||||
v-if="myel.image"
|
||||
:src="tools.getImgFileByElem(myel)"
|
||||
:src="tools.getImgFileByElem(myel, undefined, path)"
|
||||
:title="myel.container"
|
||||
:legendinside="myel.container2"
|
||||
>
|
||||
@@ -212,7 +212,7 @@
|
||||
>
|
||||
<CImgPoster
|
||||
v-if="myel.image"
|
||||
:src="tools.getImgFileByElem(myel)"
|
||||
:src="tools.getImgFileByElem(myel, undefined, path)"
|
||||
:title="myel.container"
|
||||
:myheight="myel.heightimg"
|
||||
:vertalign="myel.vertalign"
|
||||
@@ -248,7 +248,7 @@
|
||||
:read="myel.parambool"
|
||||
:link="myel.container"
|
||||
:textlink="myel.container2"
|
||||
:imglogo="tools.getImgFileByElem(myel)"
|
||||
:imglogo="tools.getImgFileByElem(myel, undefined, path)"
|
||||
></CQRCode>
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.IMAGE">
|
||||
@@ -264,7 +264,7 @@
|
||||
@click="clickOnElem"
|
||||
>
|
||||
<q-img
|
||||
:src="tools.getImgFileByElem(myel)"
|
||||
:src="tools.getImgFileByElem(myel, undefined, path)"
|
||||
:fit="myel.fit"
|
||||
class="img"
|
||||
:width="myel.widthimg ? myel.widthimg : undefined"
|
||||
@@ -287,7 +287,7 @@
|
||||
@click="clickOnElem"
|
||||
>
|
||||
<q-img
|
||||
:src="tools.getImgFileByElem(myel)"
|
||||
:src="tools.getImgFileByElem(myel, undefined, path)"
|
||||
:fit="myel.fit"
|
||||
class="img"
|
||||
:width="myel.widthimg ? myel.widthimg : undefined"
|
||||
|
||||
@@ -10,6 +10,7 @@ import { CMyElem } from '@/components/CMyElem'
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CMyEditElem } from '@/components/CMyEditElem'
|
||||
import { CMyPageElem2 } from '@/components/CMyPageElem2'
|
||||
import { CExportPage } from '@/components/CExportPage'
|
||||
|
||||
import { CImgTitle } from '../CImgTitle/index'
|
||||
import { CTitle } from '../CTitle/index'
|
||||
@@ -24,7 +25,7 @@ export default defineComponent({
|
||||
name: 'CMyPageElem',
|
||||
components: {
|
||||
LandingFooter, CImgTitle, CTitle, CMyElem,
|
||||
CMyEditElem, CMyPageElem2, CTitleBanner,
|
||||
CMyEditElem, CMyPageElem2, CTitleBanner, CExportPage,
|
||||
},
|
||||
props: {
|
||||
title: String,
|
||||
@@ -32,7 +33,7 @@ export default defineComponent({
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
myidPage: {
|
||||
idPage: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
@@ -77,6 +78,8 @@ export default defineComponent({
|
||||
|
||||
const mywidthEditor = ref(400)
|
||||
|
||||
const showexportPage = ref(false)
|
||||
|
||||
const editOn = computed({
|
||||
get(): boolean {
|
||||
return !!globalStore.editOn ? globalStore.editOn : false
|
||||
@@ -195,6 +198,7 @@ export default defineComponent({
|
||||
onloading,
|
||||
deleteElem,
|
||||
duplicatePage,
|
||||
showexportPage,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -46,11 +46,12 @@
|
||||
:myelem="selElem"
|
||||
:editOn="true"
|
||||
:path="rec.path"
|
||||
:IdPath="rec._id"
|
||||
:idPage="rec._id"
|
||||
@selElemClick="selElemClick"
|
||||
@deleteElem="deleteElem"
|
||||
@toggleSize="toggleSize"
|
||||
@dupPage="duplicatePage"
|
||||
@expPage="showexportPage = !showexportPage"
|
||||
>
|
||||
</CMyEditElem>
|
||||
</q-drawer>
|
||||
@@ -165,6 +166,22 @@
|
||||
<div v-if="!nofooter"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-dialog v-model="showexportPage">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
Esporta Pagina
|
||||
</q-toolbar-title>
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
<br>
|
||||
<CExportPage :idPage="selElem.idPage" :nomefile="`esporta_${rec.path}.json`"> </CExportPage>
|
||||
<br>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"
|
||||
></q-btn>
|
||||
</q-bar>
|
||||
<CMyEditElem :myelem="selElem" :editOn="editOn" :path="rec.path">
|
||||
<CMyEditElem :myelem="selElem" :editOn="editOn" :path="rec.path" :idPage="rec._id">
|
||||
</CMyEditElem>
|
||||
</q-drawer>
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { tools } from '@store/Modules/tools'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
import { CMySize } from '@src/components/CMySize'
|
||||
import { CMySlider } from '@src/components/CMySlider'
|
||||
import { CMyFieldRec } from '@src/components/CMyFieldRec'
|
||||
|
||||
@@ -16,7 +17,7 @@ import { shared_consts } from '@/common/shared_vuejs'
|
||||
export default defineComponent({
|
||||
name: 'CMyText',
|
||||
emits: ['update:modelValue', 'modifElem', 'saveFieldElem',],
|
||||
components: { CMySlider, CMyFieldRec },
|
||||
components: { CMySlider, CMyFieldRec, CMySize },
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Object as PropType<IText>,
|
||||
@@ -36,6 +37,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
show_dimensioni: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
>
|
||||
</q-select>
|
||||
<CMySlider
|
||||
label="Margine tra l'immagine"
|
||||
label="Margine % tra l'immagine"
|
||||
v-model="internalModel.font.perc_text"
|
||||
:min="0"
|
||||
:max="100"
|
||||
@@ -45,7 +45,7 @@
|
||||
></CMySlider>
|
||||
<CMySlider
|
||||
v-if="show_maxlength"
|
||||
label="Lunghezza Massima:"
|
||||
label="Max numero di caratteri:"
|
||||
v-model="internalModel.maxlength"
|
||||
:min="0"
|
||||
:max="1000"
|
||||
@@ -53,10 +53,16 @@
|
||||
addstr=""
|
||||
@update:model-value="modifElem"
|
||||
></CMySlider>
|
||||
<CMySize
|
||||
v-if="show_dimensioni"
|
||||
label="Dimensioni:"
|
||||
v-model="internalModel.size"
|
||||
@update:model-value="modifElem"
|
||||
></CMySize>
|
||||
|
||||
<div>
|
||||
Parole Chiave: {autore} {titolo} {descrizione} {date_pub} {ranking}
|
||||
{sottotitolo} {prezzo} {descrizione_estesa}
|
||||
{sottotitolo} {prezzo} {prezzo_scontato} {descrizione_estesa}
|
||||
</div>
|
||||
|
||||
<q-select
|
||||
|
||||
0
src/components/CText/CText.scss
Executable file
0
src/components/CText/CText.scss
Executable file
61
src/components/CText/CText.ts
Executable file
61
src/components/CText/CText.ts
Executable file
@@ -0,0 +1,61 @@
|
||||
import {
|
||||
PropType,
|
||||
computed,
|
||||
defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch,
|
||||
} from 'vue'
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { ICatalogo, IMyScheda, IProduct, ISchedaSingola, IText } from '@src/model'
|
||||
|
||||
import { useProducts } from '@store/Products'
|
||||
import { useGlobalStore } from '@src/store/globalStore'
|
||||
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CText',
|
||||
props: {
|
||||
rectext: {
|
||||
type: Object as PropType<IText>,
|
||||
required: true,
|
||||
},
|
||||
myproduct: {
|
||||
type: Object as PropType<IProduct>,
|
||||
required: true,
|
||||
},
|
||||
optcatalogo: {
|
||||
type: Object as PropType<ICatalogo>,
|
||||
required: true,
|
||||
},
|
||||
scheda: {
|
||||
type: Object as PropType<IMyScheda>,
|
||||
required: true,
|
||||
},
|
||||
show_at_right: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
const products = useProducts()
|
||||
|
||||
const getTesto = computed(() => {
|
||||
return products.replaceKeyWordsByProduct(
|
||||
props.optcatalogo,
|
||||
props.myproduct,
|
||||
props.rectext,
|
||||
)
|
||||
})
|
||||
|
||||
return {
|
||||
tools,
|
||||
getTesto,
|
||||
globalStore,
|
||||
costanti,
|
||||
}
|
||||
},
|
||||
})
|
||||
44
src/components/CText/CText.vue
Executable file
44
src/components/CText/CText.vue
Executable file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<!-- A DESTRA -->
|
||||
<span
|
||||
v-if="
|
||||
getTesto && rectext.font?.posiz_text === costanti.POSIZ_TESTO.A_DESTRA
|
||||
"
|
||||
:class="'flex flex-col justify-between'"
|
||||
:style="{
|
||||
width: rectext.font?.perc_text ?? '50%',
|
||||
...( rectext.size && rectext.size.height ? { height: tools.adjustSize(optcatalogo, rectext.size.height) } : {}),
|
||||
marginTop: '0',
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': rectext.font?.line_height,
|
||||
}"
|
||||
>
|
||||
<div v-html="getTesto"></div>
|
||||
<slot></slot>
|
||||
</span>
|
||||
|
||||
<!-- IN BASSO -->
|
||||
<span
|
||||
v-else-if="
|
||||
getTesto && rectext.font?.posiz_text === costanti.POSIZ_TESTO.IN_BASSO
|
||||
"
|
||||
:class="{ 'flex-details_and_barcode' : show_at_right }"
|
||||
:style="{
|
||||
width: rectext.font?.perc_text ?? '50%',
|
||||
...( rectext.size && rectext.size.height ? { height: tools.adjustSize(optcatalogo, rectext.size.height) } : {}),
|
||||
marginTop: '0rem',
|
||||
'--scalecatalog': tools.getScale(optcatalogo),
|
||||
'line-height': rectext.font?.line_height,
|
||||
'gap': show_at_right && scheda.barcode.size?.gap ? tools.adjustSize(optcatalogo, scheda.barcode.size?.gap) : ''
|
||||
}"
|
||||
>
|
||||
<div v-html="getTesto"></div>
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CText.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './CText.scss';
|
||||
</style>
|
||||
1
src/components/CText/index.ts
Executable file
1
src/components/CText/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CText } from './CText.vue'
|
||||
@@ -28,13 +28,27 @@
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DIN-Pro-Condensed-Bold-Italic';
|
||||
src: url('~src/assets/fonts/DIN-Pro-Condensed-Bold-Italic.otf') format('opentype');
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DIN-Pro-Condensed-Regular';
|
||||
src: url('~src/assets/fonts/DINPro-CondensedBold.otf') format('opentype');
|
||||
src: url('~src/assets/fonts/DIN-Pro-Condensed-Regular.otf') format('opentype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DIN-Pro-Condensed-Medium-Italic';
|
||||
src: url('~src/assets/fonts/DIN-Pro-Condensed-Medium-Italic.otf') format('opentype');
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DINPro';
|
||||
src: url('~src/assets/fonts/DINPro.otf') format('opentype');
|
||||
@@ -42,6 +56,13 @@
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'DINPro-Medium';
|
||||
src: url('~src/assets/fonts/DINPro-Medium.otf') format('opentype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
|
||||
@@ -696,6 +696,7 @@ export interface IFont {
|
||||
line_height?: number
|
||||
posiz_text?: number
|
||||
perc_text?: string
|
||||
height?: string
|
||||
}
|
||||
|
||||
export interface IBorder {
|
||||
@@ -731,6 +732,7 @@ export interface IBarCode {
|
||||
size?: ISize
|
||||
font?: IFont
|
||||
widthlines?: number
|
||||
show_at_right?: boolean
|
||||
}
|
||||
|
||||
export interface IPagina {
|
||||
@@ -766,6 +768,7 @@ export interface IText {
|
||||
contenuto?: string
|
||||
maxlength?: number
|
||||
font?: IFont
|
||||
size?: ISize
|
||||
}
|
||||
|
||||
export interface IElementiScheda {
|
||||
@@ -784,6 +787,7 @@ export interface IMyScheda {
|
||||
numschede_perRiga?: number
|
||||
numschede_perCol?: number
|
||||
show_separatore: boolean
|
||||
testo_right_attaccato?: IText
|
||||
testo_right?: IText
|
||||
testo_bottom?: IText
|
||||
barcode?: IBarCode,
|
||||
|
||||
@@ -579,6 +579,7 @@ export default defineComponent({
|
||||
|
||||
function eseguiCmd() {
|
||||
risultato.value = ''
|
||||
|
||||
userStore.importToServerCmd($q, t, cosafare.value, null)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<CTitleBanner title="Pagine"></CTitleBanner>
|
||||
<CGridTableRec
|
||||
prop_mytable="mypage"
|
||||
prop_mytable="mypages"
|
||||
prop_mytitle="Lista Pagine"
|
||||
:prop_mycolumns="colmypage"
|
||||
prop_colkey="title"
|
||||
|
||||
@@ -1211,6 +1211,7 @@ const msg_it = {
|
||||
mypages: {
|
||||
duplica_newname: 'Inserisci il nome della Nuova Pagina (senza spazi)',
|
||||
duplica_conferma: 'Duplicare {path} creando {newpath}',
|
||||
esporta_conferma: 'Esportare la pagina {path} su {nomefile} ?',
|
||||
attivita: 'Attività',
|
||||
find_people: 'Cerca Persone',
|
||||
find_group: 'Cerca Gruppo',
|
||||
@@ -1240,6 +1241,10 @@ const msg_it = {
|
||||
follow_circuits: 'I tuoi Circuiti RIS',
|
||||
duplicateok: 'Pagina Duplicata con successo',
|
||||
duplicateerr: 'Errore nel duplicare la pagina',
|
||||
expok: 'Pagina Esportata con successo',
|
||||
experr: 'Errore nell\'esportare la pagina',
|
||||
impok: 'Dati Importati con successo',
|
||||
imperr: 'Errore nell\'importare la pagina',
|
||||
},
|
||||
friends: {
|
||||
accept_trust: 'Accetta',
|
||||
|
||||
@@ -163,6 +163,7 @@ export const colIText = [
|
||||
AddCol({ name: 'maxlength', label_trans: 'catalogo.maxlength', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'posiz_text', label_trans: 'catalogo.posiz_text', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'perc_text', label_trans: 'catalogo.perc_text', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'margintop', label_trans: 'catalogo.margintop', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'line_height', label_trans: 'catalogo.line_height', fieldtype: costanti.FieldType.number }),
|
||||
]
|
||||
export const colmyIImg = [
|
||||
|
||||
@@ -3527,6 +3527,13 @@ export const tools = {
|
||||
return mydate
|
||||
},
|
||||
|
||||
getDateYYYYMMDD_Today() {
|
||||
// Ottieni la data attuale nel formato YYYY-MM-DD
|
||||
const today = new Date();
|
||||
const formattedDate = today.toISOString().split('T')[0]; // Format YYYY-MM-DD
|
||||
return formattedDate
|
||||
},
|
||||
|
||||
isDateArrived(mydate: Date | number | string | undefined) {
|
||||
const datenow = this.getDateNow()
|
||||
const diff = date.getDateDiff(datenow, mydate)
|
||||
@@ -8012,9 +8019,9 @@ export const tools = {
|
||||
} else if (!!myrow && !!myrow.directory) {
|
||||
ris = myrow.directory
|
||||
} else if (table === 'myelems') {
|
||||
ris = 'pages/' + myrow.path
|
||||
ris = 'pages/' + (path ? path : myrow.path)
|
||||
} else if (table === 'listcards') {
|
||||
ris = 'pages/' + myrow.path
|
||||
ris = 'pages/' + (path ? path : myrow.path)
|
||||
} else if (table === 'imgcards') {
|
||||
ris = 'pages/' + path
|
||||
} else if (table === 'productInfos') {
|
||||
@@ -8024,10 +8031,11 @@ export const tools = {
|
||||
} else {
|
||||
ris = table
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('err getDirectoryGall', e)
|
||||
}
|
||||
// console.log('getDirectoryGall', ris)
|
||||
console.log('getDirectoryGall', ris, 'mypath', path, 'myrow', myrow)
|
||||
return ris
|
||||
},
|
||||
|
||||
@@ -8035,7 +8043,7 @@ export const tools = {
|
||||
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + filename
|
||||
},
|
||||
|
||||
getImgFileByElem(elem: IMyElem, reccard?: IMyCard) {
|
||||
getImgFileByElem(elem: IMyElem, reccard?: IMyCard, path?: string) {
|
||||
if (elem) {
|
||||
|
||||
let addtourl = ''
|
||||
@@ -8043,21 +8051,23 @@ export const tools = {
|
||||
addtourl = '?v=' + elem.vers_img
|
||||
}
|
||||
|
||||
const mypath = (path ? path : elem.path)
|
||||
|
||||
if (elem.type === shared_consts.ELEMTYPE.CARD) {
|
||||
if (reccard?.imagefile) {
|
||||
if (reccard.vers_img) {
|
||||
addtourl = '?v=' + reccard.vers_img
|
||||
}
|
||||
|
||||
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + reccard.imagefile + addtourl
|
||||
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + reccard.imagefile + addtourl
|
||||
} else
|
||||
return ''
|
||||
} else if (elem.type === shared_consts.ELEMTYPE.IMAGE) {
|
||||
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + elem.container + addtourl
|
||||
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + elem.container + addtourl
|
||||
} else if (elem.type === shared_consts.ELEMTYPE.QRCODE) {
|
||||
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + elem.image + addtourl
|
||||
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + elem.image + addtourl
|
||||
} else {
|
||||
return costanti.DIR_UPLOAD + 'pages/' + elem.path + '/' + elem.image + addtourl
|
||||
return costanti.DIR_UPLOAD + 'pages/' + mypath + '/' + elem.image + addtourl
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -9300,6 +9310,9 @@ export const tools = {
|
||||
size: '14px',
|
||||
}
|
||||
}
|
||||
if (!rec.size) {
|
||||
rec.size = this.resetISize(rec.size!)
|
||||
}
|
||||
|
||||
return rec
|
||||
},
|
||||
|
||||
@@ -1283,7 +1283,8 @@ export const useProducts = defineStore('Products', {
|
||||
const ranking = myproduct.indiceRanking! || 0;
|
||||
const venduti = myproduct.productInfo.totaleVenduti! || 0;
|
||||
|
||||
const debugstr = " Rank=" + ranking + "<br> 1Y=" + (myproduct.productInfo.rank1Y! || '') + '<br> Venduti=' + venduti + '<br> Data Pubb=' + date_pub
|
||||
const linkvenduti = '<a href="http://vps-88271abb.vps.ovh.net/apimacro/public/view-ordini-by-idarticolo/' + myproduct.productInfo.sku + '" target="_blank">'+venduti+'</a>'
|
||||
const debugstr = " Rank=" + ranking + "<br> 1Y=" + (myproduct.productInfo.rank1Y! || '') + '<br> Venduti=' + linkvenduti + '<br> Data Pubb=' + date_pub
|
||||
|
||||
const truncatedDescription = description.length > maxDescriptionLength
|
||||
? description.substring(0, description.lastIndexOf(' ', maxDescriptionLength)) + '...'
|
||||
@@ -1355,7 +1356,7 @@ export const useProducts = defineStore('Products', {
|
||||
result = result.replace(new RegExp(key, 'g'), value);
|
||||
}
|
||||
|
||||
return result
|
||||
return result.trim()
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -1926,6 +1926,10 @@ export const useUserStore = defineStore('UserStore', {
|
||||
},
|
||||
|
||||
async importToServerCmd($q: any, t: any, cmd: number, data: any, recorddaimportare: boolean = false) {
|
||||
$q.loading.show({
|
||||
message: 'Importazione in corso, attendere ...'
|
||||
})
|
||||
|
||||
return Api.SendReq('/admin/import', 'POST', { cmd, data })
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
@@ -1953,7 +1957,9 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
|
||||
}
|
||||
$q.loading.hide()
|
||||
}).catch((error) => {
|
||||
$q.loading.hide()
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
return {}
|
||||
})
|
||||
|
||||
@@ -272,7 +272,17 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
getPage: (state: IGlobalState) => (path: string): IMyPage | undefined => state.mypage.find((page) => (`/${page.path}`) === path),
|
||||
getPageById: (state: IGlobalState) => (idpage: string): IMyPage | undefined => state.mypage.find((page) => (`/${page._id}`) === idpage),
|
||||
getPageById: (state: IGlobalState) => (idpage: string): IMyPage | undefined => {
|
||||
const mypage = state.mypage.find((page) => (`${page._id}`) === idpage)
|
||||
return mypage
|
||||
},
|
||||
getPathByIdPage: (state: IGlobalState) => (idpage: string): string => {
|
||||
const mypage = state.mypage.find((page) => (`${page._id}`) === idpage)
|
||||
if (mypage) {
|
||||
return mypage.path!
|
||||
}
|
||||
return ''
|
||||
},
|
||||
|
||||
getMyElemsByIdPage: (state: IGlobalState) => (idPage?: string): IMyElem[] | [] => {
|
||||
return state.myelems.filter((page: IMyElem) => (page._id === idPage)).sort((a: any, b: any) => a.order - b.order)
|
||||
@@ -1203,6 +1213,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
let newpath = prompt(t('mypages.duplica_newname'))
|
||||
|
||||
if (!newpath)
|
||||
return false
|
||||
|
||||
$q.dialog({
|
||||
message: t('mypages.duplica_conferma', { path, newpath }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
@@ -1230,6 +1243,46 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
},
|
||||
|
||||
async exportPage(path: string, $q: any, t: any) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
return Api.SendReq('/exppage', 'POST', { path })
|
||||
.then((res) => {
|
||||
if (res && res.data && res.data.json) {
|
||||
tools.showPositiveNotif($q, t('mypages.expok'))
|
||||
return res.data.json
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('mypages.experr'))
|
||||
return null
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error loadTable', error)
|
||||
userStore.setErrorCatch(error)
|
||||
return null
|
||||
})
|
||||
},
|
||||
|
||||
importPage(jsonString: string, $q: any, t: any) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
return Api.SendReq('/imppage', 'POST', { jsonString })
|
||||
.then((res) => {
|
||||
if (res && res.data && res.data.ris) {
|
||||
tools.showPositiveNotif($q, t('mypages.impok'))
|
||||
return res.data.ris
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('mypages.imperr'))
|
||||
return null
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error importPage', error)
|
||||
userStore.setErrorCatch(error)
|
||||
return null
|
||||
})
|
||||
},
|
||||
|
||||
async loadPageTest() {
|
||||
|
||||
console.log('loadPageTest')
|
||||
@@ -2301,7 +2354,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return;
|
||||
}
|
||||
|
||||
const filenameToDownload = tools.removeFileExtension(pdfFile.name) + '-output.pdf'
|
||||
const filenameToDownload = tools.removeFileExtension(pdfFile.name) + '-compresso.pdf'
|
||||
|
||||
const formData = new FormData();
|
||||
if (pdfFile instanceof File) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
$heightBtn: 100%;
|
||||
$colore_titolo_libro: rgb(210, 12, 12);
|
||||
|
||||
body {
|
||||
line-height: 1.2 !important;
|
||||
@@ -71,34 +72,35 @@ body {
|
||||
|
||||
.book-title {
|
||||
font-family: 'DINPro-CondensedBold', sans-serif;
|
||||
color: rgba(255, 0, 0, 1);
|
||||
color: $colore_titolo_libro;
|
||||
text-transform: uppercase;
|
||||
margin-top: calc(5 * var(--scalecatalog) * 1px);
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(18 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(20 * var(--scalecatalog) * 1px);
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
.book-author {
|
||||
font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
|
||||
font-size: calc(16 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(18 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
.book-descr {
|
||||
font-family: 'DINPro-BoldItalic', sans-serif;
|
||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||
font-family: 'DIN-Pro-Condensed-Bold-Italic', sans-serif;
|
||||
font-size: calc(16 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
|
||||
.book-details {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
font-family: 'DIN-Pro-Condensed-Regular', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(12 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(13 * var(--scalecatalog) * 1px);
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
|
||||
.book-descr-estesa {
|
||||
font-family: 'DINPro', sans-serif;
|
||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||
font-family: 'AGaramondPro-Regular', sans-serif;
|
||||
font-size: calc(15 * var(--scalecatalog) * 1px);
|
||||
text-align: justify;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
@@ -877,14 +877,21 @@ export default defineComponent({
|
||||
const paddingLeft = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.padding?.left) || '0';
|
||||
const paddingRight = tools.adjustSize(optcatalogo.value, recscheda.scheda?.dimensioni?.riga?.padding?.right) || '0';
|
||||
|
||||
return {
|
||||
let out: any = {
|
||||
placeContent,
|
||||
flex: `0 1 ${width} !important;`,
|
||||
margin: `${marginTop} ${marginRight} ${marginBottom} ${marginLeft}`,
|
||||
padding: `${paddingTop} ${paddingRight} ${paddingBottom} ${paddingLeft}`,
|
||||
...(width ? { width: `${width} !important;` } : {}),
|
||||
...(height ? { height: `${height} !important;` } : {}) // Aggiungi l'altezza solo se è valorizzata
|
||||
};
|
||||
padding: `${paddingTop} ${paddingRight} ${paddingBottom} ${paddingLeft}`
|
||||
}
|
||||
|
||||
if (width) {
|
||||
out.width = `${width} !important;`
|
||||
}
|
||||
if (height) {
|
||||
out.height = `${height} !important;`
|
||||
}
|
||||
|
||||
return out
|
||||
|
||||
}
|
||||
|
||||
@@ -906,6 +913,7 @@ export default defineComponent({
|
||||
|
||||
return {
|
||||
placeContent,
|
||||
alignSelf: 'flex-start',
|
||||
flex: `0 1 ${width} !important;`,
|
||||
margin: `${marginTop} ${marginRight} ${marginBottom} ${marginLeft}`,
|
||||
padding: `${paddingTop} ${paddingRight} ${paddingBottom} ${paddingLeft}`,
|
||||
|
||||
@@ -330,6 +330,7 @@
|
||||
<!-- Itera sui prodotti di ogni riga -->
|
||||
|
||||
<div class="row justify-center">
|
||||
<span v-if="optcatalogo.indebug">{{getStyleSchedaProdotto(recscheda)}}</span>
|
||||
<div
|
||||
v-for="(prod, colIndex) in row"
|
||||
:key="`${pageIndex}-${rowIndex}-${colIndex}`"
|
||||
|
||||
Reference in New Issue
Block a user