|
@@ -17,29 +17,34 @@ export default {
|
|
|
components: {},
|
|
|
data () {
|
|
|
return {
|
|
|
- itemId: sessionStorage.getItem('itemId') || '0'
|
|
|
+ itemId: localStorage.getItem('itemId') || '0'
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['getmenu']),
|
|
|
btn (e) {
|
|
|
this.itemId = e.code
|
|
|
- let types
|
|
|
if (e.code === '0') {
|
|
|
- this.$router.push('/')
|
|
|
+ this.$router.push('/www/')
|
|
|
return
|
|
|
}
|
|
|
if (e.type === 1) {
|
|
|
window.open(e.uri)
|
|
|
return
|
|
|
}
|
|
|
- if (e.type === 0) types = 'list'
|
|
|
- if (e.type === 2) types = 'page'
|
|
|
- this.$router.push(
|
|
|
- { path: `/${types}/${e.code}` },
|
|
|
- onComplete => {},
|
|
|
- onAbort => {}
|
|
|
- )
|
|
|
+ if (e.type === 0) {
|
|
|
+ this.$router.push(
|
|
|
+ { path: `/www/list/${e.code}` },
|
|
|
+ onComplete => {},
|
|
|
+ onAbort => {}
|
|
|
+ )
|
|
|
+ }
|
|
|
+ if (e.type === 2) {
|
|
|
+ const routeData = this.$router.resolve({
|
|
|
+ path: `/www/page/${e.code}`
|
|
|
+ })
|
|
|
+ window.open(routeData.href)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -50,10 +55,10 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
itemId (val) {
|
|
|
- sessionStorage.setItem('itemId', val)
|
|
|
+ localStorage.setItem('itemId', val)
|
|
|
},
|
|
|
$route (to, from) {
|
|
|
- this.itemId = sessionStorage.getItem('itemId') || '0'
|
|
|
+ this.itemId = localStorage.getItem('itemId') || '0'
|
|
|
}
|
|
|
}
|
|
|
}
|