123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <template>
- <div class='evTwoContainer'>
- <div class='evTwoContainer-out'>
- <Head :headText='headText'></Head>
- <div class='count-top'>
- <div class='count-top-left MicrYaHei'>
- <span>首页</span>
- <span>></span>
- <span>单日运行评价</span>
- </div>
- <ul class='MicrYaHei'>
- <router-link style='display: inline-block;min-width:300px;min-height:30px;cursor: pointer;' :to='{path:"/evaluate"}'></router-link>
- <div>
- <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>
- </div>
- </ul>
- <div class='count-bottom'>
- <div v-if='num == 1'>
- <ev-rate-title :tab='1' :rate='tindoorFillRate'></ev-rate-title>
- <div class='count-bottom-switch'>
- <span class='switchSpan'>只显示不满足的点位</span>
- <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>
- </div>
- <div class='count-bottom-foot'>
- <ev-stacked-line v-if='stackArr.length>0' :stackArr='stackArr'></ev-stacked-line>
- </div>
- </div>
- <div v-show='num == 2'>
- <ev-rate-title :tab='2' :rate='energySavingRate' :accuracy='accuracy'></ev-rate-title>
- <div class='count-historical-data'>
- <ev-history
- v-if='Object.keys(current).length>0||Object.keys(similarDay).length>0||Object.keys(maxArr).length>0'
- :current='current'
- :similarDay='similarDay'
- :maxArr='maxArr'
- ></ev-history>
- <div class='count-foot'>
- <div class='count-foot-title'>
- <span class='Micbold'>相似日概况</span>
- <span class='MicrYaHei'>相似度{{current.similarity||'--'}}</span>
- </div>
- <div class='count-foot-table'>
- <ev-energy-table v-if='samples.length>=0' :samples='samples'></ev-energy-table>
- </div>
- </div>
- </div>
- </div>
- <div v-show='num == 3'>
- <ev-rate-title :chillerExecuteRateReal='chillerExecuteRateReal' :tab='3'></ev-rate-title>
- <ev-card v-if='cardList.length>=0' :cardList='cardList' :date='date'></ev-card>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import Head from '../main/index'
- import EvTwoTable from './evTwoTable'
- import EvStackedLine from './evStackedLine'
- import EvEnergyTable from './evEnergyTable'
- import EvCard from './evCard' //执行率
- import EvRateTitle from './evRateTitle'
- 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: '', // 传过来的日期@
- type: '', //传过来的日期 @
- value2: true,
- current: {}, //本日概况 @
- similarDay: {}, //相似日概况 @
- samples: [], //相似日列表 @
- maxArr: [], // @
- dataList: [], //室内温度满足率@
- tindoorFillRate: '', //室内温度满足率@
- energySavingRate: '', //节能率
- cardList: [], //执行率@
- dateVal: '', //@
- stackArr: [],
- accuracy: '',
- chillerExecuteRateReal: ''
- }
- },
- components: {
- Head,
- EvTwoTable,
- EvStackedLine,
- EvEnergyTable,
- EvCard,
- EvRateTitle,
- EvHistory,
- DateTemp
- },
- mounted() {
- this.init()
- },
- methods: {
- init() {
- 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 @
- queryTdbDayMethod(date) {
- this.dataList = []
- let obj = {}
- let getParams = {}
- if (this.value2) {
- getParams.isSatisfy = !this.value2
- } else {
- getParams = {}
- }
- this.tindoorFillRate = ''
- queryTdbDay(date, { getParams }).then(res => {
- this.tindoorFillRate = this.formatterRes(res.tindoorFillRate, 0, 1)
- console.log('室内温度满足率', this.tindoorFillRate)
- let content = res.content
- this.stackArr = content
- if (content && content.length > 0) {
- content.forEach(({ spaceDayRpt }) => {
- if (obj.hasOwnProperty(spaceDayRpt.floorId)) {
- obj[spaceDayRpt.floorId].children.push(spaceDayRpt)
- } else {
- obj[spaceDayRpt.floorId] = {
- id: spaceDayRpt.floorId,
- name: spaceDayRpt.floorLocalName,
- children: [spaceDayRpt]
- }
- }
- })
- }
- this.dataList = Object.values(obj).map(i => {
- // 增加 isExpand 属性
- i.isExpand = i.children.some(c => c.isSatisfy == false)
- return i
- })
- })
- },
- // 执行率@
- queryimplement(date) {
- let params = {
- postParams: {
- criteria: {
- date: date,
- projectId: this.$store.state.projectId
- }
- }
- }
- queryChillerExecuteInfo(params).then(res => {
- this.cardList = res.data ? res.data : []
- // console.log('执行率', res)
- })
- },
- // 根据tab @
- changeNumMethod(date) {
- if (this.num == 1) {
- this.queryTdbDayMethod(date)
- } else if (this.num == 2) {
- this.queryEnergyDayQuery(date)
- } else if (this.num == 3) {
- this.queryimplement(date)
- this.querychillerMethod(date)
- }
- },
- querychillerMethod(date) {
- let params = {
- postParams: {
- criteria: {
- projectId: this.$store.state.projectId,
- date: date
- }
- }
- }
- this.chillerExecuteRateReal = ''
- querychiller(params).then(res => {
- //执行率
- this.chillerExecuteRateReal = this.formatterRes(res.content[0].chillerExecuteRateReal, 0, 1)
- console.log('执行率', this.chillerExecuteRateReal)
- })
- },
- // 点击tab @
- changeNum(index) {
- this.num = index
- this.changeNumMethod(this.dateVal)
- },
- // @
- formatterStr(str) {
- if (str) {
- return str.substring(0, 4) + str.substring(5, 7) + str.substring(8, 10)
- }
- },
- // @
- pickerVal(val) {
- if (val) {
- this.dateVal = this.formatterStr(val)
- this.changeNumMethod(this.dateVal)
- }
- },
- // 节能率@
- queryEnergyDayQuery(date) {
- this.maxArr = []
- this.current = {}
- this.similarDay = {}
- this.samples = []
- energyDayQuery(date, {}).then(res => {
- if (res.result == 'success') {
- // 本日概况
- this.current = res.current ? res.current : {}
- if (Object.keys(res.current).length > 0) {
- this.energySavingRate = res.current.energySavingRate
- this.accuracy = res.current.accuracy
- // 节能率
- this.energySavingRate = this.formatterRes(this.energySavingRate, 0, 1)
- // 准确率
- this.accuracy = this.formatterRes(this.accuracy, 0, 1)
- }
- // 相似日概况
- this.similarDay = res.similarDay ? res.similarDay : {}
- // 相似日列表
- this.samples = res.samples ? res.samples : []
- if (this.samples.length > 0) {
- var outsiteTemp = [],
- indoorTemp = [],
- energy = []
- for (var i in this.samples) {
- outsiteTemp.push(this.samples[i].outsiteTemp)
- indoorTemp.push(this.samples[i].indoorTemp)
- energy.push(this.samples[i].energy)
- }
- let maxOutsiteTemp = this.maxMethod(this.sortMethod(outsiteTemp)),
- maxIndoorTemp = this.maxMethod(this.sortMethod(indoorTemp)),
- maxEnergy = this.maxMethod(this.sortMethod(energy))
- this.maxArr.push(maxOutsiteTemp, maxIndoorTemp, maxEnergy)
- } else {
- 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) {
- return arr.sort(function(num1, num2) {
- return num1 - num2
- })
- } else {
- return 1
- }
- },
- // @
- maxMethod(arr) {
- if (arr instanceof Array) {
- return eval(arr[arr.length - 1])
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .evTwoContainer {
- background: #fff;
- min-width: 1000px;
- .count-top {
- width: 100%;
- height: 100%;
- .count-top-left {
- width: 200px;
- display: flex;
- align-items: center;
- z-index: 1;
- position: fixed;
- left: 240px;
- top: 65px;
- span {
- display: inline-block;
- }
- span:nth-of-type(1) {
- height: 22px;
- font-size: 14px;
- color: #8d9399;
- line-height: 22px;
- cursor: pointer;
- }
- span:nth-of-type(2) {
- color: #c3c6cb;
- margin: 0 4px;
- margin-top: -3px;
- }
- span:nth-of-type(3) {
- height: 22px;
- font-size: 14px;
- color: #1f2429;
- line-height: 22px;
- }
- }
- ul {
- display: flex;
- padding: 0 16px;
- // width: 100%;
- justify-content: space-between;
- white-space: nowrap;
- align-items: center;
- margin: 0;
- text-align: center;
- position: fixed;
- left: 0;
- right: 0;
- top: 50px;
- z-index: 1;
- min-width: 810px;
- .count-top-right {
- width: 148px;
- }
- }
- ul li {
- cursor: pointer;
- height: 21px;
- float: left;
- font-size: 16px;
- color: rgba(31, 35, 41, 1);
- line-height: 21px;
- padding: 14px 16px;
- margin-right: 22px;
- }
- .count-bottom {
- padding: 0 16px;
- height: auto;
- background: #fff;
- margin-top: 16px;
- .count-bottom-switch {
- display: flex;
- justify-content: flex-end;
- align-items: center;
- margin-top: -14px;
- .switchSpan {
- height: 22px;
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: rgba(31, 36, 41, 1);
- line-height: 20px;
- margin-right: 16px;
- }
- }
- .count-historical-data {
- .count-foot {
- .count-foot-title {
- display: flex;
- align-items: center;
- margin-bottom: 16px;
- span:nth-of-type(1) {
- height: 24px;
- font-size: 16px;
- color: rgba(31, 36, 41, 1);
- line-height: 21px;
- margin-right: 16px;
- }
- span:nth-of-type(2) {
- width: 72px;
- height: 22px;
- background: rgba(225, 242, 255, 1);
- border-radius: 2px;
- font-size: 14px;
- color: rgba(0, 101, 179, 1);
- line-height: 22px;
- text-align: center;
- }
- }
- }
- }
- .count-bottom-content {
- margin-top: 12px;
- }
- .count-bottom-foot {
- margin-top: 46px;
- height: 480px;
- background: rgba(255, 255, 255, 1);
- border: 1px solid rgba(228, 230, 231, 1);
- }
- }
- .current {
- font-size: 16px;
- font-family: MicrosoftYaHei;
- color: #0091ff;
- line-height: 21px;
- border-bottom: 2px solid#0091FF;
- }
- }
- }
- </style>
- <style lang="scss">
- .count-bottom-switch {
- .el-switch__core {
- width: 40px !important;
- height: 22px;
- border-radius: 12px;
- }
- .el-switch.is-checked .el-switch__core::after {
- left: 100%;
- margin-left: -19px;
- }
- .el-switch__core:after {
- content: '';
- position: absolute;
- border-radius: 100%;
- -webkit-transition: all 0.3s;
- transition: all 0.3s;
- width: 18px;
- height: 18px;
- background-color: #fff;
- top: 1px;
- }
- }
- </style>
|