Explorar el Código

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

fungleo hace 4 años
padre
commit
a09a342f58
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      ruoyi-ui/src/utils/ruoyi.js

+ 3 - 3
ruoyi-ui/src/utils/ruoyi.js

@@ -68,10 +68,10 @@ export function addDateRange(params, dateRange) {
 // 回显数据字典
 export function selectDictLabel(datas, value) {
 	var actions = [];
-	Object.keys(datas).map((key) => {
+	Object.keys(datas).some((key) => {
 		if (datas[key].dictValue == ('' + value)) {
 			actions.push(datas[key].dictLabel);
-			return false;
+			return true;
 		}
 	})
 	return actions.join('');
@@ -131,4 +131,4 @@ export function handleTree(data, id, parentId, children, rootId) {
 	});
 	return treeData != '' ? treeData : data;
   }
-  
+