flownode.vue
2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<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>