update public/assets/js/require-table.js.

searchList 如果传入的是$.getJSON,则无法正确显示label

如果传入的是value直接是数组的话就无需切割成数组

Signed-off-by: 还俗二师兄 <505097558@qq.com>
pull/468/head
还俗二师兄 2024-07-17 16:55:12 +00:00 committed by Gitee
parent ac25e4b275
commit 6ab795e12f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 10 additions and 1 deletions

View File

@ -870,6 +870,15 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
value = Fast.api.escape(customValue);
field = this.customField;
}
if (typeof that.searchList === 'object' && typeof that.searchList.then === 'function') {
$.when(that.searchList).done(function (ret) {
if (ret.data && ret.data.searchlist && $.isArray(ret.data.searchlist)) {
that.searchList = ret.data.searchlist;
} else if (ret.constructor === Array || ret.constructor === Object) {
that.searchList = ret;
}
})
}
if (typeof that.searchList === 'object' && typeof that.custom === 'undefined') {
var i = 0;
var searchValues = Object.keys(colorArr).map(function (e) {
@ -885,7 +894,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
//渲染Flag
var html = [];
var arr = value !== '' ? value.split(',') : [];
var arr = $.isArray(value) ? value : value !== '' ? value.split(',') : [];
var color, display, label;
$.each(arr, function (i, value) {
value = value == null || value.length === 0 ? '' : value.toString();