- Aggiunta della funzione Cron

- Flag: Pubblicati OnLine + Solo CagalogoGenerale + Dettagli
This commit is contained in:
Surya Paolo
2025-05-07 21:58:05 +02:00
parent 2cc8fcda03
commit 6eb6f236e4
20 changed files with 235 additions and 29 deletions

View File

@@ -38,6 +38,11 @@ export default defineComponent({
required: false,
default: true,
},
isCatalogoGenerale: {
type: Boolean,
required: false,
default: false,
},
heightcarousel: {
type: String,
required: false,

View File

@@ -25,7 +25,7 @@
:noresultLabel="t('grid.nosearchfound')"
:arrfilters="arrfilterand"
:filtercustom="filtercustom"
:prop_searchList="tools.getsearchList_Cataloghi()"
:prop_searchList="tools.getsearchList_Cataloghi(isCatalogoGenerale)"
:defaultnewrec="tools.getdefaultnewrec(table)"
labelBtnAddRow="NONE"
:prop_SortFieldsAvailable="mySortFieldsAvailable()"

View File

@@ -49,6 +49,11 @@ export default defineComponent({
required: false,
default: true,
},
isCatalogoGenerale: {
type: Boolean,
required: false,
default: false,
},
prop_modif: {
type: Boolean,
required: false,
@@ -645,7 +650,7 @@ export default defineComponent({
]
searchList_Cataloghi.value = tools.getsearchList_Cataloghi()
searchList_Cataloghi.value = tools.getsearchList_Cataloghi(isCatalogoGenerale)
searchList_Hosp.value = [
{

View File

@@ -2837,6 +2837,15 @@ export default defineComponent({
}
}
function getisDettagliByCatalog() {
const rec = searchList.value.find((myrec) => myrec.table === shared_consts.TABLES_CATALOG && myrec.key === 'dettagli')
if (rec) {
return rec.value
}
return false
}
created()
@@ -2973,6 +2982,7 @@ export default defineComponent({
loadMore,
onIntersection,
showfilteradv,
getisDettagliByCatalog,
}
}
})

View File

@@ -569,6 +569,7 @@
v-else-if="tablesel === shared_consts.TABLES_CATALOG"
:table="tablesel"
:prop_myrec="row"
:dettagli="getisDettagliByCatalog()"
:opt="opt"
@cmdext="cmdExt"
:editOn="editOn"
@@ -910,6 +911,13 @@
</q-item>
</template>
</q-select>
<q-toggle
v-else-if="item.type === costanti.FieldType.boolean"
:label="item.label"
v-model="item.value"
@update:model-value="refresh"
color="green"
/>
</span>
</div>

View File

@@ -210,7 +210,8 @@
addstr="px"
@update:model-value="modifElem"
></CMySlider>
</div>
<div class="row">
<CMySlider
label="Altezza:"
v-model="myel.heightimg"
@@ -220,6 +221,8 @@
addstr="px"
@update:model-value="modifElem"
></CMySlider>
</div>
<div class="row">
<CMySlider
v-if="
myel.type === shared_consts.ELEMTYPE.CARD ||
@@ -234,7 +237,8 @@
addstr="px"
@update:model-value="modifElem"
></CMySlider>
</div>
<div class="row">
<CMySlider
v-if="myel.type === shared_consts.ELEMTYPE.CATALOGLIST"
label="Lunghezza Card:"
@@ -245,9 +249,10 @@
addstr="px"
@update:model-value="modifElem"
></CMySlider>
</div>
<div class="row">
<CMySlider
v-if="myel.heightcard !== undefined"
v-if="myel.type === shared_consts.ELEMTYPE.CATALOGLIST"
label="Altezza Card:"
v-model="myel.heightcard"
:min="10"
@@ -1418,6 +1423,12 @@
label="Finder"
@update:model-value="modifElem"
></q-toggle>
<q-toggle
v-model="myel.parambool3"
color="positive"
label="Solo il Catalogo Generale"
@update:model-value="modifElem"
></q-toggle>
</div>
</div>
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CALENDAR">

View File

@@ -356,13 +356,15 @@
<q-tab-panels v-model="tabcatalogo" animated keep-alive>
<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>
</q-tab-panel>
<q-tab-panel name="griglia">
<CCatalogList :prop_search="myel.parambool" :finder="myel.parambool2"
:heightcarousel="myel.heightcarousel" :heightimg="myel.heightimg" :widthimg="myel.widthimg"
:heightcard="myel.heightcard" :widthcard="myel.widthcard">
:heightcard="myel.heightcard" :widthcard="myel.widthcard"
:isCatalogoGenerale="myel.parambool3">
</CCatalogList>
</q-tab-panel>
<q-tab-panel name="tutorial">

View File

@@ -38,6 +38,11 @@ export default defineComponent({
required: false,
default: false,
},
dettagli: {
type: Boolean,
required: false,
default: false,
},
margin_right: {
type: Number,
required: false,

View File

@@ -3,14 +3,9 @@
<q-card
v-if="myrec"
bordered
:style="`width: ` + opt.widthcard + `; ` + (opt.heightcard ? `height: ` + opt.heightcard + `; ` : '')"
:style="`width: ` + opt.widthcard + `; ` + (opt.heightcard ? `height: ` + opt.heightcard + `;`: '')"
>
<!--<q-skeleton
v-if="!myrec.foto_collana"
type="QAvatar"
:width="opt.widthcard"
:height="opt.heightcard"
/>-->
<q-img
:width="opt.widthimg"
@click="naviga(pagina_collegata)"
@@ -27,9 +22,9 @@
</div>-->
</q-img>
<q-card-section>
<q-card-section class="q-px-sm">
<div
class="q-mb-sm text-center text-bold"
class="q-mb-md text-center text-bold"
style="font-size: 1.15rem"
>
<a
@@ -38,13 +33,13 @@
>{{ myrec.title }}</a
>
</div>
<div class="">
<div class="q-px-md">
<div class="text-caption text-h7 text-grey q-pb-xs">
<q-icon name="fas fa-list-ol" /> {{ $t('cataloglist.numprodotti') }}:
<span :class="`text-` + (numprodottistr === 0 ? 'red' : 'blue')">{{ numprodottistr }}</span>
</div>
<div
v-if="!tools.isUtente()"
v-if="!tools.isUtente() && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-user" /> {{ $t('cataloglist.referenti') }}:
@@ -59,28 +54,28 @@
</span>
</div>
<div
v-if="collanestr"
v-if="!tools.isUtente() && collanestr && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-book" /> {{ t('cataloglist.collane') }}:
<span class="text-blue">{{ collanestr }}</span>
</div>
<div
v-if="!tools.isUtente() && argomentistr"
v-if="!tools.isUtente() && argomentistr && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-book" /> {{ $t('cataloglist.argomenti') }}:
<span class="text-blue">{{ argomentistr + ` (${numprodtot})` }}</span>
</div>
<div
v-if="!tools.isUtente() && editorestr"
v-if="!tools.isUtente() && editorestr && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-book-open" /> {{ $t('cataloglist.casaeditrice') }}:
<span class="text-blue">{{ editorestr }}</span>
</div>
<div
v-if="!tools.isUtente() && !esiste_descrintro"
v-if="!tools.isUtente() && !esiste_descrintro && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-pencil-alt" /> Testo descrittivo:
@@ -89,7 +84,7 @@
}}</span>
</div>
<div
v-if="!tools.isUtente() && !myrec.img_bordata?.imagefile"
v-if="!tools.isUtente() && !myrec.img_bordata?.imagefile && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-image" /> Sfondo:
@@ -98,7 +93,7 @@
}}</span>
</div>
<div
v-if="!tools.isUtente() && !myrec.img_intro?.imagefile"
v-if="!tools.isUtente() && !myrec.img_intro?.imagefile && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-image" /> Copertina:
@@ -119,7 +114,7 @@
(Data: {{ tools.getstrDate(myrec.data_generato) }})
</div>
<div
v-if="!tools.isUtente()"
v-if="!tools.isUtente() && dettagli"
class="text-caption text-h7 text-grey q-pb-xs"
>
<q-icon name="fas fa-list" /> Lista generata il:
@@ -145,9 +140,9 @@
</q-card-section>
<q-card-actions
v-if="!tools.isUtente() && dettagli"
align="center"
class="q-pa-none"
style="position: absolute; bottom: 0; width: 100%"
>
<div class="row justify-center">
<q-fab

View File

@@ -133,6 +133,16 @@ export interface IMyBot {
date_updated?: Date
}
export interface IListaCron {
active?: boolean
descr?: string
nomeFunzioneDbOp?: string
startTime?: string
everyXMinutes?: number
lastJobEnd?: Date
log?: string
}
export interface IMyElem {
_id?: string
type?: number
@@ -500,6 +510,7 @@ export interface IGlobalState {
gallery: IGallery[],
mypage: IMyPage[],
myelems: IMyElem[],
lista_cron: IListaCron[],
myschedas: ISchedaSingola[],
templemail: ITemplEmail[],
destnewsletter?: IDestNewsletter[],

View File

View File

@@ -0,0 +1,42 @@
import { defineComponent, ref, onMounted, computed, watch } from 'vue'
import { CImgText } from '../../../components/CImgText/index'
import { CCard } from '@src/components/CCard'
import { CMyPage } from '@src/components/CMyPage'
import { CTitleBanner } from '@src/components/CTitleBanner'
import { CGridTableRec } from '@src/components/CGridTableRec'
import { colcrons } from '@src/store/Modules/fieldsTable'
import MixinMetaTags from '@src/mixins/mixin-metatags'
import { tools } from '@tools'
import { shared_consts } from '@src/common/shared_vuejs'
import { IMyPage } from 'model'
import { useGlobalStore } from '@store/globalStore'
import objectId from '@src/js/objectId'
export default defineComponent({
name: 'ListaCron',
setup() {
const { setmeta } = MixinMetaTags()
const globalStore = useGlobalStore()
const lista_cron = ref([] as any[])
function mounted() {
// lista_cron.value = globalStore.lista_cron
}
onMounted(mounted)
return {
colcrons,
setmeta,
lista_cron,
}
},
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec }
})

View File

@@ -0,0 +1,27 @@
ù<template>
<CMyPage title="Lista Cron" imgbackground="/images/calendario_eventi.jpg" sizes="max-height: 120px">
<span>{{
setmeta({
title: 'Lista Cron',
description: '',
keywords: '',
})
}}
</span>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CTitleBanner title="Lista Cron"></CTitleBanner>
<CGridTableRec prop_mytable="crons" prop_mytitle="Lista Cron" :prop_mycolumns="colcrons"
:filtercustom="filtercustom" prop_colkey="title" nodataLabel="Nessun cron"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
</CGridTableRec>
</div>
</CMyPage>
</template>
<script lang="ts" src="./lista_cron.ts">
</script>
<style lang="scss" scoped>
@import 'lista_cron.scss';
</style>

View File

@@ -344,6 +344,19 @@ function getRoutesAd(site: ISites) {
level_child: 0.5,
onlyAdmin: true,
},
{
active: true,
order: 32,
path: '/admin/lista_crons',
materialIcon: 'fas fa-clock',
name: 'otherpages.admin.lista_cron',
component: () => import('@src/rootgen/admin/lista_cron/lista_cron.vue'),
inmenu: true,
submenu: true,
level_parent: 0,
level_child: 0.5,
onlyAdmin: true,
},
{
active: true,
order: 30,

View File

@@ -174,6 +174,7 @@ const msg_it = {
pages: 'Pagine',
Home: 'Pagina Home',
elems: 'Elementi Pagine',
lista_cron: 'Lista Cron',
operators: 'Operatori',
disciplines: 'Discipline',
media: 'Media',
@@ -2047,6 +2048,7 @@ const msg_it = {
img_bordata_stampa: 'Immagine di sfondo (per STAMPA)',
img_intro_stampa: 'Copertina introduttiva (per STAMPA)',
pagina_introduttiva_sfondo_nero: 'Pagina intro a sfondo nero',
isCatalogoGenerale: 'Fa parte del Catalogo Generale',
collane: 'Collane',
idPageAssigned: 'Pagina Assegnata',
idPageAssigned_stampa: 'Pagina Assegnata (per STAMPA)',
@@ -2094,7 +2096,20 @@ const msg_it = {
destnewsletter: {
descr: 'Descrizione',
tipodest_id: 'Tipo Destinatario',
}
},
cron: {
active: 'Attivato',
descr: 'Descrizione',
nomeFunzioneDbOp: 'Nome Funzione DB',
startTime: 'Ora Inizio',
everyXMinutes: 'Ogni X Minuti',
quanteVolteEseguiAlGG: 'Tot al GG',
lastJobStarted: 'Ultimo Job Iniziato',
lastJobEnd: 'Ultimo Job Completato',
eseguito: 'Eseguito',
status: 'Stato',
},
},
};

View File

@@ -147,6 +147,7 @@ export const colTableCatalogList = [
fieldtype: costanti.FieldType.select,
jointable: 'mypages_id',
}),
AddCol({ name: 'isCatalogoGenerale', label_trans: 'cataloglist.isCatalogoGenerale', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'argomenti',
label_trans: 'cataloglist.argomenti',
@@ -370,6 +371,21 @@ export const colmyelCatalogo = [
]
export const colcrons = [
AddCol({ name: 'active', label_trans: 'cron.active', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'descr', label_trans: 'cron.descr', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'status', label_trans: 'cron.status', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'nomeFunzioneDbOp', label_trans: 'cron.nomeFunzioneDbOp', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'startTime', label_trans: 'cron.startTime', fieldtype: costanti.FieldType.string }),
AddCol({ name: 'everyXMinutes', label_trans: 'cron.everyXMinutes', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'quanteVolteEseguito', label_trans: 'cron.eseguito', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'quanteVolteEseguiAlGG', label_trans: 'cron.quanteVolteEseguiAlGG', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'lastJobStarted', label_trans: 'cron.lastJobStarted', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'lastJobEnd', label_trans: 'cron.lastJobEnd', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'log', label_trans: 'cron.log', fieldtype: costanti.FieldType.string }),
// AddCol({ name: 'date_created', label_trans: 'cron.date_created', fieldtype: costanti.FieldType.date }),
]
export const colmyelems = [
AddCol({ name: 'active', label_trans: 'myelems.active', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'path', label_trans: 'myelems.path' }),
@@ -4603,6 +4619,13 @@ export const fieldsTable = {
colkey: '_id',
collabel: 'title',
},
{
value: 'crons',
label: 'Lista Cron',
columns: colcrons,
colkey: '_id',
collabel: 'title',
},
{
value: 'catalogo',
label: 'Elementi Catalogo',

View File

@@ -9828,7 +9828,7 @@ export const tools = {
return (!userStore.isEditor && !userStore.isCommerciale && !userStore.isAdmin && !userStore.isManager & !userStore.isGrafico)
},
getsearchList_Cataloghi() {
getsearchList_Cataloghi(isCatalogoGenerale: boolean) {
const lista = [
{
visible: !this.isUtente(),
@@ -9857,6 +9857,34 @@ export const tools = {
useinput: false,
icon: 'fas fa-globe'
},
{
visible: !this.isUtente(),
label: 'Solo Catalogo Generale',
key: 'isCatalogoGenerale',
type: costanti.FieldType.boolean,
value: this.isUtente() ? isCatalogoGenerale: this.getCookie(this.COOK_SEARCH + costanti.FILTER_SEP + shared_consts.TABLES_CATALOG + costanti.FILTER_SEP + 'isCatalogoGenerale', isCatalogoGenerale),
keycookie: '',
addall: true,
arrvalue: [],
filter: null,
useinput: false,
icon: 'fas fa-bookmark'
},
{
visible: !this.isUtente(),
label: 'Dettagli',
table: shared_consts.TABLES_CATALOG,
key: 'dettagli',
notinsearch: true, // non usarlo nella ricerca filtro
type: costanti.FieldType.boolean,
value: this.isUtente() ? false: this.getCookie(this.COOK_SEARCH + costanti.FILTER_SEP + shared_consts.TABLES_CATALOG + costanti.FILTER_SEP + 'dettagli', true),
keycookie: '',
addall: true,
arrvalue: [],
filter: null,
useinput: false,
icon: 'fas fa-info-circle'
},
]
console.log('getsearchList_Cataloghi', lista)

View File

@@ -88,6 +88,7 @@ export const toolsext = {
TABGROUPS: 'groups',
TABMYPAGE: 'mypages',
TABMYELEMS: 'myelems',
TABCRONS: 'crons',
TABMYBOT: 'bots',
TABCALZOOM: 'calzoom',
TABTEMPLEMAIL: 'templemail',

View File

@@ -1891,8 +1891,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (page.loadFirst)
page.loaded = true
}
this.myelems = []
this.myelems = (res.data.myelems) ? [...res.data.myelems] : []
this.crons = (res.data.crons) ? [...res.data.crons] : []
this.myschedas = []
this.myschedas = (res.data.myschedas) ? [...res.data.myschedas] : []
// console.log('this.mypage', this.mypage)

View File

@@ -47,6 +47,11 @@
color="accent"
@click="EseguiFunz('updateAllBook', {usaDBGMLocale: false, caricatutti: true})"
></q-btn>
<q-btn
label="Riaggiorna TUTTI gli ARTICOLI da GM SERVER e Rimuovi Cancellati !"
color="negative"
@click="EseguiFunz('updateAllBook', {usaDBGMLocale: false, caricatutti: true, rimuovieventualiCancellati: true})"
></q-btn>
<q-btn
label="Riaggiorna TUTTI gli ARTICOLI dal DB Locale Importato"
color="accent"