|
@ -3,11 +3,14 @@ |
|
|
<div class="bg-top"> |
|
|
<div class="bg-top"> |
|
|
<div class="content-1180"> |
|
|
<div class="content-1180"> |
|
|
<div class="d-flex pt-4"> |
|
|
<div class="d-flex pt-4"> |
|
|
<LeftNav :code="code" :list="list" class="mr-4" @chanegCode="chanegCode" @resetData="resetData" /> |
|
|
<LeftNav :code="code" :list="list" class="mr-4" @changeCode="changeCode" @resetData="resetData" /> |
|
|
<div class="flex-1 flex-column"> |
|
|
<div class="flex-1 flex-column"> |
|
|
<Location :title="defaultTitle" /> |
|
|
<Location :title="defaultTitle" /> |
|
|
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }"> |
|
|
<div class="content-detail p-4" :style="{ 'min-height': list.children.length * 56 + 'px' }"> |
|
|
<RichText :rich-obj="content" /> |
|
|
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4"> |
|
|
|
|
|
<Relevant :data="introContent" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -18,11 +21,12 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { mapActions } from 'vuex'; |
|
|
import { mapActions } from 'vuex'; |
|
|
import LeftNav from '@/components/LeftNav/LeftNav.vue'; |
|
|
import LeftNav from '@/components/LeftNav/LeftNav.vue'; |
|
|
import RichText from '@/components/RichText/RichText.vue'; |
|
|
|
|
|
import Location from '@/components/Location/Location.vue'; |
|
|
import Location from '@/components/Location/Location.vue'; |
|
|
|
|
|
import ListPage from '@/components/ListPage/ListPage.vue'; |
|
|
|
|
|
import Relevant from '@/components/RichText/Relevant.vue'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { LeftNav, RichText, Location }, |
|
|
components: { LeftNav, ListPage, Relevant, Location }, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
code: '0801', |
|
|
code: '0801', |
|
@ -65,7 +69,11 @@ export default { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
|
|
|
year: '2022', |
|
|
content: {}, |
|
|
content: {}, |
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
introId: '', |
|
|
|
|
|
introContent: {}, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
@ -73,17 +81,22 @@ export default { |
|
|
if (this.$route.path === this.list.url) { |
|
|
if (this.$route.path === this.list.url) { |
|
|
this.code = val; |
|
|
this.code = val; |
|
|
this.getDetault(val); |
|
|
this.getDetault(val); |
|
|
this.getData(this.code); |
|
|
this.getContentData(this.code); |
|
|
|
|
|
this.introContent = {}; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.code = this.$route.query.code; |
|
|
this.code = this.$route.query.code; |
|
|
this.getDetault(this.code); |
|
|
this.getDetault(this.code); |
|
|
this.getData(this.code); |
|
|
if (this.$route.query.introId) { |
|
|
|
|
|
this.introId = this.$route.query.introId; |
|
|
|
|
|
this.getIntroContent(); |
|
|
|
|
|
} |
|
|
|
|
|
this.getContentData(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
...mapActions('home', ['getDetail']), |
|
|
...mapActions('home', ['getContent', 'getDetail']), |
|
|
// 获取默认显示标题 |
|
|
// 获取默认显示标题 |
|
|
getDetault(val) { |
|
|
getDetault(val) { |
|
|
for (let i = 0; i < this.list.children.length; i++) { |
|
|
for (let i = 0; i < this.list.children.length; i++) { |
|
@ -92,22 +105,49 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async getData(showPage) { |
|
|
|
|
|
|
|
|
resetData() { |
|
|
|
|
|
this.pageNum = 1; |
|
|
|
|
|
this.getContentData(); |
|
|
|
|
|
}, |
|
|
|
|
|
changeCode(code) { |
|
|
|
|
|
this.code = code; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
changeYear(year) { |
|
|
|
|
|
this.year = year; |
|
|
|
|
|
this.getContentData(); |
|
|
|
|
|
}, |
|
|
|
|
|
getData(pageNum) { |
|
|
|
|
|
this.pageNum = pageNum; |
|
|
|
|
|
this.getContentData(); |
|
|
|
|
|
}, |
|
|
|
|
|
async getContentData() { |
|
|
try { |
|
|
try { |
|
|
const param = { |
|
|
const param = { |
|
|
showPage, |
|
|
showPage: this.code, |
|
|
introId: '', |
|
|
year: this.year, |
|
|
|
|
|
showType: '0', |
|
|
|
|
|
pageNum: this.pageNum, |
|
|
|
|
|
pageSize: 10, |
|
|
}; |
|
|
}; |
|
|
const data = await this.getDetail(param); |
|
|
const data = await this.getContent(param); |
|
|
this.content = data || {}; |
|
|
this.content = data; |
|
|
} catch (error) {} |
|
|
} catch (error) {} |
|
|
}, |
|
|
}, |
|
|
resetData() { |
|
|
|
|
|
this.pageNum = 1; |
|
|
// 获取文章信息 |
|
|
this.getData(this.code); |
|
|
async getIntroContent() { |
|
|
}, |
|
|
try { |
|
|
chanegCode(code) { |
|
|
const param = { |
|
|
this.code = code; |
|
|
showPage: '', |
|
|
|
|
|
introId: this.introId, |
|
|
|
|
|
}; |
|
|
|
|
|
const data = await this.getDetail(param); |
|
|
|
|
|
this.introContent = data || {}; |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('error: ', error); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|