123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <template>
- <div>
- <Head :headText="headText"></Head>
- <div class="nav-right">
- <img class="nav-icon" v-if="navText" src="@/assets/shape.png" alt />
- <span class="nav-text1" v-if="navText">今日已收到 {{quickData.chillerCount || 0}} 条策略,其中有 {{quickData.hillerIsNotExecutedCount || 0}} 条未执行</span>
- <span class="nav-text" v-else>今天已收到 {{quickData.chillerCount || 0}} 条策略</span>
- <span class="nav-look MicrYaHei" @click="showTodayStrategy = true">查看</span>
- </div>
- <div class="strategyContainer">
- <div class="strate-left">
- <div class="strate-left-1">今天营业时间</div>
- <div class="strate-left-2">{{quickData.openTime || '--'}} - {{quickData.endTime || '--'}}</div>
- <div class="strate-left-1">当前运行模式</div>
- <div class="strate-left-2">{{quickData.model || '--'}}</div>
- <div class="strate-left-box">
- <div class="strate-left-info-1">通风策略</div>
- <div class="strate-left-info">开启时间:{{quickData.freshAirEqOpenTime || '--'}} - {{quickData.freshAirEqCloseTime || '--'}}</div>
- <div class="strate-left-info">新风机组:开启</div>
- <div class="strate-left-info">组合式空调机组:全新风</div>
- </div>
- </div>
- <div class="starte-right">
- <p class="strate-right-title">当前状态</p>
- <water-unit :data='quickData'></water-unit>
- <animation-box :data='quickData'></animation-box>
- </div>
- </div>
- <el-dialog title="提示" :visible.sync="showTodayStrategy" width="1260px">
- <today-strategy :data='tableData'></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:[],
- quickData:{},
- today:'',
- now:''
- };
- },
- components: {
- Head,
- animationBox,
- waterUnit,
- TodayStrategy
- },
- methods:{
- 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())
- console.log(year,month,date)
- 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
- },
- getQuickData(){
- let params = {
- postParams:{
- criteria:{
- projectId:"Pj4419000005",
- date: this.today, //日期 yyyyMMdd
- time: this.now, //时间 H24mi (最近的一个15分钟时间点,例如现在是23点35分,应传2330)
- },
- withColumns: [
- "chillerOrg","chillerHourList"
- ]
- }
- }
- queryCommand(params).then(res=>{
- console.log(res)
- if(res.data){
- this.quickData = res.data.content?res.data.content[0]:{}
- }
- })
- },
- getData(){
- let params = {
- postParams:{
- criteria:{
- projectId:"Pj4419000005",
- date:this.today
- }
- }
- }
- getCommand(params).then(res=>{
- console.log(res)
- if(res.data){
- this.tableData = res.data.content?res.data.content:[]
- }
- })
- }
- },
- mounted(){
- this.formatTime()
- this.getPer5Time()
- // let vm = this
- // setInterval(function(){
- // vm.getData()
- // },1500)
- this.getQuickData()
- this.getData()
- }
- };
- </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>
|