添加标准图片上传style

This commit is contained in:
sk1551 2020-05-29 10:39:38 +08:00
parent b94ba212f9
commit 2e09cf9ec4

View File

@ -139,7 +139,7 @@
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
accept=".jpg, .png" accept=".jpg, .png"
> >
<img v-if="imageUrl" :src="imageUrl" class="avatar" /> <img width="100%" v-if="imageUrl" :src="imageUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -176,9 +176,6 @@ export default {
return { return {
// //
imageUrl: "", imageUrl: "",
dialogVisible: false,
file:"",
// //
loading: true, loading: true,
// //
@ -238,7 +235,6 @@ export default {
this.getTaskList(); this.getTaskList();
}, },
methods: { methods: {
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw); this.imageUrl = URL.createObjectURL(file.raw);
console.log(res); console.log(res);
@ -255,7 +251,6 @@ export default {
} }
return isLt2M; return isLt2M;
}, },
/**查询任务名称详细 */ /**查询任务名称详细 */
getDayflowtask(taskId) { getDayflowtask(taskId) {
getDayflowtask(taskId).then(response => { getDayflowtask(taskId).then(response => {
@ -337,7 +332,7 @@ export default {
this.form = response.data; this.form = response.data;
if (response.data.picture) { if (response.data.picture) {
this.imageUrl = process.env.VUE_APP_BASE_API + response.data.picture; this.imageUrl = process.env.VUE_APP_BASE_API + response.data.picture;
}; }
this.open = true; this.open = true;
this.title = "修改标准"; this.title = "修改标准";
}); });
@ -410,4 +405,30 @@ export default {
} }
} }
}; };
</script> </script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>