Commit 3c849371 authored by 高宇's avatar 高宇

Revert "3.切换页面前,保留查询条件"

This reverts commit 76ffe650.
parent 5d9d1554
...@@ -96,10 +96,10 @@ ...@@ -96,10 +96,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="解锁人" prop="pnumber"> <el-table-column label="解锁人" prop="pnumber">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.unlockUsername|| '-' }} {{ scope.row.unlockUsername|| '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="解锁时间" prop="pnumber"> <el-table-column label="解锁时间" prop="pnumber">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseTime(scope.row.unlockDate, '{y}-{m}-{d} {h}:{i}') || '-' }} {{ parseTime(scope.row.unlockDate, '{y}-{m}-{d} {h}:{i}') || '-' }}
...@@ -365,7 +365,7 @@ ...@@ -365,7 +365,7 @@
</div> </div>
<el-form ref="form" :model="loginform" label-width="80px"> <el-form ref="form" :model="loginform" label-width="80px">
<el-form-item label="用户名"> <el-form-item label="用户名">
<el-input v-model="loginform.password" placeholder="请输入用户名" /> <el-input v-model="loginform.password" placeholder="请输入用户名" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
...@@ -493,19 +493,15 @@ export default { ...@@ -493,19 +493,15 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('equipmentParams', JSON.stringify(this.queryParams)) this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
// this.$store.dispatch('searchSave/searchParamsSet', {
// path: this.$route.path,
// param: {
// ...this.queryParams
// }
// })
}, },
created() { created() {
if (sessionStorage.getItem('equipmentParams')) {
this.queryParams = JSON.parse(sessionStorage.getItem('equipmentParams'))
}
this.getDict() this.getDict()
this.getList() this.getList()
this.getCodeDict() this.getCodeDict()
......
...@@ -212,23 +212,20 @@ export default { ...@@ -212,23 +212,20 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('twoRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('twoDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('twoRecord')) { if (this.$store.getters.searchParams[this.$route.path]) {
this.queryEntity = JSON.parse(sessionStorage.getItem('twoRecord')) const { searchParams } = this.$store.getters
} const { path } = this.$route
if (sessionStorage.getItem('twoDateRange')) { const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.dateRange = JSON.parse(sessionStorage.getItem('twoDateRange')) this.queryParams = { ...param }
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0] + ' 00:00:00'
this.queryParams.endTime = this.dateRange[1] + ' 23:59:00'
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
} }
this.getList() this.getList()
}, },
...@@ -262,7 +259,6 @@ export default { ...@@ -262,7 +259,6 @@ export default {
if (this.queryParams.beginTime === '' || this.queryParams.endTime === '') { if (this.queryParams.beginTime === '' || this.queryParams.endTime === '') {
this.dateRange = [] this.dateRange = []
} }
console.log('dateRange',this.dateRange)
listdevice(this.queryParams, this.addDateRange(this.queryEntity, this.dateRange)).then(response => { listdevice(this.queryParams, this.addDateRange(this.queryEntity, this.dateRange)).then(response => {
// console.log('list', response) // console.log('list', response)
this.equipmentList = response.rows this.equipmentList = response.rows
......
...@@ -442,16 +442,19 @@ export default { ...@@ -442,16 +442,19 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('oneRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('oneDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('oneRecord')) { if (this.$store.getters.searchParams[this.$route.path]) {
this.queryEntity = JSON.parse(sessionStorage.getItem('oneRecord')) const { searchParams } = this.$store.getters; const { path } = this.$route
} const param = JSON.parse(searchParams[path]) // 保留着的查询条件
if (sessionStorage.getItem('oneDateRange')) { this.queryParams = { ...param }
this.dateRange = JSON.parse(sessionStorage.getItem('oneDateRange'))
} }
this.getList() this.getList()
this.getDict() this.getDict()
......
...@@ -421,24 +421,15 @@ export default { ...@@ -421,24 +421,15 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('threeRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('threeDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('threeRecord')) {
this.queryEntity = JSON.parse(sessionStorage.getItem('threeRecord'))
}
if (sessionStorage.getItem('threeDateRange')) {
this.dateRange = JSON.parse(sessionStorage.getItem('threeDateRange'))
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0] + ' 00:00:00'
this.queryParams.endTime = this.dateRange[1] + ' 23:59:00'
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
}
this.getUserName() this.getUserName()
this.getYsList() this.getYsList()
this.getDict() this.getDict()
......
...@@ -545,13 +545,15 @@ export default { ...@@ -545,13 +545,15 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('fourParams', JSON.stringify(this.queryParams)) this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('fourParams')) {
this.queryParams = JSON.parse(sessionStorage.getItem('fourParams'))
}
this.getDict() this.getDict()
this.getList() this.getList()
}, },
......
...@@ -572,13 +572,15 @@ export default { ...@@ -572,13 +572,15 @@ export default {
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sixParams', JSON.stringify(this.queryParams)) this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('sixParams')) {
this.queryParams = JSON.parse(sessionStorage.getItem('sixParams'))
}
this.getDict() this.getDict()
this.getList() this.getList()
}, },
......
...@@ -442,16 +442,20 @@ export default { ...@@ -442,16 +442,20 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('fiveRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('fiveDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('fiveRecord')) { if (this.$store.getters.searchParams[this.$route.path]) {
this.queryEntity = JSON.parse(sessionStorage.getItem('fiveRecord')) const {searchParams} = this.$store.getters;
} const {path} = this.$route
if (sessionStorage.getItem('fiveDateRange')) { const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.dateRange = JSON.parse(sessionStorage.getItem('fiveDateRange')) this.queryParams = {...param}
} }
this.getList() this.getList()
this.getDict() this.getDict()
......
...@@ -200,23 +200,19 @@ export default { ...@@ -200,23 +200,19 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sevenRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('sevenDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('sevenRecord')) { if (this.$store.getters.searchParams[this.$route.path]) {
this.queryEntity = JSON.parse(sessionStorage.getItem('sevenRecord')) const { searchParams } = this.$store.getters; const { path } = this.$route
} const param = JSON.parse(searchParams[path]) // 保留着的查询条件
if (sessionStorage.getItem('sevenDateRange')) { this.queryParams = { ...param }
this.dateRange = JSON.parse(sessionStorage.getItem('sevenDateRange'))
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0] + ' 00:00:00'
this.queryParams.endTime = this.dateRange[1] + ' 23:59:00'
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
} }
this.getList() this.getList()
}, },
......
...@@ -188,15 +188,7 @@ export default { ...@@ -188,15 +188,7 @@ export default {
basicinfoMationList: [] basicinfoMationList: []
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sampleOneParams', JSON.stringify(this.queryParams))
next()
},
created() { created() {
if (sessionStorage.getItem('sampleOneParams')) {
this.queryParams = JSON.parse(sessionStorage.getItem('sampleOneParams'))
}
this.getList() this.getList()
}, },
methods: { methods: {
......
...@@ -170,15 +170,7 @@ export default { ...@@ -170,15 +170,7 @@ export default {
basicinfoMationList: [] basicinfoMationList: []
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sampleThreeParams', JSON.stringify(this.queryParams))
next()
},
created() { created() {
if (sessionStorage.getItem('sampleThreeParams')) {
this.queryParams = JSON.parse(sessionStorage.getItem('sampleThreeParams'))
}
this.getList() this.getList()
}, },
methods: { methods: {
......
...@@ -311,24 +311,15 @@ export default { ...@@ -311,24 +311,15 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sampleFiveRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('sampleFiveDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('sampleFiveRecord')) {
this.queryEntity = JSON.parse(sessionStorage.getItem('sampleFiveRecord'))
}
if (sessionStorage.getItem('sampleFiveDateRange')) {
this.dateRange = JSON.parse(sessionStorage.getItem('sampleFiveDateRange'))
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0] + ' 00:00:00'
this.queryParams.endTime = this.dateRange[1] + ' 23:59:00'
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
}
this.getList() this.getList()
}, },
// 监听回车 // 监听回车
......
...@@ -344,24 +344,15 @@ export default { ...@@ -344,24 +344,15 @@ export default {
}, },
/** 路由离开前存储筛选条件*/ /** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sampleFourRecord', JSON.stringify(this.queryEntity)) this.$store.dispatch('searchSave/searchParamsSet', {
sessionStorage.setItem('sampleFourDateRange', JSON.stringify(this.dateRange)) path: this.$route.path,
param: {
...this.queryParams
}
})
next() next()
}, },
created() { created() {
if (sessionStorage.getItem('sampleFourRecord')) {
this.queryEntity = JSON.parse(sessionStorage.getItem('sampleFourRecord'))
}
if (sessionStorage.getItem('sampleFourDateRange')) {
this.dateRange = JSON.parse(sessionStorage.getItem('sampleFourDateRange'))
if (this.dateRange !== null) {
this.queryParams.beginTime = this.dateRange[0] + ' 00:00:00'
this.queryParams.endTime = this.dateRange[1] + ' 23:59:00'
} else {
this.queryParams.beginTime = ''
this.queryParams.endTime = ''
}
}
this.getList() this.getList()
}, },
// 监听回车 // 监听回车
......
...@@ -199,15 +199,7 @@ export default { ...@@ -199,15 +199,7 @@ export default {
basicinfoMationList: [] basicinfoMationList: []
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
sessionStorage.setItem('sampleTwoParams', JSON.stringify(this.queryParams))
next()
},
created() { created() {
if (sessionStorage.getItem('sampleTwoParams')) {
this.queryParams = JSON.parse(sessionStorage.getItem('sampleTwoParams'))
}
this.getList() this.getList()
}, },
methods: { methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment