实现受众的复制功能

This commit is contained in:
weinan2087
2023-02-10 17:31:52 +08:00
parent 9611f70c26
commit 3569345d09

View File

@@ -60,7 +60,7 @@
<el-form ref="copyForm" :rules="copyRules" :model="copyForm" label-width="100px"> <el-form ref="copyForm" :rules="copyRules" :model="copyForm" label-width="100px">
<el-form-item label="受众名称:" prop="name"> <el-form-item label="受众名称:" prop="name">
<el-input <el-input
v-model="copyForm.name" v-model="copyForm.audienceName"
placeholder="请输入受众名称" placeholder="请输入受众名称"
maxlength="50" maxlength="50"
></el-input> ></el-input>
@@ -121,8 +121,8 @@
// 表格数据 // 表格数据
tableData: [], tableData: [],
copyUserGroupShow:false, copyUserGroupShow:false,
copyRules:{ name: [{ required: true, message: "请输入名称", trigger: "blur" }]}, copyRules:{ audienceName: [{ required: true, message: "请输入名称", trigger: "blur" }]},
copyForm:{name:'',id:''}, copyForm:{audienceName:'',audienceId:''},
} }
}, },
mounted() { mounted() {
@@ -330,13 +330,13 @@
}, },
copyDialog(row){ copyDialog(row){
this.copyUserGroupShow = true; this.copyUserGroupShow = true;
this.copyForm.id = row.id; this.copyForm.audienceId = row.id;
this.copyForm.name = row.name; this.copyForm.audienceName = row.name;
}, },
copy(){ copy(){
this.$refs.copyForm.validate((valid) => { this.$refs.copyForm.validate((valid) => {
if (valid) { if (valid) {
usergroupApi.copy(this.copyForm).then((res) => { apiAudience.copy(this.copyForm).then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.$message({ type: "success", message: "复制受众成功" ,offset:50}); this.$message({ type: "success", message: "复制受众成功" ,offset:50});
this.loadData(this.page,this.query); this.loadData(this.page,this.query);