|
@@ -86,14 +86,11 @@
|
|
|
<el-input v-model="form.name" placeholder maxlength="25"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="图片" prop="image">
|
|
|
- <div class="bg90 bg-height marginB10 freePic">
|
|
|
- <el-upload
|
|
|
+ <el-upload
|
|
|
:headers="headers"
|
|
|
- :class="{hideUpload:hideUploadEdit}"
|
|
|
:action="caerAction"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
:on-remove="handleRemove"
|
|
|
- :on-change="handleChange"
|
|
|
:file-list="fileList"
|
|
|
list-type="picture-card"
|
|
|
:on-success="handleSuccess"
|
|
@@ -105,7 +102,6 @@
|
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
|
<img width="100%" :src="form.image" alt="">
|
|
|
</el-dialog>
|
|
|
- </div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="位置" prop="position">
|
|
|
<el-select v-model="form.position" placeholder="请选择">
|
|
@@ -150,7 +146,6 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- hideUploadEdit: false,
|
|
|
positions: [
|
|
|
{
|
|
|
id: 1,
|
|
@@ -226,15 +221,10 @@ export default {
|
|
|
handlePictureCardPreview(file) {
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
- handleChange(file){
|
|
|
- // 大于1张隐藏
|
|
|
- this.hideUploadEdit = true
|
|
|
- },
|
|
|
handleSuccess(file) {
|
|
|
this.form.image = file.url;
|
|
|
},
|
|
|
handleRemove(file) {
|
|
|
- this.hideUploadEdit = false
|
|
|
//刚上传的图片
|
|
|
this.form.image = '';
|
|
|
},
|
|
@@ -361,7 +351,4 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.freePic ::v-deep .hide .el-upload--picture-card {
|
|
|
- display: none;
|
|
|
-}
|
|
|
</style>
|