Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e08dcc9d
authored
Mar 27, 2023
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 重构用户管理部门回显方法
parent
7c6e2636
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
src/views/system/user/index.vue
+14
-16
No files found.
src/views/system/user/index.vue
View file @
e08dcc9d
...
@@ -332,26 +332,24 @@ const getPostOptions = async () => {
...
@@ -332,26 +332,24 @@ const getPostOptions = async () => {
const
res
=
await
getSimplePostList
()
const
res
=
await
getSimplePostList
()
postOptions
.
value
.
push
(...
res
)
postOptions
.
value
.
push
(...
res
)
}
}
const
dataFormater
=
(
val
)
=>
{
const
dataFormater
=
computed
(()
=>
(
deptId
:
number
)
=>
deptFormater
(
deptOptions
.
value
,
deptId
))
return
deptFormater
(
deptOptions
.
value
,
val
)
}
//部门回显
//部门回显
const
deptFormater
=
(
ary
,
val
:
any
)
=>
{
const
deptFormater
=
(
arr
:
Tree
[],
deptId
:
number
)
=>
{
var
o
=
''
let
deptName
=
''
if
(
ary
&&
val
)
{
if
(
arr
&&
deptId
)
{
for
(
const
v
of
ary
)
{
for
(
const
item
of
arr
)
{
if
(
v
.
id
==
val
)
{
if
(
item
.
id
===
deptId
)
{
o
=
v
.
name
deptName
=
item
.
name
if
(
o
)
return
o
break
}
else
if
(
v
.
children
?.
length
)
{
}
o
=
deptFormater
(
v
.
children
,
val
)
if
(
item
.
children
)
{
if
(
o
)
return
o
deptName
=
deptFormater
(
item
.
children
,
deptId
)
??
''
break
}
}
}
}
return
o
}
else
{
return
val
}
}
return
deptName
}
}
// 设置标题
// 设置标题
...
...
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