<template>
  <section class="staffBoxFlex">
    <div class="staffTitle">
      <strong>图像材料</strong>
      <!-- <em><i>编辑</i><i>保存</i></em> -->
    </div>
    <div class="staffContext staffPic">
      <div>
        <strong>一寸免冠白底彩照：</strong>
        <el-avatar  :src="userInfo.oneInchColorWhitePhoto" style="width:200px;height:auto">
          <img src="~@/assets/staffImgs/staffAvatar200.png" />
        </el-avatar>
      </div>
      <div>
        <strong>两寸免冠蓝底彩照：</strong>
        <el-avatar  :src="userInfo.twoInchColorBluePhoto" style="width:200px;height:auto">
                <img src='~@/assets/staffImgs/staffAvatar200.png'/>
        </el-avatar>
       </div>
    </div>
  </section>
</template>
<script>
import { employessBaseInfoApi } from "@/api/staffApi.js";
export default {
  data() {
    return {
      userInfo: {},
    };
  },
  mounted() {
    this.employessBaseInfo();
  },
  methods: {
    employessBaseInfo() {
      let obj = this.$parent.$parent.staffinfo;
      let obj2 = { domainId: this.$route.query.domainId };
      employessBaseInfoApi(obj, obj2).then((response) => {
        if (response.status == 200) {
          this.userInfo = response.data.userInfo;
           if(this.userInfo.oneInchColorWhitePhoto&&this.userInfo.oneInchColorWhitePhoto.indexOf('http')==-1){
                this.userInfo.oneInchColorWhitePhoto=location.origin+'/obpm'+this.userInfo.oneInchColorWhitePhoto
           }
           if(this.userInfo.twoInchColorBluePhoto&&this.userInfo.twoInchColorBluePhoto.indexOf('http')==-1){
                this.userInfo.twoInchColorBluePhoto=location.origin+'/obpm'+this.userInfo.twoInchColorBluePhoto
           }
        }
      });
    },
  },
};
</script>
<style lang="scss">
.staffBoxFlex {
  display: flex;
  flex-direction: column;
  .staffTitle {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ebebeb;
    padding: 5px 0;
    margin-bottom: 10px;
    strong {
      color: #000;
      font-weight: normal;
    }
    em {
      margin-right: 20px;
      i {
        color: #2e8ad7;
        margin-right: 20px;
        cursor: pointer;
      }
    }
  }
  .staffPic {
    display: flex;
    margin-top: 20px;
    div {
      display: flex;
      margin-right: 15%;
      min-width: 310px;
      img {
        width: 200px;
        height: 200px;
      }     
    }
  }
}
</style>
