- Catalogo: qualità di stampa, margini. ora è 300 DPI.
This commit is contained in:
@@ -368,6 +368,10 @@ export const shared_consts = {
|
|||||||
Outcoming: 2,
|
Outcoming: 2,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
CmdConvertPDF: {
|
||||||
|
RIDUCI_DIMENSIONI: 1,
|
||||||
|
},
|
||||||
|
|
||||||
Cmd: {
|
Cmd: {
|
||||||
PROVINCE: 1,
|
PROVINCE: 1,
|
||||||
COMUNI: 2,
|
COMUNI: 2,
|
||||||
|
|||||||
@@ -361,3 +361,10 @@
|
|||||||
position: relative; /* Per la sovrapposizione */
|
position: relative; /* Per la sovrapposizione */
|
||||||
z-index: 2; /* Posiziona l'immagine principale sopra l'ombra */
|
z-index: 2; /* Posiziona l'immagine principale sopra l'ombra */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.border-box {
|
||||||
|
border-left: 1px solid lightgray;
|
||||||
|
border-top: 1px solid lightgray;
|
||||||
|
border-right: 1px solid gray;
|
||||||
|
border-bottom: 1px solid gray;
|
||||||
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
:class="[
|
:class="[
|
||||||
'flex', // Classi comuni
|
'flex', // Classi comuni
|
||||||
'image-container',
|
'image-container',
|
||||||
{ 'shadow-2': options.in_3d }, // Classe condizionale
|
{ 'shadow-2': options.in_3d && !optcatalogo.pdf }, // Classe condizionale
|
||||||
scheda.testo_right.font?.posiz_text ===
|
scheda.testo_right.font?.posiz_text ===
|
||||||
costanti.POSIZ_TESTO.IN_BASSO
|
costanti.POSIZ_TESTO.IN_BASSO
|
||||||
? 'flex-col'
|
? 'flex-col'
|
||||||
@@ -120,8 +120,8 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'book-image-fixed': complete,
|
'book-image-fixed': complete,
|
||||||
'cursor-pointer': !complete,
|
'cursor-pointer': !complete,
|
||||||
'shadow-4': true,
|
'shadow-4': !optcatalogo.pdf,
|
||||||
'image-wrapper': optcatalogo.pdf,
|
'border-box': optcatalogo.pdf,
|
||||||
}"
|
}"
|
||||||
:style="{
|
:style="{
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
@@ -175,7 +175,6 @@
|
|||||||
costanti.POSIZ_TESTO.IN_BASSO
|
costanti.POSIZ_TESTO.IN_BASSO
|
||||||
? '100%'
|
? '100%'
|
||||||
: scheda.testo_right.font?.perc_text ?? '50%',
|
: scheda.testo_right.font?.perc_text ?? '50%',
|
||||||
textAlign: 'center',
|
|
||||||
marginTop:
|
marginTop:
|
||||||
scheda.testo_right.font?.posiz_text ===
|
scheda.testo_right.font?.posiz_text ===
|
||||||
costanti.POSIZ_TESTO.IN_BASSO
|
costanti.POSIZ_TESTO.IN_BASSO
|
||||||
@@ -260,7 +259,6 @@
|
|||||||
v-if="scheda.testo_bottom && scheda.testo_bottom.contenuto"
|
v-if="scheda.testo_bottom && scheda.testo_bottom.contenuto"
|
||||||
:style="{
|
:style="{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
textAlign: 'center',
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -91,12 +91,32 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function incrementValuePlus1() {
|
||||||
|
if (!sliderValue.value) {
|
||||||
|
sliderValue.value = '1'
|
||||||
|
} else {
|
||||||
|
sliderValue.value = (parseFloat(sliderValue.value) + 1) + ''; // Aumenta il valore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function decrementValueMinus1() {
|
||||||
|
if (sliderValue.value === '0') {
|
||||||
|
sliderValue.value = ''
|
||||||
|
} else if (!sliderValue.value) {
|
||||||
|
// niente
|
||||||
|
} else {
|
||||||
|
sliderValue.value = (parseFloat(sliderValue.value) - 1) + ''; // Diminuisci il valore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
t,
|
t,
|
||||||
shared_consts,
|
shared_consts,
|
||||||
sliderValue,
|
sliderValue,
|
||||||
incrementValue,
|
incrementValue,
|
||||||
decrementValue
|
decrementValue,
|
||||||
|
decrementValueMinus1,
|
||||||
|
incrementValuePlus1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,16 +6,25 @@
|
|||||||
@click="decrementValue"
|
@click="decrementValue"
|
||||||
:disable="disable || !sliderValue"
|
:disable="disable || !sliderValue"
|
||||||
flat
|
flat
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
<q-btn
|
||||||
|
label="-1"
|
||||||
|
@click="decrementValueMinus1"
|
||||||
|
:disable="disable || !sliderValue"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
/>
|
/>
|
||||||
<q-input
|
<q-input
|
||||||
style="width: 150px"
|
style="width: 170px"
|
||||||
dense
|
dense
|
||||||
v-model="sliderValue"
|
v-model="sliderValue"
|
||||||
filled
|
filled
|
||||||
:disable="disable"
|
:disable="disable"
|
||||||
>
|
>
|
||||||
</q-input>
|
</q-input>
|
||||||
<q-btn icon="fas fa-plus" @click="incrementValue" :disable="disable" flat />
|
<q-btn dense label="+1" @click="incrementValuePlus1" :disable="disable" flat />
|
||||||
|
<q-btn dense icon="fas fa-plus" @click="incrementValue" :disable="disable" flat />
|
||||||
|
|
||||||
<q-slider
|
<q-slider
|
||||||
:disable="disable"
|
:disable="disable"
|
||||||
|
|||||||
@@ -2516,9 +2516,6 @@ body.body--dark {
|
|||||||
align-items: center; /* Allineamento verticale al centro */
|
align-items: center; /* Allineamento verticale al centro */
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
flex-grow: 0; /* Opzionale: permette agli elementi di crescere uniformemente */
|
flex-grow: 0; /* Opzionale: permette agli elementi di crescere uniformemente */
|
||||||
|
|
||||||
break-inside: avoid;
|
|
||||||
page-break-inside: avoid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-page {
|
.card-page {
|
||||||
@@ -2526,6 +2523,12 @@ body.body--dark {
|
|||||||
page-break-after: always;
|
page-break-after: always;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-page::after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
page-break-after: always;
|
||||||
|
}
|
||||||
|
|
||||||
.card-row {
|
.card-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
0
src/rootgen/admin/convertPDF/convertPDF.scss
Executable file
0
src/rootgen/admin/convertPDF/convertPDF.scss
Executable file
135
src/rootgen/admin/convertPDF/convertPDF.ts
Executable file
135
src/rootgen/admin/convertPDF/convertPDF.ts
Executable file
@@ -0,0 +1,135 @@
|
|||||||
|
import { CMyPage } from '../../../components/CMyPage/index'
|
||||||
|
|
||||||
|
import { shared_consts } from '@src/common/shared_vuejs'
|
||||||
|
import { tools } from '@src/store/Modules/tools'
|
||||||
|
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
import { defineComponent, ref, onMounted } from 'vue'
|
||||||
|
import { useI18n } from '@src/boot/i18n'
|
||||||
|
import { useUserStore } from '@store/UserStore'
|
||||||
|
import { useGlobalStore } from '@store/globalStore'
|
||||||
|
import { useQuasar } from 'quasar'
|
||||||
|
import { IParamsQuery } from 'model'
|
||||||
|
import { toolsext } from '@store/Modules/toolsext'
|
||||||
|
import { StringDecoder } from 'string_decoder'
|
||||||
|
import { GlobalConfig } from '@src/common'
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'convertPDF',
|
||||||
|
components: { CMyPage },
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const $q = useQuasar()
|
||||||
|
const { t } = useI18n()
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
|
const arrSector = ref(<any[]>[])
|
||||||
|
const arrSectorGood = ref(<any[]>[])
|
||||||
|
const arrSkill = ref(<any[]>[])
|
||||||
|
const arrGood = ref(<any[]>[])
|
||||||
|
|
||||||
|
const importasulserver = ref(false)
|
||||||
|
const skipfirstrow = ref(true)
|
||||||
|
|
||||||
|
const incaricamento = ref(false)
|
||||||
|
const checkAggiornaQta = ref(false)
|
||||||
|
|
||||||
|
const inputfile = ref('')
|
||||||
|
const risultato = ref('')
|
||||||
|
const risraw = ref('')
|
||||||
|
|
||||||
|
const width = ref('8.88')
|
||||||
|
const height = ref('12.31')
|
||||||
|
|
||||||
|
const cosafare = ref(shared_consts.CmdConvertPDF.RIDUCI_DIMENSIONI)
|
||||||
|
|
||||||
|
const caricaDatiToggle = ref(false)
|
||||||
|
|
||||||
|
const pdfFile = ref(<any>null);
|
||||||
|
|
||||||
|
const compressione = ref('prepress')
|
||||||
|
|
||||||
|
const ListaCmd = ref(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
label: 'Riduci Dimensioni',
|
||||||
|
value: shared_consts.CmdConvertPDF.RIDUCI_DIMENSIONI,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
|
const ListaCompressione = ref(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
label: '[Nessuna]',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '[screen - Buona per la visualizzazione su schermo; bassa qualità e dimensione del file ridotta]',
|
||||||
|
value: 'screen',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '[Ebook - Ottimizza il PDF per la lettura su ebook; qualità media e dimensione media]',
|
||||||
|
value: 'ebook',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '[Printer - Ottimizza il PDF per la stampa di qualità; migliora la risoluzione rispetto a /ebook.]',
|
||||||
|
value: 'printer',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '[Prepress - Ottimizza per la stampa di alta qualità; ideale per progetti di stampa professionali.]',
|
||||||
|
value: 'prepress',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '[Default - Usa impostazioni predefinite; generalmente fornisce un buon equilibrio tra qualità e dimensione]',
|
||||||
|
value: 'default',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
function caricadati() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function created() {
|
||||||
|
|
||||||
|
inputfile.value = ''
|
||||||
|
|
||||||
|
if (caricaDatiToggle.value) {
|
||||||
|
caricadati()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadPdf = (event: any) => {
|
||||||
|
pdfFile.value = event.target.files[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
const convertPdf = async () => {
|
||||||
|
globalStore.convertPdf(pdfFile.value, width.value, height.value, compressione.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const execPdf = async () => {
|
||||||
|
|
||||||
|
if (cosafare.value === shared_consts.CmdConvertPDF.RIDUCI_DIMENSIONI) {
|
||||||
|
convertPdf()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(created)
|
||||||
|
|
||||||
|
return {
|
||||||
|
shared_consts,
|
||||||
|
ListaCmd,
|
||||||
|
cosafare,
|
||||||
|
convertPdf,
|
||||||
|
uploadPdf,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
execPdf,
|
||||||
|
ListaCompressione,
|
||||||
|
compressione,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
40
src/rootgen/admin/convertPDF/convertPDF.vue
Executable file
40
src/rootgen/admin/convertPDF/convertPDF.vue
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
<template>
|
||||||
|
<div class="column">
|
||||||
|
<q-select
|
||||||
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||||
|
rounded
|
||||||
|
outlined
|
||||||
|
v-model="cosafare"
|
||||||
|
:options="ListaCmd"
|
||||||
|
label="Operazione"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
>
|
||||||
|
</q-select>
|
||||||
|
<q-input v-model="width" label="Width:" filled></q-input>
|
||||||
|
<q-input v-model="height" label="Height:" filled></q-input>
|
||||||
|
<q-select
|
||||||
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||||
|
rounded
|
||||||
|
outlined
|
||||||
|
v-model="compressione"
|
||||||
|
:options="ListaCompressione"
|
||||||
|
label="Compressione"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
|
<input type="file" @change="uploadPdf" />
|
||||||
|
<q-btn @click="execPdf" label="Esegui"></q-btn>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" src="./convertPDF.ts">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import './convertPDF.scss';
|
||||||
|
</style>
|
||||||
@@ -67,7 +67,20 @@ function getRoutesAd(site: ISites) {
|
|||||||
inmenu: true,
|
inmenu: true,
|
||||||
submenu: true,
|
submenu: true,
|
||||||
onlyAdmin: true
|
onlyAdmin: true
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
active: true,
|
||||||
|
order: 1040,
|
||||||
|
path: '/admin/convertPDF',
|
||||||
|
materialIcon: 'event_seat',
|
||||||
|
name: 'otherpages.manage.convertPDF',
|
||||||
|
component: () => import('@/rootgen/admin/convertPDF/convertPDF.vue'),
|
||||||
|
level_parent: 0.0,
|
||||||
|
level_child: 0.5,
|
||||||
|
inmenu: true,
|
||||||
|
submenu: true,
|
||||||
|
onlyAdmin: true
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ const msg_enUs = {
|
|||||||
nessuno: 'None',
|
nessuno: 'None',
|
||||||
sendpushnotif: 'Invia Msg Push',
|
sendpushnotif: 'Invia Msg Push',
|
||||||
importfile: 'Importa File',
|
importfile: 'Importa File',
|
||||||
|
convertPDF: 'Converti PDF',
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
menu: 'Your Messages',
|
menu: 'Your Messages',
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ const msg_it = {
|
|||||||
nessuno: 'Nessuno',
|
nessuno: 'Nessuno',
|
||||||
sendpushnotif: 'Invia Messaggi',
|
sendpushnotif: 'Invia Messaggi',
|
||||||
importfile: 'Importa File',
|
importfile: 'Importa File',
|
||||||
|
convertPDF: 'Converti PDF',
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
menu: 'I tuoi Messaggi',
|
menu: 'I tuoi Messaggi',
|
||||||
|
|||||||
@@ -4,15 +4,16 @@ import axios, {
|
|||||||
import { Api } from '@api'
|
import { Api } from '@api'
|
||||||
import * as Types from '@src/store/Api/ApiTypes'
|
import * as Types from '@src/store/Api/ApiTypes'
|
||||||
|
|
||||||
async function sendRequest(url: string, method: string, mydata: any) {
|
async function sendRequest(url: string, method: string, mydata: any, myformdata?: any, responsedata?: any) {
|
||||||
// if (process.env.DEBUG) console.log('sendRequest', method, url)
|
console.log('sendRequest', method, url, mydata)
|
||||||
|
|
||||||
let request
|
let request
|
||||||
if (method === 'GET') request = Api.get(url, mydata)
|
if (method === 'GET') request = Api.get(url, mydata, responsedata)
|
||||||
else if (method === 'POST') request = Api.post(url, mydata)
|
else if (method === 'POST') request = Api.post(url, mydata, responsedata)
|
||||||
else if (method === 'DELETE') request = Api.Delete(url, mydata)
|
else if (method === 'postFormData') request = Api.postFormData(url, myformdata, responsedata)
|
||||||
else if (method === 'PUT') request = Api.put(url, mydata)
|
else if (method === 'DELETE') request = Api.Delete(url, mydata, responsedata)
|
||||||
else if (method === 'PATCH') request = Api.patch(url, mydata)
|
else if (method === 'PUT') request = Api.put(url, mydata, responsedata)
|
||||||
|
else if (method === 'PATCH') request = Api.patch(url, mydata, responsedata)
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const req: Promise<Types.AxiosSuccess | Types.AxiosError> = request
|
const req: Promise<Types.AxiosSuccess | Types.AxiosError> = request
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const addAuthHeaders = () => {
|
|||||||
// delete axiosInstance.defaults.headers.Authorization
|
// delete axiosInstance.defaults.headers.Authorization
|
||||||
//}
|
//}
|
||||||
|
|
||||||
async function Request(type: string, path: string, payload: any): Promise<Types.AxiosSuccess | Types.AxiosError | undefined> {
|
async function Request(type: string, path: string, payload: any, responsedata?: any): Promise<Types.AxiosSuccess | Types.AxiosError | undefined> {
|
||||||
|
|
||||||
let ricevuto = false
|
let ricevuto = false
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -65,6 +65,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
|
|||||||
'x-auth': userStore.x_auth_token,
|
'x-auth': userStore.x_auth_token,
|
||||||
'x-refrtok': userStore.refreshToken,
|
'x-refrtok': userStore.refreshToken,
|
||||||
},
|
},
|
||||||
|
...responsedata,
|
||||||
})
|
})
|
||||||
ricevuto = true
|
ricevuto = true
|
||||||
// console.log('Request Response: ', response)
|
// console.log('Request Response: ', response)
|
||||||
@@ -119,10 +120,12 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
|
|||||||
'x-auth': userStore.x_auth_token,
|
'x-auth': userStore.x_auth_token,
|
||||||
'x-refrtok': userStore.refreshToken,
|
'x-refrtok': userStore.refreshToken,
|
||||||
},
|
},
|
||||||
|
...responsedata,
|
||||||
})
|
})
|
||||||
ricevuto = true
|
ricevuto = true
|
||||||
return new Types.AxiosSuccess(response.data, response.status)
|
return new Types.AxiosSuccess(response.data, response.status)
|
||||||
} else if (type === 'postFormData') {
|
} else if (type === 'postFormData') {
|
||||||
|
console.log('postFormData', payload)
|
||||||
response = await axiosInstance.post(path, payload, {
|
response = await axiosInstance.post(path, payload, {
|
||||||
baseURL: globalStore.getServerHost(),
|
baseURL: globalStore.getServerHost(),
|
||||||
headers: {
|
headers: {
|
||||||
@@ -130,6 +133,7 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
|
|||||||
'x-auth': userStore.x_auth_token,
|
'x-auth': userStore.x_auth_token,
|
||||||
'x-refrtok': userStore.refreshToken,
|
'x-refrtok': userStore.refreshToken,
|
||||||
},
|
},
|
||||||
|
...responsedata,
|
||||||
})
|
})
|
||||||
ricevuto = true
|
ricevuto = true
|
||||||
return new Types.AxiosSuccess(response.data, response.status)
|
return new Types.AxiosSuccess(response.data, response.status)
|
||||||
|
|||||||
@@ -37,43 +37,43 @@ function ReceiveResponsefromServer(tablesync: string, nametab: string, method: s
|
|||||||
|
|
||||||
// const algoliaApi = new AlgoliaSearch()
|
// const algoliaApi = new AlgoliaSearch()
|
||||||
export const Api = {
|
export const Api = {
|
||||||
async post(path: string, payload?: any) {
|
async post(path: string, payload?: any, responsedata?: any) {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
globalStore.connData.downloading_server = 1
|
globalStore.connData.downloading_server = 1
|
||||||
globalStore.connData.uploading_server = 1
|
globalStore.connData.uploading_server = 1
|
||||||
return Request('post', path, payload)
|
return Request('post', path, payload, responsedata)
|
||||||
},
|
},
|
||||||
|
|
||||||
async postFormData(path: string, payload?: any) {
|
async postFormData(path: string, payload?: any, responsedata?: any) {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
globalStore.connData.uploading_server = 1
|
globalStore.connData.uploading_server = 1
|
||||||
globalStore.connData.downloading_server = 1
|
globalStore.connData.downloading_server = 1
|
||||||
return Request('postFormData', path, payload)
|
return Request('postFormData', path, payload, responsedata)
|
||||||
},
|
},
|
||||||
|
|
||||||
async get(path: string, payload?: any) {
|
async get(path: string, payload?: any, responsedata?: any) {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
globalStore.connData.downloading_server = 1
|
globalStore.connData.downloading_server = 1
|
||||||
globalStore.connData.uploading_server = 0
|
globalStore.connData.uploading_server = 0
|
||||||
return Request('get', path, payload)
|
return Request('get', path, payload, responsedata)
|
||||||
},
|
},
|
||||||
|
|
||||||
async put(path: string, payload?: any) {
|
async put(path: string, payload?: any, responsedata?: any) {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
globalStore.connData.uploading_server = 1
|
globalStore.connData.uploading_server = 1
|
||||||
return Request('put', path, payload)
|
return Request('put', path, payload, responsedata)
|
||||||
},
|
},
|
||||||
|
|
||||||
async patch(path: string, payload?: any) {
|
async patch(path: string, payload?: any, responsedata?: any) {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
globalStore.connData.uploading_server = 1
|
globalStore.connData.uploading_server = 1
|
||||||
return Request('patch', path, payload)
|
return Request('patch', path, payload, responsedata)
|
||||||
},
|
},
|
||||||
|
|
||||||
async Delete(path: string, payload: any) {
|
async Delete(path: string, payload: any, responsedata?: any) {
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
globalStore.connData.uploading_server = 1
|
globalStore.connData.uploading_server = 1
|
||||||
return Request('delete', path, payload)
|
return Request('delete', path, payload, responsedata)
|
||||||
},
|
},
|
||||||
|
|
||||||
async checkSession({ token, refresh_token }: any) {
|
async checkSession({ token, refresh_token }: any) {
|
||||||
@@ -131,7 +131,7 @@ export const Api = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async SendReqBase(url: string, method: string, mydata: any, setAuthToken = false, evitaloop = false): Promise<Types.AxiosSuccess | Types.AxiosError> {
|
async SendReqBase(url: string, method: string, mydata: any, setAuthToken = false, evitaloop = false, myformdata?: any, responsedata?: any): Promise<Types.AxiosSuccess | Types.AxiosError> {
|
||||||
const mydataout = {
|
const mydataout = {
|
||||||
...mydata,
|
...mydata,
|
||||||
keyappid: process.env.PAO_APP_ID,
|
keyappid: process.env.PAO_APP_ID,
|
||||||
@@ -145,7 +145,7 @@ export const Api = {
|
|||||||
userStore.setServerCode(tools.EMPTY)
|
userStore.setServerCode(tools.EMPTY)
|
||||||
userStore.setResStatus(0)
|
userStore.setResStatus(0)
|
||||||
|
|
||||||
return new Promise((resolve, reject) => sendRequest(url, method, mydataout)
|
return new Promise((resolve, reject) => sendRequest(url, method, mydataout, myformdata, responsedata)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (method === 'get') {
|
if (method === 'get') {
|
||||||
@@ -245,10 +245,12 @@ export const Api = {
|
|||||||
setAuthToken = false,
|
setAuthToken = false,
|
||||||
evitaloop = false,
|
evitaloop = false,
|
||||||
retryCount = 3,
|
retryCount = 3,
|
||||||
retryDelay = 5000
|
retryDelay = 5000,
|
||||||
|
myformdata?: any,
|
||||||
|
responsedata?: any,
|
||||||
): Promise<Types.AxiosSuccess | Types.AxiosError> {
|
): Promise<Types.AxiosSuccess | Types.AxiosError> {
|
||||||
try {
|
try {
|
||||||
const response = await this.SendReqBase(url, method, mydata, setAuthToken, evitaloop);
|
const response = await this.SendReqBase(url, method, mydata, setAuthToken, evitaloop, myformdata, responsedata);
|
||||||
return response;
|
return response;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (retryCount > 0) {
|
if (retryCount > 0) {
|
||||||
@@ -262,7 +264,9 @@ export const Api = {
|
|||||||
setAuthToken,
|
setAuthToken,
|
||||||
evitaloop,
|
evitaloop,
|
||||||
retryCount - 1,
|
retryCount - 1,
|
||||||
retryDelay
|
retryDelay,
|
||||||
|
myformdata,
|
||||||
|
responsedata,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -380,16 +380,24 @@ export const tools = {
|
|||||||
SelectListFormatPDF: [
|
SelectListFormatPDF: [
|
||||||
{ label: 'a4 (mm)', value: [210, 297] },
|
{ label: 'a4 (mm)', value: [210, 297] },
|
||||||
{ label: '22,60 x 31,26 (in mm)', value: [226.0, 312.6] },
|
{ label: '22,60 x 31,26 (in mm)', value: [226.0, 312.6] },
|
||||||
|
{ label: '22,60 x 31,31 (in mm)', value: [226.0, 313.1] },
|
||||||
|
{ label: '22,60 x 31,20 (in mm)', value: [226.0, 312.0] },
|
||||||
|
{ label: '22,60 x 31,10 (in mm)', value: [226.0, 311.0] },
|
||||||
],
|
],
|
||||||
|
|
||||||
SelectListScalePDF: [
|
SelectListScalePDF: [
|
||||||
{ label: 'Normale (100 DPI)', value: 1 },
|
{ label: 'Normale (72 DPI)', value: 1 },
|
||||||
{ label: 'Medio (200 PDI)', value: 2 },
|
{ label: 'Medio (144 PDI)', value: 2 },
|
||||||
{ label: 'Alto (300 PDI)', value: 3 },
|
{ label: 'Medio-Alta (180 PDI)', value: 2.5 },
|
||||||
|
{ label: 'Medio-Alta2 (201 PDI)', value: 2.8 },
|
||||||
|
{ label: 'Alto (216 PDI)', value: 3 },
|
||||||
|
{ label: 'Alto2 (288 PDI)', value: 4 },
|
||||||
],
|
],
|
||||||
SelectListQualityPDF: [
|
SelectListQualityPDF: [
|
||||||
{ label: 'Bassa (1 scale)', value: 1 },
|
{ label: 'Bassa (1 scale)', value: 1 },
|
||||||
|
{ label: 'Bassa-Norm (1.5 scale)', value: 1.5 },
|
||||||
{ label: 'Normale (2 scale)', value: 2 },
|
{ label: 'Normale (2 scale)', value: 2 },
|
||||||
|
{ label: 'Normale2.5 (2.5 scale)', value: 2.5 },
|
||||||
{ label: 'Media (3 scale)', value: 3 },
|
{ label: 'Media (3 scale)', value: 3 },
|
||||||
{ label: 'Elevata (4 scale)', value: 4 },
|
{ label: 'Elevata (4 scale)', value: 4 },
|
||||||
],
|
],
|
||||||
@@ -8629,6 +8637,20 @@ export const tools = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
removeFileExtension(filename: string) {
|
||||||
|
// Trova l'ultima occorrenza del punto nel nome del file
|
||||||
|
const lastDotIndex = filename.lastIndexOf('.');
|
||||||
|
|
||||||
|
// Se non c'è un punto o il punto è all'inizio del nome file,
|
||||||
|
// restituisci il nome file originale
|
||||||
|
if (lastDotIndex === -1 || lastDotIndex === 0) {
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Altrimenti, restituisci la parte del nome file prima dell'ultimo punto
|
||||||
|
return filename.substring(0, lastDotIndex);
|
||||||
|
},
|
||||||
|
|
||||||
removeescape(inputString: string): string {
|
removeescape(inputString: string): string {
|
||||||
return inputString.replace('\\', '').replace(/"/g, '')
|
return inputString.replace('\\', '').replace(/"/g, '')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2283,6 +2283,56 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async execConvertPDF(paramquery: any) {
|
||||||
|
// console.log('paramquery', paramquery)
|
||||||
|
return Api.SendReq('/admin/convert-pdf', 'postFormData', {}, false, false, 1, 5000, paramquery, { responseType: 'blob' })
|
||||||
|
.then((res) => {
|
||||||
|
return res.data
|
||||||
|
}).catch((error) => {
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async convertPdf(pdfFile: any, width: string, height: string, compressione: string) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (!pdfFile) {
|
||||||
|
console.error('No PDF file selected');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const filenameToDownload = tools.removeFileExtension(pdfFile.name) + '-output.pdf'
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
if (pdfFile instanceof File) {
|
||||||
|
formData.append('pdf', pdfFile);
|
||||||
|
}
|
||||||
|
formData.append('width', width); // Dimensione del PDF in cm
|
||||||
|
formData.append('height', height); // Dimensione del PDF in cm
|
||||||
|
formData.append('compressione', compressione);
|
||||||
|
|
||||||
|
const response = await this.execConvertPDF(formData)
|
||||||
|
|
||||||
|
if (response) {
|
||||||
|
const blob = new Blob([response], { type: 'application/pdf' });
|
||||||
|
const downloadUrl = window.URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = downloadUrl;
|
||||||
|
link.setAttribute('download', filenameToDownload);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
link.remove();
|
||||||
|
|
||||||
|
window.URL.revokeObjectURL(downloadUrl);
|
||||||
|
} else {
|
||||||
|
console.error('No data returned from the server.');
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error converting PDF:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async saveServerMysql(paramquery: any) {
|
async saveServerMysql(paramquery: any) {
|
||||||
return Api.SendReq('/admin/mysql', 'POST', paramquery)
|
return Api.SendReq('/admin/mysql', 'POST', paramquery)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ body {
|
|||||||
.book-descr-estesa {
|
.book-descr-estesa {
|
||||||
font-family: 'DINPro', sans-serif;
|
font-family: 'DINPro', sans-serif;
|
||||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||||
|
text-align: justify !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.book-link{
|
.book-link{
|
||||||
|
|||||||
@@ -769,8 +769,8 @@ export default defineComponent({
|
|||||||
const element = document.getElementById('pdf-content')
|
const element = document.getElementById('pdf-content')
|
||||||
const opt = {
|
const opt = {
|
||||||
margin: [
|
margin: [
|
||||||
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.left) || defaultMargin) : defaultMargin,
|
|
||||||
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.top) || defaultMargin) : defaultMargin,
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.top) || defaultMargin) : defaultMargin,
|
||||||
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.left) || defaultMargin) : defaultMargin,
|
||||||
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.bottom) || defaultMargin) : defaultMargin,
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.bottom) || defaultMargin) : defaultMargin,
|
||||||
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.right) || defaultMargin) : defaultMargin
|
props.optcatalogo.printable ? (parseFloat(props.optcatalogo.areadistampa!.margini?.right) || defaultMargin) : defaultMargin
|
||||||
],
|
],
|
||||||
@@ -791,6 +791,7 @@ export default defineComponent({
|
|||||||
compress: props.optcatalogo.areadistampa!.compress,
|
compress: props.optcatalogo.areadistampa!.compress,
|
||||||
},
|
},
|
||||||
enableLinks: true,
|
enableLinks: true,
|
||||||
|
pagebreak: { mode: 'avoid-all', before: '.card-page' }
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('opt di stampa', opt)
|
console.log('opt di stampa', opt)
|
||||||
|
|||||||
@@ -286,15 +286,9 @@
|
|||||||
<div
|
<div
|
||||||
v-if="containsProducts(page)"
|
v-if="containsProducts(page)"
|
||||||
:class="{
|
:class="{
|
||||||
'fixed-width': getWidthPagina(
|
'fixed-width': true,
|
||||||
optcatalogo,
|
'fixed-height': true,
|
||||||
recscheda.scheda
|
'card-page': false,
|
||||||
),
|
|
||||||
'fixed-height': getHeightPagina(
|
|
||||||
optcatalogo,
|
|
||||||
recscheda.scheda
|
|
||||||
),
|
|
||||||
'card-page': true,
|
|
||||||
}"
|
}"
|
||||||
:style="
|
:style="
|
||||||
generateStylePageScheda(
|
generateStylePageScheda(
|
||||||
|
|||||||
Reference in New Issue
Block a user