Просмотр исходного кода

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

zhulizhen1111 5 лет назад
Родитель
Сommit
5bb71cf0d2

+ 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)
 })

+ 14 - 7
src/router/index.js

@@ -9,17 +9,18 @@ const Audit = () => import('@/views/audit/index')
 const DoBusiness = () => import('@/views/doBusiness/index')
 const Evaluate = () => import('@/views/evaluate/index')
 const EvTwoLevelMenu = () => import('@/views/evaluate/evTwoLevelMenu')
-const Auth = () =>import('@/views/auth/index')
+const Auth = () => import('@/views/auth/index')
 
 import store from '../store'
-import { query } from '../utils/query'
+import {
+  query
+} from '../utils/query'
 
 Vue.use(Router)
 
 const router = new Router({
   mode: 'history',
-  routes: [
-    {
+  routes: [{
       path: '/',
       name: 'main',
       component: Main
@@ -65,7 +66,7 @@ const router = new Router({
       component: Evaluate
     },
     {
-      path: '/evaluate/evTwoLevelMenu',
+      path: '/evaluate/evTwoLevelMenu/:date/:name',
       name: 'evTwoLevelMenu',
       component: EvTwoLevelMenu
 
@@ -78,14 +79,20 @@ router.beforeEach(async (to, from, next) => {
     next()
   } else if (token) {
     store.commit('setSsoToken', token)
-    await store.dispatch('loadUserInfo', { token })
+    await store.dispatch('loadUserInfo', {
+      token
+    })
     // 去除浏览器地址栏token
     if (query().token) {
       router.replace(location.pathname + location.search.replace(/(&?token=\w+&?)/, ''))
     }
     next()
   } else {
-    let lastRoute = { path: to.path, params: to.params, query: to.query }
+    let lastRoute = {
+      path: to.path,
+      params: to.params,
+      query: to.query
+    }
     store.commit('setLastRoute', lastRoute)
     let ssoServer = 'http://sso.sagacloud.cn'
     let redirectUrl = window.location.protocol + '//' + window.location.host + '/auth'

+ 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
+}

+ 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}`)
             })
         }
     },

+ 14 - 59
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: {

+ 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 => {

+ 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>