|
@ -56,28 +56,32 @@ export default { |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
content: {}, |
|
|
content: {}, |
|
|
showLoading: true |
|
|
showLoading: true, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
'$route.query.code'(val) { |
|
|
'$route.query.code'(val) { |
|
|
if (this.$route.path === this.list.url) { |
|
|
if (this.$route.path === this.list.url) { |
|
|
this.code = val; |
|
|
this.code = val; |
|
|
for (let i = 0; i < this.list.children.length; i++) { |
|
|
this.getDefaultTitle(val); |
|
|
if (val === this.list.children[i].code) { |
|
|
|
|
|
this.defaultTitle = this.list.children[i].title; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.getData(this.code); |
|
|
this.getData(this.code); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.code = this.$route.query.code; |
|
|
this.code = this.$route.query.code; |
|
|
|
|
|
this.getDefaultTitle(this.code); |
|
|
this.getData(this.code); |
|
|
this.getData(this.code); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
...mapActions('home', ['getDetail']), |
|
|
...mapActions('home', ['getDetail']), |
|
|
|
|
|
getDefaultTitle(code) { |
|
|
|
|
|
for (let i = 0; i < this.list.children.length; i++) { |
|
|
|
|
|
if (code === this.list.children[i].code) { |
|
|
|
|
|
this.defaultTitle = this.list.children[i].title; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
async getData(showPage) { |
|
|
async getData(showPage) { |
|
|
try { |
|
|
try { |
|
|
this.showLoading = true; |
|
|
this.showLoading = true; |
|
|