<!--
 * @Company: 沈阳信诚科技
 * @Email: html_venustar@163.com
 * @Author: Liuqiming
 * @Description: 生产事件记录
 * @LastEditors: Liuqiming
 * @LastEditTime: 2024-03-05 09:15:36
 * @Date: 2024-02-26 12:25:10
-->
<template>
  <div class="app-container produceEvents">
    <els-table
      :btnList="btnList"
      :columns="columns"
      :tableData="tableData"
      :searchList="searchList"
      @getTableData="getTableData"
      :pageSet="pageSet"
      :option="tableOption"
      :tableLoading="loading"
    ></els-table>
  </div>
</template>

<script setup name="produceEvents">
import { init } from './index.jsx'

import { eventRecordsList } from '@A/digitalCasting/monitor/produceEvents.js'
const { proxy } = getCurrentInstance();

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

// 表格数据获取
const getList = (searchVal) => {
  loading.value = true
  // 获取表格数据
  eventRecordsList(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)
}
getList({ pageSize:10, pageNum:1 })
const { 
  searchList,
  btnList,
  columns,
  pageSet,
  tableOption,
} = init()
</script>

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