|
@@ -19,7 +19,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="timesubmitForm('act_time')" size="mini">提交</el-button>
|
|
|
- <el-button @click="timeresetForm('act_time')" size="mini">重置</el-button>
|
|
|
+ <el-button @click="resetForm('act_time')" size="mini">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</template>
|
|
@@ -35,7 +35,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="contentonSubmit('content')" size="mini">提交</el-button>
|
|
|
- <el-button @click="contentresetForm('content')" size="mini">重置</el-button>
|
|
|
+ <el-button @click="resetForm('content')" size="mini">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</template>
|
|
@@ -76,8 +76,8 @@ export default {
|
|
|
{ label: '活动标题', model: 'title' },
|
|
|
{ label: '活动时间', model: 'act_time', custom: true },
|
|
|
{ label: '活动说明', model: 'content', custom: true },
|
|
|
- { label: '分享图片(237*190)', model: 'share', type: 'upload', url: '/files/point/act/upload' },
|
|
|
- { label: '封面图片', model: 'cover', type: 'upload', url: '/files/point/act/upload' },
|
|
|
+ { label: '分享图片(237*190)', model: 'share', type: 'upload', limit: 1, url: '/files/point/act/upload' },
|
|
|
+ { label: '封面图片', model: 'cover', type: 'upload', limit: 1, url: '/files/point/act/upload' },
|
|
|
{ label: '是否在首页展示', model: 'show_index', type: 'select' },
|
|
|
{ label: '是否开启', model: 'is_use', type: 'select' },
|
|
|
],
|
|
@@ -98,6 +98,8 @@ export default {
|
|
|
let res = await this.fetch(this.id);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `form`, res.data);
|
|
|
+ this.$set(this, `act_time`, res.data.act_time);
|
|
|
+ this.$set(this, `content`, res.data.content);
|
|
|
}
|
|
|
} else {
|
|
|
this.$set(this, `form`, { is_use: '0', show_index: '0' });
|
|
@@ -116,8 +118,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- timeresetForm(formName) {
|
|
|
- this.$refs[formName].resetFields();
|
|
|
+ resetForm(type) {
|
|
|
+ this.$set(this, type, {});
|
|
|
},
|
|
|
// 说明提交
|
|
|
contentonSubmit(formName) {
|
|
@@ -130,19 +132,15 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- contentresetForm(formName) {
|
|
|
- this.$refs[formName].resetFields();
|
|
|
- },
|
|
|
// 提交
|
|
|
async onSubmit({ data }) {
|
|
|
let res;
|
|
|
- console.log(data);
|
|
|
- // if (data.id) res = await this.update(data);
|
|
|
- // else res = await this.create(data);
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
- // this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
- // this.toBack();
|
|
|
- // }
|
|
|
+ if (data.id) res = await this.update(data);
|
|
|
+ else res = await this.create(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
+ this.toBack();
|
|
|
+ }
|
|
|
},
|
|
|
// 查询其他信息
|
|
|
async searchOther() {
|