‘首次‘
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// 搜索条件
|
||||
export default {
|
||||
state: {
|
||||
searchObj:{}
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
mutations: {
|
||||
// 设置搜索信息
|
||||
'SETSEARCH':function(state, payload){
|
||||
state.searchObj = payload
|
||||
},
|
||||
// 清除搜索信息
|
||||
'CLEARSEARCH':function(state){
|
||||
state.searchObj = {}
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setSearch({ commit },payload){
|
||||
// 过滤存储条件,只存,城市,线路,车辆,车厢,车门,时间
|
||||
let obj = JSON.parse(JSON.stringify(payload))
|
||||
let searchKey = ['areaid','lineid','metroid','carriageid','doorno','doorid','starttime','endtime']
|
||||
for(let key in obj){
|
||||
if(searchKey.indexOf(key) == -1){
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
commit('SETSEARCH',obj)
|
||||
},
|
||||
clearSearch({ commit }){
|
||||
commit('CLEARSEARCH')
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user