Bläddra i källkod

Merge branch 'ch/dongwu1.4' of eta_mini/eta_mini_h5 into master_dw

leichen 1 månad sedan
förälder
incheckning
4c6774cbc6

BIN
src/assets/imgs/logo.png


+ 1 - 0
src/styles/vars.css

@@ -28,6 +28,7 @@
   /* 修改td组件颜色 */
   --td-primary-color-7: #053cc9;
   --td-primary-color-1: #f5f8ff;
+  --td-tab-item-height: 65px;
 }
 
 @media (min-width: 600px) {

+ 58 - 32
src/views/report/PushDetail.vue

@@ -10,49 +10,58 @@ 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 reportCollected = ref(false)//报告是否收藏
-const isBind=ref(false)
 const headImgStyle=ref([])
 const endImgStyle=ref([])
+const PdfUrl = ref('')
 const layoutBaseInfo=ref({
   '研报标题':'',
   '研报作者':'',
   '创建时间':''
 })
 async function getReportInfo() {
-  console.log(reportId);
   
   if (!reportId) return
   const res = await apiReport.getPushReportDetail({
-    ReportId: Number(reportId)
+    ReportId: Number(reportId),
+    ReportType: Number(ReportType)
   })
   if (res.Ret === 200) {
     reportInfo.value = res.Data.Report
-    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]
+    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
-    reportCollected.value = res.Data.IsCollect || false
-    isBind.value=res.Data.IsSignIn
-    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
 
 
     nextTick(() => {
-      handlePreviewImgs()
+      if (ReportType === '1') {
+        handlePreviewImgs()
+      }
     })
     // 设置分享文案
-    wx.miniProgram.postMessage({
-      data: {
-        title: res.Data.Report.Title
-      }
-    });
-    reportInfo.value.Content=modifyReportContentIframeData(reportInfo.value.Content)
-    formatIframeData()
+    // wx.miniProgram.postMessage({
+    //   data: {
+    //     title: res.Data.Report.Title
+    //   }
+    // });
   }
 }
 getReportInfo()
@@ -143,7 +152,7 @@ onUnmounted(() => {
 <template>
   <div class="report-detail-page" v-if="reportInfo">
     <!-- 智能研报有版头版尾 -->
-    <div class="html-head-img-box" v-if="reportInfo.HeadResource.ImgUrl">
+    <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" 
@@ -164,19 +173,30 @@ onUnmounted(() => {
         {{ layoutBaseInfo[item.value] }}
       </div>
     </div>
-    <div class="time-box" style="text-align:right;" v-if="reportInfo.HeadResource.ImgUrl">
+    <div class="time-box" style="text-align:right;" v-if="reportInfo.HeadResource && reportInfo.HeadResource.ImgUrl">
       <span>如有内容疑问 请查看 &nbsp;</span>
       <span class="btn" @click="isShowMZSM = true">免责声明</span>
     </div>
 
-    <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 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>
@@ -186,8 +206,9 @@ onUnmounted(() => {
       id="rich-content"
       class="report-content-box rich-content"
       v-html="reportContent"
+      v-if="ReportType === '1'"
     />
-    <template>
+    <template v-if="ReportType === '1'">
     <div
       id="rich-content"
       class="report-content-box rich-content"
@@ -213,10 +234,15 @@ onUnmounted(() => {
       </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.ImgUrl">
+    <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" 

+ 48 - 36
src/views/report/PushList.vue

@@ -13,10 +13,13 @@
   let finished = ref(false)
   const pageSize = 30
   let typeOpts = ref([])
+  let varietyOpts = ref([])
   let activeType = ref(0)
-  let timeRangeType = ref(0)
+  let timeRangeType = ref(3)
   let pdfPermissionId = ref(0)
   let pid = ref(0)
+  let isPdf = ref(false)
+  let Parent = ref(0)
   const tabs = ref(null)
   const activeTypeTabs = ref(null)
   let defaultValue = ref(0)
@@ -30,6 +33,7 @@
     ChartPermissionId:activeType.value === 0 ? pid.value : activeType.value,
     RangeType: timeRangeType.value,
     ClassifyId: 0,
+    ReportType: 1
   })
 
   getReportPermissionOpts()
@@ -40,6 +44,7 @@
     apiReport.permissionList({ chartPermissonId: pid.value }).then(res => {
       if (res.Ret === 200) {
         const arr = res.Data || []
+        varietyOpts.value=[{ChartPermissionId:0,PermissionName:'全部',ChartPermissionType:1},...arr]
         if (!secondary.value)  typeOpts.value=[{ChartPermissionId:0,PermissionName:'全部',ChartPermissionType:1},...arr]
         else {
           if(activeType.value === 0) {
@@ -50,6 +55,8 @@
           } else {
             secondaryList.value = arr 
             filterState.ChartPermissionId = arr[0].ChartPermissionId
+            filterState.ReportType = arr[0].ChartPermissionType
+            filterState.Level = arr[0].ChartPermissionType === 2 ? 1 : 2
             defaultValue.value = arr[0].ChartPermissionId
           }
           getReportList()
@@ -61,6 +68,7 @@
 
   // 获取报告列表
   async function getReportList() {
+    isPdf.value = filterState.ReportType === 2 ? true : false
     loading.value = true
     const res = await apiReport.getReportList(filterState)
     loading.value = false
@@ -103,6 +111,7 @@
     pid.value = e
     filterState.ClassifyId = 0
     filterState.ChartPermissionId = e === 0 ? pid.value : e,
+    Parent.value = e
     secondary.value = true
     nextTick(()=>{
       // activeTypeTabs.value.setTrack()//设置滑块位置
@@ -113,20 +122,22 @@
   function handleSecondary(e) {
     list.value = []
     defaultValue.value = e
-    if(activeType.value === e) return
+    // if(activeType.value === e) return
     activeType.value = e
     filterState.RangeType = 3
     // filterState.ClassifyId = e
     filterState.ClassifyId = 0
     pid.value = e
     filterState.ChartPermissionId = e === 0 ? pid.value : e,
+    filterState.ReportType = e === Parent.value ? 2 : 1
+    filterState.Level = e === Parent.value ? 1 : 2
     handleRefreshList()
   }
 
   function handleFilterList(e) {
-    console.log(e);
     filterState.RangeType = e.time
-    pdfPermissionId.value=e.permission
+    if(filterState.ReportType === 2) filterState.ChartPermissionId = e.permission
+    if (activeType.value !== 0) filterState.Level = 2
     filterState.ClassifyId = e.classifyId
     handleRefreshList()
   }
@@ -166,17 +177,11 @@
       <div class="top-filter-wrap">
         <div class="search">
           <div class="top">
-            <t-input placeholder="请输入关键字" class="input" @click="toSearch">
-              <template #prefixIcon>
-                <t-icon name="search" size="20px" color="RGBA(0, 79, 189, 1)"></t-icon>
-              </template>
-            </t-input>
-            <t-button variant="text" size="large" class="btn" @click="handleFilter">
-              <template #icon>
-                <t-icon name="filter"></t-icon>
-              </template>
-              筛选
-            </t-button>
+            <img src="@/assets/imgs/logo.png" alt="" class="logo">
+            <div>
+              <t-icon name="search" size="20px" color="RGBA(0, 79, 189, 1)" @click="toSearch" style="margin-right: 10px;"></t-icon>
+              <t-icon name="filter"  size="20px" color="RGBA(0, 79, 189, 1)" @click="handleFilter"></t-icon>
+            </div>
           </div> 
         </div>
         <t-tabs
@@ -227,9 +232,10 @@
       <!-- eslint-disable -->
     <Filter 
       v-model:show="showFilter" 
-      :permissionOpts="typeOpts"
+      :permissionOpts="varietyOpts"
       :filterClassifyPermissionId="filterClassifyPermissionId"
       :firstPermissionId="pid"
+      :isPdf="isPdf"
       @updateShowFilter="updateShowFilter"
       @change="handleFilterList" 
     />
@@ -262,32 +268,38 @@
     transform: translateY(-50%);
   }
 }
+.top-filter-wrap {
+  .search {
+    padding-top: 16px;
+    background-color: #fff;
+    .top {
+      padding: 4px 20px;
+      display: flex;
+      justify-content:space-between;
+      align-items: center;
+      .logo {
+        width: 50%;
+        height: 80px;
+      }
+    }
+  }
+}
 @media (min-width: 600px) {
   .top-filter-wrap {
     .filter-icon {
       width: 22px;
       height: 22px;
     }
-  }
-}
-.search {
-  padding-top: 20px;
-  background-color: #fff;
-  .top {
-    // margin-top: 20px;
-    display: flex;
-    align-items: center;
-    padding: 0 28px;
-    .input {
-      height: 80px;
-      padding: 0 30px;
-      border: none;
-      border-radius: 50px;
-      background: rgba(248, 248, 250, 1);
-    }
-    .btn {
-      font-size: 28px;
-      font-weight: 400;
+    .search {
+      margin-top: 8px;
+      .top {
+        padding: 2px 10px;
+        .logo {
+          width: 25%;
+          height: 40px;
+          
+        }
+      }
     }
   }
 }

+ 22 - 4
src/views/report/components/Filter.vue

@@ -16,6 +16,10 @@ const props=defineProps({
     type:Number,
     default:0
   },
+  isPdf:{
+    type:Boolean,
+    default:false
+  },
   firstPermissionId:{//一级品种id
     type:Number,
     default:0,
@@ -45,7 +49,7 @@ const permissionOpts=computed(()=>{
   return arr.filter(e=>e.ChartPermissionType===1)
 })
 function handlePermissionChange(e){
-  activePermission.value=e.detail.value
+  activePermission.value=e
 }
 
 // 报告分类
@@ -63,7 +67,7 @@ function formatClassify(arr){
 }
 function getReportClassifyList(){
   apiReport.reportClassifyOpts({
-    ChartPermissionId: props.filterClassifyPermissionId,
+    ChartPermissionId: props.isPdf?props.firstPermissionId:props.filterClassifyPermissionId,
   }).then(res=>{
     if(res.Ret===200){
       const arr=res.Data||[]
@@ -82,6 +86,11 @@ function getReportClassifyList(){
 }
 watch(()=>props.show,()=>{
   if(props.show){
+    if(props.isPdf){
+      typeActive.value='报告品种'
+    }else{
+      typeActive.value='报告分类'
+    }
     getReportClassifyList()
   }
 })
@@ -115,6 +124,11 @@ function handleFilter(type){
       </div> -->
       <div class="content">
         <div class="type-wrap">
+          <div 
+            :class="['type-item',typeActive==='报告品种'?'type-item_active':'']" 
+            @click="typeActive='报告品种'"
+            v-if="props.isPdf"
+          >报告品种</div>
           <div 
             :class="['type-item',typeActive==='报告分类'?'type-item_active':'']" 
             @click="typeActive='报告分类'"
@@ -126,7 +140,7 @@ function handleFilter(type){
         </div>
         <div :class="['context-wrap', typeActive === '发布时间' ? 'type-item_height':'']">
           <!-- 报告品种 -->
-          <!-- <div class="premission-wrap" v-if="typeActive==='报告品种'">
+          <div class="premission-wrap" v-if="typeActive==='报告品种'">
             <t-radio-group 
               :value="activePermission" 
               icon="line" 
@@ -138,7 +152,7 @@ function handleFilter(type){
               }"
               @change="handlePermissionChange"
             />
-          </div> -->
+          </div>
           <!-- 报告分类 -->
           <div class="classify-wrap" v-if="typeActive==='报告分类'">
             <!-- <t-tree-select 
@@ -208,6 +222,10 @@ function handleFilter(type){
     .context-wrap{
       height: 572px;
       // overflow-y: auto;
+      .premission-wrap {
+        height: 572px;
+        overflow-y: auto;
+      }
     }
     .type-item_height {
       height: 388px;

+ 17 - 8
src/views/report/components/ReportItem.vue

@@ -16,7 +16,7 @@ const props = defineProps({
 })
 
 async function goDetail(){
-  router.push(`/pushReport/detail?ReportId=${props.data.ReportId}`)
+  router.push(`/pushReport/detail?ReportId=${props.data.ReportId}&ReportType=${props.data.ReportType}`)
 }
 
 const title=computed(()=>{
@@ -46,10 +46,11 @@ const title=computed(()=>{
 <style lang="scss" scoped>
 
 .report-item-box {
-  padding: 30PX var(--page-padding);
-  margin-bottom: 15PX;
+  padding: 30px 30px 20px 30px;
+  margin-bottom: 2PX;
   background-color: var(--bg-color);
   .report-title {
+    margin-bottom: 6px;
     font-size: var(--font-size-huge);
     :deep(.report-title_color){
       color: var(--primary-color);
@@ -61,7 +62,7 @@ const title=computed(()=>{
     }
   }
   .report-des {
-    margin: 16PX 0;
+    margin-top: 4PX;
     color: var(--text-color-grey);
     font-size: var(--font-size-small);
     line-height: 1.5;
@@ -71,29 +72,37 @@ const title=computed(()=>{
     justify-content: space-between;
     color: var(--text-color-sub);
     font-size: var(--font-size-small);
+    padding-top: 8px;
     .author {
-      padding: 4PX 6PX;
+      width: 60%;
+      // overflow: hidden;
+      // text-overflow: ellipsis;
+      // white-space: nowrap;
+      padding: 4PX 0;
     }
     .bottom {
       display: flex;
       justify-content: space-between;
       .time {
+        height: 42px;
+        line-height: 28px;
         padding: 4PX 6PX;
       }
       .stage {
+        height: 42px;
+        line-height: 28px;
         display: inline-block;
         background-color: var(--td-primary-color-1);
         color: var(--primary-color);
         padding: 4PX 6PX;
-        margin-left: 20PX;
       }
     }
   }
 }
 @media (min-width: 600px){
   .report-item-box{
-    padding: 15px var(--page-padding);
-    margin-bottom: 10px;
+    padding: 15px 15px 10px 15px;
+    margin-bottom: 1px;
     .report-des{
       margin: 8px 0;
     }