fix(encounter): modify dropdown action
This commit is contained in:
@@ -10,6 +10,8 @@ const recId = inject<Ref<number>>('rec_id')!
|
||||
const recAction = inject<Ref<string>>('rec_action')!
|
||||
const recItem = inject<Ref<any>>('rec_item')!
|
||||
const activeKey = ref<string | null>(null)
|
||||
const activePosition = inject<Ref<string>>('position')
|
||||
const linkItemsFiltered = ref<LinkItem[]>([])
|
||||
const linkItems: LinkItem[] = [
|
||||
{
|
||||
label: 'Detail',
|
||||
@@ -77,6 +79,24 @@ function remove() {
|
||||
recAction.value = ActionEvents.showConfirmDelete
|
||||
recItem.value = props.rec
|
||||
}
|
||||
|
||||
linkItemsFiltered.value = [...linkItems]
|
||||
|
||||
if (activePosition) {
|
||||
switch (activePosition.value) {
|
||||
case 'medical':
|
||||
linkItemsFiltered.value = [...linkItems]
|
||||
break
|
||||
case 'verificator':
|
||||
linkItemsFiltered.value = [
|
||||
...linkItems.filter((item) => ['Detail', 'Print'].includes(item.label)),
|
||||
]
|
||||
break
|
||||
default:
|
||||
linkItemsFiltered.value = [...linkItems]
|
||||
break
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import { config } from './list.cfg'
|
||||
|
||||
const props = defineProps<{
|
||||
data: any[]
|
||||
data: any[],
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PubMyUiDataTable
|
||||
v-bind="config"
|
||||
:rows="data"
|
||||
:rows="props.data"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user