提交 a09a342f authored 作者: fungleo's avatar fungleo

优化 uitls/ruoyi.js 中 selectDictLabel 方法,数组迭代器换为 some

提高性能
上级 3e1bd8e3
...@@ -68,10 +68,10 @@ export function addDateRange(params, dateRange) { ...@@ -68,10 +68,10 @@ export function addDateRange(params, dateRange) {
// 回显数据字典 // 回显数据字典
export function selectDictLabel(datas, value) { export function selectDictLabel(datas, value) {
var actions = []; var actions = [];
Object.keys(datas).map((key) => { Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) { if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel); actions.push(datas[key].dictLabel);
return false; return true;
} }
}) })
return actions.join(''); return actions.join('');
...@@ -131,4 +131,4 @@ export function handleTree(data, id, parentId, children, rootId) { ...@@ -131,4 +131,4 @@ export function handleTree(data, id, parentId, children, rootId) {
}); });
return treeData != '' ? treeData : data; return treeData != '' ? treeData : data;
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论