Commit 732e62a5 authored by zhuangzhuang's avatar zhuangzhuang

牛舍详情页-水槽,照明

parent 7115de25
...@@ -42,9 +42,9 @@ const routes: Routes = [ ...@@ -42,9 +42,9 @@ const routes: Routes = [
component: EnvDetailPage, component: EnvDetailPage,
children: [ children: [
{path: 'fan', component: EnvFanPage}, {path: 'fan', component: EnvFanPage},
{path: 'shower', component: EnvShowerPage}, {path: 'shower/:fieldRegionNo', component: EnvShowerPage},
{path: 'light', component: EnvLightPage}, {path: 'light/:fieldRegionNo', component: EnvLightPage},
{path: 'waterchannel', component: EnvWaterchannelPage}, {path: 'waterchannel/:fieldRegionNo', component: EnvWaterchannelPage},
{path: '', redirectTo: 'fan', pathMatch : 'prefix'}, {path: '', redirectTo: 'fan', pathMatch : 'prefix'},
] ]
}, },
......
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
</ion-buttons> </ion-buttons>
<ion-title mode="ios" class="title">{{item.fieldRegionName}}详情</ion-title> <ion-title mode="ios" class="title">{{item.fieldRegionName}}详情</ion-title>
</ion-toolbar> </ion-toolbar>
<div style="padding-top: 5px; padding-bottom: 7px; background-color: #F0F0F0"> <div class="top">
<span [ngClass]="{'online': item.online, 'offline': !item.online}">{{item.online ? '在线' : '离线'}} </span> <span [ngClass]="{'online': item.online, 'offline': !item.online}">{{item.online ? '在线' : '离线'}} </span>
<span *ngIf="item.operationModel" class="online">{{item.operationModel ? '平控' :'现控'}} </span> <span *ngIf="item.operationModel" class="online">{{item.operationModel ? '平控' :'现控'}} </span>
<span *ngIf="item.operationModel" [ngClass]="{'online': item.isWisdomModel, 'offline': !item.isWisdomModel}" class="online">智控 </span> <span *ngIf="item.operationModel" [ngClass]="{'online': item.isWisdomModel, 'offline': !item.isWisdomModel}" class="online">智控 </span>
<span *ngIf="item.ts" class="right">{{item.ts | date: 'yyyy-MM-dd HH:mm'}}</span>
</div> </div>
<div style="background-color: #F0F0F0;" align="center"> <div style="background-color: #F0F0F0;" align="center">
<v-kanban class="home-bar" name="温度" [inData]="item.temp" iconClass="vo v-wendu" iconColor="#285B90" iconSize="14px"></v-kanban> <v-kanban class="home-bar" name="温度" [inData]="item.temp" iconClass="vo v-wendu" iconColor="#285B90" iconSize="14px"></v-kanban>
...@@ -20,21 +21,29 @@ ...@@ -20,21 +21,29 @@
<ion-content style="background-color: #F3F4F4;"> <ion-content style="background-color: #F3F4F4;">
<ion-router-outlet></ion-router-outlet> <ion-router-outlet></ion-router-outlet>
<ion-tabs> <ion-tabs>
<!-- Tab bar -->
<ion-tab-bar slot="top"> <ion-tab-bar slot="top">
<ion-tab-button tab="fan"> <ion-tab-button tab="fan">
<ion-label>风机</ion-label> <ion-label>风机</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="shower"> <ion-tab-button tab="shower" routerLink="/env-detail/shower/{{fieldRegionNo}}"> <!--[rootParams]="fieldRegionNo"-->
<ion-label>喷淋</ion-label> <ion-label>喷淋</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="light"> <ion-tab-button tab="light" routerLink="/env-detail/light/{{fieldRegionNo}}">
<ion-label>照明</ion-label> <ion-label>照明</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="waterchannel"> <ion-tab-button tab="waterchannel" routerLink="/env-detail/waterchannel/{{fieldRegionNo}}">
<ion-label>水槽</ion-label> <ion-label>水槽</ion-label>
</ion-tab-button> </ion-tab-button>
</ion-tab-bar> </ion-tab-bar>
</ion-tabs> </ion-tabs>
</ion-content> </ion-content>
<!--<ion-tabs>-->
<!--<ion-tab [root]="fan" [rootParams]="fieldRegionNo" tabTitle="风机">-->
<!--</ion-tab>-->
<!--<ion-tab [root]="shower" [rootParams]="fieldRegionNo" tabTitle="风机">-->
<!--</ion-tab>-->
<!--<ion-tab [root]="light" [rootParams]="fieldRegionNo" tabTitle="风机">-->
<!--</ion-tab>-->
<!--</ion-tabs>-->
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
margin-left: 5px; margin-left: 5px;
} }
.top {
padding: 7px 5px;
background-color: #F0F0F0
}
.warmColor1 { .warmColor1 {
color: #71fa1d; color: #71fa1d;
} }
......
...@@ -24,6 +24,10 @@ export class EnvDetailPage implements OnInit { ...@@ -24,6 +24,10 @@ export class EnvDetailPage implements OnInit {
isLoading: true isLoading: true
}; };
fan = '/env-detail/fan';
shower = '/env-detail/shower';
light = '/env-detail/light';
ngOnInit() { ngOnInit() {
this.comm.isLoading = false; this.comm.isLoading = false;
this.comm.remain = 0; this.comm.remain = 0;
...@@ -44,7 +48,7 @@ export class EnvDetailPage implements OnInit { ...@@ -44,7 +48,7 @@ export class EnvDetailPage implements OnInit {
// TODO 测试用准备数据 // TODO 测试用准备数据
this.item = { this.item = {
// 3-重度热应激 在线 平控 非智控(自控) 有报警 // 3-重度热应激 在线 平控 非智控(自控) 有报警
fieldRegionName: '测试用4号牛舍', fieldRegionName: '1号牛舍',
temp: '23.5', temp: '23.5',
humi: '82.8', humi: '82.8',
heatStressLevel: '3', heatStressLevel: '3',
......
...@@ -54,15 +54,15 @@ export class EnvFanPage implements OnInit { ...@@ -54,15 +54,15 @@ export class EnvFanPage implements OnInit {
this.devices = data.param; this.devices = data.param;
// TODO 测试用准备数据 // TODO 测试用准备数据
this.fieldRegionNo = 'FRN136641006052720640'; // this.fieldRegionNo = 'FRN136641006052720640';
this.fieldDeviceType = '风机'; // this.fieldDeviceType = '风机';
this.controlModel = 0; // this.controlModel = 0;
this.devices = [{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'A号风机组', state: 1}, // this.devices = [{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'A号风机组', state: 1},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'B号风机组', state: 0}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'B号风机组', state: 0},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'C号风机组', state: 1}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'C号风机组', state: 1},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'D号风机组', state: 0}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'D号风机组', state: 0},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'E号风机组', state: 1}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'E号风机组', state: 1},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'F号风机组', state: 1}]; // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'F号风机组', state: 1}];
// 获取一键控制信息 // 获取一键控制信息
this.allCheck(this.batchSwitch); this.allCheck(this.batchSwitch);
...@@ -93,7 +93,6 @@ export class EnvFanPage implements OnInit { ...@@ -93,7 +93,6 @@ export class EnvFanPage implements OnInit {
// batchSwitch.state = false; // batchSwitch.state = false;
}]); }]);
// TODO 测试用准备数据 // TODO 测试用准备数据
this.batchSwitch.op = 0; // this.batchSwitch.op = 0;
} }
} }
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<span [ngClass]="{'online': item.online, 'offline': !item.online}">{{item.online ? '在线' : '离线'}} </span> <span [ngClass]="{'online': item.online, 'offline': !item.online}">{{item.online ? '在线' : '离线'}} </span>
<span *ngIf="item.operationModel" class="online">{{item.operationModel ? '平控' :'现控'}} </span> <span *ngIf="item.operationModel" class="online">{{item.operationModel ? '平控' :'现控'}} </span>
<span *ngIf="item.operationModel" [ngClass]="{'online': item.isWisdomModel, 'offline': !item.isWisdomModel}" class="online">智控 </span> <span *ngIf="item.operationModel" [ngClass]="{'online': item.isWisdomModel, 'offline': !item.isWisdomModel}" class="online">智控 </span>
<span *ngIf="item.ts" class="right">{{item.ts}}</span> <span *ngIf="item.ts" class="right">{{item.ts | date: 'yyyy-MM-dd HH:mm'}}</span>
</div> </div>
</div> </div>
</ion-item> </ion-item>
......
...@@ -73,7 +73,7 @@ export class EnvHomePage implements OnInit { ...@@ -73,7 +73,7 @@ export class EnvHomePage implements OnInit {
{ {
// 0-无热应激 离线 无报警 // 0-无热应激 离线 无报警
fieldRegionNo: 'FRN136641006052720640', fieldRegionNo: 'FRN136641006052720640',
fieldRegionName: '测试用1号牛舍', fieldRegionName: '1号牛舍',
temp: '23.5', temp: '23.5',
humi: '82', humi: '82',
heatStressLevel: '0', heatStressLevel: '0',
...@@ -85,7 +85,7 @@ export class EnvHomePage implements OnInit { ...@@ -85,7 +85,7 @@ export class EnvHomePage implements OnInit {
{ {
// 1-轻度热应激 在线 现控 无报警 // 1-轻度热应激 在线 现控 无报警
fieldRegionNo: 'FN108050436279648256', fieldRegionNo: 'FN108050436279648256',
fieldRegionName: '测试用2号牛舍', fieldRegionName: '2号牛舍',
temp: '23.5', temp: '23.5',
humi: '82', humi: '82',
heatStressLevel: '1', heatStressLevel: '1',
...@@ -98,7 +98,7 @@ export class EnvHomePage implements OnInit { ...@@ -98,7 +98,7 @@ export class EnvHomePage implements OnInit {
{ {
// 2-中度热应激 在线 平控 非智控(手控) 有报警 // 2-中度热应激 在线 平控 非智控(手控) 有报警
fieldRegionNo: 'FN108050436279648256', fieldRegionNo: 'FN108050436279648256',
fieldRegionName: '测试用3号牛舍', fieldRegionName: '3号牛舍',
temp: '23.5', temp: '23.5',
humi: '82', humi: '82',
heatStressLevel: '2', heatStressLevel: '2',
...@@ -112,7 +112,7 @@ export class EnvHomePage implements OnInit { ...@@ -112,7 +112,7 @@ export class EnvHomePage implements OnInit {
{ {
// 3-重度热应激 在线 平控 非智控(自控) 有报警 // 3-重度热应激 在线 平控 非智控(自控) 有报警
fieldRegionNo: 'FN108050436279648256', fieldRegionNo: 'FN108050436279648256',
fieldRegionName: '测试用4号牛舍', fieldRegionName: '4号牛舍',
temp: '23.5', temp: '23.5',
humi: '82', humi: '82',
heatStressLevel: '3', heatStressLevel: '3',
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
line-height: 25px; line-height: 25px;
margin-bottom: 5px;">时间模式</h1> margin-bottom: 5px;">时间模式</h1>
<ion-item lines="full"> <ion-item lines="full">
<i class="vo v-yue"></i> <i class="vo v-yue{{curDate}}"></i>
<span style="margin-left: 60px;font-size:15px"> 开启时间 {{on}}<br><br>关闭时间 {{off}}</span> <span style="margin-left: 100px; font-size:15px"> 开启时间 {{on}}<br><br>关闭时间 {{off}}</span>
</ion-item> </ion-item>
<h1 style=" <h1 style="
font-size: 16px; font-size: 16px;
...@@ -36,17 +36,32 @@ ...@@ -36,17 +36,32 @@
<ion-label>一键控制</ion-label> <ion-label>一键控制</ion-label>
<ion-toggle slot="end" [checked]="batchSwitch.op"></ion-toggle> <ion-toggle slot="end" [checked]="batchSwitch.op"></ion-toggle>
</ion-item> </ion-item>
<div> <div>
<ion-card *ngFor="let a of workarea.param" class="card" color="white"> <ion-card *ngFor="let device of devices" class="card" color="white">
<ion-card-header> <ion-card-header>
<ion-card-subtitle>{{a.name}}</ion-card-subtitle> <ion-card-subtitle align="center">{{device.fieldDeviceName}}</ion-card-subtitle>
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content>
<v-switch [value]="a.runningState" (click)="toggle(a)" style="float: none;display: inline-block;margin-top: 5px"></v-switch> <ion-toggle slot="middle" [checked]="device.state"></ion-toggle>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</div> </div>
<!--<ion-item *ngIf="batchSwitch" lines="full" insert="false">-->
<!--<ion-label>一键控制</ion-label>-->
<!--<ion-toggle slot="end" [checked]="batchSwitch.op"></ion-toggle>-->
<!--</ion-item>-->
<!--<div>-->
<!--<ion-card *ngFor="let a of workarea.param" class="card" color="white">-->
<!--<ion-card-header>-->
<!--<ion-card-subtitle>{{a.name}}</ion-card-subtitle>-->
<!--</ion-card-header>-->
<!--<ion-card-content>-->
<!--<v-switch [value]="a.runningState" (click)="toggle(a)" style="float: none;display: inline-block;margin-top: 5px"></v-switch>-->
<!--</ion-card-content>-->
<!--</ion-card>-->
<!--</div>-->
</ion-content> </ion-content>
i.vo.v-yue { i.vo {
padding-top: 5px;
padding-bottom: 5px;
font-size: 55px; font-size: 55px;
color: #199ED8; color: #199ED8;
} }
...@@ -9,3 +11,5 @@ i.vo.v-yue { ...@@ -9,3 +11,5 @@ i.vo.v-yue {
width:28%; width:28%;
margin: 10px 10px 5px 5px; margin: 10px 10px 5px 5px;
} }
import { Component, OnInit } from '@angular/core'; import {Component, Input, OnInit} from '@angular/core';
import {Api} from '../../service/api'; import {Api} from '../../service/api';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {Load} from '../../service/load'; import {Load} from '../../service/load';
...@@ -10,6 +10,7 @@ import {Load} from '../../service/load'; ...@@ -10,6 +10,7 @@ import {Load} from '../../service/load';
}) })
export class EnvLightPage implements OnInit { export class EnvLightPage implements OnInit {
// @Input() fieldRegionNo: string;
/* 照明 */ /* 照明 */
// 牧场区域编号 // 牧场区域编号
fieldRegionNo = ''; fieldRegionNo = '';
...@@ -25,6 +26,8 @@ export class EnvLightPage implements OnInit { ...@@ -25,6 +26,8 @@ export class EnvLightPage implements OnInit {
on = ''; on = '';
// 关闭时间 // 关闭时间
off = ''; off = '';
// 当前月份
curDate = 0;
// 各设备信息 // 各设备信息
devices = []; devices = [];
...@@ -68,20 +71,25 @@ export class EnvLightPage implements OnInit { ...@@ -68,20 +71,25 @@ export class EnvLightPage implements OnInit {
// ] // ]
// }; // };
constructor(private api: Api, private ac: ActivatedRoute, private load: Load) { } constructor(private api: Api, private ac: ActivatedRoute, private load: Load, private route: ActivatedRoute) { }
ngOnInit() { ngOnInit() {
this.ac.queryParams.subscribe((data) => { // this.ac.queryParams.subscribe((data) => {
this.fieldRegionNo = data.no; // this.fieldRegionNo = data.no;
}); // });
this.fieldRegionNo = this.route.snapshot.paramMap.get('fieldRegionNo');
this.getData(0); this.getData(0);
} }
toggle(a) { toggle(a) {
console.log("123"); console.log('123');
} }
getData(time) { getData(time) {
this.curDate = +new Date().getMonth();
this.ac.queryParams.subscribe((data) => {
this.fieldRegionNo = data.no;
});
if (time) { if (time) {
this.load.toLoad('加载中...', false); this.load.toLoad('加载中...', false);
} }
...@@ -90,35 +98,35 @@ export class EnvLightPage implements OnInit { ...@@ -90,35 +98,35 @@ export class EnvLightPage implements OnInit {
this.fieldRegionNo = data.fieldRegionNo; this.fieldRegionNo = data.fieldRegionNo;
this.fieldDeviceType = data.fieldDeviceType; this.fieldDeviceType = data.fieldDeviceType;
this.controlModel = data.controlModel; this.controlModel = data.controlModel;
this.startDate = data.startDate; this.startDate = data.controlConfig.startDate;
this.stopDate = data.stopDate; this.stopDate = data.controlConfig.stopDate;
this.on = data.on; this.on = data.controlConfig.on;
this.off = data.off; this.off = data.controlConfig.off;
this.devices = data.param; this.devices = data.param;
// TODO 测试用准备数据 // TODO 测试用准备数据
this.fieldRegionNo = 'FRN136641006052720640'; // this.fieldRegionNo = 'FRN136641006052720640';
this.fieldDeviceType = '照明'; this.startDate = '05-01';
this.controlModel = 2; this.stopDate = '08-31';
// this.fieldDeviceType = '照明';
// this.controlModel = 2;
this.on = '19:00'; this.on = '19:00';
this.off = '05:00'; this.off = '05:00';
this.devices = [{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'A号照明组', state: 1}, // this.devices = [{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'A号照明组', state: 1},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'B号照明组', state: 0}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'B号照明组', state: 0},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'C号照明组', state: 1}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'C号照明组', state: 1},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'D号照明组', state: 0}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'D号照明组', state: 0},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'E号照明组', state: 1}, // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'E号照明组', state: 1},
{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'F号照明组', state: 1}]; // {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'F号照明组', state: 1}];
// 获取一键控制信息 // 获取一键控制信息
this.allCheck(this.batchSwitch); this.allCheck(this.batchSwitch);
} }
}]); }]);
} }
allCheck(batchSwitch) { allCheck(batchSwitch) {
batchSwitch.type = this.fieldDeviceType; batchSwitch.type = this.fieldDeviceType;
const req = { const req = {
fieldRegionNo: this.fieldRegionNo, fieldRegionNo: this.fieldRegionNo,
op: batchSwitch.op, // op: batchSwitch.op ? 0 : 1, op: batchSwitch.op, // op: batchSwitch.op ? 0 : 1,
...@@ -138,7 +146,7 @@ export class EnvLightPage implements OnInit { ...@@ -138,7 +146,7 @@ export class EnvLightPage implements OnInit {
// batchSwitch.state = false; // batchSwitch.state = false;
}]); }]);
// TODO 测试用准备数据 // TODO 测试用准备数据
this.batchSwitch.op = 0; // this.batchSwitch.op = 0;
} }
} }
...@@ -11,10 +11,8 @@ ...@@ -11,10 +11,8 @@
margin-bottom: 5px;">模式状态</h1> margin-bottom: 5px;">模式状态</h1>
<ion-item lines="full"> <ion-item lines="full">
<ion-label>运行模式</ion-label> <ion-label>运行模式</ion-label>
<ion-select multiple="false" cancelText="取消" okText="确认" [(ngModel)]="workModeSetting.workMode" [(value)]="workModeSetting.workMode" (ionChange)="workModeEvent()"> <ion-select multiple="false" cancelText="取消" okText="确认" [(ngModel)]="controlModel" disabled="true">
<ion-select-option value="0">手控模式</ion-select-option> <ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option>
<ion-select-option value="1">自控模式</ion-select-option>
<ion-select-option value="2">智慧模式</ion-select-option>
</ion-select> </ion-select>
</ion-item> </ion-item>
...@@ -26,8 +24,8 @@ ...@@ -26,8 +24,8 @@
margin-bottom: 5px;">供液泵状态</h1> margin-bottom: 5px;">供液泵状态</h1>
<ion-item lines="full"> <ion-item lines="full">
<div [ngClass]="{'sucCir': bump.online, 'errCir': !bump.online}"></div>&nbsp; <div [ngClass]="{'sucCir': bump.online, 'errCir': !bump.online}"></div>&nbsp;
<span style="font-size: 13px">{{bump.online ? '在线' : '离线'}}</span> <span class="content">{{bump.online ? '在线' : '离线'}}</span>
<span style="font-size: 13px; margin-left: 30px">压力: {{bump.press}} Mpa</span> <span class="content" style="margin-left: 30px">压力: {{bump.press}} Mpa</span>
</ion-item> </ion-item>
<h1 style=" <h1 style="
font-size: 16px; font-size: 16px;
...@@ -35,32 +33,31 @@ ...@@ -35,32 +33,31 @@
border-left: 5px solid #28c9bd; border-left: 5px solid #28c9bd;
line-height: 25px; line-height: 25px;
margin-bottom: 5px;">时间参数</h1> margin-bottom: 5px;">时间参数</h1>
<ion-item lines="full" *ngFor="let a of workarea.param" insert="false"> <ion-item lines="full" *ngIf="controlConfig.a" insert="false">
<span style="font-size: 13px;">{{a.name}}喷淋时间 {{a.workTime}} 秒</span> <span class="content">A区喷淋时间 {{controlConfig.a}} 秒</span>
</ion-item> </ion-item>
<ion-item lines="full" insert="false"> <ion-item lines="full" *ngIf="controlConfig.b" insert="false">
<span style="font-size: 13px;">间隔时间 {{workarea.Interval}} 秒</span> <span class="content">B区喷淋时间 {{controlConfig.b}} 秒</span>
</ion-item> </ion-item>
<ion-item lines="full" *ngIf="controlConfig.interval" insert="false">
<span class="content">间隔时间 {{controlConfig.interval}} 秒</span>
</ion-item>
<h1 style=" <h1 style="
font-size: 16px; font-size: 16px;
padding-left: 5px; padding-left: 5px;
border-left: 5px solid #28c9bd; border-left: 5px solid #28c9bd;
line-height: 25px; line-height: 25px;
margin-bottom: 5px;">控制/状态</h1> margin-bottom: 5px;">控制/状态</h1>
<!--<ion-item *ngFor="let a of allBtns" lines="full" insert="false" >-->
<!--&lt;!&ndash;<v-switch [value]="a.value" (click)="toggle(a)" [loading]="a.loading"></v-switch>&ndash;&gt;-->
<!--<ion-label>一键控制{{a.l}}</ion-label>-->
<!--<v-switch [value]="a.v" (click)="allCheck(a)" [loading]="a.d"></v-switch>-->
<!--</ion-item>-->
<div> <div>
<ion-card *ngFor="let a of workarea.param" class="card" color="white"> <ion-card *ngFor="let a of param" class="card" color="white">
<ion-card-header> <ion-card-header>
<ion-card-title>{{a.name}}</ion-card-title> <ion-card-title class="card-title">{{a.fieldDeviceName}}</ion-card-title>
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content style="margin: 0px; padding-top:0px;">
<span>压力 {{a.press}} MPa</span><br> <span class="content">压力 {{a.press}} MPa</span><br>
<v-switch [value]="a.runningState" (click)="toggle(a)" style="float: none;display: inline-block;margin-top: 5px"></v-switch> <ion-toggle [checked]="a.state"></ion-toggle>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</div> </div>
......
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
float: none; float: none;
display: inline-block; display: inline-block;
width:42%; width:42%;
margin: 10px 10px 5px 5px; margin: 10px 10px 5px 10px;
text-align: center; text-align: center;
} }
.card-title {
font-size: 20px;
}
.content {
font-size: 13px;
}
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {Api} from '../../service/api';
import {ActivatedRoute} from '@angular/router';
import {Load} from '../../service/load';
@Component({ @Component({
selector: 'v-env-shower', selector: 'v-env-shower',
...@@ -17,30 +20,52 @@ export class EnvShowerPage implements OnInit { ...@@ -17,30 +20,52 @@ export class EnvShowerPage implements OnInit {
isLoading : true isLoading : true
}; };
bump = {online:true, // 牧场区域编号
press:0.4}; fieldRegionNo = '';
// 牧场设备类型
workarea = { fieldDeviceType = '';
Interval: 25, //间隔时间 // 模式状态
param: [ controlModel = 0;
{ // 供液泵状态
name: 'A区', bump = {online: true, press: 0};
workTime:25, //工作时长 // 时间参数
press:0.3, //水压 controlConfig = {
runningState:true, // 是否开启 name: '',
}, interval: 0, // 间隔时间
{ a: '', // A区喷淋时间
name: 'B区', t: '',
workTime:25, b: '', // A区喷淋时间
press:0.4,
runningState:false,
},
]
}; };
// 各设备信息
param = [];
constructor() { } controlModelOptions = [
{modelId: 0, modelValue: '手控模式'},
{modelId: 1, modelValue: '自控模式'},
{modelId: 2, modelValue: '智慧控制'}];
constructor(private api: Api, private ac: ActivatedRoute, private load: Load, private route: ActivatedRoute) { }
ngOnInit() { ngOnInit() {
this.fieldRegionNo = this.route.snapshot.paramMap.get('fieldRegionNo');
this.getData(0);
}
getData(time) {
if (time) {
this.load.toLoad('加载中...', false);
}
this.api.cowshedApp.getPenLinData([{'fieldRegionNo' : this.fieldRegionNo}, (data) => {
if (data) {
debugger;
this.fieldRegionNo = data.fieldRegionNo;
this.fieldDeviceType = data.fieldDeviceType;
this.controlModel = data.controlModel;
this.bump = data.bump;
this.controlConfig = data.controlConfig;
this.param = data.param;
}
}]);
} }
} }
...@@ -8,15 +8,14 @@ ...@@ -8,15 +8,14 @@
border-left: 5px solid #28c9bd; border-left: 5px solid #28c9bd;
line-height: 25px; line-height: 25px;
margin-bottom: 5px;">状态</h1> margin-bottom: 5px;">状态</h1>
<ion-card *ngFor="let a of workarea.param" class="card" color="white"> <ion-card *ngFor="let device of devices" class="card" color="white">
<ion-card-header> <ion-card-header>
<ion-card-title> <span [ngClass]="{'sucCir': device.online, 'errCir': !device.online}"></span>&nbsp; {{device .fieldDeviceName}}</ion-card-title>
<ion-card-title> <span [ngClass]="{'sucCir': a.online, 'errCir': !a.online}"></span>&nbsp; {{a.name}}</ion-card-title>
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content>
<span>当前功率 </span> <span> {{a.kw}} KW<br></span> <span>当前功率 </span> <span> {{device.kw}} KW<br></span>
<span>估计加热设备台数 </span> <span> {{a.deviceOnLineNum}} 台</span> <span>估计加热设备台数 </span> <span> {{device.deviceOnlineNum}} 台</span>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
</ion-content> </ion-content>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {Api} from '../../service/api';
import {ActivatedRoute} from '@angular/router';
import {Load} from '../../service/load';
@Component({ @Component({
selector: 'v-env-waterchannel', selector: 'v-env-waterchannel',
...@@ -6,10 +9,10 @@ import { Component, OnInit } from '@angular/core'; ...@@ -6,10 +9,10 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./env-waterchannel.page.scss'], styleUrls: ['./env-waterchannel.page.scss'],
}) })
export class EnvWaterchannelPage implements OnInit { export class EnvWaterchannelPage implements OnInit {
// 牧场区域编号
workModeSetting = { 'workMode' : '1', fieldRegionNo = '';
'DeviceNo' : '', // 牧场设备
'workModeOld' : '1'}; devices = [];
// 发送指令延时判断 // 发送指令延时判断
comm = { comm = {
...@@ -17,32 +20,25 @@ export class EnvWaterchannelPage implements OnInit { ...@@ -17,32 +20,25 @@ export class EnvWaterchannelPage implements OnInit {
isLoading : true isLoading : true
}; };
workarea = { constructor(private api: Api, private ac: ActivatedRoute, private load: Load, private route: ActivatedRoute) { }
param: [
{
name: '1号组',
kw:0.3, //当前功率
deviceOnLineNum:3, //估计加热设备台数
online:true,
},
{
name: '2号组',
kw:3, //当前功率
deviceOnLineNum:2, //估计加热设备台数
online:true,
},
{
name: '3号组',
kw:15, //当前功率
deviceOnLineNum:10, //估计加热设备台数
online:true,
},
]
};
constructor() { }
ngOnInit() { ngOnInit() {
// this.ac.queryParams.subscribe((data) => {
// this.fieldRegionNo = data.no;
// });
this.fieldRegionNo = this.route.snapshot.paramMap.get('fieldRegionNo');
this.getData(0);
}
getData(time) {
if (time) {
this.load.toLoad('加载中...', false);
}
this.api.cowshedApp.getShuiCaoData([{'fieldRegionNo' : this.fieldRegionNo}, (data) => {
if (data) {
this.devices = data.param;
}
}]);
} }
} }
...@@ -45,13 +45,14 @@ export class Api { ...@@ -45,13 +45,14 @@ export class Api {
// 获取照明信息 // 获取照明信息
getZhaoMingData: (data) => this.trans('post', '/cowshedApp/getZhaoMingData', data), getZhaoMingData: (data) => this.trans('post', '/cowshedApp/getZhaoMingData', data),
// 获取水槽信息 // 获取水槽信息
getShuiCaoData: (data) => this.trans('post', '/cowshedApp/getShuiCaoData', data),
}; };
public alert = { public alert = {
//获取告警列表的数据 // 获取告警列表的数据
getAll: (data)=> this.trans('post', '/alert/getAll', data), getAll: (data) => this.trans('post', '/alert/getAll', data),
//获取告警列表的数据 // 获取告警列表的数据
getByTerm: (data)=> this.trans('post', '/alert/getByTerm', data), getByTerm: (data) => this.trans('post', '/alert/getByTerm', data),
} }
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment