flownode.vue
3.53 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<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: 110px;
line-height: 50px;
background-color: #A9A9A9;
text-align: center;
border-radius: 6px;
margin-right: 50px;
position: relative;
color: #ffffff;
}
.node::after{
content: "";
position: absolute;
width: 50px;
top: 10px;
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>