<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.name"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="审批编号">
              <a-input placeholder="请输入审批编号" v-model="queryParam.name"></a-input>
            </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"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @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: 'realname'
          },
          {
            title: '日期',
            align: 'center',
            dataIndex: 'viewDate'
          },
          {
            title: '最早打卡时间',
            align: 'center',
            dataIndex: 'maxDate'
          },
          {
            title: '最晚打卡时间',
            align: 'center',
            dataIndex: 'minDate'
          },
          {
            title: '打卡次数',
            align: 'center',
            dataIndex: 'attendanceCount'
          }
        ],
        url: {
          list: '/viewClockIn/reportOutDay/list'
        },
      }
    },
    computed: {
      importExcelUrl: function () {
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>