<script lang="ts" setup>
import ADropTable from '@/components/a-drop-table/ADropTable.vue'
import UserApi from '@/pages/sys/user/user-api.ts'

defineProps<{
  placeholder?: string
}>()
const model = defineModel<string | undefined | null>()
const dropTableColumns = [
  {
    label: '账号',
    prop: 'account.username',
  },
  {
    label: '注册时间',
    prop: 'account.regdate',
  },
]
const dropTableLoader = (param: UserTypes.SearchUserParam) => {
  return UserApi.paging(param).then(res => res.data)
}

</script>

<template>
  <ADropTable v-model="model"
    :columns="dropTableColumns"
    :loader="dropTableLoader"
    :placeholder="placeholder"
    display-field="username"/>
</template>
