代码生成器模板更新,popup字典下拉翻译问题
This commit is contained in:
parent
27a7046465
commit
a2f18fd0d9
@ -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>
|
||||
|
@ -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) => {
|
||||
|
@ -171,6 +171,10 @@
|
||||
</#if>
|
||||
<#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';
|
||||
@ -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>
|
||||
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
||||
@ -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>
|
||||
@ -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…
x
Reference in New Issue
Block a user