优化代码生成功能
This commit is contained in:
@@ -302,31 +302,31 @@ $end
|
||||
if (valid) {
|
||||
$foreach(item in genTable.Columns)
|
||||
$if(item.HtmlType == "checkbox")
|
||||
this.form.${item.ColumnName} = this.form.${item.columnName}Checked.toString();
|
||||
this.form.${item.ColumnName} = this.form.${item.columnName}Checked.toString();
|
||||
$end
|
||||
$end
|
||||
console.log(JSON.stringify(this.form));
|
||||
|
||||
if (this.form.${replaceDto.FistLowerPk} != undefined || this.title === "修改数据") {
|
||||
update${genTable.BusinessName}(this.form).then((res) => {
|
||||
if (!res.data) {
|
||||
this.msgError("修改失败");
|
||||
return;
|
||||
}
|
||||
if (this.form.${replaceDto.FistLowerPk} != undefined && this.title === "修改数据") {
|
||||
update${genTable.BusinessName}(this.form)
|
||||
.then((res) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
//TODO 错误逻辑
|
||||
});
|
||||
} else {
|
||||
add${genTable.BusinessName}(this.form).then((res) => {
|
||||
if (!res.data) {
|
||||
this.msgError("新增失败");
|
||||
return;
|
||||
}
|
||||
add${genTable.BusinessName}(this.form)
|
||||
.then((res) => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
//TODO 错误逻辑
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user