feat(sep): change button export to dropdown
This commit is contained in:
@@ -3,6 +3,12 @@ import type { DataTableLoader } from '~/components/pub/base/data-table/type'
|
|||||||
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
|
import type { HeaderPrep, RefSearchNav } from '~/components/pub/custom-ui/data/types'
|
||||||
import type { PaginationMeta } from '~/components/pub/custom-ui/pagination/pagination.type'
|
import type { PaginationMeta } from '~/components/pub/custom-ui/pagination/pagination.type'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
} from '~/components/pub/ui/dropdown-menu'
|
||||||
|
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
const dateRange = ref('12 Agustus 2025 - 32 Agustus 2025')
|
const dateRange = ref('12 Agustus 2025 - 32 Agustus 2025')
|
||||||
@@ -120,6 +126,16 @@ async function getSepList() {
|
|||||||
isLoading.dataListLoading = false
|
isLoading.dataListLoading = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exportCsv() {
|
||||||
|
console.log('Ekspor CSV dipilih')
|
||||||
|
// tambahkan logic untuk generate CSV
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportExcel() {
|
||||||
|
console.log('Ekspor Excel dipilih')
|
||||||
|
// tambahkan logic untuk generate Excel
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSepList()
|
getSepList()
|
||||||
})
|
})
|
||||||
@@ -152,12 +168,20 @@ provide('table_data_loader', isLoading)
|
|||||||
</Popover>
|
</Popover>
|
||||||
|
|
||||||
<!-- Export -->
|
<!-- Export -->
|
||||||
<Button
|
<DropdownMenu>
|
||||||
variant="outline"
|
<DropdownMenuTrigger as-child>
|
||||||
class="ml-auto h-[40px] w-[120px] rounded-md border-green-600 text-green-600 hover:bg-green-50"
|
<Button
|
||||||
>
|
variant="outline"
|
||||||
<Icon name="i-lucide-download" class="h-5 w-5" /> Ekspor
|
class="ml-auto h-[40px] w-[120px] rounded-md border-green-600 text-green-600 hover:bg-green-50"
|
||||||
</Button>
|
>
|
||||||
|
<Icon name="i-lucide-download" class="h-5 w-5" /> Ekspor
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent class="w-40">
|
||||||
|
<DropdownMenuItem @click="exportCsv"> Ekspor CSV </DropdownMenuItem>
|
||||||
|
<DropdownMenuItem @click="exportExcel"> Ekspor Excel </DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rounded-md border p-4">
|
<div class="rounded-md border p-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user