Commit 133a10ecf2ac2082ce68f1f9799a05937c7df9b7

Authored by 若依
Committed by Gitee
2 parents 6a84ae42 a09a342f

!47 修复和优化前端 utils 工具函数

Merge pull request !47 from FungLeo/master
ruoyi-ui/src/utils/index.js
  1 +import { parseTime } from './ruoyi'
  2 +
1 3 /**
2 4 * 表格时间格式化
3 5 */
... ... @@ -385,4 +387,4 @@ export function camelCase(str) {
385 387 export function isNumberStr(str) {
386 388 return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
387 389 }
388   -
389 390 \ No newline at end of file
  391 +
... ...
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 +
... ...