<template>
  <div class="FlowFlowDiv">
    <div class="FlowFlowTitle">{{data.title?data.title:"办理过程"}}</div>
    <!--one start-->
    <div v-for="(obj, index) in array" class="FlowFH box">
      <div class="FlowFHLeft">
        <div class="FlowFHLine1"></div>
        <div class="FlowFHLine2"></div>
        <div class="FlowFHIcon box box_v box_center">
          <div v-show="!obj.imgBol" class="iconfont icon-touxiang"></div>
          <img v-show="obj.imgBol" class="FlowFHIconImg" :src="obj.icon" @load="imgLoad(index)">
        </div>
      </div>
      <div class="FlowFHRight box_f1">
        <div class="FFlowFHNode">{{obj.nodename}}</div>
        <div class="FFlowFHJiao"></div>
        <div class="FFlowFHDiv box box_v">
          <div class="FFlowFHDivH box box_i_center">
            <div :class="'FFlowFHType iconfont '+ getState(obj.state)"></div>
            <div class="FFlowFHTitle box_f1 slh">{{obj.title}}</div>
            <div class="FFlowFHDate">{{obj.date}}</div>
          </div>
          <div class="FFlowFHDivHD box_f1" v-html="obj.content"></div>
        </div>
      </div>
    </div>
    <!--one end-->
  </div>
</template>

<script>
    export default {
        name: "d-flowFlow",
        mounted() {
          if(this.data && this.data.data && Array.isArray(this.data.data))this.array = this.data.data
        },
        data () {
            return {
              array: []
            }
        },
        props: {
          data: Object
        },
        components: {},
        methods: {
          getState(state) {
            if(state=="yes") {
              return "icon-flow-yes"
            }else if(state=="no") {
              return "icon-flow-no"
            }else {
              return "icon-flow-load"
            }

          },
          imgLoad(index) {
            this.$set(this.array[index], "imgBol", true);
          }
        }
    }
</script>

<style scoped>
.FlowFlowDiv {
  width: 100%;
  height: auto;
  position: relative;
  margin-top: 15px;
}
.FlowFlowTitle {
  font-size: 15px;
  height: 50px;
  line-height: 50px;
  padding: 0 15px;
  box-sizing: border-box;
  background-color: #fff;
}
.FlowFH {
  padding: 0 15px;
  box-sizing: border-box;
  height: auto;
  width: 100%;
}
.FlowFHLeft {
  height: auto;
  position: relative;
  width: 60px;
  position: relative;
}
.FlowFHRight {
  height: auto;
  width: 0;
  position: relative;
}
.FlowFHLine1 {
  position: absolute;
  top: 0;
  left: 25px;
  height: 35px;
  width: 1px;
  background-color: #ddd;
  border-right: 1px solid #fff;
}
.FlowFHLine2 {
  position: absolute;
  bottom: 0;
  left: 25px;
  height: 100%;
  width: 1px;
  background-color: #ddd;
  border-right: 1px solid #fff;
}
.FlowFH:last-child .FlowFHLine2 {
  display: none;
}
.FlowFHIcon {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 35px;
  left: 4px;
  border-radius: 40px;
  position: relative;
  overflow: hidden;
  border: 1px solid #fff;
  background-color: #4d97ff;
  color: #fff;
  text-align: center;
  line-height: 40px;
  font-size: 18px;
}
.FlowFHIconImg {
  top: 0;
  left: 0;
  max-width: 100%;
}
.FFlowFHNode {
  font-size: 13px;
  color: #999;
  height: 35px;
  line-height: 50px;
}
.FFlowFHTitle {
  font-size: 14px;
  width: 100%;
}
.FFlowFHJiao {
  width: 10px;
  height: 10px;
  border-bottom: 1px solid #ddd;
  border-left: 1px solid #ddd;
  transform: rotate(45deg);
  position: absolute;
  left: -5px;
  top: 50px;
  z-index: 2;
  background-color: #fff;
}
.FFlowFHDiv {
  width: 100%;
  min-height: 80px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #fff;
  position: relative;
}
.FFlowFHDate {
  font-size: 13px;
  color: #999;
  min-width: 90px;
  text-align: right;
}
.FFlowFHDivHD {
  color: #999;
  font-size: 13px;
}
.FFlowFHDivH {
  height: 30px;
  width: 100%;
  position: relative;
  line-height: 30px;
  box-sizing: border-box;
}
.FFlowFHType {
  width: 15px;
  height: 15px;
  margin-right: 5px;
  color: #fff;
  border-radius: 20px;
  line-height: 15px;
  font-size: 12px;
  text-align: center;
}
.icon-flow-load {
  background-color: #f60;
}
.icon-flow-no {
  background-color: #f20;
}
.icon-flow-yes {
  background-color: #04be02;
}
</style>
