mirror of https://github.com/jeecgboot/jeecg-boot
Merge branch 'master' of https://github.com/zhangdaiscott/jeecg-boot
commit
9ad7ef5ab4
|
@ -2,6 +2,7 @@
|
||||||
<div>
|
<div>
|
||||||
<#assign list_need_category=false>
|
<#assign list_need_category=false>
|
||||||
<#assign list_need_pca=false>
|
<#assign list_need_pca=false>
|
||||||
|
<#assign list_has_popup_dict=false>
|
||||||
<#assign bpm_flag=false>
|
<#assign bpm_flag=false>
|
||||||
|
|
||||||
<#-- 开始循环 -->
|
<#-- 开始循环 -->
|
||||||
|
@ -12,6 +13,9 @@
|
||||||
<#if po.classType=='cat_tree' && po.dictText?default("")?trim?length == 0>
|
<#if po.classType=='cat_tree' && po.dictText?default("")?trim?length == 0>
|
||||||
<#assign list_need_category=true>
|
<#assign list_need_category=true>
|
||||||
</#if>
|
</#if>
|
||||||
|
<#if po.classType=='popup_dict'>
|
||||||
|
<#assign list_has_popup_dict=true>
|
||||||
|
</#if>
|
||||||
<#if po.classType=='pca'>
|
<#if po.classType=='pca'>
|
||||||
<#assign list_need_pca=true>
|
<#assign list_need_pca=true>
|
||||||
</#if>
|
</#if>
|
||||||
|
@ -91,6 +95,10 @@
|
||||||
import { loadCategoryData } from '/@/api/common/api'
|
import { loadCategoryData } from '/@/api/common/api'
|
||||||
import { getAuthCache, setAuthCache } from '/@/utils/auth';
|
import { getAuthCache, setAuthCache } from '/@/utils/auth';
|
||||||
import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum';
|
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>
|
||||||
<#if bpm_flag==true>
|
<#if bpm_flag==true>
|
||||||
import { startProcess } from '/@/api/common/api';
|
import { startProcess } from '/@/api/common/api';
|
||||||
|
@ -146,6 +154,9 @@
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return Object.assign(params, queryParam);
|
return Object.assign(params, queryParam);
|
||||||
},
|
},
|
||||||
|
<#if list_has_popup_dict>
|
||||||
|
afterFetch: afterFetch
|
||||||
|
</#if>
|
||||||
},
|
},
|
||||||
exportConfig: {
|
exportConfig: {
|
||||||
name:"${tableVo.ftlDescription}",
|
name:"${tableVo.ftlDescription}",
|
||||||
|
@ -319,6 +330,28 @@
|
||||||
}
|
}
|
||||||
initDictConfig();
|
initDictConfig();
|
||||||
</#if>
|
</#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.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>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
|
@ -24,6 +24,21 @@ export const getDictItemsByCode = (code) => {
|
||||||
// update-end--author:liaozhiyang---date:20230908---for:【QQYUN-6417】生产环境字典慢的问题
|
// update-end--author:liaozhiyang---date:20230908---for:【QQYUN-6417】生产环境字典慢的问题
|
||||||
|
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* Popup字典翻译方法
|
||||||
|
* @param text
|
||||||
|
* @param code
|
||||||
|
*/
|
||||||
|
export const getPopDictByCode = (text, codeStr) => {
|
||||||
|
const [code, dictCode, dictText] = codeStr.split(',');
|
||||||
|
if (!code || !dictCode || !dictText) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return defHttp.get(
|
||||||
|
{ url: `/online/api/cgreportGetDataPackage`, params: { code, dictText, dictCode, dataList: text } },
|
||||||
|
{ isTransformResponse: false }
|
||||||
|
);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* 获取字典数组
|
* 获取字典数组
|
||||||
* @param dictCode 字典Code
|
* @param dictCode 字典Code
|
||||||
|
|
Loading…
Reference in New Issue