flownode.vue 2.47 KB
<template>
  <div class="flowBox">
    <div class="node-wrap">
      <div class="node" 
          v-for="node in flowData.Nodes.ManualNode" 
          :key="node.id"
          :class="[
            {'wjh' : node.activityState == 1},
            {'jh' : node.activityState == 2 },
            {'gq' : node.activityState == 3 },
            {'wc' : node.activityState == 4 },
            {'zz' : node.activityState == 5 }
          ]" 
      >
        {{node.name}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name:"",
  components:{},
  props:{
    flowData:{
      type:Object,
      default:null
    },
    flowState:{
      type:Array,
			default: () => {
				return [];
			},
    },
  },
  data(){
    return {
    }
  },
  created(){},
  mounted(){
    this.$nextTick(()=>{
      console.log(this.flowData,'flowData.Nodes'); 
      console.log(this.flowState,'flowState');
    })
  },
  methods:{},
  computed: {},
  watch: {},
}
</script>
<style scoped  lang="less">
.flowBox{
		width: 150%;
    height: 100%;
    position: relative;
  	//    网格背景
		background-image: -webkit-gradient(
				linear,
				left top,
				right top,
				color-stop(10%, rgba(0, 0, 0, 0.15)),
				color-stop(10%, rgba(0, 0, 0, 0))
			),
			-webkit-gradient(linear, left top, left bottom, color-stop(10%, rgba(0, 0, 0, 0.15)), color-stop(10%, rgba(0, 0, 0, 0)));
		background-image: linear-gradient(
				90deg,
				rgba(0, 0, 0, 0.15) 10%,
				rgba(0, 0, 0, 0) 10%
			),
			linear-gradient(rgba(0, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 10%);
    background-size: 10px 10px;
    .node-wrap{
      position: absolute;
      top: 50%;
      left: 20px;
      .node{
        display: inline-block;
        min-width: 80px;
        line-height: 30px; 
        background-color: #A9A9A9;
        text-align: center;
        border-radius: 6px;
        margin-right: 50px;
        position: relative;
        color: #ffffff;
      }
      .node::after{
        content: "";
        position: absolute;
        width: 50px;
        height: 30px;
        left: 100%;
        background-image: url("../../../assets/images/arrow.jpg");
        background-size: 50px 30px;
      }
      .node:last-child:after{
        display: none;
      }
      .wjh{
        background-color: #A9A9A9;
      }
      .jh{
        background-color: #449D44;
      }
      .gq{
        background-color: #F0AD4E;
      }
      .wc{
        background-color: #5BC0DE;
      }
      .zz{
        background-color: #F13F2F;
      }
    }
}
</style>