Browse Source

Merge branch 'xqc_smartReportStyle'

jwyu 1 year ago
parent
commit
5c5ae5f17c
2 changed files with 11 additions and 4 deletions
  1. 3 3
      src/views/smartReport/editReport.vue
  2. 8 1
      src/views/smartReport/reportDetail.vue

+ 3 - 3
src/views/smartReport/editReport.vue

@@ -68,7 +68,7 @@
                     </li>
                 </draggable>
 
-                <div class="report-content-box" id="report-content-box">
+                <div class="report-content-box" id="report-content-box" :style="{backgroundColor:bgColor}">
                     <div class="html-head-img-box">
                         <div class="opt-btn-box" style="display: none;">
                             <div class="del-btn" @click.stop="headImg=''"></div>
@@ -86,7 +86,6 @@
                         @add="handleParentAdd"
                         @remove="handleParentRemove"
                         :move="handleParentMove"
-                        :style="{backgroundColor:bgColor}"
                     >
                         <div 
                             :class="[
@@ -489,6 +488,7 @@ export default {
         handlePreviewReport(){
             const htmlStr=document.getElementById('report-content-box').outerHTML;
             sessionStorage.setItem('smartReportContent', htmlStr);
+            sessionStorage.setItem('smartReportContentBg', this.bgColor);
 			let { href } = this.$router.resolve({ 
                 path: '/smartReportDetail',
                 query:{
@@ -1317,7 +1317,7 @@ div{
         min-height: 100%;
         .report-drag-item-wrap{
             width: 100%;
-            padding: 3px;
+            padding: 6px;
             min-height: 80px;
             border: 1px dashed #0052D9;
             position: relative;

+ 8 - 1
src/views/smartReport/reportDetail.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="smart-report-detail">
-        <div class="main-box">
+        <div class="main-box" :style="{backgroundColor:bgColor}">
             <!-- <div class="top-box">
                 <div class="title">{{reportInfo&&reportInfo.Title}}</div>
                 <div class="flex">
@@ -83,6 +83,7 @@ export default {
         return {
             reportInfo:null,
             content:'',
+            bgColor:'',
             reportImgUrl:'',
             showReportImg:false
         }
@@ -104,8 +105,10 @@ export default {
                     this.reportInfo=res.Data
                     if(this.$route.query.type==='preview'){
                        this.content=sessionStorage.getItem('smartReportContent')
+                       this.bgColor=sessionStorage.getItem('smartReportContentBg')
                     }else{
                         this.content=res.Data.Content
+                        this.bgColor=res.Data.CanvasColor
                     }
                 }else{
                     this.$emit("reportError")
@@ -239,6 +242,10 @@ div{
         }
         .html-wrap{
             // padding: 30px;
+            .report-drag-item-wrap{
+                padding: 6px;
+                margin-bottom: 3px;
+            }
         }
     }
     .report-img-box{