Guoxiaohuan 5 роки тому
батько
коміт
68d0257dd6

+ 12 - 1
src/views/evaluate/dateTemp.vue

@@ -16,10 +16,16 @@ export default {
       pickerVal: new Date()
     };
   },
+  props: ["date"],
   methods: {
     formatter(date) {
       return moment.unix(date / 1000).format("YYYYMMDD");
     },
+    formatterStr2(str) {
+      if (str) {
+        return str.substring(0, 2) + "" + str.substring(3, 5);
+      }
+    },
     pickerChangeLeft() {
       if (this.pickerVal) {
         let dateTime = new Date(this.pickerVal);
@@ -51,7 +57,12 @@ export default {
       this.$emit("pickerVal", this.pickerVal);
     }
   },
-  mounted() {}
+  mounted() {
+    if (this.date) {
+      // this.pickerVal = new Date().getFullYear() + this.formatterStr2(this.date);
+    }
+    console.log(this.pickerVal);
+  }
 };
 </script>
 <style lang="scss">

+ 35 - 32
src/views/evaluate/evIndoorTemperature.vue

@@ -16,43 +16,46 @@ var echarts = require("echarts");
 export default {
   data() {
     return {
-      dataX:[],
-      energyY:[],
-      indoorY:[],
-      strategy1:[],
-      strategy2:[],
-      strategy3:[]
+      dataX: [],
+      energyY: [],
+      indoorY: [],
+      strategy1: [],
+      strategy2: [],
+      strategy3: []
     };
   },
   props: ["energyDataList"],
   mounted() {
-    this.getDrawData()
-    
+    this.getDrawData();
   },
   methods: {
-    getDrawData(){
-      this.energyDataList.forEach(el=>{
-        el.time = el.date.slice(4,6)+":"+el.date.slice(6,8)
-        this.dataX.push(el.time)
-        this.indoorY.push(el.tindoorFillRate?el.tindoorFillRate.toFixed(2):0)
-        this.energyY.push(el.energySavingRate?el.energySavingRate.toFixed(2):0)
-        if(el.chillerExecuteRateReal >= 75){
-          this.strategy1.push(1)
-        }else{
-          this.strategy1.push(null)
+    getDrawData() {
+      this.energyDataList.forEach(el => {
+        el.time = el.date.slice(4, 6) + "." + el.date.slice(6, 8);
+        this.dataX.push(el.time);
+        this.indoorY.push(
+          el.tindoorFillRate ? el.tindoorFillRate.toFixed(2) : 0
+        );
+        this.energyY.push(
+          el.energySavingRate ? el.energySavingRate.toFixed(2) : 0
+        );
+        if (el.chillerExecuteRateReal >= 75) {
+          this.strategy1.push(1);
+        } else {
+          this.strategy1.push(null);
         }
-        if(el.chillerExecuteRate >= 75){
-          this.strategy2.push(1)
-        }else{
-          this.strategy2.push(null)
+        if (el.chillerExecuteRate >= 75) {
+          this.strategy2.push(1);
+        } else {
+          this.strategy2.push(null);
         }
-        if(el.chillerExecuteRateReal < 75 || el.chillerExecuteRate < 75){
-          this.strategy3.push(1)
-        }else{
-          this.strategy3.push(null)
+        if (el.chillerExecuteRateReal < 75 || el.chillerExecuteRate < 75) {
+          this.strategy3.push(1);
+        } else {
+          this.strategy3.push(null);
         }
-      })
-     this.drawIt();
+      });
+      this.drawIt();
     },
     drawIt() {
       let myCharts = echarts.init(document.getElementById("pCharts2"));
@@ -86,7 +89,7 @@ export default {
             axisLabel: {
               interval: 0 //代表显示所有x轴标签显示
             },
-            data: this.dataX,
+            data: this.dataX
           }
         ],
         yAxis: [
@@ -184,17 +187,17 @@ export default {
         if (param.seriesName == "室内温度满足率") {
           this.$router.push({
             path: "/evaluate/evTwoLevelMenu",
-            query: { type: 1 }
+            query: { type: 1, name: param.name }
           });
         } else if (param.seriesName == "节能率") {
           this.$router.push({
             path: "/evaluate/evTwoLevelMenu",
-            query: { type: 2 }
+            query: { type: 2, name: param.name }
           });
         } else {
           this.$router.push({
             path: "/evaluate/evTwoLevelMenu",
-            query: { type: 3 }
+            query: { type: 3, name: param.name }
           });
         }
       });

+ 13 - 5
src/views/evaluate/evTwoLevelMenu.vue

@@ -9,13 +9,14 @@
           <span>单日运行评价</span>
         </div>
         <ul class="MicrYaHei">
+          <div style="min-width:300px;"></div>
           <div>
             <li :class="{current: num == 1}" @click="change(1)">室内温度</li>
             <li :class="{current: num==2}" @click="change(2)">节能率</li>
             <li :class="{current: num==3}" @click="change(3)">执行率</li>
           </div>
           <div class="count-top-right">
-            <date-temp @pickerVal="pickerVal"></date-temp>
+            <date-temp v-if="date" @pickerVal="pickerVal" :date="date"></date-temp>
           </div>
         </ul>
         <div class="count-bottom">
@@ -91,7 +92,8 @@ export default {
       tindoorOverrunDegree: "", //超限程度
       tindoorFillRate: "", //室内温度满足率
       energySavingRate: "", //节能率
-      cardList: []
+      cardList: [],
+      date: ""
     };
   },
   components: {
@@ -108,6 +110,7 @@ export default {
     this.start();
     this.queryRunDataQury();
     this.type = this.$route.query.type;
+    this.date = this.$route.query.name;
     if (this.type == 1) {
       this.num = 1;
     } else if (this.type == 2) {
@@ -146,7 +149,9 @@ export default {
         this.queryimplement();
       }
     },
-    pickerVal(val) {},
+    pickerVal(val) {
+      console.log(val);
+    },
     jumpIndex() {
       this.$router.push("/evaluate");
     },
@@ -210,6 +215,7 @@ export default {
 <style lang="scss" scoped>
 .evTwoContainer {
   background: #fff;
+  min-width: 1000px;
   .count-top {
     width: 100%;
     height: 100%;
@@ -246,14 +252,16 @@ export default {
     ul {
       display: flex;
       padding: 0 16px;
-      width: 60%;
+      // width: 100%;
       justify-content: space-between;
+      white-space: nowrap;
       align-items: center;
       margin: 0;
       text-align: center;
       position: fixed;
+      left: 0;
       right: 0;
-      top: 52px;
+      top: 50px;
       z-index: 1;
       min-width: 810px;
       .count-top-right {

+ 29 - 29
src/views/evaluate/index.vue

@@ -3,8 +3,10 @@
   <div>
     <Head :headText="headText"></Head>
     <div class="nav-right">
-      <el-radio v-model="radio" label="1">近30天</el-radio>
-      <el-radio v-model="radio" label="2" style="margin-right:10px;">自定义</el-radio>
+      <el-radio-group v-model="radio">
+        <el-radio label="1" @change="radioChange">近30天</el-radio>
+        <el-radio label="2" @change="radioChange" style="margin-right:10px;">自定义</el-radio>
+      </el-radio-group>
       <div class="count-top-right">
         <span class="arrow-left" @click="daterangeLeft"></span>
         <span class="arrow-line arrow-line1" @click="daterangeLeft"></span>
@@ -17,7 +19,7 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           :picker-options="pickerOptions"
-          @change="query"
+          @change="query(1)"
         ></el-date-picker>
         <span class="arrow-line" @click="daterangeRight"></span>
         <span class="arrow-right" @click="daterangeRight"></span>
@@ -109,20 +111,15 @@ export default {
             this.pickerMinDate = "";
           }
         },
-        disabledDate: time => {
-          if (this.pickerMinDate !== "") {
-            const day30 = (30 - 1) * 24 * 3600 * 1000;
-            let maxTime = this.pickerMinDate + day30;
-            if (maxTime > new Date()) {
-              maxTime = new Date();
-            }
-            return time.getTime() > maxTime;
-          }
-          return time.getTime() > Date.now();
+        disabledDate(time) {
+          return time.getTime() > Date.now() - 8.64e7;
         }
       },
       date: "2",
-      pickerVal2: [new Date(), new Date()],
+      pickerVal2: [
+        new Date().getTime() - 24 * 60 * 60 * 1000 * 30,
+        new Date().getTime() - 24 * 60 * 60 * 1000
+      ],
       radio: "1",
       tindoorFillRate: "", //室内温度满足率
       energySavingRate: "", //节能率
@@ -142,8 +139,11 @@ export default {
     EvIndoorTemperature
   },
   mounted() {
-    this.query();
-    console.log(this.projects.projects, this.projectId);
+    this.query(0);
+    console.log(timestamp2String(new Date().getTime() - 24 * 60 * 60 * 1000));
+    console.log(
+      timestamp2String(new Date().getTime() - 24 * 60 * 60 * 1000 * 30)
+    );
   },
   computed: {
     ...mapGetters(["projects", "projectId"])
@@ -152,7 +152,19 @@ export default {
     formatter(date) {
       return moment.unix(date / 1000).format("YYYYMMDD");
     },
-    query() {
+    radioChange(val) {
+      if (this.radio == "1") {
+        this.pickerVal2 = [
+          new Date().getTime() - 24 * 60 * 60 * 1000 * 30,
+          new Date().getTime() - 24 * 60 * 60 * 1000
+        ];
+      }
+      this.query(0);
+    },
+    query(type) {
+      if (type == "1") {
+        this.radio = "2";
+      }
       this.runDataQuryArr = [];
       let getParams = {
         begin: timestamp2String(this.pickerVal2[0]).slice(0, 8),
@@ -168,21 +180,9 @@ export default {
           this.allReceivedNum = res.allReceivedNum; //共收到数量
           this.tindoorOverrunDegree = res.tindoorOverrunDegree; //超限程度
           this.energyDataList = res.dataList;
-          console.log(this.energyDataList);
         }
       });
     },
-    // getEnergyDay(){
-    //   let params = {
-    //     getParms:{
-    //       date: timestamp2String(+new Date())
-    //     }
-    //   }
-    //   energyDayQuery(params).then(res=>{
-    //     console.log(res)
-
-    //   })
-    // },
     daterangeLeft() {
       if (this.pickerVal2.length > 0) {
         let dateTime = new Date(this.pickerVal2[0]);