<template>
  <ai-list class="history">
    <template slot="content">
      <ai-search-bar>
        <template #left>
          <el-button type="primary" icon="iconfont iconEdit" @click="fillupAdd('')">补录</el-button>
        </template>
        <template #right>
          <el-input size="small" placeholder="请输入届次" v-model="search.name" clearable
                      v-throttle="() => {page.current = 1, getList()}"/>
          <el-button icon="iconfont iconResetting" @click="reset('')">重置</el-button>
        </template>
      </ai-search-bar>
      <ai-table
        class="detail-table__table"
        :tableData="tableData"
        :col-configs="colConfigs"
        :total="totalJob"
        :current.sync="current"
        :size.sync="size"
        @getList="getJobList">
        <el-table-column slot="options" label="操作" align="center">
          <template slot-scope="{ row }">
            <el-button type="text" @click="jobEdit(row.id)">编辑</el-button>
            <el-button type="text" @click="jobDelete(row.id)">删除</el-button>
          </template>
        </el-table-column>
      </ai-table>
    </template>
  </ai-list>
</template>

<script>
export default {
  name: "history",
  props: {
    instance: Function,
    permissions: Function,
    dict: Object,
  },
  data() {
    return {
      search: {
        name: '',
      },
      page: {
        current: 1,
        size: 10,
        total: 0
      }
    }
  },
  computed: {
    colConfigs() {
      return [
        {prop: '', label: '届次', align: 'left'},
        {prop: '', label: '换届日期', align: 'center'},
        {prop: '', label: '操作时间', align: 'center'},
        {prop: '', label: '操作人', align: 'center'},
        {slot: 'options'},
      ]
    }
  },
  methods: {
    fillupAdd() {},
    reset() {},
    getList() {}
  },
  created() {

  },
}
</script>

<style lang="scss" scope>
.history {
  
}
</style>