<template>
  <div>
    <div class="container normal-panel normal-margin flex-align-center flex-between">
      <edit v-if="tool.checkAuth($route.name,'update')" :basicInfo="siteinfo" @onSuccess="infoData"></edit>
      <i class="el-icon-refresh" @click="infoData"></i>
    </div>
    <basicInfo></basicInfo>
    <div class="container normal-panel">
      <el-descriptions title="安全配置"></el-descriptions>
    </div>
    <div class="panel">
      <div class="flex-align-center flex-between">
        <div class="flex-align-stretch">
          <img width="72" height="72" src="../../../assets/icons/login_type_1.png" alt="">
          <div class="text-panel">
            <p class="explain-title">密码安全强制要求</p>
            <p class="explain-tips">例:<span class="color-yellow">密码6位数，数字0-9，特殊符号~,!,@,#,$,%,^;</span></p>
          </div>
        </div>
        <set-password v-if="tool.checkAuth($route.name,'psdValidate')"></set-password>
      </div>
    </div>
    <div class="panel">
      <div class="flex-align-center flex-between">
        <div class="flex-align-stretch">
          <img width="72" height="72" src="../../../assets/icons/login_type_2.png" alt="">
          <div class="text-panel">
            <p class="explain-title">企业水印图片</p>
            <p class="explain-tips">当前设置：已上传水印图片</p>
          </div>
        </div>
        <set-watermark :basicInfo="basicInfo" v-if="tool.checkAuth($route.name,'setWatermark')"></set-watermark>
      </div>
    </div>
    <div class="panel">
      <div class="flex-align-center flex-between">
        <div class="flex-align-stretch">
          <img width="72" height="72" src="../../../assets/icons/login_type_3.png" alt="">
          <div class="text-panel">
            <p class="explain-title">登录方式</p>
            <p class="explain-tips">当前设置：账号登录，微信登录</p>
          </div>
        </div>
        <login-select v-if="tool.checkAuth($route.name,'loginType')"></login-select>
      </div>
    </div>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'

import basicInfo from './modules/basicinfo.vue'
import edit from './modules/edit.vue'

import setPassword from './modules/password.vue'
import setWatermark from './modules/watermark.vue'
import loginSelect from './modules/loginSelect.vue'

export default {
  components:{
    setPassword,
    setWatermark,
    loginSelect,
    basicInfo,
    edit
  },
  data () {
    return {
      basicInfo:{}
    }
  },
  computed:{
    ...mapGetters({
      siteinfo:'siteinfo'
    })
  },
  methods:{
    // 查询站点信息
    async infoData () {
      this.$store.dispatch('querySiteInfo',{
        "classname": "webmanage.site.site",
        "method": "querySite",
        "content": {}
      })
    }
  },
  mounted () {
    this.infoData()
  }
}

</script>
<style>
</style>
<style scoped>
.panel{
  padding: 50px;
  background: #fff;
  border-bottom: 1px solid #EEEEEE;
}
.panel img{
  margin-right: 30px;
}
.text-panel{
  display: flex;
  flex-direction:column;
  justify-content: space-between;
}
.explain-title{
  flex: 1 0 auto;
  width: 100%;
  font-size: 20px;
}
.explain-tips{
  color: #999999;
  font-size: 14px;
}
.color-yellow{
  color: #FA8C16;
}
</style>