<template>

    <div class="bodyBoxs">
      <div style="margin-bottom: 15px;width: 200px;float: left">
        <el-date-picker
          v-model="dateTime"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          value-format="yyyy-MM-dd HH:mm:ss">
        </el-date-picker>
      </div>
      <div style="margin-bottom: 15px;width: 200px;float: left;margin-left: 200px">
<!--        <el-input placeholder="商品名称" style="float: left" v-model="search" class="input-with-select">-->
<!--          -->
<!--        </el-input>-->
        <el-button slot="append" icon="el-icon-search" @click="getData"></el-button>
      </div>
        <div class="boxs">
          <el-table
            :data="tableData"
            v-loading="loading"
            style="width: 100%">
            <el-table-column prop="PV" label="PV"/>
            <el-table-column prop="UV" label="UV"/>
            <el-table-column prop="user" label="参与人数"/>
            <el-table-column prop="lottery" label="抽奖次数"/>
            <el-table-column prop="ip" label="总IP"/>
          </el-table>
        </div>
    </div>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
    data(){
        return{
          dateTime:"",
          tableData : [],
          tableUserData:[],
          loading:false,
          page:1,
          pageSize:10,
          total:0,
          currentPage4:1,
        }
    },
    created(){
      this.getData()
    },
  methods:{
      handleSizeChange(val) {
        this.pageSize = val;
        this.getData()
      },
      handleCurrentChange(val) {
        console.log('点击了');
        this.page = val;
        this.getData();
      },
      getData(){
        this.loading = true;
        this.$api.getDataS({
          page: this.page,
          size: this.pageSize,
          dateTime: this.dateTime,
        }).then((res) => {
          this.tableData = res.data;
          this.loading = false;
        })
      },
  }
}
</script>
<style scoped>
    .bodyBoxs{
        padding: 40px;
    }
    .boxs{
        width: 100%;
        background: #fff;
        border-radius: 15px;
    }

</style>
