Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
d8d636fd
Commit
d8d636fd
authored
Aug 04, 2020
by
fungleo
Browse files
优化 回显数据字典(字符串数组)JS 函数
parent
8deacb70
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-ui/src/utils/ruoyi.js
View file @
d8d636fd
...
...
@@ -78,18 +78,17 @@ export function selectDictLabel(datas, value) {
}
// 回显数据字典(字符串数组)
export
function
selectDictLabels
(
datas
,
value
,
separator
)
{
var
actions
=
[];
var
currentSeparator
=
undefined
===
separator
?
"
,
"
:
separator
;
var
temp
=
value
.
split
(
currentSeparator
);
Object
.
keys
(
value
.
split
(
currentSeparator
)).
some
((
val
)
=>
{
Object
.
keys
(
datas
).
some
((
key
)
=>
{
if
(
datas
[
key
].
dictValue
==
(
''
+
temp
[
val
]))
{
actions
.
push
(
datas
[
key
].
dictLabel
+
currentSeparator
);
}
})
})
return
actions
.
join
(
''
).
substring
(
0
,
actions
.
join
(
''
).
length
-
1
);
export
function
selectDictLabels
(
datas
=
{},
value
=
''
,
separator
=
'
,
'
)
{
const
actions
=
[]
const
temp
=
value
.
split
(
separator
)
temp
.
forEach
((
_
,
index
)
=>
{
Object
.
keys
(
datas
).
forEach
(
key
=>
{
if
(
datas
[
key
].
dictValue
===
temp
[
index
].
toString
())
{
actions
.
push
(
datas
[
key
].
dictLabel
)
}
})
})
return
actions
.
join
(
separator
)
}
// 通用下载方法
...
...
Write
Preview
Supports
Markdown
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