From 6ab795e12fff286bcabf87ed4929ecc731c72c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=98=E4=BF=97=E4=BA=8C=E5=B8=88=E5=85=84?= <505097558@qq.com> Date: Wed, 17 Jul 2024 16:55:12 +0000 Subject: [PATCH] =?UTF-8?q?update=20public/assets/js/require-table.js.=20s?= =?UTF-8?q?earchList=20=E5=A6=82=E6=9E=9C=E4=BC=A0=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E6=98=AF$.getJSON,=E5=88=99=E6=97=A0=E6=B3=95=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=98=BE=E7=A4=BAlabel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如果传入的是value直接是数组的话就无需切割成数组 Signed-off-by: 还俗二师兄 <505097558@qq.com> --- public/assets/js/require-table.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index 3df6305f6..91b062a23 100755 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -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(); -- Gitee