<template>
  <div class="countfileupload">
    <div class="choice">
      <el-input
        class="input-content public-input"
        v-model="searchText"
        placeholder="用户名"
      ></el-input>
      <div class="sjxz">
        <el-date-picker
          value-format="yyyy-MM-dd"
          v-model="sc_time"
          type="daterange"
          range-separator="至"
          start-placeholder="开始时间"
          end-placeholder="结束时间"
          :default-time="['00:00:00', '23:59:59']"
        >
        </el-date-picker>
      </div>
      <div class="button-search" @click="search()">搜索</div>
    </div>
    <div class="management-content">
      <div class="info">
        <div class="shift-model" @click="shiftModel">
          <img :src="img3" alt="" />&nbsp;切换
        </div>

         <keep-alive>
            <div :is="com" :condition="con" ref="child"></div>
         </keep-alive>
       
      </div>
    </div>
    
  </div>
</template>

<script>
import img3 from "../../assets/img/setting/04.png";
import logtable from "../../components/log/logtable.vue"
import loggraph from "../../components/log/loggraph.vue"
export default {
    data(){
        return{
            img3: img3,
            active: 0,
            searchText: null,
            com: 'logtable',
            comList: ['logtable', 'loggraph'],
            sc_time:''
        }
    },
    methods:{
        search(){
          this.$refs.child.search();
        },
        shiftModel(){
          this.active++;
          this.com = this.comList[this.active%this.comList.length];
        }
    },
    mounted(){
        this.search();
    },
    computed:{
        con(){
            return{username: this.searchText,startTime:this.sc_time!=''&&this.sc_time!=null?this.sc_time[0]+' 00:00:00':null,endTime:this.sc_time!=''&&this.sc_time!=null?this.sc_time[1]+' 23:59:59':null}
        }
    },
    components:{
        logtable,
        loggraph
    }
}
</script>

<style lang="scss">
.countfileupload {
  width: 100%;
  height: 100%;
  margin: 0%;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  .choice {
    width: 100%;
    height: 40px;
    margin-top: 20px;
    padding-left: 20px;
    box-sizing: border-box;
    .input-content {
      width: 200px;
      height: 40px;
      float: left;
      input {
        height: 40px;
        color: white;
        border-radius: 0px;
        border: 1px solid #1c678a;
        background: none !important;
      }
    }
    .button-search {
      width: 100px;
      height: 30px;
      line-height: 30px;
      margin-top: 4px;
      float: left;
      margin-left: 20px;
      text-align: center;
      cursor: pointer;
      background-image: url(../../assets/img/yqjc/40.png);
      background-repeat: no-repeat;
      background-size: 100% 100%;
      font-size: 13px;
    }
    .sjxz {
      width: 350px;
      float: left;
      margin-left: 20px;
      .el-date-editor {
        background: none;
        span {
          color: white;
        }
        .el-range-input {
          color: white;
          background: none;
        }
      }
      .el-input__inner {
        box-shadow: 0 0 10px #1b6097;
        border: 1px solid #146a80 !important;
      }
    }
  }
  .management-content {
    width: 100%;
    height: calc(100% - 60px);
    padding: 10px;
    padding-top: 0px;
    box-sizing: border-box;
    .info {
      width: 100%;
      height: 100%;
      padding: 20px;
      padding-top: 40px;
      box-sizing: border-box;
      // background: url(../../assets/img/setting/01.png) no-repeat;
      // background-size: 100% 100%;
      .shift-model {
        width: 120px;
        height: 30px;
        line-height: 30px;
        padding-left: 12px;
        text-align: center;
        float: right;
        margin-top: -25px;
        cursor: pointer;
        background: url(../../assets/img/setting/08.png) no-repeat;
        background-size: 100% 100%;
      }
    }

  }
  /*修改滚动条样式*/
  tbody::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    /**/
  }
  tbody::-webkit-scrollbar-track {
    background: #146c7e;
    border-radius: 2px;
  }
  tbody::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 10px;
  }
  tbody::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
  }
  tbody::-webkit-scrollbar-corner {
    background: #179a16;
  }
   
}
</style>