Browse Source

fix:移动端版图字体大小不乘以2

chenlei 2 months ago
parent
commit
30e3f5ec0d
2 changed files with 18 additions and 4 deletions
  1. 9 2
      src/views/smartReport/detail.vue
  2. 9 2
      src/views/smartReport/detailPdf.vue

+ 9 - 2
src/views/smartReport/detail.vue

@@ -7,7 +7,7 @@
         <div class="html-head-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.HeadImg">
           <img :src="reportInfo.HeadImg" 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,
+          :style="{fontFamily:item.family,fontSize: (item.size)+'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] }}
@@ -89,7 +89,7 @@
         <div class="html-end-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.EndImg">
           <img :src="reportInfo.EndImg" 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,
+          :style="{fontFamily:item.family,fontSize: (item.size)+'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] }}
@@ -258,6 +258,13 @@ export default {
         this.endImgStyle.map(st =>{
           st.size = st.sizeMobile || st.size;
         })
+      } else {
+        this.headImgStyle.map(st =>{
+          st.size = st.size * 2 || 16;
+        })
+        this.endImgStyle.map(st =>{
+          st.size = st.size * 2 || 16;
+        })
       }
       this.layoutBaseInfo['研报标题']=this.reportInfo.Title
       this.layoutBaseInfo['研报作者']=this.reportInfo.Author

+ 9 - 2
src/views/smartReport/detailPdf.vue

@@ -6,7 +6,7 @@
         <div class="html-head-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.HeadImg">
           <img :src="reportInfo.HeadImg" 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,
+          :style="{fontFamily:item.family,fontSize:(item.size)+'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] }}
@@ -48,7 +48,7 @@
         <div class="html-end-img-box" v-if="reportInfo && !!reportInfo.NeedSplice && reportInfo.EndImg">
           <img :src="reportInfo.EndImg" 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,
+          :style="{fontFamily:item.family,fontSize:(item.size)+'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] }}
@@ -118,6 +118,13 @@ export default {
         this.endImgStyle.map(st =>{
           st.size = st.sizeMobile || st.size;
         })
+      } else {
+        this.headImgStyle.map(st =>{
+          st.size = st.size * 2 || 16;
+        })
+        this.endImgStyle.map(st =>{
+          st.size = st.size * 2 || 16;
+        })
       }
       this.layoutBaseInfo['研报标题']=this.reportInfo.Title
       this.layoutBaseInfo['研报作者']=this.reportInfo.Author