|
|
@ -7,6 +7,9 @@ |
|
|
|
<div class="flex-1 flex-column"> |
|
|
|
<Location :title="defaultTitle" /> |
|
|
|
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }"> |
|
|
|
<template v-if="code.length === 6 && (code.split('')[5] === '4' || code.split('')[5] === '6')"> |
|
|
|
<ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getNumData" /> |
|
|
|
</template> |
|
|
|
<RichText :rich-obj="content" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -20,9 +23,10 @@ import { mapActions } from 'vuex'; |
|
|
|
import LeftNav from '@/components/LeftNav/LeftNav.vue'; |
|
|
|
import RichText from '@/components/RichText/RichText.vue'; |
|
|
|
import Location from '@/components/Location/Location.vue'; |
|
|
|
import ListPage from '@/components/ListPage/ListPage.vue'; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { LeftNav, RichText, Location }, |
|
|
|
components: { LeftNav, RichText, Location, ListPage }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
code: '0901', |
|
|
@ -641,6 +645,8 @@ export default { |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
year: '2022', |
|
|
|
pageNum: 1, |
|
|
|
content: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
@ -649,17 +655,25 @@ export default { |
|
|
|
if (this.$route.path === this.list.url) { |
|
|
|
this.code = val; |
|
|
|
this.getDetault(val); |
|
|
|
this.getData(this.code); |
|
|
|
if (this.code.length === 6 && (this.code.split('')[5] === '4' || this.code.split('')[5] === '6')) { |
|
|
|
this.getContentData(this.code); |
|
|
|
} else { |
|
|
|
this.getData(this.code); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.code = this.$route.query.code; |
|
|
|
this.getDetault(this.code); |
|
|
|
this.getData(this.code); |
|
|
|
if (this.code.length === 6 && (this.code.split('')[5] === '4' || this.code.split('')[5] === '6')) { |
|
|
|
this.getContentData(this.code); |
|
|
|
} else { |
|
|
|
this.getData(this.code); |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
...mapActions('home', ['getDetail']), |
|
|
|
...mapActions('home', ['getDetail', 'getContent']), |
|
|
|
// 获取默认显示标题 |
|
|
|
getDetault(val) { |
|
|
|
for (let i = 0; i < this.list.children.length; i++) { |
|
|
@ -678,9 +692,31 @@ export default { |
|
|
|
this.content = data || {}; |
|
|
|
} catch (error) {} |
|
|
|
}, |
|
|
|
async getContentData() { |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
showPage: this.code, |
|
|
|
year: this.year, |
|
|
|
showType: 0, |
|
|
|
pageNum: this.pageNum, |
|
|
|
pageSize: 10, |
|
|
|
}; |
|
|
|
const data = await this.getContent(params); |
|
|
|
console.log('data: ', data); |
|
|
|
} catch (error) {} |
|
|
|
}, |
|
|
|
getNumData(pageNum) { |
|
|
|
console.log('pageNum: ', pageNum); |
|
|
|
this.pageNum = pageNum; |
|
|
|
this.getContentData(); |
|
|
|
}, |
|
|
|
chanegCode(code) { |
|
|
|
this.code = code; |
|
|
|
}, |
|
|
|
changeYear(year, code) { |
|
|
|
this.year = year; |
|
|
|
this.getContentData(code); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|