<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :md="6" :sm="8">
            <a-form-item label="加班人员">
              <a-input placeholder="请输入加班人员" v-model="queryParam.person"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="开始日期">
              <a-date-picker
                style="width: 100%"
                placeholder="请选择开始日期"
                v-model="queryParam.beginDate"
                valueFormat="YYYY-MM-DD HH:mm:ss" 
                :getCalendarContainer="node => node.parentNode"/>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="结束日期">
              <a-date-picker
                style="width: 100%"
                placeholder="请选择结束日期"
                v-model="queryParam.endDate"
                valueFormat="YYYY-MM-DD HH:mm:ss" 
                :getCalendarContainer="node => node.parentNode"/>
                
            </a-form-item>
          </a-col>
          
          <a-col :md="6" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

   
    <!-- table区域-begin -->
    <div>
      
      <a-table
        ref="table"
        size="middle"
        bordered
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <!-- <BdScheduling-modal ref="modalForm" @ok="modalFormOk"></BdScheduling-modal> -->
  </a-card>
</template>

<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'

  export default {
    name: 'BdSchedulingList',
    mixins: [JeecgListMixin],
    components: {
      JDictSelectTag
    },
    data() {
      return {
        description: '加班信息',
        // 表头
        columns: [
          // {
          //   title: '行号',
          //   dataIndex: '',
          //   key: 'rowIndex',
          //   width: 60,
          //   align: 'center',
          //   customRender: function (t, r, index) {
          //     return parseInt(index) + 1
          //   }
          // },
          {
            title: '加班人员',
            align: 'center',
            dataIndex: 'person'
          },
          {
            title: '申请人部门',
            align: 'center',
            dataIndex: 'dept'
          },
          {
            title: '加班事由',
            align: 'center',
            dataIndex: 'demo'
          },
          
          {
            title: '开始时间',
            align: 'center',
            dataIndex: 'beginDate'
          },
          {
            title: '结束时间',
            align: 'center',
            dataIndex: 'endDate'
          },
          {
            title: '加班时长',
            align: 'center',
            dataIndex: 'duration'
          },
          {
            title: '提交时间',
            align: 'center',
            dataIndex: 'commitDate'
          },
          {
            title: '审批编号',
            align: 'center',
            dataIndex: 'code'
          }
          
        ],
        url: {
          list: '/workOvertime/workOvertime/lists'
        },
      }
    },
    computed: {
      importExcelUrl: function () {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>