安全培训管理:完成编辑弹框,培训照片上传
This commit is contained in:
parent
ce54b6fd29
commit
70391446e5
@ -253,11 +253,13 @@
|
||||
class="photoUpload"
|
||||
:action="$store.state.UPLOADURL"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:on-success="file => handleUpload(file, i)"
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<img v-if="eduPhotos['photo' + i]" :src="$store.state.FILEURL + eduPhotos['photo' + i]" class="photo">
|
||||
<template v-else>
|
||||
<i class="el-icon-plus avatar-uploader-icon"></i>
|
||||
<span>培训{{i === 1 ? '前' : i === 2 ? '中' : '后'}}</span>
|
||||
</template>
|
||||
</el-upload>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -458,6 +460,11 @@ export default {
|
||||
allPersonList: [],
|
||||
educateTypeList: this.$t("message.laborDev.educateTypeList"),
|
||||
selectWorkerDialog: false,
|
||||
eduPhotos: {
|
||||
photo1: '',
|
||||
photo2: '',
|
||||
photo3: '',
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -467,6 +474,11 @@ export default {
|
||||
console.log('url',xxx)
|
||||
},
|
||||
methods: {
|
||||
handleUpload(res, num) {
|
||||
const imageUrl = res.data[0].imageUrl
|
||||
this.eduPhotos['photo' + num] = imageUrl
|
||||
console.log(this.eduPhoto1,this.eduPhoto2,this.eduPhoto3, num);
|
||||
},
|
||||
handlePreview(file,type){
|
||||
// console.log('file',file)
|
||||
// console.log('fileList',type)
|
||||
@ -722,6 +734,10 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
.photoUpload{
|
||||
margin-right: 10px;
|
||||
.photo{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user