<!--
 * @Company: 沈阳信诚科技
 * @Email: html_venustar@163.com
 * @Author: Liuqiming
 * @Description: 铸坯报告
 * @LastEditors: Liuqiming
 * @LastEditTime: 2024-03-18 14:47:21
 * @Date: 2024-02-26 12:25:10
-->
<template>
  <div class="app-container Information">
    <els-table
      :btnList="btnList"
      :columns="columns"
      :tableData="tableData"
      :searchList="searchList"
      @getTableData="getTableData"
      :pageSet="pageSet"
      :option="tableOption"
      :tableLoading="loading"
    ></els-table>
  </div>
</template>

<script setup>
import { init } from './index.jsx'
import { reportList } from '@A/digitalCasting/report/report.js'

const { proxy } = getCurrentInstance();
import { useRouter } from "vue-router";
const router = useRouter();

const loading = ref(false)
const tableData = ref([])

// 表格数据获取
const getList = (searchVal) => {
  loading.value = true
  // 获取表格数据
  reportList(searchVal).then(res => {
    tableData.value = res.rows
    pageSet.value.total = res.total
    loading.value = false
  }).catch(err => {console.log(err)})
}
// 查询及重置翻页等回调方法
const getTableData = (searchVal) => {
  getList(searchVal)
}
// 查看报告
const view = (row) => {
  router.push({
    path:'/digitalCasting/report/details',
    query:{ id: row.id }
  })
}

getList({ pageSize:10, pageNum:1 })
const {
  searchList,
  btnList,
  columns,
  pageSet,
  tableOption,
} = init({view})
</script>

<style lang="scss" scoped>
</style>
