Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
00f3bd22
authored
2023-08-16 11:33:05 +0800
by
yangwei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
字典递归过滤
1 parent
f82fd6cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
src/utils/dictionary.js
src/utils/dictionary.js
View file @
00f3bd2
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-0
7-03 08:59:06
* @LastEditTime: 2023-0
8-16 11:30:45
*/
import
store
from
'@/store'
...
...
@@ -27,12 +27,18 @@ export function getSjlx (level) {
*/
export
function
getDictLeabel
(
level
,
code
)
{
const
resultMap
=
store
.
getters
.
dictData
[
code
]
const
desiredObject
=
resultMap
.
find
(
obj
=>
obj
.
dcode
===
level
);
if
(
desiredObject
)
{
const
desiredName
=
desiredObject
.
dname
;
return
desiredName
}
else
{
return
''
function
findNode
(
tree
,
func
)
{
for
(
const
node
of
tree
)
{
if
(
func
(
node
))
return
node
if
(
node
.
children
)
{
const
res
=
findNode
(
node
.
children
,
func
)
if
(
res
)
return
res
}
}
return
{
dname
:
""
}
}
}
let
data
=
findNode
(
resultMap
,
(
node
)
=>
{
return
node
.
dcode
===
level
})
return
data
.
dname
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment