|
@@ -1,537 +0,0 @@
|
|
|
-<script setup>
|
|
|
-import apiReport from '@/api/modules/report'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
-import { Message } from 'tdesign-mobile-vue';
|
|
|
-import apiCommon from '@/api/modules/common'
|
|
|
-import apiUser from '@/api/modules/user'
|
|
|
-import { useThrottleFn } from '@vueuse/core'
|
|
|
-
|
|
|
-const route = useRoute()
|
|
|
-
|
|
|
-
|
|
|
-const reportId = route.query.ReportId
|
|
|
-const ReportType = route.query.ReportType
|
|
|
-const reportInfo = ref(null)
|
|
|
-const reportContent = ref('')
|
|
|
-// const reportStatus = ref(0)//1已过期,2没有该品种权限,3没有权限,4有权限,5未绑定
|
|
|
-const headImgStyle=ref([])
|
|
|
-const endImgStyle=ref([])
|
|
|
-const PdfUrl = ref('')
|
|
|
-const layoutBaseInfo=ref({
|
|
|
- '研报标题':'',
|
|
|
- '研报作者':'',
|
|
|
- '创建时间':''
|
|
|
-})
|
|
|
-async function getReportInfo() {
|
|
|
-
|
|
|
- if (!reportId) return
|
|
|
- const res = await apiReport.getPushReportDetail({
|
|
|
- ReportId: Number(reportId),
|
|
|
- ReportType: Number(ReportType)
|
|
|
- })
|
|
|
- if (res.Ret === 200) {
|
|
|
- reportInfo.value = res.Data.Report
|
|
|
- if (ReportType === '1') {
|
|
|
- reportInfo.value.Content =reportInfo.value.Content.split('<p data-f-id="pbf" style="text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;">Powered by <a href="https://www.froala.com/wysiwyg-editor?pb=1" title="Froala Editor">Froala Editor</a></p>')[0]
|
|
|
- headImgStyle.value=res.Data.Report.HeadResource.Style?JSON.parse(res.Data.Report.HeadResource.Style):[]
|
|
|
- endImgStyle.value=res.Data.Report.EndResource.Style?JSON.parse(res.Data.Report.EndResource.Style):[]
|
|
|
- layoutBaseInfo.value['研报标题']=res.Data.Report.Title
|
|
|
- layoutBaseInfo.value['研报作者']=res.Data.Report.Author
|
|
|
- layoutBaseInfo.value['创建时间']=res.Data.Report.PublishTime
|
|
|
- reportInfo.value.Content=modifyReportContentIframeData(reportInfo.value.Content)
|
|
|
- formatIframeData()
|
|
|
- } else {
|
|
|
- // PdfUrl.value = res.Data.PdfUrl
|
|
|
- // console.log(PdfUrl.value);
|
|
|
- reportInfo.value = res.Data
|
|
|
- layoutBaseInfo.value['研报标题']=res.Data.Title
|
|
|
- layoutBaseInfo.value['研报作者']=res.Data.Author
|
|
|
- layoutBaseInfo.value['创建时间']=res.Data.PublishTime
|
|
|
- }
|
|
|
- // reportStatus.value = res.Data.Status
|
|
|
-
|
|
|
-
|
|
|
- nextTick(() => {
|
|
|
- if (ReportType === '1') {
|
|
|
- handlePreviewImgs()
|
|
|
- }
|
|
|
- })
|
|
|
- // 设置分享文案
|
|
|
- // wx.miniProgram.postMessage({
|
|
|
- // data: {
|
|
|
- // title: res.Data.Report.Title
|
|
|
- // }
|
|
|
- // });
|
|
|
- }
|
|
|
-}
|
|
|
-getReportInfo()
|
|
|
-
|
|
|
-// 修改报告中嵌入的图表地址
|
|
|
-function modifyReportContentIframeData(str){
|
|
|
- let temStr=str.replace(/http:\/\/eta.dwfutures.com:8001/g,'https://dwresearch.dwfutures.com')
|
|
|
- return temStr.replace(/http:\/\/58.210.74.21:9100\/etastatic/g,'https://dwresearch.dwfutures.com/etastatic')
|
|
|
-}
|
|
|
-
|
|
|
-// 给报告详情中图表加参数
|
|
|
-function formatIframeData() {
|
|
|
- reportContent.value = reportInfo.value.Content.replace(/\/chartshow\?code=/g, `/chartshow? reportId=${reportId}&code=`)
|
|
|
- splitReportContent(reportContent.value)
|
|
|
-}
|
|
|
-
|
|
|
-// 报告内容分页
|
|
|
-const pageSize=20
|
|
|
-let page=0
|
|
|
-let endPageNum=0
|
|
|
-let contentTotals=[]
|
|
|
-const renderContentList=ref([])
|
|
|
-function splitReportContent(data){
|
|
|
- const arr=data.split('</p>');
|
|
|
- contentTotals=arr.map(_ => _+'</p>')
|
|
|
- renderContentList.value=contentTotals.slice(0,pageSize)
|
|
|
- endPageNum=parseInt(contentTotals.length / pageSize) + 1;
|
|
|
-}
|
|
|
-function handleLoadContent(){
|
|
|
- renderContentList.value=renderContentList.value.concat(contentTotals.slice(page*pageSize,(page+1)*pageSize))
|
|
|
-}
|
|
|
-
|
|
|
-// 显示免责声明
|
|
|
-const isShowMZSM = ref(false)
|
|
|
-
|
|
|
-// 显示返回顶部
|
|
|
-const showToTop = ref(false)
|
|
|
-const handlePageScroll=useThrottleFn(()=>{
|
|
|
- const top = document.documentElement.scrollTop || document.body.scrollTop
|
|
|
- if (top > window.outerHeight) {
|
|
|
- showToTop.value = true
|
|
|
- } else {
|
|
|
- showToTop.value = false
|
|
|
- }
|
|
|
-
|
|
|
- if(page >= endPageNum) return
|
|
|
- const clientHeight = document.documentElement.clientHeight || document.body.clientHeight; // 可视高度
|
|
|
- const scrollHeight = document.body.scrollHeight; // 总高度
|
|
|
- const bufferHeight = 400;
|
|
|
- if((scrollHeight - top - clientHeight) < bufferHeight+100) {
|
|
|
- console.log('触底')
|
|
|
- page++
|
|
|
- handleLoadContent();
|
|
|
- }
|
|
|
-},300)
|
|
|
-
|
|
|
-function handleBackTop() {
|
|
|
- console.log(1)
|
|
|
- document.body.scrollTop = document.documentElement.scrollTop = 0
|
|
|
-}
|
|
|
-
|
|
|
-// 点击报告内容中的图片
|
|
|
-function handlePreviewImgs() {
|
|
|
- document.getElementById('rich-content').addEventListener('click', function (event) {
|
|
|
- let imgArray = [];
|
|
|
- let curImageSrc = event.target.src;
|
|
|
- let oParent = event.target.parentNode;
|
|
|
- if (curImageSrc && !oParent.hasAttribute('href')) {
|
|
|
- let imgs = document.querySelectorAll('.rich-content img');
|
|
|
- for (let i = 0; i < imgs.length; i++) {
|
|
|
- let itemSrc = imgs[i].src;
|
|
|
- imgArray.push(itemSrc);
|
|
|
- }
|
|
|
- wx.previewImage({ current: curImageSrc, urls: imgArray });
|
|
|
- }
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
-onMounted(() => {
|
|
|
- window.addEventListener('scroll', handlePageScroll)
|
|
|
-})
|
|
|
-onUnmounted(() => {
|
|
|
- window.removeEventListener('scroll', handlePageScroll)
|
|
|
-})
|
|
|
-
|
|
|
-</script>
|
|
|
-
|
|
|
-<template>
|
|
|
- <div class="report-detail-page" v-if="reportInfo">
|
|
|
- <!-- 智能研报有版头版尾 -->
|
|
|
- <div class="html-head-img-box" v-if="reportInfo.HeadResource && reportInfo.HeadResource.ImgUrl">
|
|
|
- <img :src="reportInfo.HeadResource.ImgUrl" alt="" style="display:block;width:100%">
|
|
|
- <div
|
|
|
- class="head-layout-item"
|
|
|
- v-for="item in headImgStyle"
|
|
|
- :key="item.value"
|
|
|
- :style="{
|
|
|
- fontFamily:item.family,
|
|
|
- fontSize:(item.size*2)+'px',
|
|
|
- fontWeight:item.weight,
|
|
|
- textAlign:item.align,
|
|
|
- color:item.color,
|
|
|
- width:item.width,
|
|
|
- height:item.height,
|
|
|
- left:item.left,
|
|
|
- top:item.top
|
|
|
- }"
|
|
|
- >
|
|
|
- {{ layoutBaseInfo[item.value] }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="time-box" style="text-align:right;" v-if="reportInfo.HeadResource && reportInfo.HeadResource.ImgUrl">
|
|
|
- <span>如有内容疑问 请查看 </span>
|
|
|
- <span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
- </div>
|
|
|
-
|
|
|
- <template v-if="ReportType === '1'">
|
|
|
- <template v-if="!reportInfo.HeadResource.ImgUrl&&!reportInfo.EndResource.ImgUrl">
|
|
|
- <div class="title-box">{{ reportInfo.Title }}</div>
|
|
|
- <div class="author-box">{{ reportInfo.Author }}</div>
|
|
|
- <div class="time-box">
|
|
|
- <span>{{ reportInfo.PublishTime }}</span>
|
|
|
- <span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <div class="title-box">{{ reportInfo.Title }}</div>
|
|
|
- <div class="author-box">{{ reportInfo.Author }}</div>
|
|
|
- <div class="time-box">
|
|
|
- <span>{{ reportInfo.PublishTime }}</span>
|
|
|
- <span class="btn" @click="isShowMZSM = true">免责声明</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
-
|
|
|
- <div class="des-box" v-if="reportInfo.Abstract">
|
|
|
- <svg-icon name="icon01"></svg-icon>
|
|
|
- <div>{{ reportInfo.Abstract }}</div>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- id="rich-content"
|
|
|
- class="report-content-box rich-content"
|
|
|
- v-html="reportContent"
|
|
|
- v-if="ReportType === '1'"
|
|
|
- />
|
|
|
- <template v-if="ReportType === '1'">
|
|
|
- <div
|
|
|
- id="rich-content"
|
|
|
- class="report-content-box rich-content"
|
|
|
- v-if="reportInfo.HasChapter!==1"
|
|
|
- >
|
|
|
- <div v-for="item in renderContentList" :key="item" v-html="item"></div>
|
|
|
- </div>
|
|
|
- <!-- 章节报告 -->
|
|
|
- <div
|
|
|
- id="rich-content"
|
|
|
- class="report-content-box rich-content"
|
|
|
- v-if="reportInfo.HasChapter===1"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="chapter-item-wrap"
|
|
|
- v-for="chapter,index in reportInfo.ChapterContent"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div class="chapter-title">
|
|
|
- <h3 class="chapter-title-text">{{chapter.Title}}</h3>
|
|
|
- </div>
|
|
|
- <div v-html="chapter.Content"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-if="ReportType === '2'">
|
|
|
- <div class="report-content-box rich-content">
|
|
|
- <preview-PDF :url="reportInfo.PdfUrl"/>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
-
|
|
|
- <!-- 拼接版尾 -->
|
|
|
- <div class="html-end-img-box" v-if="reportInfo.EndResource && reportInfo.EndResource.ImgUrl">
|
|
|
- <img :src="reportInfo.EndResource.ImgUrl" alt="" style="display:block;width:100%">
|
|
|
- <div
|
|
|
- class="head-layout-item"
|
|
|
- v-for="item in endImgStyle"
|
|
|
- :key="item.value"
|
|
|
- :style="{
|
|
|
- fontFamily:item.family,
|
|
|
- fontSize:(item.size*2)+'px',
|
|
|
- fontWeight:item.weight,
|
|
|
- textAlign:item.align,
|
|
|
- color:item.color,
|
|
|
- width:item.width,
|
|
|
- height:item.height,
|
|
|
- left:item.left,
|
|
|
- top:item.top
|
|
|
- }"
|
|
|
- >{{ layoutBaseInfo[item.value] }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 右侧悬浮操作栏 -->
|
|
|
- <div class="right-fix-box">
|
|
|
- <!-- 返回顶部 -->
|
|
|
- <div class="item back-top-img">
|
|
|
- <svg-icon
|
|
|
- name="backtop"
|
|
|
- v-show="showToTop"
|
|
|
- @click="handleBackTop"
|
|
|
- class="back-top-img"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 免责声明 -->
|
|
|
- <disclaimers-wrap v-model:show="isShowMZSM" />
|
|
|
-</template>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-.report-detail-page {
|
|
|
- background-color: #fff;
|
|
|
- padding: var(--page-padding);
|
|
|
- .title-box {
|
|
|
- font-size: 36px;
|
|
|
- line-height: 44px;
|
|
|
- margin-bottom: 20px;
|
|
|
- }
|
|
|
- .time-box {
|
|
|
- margin-top: 10px;
|
|
|
- font-size: var(--font-size-small);
|
|
|
- color: var(--text-color-grey);
|
|
|
- .btn {
|
|
|
- float: right;
|
|
|
- color: var(--primary-color);
|
|
|
- }
|
|
|
- }
|
|
|
- .des-box {
|
|
|
- background-color: #f8f8f8;
|
|
|
- padding: 20px;
|
|
|
- margin: 20px 0;
|
|
|
- display: flex;
|
|
|
- gap: 0 10px;
|
|
|
- color: var(--text-color-sub);
|
|
|
- font-size: var(--font-size-small);
|
|
|
- line-height: 36px;
|
|
|
- }
|
|
|
- .report-content-box {
|
|
|
- margin-top: 20px;
|
|
|
- line-height: 1.8;
|
|
|
- font-size: 36px;
|
|
|
- :deep(img) {
|
|
|
- width: 100% !important;
|
|
|
- }
|
|
|
- :deep(span) {
|
|
|
- font-size: 36px !important;
|
|
|
- line-height: 1.8 !important;
|
|
|
- background-color: rgba(255, 255, 255, 0) !important;
|
|
|
- }
|
|
|
- :deep(p) {
|
|
|
- font-size: 36px !important;
|
|
|
- line-height: 1.8 !important;
|
|
|
- background-color: rgba(255, 255, 255, 0) !important;
|
|
|
- }
|
|
|
- :deep(ul) {
|
|
|
- font-size: 36px !important;
|
|
|
- line-height: 1.8 !important;
|
|
|
- background-color: rgba(255, 255, 255, 0) !important;
|
|
|
- }
|
|
|
- :deep(ol) {
|
|
|
- font-size: 36px !important;
|
|
|
- line-height: 1.8 !important;
|
|
|
- background-color: rgba(255, 255, 255, 0) !important;
|
|
|
- }
|
|
|
- :deep(iframe) {
|
|
|
- width: 100% !important;
|
|
|
- }
|
|
|
- :deep(li) {
|
|
|
- font-size: 36px !important;
|
|
|
- line-height: 1.8 !important;
|
|
|
- background-color: rgba(255, 255, 255, 0) !important;
|
|
|
- list-style: inherit !important;
|
|
|
- list-style-position: inside !important;
|
|
|
- }
|
|
|
- :deep(span.fr-emoticon) {
|
|
|
- width: 36px !important;
|
|
|
- height: 36px !important;
|
|
|
- background-repeat: no-repeat !important;
|
|
|
- background-size: cover !important;
|
|
|
- display: inline-block !important;
|
|
|
- vertical-align: middle !important;
|
|
|
- }
|
|
|
-
|
|
|
- .chapter-item-wrap {
|
|
|
- padding: 20px 0;
|
|
|
- .chapter-title {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 30px;
|
|
|
- .type {
|
|
|
- height: fit-content;
|
|
|
- display: inline-block;
|
|
|
- color: #fff;
|
|
|
- padding: 10px 20px;
|
|
|
- background-color: #E6A23C;
|
|
|
- border-radius: 8px;
|
|
|
- margin-right: 20px;
|
|
|
- }
|
|
|
- .chapter-title-text {
|
|
|
- font-size: 30px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .right-fix-box {
|
|
|
- position: fixed;
|
|
|
- z-index: 99;
|
|
|
- right: 34px;
|
|
|
- bottom: 130px;
|
|
|
- .item {
|
|
|
- margin-top: 10px;
|
|
|
- }
|
|
|
- .back-top-img {
|
|
|
- width: 100px;
|
|
|
- height: 100px;
|
|
|
- display: block;
|
|
|
- }
|
|
|
- .collect-icon {
|
|
|
- width: 100px;
|
|
|
- height: 100px;
|
|
|
- display: block;
|
|
|
- }
|
|
|
- }
|
|
|
- .html-head-img-box,.html-end-img-box{
|
|
|
- margin-bottom: 10px;
|
|
|
- position: relative;
|
|
|
- overflow: hidden;
|
|
|
- .head-layout-item{
|
|
|
- position: absolute;
|
|
|
- overflow: hidden;
|
|
|
- box-sizing: border-box
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-.no-auth-wrap {
|
|
|
- position: fixed;
|
|
|
- left: 0;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- z-index: 99;
|
|
|
- .opcity-box {
|
|
|
- height: 129px;
|
|
|
- background: linear-gradient(
|
|
|
- 360deg,
|
|
|
- #ffffff 0%,
|
|
|
- rgba(255, 255, 255, 0) 100%
|
|
|
- );
|
|
|
- }
|
|
|
- .content-box {
|
|
|
- background-color: #fff;
|
|
|
- padding-bottom: 200px;
|
|
|
- text-align: center;
|
|
|
- color: var(--primary-color);
|
|
|
- }
|
|
|
-
|
|
|
- .icon {
|
|
|
- display: block;
|
|
|
- margin: 0 auto;
|
|
|
- width: 200px;
|
|
|
- height: 200px;
|
|
|
- }
|
|
|
-}
|
|
|
-@media (max-width: 599px){
|
|
|
- .report-detail-page{
|
|
|
- .report-content-box{
|
|
|
- :deep(.report-drag-item-wrap_child-wrap){
|
|
|
- flex-wrap: wrap;
|
|
|
- .report-drag-item-wrap_child_content{
|
|
|
- flex: none !important;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-@media (min-width: 600px) {
|
|
|
- .report-detail-page {
|
|
|
- .title-box {
|
|
|
- font-size: 18px;
|
|
|
- line-height: 22px;
|
|
|
- margin-bottom: 10px;
|
|
|
- }
|
|
|
- .time-box {
|
|
|
- margin-top: 5px;
|
|
|
- }
|
|
|
- .des-box {
|
|
|
- padding: 10px;
|
|
|
- margin: 10px 0;
|
|
|
- gap: 0 5px;
|
|
|
- line-height: 18px;
|
|
|
- }
|
|
|
- .report-content-box {
|
|
|
- margin-top: 10px;
|
|
|
- font-size: 18px;
|
|
|
- :deep(span) {
|
|
|
- font-size: 18px !important;
|
|
|
- }
|
|
|
- :deep(p) {
|
|
|
- font-size: 18px !important;
|
|
|
- }
|
|
|
- :deep(ul) {
|
|
|
- font-size: 18px !important;
|
|
|
- }
|
|
|
- :deep(ol) {
|
|
|
- font-size: 18px !important;
|
|
|
- }
|
|
|
- :deep(li) {
|
|
|
- font-size: 18px !important;
|
|
|
- }
|
|
|
- :deep(span.fr-emoticon) {
|
|
|
- width: 18px !important;
|
|
|
- height: 18px !important;
|
|
|
- }
|
|
|
-
|
|
|
- .chapter-item-wrap {
|
|
|
- padding: 10px 0;
|
|
|
- .chapter-title {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 20px;
|
|
|
- .type {
|
|
|
- padding: 5px 10px;
|
|
|
- border-radius: 4px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
- .chapter-title-text {
|
|
|
- font-size: 20px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .right-fix-box {
|
|
|
- right: 17px;
|
|
|
- bottom: 65px;
|
|
|
- .item {
|
|
|
- margin-top: 5px;
|
|
|
- }
|
|
|
- .back-top-img {
|
|
|
- width: 50px;
|
|
|
- height: 50px;
|
|
|
- }
|
|
|
- .collect-icon {
|
|
|
- width: 50px;
|
|
|
- height: 50px;
|
|
|
- }
|
|
|
- }
|
|
|
- .html-head-img-box,.html-end-img-box{
|
|
|
- margin-bottom: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
- .no-auth-wrap {
|
|
|
- .opcity-box {
|
|
|
- height: 65px;
|
|
|
- }
|
|
|
- .content-box {
|
|
|
- padding-bottom: 100px;
|
|
|
- }
|
|
|
- .icon {
|
|
|
- width: 100px;
|
|
|
- height: 100px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|