<template>
  <div class="participants_content">
    <div class="title">
      <div>新增人员</div>
      <div><el-button type="primary" icon="el-icon-plus" size="mini" @click="drawer = true">添加</el-button></div>
    </div>
    <div v-for="item in list" :key="item.name" class="participant_info">
      <div class="p_icon">
        <i class="el-icon-user" />
      </div>
      <div class="p_info">
        <div
          class="p_info_basic"
          :style="{maxWidth:w+'px','white-space': 'nowrap',
                   overflow: 'hidden',
                   'text-overflow': 'ellipsis'}"
        >
          <div class="p_text">{{ item.name }}</div>
          <div class="p_text" style="margin:0 10px">{{ item.role }}</div>
          <div class="p_text">{{ item.phone }}</div>
        </div>
        <div class="p_text">{{ item.email }}</div>
        <div class="p_text">{{ item.site }}</div>
      </div>
      <div class="p_func">
        <el-button type="text"><i class="el-icon-edit-outline" style="font-size: 20px;" /></el-button>
        <el-button type="text"><i class="el-icon-delete" style="font-size: 20px;" /></el-button>
      </div>
    </div>
    <el-drawer
      title="添加"
      :visible.sync="drawer"
      direction="btt"
      size="50%"
    >
      <div style="padding: 0 10px">
        <el-form :model="form" label-width="80px" label-position="left">
          <el-form-item label="性">
            <el-input v-model="form.name" />
          </el-form-item>
          <el-form-item label="名">
            <el-input v-model="form.name" />
          </el-form-item>
          <el-form-item label="角色">
            <el-select v-model="form.region">
              <el-option label="区域一" value="shanghai" />
              <el-option label="区域二" value="beijing" />
            </el-select>
          </el-form-item>
          <el-form-item label="电话号码">
            <el-input v-model="form.name" />
          </el-form-item>
          <el-form-item label="邮箱">
            <el-input v-model="form.name" />
          </el-form-item>
        </el-form>
      </div>
    </el-drawer>
  </div>
</template>
<script>
export default {
  name: 'ParticipantsResearch',
  data() {
    return {
      list: [
        {
          name: '张三',
          role: 'CRC',
          phone: '13000009999',
          email: 'zhangsan@zhizhun.com',
          site: '人民医院'
        },
        {
          name: '李四',
          role: 'CRA',
          phone: '14555509999',
          email: 'lisi@zhizhun.com',
          site: '同济医院'
        },
        {
          name: '王五',
          role: 'CRA',
          phone: '18888809999',
          email: 'wang@zhizhun.com',
          site: '协和医院'
        }
      ],
      drawer: false,
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      w: 0
    }
  },
  mounted() {
    this.w = document.body.clientWidth - 200
    console.log(document.body.clientWidth)
  },
  methods: {

  }
}
</script>
<style lang="scss" scoped>
.participants_content{
  background: #fff;
  padding: 10px;
  .title{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  .participant_info{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #f5f7fa;
    .p_icon{
      width: 70px;
      font-size: 25px;
      font-weight: bold;
      text-align: center;
    }
    .p_info{
      position: relative;
      flex:1;
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      // border-right: 1px solid #f5f7fa;
      font-size: 13px;
    }
    .p_info:after {
        content: '';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 0;
        height: 50px;
        width: 1px;
        background-color: #f5f7fa;
    }
    .p_info_basic{
      display: flex;
      flex-direction: row;
      align-items: center;

    }
    .p_text{
      line-height: 25px;
      color: #82848a;
    }
    .p_func{
      width: 80px;
      padding: 0 10px;
      text-align: center;
    }
  }
}

</style>
