|
|
|
|
@ -22,12 +22,14 @@
|
|
|
|
|
}"
|
|
|
|
|
:limit="1"
|
|
|
|
|
:action="action"
|
|
|
|
|
:show-file-list="false"
|
|
|
|
|
:show-file-list="true"
|
|
|
|
|
:file-list="imgUrl ? [{url: imgUrl}] : []"
|
|
|
|
|
:on-success="uploadSuccess"
|
|
|
|
|
:on-remove="uploadRemove"
|
|
|
|
|
:before-upload="beforeAvatarUpload"
|
|
|
|
|
>
|
|
|
|
|
<img v-if="imgUrl" :src="imgUrl" alt="" style="width: 146px;height: 146px;object-fit: contain;display: block;border-radius: 6px;">
|
|
|
|
|
<i v-else class="el-icon-plus" />
|
|
|
|
|
<!-- <img v-if="imgUrl" :src="imgUrl" alt="" style="width: 146px;height: 146px;object-fit: contain;display: block;border-radius: 6px;">-->
|
|
|
|
|
<i class="el-icon-plus" />
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
@ -98,17 +100,24 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
user(newVal) {
|
|
|
|
|
user: {
|
|
|
|
|
handler: function(newVal) {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
for (const key in this.form) {
|
|
|
|
|
this.form[key] = newVal[key]
|
|
|
|
|
}
|
|
|
|
|
this.imgUrl = (newVal.sign_file && typeof newVal.sign_file === 'object') ? newVal.sign_file.url : ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
immediate: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getToken,
|
|
|
|
|
uploadRemove(file, fileList) {
|
|
|
|
|
this.form.sign_id = ''
|
|
|
|
|
this.imgUrl = ''
|
|
|
|
|
},
|
|
|
|
|
uploadSuccess(res, file) {
|
|
|
|
|
if (!res.code) {
|
|
|
|
|
this.imgUrl = res.data.url
|
|
|
|
|
|