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'])){ %>