Browse Source

Merge branch 'fix_smartReport'

jwyu 1 year ago
parent
commit
a519e28dcb

+ 1 - 1
src/views/smartReport/components/ChartComp.vue

@@ -1,7 +1,7 @@
 <template>
     <div 
         class="report-comp-item chart-comp"
-        style="min-height:300px;width:100%;height:100%;overflow: hidden;display:flex;flex-direction: column;margin-bottom:10px"
+        style="width:100%;height:100%;overflow: hidden;display:flex;flex-direction: column;"
     >
         <iframe :src="compData.content" style="flex:1;width:100%;height:100%;border-width:0px;"></iframe>
     </div>

+ 2 - 2
src/views/smartReport/components/ImgComp.vue

@@ -1,9 +1,9 @@
 <template>
     <div 
         class="report-comp-item img-comp" 
-        style="width:100%;height:100%;overflow-y: auto;margin-bottom:10px"
+        style="width:100%;height:100%;overflow-y: auto;"
     >
-        <img style="width:100%" :src="compData.content" alt="">
+        <img style="width:100%;display:block" :src="compData.content" alt="">
     </div>
 </template>
 

+ 1 - 1
src/views/smartReport/components/SheetComp.vue

@@ -1,7 +1,7 @@
 <template>
     <div 
         class="report-comp-item sheet-comp"
-        style="width:100%;overflow: hidden;margin-bottom:10px"
+        style="width:100%;overflow: hidden;"
     >
         <iframe :class="id" :src="compData.content" width="100%" style="border-width:0px;"></iframe>
     </div>

+ 1 - 1
src/views/smartReport/components/TextComp.vue

@@ -1,7 +1,7 @@
 <template>
     <div 
         class="report-comp-item text-comp" 
-        style="width:100%;height: 100%;overflow-y: auto;margin-bottom:10px"
+        style="width:100%;height: 100%;overflow-y: auto;"
     >
         <div class="rich-text-box" v-html="compData.content"></div>
     </div>

+ 79 - 22
src/views/smartReport/editReport.vue

@@ -65,7 +65,11 @@
                         :move="handleParentMove"
                     >
                         <div 
-                            :class="['report-drag-item-wrap',activeId===item.id?'blue-bg':'']" 
+                            :class="[
+                                'report-drag-item-wrap',
+                                activeId===item.id?'blue-bg':'',
+                                item.child&&!item.child.length?'report-drag-item-out':''
+                            ]"
                             v-for="item,index in conList" 
                             :key="item.id"
                             :comp-type="item.compType"
@@ -81,6 +85,7 @@
                             <div 
                                 v-if="item.child&&!item.child.length"
                                 class="report-drag-item-wrap_content"
+                                style="width:100%;height:100%"
                                 :data-id="item.id"
                             >
                                 <component :is="getComponentName(item)" :compData="item"/>
@@ -126,7 +131,7 @@
                     <img src="~@/assets/img/smartReport/icon14.png" alt="">
                 </div>
                 <div style="overflow-x:auto">
-                    <div style="min-width:600px">
+                <div style="min-width:800px">
                 <TextEdit 
                     v-if="rightType==='text'"
                     :key="activeId"
@@ -154,7 +159,7 @@
                 <ETASandBox v-if="rightType==='etaSandBox'"/>
                 <!-- 语义分析 -->
                 <SemanticAnalysis v-if="rightType==='semanticAnalysis'"/>
-                    </div>
+                </div>
                 </div>
             </div>
         </div>
@@ -342,13 +347,28 @@ export default {
         handleResizeP(e,index){
             this.isDragResize=true
             e.preventDefault()
+            const parentBox=e.target.parentNode.parentNode
+            const parentBoxWidth=parentBox.offsetWidth
+
             const targetBox=e.target.parentNode
             const targetBoxHeight=targetBox.offsetHeight
+            const targetBoxWidth=targetBox.offsetWidth
+
             const startY=e.clientY
+            const startX=e.clientX
             document.onmousemove=(mouseEl)=>{
                 mouseEl.preventDefault()
                 const h=mouseEl.clientY-startY+targetBoxHeight
-                targetBox.style.minHeight=`${h<50?50:h}px`
+                // targetBox.style.minHeight=`${h<50?50:h}px`
+                targetBox.style.height=`${h}px`
+
+                // 去除minhight
+                targetBox.style.minHeight=`10px`
+
+                // 计算宽度
+                const w=mouseEl.clientX-startX+targetBoxWidth
+                const resW= (w/parentBoxWidth)*100//计算出的百分比结果值
+                targetBox.style.width=`${resW>=100?100:resW}%`
             }
             document.onmouseup=(el)=>{
                 console.log(targetBox.style.cssText);
@@ -394,7 +414,8 @@ export default {
                 }
                 // console.log('改变的宽度',computerW);
 
-                targetBox.style.height=`${h<50?50:h}px`
+                // targetBox.style.height=`${h<50?50:h}px`
+                targetBox.style.height=`${h}px`
             }   
             document.onmouseup=(el)=>{
                 if(document.onmousemove){
@@ -437,9 +458,9 @@ export default {
             const LINK_CHART_URL = this.$setting.dynamicOutLinks.ChartViewUrl+'/chartshow';
             // console.log(list);
             let arr=[]
-            // 分成个一组
-            for (let index = 0; index < list.length; index+=3) {
-                const temarr=list.slice(index,index+3)
+            // 分成个一组
+            for (let index = 0; index < list.length; index+=2) {
+                const temarr=list.slice(index,index+2)
                 let resArr={child:[]}
                 if(temarr.length===1){//落单了
                     resArr={
@@ -447,6 +468,7 @@ export default {
                         compType:'chart',
                         content:`${LINK_CHART_URL}?code=${temarr[0].UniqueCode}`,
                         id:this.getCompId(`chart${temarr[0].UniqueCode}_`),
+                        style:'height:350px',
                         child:[]
                     }
                 }else{
@@ -456,6 +478,7 @@ export default {
                             compType:'chart',
                             content:`${LINK_CHART_URL}?code=${e.UniqueCode}`,
                             id:this.getCompId(`chart${e.UniqueCode}_`),
+                            style:'height:350px',
                             child:[]
                         })
                     });
@@ -507,6 +530,7 @@ export default {
                 compType:compData.compType,
                 id:this.getCompId(compData.compType),
                 content:compData.content||'',
+                style:compData.compType==='chart'?'height:350px':'',
                 child:[]
             }
             // console.log(tempCompData);
@@ -538,6 +562,7 @@ export default {
                                     compType:obj.compType,
                                     id:obj.id,
                                     content:obj.content,
+                                    style:obj.compType==='chart'?'height:350px':'',
                                     child:[]
                                 },
                                 {
@@ -545,6 +570,7 @@ export default {
                                     compType:compData.compType,
                                     content:compData.content||'',
                                     id:this.getCompId(compData.compType),
+                                    style:compData.compType==='chart'?'height:350px':'',
                                     child:[]
                                 }
                             ]
@@ -567,6 +593,7 @@ export default {
                                         compType:obj.compType,
                                         id:obj.id,
                                         content:obj.content,
+                                        style:obj.compType==='chart'?'height:350px':'',
                                         child:[]
                                     },
                                     {
@@ -967,18 +994,35 @@ export default {
 	},
 }
 </script>
+
+<style lang="scss">
+// 拖拽时的样式
+.edit-smart-report-page{
+.sortable-ghost{
+    position: relative !important;
+    &::before{
+        content: '' !important;
+        display: block !important;
+        width: 100% !important;
+        height: 10px !important;
+        background-color: rgba(64, 158, 255, 0.74) !important;
+        position: absolute !important;
+        left: 0 !important;
+        top: 0 !important;
+    }
+    // height: 5px !important;
+    // background-color: #0052D9 !important;
+    // overflow: hidden !important;
+    // padding: 0 !important;
+    // min-height: 0 !important;
+    // border: none !important;
+}
+}
+</style>
 <style lang='scss' scoped>
 div{
     box-sizing: border-box;
 }
-// .sortable-ghost{
-//     height: 5px !important;
-//     background-color: #0052D9 !important;
-//     overflow: hidden !important;
-//     padding: 0 !important;
-//     min-height: 0 !important;
-//     border: none !important;
-// }
 .edit-smart-report-page{
     background: var(--unnamed, #F2F6FA);
     min-width: 100vw;
@@ -1087,11 +1131,10 @@ div{
         border-radius: 4px;
         border: 1px solid var(--gary-gy-5-line, #C8CDD9);
         background: #FFF;
-        padding: 20px 20px 20px 64px;
+        padding: 20px 20px 20px 44px;
         height: calc(100vh - 180px);
         position: relative;
         overflow-y: auto;
-        
     }
 }
 
@@ -1099,14 +1142,19 @@ div{
 
 .main-wrap{
     .report-html-wrap{
+        &::after{
+            content: '';
+            display: block;
+            height: 300px;
+        }
         min-height: 100%;
         .report-drag-item-wrap{
             width: 100%;
-            padding: 20px;
+            padding: 3px;
             min-height: 80px;
             border: 1px dashed #0052D9;
             position: relative;
-            margin-bottom: 10px;
+            margin-bottom: 3px;
             &:hover{
                 border-style: solid;
                 .opt-btn-box{
@@ -1148,11 +1196,20 @@ div{
                 height: 8px;
                 display: none;
                 border: 1px solid #0052D9;
-                cursor: n-resize;
+                cursor: nw-resize;
+            }
+        }
+        .report-drag-item-out{
+            .report-drag-item-wrap_child-wrap{
+                position: absolute;
+                width: 40px;
+                right: 0;
+                top: 0;
+                height: 100%;
             }
         }
         .report-drag-item-wrap_child-wrap{
-            min-height: 30px;
+            // min-height: 30px;
         }
         .report-drag-item-wrap_child_content{
             min-height: 80px;

+ 7 - 6
src/views/smartReport/reportDetail.vue

@@ -1,13 +1,13 @@
 <template>
     <div class="smart-report-detail">
         <div class="main-box">
-            <div class="top-box">
+            <!-- <div class="top-box">
                 <div class="title">{{reportInfo&&reportInfo.Title}}</div>
                 <div class="flex">
                     <span>{{reportInfo&&reportInfo.Author}}</span>
                     <span>{{reportInfo&&reportInfo.PublishTime}}</span>
                 </div>
-            </div>
+            </div> -->
             <div class="html-wrap" v-html="content"></div>
         </div>
         <div class="right-opt-box" v-if="$route.query.type!=='preview'">
@@ -38,7 +38,7 @@
                     class="qrcode"
                 ></vue-qr>
             </div>
-            <div class="item" @click="handleGetReportImg" v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg">
+            <div class="item" v-if="reportInfo.State == 2" @click="handleGetReportImg" v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg">
                 <img src="~@/assets/img/smartReport/icon16.png" alt="" style="width:30px;height:30px;marginRight:10px;">
                 <span>导&nbsp;&nbsp;图</span>
             </div>
@@ -163,7 +163,7 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
 div{
     box-sizing: border-box;
 }
@@ -195,7 +195,8 @@ div{
     }
     .main-box{
         width: 800px;
-        margin: 0 auto;
+        padding: 20px 20px 20px 44px;
+        margin: 20px auto;
         border: 1px solid var(--gary-gy-5-line, #C8CDD9);
         border-radius: 4px;
         overflow: hidden;
@@ -219,7 +220,7 @@ div{
             }
         }
         .html-wrap{
-            padding: 30px;
+            // padding: 30px;
         }
     }
     .report-img-box{