<template>
  <el-container style="height: 100%">
    <el-header class="header" v-show="flag">
      <div class="logInfo">
        <img :src="'api' + logo" alt="" />
        <h3>{{ header }}</h3>
      </div>
      <div class="sysName">
        <h2>可视农业应用系统 实时监测基地生产环境</h2>
        <p>
          The visual agricultural application system monitors the production
          environment of the base in real time
        </p>
      </div>
      <span class="header_btn" @click="hCheckFun">[隐藏]</span>
    </el-header>
    <el-header class="header2" v-show="!flag">
      <h3>可视农业应用系统</h3>
      <span class="header_btn" @click="hCheckFun">[展开]</span>
    </el-header>

    <el-container style="overflow: auto">
      <el-aside width="200px">
        <div>
          <i :class="iconObj[20]"></i>
          <span slot="title">可视农业应用系统</span>
        </div>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      isRouter: true,
      iconObj: {
        20: "iconfont icon-jiankong",
        22: "iconfont icon-jiankong",
      },
      flag: true,
      header: "",
      logo: "",
    };
  },
  created: function () {
    this.getUserInfo();
  },
  computed: {},
  mounted() {},
  methods: {
    getUserInfo() {
      this.$axios({
        method: "POST",
        url: "logoheader",
      }).then((res) => {
        this.header = res.data.header;
        this.logo = res.data.logo;
      });
    },
    hCheckFun() {
      this.flag = !this.flag;
    },
  },
};
</script>

<style scoped lang="less">
.header {
  position: relative;
  width: 100%;
  height: 177px !important;
  border-bottom: 2px solid #272b3a;
  background: #272b3a no-repeat center / 100% 100%
    url(../assets/images/monitor/h_bg.jpg);
  .sysName {
    color: #fff;
    text-align: center;
    h2 {
      font-size: 20px;
    }
    p {
      font-size: 14px;
    }
    margin-top: 50px;
  }
  .logInfo {
    color: #fff;
    position: absolute;
    top: 10px;
    left: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    img {
      width: auto;
      height: 40px;
    }
    h3 {
      margin: 0;
      margin-left: 20px;
    }
  }
}
.header2 {
  border-bottom: 2px solid #272b3a;
  position: relative;
  background-color: #323749;
  color: #fff;
}
.header_btn {
  position: absolute;
  color: #727272;
  font-size: 14px;
  right: 20px;
  bottom: 10px;
  cursor: pointer;
}
.header_btn:hover {
  color: #fff;
}

.el-aside {
  background: #474e60;
  div {
    background: #232735;
    font-size: 14px;
    line-height: 44px;
    text-align: center;
    color: #fff;
  }
}
.el-main {
  padding: 0;
}
</style>
