- 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,
},
{
active: true,
active: site.confpages && site.confpages.showProfile,
order: 120,
path: '/editprofile',
materialIcon: 'fas fa-user',
@@ -273,16 +273,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: 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,
order: 80,

View File

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

View File

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

View File

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

View File

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

View File

@@ -90,7 +90,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true,
},
{
active: true,
active: site.confpages && site.confpages.enableEvents,
order: 20,
path: '/events',
materialIcon: 'fas fa-bullhorn',
@@ -112,7 +112,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false,
},
{
active: true,
active: site.confpages && site.confpages.showProfile,
order: 120,
path: '/myprofile',
materialIcon: 'fas fa-user',
@@ -123,7 +123,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: true,
},
{
active: true,
active: site.confpages && site.confpages.showProfile,
order: 120,
path: '/editprofile',
materialIcon: 'fas fa-user',
@@ -134,7 +134,7 @@ function getDynamicPages(site: ISites): IListRoutes[] {
infooter: false,
},
{
active: true,
active: site.confpages && site.confpages.showiscrittiMenu,
order: 130,
path: '/friends',
materialIcon: 'fas fa-user-friends',
@@ -229,16 +229,6 @@ function getDynamicPages(site: ISites): IListRoutes[] {
inmenu: 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,
order: 80,

View File

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

View File

@@ -1279,12 +1279,14 @@ export const useProducts = defineStore('Products', {
const description = myproduct.productInfo.short_descr || '';
const long_descr = myproduct.productInfo.description || '';
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 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 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
? description.substring(0, description.lastIndexOf(' ', maxDescriptionLength)) + '...'

View File

@@ -431,7 +431,7 @@ export default defineComponent({
} else if (sort === costanti.SORT_BESTSELLER) {
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) => {

View File

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