Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NLT-e-cigarette
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
张伯涛
NLT-e-cigarette
Commits
c6b4109f
Commit
c6b4109f
authored
May 09, 2022
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面离开前记住筛选项
parent
cd61d0eb
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
192 additions
and
22 deletions
+192
-22
getters.js
src/store/getters.js
+2
-1
index.js
src/store/index.js
+2
-0
searchSave.js
src/store/modules/searchSave.js
+44
-0
index.vue
src/views/monitor/errorLog/index.vue
+15
-0
index.vue
src/views/monitor/loginInfo/index.vue
+15
-0
index.vue
src/views/monitor/operLog/index.vue
+15
-0
index.vue
src/views/system/dept/index.vue
+15
-0
index.vue
src/views/system/dict/index.vue
+15
-0
index.vue
src/views/system/menu/index.vue
+18
-1
index.vue
src/views/system/role/index.vue
+15
-0
index.vue
src/views/system/user/index.vue
+36
-20
No files found.
src/store/getters.js
View file @
c6b4109f
...
@@ -8,6 +8,7 @@ const getters = {
...
@@ -8,6 +8,7 @@ const getters = {
roles
:
state
=>
state
.
user
.
roles
,
roles
:
state
=>
state
.
user
.
roles
,
introduction
:
state
=>
state
.
user
.
introduction
,
introduction
:
state
=>
state
.
user
.
introduction
,
permissions
:
state
=>
state
.
user
.
permissions
,
permissions
:
state
=>
state
.
user
.
permissions
,
permission_routes
:
state
=>
state
.
permission
.
routes
permission_routes
:
state
=>
state
.
permission
.
routes
,
searchParams
:
state
=>
state
.
searchSave
.
searchParams
}
}
export
default
getters
export
default
getters
src/store/index.js
View file @
c6b4109f
...
@@ -3,6 +3,7 @@ import Vuex from 'vuex'
...
@@ -3,6 +3,7 @@ import Vuex from 'vuex'
import
app
from
'./modules/app'
import
app
from
'./modules/app'
import
user
from
'./modules/user'
import
user
from
'./modules/user'
import
tagsView
from
'./modules/tagsView'
import
tagsView
from
'./modules/tagsView'
import
searchSave
from
'./modules/searchSave'
import
permission
from
'./modules/permission'
import
permission
from
'./modules/permission'
import
settings
from
'./modules/settings'
import
settings
from
'./modules/settings'
import
getters
from
'./getters'
import
getters
from
'./getters'
...
@@ -15,6 +16,7 @@ const store = new Vuex.Store({
...
@@ -15,6 +16,7 @@ const store = new Vuex.Store({
user
,
user
,
tagsView
,
tagsView
,
permission
,
permission
,
searchSave
,
settings
settings
},
},
getters
getters
...
...
src/store/modules/searchSave.js
0 → 100644
View file @
c6b4109f
const
state
=
{
searchParams
:
{
// [route.path]: { ...searchContent }
}
}
const
mutations
=
{
SET_SEARCH_PARAMS
:
(
state
,
config
)
=>
{
if
(
!
config
||
typeof
config
!==
'object'
)
{
return
}
if
(
!
config
.
path
)
{
return
}
if
(
config
.
param
&&
typeof
config
.
param
===
'object'
&&
Object
.
keys
(
config
.
param
).
length
>
0
)
{
state
.
searchParams
[
config
.
path
]
=
JSON
.
stringify
(
config
.
param
)
}
else
{
delete
state
.
searchParams
[
config
.
path
]
}
},
RSET_SEARCH_PARAMS
:
(
state
)
=>
{
state
.
searchParams
=
{}
},
CLEAR_ONE_PARAMS
:
(
state
,
path
)
=>
{
path
&&
state
.
searchParams
[
path
]
&&
delete
state
.
searchParams
[
path
]
}
}
const
actions
=
{
searchParamsSet
({
commit
},
config
)
{
if
(
!
config
||
typeof
config
!==
'object'
)
{
return
}
if
(
!
config
.
path
)
{
return
}
commit
(
'SET_SEARCH_PARAMS'
,
config
)
},
restSearchParams
({
commit
})
{
commit
(
'RSET_SEARCH_PARAMS'
)
},
clearOneParams
({
commit
},
path
)
{
commit
(
'CLEAR_ONE_PARAMS'
,
path
)
}
}
export
default
{
namespaced
:
true
,
state
,
mutations
,
actions
}
src/views/monitor/errorLog/index.vue
View file @
c6b4109f
...
@@ -244,7 +244,22 @@ export default {
...
@@ -244,7 +244,22 @@ export default {
}
}
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
// this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM')
// this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM')
this
.
getList
()
this
.
getList
()
this
.
getDicts
(
'sys_oper_type'
.
toUpperCase
()).
then
(
response
=>
{
this
.
getDicts
(
'sys_oper_type'
.
toUpperCase
()).
then
(
response
=>
{
...
...
src/views/monitor/loginInfo/index.vue
View file @
c6b4109f
...
@@ -175,7 +175,22 @@ export default {
...
@@ -175,7 +175,22 @@ export default {
}
}
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
// this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss')
// this.queryParams.loginTime = this.$parseDate(new Date(), 'YYYY-MM-DD HH:mm:ss')
this
.
getList
()
this
.
getList
()
this
.
getDicts
(
dictCons
[
'COMMON_STATUS'
]).
then
(
response
=>
{
this
.
getDicts
(
dictCons
[
'COMMON_STATUS'
]).
then
(
response
=>
{
...
...
src/views/monitor/operLog/index.vue
View file @
c6b4109f
...
@@ -245,7 +245,22 @@ export default {
...
@@ -245,7 +245,22 @@ export default {
}
}
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
// this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM')
// this.queryParams.operTime = this.$parseDate(new Date(), 'YYYY-MM')
this
.
getList
()
this
.
getList
()
this
.
getDicts
(
'sys_oper_type'
.
toUpperCase
()).
then
(
response
=>
{
this
.
getDicts
(
'sys_oper_type'
.
toUpperCase
()).
then
(
response
=>
{
...
...
src/views/system/dept/index.vue
View file @
c6b4109f
...
@@ -251,7 +251,22 @@ export default {
...
@@ -251,7 +251,22 @@ export default {
}
}
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
this
.
getList
()
this
.
getDicts
(
'sys_normal_disable'
.
toUpperCase
()).
then
(
response
=>
{
this
.
getDicts
(
'sys_normal_disable'
.
toUpperCase
()).
then
(
response
=>
{
this
.
statusOptions
=
response
.
data
this
.
statusOptions
=
response
.
data
...
...
src/views/system/dict/index.vue
View file @
c6b4109f
...
@@ -353,7 +353,22 @@ export default {
...
@@ -353,7 +353,22 @@ export default {
manageLoading
:
false
manageLoading
:
false
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
this
.
getList
()
this
.
getDicts
(
dictCons
[
'NORMAL_DISABLE'
]).
then
(
response
=>
{
this
.
getDicts
(
dictCons
[
'NORMAL_DISABLE'
]).
then
(
response
=>
{
this
.
statusOptions
=
response
.
data
this
.
statusOptions
=
response
.
data
...
...
src/views/system/menu/index.vue
View file @
c6b4109f
...
@@ -346,8 +346,25 @@ export default {
...
@@ -346,8 +346,25 @@ export default {
// this.workFlows = response.data
// this.workFlows = response.data
// })
// })
// },
// },
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
this
.
getList
()
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
this
.
handleQuery
()
}
else
{
this
.
getList
()
}
this
.
getDicts
(
dictCons
[
'SHOW_HIDE'
]).
then
(
response
=>
{
this
.
getDicts
(
dictCons
[
'SHOW_HIDE'
]).
then
(
response
=>
{
this
.
visibleOptions
=
response
.
data
this
.
visibleOptions
=
response
.
data
})
})
...
...
src/views/system/role/index.vue
View file @
c6b4109f
...
@@ -361,7 +361,22 @@ export default {
...
@@ -361,7 +361,22 @@ export default {
deptOptions
:
[]
deptOptions
:
[]
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
this
.
getList
()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// this.statusOptions = response.data;
...
...
src/views/system/user/index.vue
View file @
c6b4109f
<
template
>
<
template
>
<div
class=
"user-manage"
>
<div
class=
"user-manage"
>
<div
class=
"search"
style=
"border-bottom: 14px solid #f4f4f4"
>
<div
class=
"search"
style=
"border-bottom: 14px solid #f4f4f4"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
class=
"formClass"
:model=
"queryParams"
v-show=
"showSearch
"
:inline=
"true"
label-width=
"auto"
>
<el-form
v-show=
"showSearch"
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
class=
"formClass"
:model=
"queryParams
"
:inline=
"true"
label-width=
"auto"
>
<!--
<el-form-item
label=
"用户类型"
prop=
"name"
class=
"noMargin"
>
-->
<!--
<el-form-item
label=
"用户类型"
prop=
"name"
class=
"noMargin"
>
-->
<!--
<el-input-->
<!--
<el-input-->
<!-- v-model="queryParams.name"-->
<!-- v-model="queryParams.name"-->
<!-- placeholder="请输入用户类型"-->
<!-- placeholder="请输入用户类型"-->
<!-- clearable-->
<!-- clearable-->
<!-- :maxlength="30"-->
<!-- :maxlength="30"-->
<!-- size="small"-->
<!-- size="small"-->
<!-- style="width: 150px"-->
<!-- style="width: 150px"-->
<!-- />-->
<!-- />-->
<!--
</el-form-item>
-->
<!--
</el-form-item>
-->
<el-form-item
label=
"登录名"
prop=
"username"
>
<el-form-item
label=
"登录名"
prop=
"username"
>
<el-input
<el-input
v-model=
"queryParams.username"
v-model=
"queryParams.username"
...
@@ -44,8 +44,8 @@
...
@@ -44,8 +44,8 @@
</el-form-item>
</el-form-item>
<el-form-item
style=
"float: right"
>
<el-form-item
style=
"float: right"
>
<el-button
<el-button
style=
"padding: 8px 7px;"
v-hasPermi=
"['sys:user:add']"
v-hasPermi=
"['sys:user:add']"
style=
"padding: 8px 7px;"
type=
"primary"
type=
"primary"
size=
"small"
size=
"small"
icon=
"el-icon-plus"
icon=
"el-icon-plus"
...
@@ -59,8 +59,8 @@
...
@@ -59,8 +59,8 @@
@
click=
"handleImport"
@
click=
"handleImport"
>
导入
</el-button>
>
导入
</el-button>
<el-button
<el-button
style=
"padding: 8px 7px;"
v-hasPermi=
"['sys:user:export']"
v-hasPermi=
"['sys:user:export']"
style=
"padding: 8px 7px;"
type=
"success"
type=
"success"
size=
"small"
size=
"small"
icon=
"el-icon-download"
icon=
"el-icon-download"
...
@@ -211,16 +211,17 @@
...
@@ -211,16 +211,17 @@
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"手机号码"
prop=
"phone"
>
<el-form-item
label=
"手机号码"
prop=
"phone"
>
<el-input
<el-input
value=
"phone"
v-model
.
trim=
"form.phone"
v-model
.
trim=
"form.phone"
value=
"phone"
placeholder=
"请输入手机号码"
placeholder=
"请输入手机号码"
maxlength=
"11"
/>
maxlength=
"11"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"邮箱"
prop=
"email"
>
<el-form-item
label=
"邮箱"
prop=
"email"
>
<el-input
v-model
.
trim=
"form.email"
placeholder=
"请输入邮箱"
maxlength=
"25"
/>
<el-input
v-model
.
trim=
"form.email"
placeholder=
"请输入邮箱"
maxlength=
"25"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -239,13 +240,13 @@
...
@@ -239,13 +240,13 @@
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"用户类型"
prop=
"name"
>
<el-form-item
label=
"用户类型"
prop=
"name"
>
<el-input
v-model
.
trim=
"form.name"
placeholder=
"请输入用户类型"
/>
<el-input
v-model
.
trim=
"form.name"
placeholder=
"请输入用户类型"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"身份证号"
prop=
"idNumber"
>
<el-form-item
label=
"身份证号"
prop=
"idNumber"
>
<el-input
v-model
.
trim=
"form.idNumber"
placeholder=
"请输入身份证号"
maxlength=
"18"
/>
<el-input
v-model
.
trim=
"form.idNumber"
placeholder=
"请输入身份证号"
maxlength=
"18"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -582,6 +583,16 @@ export default {
...
@@ -582,6 +583,16 @@ export default {
addLoading
:
false
addLoading
:
false
}
}
},
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
watch
:
{
watch
:
{
// 根据名称筛选部门树
// 根据名称筛选部门树
deptName
(
val
)
{
deptName
(
val
)
{
...
@@ -589,6 +600,11 @@ export default {
...
@@ -589,6 +600,11 @@ export default {
}
}
},
},
created
()
{
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
this
.
getList
()
this
.
getTreeSelect
()
this
.
getTreeSelect
()
this
.
getConfigKey
(
'sys.user.initPassword'
).
then
(
response
=>
{
this
.
getConfigKey
(
'sys.user.initPassword'
).
then
(
response
=>
{
...
...
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