<template>
  <div  style="display:flex;padding-top: 20px;padding-left: 20px">
    <div>
      <el-descriptions :column="4">
        <el-descriptions-item :label="$t(`企业名称`)">{{enterprise.enterprisename?enterprise.enterprisename:'--'}}</el-descriptions-item>
        <el-descriptions-item :label="$t(`企业简称`)">{{enterprise.abbreviation}}</el-descriptions-item>
        <el-descriptions-item :label="$t(`法人`)">{{enterprise.contact}}</el-descriptions-item>
        <el-descriptions-item :label="$t(`电话`)">{{enterprise.phonenumber}}</el-descriptions-item>
      </el-descriptions>
      <div style="font-size: 14px">
        {{$t(`企业操作页LOGO:`)}}
      </div>
      <div class="image-panel" style="width: 100px;height: 100px">
          <img v-show="img.usetype === 'actionlogo'" v-for="img in siteinfo.attinfos" :key="img.index" style="width:100%" :src="img.url" alt="">
      </div>
    </div>
  </div>
</template>

<script>
import {mapGetters} from 'vuex'
import edit from './edit.vue'

export default {
  data () {
    return {
      enterprise:{},
      drawer:false,
      sys_enterpriseid:''
    }
  },
  components:{edit},
  computed:{
    ...mapGetters({
      siteinfo:'siteinfo',
      closeDrawerTemp:'closeDrawerTemp',
    }),
    show () {
      console.log(this.siteinfo);

      if (this.siteinfo.attinfos.some(item=>item.usetype === 'actionlogo')) {
        return false
      } else {
        return true
      }
    }
  },
  methods:{
     onShowDtail () {
      this.$store.dispatch('changeDetailDrawer',true),this.$router.push({path:'/enterpriseDetail',query:{basicInfo:this.siteinfo,id:this.sys_enterpriseid}})
     },
    async enterpriseData(){
      const res = await this.$api.requested({
        "id": 20221022165203,
        "content": {

        }
      })
      console.log(res,"企业信息")
      this.enterprise = res.data
      this.sys_enterpriseid = res.data.sys_enterpriseid
    },
    siteInfos () {
      this.$store.dispatch('querySiteInfo',{
        "classname": "webmanage.site.site",
        "method": "querySite",
        "content": {}
      })
    },
    closeDrawer () {
      this.drawer = false
    },
  },
  mounted () {
    this.enterpriseData()
  },
  watch:{
    closeDrawerTemp (val) {
    /*  !val?this.enterpriseData() this.queryImg():""*/
      if (!val){
        this.enterpriseData()
        /*this.queryImg()*/
        this.siteInfos()
      }
    }
  }
}

</script>
<style scoped>
/deep/.el-descriptions:last-child .el-descriptions-row {
  display: inline-block;
}
</style>
