<template>
  <div id="model-0">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="btn">
          <slot></slot>
        </el-col>
        <el-col :span="24" class="info">
          <el-col :span="24" class="top">
            <el-col :span="6" class="left">
              <el-image :src="getImage(data.img_path)">
                <template #error>
                  <el-image :src="expetImg"></el-image>
                </template>
              </el-image>
            </el-col>
            <el-col :span="18" class="right">
              <el-col :span="24" class="name textOver">
                {{ data.name || '暂无' }}
              </el-col>
              <el-col :span="24">
                <el-col :span="4" class="otherInfo textOver"> 工作单位 </el-col>
                <el-col :span="20" class="otherInfo textOver">
                  {{ data.company || '暂无' }}
                </el-col>
              </el-col>
              <el-col :span="12">
                <el-col :span="8" class="otherInfo textOver"> 毕业院校 </el-col>
                <el-col :span="16" class="otherInfo textOver">
                  {{ data.school || '暂无' }}
                </el-col>
              </el-col>
              <el-col :span="12">
                <el-col :span="8" class="otherInfo textOver"> 最高学历 </el-col>
                <el-col :span="16" class="otherInfo textOver">
                  {{ data.education || '暂无' }}
                </el-col>
              </el-col>
              <el-col :span="12">
                <el-col :span="8" class="otherInfo textOver"> 出生日期 </el-col>
                <el-col :span="16" class="otherInfo textOver">
                  {{ data.birthDate || '暂无' }}
                </el-col>
              </el-col>
              <el-col :span="12">
                <el-col :span="8" class="otherInfo textOver"> 职务职称 </el-col>
                <el-col :span="16" class="otherInfo textOver">
                  {{ data.zwzc || '暂无' }}
                </el-col>
              </el-col>
              <el-col :span="12">
                <el-col :span="8" class="otherInfo textOver"> 电子邮箱 </el-col>
                <el-col :span="16" class="otherInfo textOver">
                  {{ data.email || '暂无' }}
                </el-col>
              </el-col>
              <el-col :span="12">
                <el-col :span="8" class="otherInfo textOver"> 擅长领域 </el-col>
                <el-col :span="16" class="otherInfo textOver">
                  {{ data.expertise || '暂无' }}
                </el-col>
              </el-col>
            </el-col>
          </el-col>
          <el-col :span="24" class="down">
            <el-col :span="24" class="downInfo">
              <el-col :span="4" class="tit">
                <h2>工作经历</h2>
              </el-col>
              <el-col :span="20" class="info">
                {{ data.workexperience || '暂无' }}
              </el-col>
            </el-col>
            <el-col :span="24" class="downInfo">
              <el-col :span="4" class="tit">
                <h2>科研综述</h2>
              </el-col>
              <el-col :span="20" class="info">
                {{ data.scientific || '暂无' }}
              </el-col>
            </el-col>
            <el-col :span="24" class="downInfo">
              <el-col :span="4" class="tit">
                <h2>承担项目</h2>
              </el-col>
              <el-col :span="20" class="info">
                {{ data.undertakingproject || '暂无' }}
              </el-col>
            </el-col>
            <el-col :span="24" class="downInfo">
              <el-col :span="4" class="tit">
                <h2>科技奖励</h2>
              </el-col>
              <el-col :span="20" class="info">
                {{ data.scienceaward || '暂无' }}
              </el-col>
            </el-col>
            <el-col :span="24" class="downInfo">
              <el-col :span="4" class="tit">
                <h2>社会任职</h2>
              </el-col>
              <el-col :span="20" class="info">
                {{ data.social || '暂无' }}
              </el-col>
            </el-col>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
const _ = require('lodash');
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-0',
  props: {
    data: { type: Object },
  },
  components: {},
  data: function () {
    return { expetImg: require('@a/expert.png') };
  },
  created() {},
  methods: {
    getImage(data) {
      if (_.map(data, 'url')[0]) {
        return _.map(data, 'url')[0];
      }
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .btn {
    text-align: right;
    margin: 0 0 10px 0;
  }
  .info {
    .top {
      height: 230px;
      overflow: hidden;
      .left {
        text-align: center;
        .el-image {
          width: 100%;
          height: 220px;
        }
      }
      .right {
        padding: 0 0 0 10px;
        .name {
          font-size: 18px;
          font-weight: bold;
          padding: 10px;
          text-align: center;
          border: 1px solid #ccc;
        }
        .otherInfo {
          font-size: 16px;
          padding: 10px;
          border: 1px solid #ccc;
        }
      }
    }
    .down {
      margin: 0 0 15px 0;
      .downInfo {
        border: 1px solid #ccc;
        .tit {
          height: 150px;
          line-height: 150px;
          text-align: center;
          border-right: 1px solid #ccc;
        }
        .info {
          font-size: 16px;
          padding: 10px;
          min-height: 150px;
        }
      }
    }
  }
}
</style>
