Преглед на файлове

Merge branch 'master' of http://39.106.8.246:3003/sagacloud/sagacloud-cwc-pages

zhulizhen преди 5 години
родител
ревизия
9ed82e7708

+ 35 - 45
src/views/appeal/appealDetail.vue

@@ -9,7 +9,7 @@
       <div class="title Micbold">未执行申诉单</div>
       <div class="nav MicrYaHei">
         <span>项目名称:{{localName}}</span>
-        <span>申请人:{{ applyUser||'--'}}</span>
+        <span>申请人:{{ $store.state.userInfo.username}}</span>
         <span>申请时间:{{dateNow||'--'}}</span>
       </div>
       <div
@@ -32,7 +32,7 @@
               v-for="item in options"
               :key="item.value"
               :label="item.label"
-              :value="item.value"
+              :value="item.label"
             ></el-option>
           </el-select>
         </span>
@@ -79,14 +79,13 @@ export default {
       ],
       value: "",
       detailObj: {},
-      souseArr: ["1576036336333_image.jpg", "1576036135588_image.jpg"],
+      souseArr: [],
       appealId: "",
       commandId: "",
       tableList: [],
       dateNow: "",
       applyUser: "",
-      localName: "",
-      id:""
+      localName: ""
     };
   },
   components: {
@@ -95,33 +94,6 @@ export default {
     UploadImg
   },
   methods: {
-    queryExecute(id) {
-      let params = {
-        postParams: {
-          criteria: {
-            id: id
-          }
-        }
-      };
-      queryChillerExecuteInfo(params).then(res => {
-        console.log(res)
-         this.detailObj = res.data[0]
-         this.dateNow = moment()
-          .locale("zh-cn")
-          .format("YYYY.MM.DD");
-        if (Object.keys(this.detailObj).length > 0) {
-          console.log(this.detailObj);
-          this.quertName(this.detailObj.applyUser);
-          let projects = this.$store.state.projects.projects;
-          projects.forEach(el => {
-            if (this.detailObj.projectId == el.id) {
-              this.localName = el.localName;
-            }
-          });
-        }
-        // console.log(this.appealsArr);
-      });
-    },
     formatterStr(str) {
       if (str) {
         return (
@@ -155,25 +127,32 @@ export default {
         }
       };
       queryChillerExecuteInfo(params).then(res => {
-        console.log(res)
+        const list = res.data || [{}, {}, {}];
+        this.tableList = Object.values(list[0]).map(i => i || {});
+        this.tableList[0].title = "当前运行状态";
+        this.tableList[1].title = "推送策略";
+        this.tableList[2].title = "执行策略";
       });
     },
     submission() {
+      // this.detailObj.applyUser
       let params = {
         postParams: {
           id: this.detailObj.id,
           commit: "apply",
-          updateUser: this.detailObj.applyUser, //申请人
-          applyUser: this.detailObj.applyUser, //申请人
-          judgement:
-            this.detailObj.recommend.evaluateStrategy ||
-            this.detailObj.recommend.remarks ||
-            "", //策略评价
+          updateUser: this.$store.state.userInfo.userId, //申请人
+          applyUser: this.$store.state.userInfo.userId, //申请人
+          // judgement:
+          //   this.detailObj.recommend.evaluateStrategy ||
+          //   this.detailObj.recommend.remarks ||
+          //   "", //策略评价
           reasonType: this.detailObj.reasonType, //申诉原因类型:策略原因;设备原因;其他
-          reason: this.reason, //具体申诉原因
-          pics: this.souseArr
+          reason: this.detailObj.reason, //具体申诉原因
+          pics: this.detailObj.souseArr
         }
       };
+      // console.log(params);
+      // return;
       updateWorkflow(params).then(res => {
         if (res.result == "success") {
           this.$message.success("申诉成功");
@@ -185,10 +164,21 @@ export default {
     }
   },
   mounted() {
-    this.id = this.$route.query.id
-    console.log(this.id)
-    this.queryExecute(this.id)
-   
+    this.detailObj = JSON.parse(this.$route.query.item);
+    this.dateNow = moment()
+      .locale("zh-cn")
+      .format("YYYY.MM.DD");
+    if (Object.keys(this.detailObj).length > 0) {
+      console.log(this.detailObj);
+      // return;
+      this.quertName(this.detailObj.applyUser);
+      let projects = this.$store.state.projects.projects;
+      projects.forEach(el => {
+        if (this.detailObj.projectId == el.id) {
+          this.localName = el.localName;
+        }
+      });
+    }
   }
 };
 </script>

+ 3 - 3
src/views/appeal/index.vue

@@ -159,7 +159,7 @@ export default {
           id: item.id,
           commit: type,
           roles: [1002],
-          updateUser: "594e95e50abc4b6c9bdda985d313c1b9"
+          updateUser: this.$store.state.userInfo.userId
         }
       };
       updateWorkflow(params).then(res => {
@@ -194,10 +194,10 @@ export default {
       }
     },
     menu(item) {
-      console.log(item)
+      console.log(item);
       this.$router.push({
         path: "/appeal/appealDetail",
-        query: {id:item.id }
+        query: { item: JSON.stringify(item) }
       });
     },
     init() {

+ 3 - 1
src/views/evaluate/evEnergySavingRate.vue

@@ -9,7 +9,9 @@ export default {
     return {};
   },
   mounted() {
-    this.pie(this.energySavingRate || 0, "#box3", ["#00D6B9", "#D5F6F2"]);
+    this.$nextTick(function() {
+      this.pie(this.energySavingRate, "#box3", ["#00D6B9", "#D5F6F2"]);
+    });
   },
   props: ["energySavingRate"],
   methods: {

+ 3 - 1
src/views/evaluate/evImplementationRate.vue

@@ -10,7 +10,9 @@ export default {
   },
   props: ["chillerExecuteRate"],
   mounted() {
-    this.pie(this.chillerExecuteRate || 0, "#box2", ["#FFBA6B", "#FEE9D2"]);
+    this.$nextTick(function() {
+      this.pie(this.chillerExecuteRate, "#box2", ["#FFBA6B", "#FEE9D2"]);
+    });
   },
   methods: {
     pie(pieData, box, colors) {

+ 3 - 1
src/views/evaluate/evSatisfactionRate.vue

@@ -10,7 +10,9 @@ export default {
   },
   props: ["tindoorFillRate"],
   mounted() {
-    this.pie(this.tindoorFillRate || 0, "#box1", ["#0091FF", "#E1F2FF"]);
+    this.$nextTick(function() {
+      this.pie(this.tindoorFillRate, "#box1", ["#0091FF", "#E1F2FF"]);
+    });
   },
   methods: {
     pie(pieData, box, colors) {

+ 28 - 8
src/views/evaluate/index.vue

@@ -31,7 +31,7 @@
           <p class="ev-top Micbold">室内温度满足率</p>
           <div class="ev-bottom">
             <div class="ev-bottom-left">
-              <ev-satisfaction-rate :tindoorFillRate="tindoorFillRate"></ev-satisfaction-rate>
+              <ev-satisfaction-rate v-if="tindoorFillRate" :tindoorFillRate="tindoorFillRate"></ev-satisfaction-rate>
             </div>
             <div class="ev-bottom-right MicrYaHei">
               <p>
@@ -51,7 +51,7 @@
           <p class="ev-top">节能率</p>
           <div class="ev-bottom">
             <div class="ev-bottom-left">
-              <ev-energy-saving-rate :energySavingRate="energySavingRate"></ev-energy-saving-rate>
+              <ev-energy-saving-rate v-if="energySavingRate" :energySavingRate="energySavingRate"></ev-energy-saving-rate>
             </div>
             <div class="ev-bottom-right">
               <p>
@@ -66,7 +66,10 @@
           <p class="ev-top">策略执行率</p>
           <div class="ev-bottom">
             <div class="ev-bottom-left">
-              <ev-implementation-rate :chillerExecuteRate="chillerExecuteRate"></ev-implementation-rate>
+              <ev-implementation-rate
+                v-if="chillerExecuteRate"
+                :chillerExecuteRate="chillerExecuteRate"
+              ></ev-implementation-rate>
             </div>
             <div class="ev-bottom-right">
               <p>
@@ -168,13 +171,30 @@ export default {
       };
       runDataQury(null, { getParams }).then(res => {
         if (res.result == "success") {
-          this.tindoorFillRate = res.tindoorFillRate; //室内温度满足率
-          this.energySavingRate = res.energySavingRate; //节能率
-          this.chillerExecuteRate = res.chillerExecuteRate; //略执行率
-          this.energySaving = res.energySaving; //节能量
+          this.tindoorFillRate = res.tindoorFillRate
+            ? res.tindoorFillRate.toFixed(1)
+            : 0; //室内温度满足率
+          console.log("室内温度满足率", this.tindoorFillRate);
+          this.energySavingRate = res.energySavingRate
+            ? res.energySavingRate.toFixed(1)
+            : 0; //节能率
+          console.log("节能率", this.energySavingRate);
+          this.chillerExecuteRate = res.chillerExecuteRate
+            ? res.chillerExecuteRate.toFixed(1)
+            : 0; //略执行率
+          console.log("略执行率", this.chillerExecuteRate);
+          this.energySaving = res.energySaving
+            ? res.energySaving.toFixed(0)
+            : 0; //节能量
+          console.log("节能量", this.energySaving);
           this.isExecutedNum = res.isExecutedNum; //已执行数量
+          console.log("已执行数量", this.isExecutedNum);
           this.allReceivedNum = res.allReceivedNum; //共收到数量
-          this.tindoorOverrunDegree = res.tindoorOverrunDegree; //超限程度
+          console.log("共收到数量", this.allReceivedNum);
+          this.tindoorOverrunDegree = res.tindoorOverrunDegree
+            ? res.tindoorOverrunDegree.toFixed(1)
+            : 0; //超限程度
+          console.log("超限程度", this.tindoorOverrunDegree);
           this.energyDataList = res.dataList;
         }
       });

+ 60 - 48
src/views/strategy/animationBox.vue

@@ -33,7 +33,7 @@
           <i class="innerIcon"></i> 室内平均温度
           <i class="innerMax"></i> 室内最高温度
         </div>
-         <div id="leftLine" style="width:100%;height:350px;margin-right:;24px;"></div>
+        <div id="leftLine" style="width:100%;height:350px;margin-right:;24px;"></div>
       </div>
       <div class="rightL">
         <div class="rightLengend">
@@ -51,7 +51,12 @@
       </div>
     </div>
 
-    <bom-box v-if="Object.keys(chillerCommandQ).length>0" :class="['draw', {'open': showDraw}]" :data="chillerCommandQ" @close="showDraw = false"></bom-box>
+    <bom-box
+      v-if="Object.keys(chillerCommandQ).length>0"
+      :class="['draw', {'open': showDraw}]"
+      :data="chillerCommandQ"
+      @close="showDraw = false"
+    ></bom-box>
   </div>
 </template>
 
@@ -73,7 +78,7 @@ export default {
     };
   },
   components: { bomBox },
-  props: ["data", "chillerHourList",'chillerCommandQ'],
+  props: ["data", "chillerHourList", "chillerCommandQ"],
   methods: {
     getData() {
       this.chillerHourList.forEach(el => {
@@ -83,9 +88,17 @@ export default {
         this.dataY1.push(el.tout);
         this.dataY2.push(el.meanTindoor);
         this.dataY3.push(el.maxTindoor);
-        this.loadY1.push(el.nowPlantLoad?(el.nowPlantLoad=='-9999'?0:el.nowPlantLoad):0);
-        this.loadY2.push(el.predictedLoadUpLimit?el.predictedLoadUpLimit:0);
-        this.loadY3.push(el.redictedLoadDownLimit?el.redictedLoadDownLimit:0);
+        this.loadY1.push(
+          el.nowPlantLoad
+            ? el.nowPlantLoad == "-9999"
+              ? "-9999"
+              : el.nowPlantLoad
+            : 0
+        );
+        this.loadY2.push(el.predictedLoadUpLimit ? el.predictedLoadUpLimit : 0);
+        this.loadY3.push(
+          el.redictedLoadDownLimit ? el.redictedLoadDownLimit : 0
+        );
       });
     },
     drawLeft() {
@@ -94,12 +107,12 @@ export default {
         tooltip: {
           trigger: "axis"
         },
-        title:{
-          text:'室内外温度',
-          fontSize:'16px',
-          color:'#1F2429'
+        title: {
+          text: "室内外温度",
+          fontSize: "16px",
+          color: "#1F2429"
         },
-       
+
         grid: {
           left: "3%",
           right: "4%",
@@ -114,29 +127,29 @@ export default {
         },
         yAxis: {
           type: "value",
-          axisLabel:{formatter:'{value}  ℃'}
+          axisLabel: { formatter: "{value}  ℃" }
         },
         series: [
           {
             name: "室外温度",
             type: "line",
-           
+
             data: this.dataY1,
-            color:'#0091FF'
+            color: "#0091FF"
           },
           {
             name: "室内平均温度",
             type: "line",
-            
+
             data: this.dataY2,
-            color:'#00D6B9'
+            color: "#00D6B9"
           },
           {
             name: "室内最高温度",
             type: "line",
-           
+
             data: this.dataY3,
-            color:'#FFBA6B'
+            color: "#FFBA6B"
           }
         ]
       };
@@ -170,10 +183,10 @@ export default {
           bottom: "3%",
           containLabel: true
         },
-        title:{
-          text:'预测冷量',
-          fontSize:'16px',
-          color:'#1F2429'
+        title: {
+          text: "预测冷量",
+          fontSize: "16px",
+          color: "#1F2429"
         },
         xAxis: {
           type: "category",
@@ -184,7 +197,7 @@ export default {
           splitLine: {
             show: false
           },
-          axisLabel:{formatter:'{value}  KW'}
+          axisLabel: { formatter: "{value}  KW" }
         },
         series: [
           {
@@ -348,50 +361,49 @@ export default {
   .an-bottom {
     margin-top: 45px;
     display: flex;
-    .leftL{
-      flex:1;
-      .leftLengend{
+    .leftL {
+      flex: 1;
+      .leftLengend {
         text-align: center;
         margin-bottom: 10px;
-        i{
+        i {
           display: inline-block;
-          width:16px;
+          width: 16px;
           height: 6px;
-          border-radius:3px;
+          border-radius: 3px;
           vertical-align: middle;
         }
-        .innerIcon{
-          background:rgba(0,214,185,1);
+        .innerIcon {
+          background: rgba(0, 214, 185, 1);
           margin: 0 20px;
         }
-        .outIcon{
-          background:rgba(0,145,255,1);
+        .outIcon {
+          background: rgba(0, 145, 255, 1);
         }
-        .innerMax{
-          background:rgba(255,186,107,1);
+        .innerMax {
+          background: rgba(255, 186, 107, 1);
         }
       }
     }
-    .rightL{
-      flex:1;
-      .rightLengend{
+    .rightL {
+      flex: 1;
+      .rightLengend {
         text-align: center;
         margin-bottom: 10px;
-        i{
+        i {
           display: inline-block;
-          width:16px;
+          width: 16px;
           height: 6px;
-          border-radius:3px;
+          border-radius: 3px;
           vertical-align: middle;
         }
-        .reactCool{
-          background:rgba(0,214,185,1);
-         
+        .reactCool {
+          background: rgba(0, 214, 185, 1);
         }
-        .preCool{
-          background:rgba(0,145,255,1);
-          opacity:0.29;
-          margin-left:20px;
+        .preCool {
+          background: rgba(0, 145, 255, 1);
+          opacity: 0.29;
+          margin-left: 20px;
         }
       }
     }

+ 21 - 15
src/views/strategy/index.vue

@@ -9,7 +9,7 @@
         v-if="chillerIsNotExecutedCount"
       >今日已收到 {{chillerCount}} 条策略,其中有 {{chillerIsNotExecutedCount}} 条未执行</span>
       <span class="nav-text" v-else>今天已收到 {{chillerCommand.chillerCount || 0}} 条策略</span>
-      <span class="nav-look MicrYaHei" @click="showTodayStrategy = true">查看</span>
+      <span class="nav-look MicrYaHei" @click="lookSnapshot">查看</span>
     </div>
     <div class="strategyContainer">
       <div class="strate-left">
@@ -30,12 +30,12 @@
       </div>
       <div class="starte-right">
         <p class="strate-right-title">当前状态</p>
-        <water-unit :data="chillerOrg " :type=1></water-unit>
+        <water-unit :data="chillerOrg " :type="1"></water-unit>
         <animation-box
           v-if="chillerHourList.length>0"
           :data="chillerCommand"
           :chillerHourList="chillerHourList"
-          :chillerCommandQ='chillerCommandQ'
+          :chillerCommandQ="chillerCommandQ"
         ></animation-box>
       </div>
     </div>
@@ -59,15 +59,15 @@ export default {
       showTodayStrategy: false,
       tableData: [],
       chillerCommand: {},
-      chillerCommandQ:{},
-      chillerCount:0,
-      chillerIsNotExecutedCount :0,
+      chillerCommandQ: {},
+      chillerCount: 0,
+      chillerIsNotExecutedCount: 0,
       today: "",
       now: "",
       chillerOrg: {},
-      chillerOrgQ:{},
+      chillerOrgQ: {},
       chillerHourList: [],
-      chillerHourListQ:[],
+      chillerHourListQ: []
     };
   },
   components: {
@@ -77,6 +77,11 @@ export default {
     TodayStrategy
   },
   methods: {
+    lookSnapshot() {
+      this.showTodayStrategy = true;
+      this.getData();
+      console.log(this.$store.state.userId);
+    },
     formatTime() {
       let year = new Date().getFullYear();
       let month =
@@ -116,13 +121,14 @@ export default {
     },
     getChiller() {
       let params = {
-        getParams: {
-        }
+        getParams: {}
       };
       queryCommand(params).then(res => {
-        console.log(res)
-        this.chillerCount = res.chillerCount
-        this.chillerIsNotExecutedCount  = res.chillerIsNotExecutedCount?res.chillerIsNotExecutedCount:0
+        console.log(res);
+        this.chillerCount = res.chillerCount;
+        this.chillerIsNotExecutedCount = res.chillerIsNotExecutedCount
+          ? res.chillerIsNotExecutedCount
+          : 0;
         this.chillerOrg = res.chillerOrg;
         this.chillerCommand = res.chillerCommand;
         this.chillerHourList = res.chillerHourList;
@@ -139,6 +145,7 @@ export default {
       };
       getCommand(params).then(res => {
         this.tableData = res.content ? res.content : [];
+        console.log(this.tableData);
       });
     }
   },
@@ -150,8 +157,7 @@ export default {
     //    vm.getData()
     // },1500)
     this.getQuickData();
-    this.getChiller()
-    this.getData();
+    this.getChiller();
   }
 };
 </script>