|
@@ -72,14 +72,17 @@
|
|
|
</el-button>
|
|
|
<el-drawer title="广告位" class="drawer" :visible.sync="drawer" :direction="direction" :before-close="handleClose">
|
|
|
<el-form-item label="标题">
|
|
|
- <el-input v-model="title" placeholder="请输入标题"></el-input>
|
|
|
+ <el-input v-model="drawerform.title" placeholder="请输入标题"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="图片">
|
|
|
- <upload :limit="1" :data="imgdir" type="filedir" :url="'/files/advert/upload'" @upload="advertSuccess"></upload>
|
|
|
+ <upload :limit="1" :data="drawerform.imgdir" type="imgdir" :url="'/files/advert/upload'" @upload="advertSuccess"></upload>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="链接">
|
|
|
- <el-input v-model="imgurl" placeholder="请输入链接地址"></el-input>
|
|
|
+ <el-input v-model="drawerform.imgurl" placeholder="请输入链接地址"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-col :span="24" style="text-align:center">
|
|
|
+ <el-button type="primary" @click="submitDrawer">保存</el-button>
|
|
|
+ </el-col>
|
|
|
</el-drawer>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
@@ -124,6 +127,7 @@ export default {
|
|
|
starttime: [{ required: false, message: '请选择直播開始時間', trigger: 'change' }],
|
|
|
endtime: [{ required: false, message: '请选择直播結束時間', trigger: 'change' }],
|
|
|
},
|
|
|
+ drawerform: {},
|
|
|
}),
|
|
|
created() {},
|
|
|
computed: {},
|
|
@@ -135,21 +139,19 @@ export default {
|
|
|
this.$emit('submitDate', { data: this.form });
|
|
|
},
|
|
|
advertSuccess({ type, data }) {
|
|
|
- this.imgdir = data.uri;
|
|
|
+ this.$set(this.drawerform, `${type}`, data.uri);
|
|
|
},
|
|
|
handleClose(done) {
|
|
|
- if (this.imgurl) {
|
|
|
- const newdata = { imgurl: this.imgurl, imgdir: this.imgdir, title: this.title };
|
|
|
- this.form.adverts.push(newdata);
|
|
|
- // this.$set(this.form, `adverts`, this.adverts);
|
|
|
- this.imgurl = '';
|
|
|
- this.imgdir = '';
|
|
|
- this.title = '';
|
|
|
- }
|
|
|
done();
|
|
|
},
|
|
|
+ submitDrawer() {
|
|
|
+ if (this.drawerform) {
|
|
|
+ this.form.adverts.push(this.drawerform);
|
|
|
+ }
|
|
|
+ this.drawerform = {};
|
|
|
+ this.drawer = false;
|
|
|
+ },
|
|
|
handleDelete(index, row) {
|
|
|
- console.log(index, row);
|
|
|
this.form.adverts.splice(index, 1);
|
|
|
},
|
|
|
},
|