Refactor row action handling in FormPiyangoOnayDurum component. Replace EditOnay with adminRowAction and update rowActions to adminRowActions based on user role, enhancing access control and functionality.
This commit is contained in:
@ -2,14 +2,14 @@
|
|||||||
<list-table-content
|
<list-table-content
|
||||||
v-if="loaded"
|
v-if="loaded"
|
||||||
:tableHeader="tableHeader"
|
:tableHeader="tableHeader"
|
||||||
:rowAction="EditOnay"
|
:rowAction="adminRowAction"
|
||||||
formTitle="Piyango Onay Durumları"
|
formTitle="Piyango Onay Durumları"
|
||||||
listText="Kayıt"
|
listText="Kayıt"
|
||||||
:apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery"
|
:apiList="'OnayDurumu/GetSonOnayDurumlariList/' + piyangoStore.selectedLottery"
|
||||||
apiText="Piyango Onay Log Listesi"
|
apiText="Piyango Onay Log Listesi"
|
||||||
page="form"
|
page="form"
|
||||||
:refresh="piyangoOnayStore.refreshList"
|
:refresh="piyangoOnayStore.refreshList"
|
||||||
:rowActions="rowActions" />
|
:rowActions="adminRowActions" />
|
||||||
<panel-wrapper
|
<panel-wrapper
|
||||||
v-if="piyangoOnayStore.onayFormPanel"
|
v-if="piyangoOnayStore.onayFormPanel"
|
||||||
v-model="piyangoOnayStore.onayFormPanel"
|
v-model="piyangoOnayStore.onayFormPanel"
|
||||||
@ -45,6 +45,8 @@
|
|||||||
const dialogStore = useDialogStore()
|
const dialogStore = useDialogStore()
|
||||||
import { useDataStore } from '@/stores/dataStore'
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
const usersStore = useUsersStore()
|
||||||
|
|
||||||
const loaded = ref<boolean>(false)
|
const loaded = ref<boolean>(false)
|
||||||
|
|
||||||
@ -214,6 +216,14 @@
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const adminRowAction = computed(() => {
|
||||||
|
return usersStore.isPanelUser ? EditOnay : undefined
|
||||||
|
})
|
||||||
|
|
||||||
|
const adminRowActions = computed(() => {
|
||||||
|
return usersStore.isPanelUser ? rowActions.value : []
|
||||||
|
})
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
loaded.value = true
|
loaded.value = true
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user