mirror of https://github.com/jeecgboot/jeecg-boot
Merge branch 'master' of https://github.com/zhangdaiscott/jeecg-boot
commit
e18e980892
|
@ -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<IPage<${entityName}>> 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<String> 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<String> 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<String> 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<String> 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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -172,6 +172,10 @@
|
|||
<#if need_pca>
|
||||
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
|
||||
</#if>
|
||||
<#if need_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
|
@ -204,6 +208,9 @@
|
|||
return Object.assign(params, queryParam);
|
||||
</#if>
|
||||
},
|
||||
<#if need_popup_dict>
|
||||
afterFetch: afterFetch
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name: "${tableVo.ftlDescription}",
|
||||
|
@ -465,6 +472,28 @@
|
|||
return queryParamClone;
|
||||
}
|
||||
</#if>
|
||||
|
||||
<#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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -42,8 +42,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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>
|
||||
|
@ -81,7 +81,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -100,7 +100,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary="${tableVo.ftlDescription}-添加")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -120,7 +120,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -141,7 +141,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -156,7 +156,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary="${tableVo.ftlDescription}-批量删除")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -171,7 +171,7 @@ public class ${entityName}Controller {
|
|||
* @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);
|
||||
|
@ -190,7 +190,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
@Operation(summary = "${sub.ftlDescription}-通主表ID查询")
|
||||
@Operation(summary="${sub.ftlDescription}主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<List<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
* @Author: jeecg-boot
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,6 @@ import java.util.Date;
|
|||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
* @Author: jeecg-boot
|
||||
|
|
|
@ -33,8 +33,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;
|
||||
|
||||
|
@ -68,7 +68,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 = "/rootList")
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -164,7 +164,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 = "/childList")
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},HttpServletRequest req) {
|
||||
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
|
||||
|
@ -182,7 +182,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-批量获取子数据")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-批量获取子数据")
|
||||
@Operation(summary="${tableVo.ftlDescription}-批量获取子数据")
|
||||
@GetMapping("/getChildListBatch")
|
||||
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
|
||||
try {
|
||||
|
@ -206,7 +206,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<String> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
|
@ -221,7 +221,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<String> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
|
@ -236,7 +236,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<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -251,7 +251,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<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -266,7 +266,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);
|
||||
|
|
|
@ -15,8 +15,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<#assign pidFieldName = "">
|
||||
<#assign hasChildrenField = "">
|
||||
<#assign bpm_flag=false>
|
||||
<#assign list_has_popup_dict=false>
|
||||
<#list originalColumns as po>
|
||||
<#if po.fieldDbName == tableVo.extendParams.pidField>
|
||||
<#assign pidFieldName = po.fieldName>
|
||||
|
@ -19,6 +20,9 @@
|
|||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='popup_dict'>
|
||||
<#assign list_has_popup_dict=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<template>
|
||||
<div>
|
||||
|
@ -93,6 +97,10 @@
|
|||
<#if list_need_pca>
|
||||
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
|
||||
</#if>
|
||||
<#if list_has_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
|
@ -150,6 +158,9 @@
|
|||
params.hasQuery = "true";
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
<#if list_has_popup_dict>
|
||||
afterFetch: afterFetch
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
|
@ -442,7 +453,27 @@
|
|||
await reload();
|
||||
}
|
||||
</#if>
|
||||
|
||||
<#if list_has_popup_dict>
|
||||
/**
|
||||
* 翻译Popup字典配置
|
||||
*/
|
||||
async function afterFetch(records){
|
||||
<#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 && 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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -181,6 +181,10 @@
|
|||
<#if need_pca>
|
||||
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
|
||||
</#if>
|
||||
<#if need_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
<#if is_range>
|
||||
import { cloneDeep } from "lodash-es";
|
||||
</#if>
|
||||
|
@ -214,6 +218,9 @@
|
|||
return Object.assign(params, queryParam.value);
|
||||
</#if>
|
||||
},
|
||||
<#if need_popup_dict>
|
||||
afterFetch: afterFetch
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name: "${tableVo.ftlDescription}",
|
||||
|
@ -623,6 +630,28 @@
|
|||
return queryParamClone;
|
||||
}
|
||||
</#if>
|
||||
|
||||
<#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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -24,8 +24,8 @@ import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
|
|||
<#list subTables as sub>
|
||||
import ${bussiPackage}.${entityPackage}.service.I${sub.entityName}Service;
|
||||
</#list>
|
||||
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.SecurityUtils;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
|
@ -79,7 +79,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<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -109,7 +109,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<String> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
|
@ -123,7 +123,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<String> 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<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -151,7 +151,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<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -188,7 +188,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
|
||||
@Operation(summary = "${sub.ftlDescription}-通过主表ID查询")
|
||||
@Operation(summary="${sub.ftlDescription}-通过主表ID查询")
|
||||
@GetMapping(value = "/list${sub.entityName}ByMainId")
|
||||
public Result<IPage<${sub.entityName}>> list${sub.entityName}ByMainId(${sub.entityName} ${sub.entityName?uncap_first},
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
|
@ -206,7 +206,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}-添加")
|
||||
@Operation(summary = "${sub.ftlDescription}-添加")
|
||||
@Operation(summary="${sub.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add${sub.entityName}")
|
||||
public Result<String> add${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
||||
${sub.entityName?uncap_first}Service.save(${sub.entityName?uncap_first});
|
||||
|
@ -219,7 +219,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}-编辑")
|
||||
@Operation(summary = "${sub.ftlDescription}-编辑")
|
||||
@Operation(summary="${sub.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit${sub.entityName}", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
||||
${sub.entityName?uncap_first}Service.updateById(${sub.entityName?uncap_first});
|
||||
|
@ -232,7 +232,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}-通过id删除")
|
||||
@Operation(summary = "${sub.ftlDescription}-通过id删除")
|
||||
@Operation(summary="${sub.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete${sub.entityName}")
|
||||
public Result<String> delete${sub.entityName}(@RequestParam(name="id",required=true) String id) {
|
||||
${sub.entityName?uncap_first}Service.removeById(id);
|
||||
|
@ -245,7 +245,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}-批量删除")
|
||||
@Operation(summary = "${sub.ftlDescription}-批量删除")
|
||||
@Operation(summary="${sub.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch${sub.entityName}")
|
||||
public Result<String> deleteBatch${sub.entityName}(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${sub.entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(",")));
|
||||
|
|
|
@ -15,8 +15,8 @@ import lombok.Data;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -16,8 +16,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<#assign list_need_category=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#assign list_has_popup_dict=false>
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
|
@ -15,6 +15,9 @@
|
|||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='popup_dict'>
|
||||
<#assign list_has_popup_dict=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<div class="content">
|
||||
|
@ -103,6 +106,10 @@
|
|||
import { getAreaTextByCode } from '/@/components/Form/src/utils/Area';
|
||||
</#if>
|
||||
<#if list_need_category>
|
||||
<#if list_has_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
import { loadCategoryData } from '/@/api/common/api'
|
||||
import { getAuthCache, setAuthCache } from '/@/utils/auth';
|
||||
import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum';
|
||||
|
@ -158,6 +165,9 @@
|
|||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
<#if list_has_popup_dict>
|
||||
afterFetch: afterFetch,
|
||||
</#if>
|
||||
pagination:{
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
|
@ -341,6 +351,28 @@
|
|||
}
|
||||
initDictConfig();
|
||||
</#if>
|
||||
|
||||
<#if list_has_popup_dict>
|
||||
/**
|
||||
* 翻译Popup字典配置
|
||||
*/
|
||||
async function afterFetch(records){
|
||||
<#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 && 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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -198,6 +198,10 @@
|
|||
<#if is_range>
|
||||
import { cloneDeep } from "lodash-es";
|
||||
</#if>
|
||||
<#if need_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
|
@ -225,6 +229,9 @@
|
|||
return Object.assign(params, queryParam);
|
||||
</#if>
|
||||
},
|
||||
<#if need_popup_dict>
|
||||
afterFetch: afterFetch,
|
||||
</#if>
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
|
@ -419,7 +426,27 @@
|
|||
}
|
||||
initDictConfig();
|
||||
</#if>
|
||||
|
||||
<#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' && need_popup_dict==true>
|
||||
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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
/* ----------------------以下为原生查询需要添加的-------------------------- */
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const labelCol = reactive({
|
||||
|
|
|
@ -44,8 +44,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 has_multi_query_field=false>
|
||||
|
@ -82,7 +82,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -113,7 +113,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary="${tableVo.ftlDescription}-添加")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -130,7 +130,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -151,7 +151,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -166,7 +166,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary="${tableVo.ftlDescription}-批量删除")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -181,7 +181,7 @@ public class ${entityName}Controller {
|
|||
* @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);
|
||||
|
@ -200,7 +200,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
|
||||
@Operation(summary = "${sub.ftlDescription}-通过主表ID查询")
|
||||
@Operation(summary="${sub.ftlDescription}-通过主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<IPage<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
|
|
|
@ -15,8 +15,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -16,8 +16,8 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,8 +15,8 @@ import java.util.Date;
|
|||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<#assign list_need_category=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign bpm_flag=false>
|
||||
<#assign list_has_popup_dict=false>
|
||||
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
|
@ -18,6 +19,9 @@
|
|||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='popup_dict'>
|
||||
<#assign list_has_popup_dict=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<!--引用表格-->
|
||||
|
@ -111,6 +115,10 @@
|
|||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
<#if list_has_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const queryParam = reactive<any>({});
|
||||
// 展开key
|
||||
|
@ -164,6 +172,9 @@
|
|||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
<#if list_has_popup_dict>
|
||||
afterFetch: afterFetch
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
|
@ -348,6 +359,28 @@
|
|||
}
|
||||
initDictConfig();
|
||||
</#if>
|
||||
|
||||
<#if list_has_popup_dict>
|
||||
/**
|
||||
* 翻译Popup字典配置
|
||||
*/
|
||||
async function afterFetch(records){
|
||||
<#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 && 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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -44,8 +44,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -122,7 +122,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary="${tableVo.ftlDescription}-添加")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -142,7 +142,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -163,7 +163,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -178,7 +178,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary="${tableVo.ftlDescription}-批量删除")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -193,7 +193,7 @@ public class ${entityName}Controller {
|
|||
* @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);
|
||||
|
@ -212,7 +212,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
@Operation(summary = "${sub.ftlDescription}-通主表ID查询")
|
||||
@Operation(summary="${sub.ftlDescription}主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<List<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
|
|
|
@ -15,8 +15,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,8 +15,8 @@ import java.util.Date;
|
|||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<#assign list_need_category=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#assign list_has_popup_dict=false>
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
|
@ -15,6 +15,9 @@
|
|||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='popup_dict'>
|
||||
<#assign list_has_popup_dict=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<!--引用表格-->
|
||||
|
@ -92,6 +95,10 @@
|
|||
import { getAuthCache, setAuthCache } from '/@/utils/auth';
|
||||
import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum';
|
||||
</#if>
|
||||
<#if list_has_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
|
@ -146,6 +153,9 @@
|
|||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
<#if list_has_popup_dict>
|
||||
afterFetch: afterFetch
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
|
@ -321,6 +331,28 @@
|
|||
}
|
||||
initDictConfig();
|
||||
</#if>
|
||||
|
||||
<#if list_has_popup_dict>
|
||||
/**
|
||||
* 翻译Popup字典配置
|
||||
*/
|
||||
async function afterFetch(records){
|
||||
<#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 && 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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -182,6 +182,10 @@
|
|||
<#if is_range>
|
||||
import { cloneDeep } from "lodash-es";
|
||||
</#if>
|
||||
<#if need_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
|
@ -209,6 +213,9 @@
|
|||
return Object.assign(params, queryParam);
|
||||
</#if>
|
||||
},
|
||||
<#if need_popup_dict>
|
||||
afterFetch: afterFetch,
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
|
@ -394,6 +401,27 @@
|
|||
initDictConfig();
|
||||
</#if>
|
||||
|
||||
<#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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
/* ----------------------以下为原生查询需要添加的-------------------------- */
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const labelCol = reactive({
|
||||
|
|
|
@ -44,8 +44,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 has_multi_query_field=false>
|
||||
|
@ -82,7 +82,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@Operation(summary="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
@ -113,7 +113,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-添加")
|
||||
@Operation(summary="${tableVo.ftlDescription}-添加")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -130,7 +130,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
|
@ -151,7 +151,7 @@ public class ${entityName}Controller {
|
|||
* @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<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
@ -166,7 +166,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary = "${tableVo.ftlDescription}-批量删除")
|
||||
@Operation(summary="${tableVo.ftlDescription}-批量删除")
|
||||
@RequiresPermissions("${entityPackage}:${tableName}:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
|
@ -181,7 +181,7 @@ public class ${entityName}Controller {
|
|||
* @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);
|
||||
|
@ -200,7 +200,7 @@ public class ${entityName}Controller {
|
|||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
@Operation(summary = "${sub.ftlDescription}-通主表ID查询")
|
||||
@Operation(summary="${sub.ftlDescription}主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<List<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
|
|
|
@ -15,8 +15,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -15,8 +15,8 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.util.Date;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,8 +15,8 @@ import java.util.Date;
|
|||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @Description: ${tableVo.ftlDescription}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<#assign list_need_category=false>
|
||||
<#assign list_need_pca=false>
|
||||
<#assign bpm_flag=false>
|
||||
|
||||
<#assign list_has_popup_dict=false>
|
||||
<#-- 开始循环 -->
|
||||
<#list columns as po>
|
||||
<#if po.fieldDbName=='bpm_status'>
|
||||
|
@ -15,6 +15,9 @@
|
|||
<#if po.classType=='pca'>
|
||||
<#assign list_need_pca=true>
|
||||
</#if>
|
||||
<#if po.classType=='popup_dict'>
|
||||
<#assign list_has_popup_dict=true>
|
||||
</#if>
|
||||
</#list>
|
||||
<#-- 结束循环 -->
|
||||
<!--引用表格-->
|
||||
|
@ -92,6 +95,10 @@
|
|||
import { getAuthCache, setAuthCache } from '/@/utils/auth';
|
||||
import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum';
|
||||
</#if>
|
||||
<#if list_has_popup_dict>
|
||||
import {getPopDictByCode} from "@/utils/dict";
|
||||
import {filterMultiDictText} from "@/utils/dict/JDictSelectUtil";
|
||||
</#if>
|
||||
<#if bpm_flag==true>
|
||||
import { startProcess } from '/@/api/common/api';
|
||||
</#if>
|
||||
|
@ -146,6 +153,9 @@
|
|||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
<#if list_has_popup_dict>
|
||||
afterFetch: afterFetch
|
||||
</#if>
|
||||
},
|
||||
exportConfig: {
|
||||
name:"${tableVo.ftlDescription}",
|
||||
|
@ -320,6 +330,28 @@
|
|||
}
|
||||
initDictConfig();
|
||||
</#if>
|
||||
|
||||
<#if list_has_popup_dict>
|
||||
/**
|
||||
* 翻译Popup字典配置
|
||||
*/
|
||||
async function afterFetch(records){
|
||||
<#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 && 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}']);
|
||||
});
|
||||
}
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
return records;
|
||||
}
|
||||
</#if>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
Loading…
Reference in New Issue