diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei index 33439222..5233401f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei @@ -340,10 +340,12 @@ selectedMainId:'', superFieldList:[], <#list subTables as sub> + <#if sub != null> <#list sub.foreignMainKeys as key> <#assign subMainFieldMap += {"${sub.entityName?uncap_first}MainId": "${dashedToCamel(key)}"}> ${sub.entityName?uncap_first}MainId: '', + } }, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/[1-n]List.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/[1-n]List.vuei index 3f69b13b..333760f6 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/[1-n]List.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/vue3/[1-n]List.vuei @@ -48,7 +48,7 @@ import {useModal} from '/@/components/Modal'; import ${sub.entityName}Modal from './components/${sub.entityName}Modal.vue' import {${sub.entityName?uncap_first}Columns} from './${entityName}.data'; - import {${sub.entityName?uncap_first}List, ${sub.entityName?uncap_first}Delete, ${sub.entityName?uncap_first}DeleteBatch} from './${entityName}.api'; + import {${sub.entityName?uncap_first}List, ${sub.entityName?uncap_first}Delete, ${sub.entityName?uncap_first}DeleteBatch, ${sub.entityName?uncap_first}ExportXlsUrl, ${sub.entityName?uncap_first}ImportUrl } from './${entityName}.api'; import {isEmpty} from "/@/utils/is"; import {useMessage} from '/@/hooks/web/useMessage'; @@ -60,7 +60,7 @@ const [registerModal, {openModal}] = useModal(); const searchInfo = {}; // 列表页面公共参数、方法 - const {prefixCls, tableContext} = useListPage({ + const {prefixCls, tableContext, onImportXls, onExportXls} = useListPage({ tableProps: { api: ${sub.entityName?uncap_first}List, columns: ${sub.entityName?uncap_first}Columns, @@ -75,6 +75,13 @@ pageSizeOptions: ['5', '10', '20'], } }, + exportConfig: { + name: '${sub.ftlDescription}', + url: ${sub.entityName?uncap_first}ExportXlsUrl + }, + importConfig: { + url: getImportUrl() + } }); //注册table数据 @@ -88,6 +95,14 @@ } ); + /** + * 导入地址 + */ + function getImportUrl(){ + return ${sub.entityName?uncap_first}ImportUrl+'/'+ unref(mainId) + } + + /** * 新增事件 */ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei index 0a7ae065..c503847d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei @@ -126,7 +126,6 @@ -