|
@ -7,7 +7,19 @@ |
|
|
<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' }"> |
|
|
<ListPage v-if="!introId" :code="code" @changeYear="changeYear" :content="content" @getData="getData" /> |
|
|
<template v-if="!introId"> |
|
|
|
|
|
<template v-if="code !== '0204'"> |
|
|
|
|
|
<ListPage :code="code" @changeYear="changeYear" :content="content" @getData="getData" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
<template v-else> |
|
|
|
|
|
<h3>集团新闻</h3> |
|
|
|
|
|
<ListPage :code="code" @changeYear="changeYear" :content="content1" @getData="getData" /> |
|
|
|
|
|
<h3>省公司新闻</h3> |
|
|
|
|
|
<ListPage :code="code" @changeYear="changeYear" :content="content2" @getData="getData" /> |
|
|
|
|
|
<h3>公司新闻</h3> |
|
|
|
|
|
<ListPage :code="code" @changeYear="changeYear" :content="content3" @getData="getData" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</template> |
|
|
<RichText v-else :rich-obj="introContent" /> |
|
|
<RichText v-else :rich-obj="introContent" /> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4"> |
|
|
<div v-if="introContent.relations && introContent.relations.length" class="content-detail p-4"> |
|
@ -81,6 +93,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
year: '2022', |
|
|
year: '2022', |
|
|
content: {}, |
|
|
content: {}, |
|
|
|
|
|
content1: {}, |
|
|
|
|
|
content2: {}, |
|
|
|
|
|
content3: {}, |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
introId: '', |
|
|
introId: '', |
|
|
introContent: {}, |
|
|
introContent: {}, |
|
@ -93,7 +108,13 @@ export default { |
|
|
this.code = val; |
|
|
this.code = val; |
|
|
this.getType(this.code); |
|
|
this.getType(this.code); |
|
|
this.getDetault(val); |
|
|
this.getDetault(val); |
|
|
|
|
|
if (this.code === '0204') { |
|
|
|
|
|
this.getContentData('0201'); |
|
|
|
|
|
this.getContentData('0202'); |
|
|
|
|
|
this.getContentData('0203'); |
|
|
|
|
|
} else { |
|
|
this.getContentData(); |
|
|
this.getContentData(); |
|
|
|
|
|
} |
|
|
this.introContent = {}; |
|
|
this.introContent = {}; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -106,7 +127,13 @@ export default { |
|
|
this.introId = this.$route.query.introId; |
|
|
this.introId = this.$route.query.introId; |
|
|
this.getIntroContent(); |
|
|
this.getIntroContent(); |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.code === '0204') { |
|
|
|
|
|
this.getContentData('0201'); |
|
|
|
|
|
this.getContentData('0202'); |
|
|
|
|
|
this.getContentData('0203'); |
|
|
|
|
|
} else { |
|
|
this.getContentData(); |
|
|
this.getContentData(); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
...mapActions('home', ['getContent', 'getDetail', 'getContentImg']), |
|
|
...mapActions('home', ['getContent', 'getDetail', 'getContentImg']), |
|
@ -128,24 +155,35 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async getContentData() { |
|
|
async getContentData(showPage) { |
|
|
try { |
|
|
try { |
|
|
let param = { |
|
|
let param = { |
|
|
showPage: this.code, |
|
|
showPage: showPage || this.code, |
|
|
year: this.year, |
|
|
year: this.year, |
|
|
showType: this.showType, |
|
|
showType: this.showType, |
|
|
pageNum: this.pageNum, |
|
|
pageNum: this.pageNum, |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
|
}; |
|
|
}; |
|
|
let data = null; |
|
|
let data = null; |
|
|
|
|
|
let data1 = null; |
|
|
|
|
|
let data2 = null; |
|
|
|
|
|
let data3 = null; |
|
|
if (this.showType === '1' && this.code === '0204') { |
|
|
if (this.showType === '1' && this.code === '0204') { |
|
|
param.pageSize = 12; |
|
|
param.pageSize = 16; |
|
|
data = await this.getContentImg(param); |
|
|
if (showPage === '0201') { |
|
|
|
|
|
data1 = await this.getContentImg(param); |
|
|
|
|
|
this.content1 = data1; |
|
|
|
|
|
} else if (showPage === '0202') { |
|
|
|
|
|
data2 = await this.getContentImg(param); |
|
|
|
|
|
this.content2 = data2; |
|
|
|
|
|
} else if (showPage === '0203') { |
|
|
|
|
|
data3 = await this.getContentImg(param); |
|
|
|
|
|
this.content3 = data3; |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
data = await this.getContent(param); |
|
|
data = await this.getContent(param); |
|
|
console.log('data: ', data); |
|
|
|
|
|
} |
|
|
|
|
|
this.content = data; |
|
|
this.content = data; |
|
|
|
|
|
} |
|
|
} catch (error) {} |
|
|
} catch (error) {} |
|
|
}, |
|
|
}, |
|
|
// 获取文章信息 |
|
|
// 获取文章信息 |
|
@ -165,14 +203,14 @@ export default { |
|
|
this.code = code; |
|
|
this.code = code; |
|
|
this.introId = ''; |
|
|
this.introId = ''; |
|
|
}, |
|
|
}, |
|
|
changeYear(year) { |
|
|
changeYear(year, code) { |
|
|
this.year = year; |
|
|
this.year = year; |
|
|
this.getContentData(); |
|
|
this.getContentData(code); |
|
|
}, |
|
|
}, |
|
|
getData(pageNum) { |
|
|
getData(pageNum, code) { |
|
|
console.log('pageNum: ', pageNum); |
|
|
console.log('pageNum: ', pageNum); |
|
|
this.pageNum = pageNum; |
|
|
this.pageNum = pageNum; |
|
|
this.getContentData(); |
|
|
this.getContentData(code); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|