guoxiaohuan %!s(int64=5) %!d(string=hai) anos
pai
achega
04c8e1cdca

+ 32 - 11
src/utils/query.js

@@ -1,16 +1,37 @@
 function query(search) {
-  let obj = {}
-  const _search = search || location.search.split('?')[1]
-  if (_search) {
-    _search.split('&').forEach(i => {
-      let key = i.split('=')[0]
-      let value = i.split('=')[1]
-      obj[key] = value
-    })
-  }
-  return obj
+    let obj = {}
+    const _search = search || location.search.split('?')[1]
+    if (_search) {
+        _search.split('&').forEach(i => {
+            let key = i.split('=')[0]
+            let value = i.split('=')[1]
+            obj[key] = value
+        })
+    }
+    return obj
+}
+
+function shutDown(num, type, len) {
+    if (num == '-9998') {
+        if (type) {
+            num = 0
+        } else {
+            num = '--'
+        }
+        return num
+    } else if (num == '-9999') {
+        num = 'x'
+        return num
+    } else {
+        if ((num || num === 0) && !type && len) {
+            num = num.toFixed(len)
+        } else {
+            num = '--'
+        }
+        return num
+    }
 }
 
 export {
-  query
+    query, shutDown
 }

+ 10 - 8
src/views/appeal/index.vue

@@ -33,16 +33,16 @@
                                     <div class='advice MicrYaHei'>
                                         <span>策略建议</span>
                                         <span>冷机台数</span>
-                                        <span>{{item.recommend.chillerNumSetL||'--'}}大{{item.recommend.chillerNumSetS||'--'}}小</span>
+                                        <span>{{shutDown(item.recommend.chillerNumSetL,true,null)}}大{{shutDown(item.recommend.chillerNumSetS,true,null)}}小</span>
                                         <span>冷机出水温度</span>
-                                        <span>{{item.recommend.chillWaterOutTempSet||'--'}}°C</span>
+                                        <span>{{shutDown(item.recommend.chillWaterOutTempSet,false,1)}}°C</span>
                                     </div>
                                     <div class='advice'>
                                         <span>实际执行</span>
                                         <span>冷机台数</span>
-                                        <span>{{item.real?item.real.chillerNumSetLOrg:'--'}}大{{item.real?item.real.chillerNumSetSOrg:'--'}}小</span>
+                                        <span>{{shutDown(item.real.chillerNumSetLOrg,true,null)}}大{{shutDown(item.real.chillerNumSetSOrg,true,null)}}小</span>
                                         <span>冷机出水温度</span>
-                                        <span>{{item.real?item.real.chillWaterOutTempSetOrg:'--'}}°C</span>
+                                        <span>{{shutDown(item.real.chillWaterOutTempSetOrg,false,1)}}°C</span>
                                     </div>
                                     <div class='remark'>备注:{{item.remarks||'--'}}</div>
                                     <div class='refuteBox'>
@@ -62,14 +62,14 @@
                     </div>
                     <div class='no-data' v-else>暂无数据</div>
                 </div>
-                <div class='appealBoxCenter' >
+                <div class='appealBoxCenter'>
                     <div class='title'>
                         <span class='Micbold'>审核中</span>
                         <span v-if='InAuditArr.length>0'>{{InAuditArr.length}}</span>
                     </div>
-                    <div class='center' v-if='InAuditArr.length>0' >
+                    <div class='center' v-if='InAuditArr.length>0'>
                         <div class='card' v-for='(item,index) in InAuditArr' :key='index' @click='menus(item,2)'>
-                            <div class='time' >
+                            <div class='time'>
                                 <span class='time-box'>
                                     <span>{{item.pushTime?formatter(item.pushTime):'--'}}</span>
                                     <span>{{item.title||'--'}}</span>
@@ -133,6 +133,7 @@ import Head from '../main/index'
 import { queryWorkflow, queryChillerExecuteInfo, querySimpleInfo } from '@/api/appeal/appeal.js'
 import EvSnapshotsDialog from '../evaluate/evSnapshotsDialog'
 import { updateWorkflow } from '@/api/audit/audit.js'
+import { shutDown } from '@/utils/query.js'
 
 var moment = require('moment')
 import 'moment/locale/zh-cn'
@@ -156,7 +157,8 @@ export default {
             day: '',
             day1: '',
             yesterday: '',
-            today: ''
+            today: '',
+            shutDown: shutDown
         }
     },
     components: {

+ 17 - 20
src/views/audit/auditTable.vue

@@ -3,54 +3,51 @@
         <el-table :data='tableList' border>
             <el-table-column prop='title' label width='95'></el-table-column>
             <el-table-column prop label='冷机开启台数' align='center' width>
-                <template
-                    slot-scope='{row}'
-                >{{row.chillerNumSetLOrg!=undefined?row.chillerNumSetLOrg : '--'}} 大 {{row.chillerNumSetSOrg!=undefined?row.chillerNumSetSOrg : '--'}} 小</template>
+                <template slot-scope='{row}'>{{shutDown(row.chillerNumSetLOrg,true,null)}} 大 {{shutDown(row.chillerNumSetSOrg,true,null)}} 小</template>
             </el-table-column>
             <el-table-column prop label='冷机出水温度' align='center' width>
-                <template slot-scope='{row}'>{{row.chillWaterOutTempSetOrg?(row.chillWaterOutTempSetOrg ).toFixed(1): '--'}} ℃</template>
+                <template slot-scope='{row}'>{{shutDown(row.chillWaterOutTempSetOrg,false,1)}} ℃</template>
             </el-table-column>
             <el-table-column prop label='冷冻泵台数' align='center' width>
-                <template
-                    slot-scope='{row}'
-                >{{row.coolPumpNumSetLOrg!=undefined?row.coolPumpNumSetLOrg : '--'}} 大 {{row.coolPumpNumSetSOrg !=undefined?row.coolPumpNumSetSOrg : '--'}} 小</template>
+                <template slot-scope='{row}'>{{shutDown(row.coolPumpNumSetLOrg,true,null)}} 大 {{shutDown(row.coolPumpNumSetSOrg,true,null)}} 小</template>
             </el-table-column>
             <el-table-column prop label='冷冻泵频率' align='center' width>
-                <template slot-scope='{row}'>{{row.coolPumpFreqSetOrg?row.coolPumpFreqSetOrg.toFixed(0): '--'}} HZ</template>
+                <template slot-scope='{row}'>{{shutDown(row.coolPumpFreqSetOrg,false,0)}} HZ</template>
             </el-table-column>
             <el-table-column prop label='冷却泵台数' align='center' width>
-                <template
-                    slot-scope='{row}'
-                >{{row.chillPumpNumSetLOrg!=undefined?row.chillPumpNumSetLOrg : '--' }}大{{row.chillPumpNumSetSOrg !=undefined?row.chillPumpNumSetSOrg : '--'}}小</template>
+                <template slot-scope='{row}'>{{shutDown(row.chillPumpNumSetLOrg,true,null)}}大{{shutDown(row.chillPumpNumSetSOrg,true,null)}}小</template>
             </el-table-column>
             <el-table-column prop label='冷却泵频率' align='center' width>
-                <template slot-scope='{row}'>{{row.chillPumpFreqSetOrg ?(row.chillPumpFreqSetOrg.toFixed(0)):'--'}} HZ</template>
+                <template slot-scope='{row}'>{{shutDown(row.chillPumpFreqSetOrg,false,0)}} HZ</template>
             </el-table-column>
             <el-table-column prop label='冷却塔台数' align='center' width>
-                <template
-                    slot-scope='{row}'
-                >{{row.coolTowerNumSetSOrg !=undefined?row.coolTowerNumSetSOrg : '--'}}大{{row.coolTowerNumSetLOrg!=undefined?row.coolTowerNumSetLOrg : '--'}}小</template>
+                <template slot-scope='{row}'>{{shutDown(row.coolTowerNumSetSOrg,true,null)}}大{{shutDown(row.coolTowerNumSetLOrg,true,null)}}小</template>
             </el-table-column>
             <el-table-column prop='zip' label='冷却塔频率' align='center' width>
-                <template slot-scope='{row}'>{{row.coolTowerFreqSetOrg?(row.coolTowerFreqSetOrg).toFixed(0) : '--'}} HZ</template>
+                <template slot-scope='{row}'>{{shutDown(row.coolTowerFreqSetOrg,false,0)}} HZ</template>
             </el-table-column>
             <el-table-column prop label='室内平均温度' align='center' width>
-                <template slot-scope='{row}'>{{row.meanTindoor?(row.meanTindoor).toFixed(1): '--'}} ℃</template>
+                <template slot-scope='{row}'>{{row.meanTindoor}}</template>
+                <template slot-scope='{row}'>{{shutDown(row.meanTindoor,false,1)}} ℃</template>
             </el-table-column>
             <el-table-column prop label='室内最高温度' align='center' width>
-                <template slot-scope='{row}'>{{row.maxTindoor?(row.maxTindoor).toFixed(1): '--'}} ℃</template>
+                <template slot-scope='{row}'>{{shutDown(row.maxTindoor,false,1)}} ℃</template>
             </el-table-column>
             <el-table-column prop label='冷机负载率' align='center' width>
-                <template slot-scope='{row}'>{{row.plrAllOrg||'--'}} HZ</template>
+                <template slot-scope='{row}'>{{shutDown(row.plrAllOrg,false,0)}} HZ</template>
             </el-table-column>
         </el-table>
     </div>
 </template>
 
 <script>
+import { shutDown } from '@/utils/query.js'
+
 export default {
     data() {
-        return {}
+        return {
+            shutDown: shutDown
+        }
     },
     props: ['tableList'],
     mounted() {

+ 10 - 7
src/views/evaluate/evCard.vue

@@ -6,15 +6,15 @@
                 <span>策略建议</span>
                 <span>冷机台数</span>
                 <span>
-                    <b style='width:50px;display: inline-block;text-align: center;'>{{item.recommend?item.recommend.chillerNumSetL:'--'}}</b>
+                    <b style='width:50px;display: inline-block;text-align: center;'>{{shutDown(item.recommend.chillerNumSetL,true,null)}}</b>
                     <b
                         style='width:50px;display: inline-block;text-align: center;'
-                    >{{item.recommend?item.recommend.chillerNumSetS:'--'}}</b>小
+                    >{{shutDown(item.recommend.chillerNumSetS,true,null)}}</b>小
                 </span>
                 <span>冷机出水温度</span>
                 <span>
-                    <b style='width:50px;display: inline-block;text-align: center;'>{{item.recommend?item.recommend.chillWaterOutTempSet:'--'}}</b> °C
+                    <b style='width:50px;display: inline-block;text-align: center;'>{{shutDown(item.recommend.chillWaterOutTempSet,false,1)}}</b> °C
                 </span>
             </div>
             <div class='card-div3 MicrYaHei'>
@@ -24,18 +24,18 @@
                     <b
                         style='width:50px;display: inline-block;text-align: center;'
                         :class='item.recommend.chillerNumSetL==item.real.chillerNumSetLOrg?"":"red"'
-                    >{{item.real?item.real.chillerNumSetLOrg:'--'}}</b>大
+                    >{{shutDown(item.real.chillerNumSetLOrg,true,null)}}</b>大
                     <b
                         style='width:50px;display: inline-block;text-align: center;'
                         :class='item.recommend.chillerNumSetS==item.real.chillerNumSetSOrg?"":"red"'
-                    >{{item.real?item.real.chillerNumSetSOrg:'--'}}</b> 小
+                    >{{shutDown(item.real.chillerNumSetSOrg,true,null)}}</b> 小
                 </span>
                 <span>冷机出水温度</span>
                 <span>
                     <b
                         style='width:50px;display: inline-block;text-align: center;'
                         :class='item.recommend.chillWaterOutTempSet==item.real.chillWaterOutTempSetOrg?"":"red"'
-                    >{{item.real?item.real.chillWaterOutTempSetOrg:'--'}}</b>°C
+                    >{{shutDown(item.real.chillWaterOutTempSetOrg,false,1)}}</b>°C
                 </span>
             </div>
 
@@ -70,13 +70,16 @@
 <script>
 import EvSnapshotsDialog from './evSnapshotsDialog'
 import { queryWorkflow } from '@/api/appeal/appeal.js'
+import { shutDown } from '@/utils/query.js'
+
 export default {
     data() {
         return {
             viewSnapshots: false,
             ids: [],
             titles: [],
-            time: ''
+            time: '',
+            shutDown: shutDown
         }
     },
     props: ['cardList', 'date'],

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 690 - 696
src/views/evaluate/evSnapshotsDialog.vue


+ 9 - 6
src/views/strategy/animationBox.vue

@@ -21,9 +21,9 @@
             </div>
             <div class='snapshotss-cont2-box2 MicrYaHei'>
                 <span>实际冷量</span>
-                <span>{{data.nowPlantLoad?parseInt(data.nowPlantLoad):'--'}} kW</span>
+                <span>{{shutDown(parseInt(data.nowPlantLoad),false,0)}} kW</span>
                 <span>未来1小时预测冷量</span>
-                <span>{{data.predictedLoad1h?parseInt(data.predictedLoad1h):'--'}} kW</span>
+                <span>{{shutDown(parseInt(data.predictedLoad1h),false,0)}} kW</span>
             </div>
         </div>
         <div class='an-bottom'>
@@ -44,7 +44,7 @@
             </div>
         </div>
 
-        <div class='side-r' :class='data.isExecuted==true?"green":"red"' v-if="data.isExecuted">
+        <div class='side-r' :class='data.isExecuted==true?"green":"red"' v-if='data.isExecuted'>
             <div v-if='!showDraw' class='float-r' @click='showDraw = true'>
                 <div class='float-line' :class='data.isExecuted==true?"green":"red"'></div>
                 <img src='../../assets/open.png' alt />
@@ -59,6 +59,8 @@
 <script>
 import echarts from 'echarts'
 import bomBox from './bomBox'
+import { shutDown } from '@/utils/query.js'
+
 export default {
     data() {
         return {
@@ -71,15 +73,16 @@ export default {
             loadY1: [],
             loadY2: [],
             loadY3: [],
-            dataY1Min:'',
-            dataY1Max:''
+            dataY1Min: '',
+            dataY1Max: '',
+            shutDown: shutDown
         }
     },
     components: { bomBox },
     props: ['data', 'chillerHourList', 'chillerCommandQ'],
     watch: {
         chillerHourList(newVal, oldVal) {
-            if(newVal) {
+            if (newVal) {
                 this.getData()
                 this.drawLeft()
                 this.drawRight()

+ 6 - 4
src/views/strategy/bomBox.vue

@@ -35,9 +35,9 @@
                 </div>
                 <div class='snapshotss-cont2-box2 MicrYaHei'>
                     <span>实际冷量</span>
-                    <span>{{data.nowPlantLoad?parseInt(data.nowPlantLoad):'--'}} kW</span>
+                    <span>{{shutDown(parseInt(data.nowPlantLoad),false,0)}} kW</span>
                     <span>未来1小时预测冷量</span>
-                    <span>{{data.predictedLoad1h?parseInt(data.predictedLoad1h):'--'}} kW</span>
+                    <span>{{shutDown(parseInt(data.predictedLoad1h),false,0)}} kW</span>
                 </div>
             </div>
             <div class='bomb-right-bottom'>
@@ -52,9 +52,12 @@ import echarts from 'echarts'
 import waterUnit from './waterUnit'
 import { updateCommand } from '@/api/strategy/strategy.js'
 import { timestamp2String } from '@/utils/helper.js'
+import { shutDown } from '@/utils/query.js'
+
 export default {
     data() {
         return {
+            shutDown: shutDown,
             timestamp2String,
             circle1: 0,
             circle2: 0,
@@ -136,7 +139,7 @@ export default {
     border-left: 8px solid #fff;
     position: relative;
     border-radius: 8px 0 0 8px;
-    box-shadow: 0 2px 10px 0 rgba(44,48,62,.16);
+    box-shadow: 0 2px 10px 0 rgba(44, 48, 62, 0.16);
     .bomb-line {
         position: absolute;
         top: 0;
@@ -249,7 +252,6 @@ export default {
             }
         }
         .bomb-right-bottom {
-           
         }
     }
 }

+ 202 - 223
src/views/strategy/index.vue

@@ -1,247 +1,226 @@
 
 <template>
-  <div>
-    <Head :headText="headText"></Head>
-    <div class="nav-right">
-      <img class="nav-icon" v-if="chillerIsNotExecutedCount " src="@/assets/shape.png" alt />
-      <span
-        class="nav-text1"
-        v-if="chillerIsNotExecutedCount"
-      >今日已收到 {{chillerCount}} 条策略,其中有 {{chillerIsNotExecutedCount}} 条未执行</span>
-      <span class="nav-text" v-else>今天已收到 {{chillerCommand.chillerCount || 0}} 条策略</span>
-      <span class="nav-look MicrYaHei" @click="lookSnapshot">查看</span>
-    </div>
-    <div class="strategyContainer">
-      <div class="strate-left">
-        <div class="strate-left-1">今天营业时间</div>
-        <div
-          class="strate-left-2"
-        >{{chillerCommand.openTime?( chillerCommand.openTime.slice(0,2)+':'+chillerCommand.openTime.slice(2,4)):"--"}} - {{chillerCommand.endTime?(chillerCommand.endTime.slice(0,2)+':'+chillerCommand.endTime.slice(2,4)):"--"}}</div>
-        <div class="strate-left-1">当前运行模式</div>
-        <div class="strate-left-2">{{chillerCommand.model || '--'}}</div>
-        <div class="strate-left-box">
-          <div class="strate-left-info-1">通风策略</div>
-          <div
-            class="strate-left-info"
-          >开启时间:{{chillerCommand.freshAirEqOpenTime?(chillerCommand.freshAirEqOpenTime.slice(0,2)+":"+chillerCommand.freshAirEqOpenTime.slice(2,4)):"--"}} - {{chillerCommand.freshAirEqCloseTime?(chillerCommand.freshAirEqCloseTime.slice(0,2)+":"+chillerCommand.freshAirEqCloseTime.slice(2,4)):"--"}}</div>
-          <div class="strate-left-info">新风机组:{{chillerCommand.freshAirHandlingUnit}}</div>
-          <div class="strate-left-info">组合式空调机组:{{chillerCommand.airHandlingUnit}}</div>
+    <div>
+        <Head :headText='headText'></Head>
+        <div class='nav-right'>
+            <img class='nav-icon' v-if='chillerIsNotExecutedCount ' src='@/assets/shape.png' alt />
+            <span class='nav-text1' v-if='chillerIsNotExecutedCount'>今日已收到 {{chillerCount}} 条策略,其中有 {{chillerIsNotExecutedCount}} 条未执行</span>
+            <span class='nav-text' v-else>今天已收到 {{chillerCommand.chillerCount || 0}} 条策略</span>
+            <span class='nav-look MicrYaHei' @click='lookSnapshot'>查看</span>
+        </div>
+        <div class='strategyContainer'>
+            <div class='strate-left'>
+                <div class='strate-left-1'>今天营业时间</div>
+                <div
+                    class='strate-left-2'
+                >{{chillerCommand.openTime?( chillerCommand.openTime.slice(0,2)+':'+chillerCommand.openTime.slice(2,4)):"--"}} - {{chillerCommand.endTime?(chillerCommand.endTime.slice(0,2)+':'+chillerCommand.endTime.slice(2,4)):"--"}}</div>
+                <div class='strate-left-1'>当前运行模式</div>
+                <div class='strate-left-2'>{{chillerCommand.model || '--'}}</div>
+                <div class='strate-left-box'>
+                    <div class='strate-left-info-1'>通风策略</div>
+                    <div
+                        class='strate-left-info'
+                    >开启时间:{{chillerCommand.freshAirEqOpenTime?(chillerCommand.freshAirEqOpenTime.slice(0,2)+":"+chillerCommand.freshAirEqOpenTime.slice(2,4)):"--"}} - {{chillerCommand.freshAirEqCloseTime?(chillerCommand.freshAirEqCloseTime.slice(0,2)+":"+chillerCommand.freshAirEqCloseTime.slice(2,4)):"--"}}</div>
+                    <div class='strate-left-info'>新风机组:{{chillerCommand.freshAirHandlingUnit}}</div>
+                    <div class='strate-left-info'>组合式空调机组:{{chillerCommand.airHandlingUnit}}</div>
+                </div>
+            </div>
+            <div class='starte-right'>
+                <p class='strate-right-title'>当前状态</p>
+                <water-unit :data='chillerOrg ' :type='1'></water-unit>
+                <animation-box :data='chillerCommand' :chillerHourList='chillerHourList' :chillerCommandQ='chillerCommand'></animation-box>
+            </div>
         </div>
-      </div>
-      <div class="starte-right">
-        <p class="strate-right-title">当前状态</p>
-        <water-unit :data="chillerOrg " :type="1"></water-unit>
-        <animation-box
-          :data="chillerCommand"
-          :chillerHourList="chillerHourList"
-          :chillerCommandQ="chillerCommand"
-        ></animation-box>
-       
-      </div>
+        <el-dialog title='提示' :visible.sync='showTodayStrategy' width='1260px'>
+            <today-strategy v-if='tableData.length>0 && idArr.length>0' :data='tableData' :idArr='idArr'></today-strategy>
+        </el-dialog>
     </div>
-    <el-dialog title="提示" :visible.sync="showTodayStrategy" width="1260px">
-      <today-strategy v-if="tableData.length>0 && idArr.length>0" :data="tableData" :idArr="idArr"></today-strategy>
-    </el-dialog>
-  </div>
 </template>
 
 <script>
-import Head from "../main/index";
-import animationBox from "./animationBox";
-import waterUnit from "./waterUnit";
-import TodayStrategy from "@/components/todayStrategy.vue";
-import { queryCommand, getCommand } from "@/api/strategy/strategy.js";
+import Head from '../main/index'
+import animationBox from './animationBox'
+import waterUnit from './waterUnit'
+import TodayStrategy from '@/components/todayStrategy.vue'
+import { queryCommand, getCommand } from '@/api/strategy/strategy.js'
 export default {
-  data() {
-    return {
-      headText: "当日运行策略",
-      navText: true,
-      showTodayStrategy: false,
-      tableData: [],
-      chillerCommand: {},
-      chillerCount: 0,
-      chillerIsNotExecutedCount: 0,
-      today: "",
-      now: "",
-      chillerOrg: {},
-      chillerHourList: [],
-      idArr: []
-    };
-  },
-  components: {
-    Head,
-    animationBox,
-    waterUnit,
-    TodayStrategy
-  },
-  methods: {
-    lookSnapshot() {
-      this.showTodayStrategy = true;
-      this.getData();
-      // console.log(this.$store.state);
-    },
-    formatTime() {
-      let year = new Date().getFullYear();
-      let month =
-        new Date().getMonth() + 1 > 10
-          ? new Date().getMonth() + 1
-          : "0" + (new Date().getMonth() + 1);
-      let date =
-        new Date().getDate() > 10
-          ? new Date().getDate()
-          : "0" + new Date().getDate();
-      return (this.today = year + "" + month + "" + date);
-    },
-    getPer5Time() {
-      let now = new Date().getTime();
-      let datetime = now - 5 * 60 * 1000;
-      let hours =
-        new Date(datetime).getHours() < 10
-          ? "0" + new Date(datetime).getHours()
-          : new Date(datetime).getHours();
-      let minute =
-        new Date(datetime).getMinutes() < 10
-          ? "0" + new Date(datetime).getMinutes()
-          : new Date(datetime).getMinutes();
-      return (this.now = hours + "" + minute);
+    data() {
+        return {
+            headText: '当日运行策略',
+            navText: true,
+            showTodayStrategy: false,
+            tableData: [],
+            chillerCommand: {},
+            chillerCount: 0,
+            chillerIsNotExecutedCount: 0,
+            today: '',
+            now: '',
+            chillerOrg: {},
+            chillerHourList: [],
+            idArr: []
+        }
     },
-    getChiller() {
-      let params = {
-        getParams: {}
-      };
-      queryCommand(params).then(res => {
-        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;
-      });
+    components: {
+        Head,
+        animationBox,
+        waterUnit,
+        TodayStrategy
     },
-    getData() {
-      this.idArr = [];
-      let params = {
-        postParams: {
-          criteria: {
-            projectId: this.$store.state.projectId,
-            date: this.today
-          }
-        }
-      };
-      console.log(this.$store.state.userInfo.userId);
-      // return
-      getCommand(params).then(res => {
-        this.tableData = res.content ? res.content : [];
-        if (this.tableData.length > 0) {
-          this.tableData.forEach(el => {
-            this.idArr.push(el.appealId);
-          });
+    methods: {
+        lookSnapshot() {
+            this.showTodayStrategy = true
+            this.getData()
+            // console.log(this.$store.state);
+        },
+        formatTime() {
+            let year = new Date().getFullYear()
+            let month = new Date().getMonth() + 1 > 10 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1)
+            let date = new Date().getDate() > 10 ? new Date().getDate() : '0' + new Date().getDate()
+            return (this.today = year + '' + month + '' + date)
+        },
+        getPer5Time() {
+            let now = new Date().getTime()
+            let datetime = now - 5 * 60 * 1000
+            let hours = new Date(datetime).getHours() < 10 ? '0' + new Date(datetime).getHours() : new Date(datetime).getHours()
+            let minute = new Date(datetime).getMinutes() < 10 ? '0' + new Date(datetime).getMinutes() : new Date(datetime).getMinutes()
+            return (this.now = hours + '' + minute)
+        },
+        getChiller() {
+            let params = {
+                getParams: {}
+            }
+            queryCommand(params).then(res => {
+                console.log(res)
+                this.chillerCount = res.chillerCount || 0
+                this.chillerIsNotExecutedCount = res.chillerIsNotExecutedCount ? res.chillerIsNotExecutedCount : 0
+                this.chillerOrg = res.chillerOrg
+                this.chillerCommand = res.chillerCommand || {}
+                console.log(this.chillerCommand)
+                this.chillerHourList = res.chillerHourList
+            })
+        },
+        getData() {
+            this.idArr = []
+            let params = {
+                postParams: {
+                    criteria: {
+                        projectId: this.$store.state.projectId,
+                        date: this.today
+                    }
+                }
+            }
+            console.log(this.$store.state.userInfo.userId)
+            // return
+            getCommand(params).then(res => {
+                this.tableData = res.content ? res.content : []
+                if (this.tableData.length > 0) {
+                    this.tableData.forEach(el => {
+                        this.idArr.push(el.appealId)
+                    })
+                }
+                console.log(this.tableData)
+            })
         }
-        console.log(this.tableData);
-      });
+    },
+    mounted() {
+        this.formatTime()
+        this.getPer5Time()
+        // let vm = this
+        // setInterval(function(){
+        //    vm.getData()
+        // },1500)
+        // this.getQuickData();
+        this.getChiller()
     }
-  },
-  mounted() {
-    this.formatTime();
-    this.getPer5Time();
-    // let vm = this
-    // setInterval(function(){
-    //    vm.getData()
-    // },1500)
-    // this.getQuickData();
-    this.getChiller();
-  }
-};
+}
 </script>
 
 <style lang="scss" scoped>
 .nav-right {
-  height: 48px;
-  position: fixed;
-  right: 24px;
-  top: 48px;
-  z-index: 1;
-  display: flex;
-  align-items: center;
-  .nav-text {
-    height: 22px;
-    font-size: 14px;
-    font-family: PingFangSC-Regular, PingFang SC;
-    font-weight: 400;
-    color: rgba(31, 36, 41, 1);
-    line-height: 20px;
-  }
-  .nav-text1 {
-    margin: 0 4px;
-    height: 20px;
-    font-size: 14px;
-    font-family: PingFangSC-Regular, PingFang SC;
-    font-weight: 400;
-    color: rgba(245, 78, 69, 1);
-    line-height: 20px;
-  }
-  .nav-icon {
-    width: 16px;
-    height: 14px;
-  }
-  .nav-look {
-    height: 22px;
-    font-size: 14px;
-    color: rgba(0, 145, 255, 1);
-    line-height: 22px;
-    margin: 0 12px;
-    cursor: pointer;
-  }
+    height: 48px;
+    position: fixed;
+    right: 24px;
+    top: 48px;
+    z-index: 1;
+    display: flex;
+    align-items: center;
+    .nav-text {
+        height: 22px;
+        font-size: 14px;
+        font-family: PingFangSC-Regular, PingFang SC;
+        font-weight: 400;
+        color: rgba(31, 36, 41, 1);
+        line-height: 20px;
+    }
+    .nav-text1 {
+        margin: 0 4px;
+        height: 20px;
+        font-size: 14px;
+        font-family: PingFangSC-Regular, PingFang SC;
+        font-weight: 400;
+        color: rgba(245, 78, 69, 1);
+        line-height: 20px;
+    }
+    .nav-icon {
+        width: 16px;
+        height: 14px;
+    }
+    .nav-look {
+        height: 22px;
+        font-size: 14px;
+        color: rgba(0, 145, 255, 1);
+        line-height: 22px;
+        margin: 0 12px;
+        cursor: pointer;
+    }
 }
 
 .strategyContainer {
-  background: #fff;
-  display: flex;
-  .strate-left {
-    min-width: 224px;
     background: #fff;
-    border-right: 1px solid #f7f9fa;
-    margin-left: 16px;
-    .strate-left-1 {
-      margin-top: 24px;
-      color: #646c73;
-      font-size: 14px;
-    }
-    .strate-left-2 {
-      margin-top: 8px;
-      font-size: 20px;
-    }
-    .strate-left-box {
-      width: 192px;
-      height: 150px;
-      border-radius: 6px;
-      background: #e4e5e7;
-      margin-top: 67px;
-      .strate-left-info-1 {
-        padding-top: 20px;
-        padding-left: 20px;
-        font-size: 16px;
-        color: #1f2429;
-      }
-      .strate-left-info {
-        padding-left: 20px;
-        font-size: 14px;
-        margin-top: 8px;
-        color: #646c73;
-      }
+    display: flex;
+    .strate-left {
+        min-width: 224px;
+        background: #fff;
+        border-right: 1px solid #f7f9fa;
+        margin-left: 16px;
+        .strate-left-1 {
+            margin-top: 24px;
+            color: #646c73;
+            font-size: 14px;
+        }
+        .strate-left-2 {
+            margin-top: 8px;
+            font-size: 20px;
+        }
+        .strate-left-box {
+            width: 192px;
+            height: 150px;
+            border-radius: 6px;
+            background: #e4e5e7;
+            margin-top: 67px;
+            .strate-left-info-1 {
+                padding-top: 20px;
+                padding-left: 20px;
+                font-size: 16px;
+                color: #1f2429;
+            }
+            .strate-left-info {
+                padding-left: 20px;
+                font-size: 14px;
+                margin-top: 8px;
+                color: #646c73;
+            }
+        }
     }
-  }
-  .starte-right {
-    margin-right: 30px;
-    flex: 1;
-    .starte-right-title {
-      height: 74px;
-      line-height: 74px;
-      color: #1f2429;
-      font-size: 22px;
+    .starte-right {
+        margin-right: 30px;
+        flex: 1;
+        .starte-right-title {
+            height: 74px;
+            line-height: 74px;
+            color: #1f2429;
+            font-size: 22px;
+        }
     }
-  }
 }
 </style>

+ 93 - 90
src/views/strategy/waterUnit.vue

@@ -1,116 +1,119 @@
 <template>
-       <div class="water-unit">
-          <div class="strate-right-box-1"  :class='type==2?"content1":""'>
-            <div class="starte-right-box-1-title" :class='type==2?"title1":""'>冷水机组</div>
-            <div class="starte-right-box-1-content1">
-              <p>{{data.chillerNumSetL || 0}}</p>
-              <p>{{data.chillerNumSetS || 0}}</p>
-              <p>{{data.chillWaterOutTempSet?data.chillWaterOutTempSet.toFixed(1):'--'}} ℃</p>
+    <div class='water-unit'>
+        <div class='strate-right-box-1' :class='type==2?"content1":""'>
+            <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷水机组</div>
+            <div class='starte-right-box-1-content1'>
+                <p>{{shutDown(data.chillerNumSetL,true,null)}}</p>
+                <p>{{shutDown(data.chillerNumSetS,true,null)}}</p>
+                <p>{{shutDown(data.chillWaterOutTempSet,false,1)}} ℃</p>
             </div>
-             <div class="starte-right-box-1-content">
-              <p>大</p>
-              <p>小</p>
-              <p>温度</p>
+            <div class='starte-right-box-1-content'>
+                <p>大</p>
+                <p>小</p>
+                <p>温度</p>
             </div>
-          </div>
-           <div class="strate-right-box-1"  :class='type==2?"content1":""'>
-            <div class="starte-right-box-1-title" :class='type==2?"title1":""'>冷冻水泵</div>
-            <div class="starte-right-box-1-content1" >
-              <p>{{data.coolPumpNumSetL || 0}}</p>
-              <p>{{data.coolPumpNumSetS || 0}}</p>
-              <p>{{data.coolPumpFreqSet?data.coolPumpFreqSet.toFixed(0):'--'}} HZ</p>
+        </div>
+        <div class='strate-right-box-1' :class='type==2?"content1":""'>
+            <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷冻水泵</div>
+            <div class='starte-right-box-1-content1'>
+                <p>{{shutDown(data.coolPumpNumSetL,true,null)}}</p>
+                <p>{{shutDown(data.coolPumpNumSetS,true,null)}}</p>
+                <p>{{shutDown(data.coolPumpFreqSet,false,0)}} HZ</p>
             </div>
-             <div class="starte-right-box-1-content">
-              <p>大</p>
-              <p>小</p>
-              <p>设定频率</p>
+            <div class='starte-right-box-1-content'>
+                <p>大</p>
+                <p>小</p>
+                <p>设定频率</p>
             </div>
-          </div>
-           <div class="strate-right-box-1"  :class='type==2?"content1":""'>
-            <div class="starte-right-box-1-title" :class='type==2?"title1":""'>冷却水泵</div>
-            <div class="starte-right-box-1-content1">
-              <p>{{data.chillPumpNumSetL || 0}}</p>
-              <p>{{data.chillPumpNumSetS || 0}}</p>
-              <p>{{data.chillPumpFreqSet?data.chillPumpFreqSet.toFixed(0):'--'}} HZ</p>
+        </div>
+        <div class='strate-right-box-1' :class='type==2?"content1":""'>
+            <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷却水泵</div>
+            <div class='starte-right-box-1-content1'>
+                <p>{{shutDown(data.chillPumpNumSetL,true,null)}}</p>
+                <p>{{shutDown(data.chillPumpNumSetS,true,null)}}</p>
+                <p>{{shutDown(data.chillPumpFreqSet,false,0)}} HZ</p>
             </div>
-             <div class="starte-right-box-1-content">
-              <p>大</p>
-              <p>小</p>
-              <p>设定频率</p>
+            <div class='starte-right-box-1-content'>
+                <p>大</p>
+                <p>小</p>
+                <p>设定频率</p>
             </div>
-          </div>
-           <div class="strate-right-box-1"  :class='type==2?"content1":""'>
-            <div class="starte-right-box-1-title" :class='type==2?"title1":""'>冷却塔</div>
-            <div class="starte-right-box-1-content1">
-              <p>{{data.coolTowerNumSetL || 0}}</p>
-              <p>{{data.coolTowerNumSetS || 0}}</p>
-              <p>{{data.coolTowerFreqSet?data.coolTowerFreqSet.toFixed(0):'--'}} HZ</p>
+        </div>
+        <div class='strate-right-box-1' :class='type==2?"content1":""'>
+            <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷却塔</div>
+            <div class='starte-right-box-1-content1'>
+                <p>{{shutDown(data.coolTowerNumSetL,true,null)}}</p>
+                <p>{{shutDown(data.coolTowerNumSetS,true,null)}}</p>
+                <p>{{shutDown(data.coolTowerFreqSet,false,0)}} HZ</p>
             </div>
-             <div class="starte-right-box-1-content">
-              <p>大</p>
-              <p>小</p>
-              <p>设定频率</p>
+            <div class='starte-right-box-1-content'>
+                <p>大</p>
+                <p>小</p>
+                <p>设定频率</p>
             </div>
-          </div>
         </div>
-
+    </div>
 </template>
 
 <script>
+import { shutDown } from '@/utils/query.js'
+
 export default {
-data(){
-  return{}
-},
-props:['data','type']
+    data() {
+        return {
+            shutDown: shutDown
+        }
+    },
+    props: ['data', 'type']
 }
 </script>
 
 <style lang='scss' scoped>
-.water-unit{
-      display: flex;
-      justify-content: space-between;
-       .content1{
-          background:rgba(0,145,255,1);
-          color:#fff;
-        }
-      .strate-right-box-1{
-        flex:1;
-        border-radius:6px;
-        border:1px solid rgba(238,238,238,1);
-        margin-right:18px;
-        &:last-of-type{
-          margin-right: 0;
+.water-unit {
+    display: flex;
+    justify-content: space-between;
+    .content1 {
+        background: rgba(0, 145, 255, 1);
+        color: #fff;
+    }
+    .strate-right-box-1 {
+        flex: 1;
+        border-radius: 6px;
+        border: 1px solid rgba(238, 238, 238, 1);
+        margin-right: 18px;
+        &:last-of-type {
+            margin-right: 0;
         }
-        .starte-right-box-1-title{
-          padding-left: 28px;
-          height: 56px;
-          line-height:56px;
-          font-size: 16px;
-          background:rgba(248,249,250,1);
-          color: #1F2429;
+        .starte-right-box-1-title {
+            padding-left: 28px;
+            height: 56px;
+            line-height: 56px;
+            font-size: 16px;
+            background: rgba(248, 249, 250, 1);
+            color: #1f2429;
         }
-        .title1{
-          color:#fff;
-          background:rgba(0,124,219,1);
+        .title1 {
+            color: #fff;
+            background: rgba(0, 124, 219, 1);
         }
-        
-        p{
-          padding: 0;
-          margin:0;
+
+        p {
+            padding: 0;
+            margin: 0;
         }
-        .starte-right-box-1-content1{
-          display: flex;
-          font-size: 24px;
-          justify-content:space-evenly;
-          margin-top: 11px;
+        .starte-right-box-1-content1 {
+            display: flex;
+            font-size: 24px;
+            justify-content: space-evenly;
+            margin-top: 11px;
         }
-        .starte-right-box-1-content{
-          display: flex;
-          font-size: 14px;
-          margin-top: 4px;
-          margin-bottom: 14px;
-          justify-content:space-evenly;
+        .starte-right-box-1-content {
+            display: flex;
+            font-size: 14px;
+            margin-top: 4px;
+            margin-bottom: 14px;
+            justify-content: space-evenly;
         }
-      }
     }
+}
 </style>