优化代码生成功能

This commit is contained in:
不做码农
2021-12-14 21:50:30 +08:00
parent bb2f64088d
commit 50c48077d7
6 changed files with 126 additions and 124 deletions

View File

@@ -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 错误逻辑
});
}
}
});