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
1aea6aca
authored
May 16, 2025
by
王靖文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理,选中树形后无法取消选中问题
parent
581ca07c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
package-lock.json
+0
-0
src/views/system/user/DeptTree.vue
+17
-1
src/views/system/user/index.vue
+6
-1
No files found.
package-lock.json
0 → 100644
View file @
1aea6aca
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/views/system/user/DeptTree.vue
View file @
1aea6aca
...
...
@@ -46,8 +46,24 @@ const filterNode = (name: string, data: Tree) => {
}
/** 处理部门被点击 */
const
handleNodeClick
=
async
(
row
:
{
[
key
:
string
]:
any
})
=>
{
let
currentNode
:
any
=
{}
const
handleNodeClick
=
async
(
row
:
{
[
key
:
string
]:
any
},
treeNode
:
any
)
=>
{
// 判断选中状态
if
(
currentNode
&&
currentNode
.
name
===
row
.
name
)
{
treeNode
.
checked
=
!
treeNode
.
checked
}
else
{
treeNode
.
checked
=
true
}
if
(
treeNode
.
checked
)
{
// 选中
currentNode
=
row
emits
(
'node-click'
,
row
)
}
else
{
// 取消选中
treeRef
.
value
!
.
setCurrentKey
(
undefined
)
emits
(
'node-click'
,
undefined
)
currentNode
=
null
}
}
const
emits
=
defineEmits
([
'node-click'
])
...
...
src/views/system/user/index.vue
View file @
1aea6aca
...
...
@@ -255,9 +255,14 @@ const resetQuery = () => {
}
/** 处理部门被点击 */
const
handleDeptNodeClick
=
async
(
row
)
=>
{
const
handleDeptNodeClick
=
async
(
row
:
any
)
=>
{
if
(
row
===
undefined
)
{
queryParams
.
deptId
=
undefined
await
getList
()
}
else
{
queryParams
.
deptId
=
row
.
id
await
getList
()
}
}
/** 添加/修改操作 */
...
...
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