Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bms-vue-obear
Project
Project
Details
Activity
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
daywrite
bms-vue-obear
Commits
d0a10db2
Commit
d0a10db2
authored
Apr 16, 2019
by
huai.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记住查询条件
parent
2f999c92
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
63 deletions
+133
-63
searchForm.vue
src/components/common/searchForm.vue
+41
-37
searchHeader.vue
src/components/common/searchHeader.vue
+33
-20
setParams.js
src/components/common/setParams.js
+35
-0
scheduleHome.vue
src/components/schedule_list/scheduleHome.vue
+23
-5
schedulePagenation.vue
src/components/schedule_list/schedulePagenation.vue
+1
-1
No files found.
src/components/common/searchForm.vue
View file @
d0a10db2
...
...
@@ -27,8 +27,10 @@
</
template
>
<
script
>
export
default
{
import
setParams
from
'./setParams'
export
default
{
name
:
'client-form'
,
mixins
:
[
setParams
],
data
()
{
return
{
clientForm
:
{
...
...
@@ -60,8 +62,10 @@
},
watch
:
{
'filter'
(
val
)
{
this
.
setInitParams
((
ret
)
=>
{
val
.
forEach
(
item
=>
{
this
.
$set
(
this
.
clientForm
,
item
.
key
,
''
)
this
.
$set
(
this
.
clientForm
,
item
.
key
,
ret
[
item
.
key
]
||
''
)
})
})
},
'clientForm'
:
{
...
...
@@ -71,7 +75,7 @@
deep
:
true
}
}
}
}
</
script
>
<
style
scoped
>
...
...
src/components/common/searchHeader.vue
View file @
d0a10db2
...
...
@@ -28,8 +28,10 @@
</
template
>
<
script
>
export
default
{
import
setParams
from
'./setParams'
export
default
{
name
:
'client-header'
,
mixins
:
[
setParams
],
data
()
{
return
{
search
:
{}
...
...
@@ -44,14 +46,25 @@
}
},
props
:
[
'title'
,
'searchKey'
,
'addTitle'
],
created
()
{
this
.
setInitParams
((
ret
)
=>
{
this
.
$set
(
this
.
search
,
this
.
searchKey
+
'[keyword]'
,
ret
[
this
.
searchKey
+
'[keyword]'
])
})
},
watch
:
{
'searchKey'
(
val
)
{
this
.
$set
(
this
.
search
,
val
+
'[keyword]'
,
''
)
},
'search'
:
{
handler
(
val
)
{
this
.
$emit
(
'update:headerParams'
,
this
.
search
)
},
deep
:
true
}
}
}
}
</
script
>
<
style
scoped
>
...
...
src/components/common/setParams.js
0 → 100644
View file @
d0a10db2
export
default
{
methods
:
{
setInitParams
(
cb
)
{
let
ret
=
null
let
parentName
=
this
.
$parent
.
$options
&&
this
.
$parent
.
$options
.
name
if
(
window
.
localStorage
&&
parentName
)
{
let
l
=
window
.
localStorage
ret
=
JSON
.
parse
(
l
.
getItem
(
parentName
))
}
if
(
ret
)
{
cb
&&
cb
(
ret
)
}
},
setParams
(
obj
,
param
)
{
let
key
=
this
.
$options
&&
this
.
$options
.
name
let
l
=
this
.
isHasLocalStorage
()
let
value
=
{}
if
(
l
&&
key
)
{
if
(
l
.
getItem
(
key
))
{
value
=
JSON
.
parse
(
l
.
getItem
(
key
))
}
else
{
value
=
obj
}
}
let
ret
=
Object
.
assign
(
value
,
param
)
l
.
setItem
(
key
,
JSON
.
stringify
(
ret
))
return
ret
},
isHasLocalStorage
()
{
return
window
.
localStorage
}
}
}
src/components/schedule_list/scheduleHome.vue
View file @
d0a10db2
...
...
@@ -7,6 +7,7 @@
:search-key=
"'ClientSearch'"
:add-title=
"'新建待办事项'"
@
update:headerSearch=
"search => searchKeyword(search)"
@
update:headerParams=
"param => paramsFormat(param)"
@
update:headerAdd=
"() => addSch()"
>
</search-header>
<search-form
...
...
@@ -53,12 +54,15 @@ import ScheduleModal from '../schedule/scheduleModal'
import
LeaveMessage
from
'../common/leaveMessage'
import
Pagenation
from
'./schedulePagenation'
import
clickOutside
from
'@/lib/bind'
import
SetParams
from
'../common/setParams'
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
export
default
{
name
:
''
,
name
:
'scheduleHome'
,
mixins
:
[
SetParams
],
components
:
{
SearchHeader
,
...
...
@@ -145,20 +149,32 @@ export default {
methods
:
{
init
()
{
this
.
getFilter
()
this
.
getScheduleList
()
},
paramsFormat
(
param
)
{
this
.
setParams
({
...
this
.
form
,
page
:
this
.
pagenation
.
thispage
},
param
)
},
searchKeyword
(
search
)
{
this
.
updateForm
(
search
)
this
.
getScheduleList
(
)
},
updateForm
(
search
)
{
Object
.
assign
(
this
.
form
,
search
)
this
.
setParams
({
...
this
.
form
,
page
:
this
.
pagenation
.
thispage
},
search
)
this
.
getScheduleList
()
},
updatePage
(
pager
)
{
Object
.
assign
(
this
.
pagenation
,
pager
)
this
.
setParams
({
...
this
.
form
,
page
:
this
.
pagenation
.
thispage
},
pager
)
this
.
getScheduleList
()
},
...
...
@@ -206,6 +222,8 @@ export default {
},
getScheduleList
()
{
// 查询条件
requestAPI
(
api
.
getScheduleList
,
{
...
this
.
form
,
page
:
this
.
pagenation
.
thispage
...
...
src/components/schedule_list/schedulePagenation.vue
View file @
d0a10db2
...
...
@@ -33,7 +33,7 @@ export default {
},
created
()
{
this
.
$emit
(
'update:pager'
,
this
.
pager
)
//
this.$emit('update:pager', this.pager)
},
methods
:
{
...
...
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