代码调整
This commit is contained in:
parent
c2c746406e
commit
dcfbe22510
@ -84,21 +84,21 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const data = Object.assign({}, this.formModel);
|
const data = Object.assign({}, this.formModel);
|
||||||
if (data.id) {
|
// 检查项目markKey
|
||||||
// 更新前端项目配置
|
checkFrontProjectExist({markKey:data.markKey}).then(res=>{
|
||||||
updateFrontProjectConfig(data).then(resp => {
|
if (!res.data) {
|
||||||
this.$message.success('修改前端配置成功!');
|
if (data.id) {
|
||||||
this.handleClose();
|
// 更新前端项目配置
|
||||||
this.$emit('reloadTable');
|
updateFrontProjectConfig(data).then(resp => {
|
||||||
}).catch(error => {
|
this.$message.success('修改前端配置成功!');
|
||||||
this.$message.error(error.message);
|
this.handleClose();
|
||||||
this.loading = false;
|
this.$emit('reloadTable');
|
||||||
});
|
}).catch(error => {
|
||||||
} else {
|
this.$message.error(error.message);
|
||||||
delete data.id;
|
this.loading = false;
|
||||||
// 检查项目markKey
|
});
|
||||||
checkFrontProjectExist({markKey:data.markKey}).then(res=>{
|
} else {
|
||||||
if (!res.data) {
|
delete data.id;
|
||||||
// 保存前端项目配置
|
// 保存前端项目配置
|
||||||
saveFrontProjectConfig(data).then(resp => {
|
saveFrontProjectConfig(data).then(resp => {
|
||||||
this.$message.success('创建前端配置成功!');
|
this.$message.success('创建前端配置成功!');
|
||||||
@ -108,13 +108,13 @@ export default {
|
|||||||
this.$message.error(error.message);
|
this.$message.error(error.message);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.$message.success('此前端配置已存在,请修改配置编码');
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.loading = false;
|
||||||
|
this.$message.error('此前端配置已存在,请修改配置编码');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -89,20 +89,22 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
const data = Object.assign({}, this.formModel);
|
const data = Object.assign({}, this.formModel);
|
||||||
data.viewShow = data.viewShow ? 1 : 0;
|
data.viewShow = data.viewShow ? 1 : 0;
|
||||||
if (data.id) {
|
// 检查项目code
|
||||||
updateBackProjectConfig(data).then(resp => {
|
checkBackProjectExist({code:data.code}).then(res=>{
|
||||||
this.$message.success('修改项目成功!');
|
if (!res.data) {
|
||||||
this.handleClose();
|
if (data.id) {
|
||||||
this.$emit('reloadTable');
|
// 更新后端项目配置
|
||||||
}).catch(error => {
|
updateBackProjectConfig(data).then(resp => {
|
||||||
this.$message.error(error.message);
|
this.$message.success('修改项目成功!');
|
||||||
this.loading = false;
|
this.handleClose();
|
||||||
});
|
this.$emit('reloadTable');
|
||||||
} else {
|
}).catch(error => {
|
||||||
delete data.id;
|
this.$message.error(error.message);
|
||||||
// 检查项目code
|
this.loading = false;
|
||||||
checkBackProjectExist({code:data.code}).then(res=>{
|
});
|
||||||
if (!res.data) {
|
} else {
|
||||||
|
delete data.id;
|
||||||
|
// 保存后端项目配置
|
||||||
saveBackProjectConfig(data).then(resp => {
|
saveBackProjectConfig(data).then(resp => {
|
||||||
this.$message.success('创建项目成功!');
|
this.$message.success('创建项目成功!');
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
@ -111,12 +113,12 @@ export default {
|
|||||||
this.$message.error(error.message);
|
this.$message.error(error.message);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.$message.success('此项目已存在,请修改项目编码');
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
this.loading = false;
|
||||||
}
|
this.$message.error('此项目已存在,请修改项目编码');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user