Browse Source

!47 修复和优化前端 utils 工具函数
Merge pull request !47 from FungLeo/master

若依 4 years ago
parent
commit
133a10ecf2
2 changed files with 6 additions and 4 deletions
  1. 3 1
      ruoyi-ui/src/utils/index.js
  2. 3 3
      ruoyi-ui/src/utils/ruoyi.js

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

@@ -1,3 +1,5 @@
+import { parseTime } from './ruoyi'
+
 /**
  * 表格时间格式化
  */
@@ -385,4 +387,4 @@ export function camelCase(str) {
 export function isNumberStr(str) {
   return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
 }
- 
+ 

+ 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;
   }
-  
+