ver. 0.2.12

Sistemare i Gruppi : cardGruppo
This commit is contained in:
paoloar77
2022-02-25 19:20:51 +01:00
parent f63fdbb175
commit bdfeb714d7
23 changed files with 667 additions and 93 deletions

View File

@@ -24,6 +24,7 @@ import { CMyUser } from '../CMyUser'
import { CMyGroups } from '../CMyGroups'
import { CMyFieldDb } from '../CMyFieldDb'
import { CMyRecCard } from '../CMyRecCard'
import { CMyRecGrpCard } from '../CMyRecGrpCard'
import { CMySelect } from '../CMySelect'
import { CTitleBanner } from '../CTitleBanner'
@@ -34,6 +35,7 @@ import { costanti } from '@costanti'
import translate from '@/globalroutines/util'
import { toolsext } from '@store/Modules/toolsext'
import { CMyCardPopup } from '@/components/CMyCardPopup'
import { CMyCardGrpPopup } from '@/components/CMyCardGrpPopup'
export default defineComponent({
name: 'CGridTableRec',
@@ -208,7 +210,7 @@ export default defineComponent({
default: '',
},
},
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser, CMyRecCard, CMyCardPopup },
components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser, CMyRecCard, CMyCardPopup, CMyRecGrpCard, CMyCardGrpPopup },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
@@ -341,33 +343,6 @@ export default defineComponent({
refresh()
}
function canModifyThisRec(rec: any) {
// console.log('rec', rec)
if (tablesel.value === 'mygroups') {
// is Admin ?
if (rec.admins) {
const trovato = rec.admins.find((myuser: any) => myuser.username === userStore.my.username)
if (trovato) {
return !!trovato
}
}
}
if (rec.hasOwnProperty('userId')) {
let userId = rec.userId
if (userId === userStore.my._id) {
// E' il mio, quindi modificalo
return true
} else {
return false
}
} else {
return false
}
if (userStore.isAdmin || userStore.isManager)
return true
}
// emulate 'SELECT count(*) FROM ...WHERE...'
function getRowsNumberCount(myfilter?: any) {
@@ -1628,7 +1603,6 @@ export default defineComponent({
globalStore,
searchList,
searchval,
canModifyThisRec,
checkIfShowRec,
valoriopt,
labelcombo,