vue+ele启用停用
程序员文章站
2022-05-30 22:38:41
...
//停用/启用
change_status(row,index) {
let _this=this;
console.log(row);
let obj={};
if(row.status==0){
obj={
uid:1,
id:row.id,
project_id:row.project_id,
title:row.title,
logo:row.logo,
content:row.content,
status:1,
ntype:row.ntype,
ptype:row.ptype,
};
postFormAPI(obj, "/web_notice/addnotice").then(res => {
if (res.data.code === 1) {
this.tableData[index].status=1;
this.flag=1;
console.log("status=1");
} else {
_this.$message.error(res.data.data.info.detail);
}
}).catch(error => {
alert(error)
_this.$message.error(error);
});
}else{
obj={
uid:1,
id:row.id,
project_id:row.project_id,
title:row.title,
logo:row.logo,
content:row.content,
status:0,
ntype:row.ntype,
ptype:row.ptype,
};
postFormAPI(obj, "/web_notice/addnotice").then(res => {
if (res.data.code === 1) {
this.tableData[index].status=0;
this.flag=1;
console.log("status=0");
} else {
_this.$message.error(res.data.data.info.detail);
}
}).catch(error => {
alert(error)
_this.$message.error(error);
});
}
},
上一篇: SQL中约束和触发器的停用与启用
下一篇: 实验4 简单查询—单表无条件和有条件查询