<template>
  <div class="page-wrap">
    <ui-loading :show="page_loading.show"></ui-loading>

    <div class="page-handle-wrap">
      <ul class="handle-wraper bd-b">
        <li class="f-l">
          <div class="text-exp">
            <b>全部信息</b>
          </div>
        </li>
        <li class="f-r">
          <div class="handle-item">
            <Button @click="destroyBatch" icon="md-trash" type="primary" v-has="'destroy'">删除</Button>
          </div>

          <div class="handle-item">
            <Button @click="search.show=!search.show" ghost icon="ios-search" type="primary">搜索</Button>
          </div>

          <div class="handle-item">
            <Button @click="index(1)" icon="md-refresh">刷新</Button>
          </div>
        </li>
      </ul>

      <div class="search-wrap" v-show="search.show">
        <ul class="handle-wraper">
          <li class="handle-item w-250">
            <Select clearable placeholder="类型" v-model="other.tag">
              <Option value="客户列表"></Option>
              <Option value="企业统计"></Option>
              <Option value="销售订单统计"></Option>
              <Option value="销售订单明细"></Option>
              <Option value="续费订单统计"></Option>
              <Option value="续费订单明细"></Option>
              <Option value="续费包订单统计"></Option>
              <Option value="续费包订单明细"></Option>
              <Option value="加油包订单统计"></Option>
              <Option value="加油包订单明细"></Option>
              <Option value="用户月报表"></Option>
              <Option value="用户月报表明细"></Option>
              <Option value="增值包月报表"></Option>
              <Option value="增值包月报表明细"></Option>
            </Select>
          </li>

          <li class="handle-item w-350">
            <DatePicker
              :editable="false"
              placeholder="请选择时间"
              placement="bottom-start"
              type="daterange"
              v-model.trim="other.time"
              :options="datePickerOptionsMonth"
            ></DatePicker>
          </li>
        </ul>

        <ul class="handle-wraper">
          <li class="f-r">
            <div class="handle-item">
              <Button @click="index(1)" ghost type="primary">立即搜索</Button>
            </div>
            <div class="handle-item">
              <Button @click="resetSearch" ghost type="warning">重置搜索</Button>
            </div>
          </li>
        </ul>
      </div>
    </div>

    <div class="page-list-wrap">
      <Alert class="page-tips" show-icon>
        已选
        <span class="num">{{selection.length}}</span>项
        <span @click="handleSelectAll(false)" class="clear">清空</span>
      </Alert>

      <Table
        :columns="table_titles"
        :data="list_data?list_data.data:[]"
        @on-selection-change="selectionChange"
        ref="table"
      ></Table>
    </div>

    <div class="page-turn-wrap" v-if="list_data && list_data.data.length">
      <Page
        :current="Number(list_data.current_page)"
        :page-size="Number(list_data.per_page)"
        :total="Number(list_data.total)"
        @on-change="index"
        show-elevator
        show-total
      ></Page>
    </div>
  </div>
</template>

<script src="./js/index.js"></script>
