<template>
  <div class="main-box" :style="dynamicImage?{'background-image': `url(${dynamicImage})`}:`url('~@/assets/img/login/bg001.png')`">
    <!--  -->
    <!-- <top-header :isLogin="isLogin" :isRegister="isRegister" /> -->
    <div class="content-box">
      <div class="sider-left">
        <h1 class="h1-title">Hi，您好！</h1>
        <p class="p-text">{{sysName}}</p>
        <!-- <div class="img-icon">
          <img src="~@/assets/img/login/archive_icon.png">
        </div> -->
      </div>
      <div class="sider-right">
        <slot name="formBox"></slot>
      </div>
      <!-- <div style="width:100%;height:100%;text-align:center;">
        <h1 style="color:#fff;font-size:50px;letter-spacing: .18em;">电子档案管理系统</h1>
        
      </div> -->
     
      <!-- <div class="left">
        <div class="word-box">
          <div class="company">九州通医药集团数字档案馆系统</div>
        </div>
      </div>
      <div class="right">
        <slot name="formBox"></slot>
      </div> -->
    </div>
  </div>
</template>

<script>
import {getconfig} from "@/api/login";
import topHeader from "./header.vue";
export default {
  props: {
    isLogin: {
      type: Boolean,
      default: () => false,
    },
    isRegister: {
      type: Boolean,
      default: () => false,
    },
  },
  data() {
    return {
      sysConfig:{},
      dynamicImage:'',
      sysName:'',
    };
  },
  components: {
    topHeader,
  },
  methods:{
    // 获取系统默认配置
    getconfig(){
      getconfig().then((res)=>{
        if(res.code == 100){
          let data = res.body.list || [];
          this.sysConfig = data;
          this.sysName = this.sysConfig[0].backgroundName;
          if(this.sysConfig.length>0){
            this.dynamicImage = `${this.sysConfig[0].backgroundImage}`;
          }
          this.$store.dispatch("user/setSysConfig",data)
        }
      })
    },
  },
  created() {
    this.getconfig();
  },
};
</script>

<style lang="scss" scoped>
.main-box {
  width: 100%;
  height: 100%;
  background-image: url("~@/assets/img/login/bg001.png");
  background-repeat: no-repeat;
  background-size:cover;
  position: relative;
  background-position: center;
  .content-box {
    width: 900px;
    margin: 0 auto;
    height: 420px;
    display: flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    flex-direction: row;
    .sider-left{
      flex:1;
      background-color: rgba(10, 62, 232, 0.1);
      padding-left: 20px;
      position: relative;
      border-radius: 10px 0 0 10px;
      .h1-title{
        font-size:3em;
        color:#fff;
      }
      .p-text{
        color:#fff;
        font-size:2em;
      }
      .img-icon{
        position: absolute;
        left: 50%;
        bottom: 0;
        width: 400px;
        height: 400px;
        opacity: .4;
        transform: translateX(-50%);
        z-index: -1;

      }
    }
    .sider-right{
      width: 370px;
      height: 100%;
    }
    .left {
      width: 50%;
      .word-box {
        padding-top: 30rem;
        color: #fff;
        .company {
          font-size: 42rem;
          margin-bottom: 30rem;
        }
        .system {
          font-size: 30px;
          color: #eee;
        }
      }
    }
    .right {
      flex: 1;
      position: relative;
    }
  }
}

// @media screen and(max-width: 3000px) {
//   // 1920
//   .main-box {
//     .content-box {
//       width: 1550px !important;
//       margin: 150px auto 0;
//     }
//   }
// }
// @media screen and(max-width: 1700px) {
//   // 1600, 1680
//   .main-box {
//     .content-box {
//       width: 1400px !important;
//       margin: 120px auto 0;
//     }
//   }
// }
// @media screen and(max-width: 1500px) {
//   // 1366, 1440
//   .main-box {
//     .content-box {
//       width: 1200px !important;
//       margin: 100px auto 0;
//     }
//   }
// }
</style>

