FlowTestPlugin.vue
4.71 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<template>
<div class="form-inline">
<label class="control-label">{{node.name}}({{node.nodeId}})</label>
<el-button type="primary" size="mini" @click="editAutoService">设置测试插件</el-button>
<el-dialog
width="70%"
title="设置测试插件"
:visible="dialogVisibleSetting"
:before-close="close"
:close-on-click-modal="false"
append-to-body
top="8vh"
>
<div style="width:100%;height: 550px;overflow: auto;">
<div style="margin-bottom: 10px;">
<el-button type="success" size="mini" @click="save" icon="el-icon-check">保 存</el-button>
<el-button type="danger" size="mini" @click="close" icon="el-icon-close">关 闭</el-button>
</div>
<table class="form-table" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<th width="130px">消息内容:</th>
<td>
<ht-input
v-model="testPlugin.testMessage"
class="ht"
placeholder="请输入测试消息"
autocomplete="off"
></ht-input>
</td>
</tr>
</tbody>
</table>
</div>
</el-dialog>
</div>
</template>
<script>
import req from "@/request.js";
import { mapState, mapActions } from "vuex";
import { Message } from "element-ui";
export default {
name: "test-plugin",
components: {},
props: {
//任务节点信息
node: {
type: Object,
required: true
},
//流程配置信息
defConfigData: {
type: Object,
required: true
}
},
data() {
return {
curEditSetting: "", //修改接收人配置的时候用于判断是修改富文本消息的还是修改普通消息的
curEditRuleIndex: "", //下标,用于记录修改接收人配置的时候是哪条数据
tabType: "message", //scriptNode:脚本任务,message:消息任务
dialogVisibleSetting: false,
isEdit: false, //是否编辑自动任务节点
testPlugin: {}
};
},
methods: {
//设置自动任务
editAutoService() {
let Base64 = require("js-base64").Base64;
this.dialogVisibleSetting = true;
//根据定义id和节点id查询该自动任务节点是否已经配置过
let this_ = this;
req
.get(
"${bpmModel}/flow/plugins/v1/getTestPlugin?defId=" +
this.node.defId +
"&nodeId=" +
this.node.nodeId
)
.then(function(data) {
data = data.data;
if (data) {
this_.testPlugin = data;
}else{
this_.testPlugin = {};
}
});
},
save() {
let this_ = this;
//消息任务
let url = "${bpmModel}/flow/plugins/v1/saveTestPlugin?defId="+this.node.defId+"&nodeId="+this.node.nodeId;
req.post(url, JSON.stringify(this.testPlugin)).then(function(data) {
data = data.data;
if (data.state) {
this_.dialogVisibleSetting = false;
Message.success("消息任务配置成功");
} else {
Message.error(data.message);
}
});
},
//关闭自动任务设置列弹框
close() {
this.dialogVisibleSetting = false;
}
},
mounted() {
this.$validator = this.$root.$validator;
}
};
</script>
<style lang="scss" scoped>
div >>> .el-dialog__body {
padding: 10px 20px;
color: #606266;
font-size: 14px;
word-break: break-all;
}
.ht_ce {
margin-top: -10px !important;
}
.div_list {
height: 30px;
background: #e2e2e2;
line-height: 30px;
font-weight: bold;
padding-left: 10px;
margin-bottom: 10px;
}
>>> label.el-checkbox {
margin: 5px 10px 0 0;
}
.ht {
width: 100%;
}
.form-inline {
float: left;
width: 100%;
}
.left-label {
width: 18%;
float: left;
}
.control-label {
word-break: break-all;
text-align: right;
color: #545252;
font-size: 12px;
padding: 0px 10px !important;
font-weight: bold;
line-height: 35px;
}
div >>> .box-card {
margin-bottom: 20px;
}
div >>> .box-card .clearfix {
padding-top: 20px;
}
div >>> .el-collapse-item__header {
height: 40px;
line-height: 40px;
font-size: 14px;
font-weight: bold;
}
div >>> .el-button {
padding: 7px;
margin-right: 10px;
margin-left: 0px !important;
}
.table > thead > tr > th,
.table > thead > th,
.table > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tr > td,
.table > tfoot > tr > td {
border-top: 1px solid #e7eaec;
border-left: 1px solid #e7eaec;
line-height: 1.42857;
padding: 4px 8px;
vertical-align: middle;
text-align: center;
}
.table {
border-bottom: 1px solid #e7eaec;
border-right: 1px solid #e7eaec;
width: 100%;
border-spacing: 0;
}
</style>