From 9b07e167f717f4f939a2b563617854d7f11a908f Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 27 Nov 2023 10:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=91=E8=A1=A8=E7=9A=84=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=94=B9=E8=BF=9B=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=81=E5=81=9C=E7=94=A8=E3=80=81=E5=90=AF=E7=94=A8=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=88=B6=E8=8A=82=E7=82=B9=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E5=AE=8C=E7=BE=8E=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/modules/gen/crud/vueForm.xml | 11 +++++--- .../templates/modules/gen/crud/vueList.xml | 25 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml index 92c36020..f4243ffa 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueForm.xml @@ -51,7 +51,7 @@ formKey="${table.optionMap['bpmFormKey']}" completeText="提交" :loading="loadingRef" - :auth="'oa:oaLeave:edit'" + :auth="'${permissionPrefix}:edit'" @complete="handleSubmit" @success="handleSuccess" @close="closeDrawer" @@ -576,17 +576,17 @@ for (c in table.columnList){ async function handleSubmit() { try { const data = await validate(); - <% if(toBoolean(table.optionMap['isBpmForm'])){ %> + <% if(toBoolean(table.optionMap['isBpmForm'])){ %> data.bpm = record.value.bpm; // 流程信息 data.status = record.value.status; // 提交状态 loadingRef.value = true; - <% } %> + <% } %> setDrawerProps({ confirmLoading: true }); const params: any = { isNewRecord: record.value.isNewRecord, <% for (c in table.columnList){ - if (c.isPk == '1' || c.showType == 'hidden'){ %> + if (c.isPk == '1' || c.showType == 'hidden'){ %> ${c.attrName}: record.value.${c.attrName}, <% } @@ -595,6 +595,9 @@ for (c in table.columnList){ }; <% for (child in table.childList){ %> data.${@StringUtils.uncap(child.className)}List = await get${child.className}List(); + <% } %> + <% if(table.isTreeEntity){ %> + data.oldParentCode = record.value.parentCode; <% } %> // console.log('submit', params, data, record); const res = await ${className}Save(params, data); diff --git a/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml b/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml index 0de31222..257e1290 100644 --- a/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml +++ b/modules/core/src/main/resources/templates/modules/gen/crud/vueList.xml @@ -324,7 +324,7 @@ for(c in table.columnList){ title: t('停用${functionNameSimple}'), popConfirm: { title: t('是否确认停用${functionNameSimple}'), - confirm: handleDisable.bind(this, { ${idParam} }), + confirm: handleDisable.bind(this, record), }, auth: '${permissionPrefix}:edit', ifShow: () => record.status === '0', @@ -335,7 +335,7 @@ for(c in table.columnList){ title: t('启用${functionNameSimple}'), popConfirm: { title: t('是否确认启用${functionNameSimple}'), - confirm: handleEnable.bind(this, { ${idParam} }), + confirm: handleEnable.bind(this, record), }, auth: '${permissionPrefix}:edit', ifShow: () => record.status === '2', @@ -348,7 +348,7 @@ for(c in table.columnList){ title: t('删除${functionNameSimple}'), popConfirm: { title: t('是否确认删除${functionNameSimple}'), - confirm: handleDelete.bind(this, { ${idParam} }), + confirm: handleDelete.bind(this, record), }, auth: '${permissionPrefix}:edit', <% if(toBoolean(table.optionMap['isBpmForm'])){ %> @@ -444,26 +444,29 @@ for(c in table.columnList){ <% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %> async function handleDisable(record: Recordable) { - const res = await ${className}Disable(record); + const params = { ${idParam} }; + const res = await ${className}Disable(params); showMessage(res.message); - handleSuccess(); + handleSuccess(record); } async function handleEnable(record: Recordable) { - const res = await ${className}Enable(record); + const params = { ${idParam} }; + const res = await ${className}Enable(params); showMessage(res.message); - handleSuccess(); + handleSuccess(record); } <% } %> async function handleDelete(record: Recordable) { - const res = await ${className}Delete(record); + const params = { ${idParam} }; + const res = await ${className}Delete(params); showMessage(res.message); - handleSuccess(); + handleSuccess(record); } - function handleSuccess() { - reload(); + function handleSuccess(record: Recordable) { + reload({ record }); } <% if(toBoolean(table.optionMap['isBpmForm'])){ %>