diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index d0d6a8b2c..e28c47645 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -34,8 +34,8 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; -import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; import org.jeecg.common.aspect.annotation.AutoLog; import org.apache.shiro.authz.annotation.RequiresPermissions; <#assign bpm_flag=false> @@ -73,7 +73,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @return */ //@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询") - @Operation(summary = "${tableVo.ftlDescription}-分页列表查询") + @Operation(summary="${tableVo.ftlDescription}-分页列表查询") @GetMapping(value = "/list") public Result> queryPageList(${entityName} ${entityName?uncap_first}, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @@ -104,7 +104,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @return */ @AutoLog(value = "${tableVo.ftlDescription}-添加") - @Operation(summary = "${tableVo.ftlDescription}-添加") + @Operation(summary="${tableVo.ftlDescription}-添加") @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName} ${entityName?uncap_first}) { @@ -122,7 +122,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @return */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") - @Operation(summary = "${tableVo.ftlDescription}-编辑") + @Operation(summary="${tableVo.ftlDescription}-编辑") @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName} ${entityName?uncap_first}) { @@ -137,7 +137,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @return */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") - @Operation(summary = "${tableVo.ftlDescription}-通过id删除") + @Operation(summary="${tableVo.ftlDescription}-通过id删除") @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { @@ -152,7 +152,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @return */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") - @Operation(summary = "${tableVo.ftlDescription}-批量删除") + @Operation(summary="${tableVo.ftlDescription}-批量删除") @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { @@ -167,7 +167,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @return */ //@AutoLog(value = "${tableVo.ftlDescription}-通过id查询") - @Operation(summary = "${tableVo.ftlDescription}-通过id查询") + @Operation(summary="${tableVo.ftlDescription}-通过id查询") @GetMapping(value = "/queryById") public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) { ${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index 2b5e5ebd6..5b9f134fc 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -17,7 +17,6 @@ import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; import io.swagger.v3.oas.annotations.media.Schema; - import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei index 52f6a1171..be4ca9dd7 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3/${entityName}List.vuei @@ -339,7 +339,7 @@ <#list columns as po> <#if po.isQuery=='Y' || po.isShowList=='Y'> <#if po.classType=='popup_dict' && list_has_popup_dict==true> - const ${po.fieldName}Keys = [...new Set(records.map((item) => item['${po.fieldName}']).flatMap((item) => item.split(',')))]; + const ${po.fieldName}Keys = [...new Set(records.map((item) => item['${po.fieldName}']).flatMap((item) => item && item.split(',')))]; if(${po.fieldName}Keys && ${po.fieldName}Keys.length){ const dictOptions = await getPopDictByCode(${po.fieldName}Keys.join(','), '${po.dictTable},${po.dictField},${po.dictText}'); records.forEach((item) => { diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei index b1908553b..5cbb6ca9d 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue3Native/${entityName}List.vuei @@ -172,6 +172,10 @@ <#if need_pca> import { getAreaTextByCode } from '/@/components/Form/src/utils/Area'; + <#if need_popup_dict> + import {getPopDictByCode} from "@/utils/dict"; + import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil"; + <#if bpm_flag==true> import { startProcess } from '/@/api/common/api'; @@ -204,6 +208,9 @@ return Object.assign(params, queryParam); }, + <#if need_popup_dict> + afterFetch: afterFetch + }, exportConfig: { name: "${tableVo.ftlDescription}", @@ -465,6 +472,28 @@ return queryParamClone; } + + <#if need_popup_dict> + /** + * 翻译Popup字典配置 + */ + async function afterFetch(records){ +<#list columns as po> + <#if po.isQuery=='Y' || po.isShowList=='Y'> + <#if po.classType=='popup_dict'> + const ${po.fieldName}Keys = [...new Set(records.map((item) => item['${po.fieldName}']).flatMap((item) => item && item.split(',')))]; + if(${po.fieldName}Keys && ${po.fieldName}Keys.length){ + const dictOptions = await getPopDictByCode(${po.fieldName}Keys.join(','), '${po.dictTable},${po.dictField},${po.dictText}'); + records.forEach((item) => { + item['${po.fieldName}_dictText'] = filterMultiDictText(dictOptions, item['${po.fieldName}']); + }); + } + + + + return records; + } +