11
11
<el-input type =" text" v-model =" form.workflowDescription" ></el-input >
12
12
</el-form-item >
13
13
</el-form >
14
- <el-table :data =" tableData" border style =" width : 100% " >
14
+ <el-button @click =" createWorkflowStep" class =" fl-right mg" type =" primary" >新增</el-button >
15
+ <el-table :data =" form.workflowStep" border style =" width : 100% " >
15
16
<el-table-column label =" 是否是完结流节点" prop =" isEnd" >
16
- <template scope="scope">
17
+ <template slot- scope="scope">
17
18
<el-select placeholder =" 请选择" v-model =" scope.row.isEnd" >
18
19
<el-option
19
20
:key =" key"
25
26
</template >
26
27
</el-table-column >
27
28
<el-table-column label =" 是否是开始流节点" prop =" isStrat" >
28
- <template scope="scope">
29
+ <template slot- scope="scope">
29
30
<el-select placeholder =" 请选择" v-model =" scope.row.isStrat" >
30
31
<el-option
31
32
:key =" key"
37
38
</template >
38
39
</el-table-column >
39
40
<el-table-column label =" 操作者级别id" prop =" stepAuthorityID" >
40
- <template scope="scope">
41
+ <template slot- scope="scope">
41
42
<el-input placeholder =" 请输入" type =" text" v-model =" scope.row.stepAuthorityID" ></el-input >
42
43
</template >
43
44
</el-table-column >
44
45
<el-table-column label =" 工作流名称" prop =" stepName" >
45
- <template scope="scope">
46
+ <template slot- scope="scope">
46
47
<el-input placeholder =" 请输入" type =" text" v-model =" scope.row.stepName" ></el-input >
47
48
</template >
48
49
</el-table-column >
49
50
<el-table-column label =" 步骤id" prop =" stepNo" >
50
- <template scope="scope">
51
+ <template slot- scope="scope">
51
52
<el-input placeholder =" 请输入" type =" text" v-model =" scope.row.stepNo" ></el-input >
52
53
</template >
53
54
</el-table-column >
54
55
</el-table >
55
- <el-button @click =" submit" type =" primary" >提交</el-button >
56
+ <el-button @click =" submit" type =" primary" class = " fl-right mg " >提交</el-button >
56
57
</div >
57
58
</template >
58
59
59
60
<script >
60
61
import { createWorkFlow } from ' @/api/workflow'
61
62
export default {
62
- name: ' workflow ' ,
63
+ name: ' Workflow ' ,
63
64
data () {
64
65
return {
65
66
form: {
66
67
workflowName: ' ' ,
67
68
workflowDescription: ' ' ,
68
- workflowNickName: ' '
69
+ workflowNickName: ' ' ,
70
+ workflowStep: [
71
+ {
72
+ isEnd: false ,
73
+ isStrat: true ,
74
+ stepAuthorityID: ' ' ,
75
+ stepName: ' ' ,
76
+ stepNo: ' '
77
+ }
78
+ ]
69
79
},
70
- tableData: [
71
- {
72
- isEnd: ' ' ,
73
- isStrat: ' ' ,
74
- stepAuthorityID: ' ' ,
75
- stepName: ' ' ,
76
- stepNo: ' '
77
- }
78
- ],
79
80
options: [
80
81
{
81
82
name: ' 是' ,
@@ -88,28 +89,27 @@ export default {
88
89
]
89
90
}
90
91
},
91
- component: {},
92
92
methods: {
93
+ createWorkflowStep () {
94
+ this .form .workflowStep .push ({
95
+ isEnd: false ,
96
+ isStrat: false ,
97
+ stepAuthorityID: ' ' ,
98
+ stepName: ' ' ,
99
+ stepNo: ' '
100
+ })
101
+ },
93
102
async submit () {
94
- let params = {
95
- workflowDescription: this .form .workflowDescription ,
96
- workflowName: this .form .workflowName ,
97
- workflowNickName: this .form .workflowNickName ,
98
- workflowStep: [
99
- {
100
- isEnd: this .tableData [0 ].isEnd ,
101
- isStrat: this .tableData [0 ].isStrat ,
102
- stepAuthorityID: this .tableData [0 ].stepAuthorityID ,
103
- stepName: this .tableData [0 ].stepName ,
104
- stepNo: this .tableData [0 ].stepNo
105
- }
106
- ]
103
+ const res = await createWorkFlow (this .form )
104
+ if (res .success ){
105
+ this .$message ({
106
+ message: " 创建成功" ,
107
+ type: " success"
108
+ })
107
109
}
108
- const res = await createWorkFlow (params)
109
- console .log (res)
110
110
}
111
111
}
112
112
}
113
113
</script >
114
- <style scoped >
114
+ <style >
115
115
</style >
0 commit comments