yujinwen 2 kuukautta sitten
vanhempi
commit
854586ca0c

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 25 - 16
public/eta_comp.js


+ 10 - 1
src/views/report/reportDetailPdf.vue

@@ -218,7 +218,7 @@ export default {
 #reportdtl {
   background: #fff;
   overflow: auto;
-  max-width: 1200px;
+  width: 1200px;
   margin: 0 auto;
   header {
     padding: 0.6rem;
@@ -343,6 +343,15 @@ export default {
       }
   }
 }
+// 适配移动端页面
+@media screen and (max-width: 610px){
+  #reportdtl{
+    width: 100%;
+    header{
+      flex-direction: column-reverse;
+    }
+  }
+}
 // 不禁止页面打印,不然转pdf会出现空白页
 @media print{
     body{

+ 39 - 16
src/views/smartReport/detail.vue

@@ -189,14 +189,32 @@ export default {
       wxShare(document.location.href,res.Data.H5ShareName||document.title,res.Data.H5ShareTitle,res.Data.H5ReportShareImg,0);
       this.getreportdetail()
     },
-    pageResize(){
-      const el=document.getElementById('reportdtl')
-      const windowWid=document.body.clientWidth
-      if(windowWid<1200){
-        el.style.transform=`scale(${windowWid/1200})`
-        // el.style.
-      }
-    },
+    // pageResize(){
+    //   const el=document.getElementById('reportdtl')
+    //   const windowWid=document.body.clientWidth
+    //   if(windowWid<1200){
+    //     el.style.transform=`scale(${windowWid/1200})`
+    //     // el.style.
+    //   }
+    // },
+    // 智能布局移动端样式时内容排版全部变成1个1行的顺排
+    formatSmartStyle() {
+        this.$nextTick(() =>{
+            const width=window.innerWidth;
+            if(width>600) return
+            $('.report-drag-item-wrap_child-wrap').css({
+                'flex-wrap': 'wrap',
+            });
+            $('.report-drag-item-wrap_child-wrap').children().css({
+                'flex': 'none',
+                'width': '100%'
+            });
+            
+            document.querySelectorAll('div[comp-type="text"]').forEach(function(div) {
+              div.style.height = 'auto';
+            });
+        })
+    }, 
 
     playaudio(item) {
       //子组件先存后播
@@ -265,9 +283,10 @@ export default {
       this.layoutBaseInfo['创建时间']=[2,6].includes(this.reportInfo.State)?this.reportInfo.PublishTime:''
       
       this.isshow = true;
-      this.$nextTick(()=>{
-        this.pageResize()
-      })
+      this.formatSmartStyle()
+      // this.$nextTick(()=>{
+      //   this.pageResize()
+      // })
 
       // wxShare(document.location.href, H5ShareName || document.title, wxShareTitle, H5ReportShareImg, 0);
 
@@ -383,8 +402,8 @@ body{
   font-size: 14px;
   background: #fff;
   overflow: auto;
-  width: 1200px;
-  padding: 20px 20px 20px 44px;
+  width: 1240px;
+  padding: 20px;
   margin: 0 auto;
 
   .top-header {
@@ -500,10 +519,14 @@ body{
 		}
   }
 }
-@media screen and (max-width:1200px){
+@media screen and (max-width:610px){
   #reportdtl{
-    position: absolute;
-    transform-origin: 0 0;
+    width: 100%;
+    .no-layout-img-box{
+      header{
+        flex-direction: column-reverse;
+      }
+    }
   }
 }
 </style>

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

@@ -84,11 +84,11 @@ export default {
   },
   mounted() {
     this.getreportdetail();
-    window.addEventListener('resize',this.pageResize)
+    // window.addEventListener('resize',this.pageResize)
   },
 
   destroyed() {
-    window.removeEventListener('resize',this.pageResize)
+    // window.removeEventListener('resize',this.pageResize)
   },
   methods: {
     pageResize(){
@@ -99,6 +99,24 @@ export default {
         // el.style.
       }
     },
+    // 智能布局移动端样式时内容排版全部变成1个1行的顺排
+    formatSmartStyle() {
+        this.$nextTick(() =>{
+            const width=window.innerWidth;
+            if(width>600) return
+            $('.report-drag-item-wrap_child-wrap').css({
+                'flex-wrap': 'wrap',
+            });
+            $('.report-drag-item-wrap_child-wrap').children().css({
+                'flex': 'none',
+                'width': '100%'
+            });
+            
+            document.querySelectorAll('div[comp-type="text"]').forEach(function(div) {
+              div.style.height = 'auto';
+            });
+        })
+    },   
     async getreportdetail() {
       const { Data, Ret } = await reportDetail({ ReportCode: this.id,IsReplace:1 });
       if (Ret !== 200) return;
@@ -125,9 +143,10 @@ export default {
       this.layoutBaseInfo['创建时间']=(this.reportInfo.PublishTime||this.reportInfo.PrePublishTime)
       this.reportInfo.Content=this.setReportContent(this.reportInfo.Content)
       this.isshow = true;
-      this.$nextTick(()=>{
-        this.pageResize()
-      })
+      this.formatSmartStyle()
+      // this.$nextTick(()=>{
+      //   this.pageResize()
+      // })
     },
 
     /**
@@ -205,7 +224,7 @@ body{
   font-size: 14px;
   background: #fff;
   overflow: auto;
-  width: 1200px;
+  width: 1240px;
   padding: 20px;
   margin: 0 auto;
 
@@ -298,10 +317,14 @@ body{
       }
   }
 }
-@media screen and (max-width:1200px){
+@media screen and (max-width:610px){
   #reportdtl{
-    position: absolute;
-    transform-origin: 0 0;
+    width: 100%;
+    .no-layout-img-box{
+      header{
+        flex-direction: column-reverse;
+      }
+    }
   }
 }
 

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä