- aggiornato scheda e rigenera lista
- corretto filtro sulla Collana
This commit is contained in:
@@ -60,176 +60,86 @@
|
||||
<tr
|
||||
:key="element._id"
|
||||
:class="{
|
||||
'bg-grey-2': internalProducts.indexOf(element) % 2 === 1,
|
||||
'bg-grey-3': internalProducts.indexOf(element) % 2 === 1,
|
||||
}"
|
||||
>
|
||||
<!-- Icona Drag Handle -->
|
||||
<td v-if="isColumnVisible('pos')">
|
||||
{{
|
||||
// put index in the first column
|
||||
internalProducts.indexOf(element) + 1
|
||||
}}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('drag')"
|
||||
class="drag-handle"
|
||||
<template
|
||||
v-for="field in allColumns"
|
||||
:key="field.name"
|
||||
>
|
||||
<q-icon
|
||||
name="drag_handle"
|
||||
size="32px"
|
||||
color="primary"
|
||||
/>
|
||||
</td>
|
||||
|
||||
<!-- Immagine Piccola -->
|
||||
<td v-if="isColumnVisible('image')">
|
||||
<q-img
|
||||
:src="
|
||||
element.productInfo?.imagefile
|
||||
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile)
|
||||
: element.productInfo?.image_link
|
||||
"
|
||||
style="width: 50px; height: 50px"
|
||||
class="rounded-borders cursor-pointer"
|
||||
@click="showProduct(element)"
|
||||
/>
|
||||
</td>
|
||||
|
||||
<!-- Titolo -->
|
||||
<td v-if="isColumnVisible('name')">{{ element.productInfo?.name }}</td>
|
||||
|
||||
<!-- Autore -->
|
||||
<td v-if="isColumnVisible('authors')">{{ formatAuthors(element.productInfo?.authors) }}</td>
|
||||
|
||||
<!-- ISBN -->
|
||||
<td v-if="isColumnVisible('isbn')">{{ element.isbn }}</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('trafiletto')"
|
||||
style="text-align: center"
|
||||
:class="element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'text-green' : 'text-red'"
|
||||
>
|
||||
{{ element.productInfo?.descr_trafiletto_catalogo?.length > 100 ? 'SI' : 'NO' }}
|
||||
</td>
|
||||
|
||||
<!-- Argomento -->
|
||||
<td v-if="isColumnVisible('catprods')">{{ tools.formatCatProds(element.productInfo?.catprods) }}</td>
|
||||
<!-- Collana -->
|
||||
<td v-if="isColumnVisible('idCollana')">{{ tools.formatCollane(element.productInfo?.idCollana) }}</td>
|
||||
<td
|
||||
v-if="isColumnVisible('stato')"
|
||||
:class="{
|
||||
'bg-purple-3': products.isProssimaUscita(element.productInfo),
|
||||
'bg-grey': products.isNonVendibile(element.productInfo),
|
||||
}"
|
||||
>
|
||||
{{ products.getDescrStatiProdottoByIdStatoProdotto(element.productInfo.idStatoProdotto || '') }}
|
||||
</td>
|
||||
<td v-if="isColumnVisible('tipologia')">
|
||||
{{ products.getDescrByIdTipologia(element.arrvariazioni[0].idTipologia || '') }}
|
||||
</td>
|
||||
<td v-if="isColumnVisible('tipoformato')">
|
||||
{{ products.getDescrByIdTipoFormato(element.arrvariazioni[0].idTipoFormato || '') }}
|
||||
</td>
|
||||
|
||||
<td v-if="isColumnVisible('date_pub')">{{ tools.getstrDate(element.productInfo?.date_pub) }}</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('rank3M')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.rank3M }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('rank6M')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.rank6M }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('rank1Y')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.rank1Y }}
|
||||
</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('pagine')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.arrvariazioni[0].pagine }}
|
||||
</td>
|
||||
|
||||
<td
|
||||
v-if="isColumnVisible('totVen')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.totVen }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('totFat')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.totFat }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('fatLast6M')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.fatLast6M }}
|
||||
</td>
|
||||
<td
|
||||
v-if="isColumnVisible('fatLast1Y')"
|
||||
style="text-align: right"
|
||||
>
|
||||
{{ element.productInfo?.fatLast1Y }}
|
||||
</td>
|
||||
<td v-if="isColumnVisible('ult_ord')">{{ tools.getstrDate(element.productInfo?.dataUltimoOrdine) }}</td>
|
||||
|
||||
<!-- Quantità -->
|
||||
<td
|
||||
v-if="isColumnVisible('quantity')"
|
||||
style="text-align: right"
|
||||
:class="{
|
||||
'bg-yellow': products.isPubblicato(element.productInfo) && products.isQtaLimitata(element),
|
||||
'bg-orange': products.isPubblicato(element.productInfo) && products.isInEsaurendo(element),
|
||||
'text-white bg-red-10': products.isPubblicato(element.productInfo) && products.isEsaurito(element),
|
||||
}"
|
||||
>
|
||||
{{ element.arrvariazioni[0].quantita }}
|
||||
</td>
|
||||
|
||||
<!-- Azioni -->
|
||||
<td v-if="isColumnVisible('actions')">
|
||||
<q-btn-dropdown
|
||||
label="Azioni"
|
||||
color="primary"
|
||||
flat
|
||||
<!-- Icona Drag Handle -->
|
||||
<td v-if="field.name === 'pos' && isColumnVisible('pos')">
|
||||
{{
|
||||
// put index in the first column
|
||||
internalProducts.indexOf(element) + 1
|
||||
}}
|
||||
</td>
|
||||
<td
|
||||
v-else-if="field.name === 'drag' && isColumnVisible('drag')"
|
||||
class="drag-handle"
|
||||
>
|
||||
<q-list>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="modifyProduct(element)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Modifica</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="removeProduct(element)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Elimina</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<q-icon
|
||||
name="drag_handle"
|
||||
size="32px"
|
||||
color="primary"
|
||||
/>
|
||||
</td>
|
||||
|
||||
<!-- Immagine Piccola -->
|
||||
<td v-else-if="field.name === 'image' && isColumnVisible('image')">
|
||||
<q-img
|
||||
:src="
|
||||
element.productInfo?.imagefile
|
||||
? tools.getFullFileNameByImageFile('productInfos', element.productInfo?.imagefile)
|
||||
: element.productInfo?.image_link
|
||||
"
|
||||
style="width: 50px; height: 50px"
|
||||
class="rounded-borders cursor-pointer"
|
||||
@click="showProduct(element)"
|
||||
/>
|
||||
</td>
|
||||
|
||||
<td
|
||||
v-else-if="isColumnVisible(field.name)"
|
||||
:class="getFieldClass(element, field)"
|
||||
:style="getFieldStyle(element, field)"
|
||||
@click="getFieldClick(element, field)?.()"
|
||||
>
|
||||
{{ getFieldValue(element, field) }}
|
||||
</td>
|
||||
<!-- Azioni -->
|
||||
<td v-else-if="field.name === 'actions' && isColumnVisible('actions')">
|
||||
<q-btn-dropdown
|
||||
label="Azioni"
|
||||
color="primary"
|
||||
flat
|
||||
>
|
||||
<q-list>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="modifyProduct(element)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Modifica</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="removeProduct(element)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Elimina</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</td>
|
||||
</template>
|
||||
</tr></template
|
||||
>
|
||||
>
|
||||
</draggable>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user