<template>
  <div>
    <el-row style="margin-bottom:5px;">
      <el-col :span="12">
        <span>时间 : </span>
        <el-date-picker
          v-model="search.time"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          size="small"
        />
      </el-col>
      <el-col :span="6">
        <el-button size="small" type="primary" icon="el-icon-search" @click="searchClick(1)">搜索</el-button>
        <el-button size="small" type="info" icon="el-icon-refresh" @click="searchClick(2)">重置</el-button>
      </el-col>
      <el-col :span="6" style="display:flex;background-color: #ffe793;font-size: 13px;padding: 5px;">
        <div class="box-x" style="margin-right:5px;">硬盘总容量：<br>{{ capacity }}</div>
        <div class="box-x">硬盘剩余量：<br>{{ residue }}</div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import {getDiskCapacity} from "@/api/archives-management/dailyManagement/operationLog";
import {message} from "@/utils/common"
export default {
  props: {
    search: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      capacity:'', // 容量
      residue:'',// 剩余
      options: [{
        value: '1',
        label: '原文导入 '
      }, {
        value: '2',
        label: '条目导入 '
      }]
    }
  },
  mounted() {
    this.getDiskCapacity();
  },
  methods: {
    // 获取磁盘容量数据
    getDiskCapacity(){
      getDiskCapacity().then((res)=>{
        if(res.code == 100){
          this.capacity = res.body.allTotalSpace;
          this.residue = res.body.allFreeSpace;
        }
      }).catch((error)=>{
        this.$message.error(res.msg);
      })
    },

    searchClick(val) {
      this.$emit('searchClick', val)
    }

  }
}

</script>
<style lang="scss" scoped>
.box-x{
  height: 30px;
  width: 50%;
}
</style>
