Pannello Utente
Aggiornamento Yarn
This commit is contained in:
@@ -89,6 +89,7 @@ function AddCol(params: IColGridTable) {
|
||||
remote_key: (params.remote_key === undefined) ? '' : params.remote_key,
|
||||
remote_field: (params.remote_field === undefined) ? '' : params.remote_field,
|
||||
maxlength: (params.maxlength === undefined) ? 0 : params.maxlength,
|
||||
minlength: (params.minlength === undefined) ? 0 : params.minlength,
|
||||
filter_field: (params.filter_field === undefined) ? '' : params.filter_field,
|
||||
isadvanced_field: (params.isadvanced_field === undefined) ? false : params.isadvanced_field,
|
||||
}
|
||||
@@ -687,6 +688,14 @@ export const colmyGoods = [
|
||||
required: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
minlength: 50,
|
||||
isadvanced_field: true,
|
||||
required: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idSectorGood',
|
||||
label_trans: 'sectors.name',
|
||||
@@ -784,12 +793,6 @@ export const colmyGoods = [
|
||||
|
||||
*/
|
||||
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
//**ADDFIELD_MYSKILL
|
||||
AddCol({
|
||||
name: 'website', label_trans: 'reg.website', isadvanced_field: true, fieldtype: costanti.FieldType.link,
|
||||
@@ -864,6 +867,13 @@ export const colmySkills = [
|
||||
required: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
required: true,
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idSector',
|
||||
label_trans: 'sectors.name',
|
||||
@@ -952,12 +962,6 @@ export const colmySkills = [
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
isadvanced_field: true,
|
||||
}),
|
||||
//**ADDFIELD_MYSKILL
|
||||
AddCol({
|
||||
name: 'website', label_trans: 'reg.website', isadvanced_field: true, fieldtype: costanti.FieldType.link,
|
||||
@@ -1076,6 +1080,14 @@ export const colmyHosp = [
|
||||
required: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
isadvanced_field: true,
|
||||
required: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'photos',
|
||||
label_trans: 'skill.photos',
|
||||
@@ -1086,13 +1098,6 @@ export const colmyHosp = [
|
||||
isadvanced_field: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
isadvanced_field: true,
|
||||
sortable: false,
|
||||
}),
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
AddCol({
|
||||
name: 'link_maplocation', label_trans: 'reg.link_maplocation', isadvanced_field: true, fieldtype: costanti.FieldType.link,
|
||||
@@ -1194,6 +1199,14 @@ export const colmyBachecas = [
|
||||
required: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
required: true,
|
||||
isadvanced_field: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idSector',
|
||||
label_trans: 'sectors.name',
|
||||
@@ -1257,13 +1270,6 @@ export const colmyBachecas = [
|
||||
isadvanced_field: true,
|
||||
sortable: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
isadvanced_field: true,
|
||||
sortable: false,
|
||||
}),
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
AddCol({
|
||||
name: 'website', label_trans: 'reg.website', isadvanced_field: true, fieldtype: costanti.FieldType.link,
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ITodo,
|
||||
IUserFields,
|
||||
Privacy,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport,
|
||||
} from '@model'
|
||||
|
||||
import { addToDate } from '@quasar/quasar-ui-qcalendar'
|
||||
@@ -1945,8 +1945,8 @@ export const tools = {
|
||||
this.showNotif(q, msg, { color: 'positive', icon: 'notifications' })
|
||||
},
|
||||
|
||||
showNegativeNotif(q: any, msg: string) {
|
||||
this.showNotif(q, msg, { color: 'negative', icon: 'notifications' }, 10000)
|
||||
showNegativeNotif(q: any, msg: string, time = 5000) {
|
||||
this.showNotif(q, msg, { color: 'negative', icon: 'notifications' }, time)
|
||||
},
|
||||
|
||||
showNeutralNotif(q: any, msg: string, time = 10000) {
|
||||
@@ -3022,7 +3022,7 @@ export const tools = {
|
||||
},
|
||||
|
||||
loginOk($router: Router, route: any, mythisq: any, ispageLogin: boolean) {
|
||||
// console.log('loginOk')
|
||||
console.log('loginOk')
|
||||
const userStore = useUserStore()
|
||||
|
||||
if (toolsext.getLocale() !== '') {
|
||||
@@ -5487,6 +5487,63 @@ export const tools = {
|
||||
return []
|
||||
},
|
||||
|
||||
loadrecProfile() {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const params: any = {
|
||||
table: 'exp',
|
||||
userId: userStore.my._id
|
||||
}
|
||||
|
||||
console.log('loadrecProfile', params)
|
||||
|
||||
return globalStore.loadExp(params)
|
||||
|
||||
},
|
||||
|
||||
async exportListaEmail() {
|
||||
|
||||
let myrec = await this.loadrecProfile()
|
||||
|
||||
const sep = ';'
|
||||
|
||||
let mystr = ''
|
||||
|
||||
mystr += 'username' + sep + 'username_telegram' + sep + 'nome_telegram' + sep + 'cognome_telegram' + sep + 'email' + sep + 'verificato_telegram' + sep + 'verificato_invitante' + '\n'
|
||||
let index = 1
|
||||
for (const rec of myrec) {
|
||||
mystr += rec.username + sep
|
||||
mystr += rec.profile.username_telegram + sep
|
||||
mystr += rec.profile.firstname_telegram + sep
|
||||
mystr += rec.profile.lastname_telegram + sep
|
||||
mystr += rec.email + sep
|
||||
mystr += (rec.profile.teleg_id) ? 'SI' : 'NO'
|
||||
mystr += (rec.verified_by_aportador) ? 'SI' : 'NO'
|
||||
mystr += '\n'
|
||||
index++
|
||||
}
|
||||
|
||||
// tools.copyStringToClipboard(this, mystr, false)
|
||||
|
||||
return mystr
|
||||
},
|
||||
|
||||
get_SI_NO(myvalue: boolean) {
|
||||
return myvalue ? 'SI' : 'NO'
|
||||
},
|
||||
|
||||
getvalueAll(myval: string | Date) {
|
||||
const mydate = new Date(myval);
|
||||
if (mydate instanceof Date && !isNaN(mydate.valueOf())) {
|
||||
return this.getstrDateTime(mydate)
|
||||
} else {
|
||||
return myval
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// getLocale() {
|
||||
// if (navigator.languages && navigator.languages.length > 0) {
|
||||
|
||||
87
src/store/NotifStore.ts
Executable file
87
src/store/NotifStore.ts
Executable file
@@ -0,0 +1,87 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { Api } from '@api'
|
||||
|
||||
import { serv_constants } from './Modules/serv_constants'
|
||||
|
||||
import { INotif, INotifState } from '../model'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
import { NotifDefault } from '@src/model'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
export const useNotifStore = defineStore('NotifStore', {
|
||||
state: (): INotifState => ({
|
||||
last_notifs: [],
|
||||
}),
|
||||
|
||||
getters: {
|
||||
|
||||
getlasts_notifs: (mystate: INotifState) => (): INotif[] => {
|
||||
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 5) : []
|
||||
// const ctrec = (mystate.notifs) ? mystate.notifs.slice().reverse().slice(0, 5) : []
|
||||
return (ctrec)
|
||||
|
||||
},
|
||||
|
||||
getnumNotifUnread: (mystate: INotifState) => () => {
|
||||
return mystate.last_notifs.filter((notif) => !notif.read).length
|
||||
},
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
setNotif(notif: INotif) {
|
||||
// console.log('arrnotif', arrnotif)
|
||||
if (notif) {
|
||||
this.last_notifs = [notif, ...this.last_notifs]
|
||||
}
|
||||
},
|
||||
|
||||
async updateNotifDataFromServer({ username, lastdataread }: {username: string, lastdataread: Date}) {
|
||||
// console.log('updateNotifDataFromServer', username, lastdataread)
|
||||
|
||||
return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null)
|
||||
.then((res) => {
|
||||
// console.log('res', res)
|
||||
return true
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
|
||||
async SendNotifEvent(notif: INotif) {
|
||||
console.log('SendNotifEvent', notif)
|
||||
|
||||
const data: INotif = { ...NotifDefault, ...notif }
|
||||
|
||||
data.idapp = process.env.APP_ID
|
||||
data.type = notif.type
|
||||
data.sender = notif.sender
|
||||
data.dest = notif.dest
|
||||
data.descr = notif.descr
|
||||
data.datenotif = tools.getDateNow()
|
||||
data.read = false
|
||||
|
||||
// console.log('DOPO:')
|
||||
// console.table(data)
|
||||
|
||||
return Api.SendReq('/sendnotif', 'POST', data)
|
||||
.then((res) => {
|
||||
// console.log('res', res)
|
||||
if (res.status === 200) {
|
||||
if (res.data.code === serv_constants.RIS_CODE_OK) {
|
||||
this.setNotif(res.data)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -991,6 +991,21 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async loadUserPanel(username: string) {
|
||||
const data = {
|
||||
username
|
||||
}
|
||||
|
||||
return Api.SendReq('/users/panel', 'POST', data)
|
||||
.then((ris) => {
|
||||
console.log('out:', ris)
|
||||
return ris.data
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
async loadGroup(groupname: string) {
|
||||
const data = {
|
||||
groupname
|
||||
|
||||
@@ -30,6 +30,7 @@ import urlBase64ToUint8Array from '@src/js/utility'
|
||||
import translate from '@src/globalroutines/util'
|
||||
import { useTodoStore } from '@store/Todos'
|
||||
import { useMessageStore } from './MessageStore'
|
||||
import { useNotifStore } from './NotifStore'
|
||||
|
||||
|
||||
const stateConnDefault = 'online'
|
||||
@@ -201,6 +202,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
const calendarStore = useCalendarStore()
|
||||
const userStore = useUserStore()
|
||||
const messageStore = useMessageStore()
|
||||
const notifStore = useNotifStore()
|
||||
|
||||
if (table === costanti.TABEVENTS)
|
||||
return calendarStore.eventlist
|
||||
@@ -240,6 +242,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return userStore.groups
|
||||
else if (table === 'sendmsgs')
|
||||
return messageStore.last_msgs
|
||||
else if (table === 'sendnotifs')
|
||||
return notifStore.last_notifs
|
||||
else if (table === 'settings')
|
||||
return state.settings
|
||||
else if (table === 'levels')
|
||||
@@ -811,6 +815,19 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
})
|
||||
},
|
||||
|
||||
async loadExp(params: any) {
|
||||
// console.log('loadTable', params)
|
||||
params.filtersearch2 = 'fdsgas1'
|
||||
|
||||
return Api.SendReq('/getexp', 'POST', params)
|
||||
.then((res) => {
|
||||
return res.data ? res.data : []
|
||||
})
|
||||
.catch((error) => {
|
||||
return []
|
||||
})
|
||||
},
|
||||
|
||||
loadPickup(params: IParamsPickup) {
|
||||
console.log('loadPickup', params)
|
||||
const userStore = useUserStore()
|
||||
|
||||
Reference in New Issue
Block a user