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
0276c2d9
Commit
0276c2d9
authored
Oct 29, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记住筛选项功能
parent
ff3406c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1 deletion
+67
-1
filterData.ts
src/store/modules/filterData.ts
+28
-0
index.vue
src/views/system/user/index.vue
+39
-1
No files found.
src/store/modules/filterData.ts
0 → 100644
View file @
0276c2d9
import
{
defineStore
}
from
'pinia'
;
import
{
UserInfo
}
from
"#/store"
;
import
{
getAuthCache
}
from
"@/utils/auth"
;
import
{
USER_INFO_KEY
}
from
"@/enums/cacheEnum"
;
export
const
useFilterStore
=
defineStore
(
'filter'
,
{
state
:
()
=>
({
searchParams
:
{
},
}),
getters
:
{
getSearchParams
(
state
):
any
{
return
state
.
searchParams
;
},
},
actions
:
{
setSearchParams
(
config
:
any
)
{
if
(
!
config
||
typeof
config
!==
'object'
)
{
return
}
if
(
!
config
.
path
)
{
return
}
if
(
config
.
param
&&
typeof
config
.
param
===
'object'
&&
Object
.
keys
(
config
.
param
).
length
>
0
)
{
this
.
searchParams
[
config
.
path
]
=
JSON
.
stringify
(
config
.
param
)
console
.
log
(
'this.searchParams'
,
this
.
searchParams
)
}
},
},
});
src/views/system/user/index.vue
View file @
0276c2d9
...
...
@@ -42,7 +42,7 @@
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
unref
}
from
'vue'
;
import
{
reactive
,
unref
,
onDeactivated
,
onMounted
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getAccountList
,
deleteUser
,
exportUserList
}
from
'@/api/system/user/user'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
...
...
@@ -55,8 +55,13 @@
import
{
columns
,
searchFormSchema
}
from
'./account.data'
;
import
{
useGo
}
from
'@/hooks/web/usePage'
;
import
{
downloadByData
}
from
'@/utils/file/download'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
useUserStore
}
from
"@/store/modules/user"
;
defineOptions
({
name
:
'AccountManagement'
});
const
{
createMessage
}
=
useMessage
();
const
filterStore
=
useFilterStore
();
const
route
=
useRoute
();
const
go
=
useGo
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerResetPassword
,
{
openModal
:
openResetPasswordModal
}]
=
useModal
();
...
...
@@ -71,6 +76,9 @@
labelWidth
:
120
,
schemas
:
searchFormSchema
,
autoSubmitOnEnter
:
true
,
resetFunc
:
()
=>
{
searchInfo
.
deptId
=
''
},
},
useSearchForm
:
true
,
showTableSetting
:
false
,
...
...
@@ -148,4 +156,34 @@
function
handleView
(
record
:
Recordable
)
{
go
(
'/system/account_detail/'
+
record
.
id
);
}
onMounted
(()
=>
{
const
path
=
route
.
path
if
(
filterStore
.
getSearchParams
[
path
])
{
if
(
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
]
!==
{})){
const
params
=
JSON
.
parse
(
filterStore
.
getSearchParams
[
path
])
console
.
log
(
'11111111111111111111111111111'
,
params
)
getForm
().
setFieldsValue
({
page
:
params
.
page
,
pageSize
:
params
.
pageSize
,
username
:
params
.
username
,
flag
:
params
.
flag
,
})
searchInfo
.
deptId
=
params
.
deptId
}
}
});
onBeforeRouteLeave
((
to
,
from
,
next
)
=>
{
const
params
=
Object
.
assign
({},
getSearchInfo
(),
getForm
().
getFieldsValue
());
console
.
log
(
'path'
,
from
.
path
)
console
.
log
(
'params'
,
params
)
filterStore
.
setSearchParams
(
{
path
:
from
.
path
,
param
:
{
...
params
}
}
)
next
();
// 允许导航
});
</
script
>
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