update 修改代码生成模板,调整列表打开对话框和接口请求顺序

feature/model
lvwshuai 1 year ago
parent 8df34e50fa
commit 3480e36dcd

@ -421,9 +421,6 @@ const resetQuery = () => {
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = (row?: ${BusinessName}VO) => { const handleAdd = (row?: ${BusinessName}VO) => {
dialog.visible = true;
dialog.title = "添加${functionName}";
nextTick(() => {
reset(); reset();
getTreeselect(); getTreeselect();
if (row != null && row.${treeCode}) { if (row != null && row.${treeCode}) {
@ -431,7 +428,8 @@ const handleAdd = (row?: ${BusinessName}VO) => {
} else { } else {
form.value.${treeParentCode} = 0; form.value.${treeParentCode} = 0;
} }
}); dialog.visible = true;
dialog.title = "添加${functionName}";
} }
/** 展开/折叠操作 */ /** 展开/折叠操作 */
@ -449,10 +447,7 @@ const toggleExpandAll = (data: ${BusinessName}VO[], status: boolean) => {
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleUpdate = (row: ${BusinessName}VO) => { const handleUpdate = async (row: ${BusinessName}VO) => {
dialog.visible = true;
dialog.title = "修改${functionName}";
nextTick(async () => {
reset(); reset();
await getTreeselect(); await getTreeselect();
if (row != null) { if (row != null) {
@ -465,7 +460,8 @@ const handleUpdate = (row: ${BusinessName}VO) => {
form.value.$column.javaField = form.value.${column.javaField}.split(","); form.value.$column.javaField = form.value.${column.javaField}.split(",");
#end #end
#end #end
}); dialog.visible = true;
dialog.title = "修改${functionName}";
} }
/** 提交按钮 */ /** 提交按钮 */

@ -404,18 +404,13 @@ const handleSelectionChange = (selection: ${BusinessName}VO[]) => {
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = () => { const handleAdd = () => {
reset();
dialog.visible = true; dialog.visible = true;
dialog.title = "添加${functionName}"; dialog.title = "添加${functionName}";
nextTick(() => {
reset();
});
} }
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleUpdate = (row?: ${BusinessName}VO) => { const handleUpdate = async (row?: ${BusinessName}VO) => {
dialog.visible = true;
dialog.title = "修改${functionName}";
nextTick(async () => {
reset(); reset();
const _${pkColumn.javaField} = row?.${pkColumn.javaField} || ids.value[0] const _${pkColumn.javaField} = row?.${pkColumn.javaField} || ids.value[0]
const res = await get${BusinessName}(_${pkColumn.javaField}); const res = await get${BusinessName}(_${pkColumn.javaField});
@ -425,7 +420,8 @@ const handleUpdate = (row?: ${BusinessName}VO) => {
form.value.$column.javaField = form.value.${column.javaField}.split(","); form.value.$column.javaField = form.value.${column.javaField}.split(",");
#end #end
#end #end
}); dialog.visible = true;
dialog.title = "修改${functionName}";
} }
/** 提交按钮 */ /** 提交按钮 */

Loading…
Cancel
Save