flownode.vue 3.51 KB
<template>
  <div class="flowBox">
    <div class="node-wrap">
      <!-- <el-popover
        placement="top-start"
        width="400"
        v-for="node in flowData.Nodes.ManualNode" 
        :key="node.id"
        trigger="click">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>卡片名称</span>
            <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
          </div>
          <div v-for="o in 4" :key="o" class="text item">
            {{'列表内容 ' + o }}
          </div>
        </el-card>
        
        <div class="node" 
            slot="reference"
            :class="[
              {'wjh' : node.activityState == 1},
              {'jh' : node.activityState == 2 },
              {'gq' : node.activityState == 3 },
              {'wc' : node.activityState == 4 },
              {'zz' : node.activityState == 5 }
            ]" 
        >
          {{node.name}}
        </div>
      </el-popover> -->

      <div class="node" 
          v-for="node in flowData.Nodes.ManualNode" 
          :key="node.id"
          @click="nodeClick(node.name)"
          :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:{
    nodeClick(name){
      this.$parent.getCurNode(name)
    }
  },
  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>