瀏覽代碼

Merge remote-tracking branch 'origin' into dev_wanke

zhulizhen1111 5 年之前
父節點
當前提交
2159f9b5a3

+ 10 - 10
src/components/strategyLine.vue

@@ -7,7 +7,7 @@
                 <i class='innerMax'></i> 室内最高温度
             </div>
 
-            <div style='width:100%;height:350px;margin-right:24px;'>
+            <div style='width:100%;height:100%;'>
                 <div id='leftLine' style='width:100%;height:100%;'></div>
             </div>
         </div>
@@ -18,7 +18,7 @@
                 预测冷量
             </div>
 
-            <div style='width:100%;height:350px;margin-right:24px;'>
+            <div style='width:100%;height:100%;'>
                 <div id='RightLine' style='width:100%;height:100%;'></div>
             </div>
         </div>
@@ -248,18 +248,18 @@ export default {
                         areaStyle: {
                             color: '#ccc'
                         },
-                        stack: 'confidence-band',
-                        symbol: 'none'
+                        stack: 'confidence-band'
+                        // symbol: 'none'
                     },
                     {
                         type: 'line',
                         data: this.loadY1,
-                        hoverAnimation: false,
-                        symbolSize: 6,
+                        // hoverAnimation: false,
+                        // symbolSize: 6,
                         itemStyle: {
                             color: '#0091FF'
-                        },
-                        showSymbol: false
+                        }
+                        // showSymbol: false
                     }
                 ]
             })
@@ -288,7 +288,7 @@ export default {
     height: 100%;
     display: flex;
     .leftL {
-        width: 50%;
+        width: 45%;
         flex: 1;
         .leftLengend {
             text-align: center;
@@ -314,7 +314,7 @@ export default {
     }
     .rightL {
         flex: 1;
-        width: 50%;
+        width: 45%;
         .rightLengend {
             text-align: center;
             margin-bottom: 10px;

+ 10 - 4
src/main.js

@@ -14,13 +14,19 @@ Vue.use(ElementUI)
 
 Vue.config.productionTip = false
 
+import Router from 'vue-router'
+
+const originalPush = Router.prototype.push
+Router.prototype.push = function push(location) {
+  return originalPush.call(this, location).catch(err => err)
+}
 // projectId 写入 store
 store.commit('setProId', localStorage.getItem('projectId') || 'Pj4419000005')
 
 /* eslint-disable no-new */
 new Vue({
-    el: '#app',
-    router,
-    store,
-    render: h => h(App)
+  el: '#app',
+  router,
+  store,
+  render: h => h(App)
 })

+ 1 - 1
src/router/index.js

@@ -66,7 +66,7 @@ const router = new Router({
       component: Evaluate
     },
     {
-      path: '/evaluate/evTwoLevelMenu',
+      path: '/evaluate/evTwoLevelMenu/:date/:name',
       name: 'evTwoLevelMenu',
       component: EvTwoLevelMenu
 

+ 20 - 4
src/utils/moment.js

@@ -1,7 +1,23 @@
-import moment from 'moment'
-moment.locale('zh-cn')
+// -9998  台数 0  数值 --
+// -9999  台数 ×  数值 ×  红色
 
+function formatterRes(res, type, num) {
+  // type 1 表示台数 0 表示数值
+  // num 需要几位小数
+  if (res || res == 0) {
+    if (res == '-9999') {
+      res = 'x'
+    } else if (res == '-9998') {
+      type ? res = 0 : res = '--'
+    } else {
+      res = Number(res).toFixed(num)
+    }
+  } else {
+    res = '--'
+  }
+  return res
+}
 
 export {
-
-}
+  formatterRes
+}

+ 4 - 1
src/views/appeal/index.vue

@@ -166,7 +166,7 @@ export default {
             day1: '',
             yesterday: '',
             today: '',
-            appDate:''
+            appDate: ''
         }
     },
     components: {
@@ -873,6 +873,9 @@ export default {
 </style>
 <style lang="scss">
 .view-dialog {
+    .el-dialog__wrapper {
+        top: -60px;
+    }
     .el-dialog__header {
         padding: 16px 28px 0 32px;
         .el-dialog__title {

+ 1 - 1
src/views/auth/index.vue

@@ -12,7 +12,7 @@ export default {
     created(){
         let lastRoute = this.$store.getters['lastRoute'].path.split('/')[1]
         console.log(lastRoute)
-        if (lastRoute != 'auth') {
+        if (lastRoute) {
             this.$router.replace(lastRoute)
         } else {
             this.$router.replace('/strategy')

+ 16 - 30
src/views/evaluate/evCard.vue

@@ -9,15 +9,13 @@
                     <span>策略建议</span>
                     <span>冷机台数</span>
                     <span>
-                        <b style='width:50px;display: inline-block;text-align: center;'>{{formatterRes(item.recommend.chillerNumSetL,true,0)}}</b>
+                        <b class='recommend-b'>{{formatterRes(item.recommend.chillerNumSetL,1,0)}}</b>
-                        <b
-                            style='width:50px;display: inline-block;text-align: center;'
-                        >{{formatterRes(item.recommend.chillerNumSetS,true,0)}}</b>小
+                        <b class='recommend-b'>{{formatterRes(item.recommend.chillerNumSetS,1,0)}}</b>小
                     </span>
                     <span>冷机出水温度</span>
                     <span>
-                        <b style='width:50px;display: inline-block;text-align: center;'>{{formatterRes(item.recommend.chillWaterOutTempSet,false,1)}}</b> °C
+                        <b class='recommend-b'>{{formatterRes(item.recommend.chillWaterOutTempSet,0,1)}}</b> °C
                     </span>
                 </div>
                 <div class='card-div3 MicrYaHei'>
@@ -25,23 +23,23 @@
                     <span>冷机台数</span>
                     <span>
                         <b
+                            class='recommend-b'
                             v-if='item.real'
-                            style='width:50px;display: inline-block;text-align: center;'
                             :class='item.recommend.chillerNumSetL==item.real.chillerNumSetLOrg?"":"red"'
-                        >{{formatterRes(item.real.chillerNumSetLOrg,true,0)}}</b>大
+                        >{{formatterRes(item.real.chillerNumSetLOrg,1,0)}}</b>大
                         <b
+                            class='recommend-b'
                             v-if='item.real'
-                            style='width:50px;display: inline-block;text-align: center;'
                             :class='item.recommend.chillerNumSetS==item.real.chillerNumSetSOrg?"":"red"'
-                        >{{formatterRes(item.real.chillerNumSetSOrg,true,0)}}</b> 小
+                        >{{formatterRes(item.real.chillerNumSetSOrg,1,0)}}</b> 小
                     </span>
                     <span>冷机出水温度</span>
                     <span>
                         <b
+                            class='recommend-b'
                             v-if='item.real'
-                            style='width:50px;display: inline-block;text-align: center;'
                             :class='item.recommend.chillWaterOutTempSet==item.real.chillWaterOutTempSetOrg?"":"red"'
-                        >{{formatterRes(item.real.chillWaterOutTempSetOrg,false,1)}}</b>°C
+                        >{{formatterRes(item.real.chillWaterOutTempSetOrg,0,1)}}</b>°C
                     </span>
                 </div>
 
@@ -85,10 +83,12 @@
 <script>
 import EvSnapshotsDialog from './evSnapshotsDialog'
 import { queryWorkflow } from '@/api/appeal/appeal.js'
+import { formatterRes } from '@/utils/moment.js'
 
 export default {
     data() {
         return {
+            formatterRes,
             viewSnapshots: false,
             ids: [],
             titles: [],
@@ -119,24 +119,6 @@ export default {
                 this.titles = res.content
             })
         },
-        formatterRes(res, type, num) {
-            if (res == '-9999') {
-                return 'x'
-            } else if (res == '-9998') {
-                if (type) {
-                    return 0
-                } else {
-                    return '--'
-                }
-            } else {
-                if (res != undefined) {
-                    res = res.toFixed(num)
-                } else {
-                    return '--'
-                }
-                return res
-            }
-        },
         getAppealId() {
             this.cardList.forEach(el => {
                 if (!el.recommend.isExecuted) {
@@ -148,7 +130,6 @@ export default {
     },
     mounted() {
         this.getAppealId()
-        console.log(this.cardList.length)
     },
     watch: {
         cardList(n, o) {
@@ -246,6 +227,11 @@ export default {
             line-height: 20px;
             margin-bottom: 26px;
         }
+        .recommend-b {
+            width: 50px;
+            display: inline-block;
+            text-align: center;
+        }
 
         .card-div5 {
             span:nth-of-type(1) {

+ 2 - 17
src/views/evaluate/evIndoorTemperature.vue

@@ -238,23 +238,8 @@ export default {
             }
             myCharts.setOption(option)
             myCharts.on('click', param => {
-                this.$router.push('/evaluate/evTwoLevelMenu')
-                if (param.seriesName == '室内温度满足率') {
-                    this.$router.push({
-                        path: '/evaluate/evTwoLevelMenu',
-                        query: { type: 1, name: param.name }
-                    })
-                } else if (param.seriesName == '节能率') {
-                    this.$router.push({
-                        path: '/evaluate/evTwoLevelMenu',
-                        query: { type: 2, name: param.name }
-                    })
-                } else {
-                    this.$router.push({
-                        path: '/evaluate/evTwoLevelMenu',
-                        query: { type: 3, name: param.name }
-                    })
-                }
+                let date = `${new Date().getFullYear() + param.name.slice(0, 2) + param.name.slice(3, 5)}`
+                this.$router.push(`/evaluate/evTwoLevelMenu/${date}/${param.seriesName}`)
             })
         }
     },

+ 19 - 61
src/views/evaluate/evSnapshotsDialog.vue

@@ -23,15 +23,15 @@
                     <div class='snapshotss-cont-bottom'>
                         <div class='snapshotss-cont-bot-1'>
                             <span>
-                                <font :class='chillerOrg.chillerNumSetLOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillerNumSetLOrg,true,0)}}</font>
+                                <font :class='chillerOrg.chillerNumSetLOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillerNumSetLOrg,1,0)}}</font>
                             </span>
                             <span>
-                                <font :class='chillerOrg.chillerNumSetSOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillerNumSetSOrg,true,0)}}</font>
+                                <font :class='chillerOrg.chillerNumSetSOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillerNumSetSOrg,1,0)}}</font>
                             </span>
                             <span>
                                 <font
                                     :class='chillerOrg.chillWaterOutTempSetOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.chillWaterOutTempSetOrg,false,1)}}</font>
+                                >{{formatterRes(chillerOrg.chillWaterOutTempSetOrg,1,1)}}</font>
                                 <font style='font-size:12px;'>°C</font>
                             </span>
                         </div>
@@ -47,13 +47,13 @@
                     <div class='snapshotss-cont-bottom'>
                         <div class='snapshotss-cont-bot-1'>
                             <span>
-                                <font :class='chillerOrg.coolPumpNumSetLOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolPumpNumSetLOrg ,true,0)}}</font>
+                                <font :class='chillerOrg.coolPumpNumSetLOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolPumpNumSetLOrg ,1,0)}}</font>
                             </span>
                             <span>
-                                <font :class='chillerOrg.coolPumpNumSetSOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolPumpNumSetSOrg,true,0)}}</font>
+                                <font :class='chillerOrg.coolPumpNumSetSOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolPumpNumSetSOrg,1,0)}}</font>
                             </span>
                             <span>
-                                <font :class='chillerOrg.coolPumpFreqSetOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolPumpFreqSetOrg,false,0)}}</font>
+                                <font :class='chillerOrg.coolPumpFreqSetOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolPumpFreqSetOrg,0,0)}}</font>
                                 <font style='font-size:12px;'>Hz</font>
                             </span>
                         </div>
@@ -69,19 +69,13 @@
                     <div class='snapshotss-cont-bottom'>
                         <div class='snapshotss-cont-bot-1'>
                             <span>
-                                <font
-                                    :class='chillerOrg.chillPumpNumSetLOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.chillPumpNumSetLOrg,true,0)}}</font>
+                                <font :class='chillerOrg.chillPumpNumSetLOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillPumpNumSetLOrg,1,0)}}</font>
                             </span>
                             <span>
-                                <font
-                                    :class='chillerOrg.chillPumpNumSetSOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.chillPumpNumSetSOrg,true,0)}}</font>
+                                <font :class='chillerOrg.chillPumpNumSetSOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillPumpNumSetSOrg,1,0)}}</font>
                             </span>
                             <span>
-                                <font
-                                    :class='chillerOrg.chillPumpFreqSetOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.chillPumpFreqSetOrg,false,0)}}</font>
+                                <font :class='chillerOrg.chillPumpFreqSetOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.chillPumpFreqSetOrg,0,0)}}</font>
                                 <font style='font-size:12px;'>Hz</font>
                             </span>
                         </div>
@@ -97,19 +91,13 @@
                     <div class='snapshotss-cont-bottom'>
                         <div class='snapshotss-cont-bot-1'>
                             <span>
-                                <font
-                                    :class='chillerOrg.coolTowerNumSetLOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.coolTowerNumSetLOrg,true,0)}}</font>
+                                <font :class='chillerOrg.coolTowerNumSetLOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolTowerNumSetLOrg,1,0)}}</font>
                             </span>
                             <span>
-                                <font
-                                    :class='chillerOrg.coolTowerNumSetSOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.coolTowerNumSetSOrg,true,0)}}</font>
+                                <font :class='chillerOrg.coolTowerNumSetSOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolTowerNumSetSOrg,1,0)}}</font>
                             </span>
                             <span>
-                                <font
-                                    :class='chillerOrg.coolTowerFreqSetOrg=="-9999"?"red":""'
-                                >{{formatterRes(chillerOrg.coolTowerFreqSetOrg,false,0)}}</font>
+                                <font :class='chillerOrg.coolTowerFreqSetOrg=="-9999"?"red":""'>{{formatterRes(chillerOrg.coolTowerFreqSetOrg,0,0)}}</font>
                                 <font style='font-size:12px;'>Hz</font>
                             </span>
                         </div>
@@ -167,29 +155,14 @@
 import echarts from 'echarts'
 import { queryQuickData } from '@/api/strategy/strategy.js'
 import strategyLine from '@/components/strategyLine'
+import { formatterRes } from '@/utils/moment.js'
 
 export default {
     props: ['appDate', 'time'],
     data() {
         return {
+            formatterRes,
             imgFinish: true,
-            imgFinishList: [
-                {
-                    name: '能耗',
-                    img1: require('../../assets/finish.png'),
-                    img2: require('../../assets/wrong.png')
-                },
-                {
-                    name: '环境',
-                    img1: require('../../assets/finish.png'),
-                    img2: require('../../assets/wrong.png')
-                },
-                {
-                    name: 'BA',
-                    img1: require('../../assets/finish.png'),
-                    img2: require('../../assets/wrong.png')
-                }
-            ],
             chillerOrg: {},
             chillerCommand: {},
             chillerHourList: []
@@ -205,24 +178,6 @@ export default {
     },
     components: { strategyLine },
     methods: {
-        formatterRes(res, type, num) {
-            if (res == '-9999') {
-                return 'x'
-            } else if (res == '-9998') {
-                if (type) {
-                    return 0
-                } else {
-                    return '--'
-                }
-            } else {
-                if (res != undefined) {
-                    res = res.toFixed(num)
-                } else {
-                    return '--'
-                }
-                return res
-            }
-        },
         getQuickData() {
             let params = {
                 getParams: {
@@ -347,7 +302,7 @@ export default {
     }
     .snapshotss-center2 {
         padding: 0 20px;
-        margin-bottom: 44px;
+        margin-bottom: 30px;
         display: flex;
         align-items: center;
         justify-content: space-between;
@@ -359,9 +314,10 @@ export default {
             display: flex;
             align-items: center;
             padding-left: 24px;
+            flex: 1;
         }
         .snapshotss-cont2-box1 {
-            padding-right: 120px;
+            margin-right: 12px;
             span:nth-of-type(1) {
                 height: 22px;
                 font-size: 14px;
@@ -417,6 +373,8 @@ export default {
         }
     }
     .snapshotss-foot {
+        padding-bottom: 20px;
+        height: 280px;
         display: flex;
         justify-content: space-between;
     }

+ 35 - 121
src/views/evaluate/evTwoLevelMenu.vue

@@ -9,11 +9,9 @@
                     <span>单日运行评价</span>
                 </div>
                 <ul class='MicrYaHei'>
-                    <div style='min-width:300px;min-height:30px;cursor: pointer;' @click='jumpIndex'></div>
+                    <router-link style='display: inline-block;min-width:300px;min-height:30px;cursor: pointer;' :to='{path:"/evaluate"}'></router-link>
                     <div>
-                        <li :class='{current: num == 1}' @click='changeNum(1)'>室内温度</li>
-                        <li :class='{current: num==2}' @click='changeNum(2)'>节能率</li>
-                        <li :class='{current: num==3}' @click='changeNum(3)'>执行率</li>
+                        <li v-for='(item,index) in tabArr' :key='index' :class='{current:num==`${index+1}`}' @click='changeNum(`${index+1}`)'>{{item}}</li>
                     </div>
                     <div class='count-top-right'>
                         <date-temp v-if='date' @pickerVal='pickerVal' :date='date'></date-temp>
@@ -27,10 +25,10 @@
                             <el-switch v-model='value2' @change='changeNum("1")'></el-switch>
                         </div>
                         <div class='count-bottom-content'>
-                            <ev-two-table v-if='dataList.length>=0' :switch='value2' :dataList='dataList' :value2='value2'></ev-two-table>
+                            <ev-two-table v-if='dataList.length>0' :switch='value2' :dataList='dataList' :value2='value2'></ev-two-table>
                         </div>
                         <div class='count-bottom-foot'>
-                            <ev-stacked-line v-if='stackArr.length>=0' :stackArr='stackArr'></ev-stacked-line>
+                            <ev-stacked-line v-if='stackArr.length>0' :stackArr='stackArr'></ev-stacked-line>
                         </div>
                     </div>
                     <div v-show='num == 2'>
@@ -73,10 +71,13 @@ import EvHistory from './evHistory'
 import DateTemp from './dateTemp'
 import { energyDayQuery, querychiller, queryTdbDay } from '@/api/evaluate/evaluate.js'
 import { queryChillerExecuteInfo } from '@/api/appeal/appeal.js'
+import { formatterRes } from '@/utils/moment.js'
 
 export default {
     data() {
         return {
+            formatterRes,
+            tabArr: ['室内温度', '节能率', '执行率'],
             headText: '运行评价',
             num: 1, //tab @
             date: '', // 传过来的日期@
@@ -111,19 +112,14 @@ export default {
     },
     methods: {
         init() {
-            this.type = this.$route.query.type
-            this.date = this.$route.query.name
-            if (this.type) {
-                this.num = this.type
-            }
-            if (this.date) {
-                this.date = this.formatterStr3(new Date().getFullYear() + this.formatterStr2(this.date))
-            }
-        },
-        // @
-        formatterStr2(str) {
-            if (str) {
-                return str.substring(0, 2) + '' + str.substring(3, 5)
+            this.type = this.$route.params.name
+            this.date = this.$route.params.date
+            if (this.type == '室内温度满足率') {
+                this.num = 1
+            } else if (this.type == '节能率') {
+                this.num = 2
+            } else {
+                this.num = 3
             }
         },
         // 室内温度table @
@@ -138,17 +134,8 @@ export default {
             }
             this.tindoorFillRate = ''
             queryTdbDay(date, { getParams }).then(res => {
-                if (res.tindoorFillRate != undefined) {
-                    if (res.tindoorFillRate == -9999) {
-                        this.tindoorFillRate = 'x'
-                    } else if (res.tindoorFillRate == -9998) {
-                        this.tindoorFillRate = '--'
-                    } else {
-                        this.tindoorFillRate = Number(this.tindoorFillRate).toFixed(1)
-                    }
-                } else {
-                    this.tindoorFillRate = '--'
-                }
+                this.tindoorFillRate = this.formatterRes(res.tindoorFillRate, 0, 1)
+                console.log('室内温度满足率', this.tindoorFillRate)
                 let content = res.content
                 this.stackArr = content
                 if (content && content.length > 0) {
@@ -172,12 +159,6 @@ export default {
                 })
             })
         },
-        // @
-        formatterStr3(str) {
-            if (str) {
-                return str.substring(0, 4) + str.substring(4, 6) + str.substring(6, 8)
-            }
-        },
         // 执行率@
         queryimplement(date) {
             let params = {
@@ -199,7 +180,6 @@ export default {
                 this.queryTdbDayMethod(date)
             } else if (this.num == 2) {
                 this.queryEnergyDayQuery(date)
-                this.querychillerMethod(date)
             } else if (this.num == 3) {
                 this.queryimplement(date)
                 this.querychillerMethod(date)
@@ -214,43 +194,10 @@ export default {
                     }
                 }
             }
-            this.accuracy = ''
-            this.energySavingRate = ''
             this.chillerExecuteRateReal = ''
             querychiller(params).then(res => {
-                // // 节能率
-                // if (res.content[0].energySavingRate != undefined) {
-                //     if (res.content[0].energySavingRate == -9999) {
-                //         this.energySavingRate = 'x'
-                //     } else {
-                //         this.energySavingRate = res.content[0].energySavingRate.toFixed(1)
-                //     }
-                // } else {
-                //     this.energySavingRate = '--'
-                // }
-                // console.log('节能率', this.energySavingRate)
-                // // 准确率
-                // if (res.content[0].accuracy != undefined) {
-                //     if (res.content[0].accuracy == -9999) {
-                //         this.accuracy = 'x'
-                //     } else {
-                //         this.accuracy = res.content[0].accuracy.toFixed(1)
-                //     }
-                // } else {
-                //     this.accuracy = '--'
-                // }
-                // console.log('准确率', this.accuracy)
-
                 //执行率
-                if (res.content[0].chillerExecuteRateReal != undefined) {
-                    if (res.content[0].chillerExecuteRateReal == -9999) {
-                        this.chillerExecuteRateReal = 'x'
-                    } else {
-                        this.chillerExecuteRateReal = res.content[0].chillerExecuteRateReal.toFixed(1)
-                    }
-                } else {
-                    this.chillerExecuteRateReal = '--'
-                }
+                this.chillerExecuteRateReal = this.formatterRes(res.content[0].chillerExecuteRateReal, 0, 1)
                 console.log('执行率', this.chillerExecuteRateReal)
             })
         },
@@ -270,13 +217,9 @@ export default {
             if (val) {
                 this.dateVal = this.formatterStr(val)
                 this.changeNumMethod(this.dateVal)
-                // console.log(this.dateVal);
             }
         },
-        // @
-        jumpIndex() {
-            this.$router.push('/evaluate')
-        },
+
         // 节能率@
         queryEnergyDayQuery(date) {
             this.maxArr = []
@@ -290,31 +233,11 @@ export default {
                     if (Object.keys(res.current).length > 0) {
                         this.energySavingRate = res.current.energySavingRate
                         this.accuracy = res.current.accuracy
-
                         // 节能率
-                        if (this.energySavingRate != undefined) {
-                            if (this.energySavingRate == -9999) {
-                                this.energySavingRate = 'x'
-                            } else {
-                                this.energySavingRate = this.energySavingRate.toFixed(1)
-                            }
-                        } else {
-                            this.energySavingRate = '--'
-                        }
-                        console.log('节能率', this.energySavingRate)
+                        this.energySavingRate = this.formatterRes(this.energySavingRate, 0, 1)
                         // 准确率
-                        if (this.accuracy != undefined) {
-                            if (this.accuracy == -9999) {
-                                this.accuracy = 'x'
-                            } else {
-                                this.accuracy = this.accuracy.toFixed(1)
-                            }
-                        } else {
-                            this.accuracy = '--'
-                        }
-                        console.log('准确率', this.accuracy)
+                        this.accuracy = this.formatterRes(this.accuracy, 0, 1)
                     }
-                    console.log('相似度', this.current.similarity)
                     // 相似日概况
                     this.similarDay = res.similarDay ? res.similarDay : {}
                     // 相似日列表
@@ -333,35 +256,26 @@ export default {
                             maxEnergy = this.maxMethod(this.sortMethod(energy))
                         this.maxArr.push(maxOutsiteTemp, maxIndoorTemp, maxEnergy)
                     } else {
-                        if (this.current.tempOutdoor == '-9999') {
-                            this.maxArr[0] = 'x'
-                        } else if (this.current.tempOutdoor == '-9998') {
-                            this.maxArr[0] = '--'
-                        } else {
-                            this.maxArr[0] = this.current.tempOutdoor * 1.2
-                        }
-
-                        if (this.current.tempIndoor == '-9999') {
-                            this.maxArr[1] = 'x'
-                        } else if (this.current.tempIndoor == '-9998') {
-                            this.maxArr[1] = '--'
-                        } else {
-                            this.maxArr[1] = this.current.tempIndoor * 1.2
-                        }
-
-                        if (this.current.energy == '-9999') {
-                            this.maxArr[2] = 'x'
-                        } else if (this.current.energy == '-9998') {
-                            this.maxArr[2] = '--'
-                        } else {
-                            this.maxArr[2] = this.current.energy * 1.2
-                        }
+                        this.maxArr[0] = this.currentN(this.current.tempOutdoor, 0, 1)
+                        this.maxArr[1] = this.currentN(this.current.tempIndoor, 0, 1)
+                        this.maxArr[2] = this.currentN(this.current.energy, 0, 1)
                     }
                 } else {
                     this.$message.error(res.message)
                 }
             })
         },
+        currentN(data) {
+            let num
+            if (data == '-9999') {
+                num = 'x'
+            } else if (data == '-9998') {
+                num = '--'
+            } else {
+                num = data * 1.2
+            }
+            return num
+        },
         // @
         sortMethod(arr) {
             if (arr instanceof Array) {

+ 0 - 3
src/views/evaluate/evTwoTable.vue

@@ -74,11 +74,9 @@ export default {
     mounted() {
         this.initExpand()
         this.$nextTick(() => this.doSelect())
-        console.log(this.value2)
     },
     methods: {
         expandChange(row, expandedRows) {
-            console.log(row, expandedRows)
             if (expandedRows.length > 0) {
                 this.$nextTick(() => this.doSelect())
             }
@@ -94,7 +92,6 @@ export default {
                 }
                 // if (i.children.some(c => c.isSatisfy == false)) this.expands.push(i.id)
             })
-            console.log('this.dataList', this.dataList)
         },
         doSelect() {
             this.dataList.forEach(i => {

+ 17 - 4
src/views/strategy/animationBox.vue

@@ -50,7 +50,7 @@
                 <p>当前策略</p>
             </div>
         </div>
-        <bom-box v-if='Object.keys(chillerCommandQ).length>0' :class='["draw", {"open": showDraw}]' :data='chillerCommandQ' @close='showDraw = false'></bom-box>
+        <bom-box :class='["draw", {"open": showDraw}]' :data='chillerCommandQ' @close='showDraw = false'></bom-box>
     </div>
 </template>
 
@@ -62,7 +62,7 @@ import strategyLine from '@/components/strategyLine'
 export default {
     data() {
         return {
-            showDraw: false,
+            showDraw: true,
             dataX: [],
             dataY1: [],
             dataY2: [],
@@ -76,6 +76,18 @@ export default {
         }
     },
     components: { bomBox, strategyLine },
+    methods: {
+        isShowDraw() {
+            if (
+                (Object.keys(this.chillerCommandQ).length > 0 && this.chillerCommandQ.isNew) ||
+                (Object.keys(this.chillerCommandQ).length > 0 && !this.chillerCommandQ.isExecuted)
+            ) {
+                this.showDraw = true
+            } else {
+                this.showDraw = false
+            }
+        }
+    },
     props: ['data', 'chillerHourList', 'chillerCommandQ']
 }
 </script>
@@ -164,7 +176,7 @@ export default {
         width: 8px;
         border-radius: 8px 0 0 8px;
         cursor: pointer;
-        height: 357px;
+        height: 288px;
         .float-r {
             width: 8px;
             display: flex;
@@ -173,7 +185,7 @@ export default {
             cursor: pointer;
             .float-line {
                 width: 8px;
-                height: 357px;
+                height: 288px;
                 border-radius: 8px 0 0 8px;
             }
             img {
@@ -205,6 +217,7 @@ export default {
         }
     }
     .an-bottom {
+        height: 350px;
         margin-top: 45px;
         display: flex;
     }

+ 46 - 17
src/views/strategy/bomBox.vue

@@ -5,7 +5,10 @@
             <img src='../../assets/close.png' alt />
         </div>
         <div class='bomb-left'>
-            <div class='bomb-left1'>当前策略</div>
+            <div class='bomb-left1'>
+                当前策略
+                <span v-if='data.isExecuted' class='excute'>已执行</span>
+            </div>
             <div class='bomb-left2'>
                 应执行时间
                 <span v-if='data.onTime'>{{data.onTime?data.onTime.slice(0,2)+":"+data.onTime.slice(2,4):"--"}}</span>
@@ -13,7 +16,7 @@
                 <span v-else>{{data.executeTime?data.executeTime.slice(8,10)+":"+data.executeTime.slice(10,12):"--"}}</span>
             </div>
             <div class='bomb-left3'>策略可靠度</div>
-            <div id='circleEcharts' style='width:170px;height:204px'></div>
+            <div id='circleEcharts' style='width:170px;height:170px'></div>
         </div>
         <div class='bomb-right'>
             <water-unit :data='data' :type='2'></water-unit>
@@ -54,7 +57,7 @@
                 </div>
             </div>
             <div class='bomb-right-bottom'>
-                <el-input placeholder='你可以在此处填写备注信息' v-model='remarks' @blur='saveRemarks'></el-input>
+                <el-input placeholder='你可以在此处填写备注信息' v-model='remarks' @blur='saveRemarks' prefix-icon='el-icon-edit'></el-input>
             </div>
         </div>
     </div>
@@ -98,6 +101,23 @@ export default {
             var circleEcharts = echarts.init(document.getElementById('circleEcharts'))
             let option = {
                 color: ['#E1F2FF', '#0091FF'],
+                graphic: [
+                    {
+                        type: 'text',
+                        left: 'center',
+                        top: '45%',
+                        style: {
+                            text: this.circle2.toFixed(1) + '%',
+                            textAlign: 'center',
+                            fill: '#000', //文字的颜色
+                            width: 30,
+                            height: 30,
+                            fontSize: 18,
+                            color: '#4d4f5c',
+                            fontFamily: 'Microsoft YaHei'
+                        }
+                    }
+                ],
                 series: [
                     {
                         name: '',
@@ -108,10 +128,7 @@ export default {
                         label: {
                             normal: {
                                 show: true,
-                                position: 'center',
-                                formatter: function(formatter) {
-                                    return formatter.percent + '%'
-                                }
+                                position: 'center'
                             }
                         },
                         labelLine: {
@@ -145,6 +162,7 @@ export default {
     position: relative;
     border-radius: 8px 0 0 8px;
     box-shadow: 0 2px 10px 0 rgba(44, 48, 62, 0.16);
+    padding-top: 10px;
     .bomb-line {
         position: absolute;
         top: 0;
@@ -159,20 +177,32 @@ export default {
     }
     .bomb-left {
         width: 180px;
-        padding-left: 10px;
         .bomb-left1 {
+            padding-left: 30px;
             font-size: 16px;
-            margin: 38px 0 16px 0;
+            margin: 10px 0 20px 0;
+            .excute {
+                width: 58px;
+                height: 24px;
+                background: rgba(217, 245, 214, 1);
+                border-radius: 2px;
+                font-size: 14px;
+                font-family: MicrosoftYaHei;
+                color: rgba(35, 123, 25, 1);
+                padding: 2px 8px;
+                margin-left: 6px;
+            }
         }
         .bomb-left2 {
+            padding-left: 30px;
             color: #646c73;
             font-size: 14px;
-            margin-bottom: 16px;
+            margin-bottom: 20px;
         }
         .bomb-left3 {
+            padding-left: 30px;
             color: #646c73;
             font-size: 14px;
-            margin-bottom: 22px;
         }
     }
     .bomb-right {
@@ -187,12 +217,8 @@ export default {
             .snapshotss-cont2-box1,
             .snapshotss-cont2-box2 {
                 flex: 1;
-                height: 80px;
-                background: url('../../assets/copy.png');
-                background-size: 100% 100%;
                 display: flex;
                 align-items: center;
-                padding-left: 24px;
             }
             .snapshotss-cont2-box1 {
                 margin-right: 12px;
@@ -204,7 +230,7 @@ export default {
                     margin-right: 20px;
                 }
                 span:not(:first-child) {
-                    height: 28px;
+                    height: 26px;
                     background: rgba(255, 255, 255, 1);
                     border-radius: 16px;
                     font-size: 14px;
@@ -239,7 +265,7 @@ export default {
                 span:nth-of-type(2),
                 span:nth-of-type(4) {
                     height: 32px;
-                    font-size: 24px;
+                    font-size:18px;
                     font-family: Persagy;
                     color: rgba(31, 36, 41, 1);
                     line-height: 29px;
@@ -250,6 +276,9 @@ export default {
                 }
             }
         }
+        .bomb-right-bottom {
+            margin-bottom: 10px;
+        }
     }
 }
 </style>

+ 18 - 19
src/views/strategy/index.vue

@@ -28,7 +28,7 @@
             <div class='starte-right'>
                 <p class='strate-right-title'>当前状态</p>
                 <water-unit :data='chillerOrg ' :type='1'></water-unit>
-                <animation-box
+                <animation-box ref="box"
                     v-if='Object.keys(chillerCommand).length>=0||chillerHourList.length>=0'
                     :data='chillerOrg'
                     :chillerHourList='chillerHourList'
@@ -62,7 +62,8 @@ export default {
             now: '',
             chillerOrg: {},
             chillerHourList: [],
-            idArr: []
+            idArr: [],
+            clearId:null,
         }
     },
     components: {
@@ -75,7 +76,6 @@ export default {
         lookSnapshot() {
             this.showTodayStrategy = true
             this.getData()
-            // console.log(this.$store.state);
         },
         formatTime() {
             let year = new Date().getFullYear()
@@ -83,13 +83,6 @@ export default {
             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: {}
@@ -104,6 +97,12 @@ export default {
                 this.chillerOrg = res.chillerOrg || {}
                 this.chillerCommand = res.chillerCommand || {}
                 this.chillerHourList = res.chillerHourList || []
+                 if(Object.keys(this.chillerCommand).length>=0||this.chillerHourList.length>=0){
+                    let vm =this
+                    setTimeout(function(){
+                         vm.$refs.box.isShowDraw()
+                    },100) 
+                }
             })
         },
         getData() {
@@ -119,8 +118,6 @@ export default {
                     }
                 }
             }
-            console.log(this.$store.state.userInfo.userId)
-            // return
             getCommand(params).then(res => {
                 this.tableData = res.content ? res.content : []
                 if (this.tableData.length > 0) {
@@ -128,19 +125,21 @@ export default {
                         this.idArr.push(el.appealId)
                     })
                 }
-                console.log(this.tableData)
             })
         }
     },
     mounted() {
         this.formatTime()
-        this.getPer5Time()
-        // let vm = this
-        // setInterval(function(){
-        //    vm.getData()
-        // },1500)
-        // this.getQuickData();
+        let vm = this
+        this.clearId = setInterval(function(){
+           vm.getChiller()
+           vm.$refs.box.isShowDraw()
+        },1000*60)
         this.getChiller()
+       
+    },
+    destroyed(){
+        window.clearInterval(this.clearId)
     }
 }
 </script>

+ 30 - 49
src/views/strategy/waterUnit.vue

@@ -4,19 +4,16 @@
             <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷水机组</div>
             <div class='starte-right-box-1-content1' v-if='data'>
                 <p>
-                    <font v-if='type==1' :class='data.chillerNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetLOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.chillerNumSetL=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetL,true,0)}}</font>
+                    <font v-if='type==1' :class='data.chillerNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetLOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.chillerNumSetL=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetL,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.chillerNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetSOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.chillerNumSetS=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetS,true,0)}}</font>
+                    <font v-if='type==1' :class='data.chillerNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetSOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.chillerNumSetS=="-9999"?"reds":""'>{{formatterRes(data.chillerNumSetS,1,0)}}</font>
                 </p>
                 <p>
-                    <font
-                        v-if='type==1'
-                        :class='data.chillWaterOutTempSetOrg=="-9999"?"reds":""'
-                    >{{formatterRes(data.chillWaterOutTempSetOrg,false,1)}}</font>
-                    <font v-if='type==2' :class='data.chillWaterOutTempSet=="-9999"?"reds":""'>{{formatterRes(data.chillWaterOutTempSet,false,1)}}</font>
+                    <font v-if='type==1' :class='data.chillWaterOutTempSetOrg=="-9999"?"reds":""'>{{formatterRes(data.chillWaterOutTempSetOrg,0,1)}}</font>
+                    <font v-if='type==2' :class='data.chillWaterOutTempSet=="-9999"?"reds":""'>{{formatterRes(data.chillWaterOutTempSet,0,1)}}</font>
                     <font style='font-size:12px;'>℃</font>
                 </p>
             </div>
@@ -30,16 +27,16 @@
             <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷冻水泵</div>
             <div class='starte-right-box-1-content1' v-if='data'>
                 <p>
-                    <font v-if='type==1' :class='data.coolPumpNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetLOrg ,true,0)}}</font>
-                    <font v-if='type==2' :class='data.coolPumpNumSetL=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetL,true,0)}}</font>
+                    <font v-if='type==1' :class='data.coolPumpNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetLOrg ,1,0)}}</font>
+                    <font v-if='type==2' :class='data.coolPumpNumSetL=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetL,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.coolPumpNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetSOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.coolPumpNumSetS=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetS,true,0)}}</font>
+                    <font v-if='type==1' :class='data.coolPumpNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetSOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.coolPumpNumSetS=="-9999"?"reds":""'>{{formatterRes(data.coolPumpNumSetS,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.coolPumpFreqSetOrg=="-9999"?"reds":""'>{{formatterRes(data.coolPumpFreqSetOrg,false,0)}}</font>
-                    <font v-if='type==2' :class='data.coolPumpFreqSet=="-9999"?"reds":""'>{{formatterRes(data.coolPumpFreqSet,false,0)}}</font>
+                    <font v-if='type==1' :class='data.coolPumpFreqSetOrg=="-9999"?"reds":""'>{{formatterRes(data.coolPumpFreqSetOrg,0,0)}}</font>
+                    <font v-if='type==2' :class='data.coolPumpFreqSet=="-9999"?"reds":""'>{{formatterRes(data.coolPumpFreqSet,0,0)}}</font>
                     <font style='font-size:12px;'>Hz</font>
                 </p>
             </div>
@@ -53,16 +50,16 @@
             <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷却水泵</div>
             <div class='starte-right-box-1-content1' v-if='data'>
                 <p>
-                    <font v-if='type==1' :class='data.chillPumpNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetLOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.chillPumpNumSetL=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetL,true,0)}}</font>
+                    <font v-if='type==1' :class='data.chillPumpNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetLOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.chillPumpNumSetL=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetL,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.chillPumpNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetSOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.chillPumpNumSetS=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetS,true,0)}}</font>
+                    <font v-if='type==1' :class='data.chillPumpNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetSOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.chillPumpNumSetS=="-9999"?"reds":""'>{{formatterRes(data.chillPumpNumSetS,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.chillPumpFreqSetOrg=="-9999"?"reds":""'>{{formatterRes(data.chillPumpFreqSetOrg,false,0)}}</font>
-                    <font v-if='type==2' :class='data.chillPumpFreqSet=="-9999"?"reds":""'>{{formatterRes(data.chillPumpFreqSet,false,0)}}</font>
+                    <font v-if='type==1' :class='data.chillPumpFreqSetOrg=="-9999"?"reds":""'>{{formatterRes(data.chillPumpFreqSetOrg,0,0)}}</font>
+                    <font v-if='type==2' :class='data.chillPumpFreqSet=="-9999"?"reds":""'>{{formatterRes(data.chillPumpFreqSet,0,0)}}</font>
                     <font style='font-size:12px;'>Hz</font>
                 </p>
             </div>
@@ -76,16 +73,16 @@
             <div class='starte-right-box-1-title' :class='type==2?"title1":""'>冷却塔</div>
             <div class='starte-right-box-1-content1' v-if='data'>
                 <p>
-                    <font v-if='type==1' :class='data.coolTowerNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetLOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.coolTowerNumSetL=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetL,true,0)}}</font>
+                    <font v-if='type==1' :class='data.coolTowerNumSetLOrg=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetLOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.coolTowerNumSetL=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetL,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.coolTowerNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetSOrg,true,0)}}</font>
-                    <font v-if='type==2' :class='data.coolTowerNumSetS=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetS,true,0)}}</font>
+                    <font v-if='type==1' :class='data.coolTowerNumSetSOrg=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetSOrg,1,0)}}</font>
+                    <font v-if='type==2' :class='data.coolTowerNumSetS=="-9999"?"reds":""'>{{formatterRes(data.coolTowerNumSetS,1,0)}}</font>
                 </p>
                 <p>
-                    <font v-if='type==1' :class='data.coolTowerFreqSetOrg=="-9999"?"reds":""'>{{formatterRes(data.coolTowerFreqSetOrg,false,0)}}</font>
-                    <font v-if='type==2' :class='data.coolTowerFreqSet=="-9999"?"reds":""'>{{formatterRes(data.coolTowerFreqSet,false,0)}}</font>
+                    <font v-if='type==1' :class='data.coolTowerFreqSetOrg=="-9999"?"reds":""'>{{formatterRes(data.coolTowerFreqSetOrg,0,0)}}</font>
+                    <font v-if='type==2' :class='data.coolTowerFreqSet=="-9999"?"reds":""'>{{formatterRes(data.coolTowerFreqSet,0,0)}}</font>
                     <font style='font-size:12px;'>Hz</font>
                 </p>
             </div>
@@ -99,31 +96,15 @@
 </template>
 
 <script>
+import { formatterRes } from '@/utils/moment.js'
+
 export default {
     data() {
-        return {}
-    },
-    props: ['data', 'type'],
-    methods: {
-        formatterRes(res, type, num) {
-            if (res == '-9999') {
-                return 'x'
-            } else if (res == '-9998') {
-                if (type) {
-                    return 0
-                } else {
-                    return '--'
-                }
-            } else {
-                if (res != undefined) {
-                    res = res.toFixed(num)
-                } else {
-                    return '--'
-                }
-                return res
-            }
+        return {
+            formatterRes
         }
-    }
+    },
+    props: ['data', 'type']
 }
 </script>