代码调整

This commit is contained in:
joylink_cuiweidong 2022-09-29 16:59:38 +08:00
parent c2c746406e
commit dcfbe22510
2 changed files with 41 additions and 39 deletions

View File

@ -84,21 +84,21 @@ export default {
if (valid) {
this.loading = true;
const data = Object.assign({}, this.formModel);
if (data.id) {
//
updateFrontProjectConfig(data).then(resp => {
this.$message.success('修改前端配置成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
delete data.id;
// markKey
checkFrontProjectExist({markKey:data.markKey}).then(res=>{
if (!res.data) {
// markKey
checkFrontProjectExist({markKey:data.markKey}).then(res=>{
if (!res.data) {
if (data.id) {
//
updateFrontProjectConfig(data).then(resp => {
this.$message.success('修改前端配置成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
delete data.id;
//
saveFrontProjectConfig(data).then(resp => {
this.$message.success('创建前端配置成功!');
@ -108,13 +108,13 @@ export default {
this.$message.error(error.message);
this.loading = false;
});
} else {
this.$message.success('此前端配置已存在,请修改配置编码');
}
} else {
this.loading = false;
this.$message.error('此前端配置已存在,请修改配置编码');
}
});
});
}
}
});
}

View File

@ -89,20 +89,22 @@ export default {
this.loading = true;
const data = Object.assign({}, this.formModel);
data.viewShow = data.viewShow ? 1 : 0;
if (data.id) {
updateBackProjectConfig(data).then(resp => {
this.$message.success('修改项目成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
delete data.id;
// code
checkBackProjectExist({code:data.code}).then(res=>{
if (!res.data) {
// code
checkBackProjectExist({code:data.code}).then(res=>{
if (!res.data) {
if (data.id) {
//
updateBackProjectConfig(data).then(resp => {
this.$message.success('修改项目成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
delete data.id;
//
saveBackProjectConfig(data).then(resp => {
this.$message.success('创建项目成功!');
this.handleClose();
@ -111,12 +113,12 @@ export default {
this.$message.error(error.message);
this.loading = false;
});
} else {
this.$message.success('此项目已存在,请修改项目编码');
}
});
}
} else {
this.loading = false;
this.$message.error('此项目已存在,请修改项目编码');
}
});
}
});
}