Browse Source

fix:周报能耗没设置则不显示

guotianliang 3 years ago
parent
commit
4e2a736dba

+ 1 - 1
src/utils/htmlToPdf.js

@@ -14,7 +14,7 @@ export default{
             html2Canvas(document.querySelector(`#${id}`), {
                 // allowTaint: true
                 useCORS: true,
-                scale: 0.65,
+                scale: 0.64,
                 scrollY: 0,
             }).then(function (canvas) {
                 let contentWidth = canvas.width;

+ 16 - 4
src/views/ReportForm/weekReport/reportDetail.vue

@@ -30,14 +30,14 @@
               </el-table>
               <div class="title_tips big_tips"><i class="el-icon-warning-outline"></i>数据来源:物联网传感器数据监测备份</div>
               <!-- 用户调节 -->
-              <userAdjust :energyDate="surveyTable[6]" :userAdjust="surveyTable[5]" class="mp40"/>
+              <userAdjust :projectId="projectId" :energyDate="surveyTable[6]" :userAdjust="surveyTable[5]" class="mp40"/>
           </section>
           <!-- end 环境概况 -->
           <!-- 3.0.0添加各种参数类型 -->
           <!-- start 本周环境温度概况 -->
           <section class="env_module mb16">
                 <!--可切换参数  -->
-                <Tabs type="card" :data="envTypelist" v-model="envType" class="daytabs"/>
+                <Tabs type="card" :data="envTypelistnow" v-model="envType" class="daytabs"/>
                 <div class="sj_title">本周环境概况</div>
                 <envSurvey :surveyTable="surveyTable[currentEnv]" :envType="envType"></envSurvey>
                 <!-- 根据参数显示内容 -->
@@ -506,13 +506,13 @@
               </el-table>
               <div class="title_tips big_tips"><i class="el-icon-warning-outline"></i>数据来源:物联网传感器数据监测备份</div>
               <!-- 用户调节 -->
-              <userAdjust :energyDate="surveyTable[6]" :userAdjust="surveyTable[5]" class="mp40"/>
+              <userAdjust :projectId="projectId" :energyDate="surveyTable[6]" :userAdjust="surveyTable[5]" class="mp40"/>
           </section>
           <!-- end 环境概况 -->
           <!-- start 本周环境温度概况 -->
           <!-- 循环生成环境参数 -->
 
-          <section class="env_module" :class="'mb'+mbList[index]" v-for="(item,index) in surveyTable" :key="index">
+          <section class="env_module" :class="'mb'+mbList[index]" v-for="(item,index) in surveyTablenow" :key="index">
                 <div class="sj_title">{{item.name}}概况</div>
                 <envSurvey :surveyTable="item" :envType="item.id" :pdf-id="item.id"></envSurvey>
                 <div class="pm_container" v-if="item.id=='PM2d5'&&pdfPmDateShow">
@@ -1963,6 +1963,18 @@ export default {
             }
             return 1
         },
+        envTypelistnow(){
+            if(this.projectId!=="Pj1101080259"){
+                return this.envTypelist.slice(0,6)
+            }
+            return this.envTypelist
+        },
+        surveyTablenow(){
+             if(this.projectId!=="Pj1101080259"){
+                return this.surveyTable.slice(0,6)
+            }
+            return this.surveyTable
+        }
         // slicesurveyTable(){
         //     return this.surveyTable.slice(0,5)
         // }

+ 3 - 2
src/views/ReportForm/weekReport/userAdjust.vue

@@ -19,7 +19,7 @@
                 </div>
             </div>
         </section>
-        <section class="energy_box">
+        <section class="energy_box"  v-if="projectId=='Pj1101080259'">
             <div class="content_title"><span>周总能耗</span></div>
             <div class="content_num">{{energyDate.totalEnergy||'--'}}<span>KWh</span></div>
             <p>环比:<rateSpan :value="energyDate.totalEnergyChainRatio" /></p>
@@ -36,7 +36,8 @@ export default {
         },
         energyDate:{
             type:Object
-        }
+        },
+        projectId:{}
     },
     components:{rateSpan},
     data(){