<script setup lang="ts">
import {useTable} from "@/hooks/web/useTable";
import {FormSchema} from "@/types/form";
const tableRef = ref()
const elTableRef = ref()
const columns = [
  {
    label: '文档名称',
    field: 'text',
    key: 'text',
    width: 200,
  },
  {
    label: '文档链接',
    field: 'text',
    key: 'text',
    width: 200,
  },
  {
    label: '文档来源',
    field: 'text',
    key: 'text',
    width: 200,
  },
  {
    label: '切片数量',
    field: 'text',
    key: 'text',
    width: 200,
  },
  {
    label: '切片状态',
    field: 'text',
    key: 'text',
    width: 200,
  },
  {
    label: '文件大小',
    field: 'text',
  },
  {
    label: '操作',
    field: 'text',
    key: 'text',
    width: 200,
  }
]
const {tableObject, register, tableMethods} = useTable()
const schema = ref<FormSchema[]>([
  {
    label: '文档名称',
    field: 'text',
    component: 'Select',
    componentProps: {
      style: {
        width: '150px'
      }
    }
  }
])
const pagination = computed(() => {
  return {
    pageSize: tableObject.pageSize,
    currentPage: tableObject.currentPage,
    total: tableObject.total,
  }
})
onMounted(() => {
  register(tableRef.value, elTableRef.value)
})
</script>

<template>
  <content-wrap>
    <Search :schema="schema"/>
  </content-wrap>
  <content-wrap>
    <Table ref="tableRef" :pagination="pagination" :columns="columns"/>
  </content-wrap>
</template>

<style scoped lang="scss">

</style>
