Commit a09a342f58c282a89df6b5bc274cf8f37f8bf6f3
1 parent
3e1bd8e3
优化 uitls/ruoyi.js 中 selectDictLabel 方法,数组迭代器换为 some
提高性能
Showing
1 changed file
with
3 additions
and
3 deletions
ruoyi-ui/src/utils/ruoyi.js
| ... | ... | @@ -68,10 +68,10 @@ export function addDateRange(params, dateRange) { |
| 68 | 68 | // 回显数据字典 |
| 69 | 69 | export function selectDictLabel(datas, value) { |
| 70 | 70 | var actions = []; |
| 71 | - Object.keys(datas).map((key) => { | |
| 71 | + Object.keys(datas).some((key) => { | |
| 72 | 72 | if (datas[key].dictValue == ('' + value)) { |
| 73 | 73 | actions.push(datas[key].dictLabel); |
| 74 | - return false; | |
| 74 | + return true; | |
| 75 | 75 | } |
| 76 | 76 | }) |
| 77 | 77 | return actions.join(''); |
| ... | ... | @@ -131,4 +131,4 @@ export function handleTree(data, id, parentId, children, rootId) { |
| 131 | 131 | }); |
| 132 | 132 | return treeData != '' ? treeData : data; |
| 133 | 133 | } |
| 134 | - | |
| 135 | 134 | \ No newline at end of file |
| 135 | + | ... | ... |