base structure

This commit is contained in:
ctengiz
2024-04-15 10:00:31 +03:00
parent 19d9d24530
commit 61f5f8fe04
21 changed files with 846 additions and 55 deletions

123
ui/src/lib/menu.js Normal file
View File

@@ -0,0 +1,123 @@
import { useLoginStore } from 'stores/login'
const store = useLoginStore()
const tmenu = [
{
label: 'Şirket Tanımları',
icon: 'business',
grantKey: 'Company',
to: '/company'
},
{
label:'menu.masterData',
icon: 'mdi-database-edit',
grantKey: 'Data',
to: null,
children: [
{
label: 'menu.fiCrn',
icon: 'mdi-server-network',
grantKey: 'fiCrn',
to: '/ficrn'
},
{
label: 'menu.dfGeo',
icon: 'mdi-server-network',
grantKey: 'defGeo',
to: '/dfgeo'
},
{
label: 'menu.region',
icon: 'mdi-server-network',
grantKey: 'defGeo',
to: '/region'
},
{
label: 'menu.translations',
icon: 'mdi-translate',
grantKey: 'Locale',
to: '/locale'
},
]
},
{
label: 'menu.systemManagement',
icon: 'build_circle',
grantKey: 'System',
to: null,
children: [
{
label: 'menu.syusr',
icon: 'mdi-badge-account-horizontal',
grantKey: 'syUsr',
to: '/syusr'
},
{
label: 'menu.syunit',
icon: 'mdi-account-group',
grantKey: 'syUnit',
to: '/syunit'
},
{
label: 'menu.systemParams',
icon: 'settings_applications',
grantKey: 'syParams',
to: '/syparams'
},
{
label: 'Log Auth',
icon: 'receipt',
grantKey: 'LogAuth',
to: '/logauth'
},
{
label: 'Log DML',
icon: 'receipt',
grantKey: 'LogDML',
to: '/logdml'
}
]
},
]
export const menu = function () {
const m = tmenu.filter(m => {
return checkGrant(m.grantKey)
})
return m
}
const checkGrant = function (typ) {
//todo:
return true
if (store.IsAdmin) {
return true
}
if (store.grantHasKey(typ)) {
const o = store.Grants[typ]
for (let [key, value] of Object.entries(o)) {
if (value) {
return true
}
}
}
return false
}
const checkRprGrant = function (typ) {
if (this.$store.IsAdmin) {
return true
}
return store.Grants.Rpr[typ]
}