Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intelligent_qp_manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
intelligent_qp_manager
Commits
7ab616ea
Commit
7ab616ea
authored
Oct 29, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.退出登录接口注释
2.用户管理部门树默认展开
parent
0276c2d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
user.ts
src/store/modules/user.ts
+7
-7
DeptTree.vue
src/views/system/user/DeptTree.vue
+16
-4
No files found.
src/store/modules/user.ts
View file @
7ab616ea
...
@@ -154,13 +154,13 @@ export const useUserStore = defineStore({
...
@@ -154,13 +154,13 @@ export const useUserStore = defineStore({
* @description: logout
* @description: logout
*/
*/
async
logout
(
goLogin
=
false
)
{
async
logout
(
goLogin
=
false
)
{
if
(
this
.
getToken
)
{
//
if (this.getToken) {
try
{
//
try {
await
doLogout
();
//
await doLogout();
}
catch
{
//
} catch {
console
.
log
(
'注销Token失败'
);
//
console.log('注销Token失败');
}
//
}
}
//
}
this
.
setToken
(
undefined
);
this
.
setToken
(
undefined
);
this
.
setSessionTimeout
(
false
);
this
.
setSessionTimeout
(
false
);
this
.
setUserInfo
(
null
);
this
.
setUserInfo
(
null
);
...
...
src/views/system/user/DeptTree.vue
View file @
7ab616ea
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"m-4 mr-0 overflow-hidden bg-white"
>
<div
class=
"m-4 mr-0 overflow-hidden bg-white"
>
<BasicTree
<BasicTree
title=
"部门列表"
title=
"部门列表"
ref=
"
basicT
reeRef"
ref=
"
t
reeRef"
toolbar
toolbar
search
search
treeWrapperClassName=
"h-[calc(100%-35px)] overflow-auto"
treeWrapperClassName=
"h-[calc(100%-35px)] overflow-auto"
...
@@ -15,19 +15,31 @@
...
@@ -15,19 +15,31 @@
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
nextTick
,
onMounted
,
ref
,
unref
}
from
'vue'
;
import
{
BasicTree
,
TreeItem
}
from
'@/components/Tree'
;
import
{
BasicTree
,
Tree
ActionType
,
Tree
Item
}
from
'@/components/Tree'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
getDeptList
}
from
'@/api/system/dept/dept'
;
import
{
Nullable
}
from
"@vben/types"
;
defineOptions
({
name
:
'DeptTree'
});
defineOptions
({
name
:
'DeptTree'
});
const
emit
=
defineEmits
([
'select'
]);
const
emit
=
defineEmits
([
'select'
]);
const
treeData
=
ref
<
TreeItem
[]
>
([]);
const
treeData
=
ref
<
TreeItem
[]
>
([]);
const
treeRef
=
ref
<
Nullable
<
TreeActionType
>>
(
null
);
function
getTree
()
{
const
tree
=
unref
(
treeRef
);
if
(
!
tree
)
{
throw
new
Error
(
'tree is null!'
);
}
return
tree
;
}
async
function
fetch
()
{
async
function
fetch
()
{
const
res
=
await
getDeptList
()
const
res
=
await
getDeptList
()
treeData
.
value
=
handleTree
(
res
.
data
,
'businessId'
,
undefined
,
undefined
,
undefined
)
treeData
.
value
=
handleTree
(
res
.
data
,
'businessId'
,
undefined
,
undefined
,
undefined
)
await
nextTick
(()
=>
{
getTree
().
expandAll
(
true
)
})
}
}
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
...
...
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