|
| 1 | +<script setup> |
| 2 | +
|
| 3 | +
|
| 4 | +const data = computed(() => usePage().props.data); |
| 5 | +
|
| 6 | +const items = computed(() => data.value.items); |
| 7 | +const columns = computed(() => data.value.columns); |
| 8 | +const pageTitle = computed(() => data.value.pageTitle); |
| 9 | +
|
| 10 | +
|
| 11 | + const {form, reset, processing, onSort} = useSearchFilter(route('admin.users.index')); |
| 12 | +
|
| 13 | +
|
| 14 | +
|
| 15 | +</script> |
| 16 | + |
| 17 | +<template> |
| 18 | + <Head :title="__(pageTitle)"/> |
| 19 | + <AppContainer> |
| 20 | + <PageHeading> |
| 21 | + <template #title>{{ __(pageTitle) }}</template> |
| 22 | + |
| 23 | + </PageHeading> |
| 24 | + <div class="flex flex-wrap items-center gap-5 mb-5 px-5"> |
| 25 | + <TabButton |
| 26 | + v-for="(tab, index) in tabs" |
| 27 | + :key="index" |
| 28 | + :text="tab.text" |
| 29 | + :icon="tab.icon" |
| 30 | + class="!text-md" |
| 31 | + @click="form.scope = tab.scope" |
| 32 | + :selected="form.scope == tab.scope || (index == 0 && !form.scope)"/> |
| 33 | + </div> |
| 34 | + |
| 35 | + <SectionCard class="mt-4 h-full" :key="Date.now().toString()"> |
| 36 | + <div class="mb-1 p-5 flex items-center justify-between flex-wrap gap-3"> |
| 37 | + <SearchInput placeholder="Search ... " v-model="form.filter.global" @reset="reset"></SearchInput> |
| 38 | + |
| 39 | + </div> |
| 40 | + |
| 41 | + <LoadingProgressBar v-if="processing"/> |
| 42 | + |
| 43 | + <DataTable |
| 44 | + id="usersTable" |
| 45 | + :items="items.data" |
| 46 | + :columns="columns" |
| 47 | + class="rounded-xl" |
| 48 | + @onSort="onSort" |
| 49 | + :key="Date.now().toString() + 1"> |
| 50 | + <template #cell(country)="{ item }"> |
| 51 | + <p class="px-1 pt-2 text-sm text-light">{{ item.country }}</p> |
| 52 | + </template> |
| 53 | + |
| 54 | + <template #cell(email)="{ item }"> |
| 55 | + <p class="px-1 pt-2 text-sm text-light">{{ item.email }}</p> |
| 56 | + </template> |
| 57 | + |
| 58 | + <template #cell(mobile)="{ item }"> |
| 59 | + <p class="px-1 pb-2 text-sm text-light">{{ item.mobile }}</p> |
| 60 | + </template> |
| 61 | + |
| 62 | + <template #cell(created_at)="{ item }"> |
| 63 | + <p class="px-1 py-2 text-sm text-light">{{ (item.created_at) }}</p> |
| 64 | + </template> |
| 65 | + |
| 66 | + |
| 67 | + </DataTable> |
| 68 | + <DataTablePagination :items="items" v-model="form.perPage"/> |
| 69 | + </SectionCard> |
| 70 | + |
| 71 | + </AppContainer> |
| 72 | +</template> |
| 73 | + |
| 74 | +<script> |
| 75 | +import Layout from '@/Layouts/AdminLayout.vue'; |
| 76 | +import {defineComponent} from 'vue'; |
| 77 | +
|
| 78 | +export default defineComponent({ |
| 79 | + layout: Layout, |
| 80 | +}); |
| 81 | +</script> |
0 commit comments