- Export Lista
- Ordinamento - PDF Risolto Salvataggio ed invio al server direttamente.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
:finder="finder"
|
||||
labelElemFind="trovati"
|
||||
:choose_visutype="visuType"
|
||||
:butt_modif_new="tools.isAdmin()"
|
||||
:butt_modif_new="!tools.isUtente()"
|
||||
:noresultLabel="t('grid.nosearchfound')"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
|
||||
@@ -97,9 +97,9 @@
|
||||
@click="click_opendetail()"
|
||||
/>
|
||||
</a>
|
||||
<div class="q-ma-sm">
|
||||
<div class="q-ma-sm no-print">
|
||||
<div
|
||||
class="row absolute-top-left semi-transparent"
|
||||
class="row absolute-top-left semi-transparent "
|
||||
style="z-index: 10"
|
||||
>
|
||||
<q-btn-dropdown
|
||||
|
||||
@@ -69,6 +69,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: 0,
|
||||
},
|
||||
enableExport: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
CMyFieldDb, CGridTableRec, CTitlePage,
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
:heightcarousel="heightcarousel"
|
||||
@clickButtBar="clickButtBar"
|
||||
:tablesList="gettablesList()"
|
||||
:enableExport="enableExport"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</div>
|
||||
|
||||
@@ -2606,16 +2606,17 @@ export default defineComponent({
|
||||
// console.log('row', serverData.value)
|
||||
// console.log('mycolumns.value', mycolumns.value)
|
||||
// naive encoding to csv format
|
||||
const content = [mycolumns.value.map((col: any) => wrapCsvValue(col.label))].concat(
|
||||
serverData.value.map((row: any) => mycolumns.value.map((col: any) => wrapCsvValue(
|
||||
typeof col.field === 'function'
|
||||
const headers = mycolumns.value.map((col: any) => wrapCsvValue(col.label));
|
||||
const rows = serverData.value.map((row: any) =>
|
||||
mycolumns.value.map((col: any) => {
|
||||
const value = typeof col.field === 'function'
|
||||
? col.field(row)
|
||||
: tools.getValue(row, col.field, col.subfield),
|
||||
col.format,
|
||||
row,
|
||||
col
|
||||
)).join(','))
|
||||
).join('\r\n')
|
||||
: tools.getValue(row, col.field, col.subfield);
|
||||
return wrapCsvValue(value, col.format, row, col);
|
||||
}).join('|')
|
||||
);
|
||||
|
||||
const content = [headers.join('|'), ...rows].join('\r\n');
|
||||
|
||||
const status = exportFile(
|
||||
'export-' + mytable.value + '_' + tools.getstrYYMMDDHHMMDateTime(tools.getDateNow()) + '.csv',
|
||||
|
||||
@@ -2264,7 +2264,7 @@ export default defineComponent({
|
||||
col.format,
|
||||
row,
|
||||
col
|
||||
)).join(','))
|
||||
)).join('|'))
|
||||
).join('\r\n')
|
||||
|
||||
const status = exportFile(
|
||||
|
||||
@@ -1595,6 +1595,14 @@
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.showListaCollane"
|
||||
color="positive"
|
||||
icon="fas fa-file-pdf"
|
||||
label="Mostra Lista Collane"
|
||||
@update:model-value="modifElem"
|
||||
>
|
||||
</q-toggle>
|
||||
|
||||
<q-toggle
|
||||
v-model="myel.catalogo.pdf"
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
<q-tab-panel name="lista">
|
||||
<CGridOriz table="catalogs" :tipovisu="costanti.VISUTABLE_TABLELIST" :prop_search="true" :finder="true"
|
||||
:isCatalogoGenerale="myel.parambool3"
|
||||
:showMap="false" :prop_modif="tools.isAdmin()"></CGridOriz>
|
||||
:showMap="false" :prop_modif="tools.isAdmin()" :enableExport="true"></CGridOriz>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="griglia">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<q-card
|
||||
v-if="myrec"
|
||||
bordered
|
||||
class="full-height flex flex-column"
|
||||
class="full-height flex flex-column justify-evenly"
|
||||
:style="`width: ` + opt.widthcard + `; ` + (opt.heightcard ? `height: ` + opt.heightcard + `;` : '')"
|
||||
>
|
||||
<q-img
|
||||
|
||||
@@ -93,35 +93,6 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
|
||||
async function mounted() {
|
||||
console.log('mounted CProductTable')
|
||||
loading.value = true
|
||||
|
||||
optionscatalogo.value = {
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
}
|
||||
|
||||
const savedColumns = tools.getCookie("selColCat_2");
|
||||
if (savedColumns) {
|
||||
selectedColumns.value = savedColumns;
|
||||
}
|
||||
|
||||
const savedSortAttribute = tools.getCookie("sortAttr");
|
||||
if (savedSortAttribute) {
|
||||
if (isColumnVisible(savedSortAttribute)) {
|
||||
sortAttribute.value = savedSortAttribute;
|
||||
|
||||
const savedSortDir = tools.getCookie("sortDir");
|
||||
if (savedSortDir) {
|
||||
sortDirection.value = savedSortDir;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
// Aggiorna la copia locale quando il prop cambia
|
||||
watch(
|
||||
() => props.lista_prodotti,
|
||||
@@ -167,6 +138,36 @@ export default defineComponent({
|
||||
{ name: "actions", label: "Azioni", field: "", align: "center", visu: costanti.VISUCAMPI.PER_EDITORE, noexp: true, notsortable: true },
|
||||
];
|
||||
|
||||
async function mounted() {
|
||||
console.log('mounted CProductTable')
|
||||
loading.value = true
|
||||
|
||||
optionscatalogo.value = {
|
||||
maxlength: props.scheda?.testo_bottom?.maxlength
|
||||
}
|
||||
|
||||
const savedColumns = tools.getCookie("selColCat_2");
|
||||
if (savedColumns) {
|
||||
selectedColumns.value = savedColumns;
|
||||
}
|
||||
|
||||
const savedSortAttribute = tools.getCookie("sortAttr");
|
||||
if (savedSortAttribute && props.optcatalogo.showListaArgomenti) {
|
||||
if (isColumnVisible(savedSortAttribute)) {
|
||||
sortAttribute.value = savedSortAttribute;
|
||||
|
||||
const savedSortDir = tools.getCookie("sortDir");
|
||||
if (savedSortDir) {
|
||||
sortDirection.value = savedSortDir;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
|
||||
function getFieldValue(element: any, field: any): any {
|
||||
if (!element)
|
||||
return ''
|
||||
|
||||
@@ -249,7 +249,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function collabel(rec: any) {
|
||||
console.log('Record:', rec)
|
||||
|
||||
let label = ''
|
||||
if (rec && rec.productInfo) {
|
||||
if (productStore.isNovitaById(rec.productInfo.date_pub))
|
||||
|
||||
Reference in New Issue
Block a user