<template>
  <a-table
    bordered
    :pagination="pagination"
    :columns="columns"
    :dataSource="dataSource"
    :scroll="{ x: 'max-content' }"
    @change="handleTableChange"
  >
  </a-table>
</template>

<script setup>
import { ref, defineProps, reactive } from 'vue'
import config from '@/utils/config.js'

const props = defineProps({
  onCallBack: {
    type: Function,
    required: true
  },
});

// 表格行数据
const dataSource = ref([])

let pagination = reactive({
  total: dataSource.value.length,
  current: 10,
  pageSize: config.pageParam.pageSize,
  showSizeChanger: true,
  pageSizeOptions: config.pageParam.pageSizeOptions,
  showQuickJumper: true
})

const columns = ref([
  {
    title: '反馈用户',
    dataIndex: 'userName',
    width: 200,
    key: 'userName',
    align: 'center'
  },
  {
    title: '坐标',
    dataIndex: 'coordinate',
    width: 200,
    key: 'coordinate',
    align: 'center'
  },
  {
    title: '故障类型',
    dataIndex: 'faultType',
    width: 200,
    key: 'faultType',
    align: 'center'
  },
  {
    title: '图片',
    dataIndex: 'image',
    width: 200,
    key: 'image',
    align: 'center'
  },
  {
    title: '备注',
    dataIndex: 'remark',
    width: 200,
    key: 'remark',
    align: 'center'
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 200,
    key: 'createTime',
    align: 'center'
  }
]);


let handleTableChange = (pagina) => {
  pagination.current = pagina.current
  pagination.pageSize = pagina.pageSize
  queryform.value.pageParam.pageNum = pagina.current
  queryform.value.pageParam.pageSize = pagina.pageSize
  getData()
}

const getData = () => {
}

</script> 