From a036b5a1247ebf90c5db81f09400057acbbd2e1a Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期四, 17 三月 2022 09:45:38 +0800 Subject: [PATCH] 修复Oracle数据库用户表头像列为null时不显示默认头像问题 --- src/utils/ruoyi.js | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index 4872d56..a051e82 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -70,6 +70,9 @@ // 鍥炴樉鏁版嵁瀛楀吀 export function selectDictLabel(datas, value) { + if (value === undefined) { + return ""; + } var actions = []; Object.keys(datas).some((key) => { if (datas[key].value == ('' + value)) { @@ -77,20 +80,31 @@ return true; } }) + if (actions.length === 0) { + actions.push(value); + } return actions.join(''); } // 鍥炴樉鏁版嵁瀛楀吀锛堝瓧绗︿覆鏁扮粍锛� export function selectDictLabels(datas, value, separator) { + if (value === undefined) { + return ""; + } var actions = []; var currentSeparator = undefined === separator ? "," : separator; var temp = value.split(currentSeparator); Object.keys(value.split(currentSeparator)).some((val) => { + var match = false; Object.keys(datas).some((key) => { if (datas[key].value == ('' + temp[val])) { actions.push(datas[key].label + currentSeparator); + match = true; } }) + if (!match) { + actions.push(temp[val] + currentSeparator); + } }) return actions.join('').substring(0, actions.join('').length - 1); } -- Gitblit v1.9.3