- risolto Ordinamento Bestseller (a 6 mesi ora)

- EditOn anche per gli Editori
This commit is contained in:
Surya Paolo
2024-12-17 21:38:21 +01:00
parent 7619ce5b51
commit ce86dd51a8
10 changed files with 41 additions and 36 deletions

View File

@@ -167,7 +167,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true, infooter: true,
}, },
{ {
active: true, active: site.confpages && site.confpages.showProfile,
order: 120, order: 120,
path: '/editprofile', path: '/editprofile',
materialIcon: 'fas fa-user', materialIcon: 'fas fa-user',
@@ -273,16 +273,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: false, inmenu: false,
infooter: false, infooter: false,
}, },
{
active: true,
order: 150,
path: '/fundraising',
materialIcon: 'fas fa-hand-holding-heart',
name: 'pages.fundraising',
component: () => import('@src/root/fundraising/fundraising.vue'),
inmenu: false,
infooter: false,
},
{ {
active: true, active: true,
order: 80, order: 80,

View File

@@ -120,7 +120,7 @@
</a> </a>
<q-btn <q-btn
v-if=" v-if="
tools.isManager() && (tools.isManager() || tools.isEditor()) &&
!optcatalogo.generazionePDFInCorso && !optcatalogo.generazionePDFInCorso &&
globalStore.editOn globalStore.editOn
" "
@@ -321,7 +321,7 @@
:myproduct="myproduct" :myproduct="myproduct"
:optcatalogo="optcatalogo" :optcatalogo="optcatalogo"
></CText> ></CText>
<div v-if="optcatalogo.indebug">testo: "{{ getTesto_Bottom }}"</div> <!--<div v-if="optcatalogo.indebug">testo: "{{ getTesto_Bottom }}"</div>-->
</div> </div>
</q-card-section> </q-card-section>
<q-separator v-if="complete" class="q-my-sm"></q-separator> <q-separator v-if="complete" class="q-my-sm"></q-separator>
@@ -729,7 +729,7 @@
table="productinfos" table="productinfos"
:id="myproduct.productInfo._id" :id="myproduct.productInfo._id"
:rec="myproduct.productInfo" :rec="myproduct.productInfo"
mykey="vLastM" mykey="vLast3M"
debounce="1000" debounce="1000"
:save="updateproductmodif()" :save="updateproductmodif()"
:type="costanti.FieldType.number" :type="costanti.FieldType.number"
@@ -747,6 +747,18 @@
:type="costanti.FieldType.number" :type="costanti.FieldType.number"
> >
</CMyValueDb> </CMyValueDb>
<div class="etichetta">Venduti Ultimo Anno:</div>
<CMyValueDb
:editOn="modifOn"
table="productinfos"
:id="myproduct.productInfo._id"
:rec="myproduct.productInfo"
mykey="vLastY"
debounce="1000"
:save="updateproductmodif()"
:type="costanti.FieldType.number"
>
</CMyValueDb>
<CLabel <CLabel
:value="myproduct.indiceRanking" :value="myproduct.indiceRanking"
label="N° in Classifica:" label="N° in Classifica:"

View File

@@ -2,7 +2,7 @@
<div v-if="tools.isDebugOn()"></div> <div v-if="tools.isDebugOn()"></div>
<div :class="$q.screen.lt.sm ? `` : `q-pa-xs`" v-if="isfinishLoading"> <div :class="$q.screen.lt.sm ? `` : `q-pa-xs`" v-if="isfinishLoading">
<q-toggle <q-toggle
v-if="tools.isManager() && !showMap && editOn" v-if="(tools.isManager() || tools.isEditor()) && !showMap && editOn"
v-model="editOn" v-model="editOn"
color="green" color="green"
icon="fas fa-pencil-alt" icon="fas fa-pencil-alt"

View File

@@ -191,6 +191,9 @@ export default defineComponent({
function isManager() { function isManager() {
return userStore.isManager return userStore.isManager
} }
function isEditor() {
return userStore.isEditor
}
const isSocio = computed(() => userStore.my.profile.socio) const isSocio = computed(() => userStore.my.profile.socio)
@@ -630,6 +633,7 @@ export default defineComponent({
products, products,
userStore, userStore,
clickMenu3Orizz, clickMenu3Orizz,
isEditor,
} }
}, },

View File

@@ -71,7 +71,7 @@
<q-toggle :icon="'fas fa-moon'" v-model="dark"> </q-toggle> <q-toggle :icon="'fas fa-moon'" v-model="dark"> </q-toggle>
</div> </div>
<div <div
v-if="tools.isLogged() && isAdmin()" v-if="tools.isLogged() && (isAdmin() || tools.isEditor())"
class="text-h7" class="text-h7"
> >
<q-toggle :icon="'fas fa-pencil-alt'" v-model="globalStore.editOn"> </q-toggle> <q-toggle :icon="'fas fa-pencil-alt'" v-model="globalStore.editOn"> </q-toggle>
@@ -346,6 +346,12 @@
> >
Segreteria Segreteria
</div> </div>
<div
v-if="isEditor()"
class="text-weight-bold text-user bg-indigo q-px-xs"
>
Editore
</div>
<div <div
v-if="isFacilitatore()" v-if="isFacilitatore()"
class="text-weight-bold text-user q-px-xs" class="text-weight-bold text-user q-px-xs"

View File

@@ -90,7 +90,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true, infooter: true,
}, },
{ {
active: true, active: site.confpages && site.confpages.enableEvents,
order: 20, order: 20,
path: '/events', path: '/events',
materialIcon: 'fas fa-bullhorn', materialIcon: 'fas fa-bullhorn',
@@ -112,7 +112,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false, infooter: false,
}, },
{ {
active: true, active: site.confpages && site.confpages.showProfile,
order: 120, order: 120,
path: '/myprofile', path: '/myprofile',
materialIcon: 'fas fa-user', materialIcon: 'fas fa-user',
@@ -123,7 +123,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true, infooter: true,
}, },
{ {
active: true, active: site.confpages && site.confpages.showProfile,
order: 120, order: 120,
path: '/editprofile', path: '/editprofile',
materialIcon: 'fas fa-user', materialIcon: 'fas fa-user',
@@ -134,7 +134,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false, infooter: false,
}, },
{ {
active: true, active: site.confpages && site.confpages.showiscrittiMenu,
order: 130, order: 130,
path: '/friends', path: '/friends',
materialIcon: 'fas fa-user-friends', materialIcon: 'fas fa-user-friends',
@@ -229,16 +229,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: false, inmenu: false,
infooter: false, infooter: false,
}, },
{
active: true,
order: 150,
path: '/fundraising',
materialIcon: 'fas fa-hand-holding-heart',
name: 'pages.fundraising',
component: () => import('@src/root/fundraising/fundraising.vue'),
inmenu: false,
infooter: false,
},
{ {
active: true, active: true,
order: 80, order: 80,

View File

@@ -45,7 +45,7 @@ export interface IProductInfo {
short_descr: string short_descr: string
totVen?: number, totVen?: number,
vLastM?: number, vLast3M?: number,
vLast6M?: number, vLast6M?: number,
vLastY?: number, vLastY?: number,
vLast2Y?: number, vLast2Y?: number,
@@ -71,6 +71,7 @@ export interface IVariazione {
availability?: number availability?: number
formato?: string formato?: string
misure?: string misure?: string
pagine?: number
tipologia?: string tipologia?: string
edizione?: string edizione?: string
preOrderDate?: Date preOrderDate?: Date

View File

@@ -1279,12 +1279,14 @@ export const useProducts = defineStore('Products', {
const description = myproduct.productInfo.short_descr || ''; const description = myproduct.productInfo.short_descr || '';
const long_descr = myproduct.productInfo.description || ''; const long_descr = myproduct.productInfo.description || '';
const date_pub = tools.getstrDateShort(myproduct.productInfo.date_pub) || ''; const date_pub = tools.getstrDateShort(myproduct.productInfo.date_pub) || '';
const ranking_globale = myproduct.productInfo.rank1Y! || 0; const vLast3M = myproduct.productInfo.vLast3M! || 0;
const vLast6M = myproduct.productInfo.vLast6M! || 0;
const ranking_globale = myproduct.productInfo.rank3M! || 0;
const ranking = myproduct.indiceRanking! || 0; const ranking = myproduct.indiceRanking! || 0;
const venduti = myproduct.productInfo.totVen! || 0; const venduti = myproduct.productInfo.totVen! || 0;
const linkvenduti = '<a href="http://vps-88271abb.vps.ovh.net/apimacro/public/view-ordini-by-idarticolo/' + myproduct.productInfo.sku + '" target="_blank">'+venduti+'</a>' 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 debugstr = " Rank=" + ranking + "<br> Rank3M=" + (myproduct.productInfo.rank3M! || '') + '<br> Venduti=' + linkvenduti + '<br>vLast3M= ' + vLast3M + '<br>vLast6M= ' + vLast6M + ' <br> Data Pubb=' + date_pub
const truncatedDescription = description.length > maxDescriptionLength const truncatedDescription = description.length > maxDescriptionLength
? description.substring(0, description.lastIndexOf(' ', maxDescriptionLength)) + '...' ? description.substring(0, description.lastIndexOf(' ', maxDescriptionLength)) + '...'

View File

@@ -431,7 +431,7 @@ export default defineComponent({
} else if (sort === costanti.SORT_BESTSELLER) { } else if (sort === costanti.SORT_BESTSELLER) {
arrprod = arrprod.sort((a: IProduct, b: IProduct) => { arrprod = arrprod.sort((a: IProduct, b: IProduct) => {
return b.productInfo.rank3M! - a.productInfo.rank3M! return b.productInfo.vLast6M! - a.productInfo.vLast6M!
}) })
arrprod = arrprod.map((product, index) => { arrprod = arrprod.map((product, index) => {

View File

@@ -1,7 +1,7 @@
<template> <template>
<q-page> <q-page>
<q-tabs <q-tabs
v-if="optcatalogo.pdf" v-if="optcatalogo.pdf && tools.isEditor()"
v-model="tabcatalogo" v-model="tabcatalogo"
dense dense
class="bg-green text-white" class="bg-green text-white"
@@ -330,7 +330,7 @@
<!-- Itera sui prodotti di ogni riga --> <!-- Itera sui prodotti di ogni riga -->
<div class="row justify-center"> <div class="row justify-center">
<span v-if="optcatalogo.indebug">{{getStyleSchedaProdotto(recscheda)}}</span> <!--<span v-if="optcatalogo.indebug">{{getStyleSchedaProdotto(recscheda)}}</span>-->
<div <div
v-for="(prod, colIndex) in row" v-for="(prod, colIndex) in row"
:key="`${pageIndex}-${rowIndex}-${colIndex}`" :key="`${pageIndex}-${rowIndex}-${colIndex}`"