mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
Jeecg Boot 2.2.1 版本发布,低代码平台
This commit is contained in:
@ -36,15 +36,20 @@ export async function initDictOptions(dictCode) {
|
||||
*/
|
||||
export function filterDictText(dictOptions, text) {
|
||||
// --update-begin----author:sunjianlei---date:20200323------for: 字典翻译 text 允许逗号分隔 ---
|
||||
if (text != null && dictOptions instanceof Array) {
|
||||
if (text != null && Array.isArray(dictOptions)) {
|
||||
let result = []
|
||||
// 允许多个逗号分隔
|
||||
let splitText = text.toString().trim().split(',')
|
||||
// 允许多个逗号分隔,允许传数组对象
|
||||
let splitText
|
||||
if (Array.isArray(text)) {
|
||||
splitText = text
|
||||
} else {
|
||||
splitText = text.toString().trim().split(',')
|
||||
}
|
||||
for (let txt of splitText) {
|
||||
let dictText = txt
|
||||
for (let dictItem of dictOptions) {
|
||||
if (txt === dictItem.value.toString()) {
|
||||
dictText = dictItem.text
|
||||
if (txt.toString() === dictItem.value.toString()) {
|
||||
dictText = (dictItem.text || dictItem.title || dictItem.label)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user