Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
cb5a6d29
Commit
cb5a6d29
authored
Feb 23, 2022
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面若未匹配到字典标签则返回原字典值
parent
4d8bd880
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
ruoyi-ui/src/utils/ruoyi.js
ruoyi-ui/src/utils/ruoyi.js
+12
-1
No files found.
ruoyi-ui/src/utils/ruoyi.js
View file @
cb5a6d29
...
@@ -70,6 +70,9 @@ export function addDateRange(params, dateRange, propName) {
...
@@ -70,6 +70,9 @@ export function addDateRange(params, dateRange, propName) {
// 回显数据字典
// 回显数据字典
export
function
selectDictLabel
(
datas
,
value
)
{
export
function
selectDictLabel
(
datas
,
value
)
{
if
(
value
===
undefined
)
{
return
""
;
}
var
actions
=
[];
var
actions
=
[];
Object
.
keys
(
datas
).
some
((
key
)
=>
{
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
value
==
(
''
+
value
))
{
if
(
datas
[
key
].
value
==
(
''
+
value
))
{
...
@@ -77,23 +80,31 @@ export function selectDictLabel(datas, value) {
...
@@ -77,23 +80,31 @@ export function selectDictLabel(datas, value) {
return
true
;
return
true
;
}
}
})
})
if
(
actions
.
length
===
0
)
{
actions
.
push
(
value
);
}
return
actions
.
join
(
''
);
return
actions
.
join
(
''
);
}
}
// 回显数据字典(字符串数组)
// 回显数据字典(字符串数组)
export
function
selectDictLabels
(
datas
,
value
,
separator
)
{
export
function
selectDictLabels
(
datas
,
value
,
separator
)
{
if
(
value
===
undefined
)
{
if
(
value
===
undefined
)
{
return
""
;
return
""
;
}
}
var
actions
=
[];
var
actions
=
[];
var
currentSeparator
=
undefined
===
separator
?
"
,
"
:
separator
;
var
currentSeparator
=
undefined
===
separator
?
"
,
"
:
separator
;
var
temp
=
value
.
split
(
currentSeparator
);
var
temp
=
value
.
split
(
currentSeparator
);
Object
.
keys
(
value
.
split
(
currentSeparator
)).
some
((
val
)
=>
{
Object
.
keys
(
value
.
split
(
currentSeparator
)).
some
((
val
)
=>
{
var
match
=
false
;
Object
.
keys
(
datas
).
some
((
key
)
=>
{
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
value
==
(
''
+
temp
[
val
]))
{
if
(
datas
[
key
].
value
==
(
''
+
temp
[
val
]))
{
actions
.
push
(
datas
[
key
].
label
+
currentSeparator
);
actions
.
push
(
datas
[
key
].
label
+
currentSeparator
);
match
=
true
;
}
}
})
})
if
(
!
match
)
{
actions
.
push
(
temp
[
val
]
+
currentSeparator
);
}
})
})
return
actions
.
join
(
''
).
substring
(
0
,
actions
.
join
(
''
).
length
-
1
);
return
actions
.
join
(
''
).
substring
(
0
,
actions
.
join
(
''
).
length
-
1
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment