- aggiornamento catalogo: lista titoli del catalogo
- scheda prodotto libro - migliorata tabella prodotto
This commit is contained in:
@@ -94,8 +94,11 @@ body {
|
||||
.book-details {
|
||||
font-family: 'DINPro-Condensed-Regular', sans-serif;
|
||||
margin-bottom: calc(5 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(14 * var(--scalecatalog) * 1px);
|
||||
font-size: calc(16 * var(--scalecatalog) * 1px);
|
||||
text-align: left !important;
|
||||
&.big {
|
||||
font-size: calc(22 * var(--scalecatalog) * 1px);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,10 @@ import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { CProductCard } from '@src/components/CProductCard'
|
||||
|
||||
import { CMyDialog } from '@src/components/CMyDialog'
|
||||
import { CMySelect } from '@src/components/CMySelect'
|
||||
import { CProductTable } from '@src/components/CProductTable'
|
||||
import { CSearchProduct } from '@src/components/CSearchProduct'
|
||||
import { CContainerCatalogoCard } from '@src/components/CContainerCatalogoCard'
|
||||
import { CSelectUserActive } from '@src/components/CSelectUserActive'
|
||||
import type {
|
||||
@@ -34,7 +36,10 @@ import { Catalogo } from '.';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Catalogo',
|
||||
components: { CContainerCatalogoCard, CProductCard, CSelectUserActive, CMySelect, CProductTable },
|
||||
components: {
|
||||
CContainerCatalogoCard, CProductCard,
|
||||
CSelectUserActive, CMySelect, CProductTable, CSearchProduct, CMyDialog,
|
||||
},
|
||||
emits: ['update:modelValue', 'updateCatalogo'],
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -59,6 +64,7 @@ export default defineComponent({
|
||||
const optauthors = ref(<any>[])
|
||||
|
||||
const pdfContent = ref(null);
|
||||
const addnewProd = ref(false)
|
||||
|
||||
const optcatalogo = ref(<IOptCatalogo>{ ...props.modelValue });
|
||||
|
||||
@@ -601,8 +607,8 @@ export default defineComponent({
|
||||
let risposta_si = false
|
||||
|
||||
$q.dialog({
|
||||
title: 'Genera catalogo',
|
||||
message: 'Sei sicuro di rigenerare il catalogo?',
|
||||
title: 'Rigenera lista',
|
||||
message: 'Sicuri di rigenerare questa lista di libri, perdendo l\'ordinamento attuale ?',
|
||||
cancel: true,
|
||||
persistent: true
|
||||
}).onOk(() => {
|
||||
@@ -1225,6 +1231,29 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function addProductToList(element: IProduct) {
|
||||
// console.log('addProductToList', element)
|
||||
|
||||
if (element) {
|
||||
// add this record to lista_prodotti
|
||||
if (getCatalogoByMyPage.value && !getCatalogoByMyPage.value.lista_prodotti.some((p) => p._id === element._id)) {
|
||||
// inserire il record in cima
|
||||
const arr = getCatalogoByMyPage.value.lista_prodotti
|
||||
arr.unshift(element)
|
||||
|
||||
updateProducts(arr)
|
||||
|
||||
addnewProd.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function clickaddNewBook() {
|
||||
addnewProd.value = true
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -1284,6 +1313,9 @@ export default defineComponent({
|
||||
generaListaLibri,
|
||||
lista_prodotti,
|
||||
updateProducts,
|
||||
clickaddNewBook,
|
||||
addProductToList,
|
||||
addnewProd,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -64,14 +64,23 @@
|
||||
>
|
||||
<q-btn
|
||||
rounded
|
||||
label="Rigenera Lista Libri"
|
||||
label="Rigenera Ordinamento Libri"
|
||||
color="primary"
|
||||
@click="generaListaLibri()"
|
||||
></q-btn>
|
||||
|
||||
<q-btn
|
||||
rounded
|
||||
label="Aggiungi"
|
||||
icon="fas fa-plus"
|
||||
color="primary"
|
||||
@click="clickaddNewBook()"
|
||||
></q-btn>
|
||||
|
||||
<CProductTable
|
||||
:lista_prodotti="lista_prodotti"
|
||||
@update:lista_prodotti="updateProducts"
|
||||
:optcatalogo="optcatalogo"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
@@ -638,6 +647,21 @@
|
||||
|
||||
<!--<div ref="pdfContent" class="pdf-content">-->
|
||||
</q-page>
|
||||
|
||||
<CMyDialog
|
||||
v-model="addnewProd"
|
||||
title="Aggiungi"
|
||||
class="q-ma-md"
|
||||
>
|
||||
<CSearchProduct
|
||||
:visu="shared_consts.VISU_SEARCHPROD_MODE.INSERT"
|
||||
@insert="addProductToList"
|
||||
@close="addnewProd = false"
|
||||
nameLinkTemplate="SEARCH_Prima"
|
||||
:empty="true"
|
||||
>
|
||||
</CSearchProduct>
|
||||
</CMyDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./catalogo.ts"></script>
|
||||
|
||||
@@ -89,7 +89,7 @@ export default defineComponent({
|
||||
const listgroupsfiltered = ref(<IMyGroup[]>[])
|
||||
const listcircuitsfiltered = ref(<IMyCircuit[]>[])
|
||||
|
||||
const tab = ref('attivita')
|
||||
const tab = ref('')
|
||||
|
||||
function profile() {
|
||||
return userStore.my.profile
|
||||
@@ -150,6 +150,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
tab.value = tools.isRisoApp() ? 'attivita' : 'info'
|
||||
loadProfile()
|
||||
}
|
||||
|
||||
|
||||
@@ -666,6 +666,7 @@
|
||||
>
|
||||
<q-tab
|
||||
name="attivita"
|
||||
v-if="tools.isRisoApp()"
|
||||
:label="t('profile.annunci')"
|
||||
icon="fas fa-pencil-alt"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user