|
|
@@ -28,6 +28,20 @@
|
|
28
|
28
|
<el-form-item label="权限字符" prop="buttonAuthFlag">
|
|
29
|
29
|
<el-input v-model="ruleForm.buttonAuthFlag" placeholder="请输入"></el-input>
|
|
30
|
30
|
</el-form-item>
|
|
|
31
|
+ <el-form-item label="节点图标" prop="nodeIcon">
|
|
|
32
|
+ <el-upload
|
|
|
33
|
+ class="avatar-uploader"
|
|
|
34
|
+ :action="uploadImgUrl"
|
|
|
35
|
+ :show-file-list="false"
|
|
|
36
|
+ :headers="headers"
|
|
|
37
|
+ :data="filedata"
|
|
|
38
|
+ :on-success="handleAvatarSuccess"
|
|
|
39
|
+ :before-upload="beforeAvatarUpload">
|
|
|
40
|
+ <img v-if="imageUrl" :src="imgSvgUrl" class="avatar">
|
|
|
41
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
42
|
+ <div slot="tip" class="el-upload__tip">只能上传SVG图片</div>
|
|
|
43
|
+ </el-upload>
|
|
|
44
|
+ </el-form-item>
|
|
31
|
45
|
</el-form>
|
|
32
|
46
|
<div slot="footer" class="dialog-footer">
|
|
33
|
47
|
<el-button @click="cancel" class="endbutton"><span>取 消</span></el-button>
|
|
|
@@ -39,6 +53,7 @@
|
|
39
|
53
|
<script>
|
|
40
|
54
|
import { queryCaseFlowInfo, saveCaseFlow } from "@/api/caseprocessManagement/caseprocessManagement.js";
|
|
41
|
55
|
import { listRole } from "@/api/system/role";
|
|
|
56
|
+import { getToken } from "@/utils/auth";
|
|
42
|
57
|
export default {
|
|
43
|
58
|
props: ["addvisiable", "editData", "queryParams"],
|
|
44
|
59
|
dicts: ["case_flow_node"],
|
|
|
@@ -49,7 +64,9 @@ export default {
|
|
49
|
64
|
backflowArr: [],//驳回节点
|
|
50
|
65
|
roleArr: [],//关联角色
|
|
51
|
66
|
isImg: false,
|
|
52
|
|
- filedata: {},
|
|
|
67
|
+ filedata: {
|
|
|
68
|
+ annexType: 11,
|
|
|
69
|
+ },
|
|
53
|
70
|
flagBtn: false,
|
|
54
|
71
|
ruleForm: {},
|
|
55
|
72
|
rules: {
|
|
|
@@ -67,16 +84,38 @@ export default {
|
|
67
|
84
|
]
|
|
68
|
85
|
},
|
|
69
|
86
|
dealvalue: [],
|
|
|
87
|
+ imageUrl: '',
|
|
|
88
|
+ uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
|
|
89
|
+ headers: {
|
|
|
90
|
+ Authorization: "Bearer " + getToken(),
|
|
|
91
|
+ },
|
|
|
92
|
+ fileName: '',
|
|
|
93
|
+ imgSvgUrl: ''
|
|
70
|
94
|
};
|
|
71
|
95
|
},
|
|
72
|
96
|
watch: {
|
|
73
|
97
|
addvisiable(val) {
|
|
74
|
98
|
if (val) {
|
|
75
|
99
|
this.ruleForm = this.editData;
|
|
|
100
|
+ console.log(this.ruleForm,'this.ruleForm');
|
|
76
|
101
|
this.getRoles();
|
|
77
|
|
- this.getbackflowArr()
|
|
|
102
|
+ this.getbackflowArr();
|
|
|
103
|
+ if (this.ruleForm && this.ruleForm.fileName) {
|
|
|
104
|
+ this.imgSvgUrl = process.env.VUE_APP_BASE_API + this.ruleForm.fileName;
|
|
|
105
|
+ } else {
|
|
|
106
|
+ this.imgSvgUrl = ''
|
|
|
107
|
+ }
|
|
78
|
108
|
}
|
|
|
109
|
+ },
|
|
|
110
|
+ fileName: {
|
|
|
111
|
+ handler(val) {
|
|
|
112
|
+ if (val) {
|
|
|
113
|
+ this.imgSvgUrl = this.imageUrl
|
|
|
114
|
+ }
|
|
|
115
|
+ },
|
|
|
116
|
+ deep: true
|
|
79
|
117
|
}
|
|
|
118
|
+
|
|
80
|
119
|
},
|
|
81
|
120
|
created() {
|
|
82
|
121
|
|
|
|
@@ -119,6 +158,22 @@ export default {
|
|
119
|
158
|
cancel() {
|
|
120
|
159
|
this.$emit("cancelAdd");
|
|
121
|
160
|
},
|
|
|
161
|
+ // 图标上传
|
|
|
162
|
+ handleAvatarSuccess(res, file) {
|
|
|
163
|
+ this.fileName = ''
|
|
|
164
|
+ console.log(file.response.fileName,'上传成功的file');
|
|
|
165
|
+ this.imageUrl = URL.createObjectURL(file.raw);
|
|
|
166
|
+ this.fileName = file.response.fileName
|
|
|
167
|
+ console.log(this.imageUrl,'上传成功的this.imageUrl');
|
|
|
168
|
+ },
|
|
|
169
|
+ beforeAvatarUpload(file) {
|
|
|
170
|
+ console.log(file,'file');
|
|
|
171
|
+ const isSvg = file.type === 'image/svg+xml';
|
|
|
172
|
+ if (!isSvg) {
|
|
|
173
|
+ this.$message.error('上传图片只能是 SVG 格式!');
|
|
|
174
|
+ }
|
|
|
175
|
+ return isSvg;
|
|
|
176
|
+ },
|
|
122
|
177
|
// 提交
|
|
123
|
178
|
submitForm() {
|
|
124
|
179
|
this.$refs['ruleForm'].validate((valid) => {
|
|
|
@@ -141,7 +196,8 @@ export default {
|
|
141
|
196
|
backFlowId: this.ruleForm.backFlowId,
|
|
142
|
197
|
roleIds: this.ruleForm.roleIds,
|
|
143
|
198
|
sort: this.ruleForm.sort,
|
|
144
|
|
- buttonAuthFlag: this.ruleForm.buttonAuthFlag
|
|
|
199
|
+ buttonAuthFlag: this.ruleForm.buttonAuthFlag,
|
|
|
200
|
+ fileName: this.fileName
|
|
145
|
201
|
}
|
|
146
|
202
|
} else {
|
|
147
|
203
|
let nodevalue = this.dict.type.case_flow_node;
|
|
|
@@ -158,7 +214,8 @@ export default {
|
|
158
|
214
|
caseStatusName: this.ruleForm.caseStatusName,
|
|
159
|
215
|
backFlowId: this.ruleForm.backFlowId,
|
|
160
|
216
|
roleIds: this.ruleForm.roleIds,
|
|
161
|
|
- buttonAuthFlag: this.ruleForm.buttonAuthFlag
|
|
|
217
|
+ buttonAuthFlag: this.ruleForm.buttonAuthFlag,
|
|
|
218
|
+ fileName: this.fileName
|
|
162
|
219
|
}
|
|
163
|
220
|
}
|
|
164
|
221
|
if (params.backFlowId == undefined) {
|
|
|
@@ -181,4 +238,31 @@ export default {
|
|
181
|
238
|
::v-deep .el-select {
|
|
182
|
239
|
width: 100%;
|
|
183
|
240
|
}
|
|
|
241
|
+.avatar-uploader .el-upload {
|
|
|
242
|
+ border: 1px dashed #d9d9d9;
|
|
|
243
|
+ border-radius: 6px;
|
|
|
244
|
+ cursor: pointer;
|
|
|
245
|
+ position: relative;
|
|
|
246
|
+ overflow: hidden;
|
|
|
247
|
+ }
|
|
|
248
|
+// .avatar-uploader .el-upload:hover {
|
|
|
249
|
+// border-color: #409EFF;
|
|
|
250
|
+// }
|
|
|
251
|
+ .avatar-uploader-icon {
|
|
|
252
|
+ border: 1px dashed #d9d9d9;
|
|
|
253
|
+ font-size: 28px;
|
|
|
254
|
+ color: #8c939d;
|
|
|
255
|
+ width: 100px;
|
|
|
256
|
+ height: 100px;
|
|
|
257
|
+ line-height: 100px;
|
|
|
258
|
+ text-align: center;
|
|
|
259
|
+ }
|
|
|
260
|
+ .avatar-uploader-icon:hover {
|
|
|
261
|
+ border-color: #409EFF;
|
|
|
262
|
+ }
|
|
|
263
|
+ .avatar {
|
|
|
264
|
+ width: 100px;
|
|
|
265
|
+ height: 100px;
|
|
|
266
|
+ display: block;
|
|
|
267
|
+ }
|
|
184
|
268
|
</style>
|