<template>
  <div class="apploval-node">
    <div class="el-step-line"></div>
    <div class="steps-wrap">
      <div v-for="(item,index) in processList" class="step">
        <span class="step-icon"
        :class="{'doing': index==2, 'finish': index<2, 'skip': index==3, 'turn-to': index==4}"></span>
        <span class="node">{{index+1}}.{{item.role}}</span>
        <span class="name">{{item.name}}</span>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'approval-node',
    mounted: function () {

    },
    methods: {

    },
    data() {
      return {
        processList: [{role: '销售负责人', name: '张三'},{role: '事业部负责人', name: '李四'},
          {role: '产品负责人', name: '王五'}, {role: 'COO审批', name: '马冬梅'},
          {role: 'FAE负责人', name: '张三'}, {role: '协作部门负责人', name: '王钢蛋'}
        ],
        active: 0,
        dataId: '',
      }
    }
  }
</script>

<style scoped lang="scss">
.apploval-node{
  border-top: 1px solid #f4f4f4;
  background-color: #fff;
  padding: 20px 0;
  position: relative;

  .steps-wrap{
    max-width: 1180px;
    width: 60%;
    margin: 0 auto;
    display: flex;

    .step-icon{
      width: 40px;
      height: 40px;
      background: url('~@/assets/img/node/no-start.png') no-repeat;
      background-size: 100% 100%;
      border-radius: 50%;
      position: relative;
      z-index: 9;
    }
    .doing{
      background: url('~@/assets/img/node/doing.png') no-repeat;
    }
    .finish{
      background: url('~@/assets/img/node/finish.png') no-repeat;
    }
    .skip{
      background: url('~@/assets/img/node/skip.png') no-repeat;
    }
    .turn-to{
      background: url('~@/assets/img/node/turn-to.png') no-repeat;
    }
    .step {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      span {
        font-size: 14px;
        line-height: 19px;
        white-space: nowrap;
        &:nth-child(2){
          font-weight: bold;
          padding: 5px;
        }
      }
    }

  }

  .el-step-line {
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translate( -50%, -32%);
    max-width: 1300px;
    width: 68%;
    height: 2px;
    background: rgba(221, 221, 221, 0.39);
    border-radius: 5px;
    margin: 0 auto;
  }
}

</style>
