CGridTableRec + fields + page

pagine:
- Siti Web
- Operazioni
- Push...
This commit is contained in:
Paolo Arena
2021-09-19 20:07:28 +02:00
parent 622bd6943d
commit db4b06f67f
96 changed files with 2561 additions and 4328 deletions

View File

@@ -2191,6 +2191,11 @@ export const tools = {
return userStore.isEditor
},
isTeacher() {
const userStore = useUserStore()
return userStore.isTeacher
},
getstrDate(mytimestamp: Date | number | string | undefined) {
// console.log('getstrDate', mytimestamp)
if (mytimestamp) return date.formatDate(mytimestamp, 'DD/MM/YYYY')

View File

@@ -20,6 +20,7 @@ import bcrypt from 'bcryptjs'
import { useTodoStore } from '@store/Todos'
import { Router } from 'vue-router'
import { useProjectStore } from '@store/Projects'
import { shared_consts } from '@/common/shared_vuejs'
export const DefaultUser: IUserFields = {
_id: '',
@@ -101,6 +102,7 @@ export const useUserStore = defineStore('UserStore', {
isZoomeri: false,
isTratuttrici: false,
isEditor: false,
isTeacher: false,
usersList: [],
countusers: 0,
lastparamquery: {},
@@ -396,6 +398,19 @@ export const useUserStore = defineStore('UserStore', {
if (!this.my.profile) {
this.my.profile = DefaultProfile
}
this.isAdmin = tools.isBitActive(this.my.perm, shared_consts.Permissions.Admin.value)
this.isManager = tools.isBitActive(this.my.perm, shared_consts.Permissions.Manager.value)
this.isTutor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Tutor.value)
this.isZoomeri = tools.isBitActive(this.my.perm, shared_consts.Permissions.Zoomeri.value)
this.isDepartment = tools.isBitActive(this.my.perm, shared_consts.Permissions.Department.value)
this.isTeacher = tools.isBitActive(this.my.perm, shared_consts.Permissions.Teacher.value)
this.isEditor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Editor.value)
this.my.tokens = []
this.resetArrToken(this.my.tokens)
this.my.tokens.push({ access: 'auth', token: this.x_auth_token, data_login: tools.getDateNow() })
},
updateLocalStorage(myuser: IUserFields) {

View File

@@ -225,7 +225,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
getrecSettingsByKey: (state: IGlobalState) => (key: any, serv: any): ISettings | undefined => {
if (serv) return state.serv_settings.find((rec) => rec.key === key)
const ris = state.settings.find((rec) => rec.key === key)
console.log('getrecSettingsByKey=', ris)
// console.log('getrecSettingsByKey=', ris)
return ris
},
@@ -253,13 +253,13 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (myrec.type === costanti.FieldType.boolean) myrec.value_bool = value
else myrec.value_str = value
console.log('setValueSettingsByKey value', value, 'myrec', myrec)
// console.log('setValueSettingsByKey value', value, 'myrec', myrec)
}
},
getValueSettingsByKey(key: any, serv: any): any | undefined {
const myrec = this.getrecSettingsByKey(key, serv)
console.log('getValueSettingsByKey', myrec, 'key=', key, 'srv=', serv)
// console.log('getValueSettingsByKey', myrec, 'key=', key, 'srv=', serv)
if (myrec) {
if ((myrec.type === costanti.FieldType.date) || (myrec.type === costanti.FieldType.onlydate)) return myrec.value_date
if ((myrec.type === costanti.FieldType.number) || (myrec.type === costanti.FieldType.hours)) return myrec.value_num
@@ -346,7 +346,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
// console.log('static_data.routes', static_data.routes)
console.log('$router', $router)
// console.log('$router', $router)
if (tools.sito_online(false)) {
arrpagesroute.forEach(function (route: any) {
@@ -556,7 +556,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
},
async clearDataAfterLogout() {
console.log('clearDataAfterLogout')
// console.log('clearDataAfterLogout')
for (const table of ApiTables.allTables()) {
await globalroutines('clearalldata', table, null)