页面若未匹配到字典标签则返回原字典值

pull/372/head
RuoYi 2022-02-23 16:57:07 +08:00
parent a7350294e8
commit c2743f949e
1 changed files with 9 additions and 1 deletions

View File

@ -539,6 +539,9 @@ var table = {
return false;
}
});
if (actions.length === 0) {
actions.push($.common.sprintf("<span>%s</span>", value))
}
return actions.join('');
},
// 回显数据字典(字符串数组)
@ -549,13 +552,18 @@ var table = {
var currentSeparator = $.common.isEmpty(separator) ? "," : separator;
var actions = [];
$.each(value.split(currentSeparator), function(i, val) {
var match = false
$.each(datas, function(index, dict) {
if (dict.dictValue == ('' + val)) {
var listClass = $.common.equals("default", dict.listClass) || $.common.isEmpty(dict.listClass) ? "" : "badge badge-" + dict.listClass;
actions.push($.common.sprintf("<span class='%s'>%s </span>", listClass, dict.dictLabel));
actions.push($.common.sprintf("<span class='%s'>%s</span>", listClass, dict.dictLabel));
match = true
return false;
}
});
if (!match) {
actions.push($.common.sprintf("<span> %s </span>", val));
}
});
return actions.join('');
},