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