Sfoglia il codice sorgente

优化selectDictLabel方法,数组迭代器换为some

RuoYi 5 anni fa
parent
commit
4126f634ba
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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) {
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('');
@@ -144,4 +144,4 @@ export function tansParams(params) {
144 144
 		}
145 145
 	})
146 146
 	return result
147
-}
147
+}