From 3480e36dcd527e8bd8bb97ac8d2e4bc3d56de4d2 Mon Sep 17 00:00:00 2001 From: lvwshuai Date: Thu, 20 Jul 2023 14:10:21 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=A8=A1=E6=9D=BF=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=89=93=E5=BC=80=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?=E5=92=8C=E6=8E=A5=E5=8F=A3=E8=AF=B7=E6=B1=82=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/vm/vue/index-tree.vue.vm | 44 +++++++++---------- .../src/main/resources/vm/vue/index.vue.vm | 26 +++++------ 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index 9c57e2c0..ee3800f4 100644 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -421,17 +421,15 @@ const resetQuery = () => { /** 新增按钮操作 */ const handleAdd = (row?: ${BusinessName}VO) => { - dialog.visible = true; - dialog.title = "添加${functionName}"; - nextTick(() => { - reset(); - getTreeselect(); - if (row != null && row.${treeCode}) { + reset(); + getTreeselect(); + if (row != null && row.${treeCode}) { form.value.${treeParentCode} = row.${treeCode}; - } else { + } else { form.value.${treeParentCode} = 0; - } - }); + } + dialog.visible = true; + dialog.title = "添加${functionName}"; } /** 展开/折叠操作 */ @@ -449,23 +447,21 @@ const toggleExpandAll = (data: ${BusinessName}VO[], status: boolean) => { } /** 修改按钮操作 */ -const handleUpdate = (row: ${BusinessName}VO) => { - dialog.visible = true; - dialog.title = "修改${functionName}"; - nextTick(async () => { - reset(); - await getTreeselect(); - if (row != null) { - form.value.${treeParentCode} = row.${treeCode}; - } - const res = await get${BusinessName}(row.${treeCode}); - Object.assign(form.value, res.data); +const handleUpdate = async (row: ${BusinessName}VO) => { + reset(); + await getTreeselect(); + if (row != null) { + form.value.${treeParentCode} = row.${treeCode}; + } + const res = await get${BusinessName}(row.${treeCode}); + Object.assign(form.value, res.data); #foreach ($column in $columns) -#if($column.htmlType == "checkbox") - form.value.$column.javaField = form.value.${column.javaField}.split(","); + #if($column.htmlType == "checkbox") + form.value.$column.javaField = form.value.${column.javaField}.split(","); + #end #end -#end - }); + dialog.visible = true; + dialog.title = "修改${functionName}"; } /** 提交按钮 */ diff --git a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index 23715ec0..4bc1e6bf 100644 --- a/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-modules/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -404,28 +404,24 @@ const handleSelectionChange = (selection: ${BusinessName}VO[]) => { /** 新增按钮操作 */ const handleAdd = () => { + reset(); dialog.visible = true; dialog.title = "添加${functionName}"; - nextTick(() => { - reset(); - }); } /** 修改按钮操作 */ -const handleUpdate = (row?: ${BusinessName}VO) => { - dialog.visible = true; - dialog.title = "修改${functionName}"; - nextTick(async () => { - reset(); - const _${pkColumn.javaField} = row?.${pkColumn.javaField} || ids.value[0] - const res = await get${BusinessName}(_${pkColumn.javaField}); - Object.assign(form.value, res.data); +const handleUpdate = async (row?: ${BusinessName}VO) => { + reset(); + const _${pkColumn.javaField} = row?.${pkColumn.javaField} || ids.value[0] + const res = await get${BusinessName}(_${pkColumn.javaField}); + Object.assign(form.value, res.data); #foreach ($column in $columns) -#if($column.htmlType == "checkbox") - form.value.$column.javaField = form.value.${column.javaField}.split(","); -#end + #if($column.htmlType == "checkbox") + form.value.$column.javaField = form.value.${column.javaField}.split(","); + #end #end - }); + dialog.visible = true; + dialog.title = "修改${functionName}"; } /** 提交按钮 */