<style>
  .empInfo_Dialog .classFirst {
    color: #000000;
    font-weight: bold;
  }

  .empInfo_Dialog .className {
    margin-left: 10px;
  }

  .empInfo_Dialog .classStatus {
    padding: 3px 8px;
    background-color: #c8d7fc;
    color: #2961FE;
    font-size: 12px;
    border-radius: 2px;
    margin-left: 20px;
  }

  .empInfo_Dialog .normalName {
    color: #999999;
    font-size:12px;
  }

  .empInfo_Dialog .normalInner {
    color: #111111;
    font-weight: bold;
    font-size:12px;
    margin-top:5px;
  }
  .Employee_Top{
    display: flex;
    margin:20px;
    justify-content: space-between;
    align-items: center;
  }
  .Employee_Top .q-avatar__content{
    font-size:30px!important;
  }
  .Employee_Name{
    margin:5px 0 0 10px;
    color:#111111;
  }
  .Employee_Name div:first-child{
    font-size:12px;
  }
  .Employee_Name div:last-child{
    font-weight: bold;
    margin-top:5px;
    font-size:15px;
  }
  .Emloyee_CompanyInfo{
    display: flex;
    justify-content: space-between;
    margin:0 18px 25px;
    border-bottom:1px solid #d1d1d1;
    padding-bottom:20px;
  }
  .empInfo_Dialog .employee_MenuList {
    width: 96%;
    margin:25px auto;
    height: 40px;
    border-radius: 3px!important;
    border: 1px solid #2961FE;
    color: #2961FE;
    align-items: center;
    font-size: 12px;
    white-space: nowrap;
  }
  .empInfo_Dialog .checkedRole {
    background-color: #2961FE;
    color: #fff;
  }
  .empInfo_Dialog .employee_MenuList span {
    padding:0 20px;
    display: inline-block;
    text-align: center;
    height: 100%;
    line-height: 38px;
    cursor: pointer;
}
</style>
<template>
  <q-dialog v-model="persistent" maximized full-height seamless position="right" @hide="closeShenheForm">
    <q-card style="margin-top:61px;width:800px" class="no-border-radius empInfo_Dialog">
      <div class="Employee_Top">
        <div style="display:flex;">
          <div>
            <q-avatar size="60px" v-if="saveObj.UserIcon">
              <img :src="saveObj.UserIcon" />
            </q-avatar>
            <q-avatar size="60px" color="teal-10" text-color="white" v-if="!saveObj.UserIcon">
            {{saveObj.EmployeeName.substring(0,1)}}</q-avatar>
          </div>
          <div class="Employee_Name">
            <div>姓名</div>
            <div>{{saveObj.EmployeeName}}</div>
          </div>
        </div>
        <div>
          <q-btn label="调岗" color="accent q-px-md" size="10px" style="font-weight:400 !important;margin-right:10px;" />
          <q-btn label="调部门" color="accent q-px-md" size="10px" style="font-weight:400 !important;" />
        </div>
      </div>
      <div class="Emloyee_CompanyInfo">
        <div>
          <div class="normalName">公司</div>
          <div class="normalInner">{{saveObj.SchoolName}}</div>
        </div>
        <div>
          <div class="normalName">部门</div>
          <div class="normalInner">{{saveObj.DeptName}}</div>
        </div>
        <div>
          <div class="normalName">岗位</div>
          <div class="normalInner">{{saveObj.PostName}}</div>
        </div>
        <div>
          <div class="normalName">电话</div>
          <div class="normalInner">{{saveObj.EmployeeTel}}</div>
        </div>
      </div>
      <div class="employee_MenuList">
        <span @click="getItem(item,index)" :class="{'checkedRole':index==checkedIndex}"
          v-for="(item,index) in menuList" :key="index">{{item.name}}
        </span>
      </div>
      <div v-if="tabCheck==0" style="margin:0 15px;">
        <employeeRemark :saveObj="saveObj"></employeeRemark>
      </div>
      <div v-if="tabCheck==1">
        <employeeDetails :saveObj="saveObj"></employeeDetails>
      </div>
      <div v-if="tabCheck==2">
        <employeeLog :saveObj="saveObj"></employeeLog>
      </div>
      <div v-if="tabCheck==3">
        <employeeFile :saveObj="saveObj"></employeeFile>
      </div>
      <div v-if="tabCheck==4">
        <employeeFinace :saveObj="saveObj"></employeeFinace>
      </div>
    </q-card>
    <div class="dialog-out-close" @click="closeShenheForm"
      style="height:40px !important;border-top-left-radius: 4px !important;border-bottom-left-radius: 4px !important;">
      <q-icon name="iconfont icon-jujue1" size="26px" />
    </div>
  </q-dialog>
</template>

<script>
  import employeeDetails from '../manager/employee_details';
  import employeeRemark from '../manager/employee-remark';
  import employeeLog from '../manager/employee_log';
  import employeeFile from '../manager/employee_file';
  import employeeFinace from '../manager/employee_finace';
  export default {
    props: {
      saveObj: {
        type: Object,
        default: null
      }
    },
    components: {
      employeeDetails,
      employeeRemark,
      employeeLog,
      employeeFile,
      employeeFinace
    },
    data() {
      return {
        persistent: true,
        tabCheck: 0, //默认选第一个
        loading: false,
        checkedIndex:0,
        menuList:[{
          name:'行政备注',
          id:0
        },{
          name:'详细资料',
          id:1
        },{
          name:'日志记录',
          id:2
        },{
          name:'附件',
          id:3
        },{
          name:'财务单据',
          id:4
        }]
      }
    },
    created() {},
    mounted() {
      console.log("aaa", this.saveObj);
    },
    methods: {
      closeShenheForm() {
        this.persistent = false;
        this.$emit('close');
      },
      //点击切换
      getItem(item,index){
        this.checkedIndex=index;
        this.tabCheck=item.id;
      },
    },
  }

</script>
