|
@@ -9,7 +9,7 @@
|
|
<data-form :span="24" :fields="fields" v-model="form" :rules="rules" @save="onSubmit">
|
|
<data-form :span="24" :fields="fields" v-model="form" :rules="rules" @save="onSubmit">
|
|
<template #act_time>
|
|
<template #act_time>
|
|
<el-form ref="act_time" :model="act_time" label-width="80px">
|
|
<el-form ref="act_time" :model="act_time" label-width="80px">
|
|
- <el-form-item label="活动时间">
|
|
|
|
|
|
+ <el-form-item>
|
|
<el-input v-model="act_time.value"></el-input>
|
|
<el-input v-model="act_time.value"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="是否显示">
|
|
<el-form-item label="是否显示">
|
|
@@ -17,26 +17,18 @@
|
|
<el-option v-for="i in isuseList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="i in isuseList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" @click="timesubmitForm('act_time')" size="mini">提交</el-button>
|
|
|
|
- <el-button @click="resetForm('act_time')" size="mini">重置</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
</template>
|
|
</template>
|
|
<template #content>
|
|
<template #content>
|
|
<el-form ref="content" :model="content" label-width="80px">
|
|
<el-form ref="content" :model="content" label-width="80px">
|
|
- <el-form-item label="活动说明">
|
|
|
|
- <el-input type="textarea" v-model="content.value"></el-input>
|
|
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <editor v-model="content.value" url="/files/point/act/upload" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="是否显示">
|
|
<el-form-item label="是否显示">
|
|
<el-select v-model="content.is_use" placeholder="请选择">
|
|
<el-select v-model="content.is_use" placeholder="请选择">
|
|
<el-option v-for="i in isuseList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="i in isuseList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" @click="contentonSubmit('content')" size="mini">提交</el-button>
|
|
|
|
- <el-button @click="resetForm('content')" size="mini">重置</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
</template>
|
|
</template>
|
|
<template #is_use>
|
|
<template #is_use>
|
|
@@ -62,7 +54,9 @@ const { mapActions: dictData } = createNamespacedHelpers('dictData');
|
|
export default {
|
|
export default {
|
|
name: 'form-1',
|
|
name: 'form-1',
|
|
props: {},
|
|
props: {},
|
|
- components: {},
|
|
|
|
|
|
+ components: {
|
|
|
|
+ editor: () => import('@/components/editor.vue'),
|
|
|
|
+ },
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
form: {},
|
|
form: {},
|
|
@@ -107,34 +101,11 @@ export default {
|
|
this.$set(this.content, `is_use`, '0');
|
|
this.$set(this.content, `is_use`, '0');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 活动时间提交
|
|
|
|
- timesubmitForm(formName) {
|
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.$set(this.form, `act_time`, this.act_time);
|
|
|
|
- } else {
|
|
|
|
- console.log('error submit!!');
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- resetForm(type) {
|
|
|
|
- this.$set(this, type, {});
|
|
|
|
- },
|
|
|
|
- // 说明提交
|
|
|
|
- contentonSubmit(formName) {
|
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.$set(this.form, `content`, this.content);
|
|
|
|
- } else {
|
|
|
|
- console.log('error submit!!');
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
// 提交
|
|
// 提交
|
|
async onSubmit({ data }) {
|
|
async onSubmit({ data }) {
|
|
let res;
|
|
let res;
|
|
|
|
+ data.act_time = this.act_time;
|
|
|
|
+ data.content = this.content;
|
|
if (data.id) res = await this.update(data);
|
|
if (data.id) res = await this.update(data);
|
|
else res = await this.create(data);
|
|
else res = await this.create(data);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|