|
@@ -44,7 +44,8 @@ export default {
|
|
patentNo: this.$route.params.patentNo,
|
|
patentNo: this.$route.params.patentNo,
|
|
components: 'PatentDetails',
|
|
components: 'PatentDetails',
|
|
menuList: [],
|
|
menuList: [],
|
|
- evidenceData: {}
|
|
|
|
|
|
+ evidenceData: {},
|
|
|
|
+ currentState:0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {},
|
|
watch: {},
|
|
@@ -94,6 +95,19 @@ export default {
|
|
mounted() {
|
|
mounted() {
|
|
if(this.search && !this.search.fromPath){
|
|
if(this.search && !this.search.fromPath){
|
|
this.search.fromPath = window.history.length
|
|
this.search.fromPath = window.history.length
|
|
|
|
+ this.currentState = window.history.state.key
|
|
|
|
+ var that = this
|
|
|
|
+ window.addEventListener('popstate', function(event) {
|
|
|
|
+ // console.log(event,that.currentState,event.state.key)
|
|
|
|
+ // 在这里处理历史记录变化时的逻辑
|
|
|
|
+ if(that.currentState<event.state.key){
|
|
|
|
+ that.search.fromPath += 1
|
|
|
|
+ }else{
|
|
|
|
+ that.search.fromPath -= 1
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ that.currentState = event.state.key
|
|
|
|
+ })
|
|
this.$s.setSession('search',this.search)
|
|
this.$s.setSession('search',this.search)
|
|
}
|
|
}
|
|
if (this.evidence) {
|
|
if (this.evidence) {
|
|
@@ -222,6 +236,7 @@ export default {
|
|
this.getContrast()
|
|
this.getContrast()
|
|
}
|
|
}
|
|
this.getPiZhuData()
|
|
this.getPiZhuData()
|
|
|
|
+ this.currentState = window.history.state.key
|
|
this.$router.push(
|
|
this.$router.push(
|
|
{
|
|
{
|
|
path: '/patentDetails/' + this.patentNo,
|
|
path: '/patentDetails/' + this.patentNo,
|
|
@@ -243,6 +258,13 @@ export default {
|
|
)
|
|
)
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ destroyed(){
|
|
|
|
+ window.removeEventListener('popstate', function(event) {
|
|
|
|
+ // 在这里处理历史记录变化时的逻辑
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|