Commit e43e074d authored by 王's avatar

系统管理,后台管理添加操作确认

parent 01df4bec
......@@ -173,14 +173,20 @@
let id = this.commentForm.id;
let desc = this.commentForm.desc ? this.commentForm.desc : '';
if(!desc) return;
updateAdsInnerApi(id,{desc: desc}).then(res=>{
this.$message({
type: 'success',
message: '编辑备注成功'
this.$confirm('确认编辑备注', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateAdsInnerApi(id,{desc: desc}).then(res=>{
this.$message({
type: 'success',
message: '编辑备注成功'
});
this.showCommentDialog = false
this.initPage();
});
this.showCommentDialog = false
this.initPage();
});
})
},
editComment(id, desc) {
this.showCommentDialog = true;
......
......@@ -328,13 +328,19 @@
desc:dia.form.desc,
status:dia.form.status
};
editAdminListApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将编辑该账号?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editAdminListApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
})
})
}else if(dia.dialogType === 0){
let json = {
......@@ -343,25 +349,37 @@
passwd:md5(dia.form.password),
username:dia.form.username
};
addAdminListApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将添加新账号?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addAdminListApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
})
})
}else if(dia.dialogType === 2){
let json = {
passwd_new:md5(dia.form.password)
}
editPasswordApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将修改此账号密码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editPasswordApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
})
})
}
// }
......
......@@ -261,14 +261,21 @@
if (this.imageList.length > 0) {
json.url = this.imageList[0].url
}
editBannerApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
this.$confirm('确认修改Banner', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editBannerApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
})
})
}else{
let json = {
title:dia.form.title,
......@@ -277,14 +284,21 @@
if (this.imageList.length > 0) {
json.url = this.imageList[0].url
}
addBannerApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
this.$confirm('确认添加Banner', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addBannerApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
})
})
}
}
})
......
......@@ -156,13 +156,19 @@
cover:dia.form.cover,
pid:dia.form.pid
};
updateMenuApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将修改该菜单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateMenuApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
})
})
}else{
let json = {
......@@ -170,13 +176,19 @@
cover:dia.form.cover,
pid:dia.form.pid
};
saveMenuApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将添加新菜单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveMenuApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
})
})
}
}
......
......@@ -238,26 +238,38 @@
name:dia.form.name,
menu_ids:JSON.stringify(menu_ids)
};
updateRoleApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将修改该角色?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateRoleApi(dia.form.id,json).then(()=>{
this.$message({
type: 'success',
message: '修改成功!'
});
dia.show = false;
this.getList()
})
})
}else{
let json = {
name:dia.form.name,
menu_ids:JSON.stringify(menu_ids)
};
saveRoleApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
this.$confirm('此操作将添加新角色?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveRoleApi(json).then(()=>{
this.$message({
type: 'success',
message: '添加成功!'
});
dia.show = false;
this.getList()
})
})
}
}
......
......@@ -82,26 +82,38 @@
if(this.dialogObj.id){
this.$refs['form'].validate((valid) => {
if(valid){
updateConfigApi(this.id,this.form).then(res=>{
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.show = false;
this.$confirm('此操作将修改该配置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateConfigApi(this.id,this.form).then(res=>{
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.show = false;
})
})
}
});
}else{
this.$refs['form'].validate((valid) => {
if(valid){
saveConfigApi(this.form).then(res=>{
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.show = false;
this.$confirm('此操作将添加新配置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveConfigApi(this.form).then(res=>{
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.show = false;
})
})
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment