Commit e2d344a5 authored by yating.lin's avatar yating.lin

接口调试

parent de1e2867
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.witium.muchang.test" version="2.9.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.witium.muchang.test" version="2.9.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>牧场云</name> <name>牧场云</name>
<description>test</description> <description>test</description>
<author email="frank.feng@witium.com" href="http://muchang.witium.com/">Van.chen - frank.feng</author> <author email="frank.feng@witium.com" href="http://muchang.witium.com/">Van.chen - frank.feng</author>
......
...@@ -56,12 +56,19 @@ const routes: Routes = [ ...@@ -56,12 +56,19 @@ const routes: Routes = [
{path: 'env-detail', {path: 'env-detail',
component: EnvDetailPage, component: EnvDetailPage,
children: [ children: [
{path: 'fan', component: EnvFanPage}, {path: 'tab-fan', component: EnvFanPage},
{path: 'shower/:fieldRegionNo', component: EnvShowerPage}, {path: 'tab-shower/:fieldRegionNo', component: EnvShowerPage},
{path: 'light/:fieldRegionNo', component: EnvLightPage}, {path: 'tab-light/:fieldRegionNo', component: EnvLightPage},
{path: 'waterchannel/:fieldRegionNo', component: EnvWaterchannelPage}, {path: 'tab-waterchannel/:fieldRegionNo', component: EnvWaterchannelPage},
{path: '', redirectTo: 'fan', pathMatch : 'prefix'}, {path: '', redirectTo: 'tab-fan', pathMatch : 'prefix'},
] ]
// children: [
// {path: 'tab-fan', component: EnvFanPage},
// {path: 'tab-shower', component: EnvShowerPage},
// {path: 'tab-light', component: EnvLightPage},
// {path: 'tab-waterchannel', component: EnvWaterchannelPage},
// {path: '', redirectTo: 'tab-fan', pathMatch : 'prefix'},
// ]
}, },
// { path: 'env-detail', loadChildren: './envCtrl/env-detail/env-detail.module#EnvDetailPageModule' }, // { path: 'env-detail', loadChildren: './envCtrl/env-detail/env-detail.module#EnvDetailPageModule' },
......
...@@ -57,10 +57,9 @@ ...@@ -57,10 +57,9 @@
</div> </div>
</ion-item> </ion-item>
<div style="padding:5px;"> <div style="padding:5px;">
<div class="detailContent"> <div class="detailContent">
<div class="timeline"> <div class="timeline" *ngIf="detailInfo.trouble">
<div class="entry" *ngFor="let item of detailInfo.trouble"> <div class="entry" *ngFor="let item of detailInfo.trouble">
<div class="title"> <div class="title">
<div><img [src]="'../../assets/img/' + item.fieldDeviceType + '.png'" class="deviceIcon"></div> <div><img [src]="'../../assets/img/' + item.fieldDeviceType + '.png'" class="deviceIcon"></div>
......
...@@ -79,8 +79,8 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -79,8 +79,8 @@ export class EnvAlarmDetailPage implements OnInit {
this.detailInfo = {}; this.detailInfo = {};
const req = { const req = {
fieldRegionNo: this.fieldRegionNo, fieldRegionNo: this.fieldRegionNo,
startTime: this.startTime, startTime: this.parseTime(this.startTime, 'start'),
stopTime: this.stopTime, stopTime: this.parseTime(this.stopTime, 'stop'),
disposeState: '', disposeState: '',
fieldDeviceType: '' fieldDeviceType: ''
}; };
...@@ -91,58 +91,58 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -91,58 +91,58 @@ export class EnvAlarmDetailPage implements OnInit {
req.fieldDeviceType = this.fieldDeviceType; req.fieldDeviceType = this.fieldDeviceType;
} }
this.api.troubleLog.getByTerm([req, (data) => { this.api.troubleLog.getByTerm([req, (data) => {
// --------------------------------------------------------- // START---------------------------------------------------------
// TODO 测试用数据 // TODO 测试用数据
data = { // data = {
fieldRegionNo: 'FRN110268534764224512', // fieldRegionNo: 'FRN110268534764224512',
fieldRegionName: '1号牛舍', // fieldRegionName: '1号牛舍',
startTime: 1565165000000, // startTime: 1565165000000,
stopTime: 156516501230000, // stopTime: 156516501230000,
devErr: 11, // devErr: 11,
devErrTotal: 33, // devErrTotal: 33,
trouble: [{ // trouble: [{
troubleLogNo: '123415646196875456', // troubleLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '一号风机组故障', // description: '一号风机组故障',
troubleTime: 1565165000000, // troubleTime: 1565165000000,
data: {liquidPump: 25, press: 50}, // data: {liquidPump: 25, press: 50},
disposeState: 0 // disposeState: 0
}, { // }, {
troubleLogNo: '123415646196875456', // troubleLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '一号风机组故障', // description: '一号风机组故障',
troubleTime: 1565165000000, // troubleTime: 1565165000000,
data: {liquidPump: 25, press: 50}, // data: {liquidPump: 25, press: 50},
disposeState: 0 // disposeState: 0
}, { // }, {
troubleLogNo: '123415646196875456', // troubleLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '一号风机组故障', // description: '一号风机组故障',
troubleTime: 1565165000000, // troubleTime: 1565165000000,
data: {liquidPump: 25, press: 50}, // data: {liquidPump: 25, press: 50},
disposeState: 0 // disposeState: 0
}, { // }, {
troubleLogNo: '123415646196875456', // troubleLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '一号风机组故障', // description: '一号风机组故障',
troubleTime: 1565165000000, // troubleTime: 1565165000000,
data: {liquidPump: 25, press: 50}, // data: {liquidPump: 25, press: 50},
disposeState: 0 // disposeState: 0
}, { // }, {
troubleLogNo: '123415646196875456', // troubleLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '一号风机组故障', // description: '一号风机组故障',
troubleTime: 1565165000000, // troubleTime: 1565165000000,
data: {liquidPump: 25, press: 50}, // data: {liquidPump: 25, press: 50},
disposeState: 0 // disposeState: 0
}] // }]
}; // };
// -------------------------------------------------------- // END--------------------------------------------------------
this.detailInfo = data; this.detailInfo = data;
if (data.trouble && data.trouble.constructor === Array) { if (data.trouble && data.trouble.constructor === Array) {
...@@ -160,8 +160,8 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -160,8 +160,8 @@ export class EnvAlarmDetailPage implements OnInit {
this.detailInfo = {}; this.detailInfo = {};
const req = { const req = {
fieldRegionNo: this.fieldRegionNo, fieldRegionNo: this.fieldRegionNo,
startTime: this.startTime, startTime: this.parseTime(this.startTime, 'start'),
stopTime: this.stopTime, stopTime: this.parseTime(this.stopTime, 'stop'),
disposeState: '', disposeState: '',
fieldDeviceType: '' fieldDeviceType: ''
}; };
...@@ -172,58 +172,58 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -172,58 +172,58 @@ export class EnvAlarmDetailPage implements OnInit {
req.fieldDeviceType = this.fieldDeviceType; req.fieldDeviceType = this.fieldDeviceType;
} }
this.api.alarm.getCowshedAlarm([req, (data) => { this.api.alarm.getCowshedAlarm([req, (data) => {
// --------------------------------------------------------- // START---------------------------------------------------------
// TODO 测试用数据 // TODO 测试用数据
data = { // data = {
fieldRegionNo: 'FRN110268534764224512', // fieldRegionNo: 'FRN110268534764224512',
fieldRegionName: '1号牛舍', // fieldRegionName: '1号牛舍',
startTime: 1565165000000, // startTime: 1565165000000,
stopTime: 156516501230000, // stopTime: 156516501230000,
alarm: 22, // alarm: 22,
alarmTotal: 44, // alarmTotal: 44,
trouble: [{ // trouble: [{
alarmLogNo: '123415646196875456', // alarmLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '温度偏高', // description: '温度偏高',
data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50}, // data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50},
alarmTime: 1565165000000, // alarmTime: 1565165000000,
disposeState: 0 // disposeState: 0
}, { // }, {
alarmLogNo: '123415646196875456', // alarmLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '温度偏高', // description: '温度偏高',
data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50}, // data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50},
alarmTime: 1565165000000, // alarmTime: 1565165000000,
disposeState: 0 // disposeState: 0
}, { // }, {
alarmLogNo: '123415646196875456', // alarmLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '温度偏高', // description: '温度偏高',
data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50}, // data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50},
alarmTime: 1565165000000, // alarmTime: 1565165000000,
disposeState: 0 // disposeState: 0
}, { // }, {
alarmLogNo: '123415646196875456', // alarmLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '温度偏高', // description: '温度偏高',
data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50}, // data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50},
alarmTime: 1565165000000, // alarmTime: 1565165000000,
disposeState: 0 // disposeState: 0
}, { // }, {
alarmLogNo: '123415646196875456', // alarmLogNo: '123415646196875456',
fieldDeviceName: '一号风机组', // fieldDeviceName: '一号风机组',
fieldDeviceType: '风机', // fieldDeviceType: '风机',
description: '温度偏高', // description: '温度偏高',
data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50}, // data: {temp: 25, humid: 50, heatStressLevel: '轻度', liquidPump: 25, press: 50, NH3: 50},
alarmTime: 1565165000000, // alarmTime: 1565165000000,
disposeState: 0 // disposeState: 0
}] // }]
}; // };
// --------------------------------------------------------- // END---------------------------------------------------------
this.detailInfo = data; this.detailInfo = data;
if (data.trouble && data.trouble.constructor === Array) { if (data.trouble && data.trouble.constructor === Array) {
...@@ -303,6 +303,18 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -303,6 +303,18 @@ export class EnvAlarmDetailPage implements OnInit {
return time; return time;
} }
parseTime(time, flg) {
const year = time.slice(0, 4);
const month = parseInt(time.slice(5, 7), 10);
let updateTime = 0;
if (flg === 'start') {
updateTime = new Date( year, month - 1, 1, 0, 0, 0).valueOf();
} else {
updateTime = new Date( year, month, 0, 23, 59, 59).valueOf();
}
return updateTime;
}
reflush() { reflush() {
this.getTroubleList(); this.getTroubleList();
this.getAlarmList(); this.getAlarmList();
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
} }
.alarmNum { .alarmNum {
border-radius: 10px; border-radius: 17px;
background-color: #d33939; background-color: #d33939;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
...@@ -76,6 +76,17 @@ ...@@ -76,6 +76,17 @@
color: white; color: white;
margin-left: 10px; margin-left: 10px;
font-size: 12px; font-size: 12px;
width: 16px;
height: 16px;
text-align: center;
//width: 17px;
//height: 17px;
//border-radius: 17px;
//background-color: #28c9bd;
//display: inline-block;
//vertical-align: middle;
//box-shadow: #ccc 0.5px 0.5px 3px;
} }
.label { .label {
......
...@@ -11,47 +11,49 @@ import {Load} from '../../service/load'; ...@@ -11,47 +11,49 @@ import {Load} from '../../service/load';
}) })
export class EnvAlarmPage implements OnInit { export class EnvAlarmPage implements OnInit {
alarmItems = [{ alarmItems = [];
factoryNo: 'FN108050436279648256', // TODO 测试用数据
factoryName: '一厂', // alarmItems = [{
fieldRegionNo: 'FRN110268534764224511', // factoryNo: 'FN108050436279648256',
fieldRegionName: '1号牛舍', // factoryName: '一厂',
devErr: 36, // fieldRegionNo: 'FRN110268534764224511',
devErrTotal: 55, // fieldRegionName: '1号牛舍',
alarm: 20, // devErr: 36,
alarmTotal: 55, // devErrTotal: 55,
total: 56 // alarm: 20,
}, { // alarmTotal: 55,
factoryNo: 'FN108050436279648256', // total: 56
factoryName: '一厂', // }, {
fieldRegionNo: 'FRN110268534764224512', // factoryNo: 'FN108050436279648256',
fieldRegionName: '2号牛舍', // factoryName: '一厂',
devErr: 36, // fieldRegionNo: 'FRN110268534764224512',
devErrTotal: 55, // fieldRegionName: '2号牛舍',
alarm: 20, // devErr: 36,
alarmTotal: 55, // devErrTotal: 55,
total: 56 // alarm: 20,
}, { // alarmTotal: 55,
factoryNo: 'FN108050436279648256', // total: 56
factoryName: '一厂', // }, {
fieldRegionNo: 'FRN110268534764224513', // factoryNo: 'FN108050436279648256',
fieldRegionName: '3号牛舍', // factoryName: '一厂',
devErr: 36, // fieldRegionNo: 'FRN110268534764224513',
devErrTotal: 55, // fieldRegionName: '3号牛舍',
alarm: 20, // devErr: 36,
alarmTotal: 55, // devErrTotal: 55,
total: 56 // alarm: 20,
}, { // alarmTotal: 55,
factoryNo: 'FN108050436279648256', // total: 56
factoryName: '一厂', // }, {
fieldRegionNo: 'FRN110268534764224514', // factoryNo: 'FN108050436279648256',
fieldRegionName: '4号牛舍', // factoryName: '一厂',
devErr: 36, // fieldRegionNo: 'FRN110268534764224514',
devErrTotal: 55, // fieldRegionName: '4号牛舍',
alarm: 20, // devErr: 36,
alarmTotal: 55, // devErrTotal: 55,
total: 56 // alarm: 20,
}]; // alarmTotal: 55,
// total: 56
// }];
curFieldRegion = {factoryNo: '', curFieldRegion = {factoryNo: '',
factoryName: '', factoryName: '',
...@@ -151,12 +153,11 @@ export class EnvAlarmPage implements OnInit { ...@@ -151,12 +153,11 @@ export class EnvAlarmPage implements OnInit {
dismissPopover(interval) { dismissPopover(interval) {
this.load.toLoad('加载中...', false); this.load.toLoad('加载中...', false);
const condition = {fieldRegionNo: this.curFieldRegion.fieldRegionNo, const condition = {
startTime: this.getStartTime(interval), fieldRegionNo: this.curFieldRegion.fieldRegionNo,
startTime: this.getStartTime(interval).valueOf(),
stopTime: new Date().valueOf() stopTime: new Date().valueOf()
}; };
console.log(condition.startTime);
console.log(condition.stopTime);
this.api.alert.getByTerm([condition, (data) => { this.api.alert.getByTerm([condition, (data) => {
if (data && data.fieldRegionNo) { if (data && data.fieldRegionNo) {
......
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
<div *ngIf="fan"> <div *ngIf="fan">
<ion-item-divider sticky="true" class="itemDriver subTitle"> <ion-item-divider sticky="true" class="itemDriver subTitle">
<ion-label style="width: 40%">风机模式配置</ion-label> <ion-label style="width: 40%">风机模式配置</ion-label>
<ion-select multiple="false" cancelText="取消" okText="确认" class="selectFont" [(ngModel)]="fan.controlModel"> <ion-select multiple="false" cancelText="取消" okText="确认" class="selectFont" [(ngModel)]="fan.controlModel" (ionChange)="workModeChange('fan')">
<ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option> <ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option>
</ion-select> </ion-select>
<ion-icon name="add" slot="end" class="iconOpen" *ngIf="!isOpenFan" (click)="openItem('fanCfg')"></ion-icon> <ion-icon name="add" slot="end" class="iconOpen" *ngIf="!isOpenFan && isFanDisplay" (click)="openItem('fanCfg')"></ion-icon>
<ion-icon name="remove" slot="end" class="iconOpen" *ngIf="isOpenFan" (click)="openItem('fanCfg')"></ion-icon> <ion-icon name="remove" slot="end" class="iconOpen" *ngIf="isOpenFan && isFanDisplay" (click)="openItem('fanCfg')"></ion-icon>
</ion-item-divider> </ion-item-divider>
<div *ngIf="isOpenFan" @shrink > <div *ngIf="isOpenFan && isFanDisplay" @shrink >
<ion-item class="fanItem" lines="none" > <ion-item class="fanItem" lines="none" >
<ion-grid> <ion-grid>
<ion-row> <ion-row>
...@@ -85,13 +85,13 @@ ...@@ -85,13 +85,13 @@
<div *ngIf="shower"> <div *ngIf="shower">
<ion-item-divider sticky="true" class="itemDriver subTitle"> <ion-item-divider sticky="true" class="itemDriver subTitle">
<ion-label style="width: 40%">喷淋模式配置</ion-label> <ion-label style="width: 40%">喷淋模式配置</ion-label>
<ion-select multiple="false" cancelText="取消" okText="确认" class="selectFont" [(ngModel)]="shower.controlModel"> <ion-select multiple="false" cancelText="取消" okText="确认" class="selectFont" [(ngModel)]="shower.controlModel" (ionChange)="workModeChange('shower')">
<ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option> <ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option>
</ion-select> </ion-select>
<ion-icon name="add" slot="end" class="iconOpen" *ngIf="!isOpenShower" (click)="openItem('showerCfg')"></ion-icon> <ion-icon name="add" slot="end" class="iconOpen" *ngIf="!isOpenShower && isShowerDisplay" (click)="openItem('showerCfg')"></ion-icon>
<ion-icon name="remove" slot="end" class="iconOpen" *ngIf="isOpenShower" (click)="openItem('showerCfg')"></ion-icon> <ion-icon name="remove" slot="end" class="iconOpen" *ngIf="isOpenShower && isShowerDisplay" (click)="openItem('showerCfg')"></ion-icon>
</ion-item-divider> </ion-item-divider>
<div *ngIf="isOpenShower" @shrink > <div *ngIf="isOpenShower && isShowerDisplay" @shrink >
<ion-item-sliding *ngFor="let allCfg of shower.controlConfig"> <ion-item-sliding *ngFor="let allCfg of shower.controlConfig">
<ion-item class="fanItem"> <ion-item class="fanItem">
<ion-grid> <ion-grid>
...@@ -154,13 +154,13 @@ ...@@ -154,13 +154,13 @@
<div *ngIf="light"> <div *ngIf="light">
<ion-item-divider sticky="true" class="itemDriver subTitle"> <ion-item-divider sticky="true" class="itemDriver subTitle">
<ion-label style="width: 40%">照明配置</ion-label> <ion-label style="width: 40%">照明配置</ion-label>
<ion-select multiple="false" cancelText="取消" okText="确认" class="selectFont" [(ngModel)]="light.controlModel"> <ion-select multiple="false" cancelText="取消" okText="确认" class="selectFont" [(ngModel)]="light.controlModel" (ionChange)="workModeChange('light')">
<ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option> <ion-select-option *ngFor="let option of controlModelOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option>
</ion-select> </ion-select>
<ion-icon name="add" slot="end" class="iconOpen" *ngIf="!isOpenLight" (click)="openItem('lightCfg')"></ion-icon> <ion-icon name="add" slot="end" class="iconOpen" *ngIf="!isOpenLight && isLightDisplay" (click)="openItem('lightCfg')"></ion-icon>
<ion-icon name="remove" slot="end" class="iconOpen" *ngIf="isOpenLight" (click)="openItem('lightCfg')"></ion-icon> <ion-icon name="remove" slot="end" class="iconOpen" *ngIf="isOpenLight && isLightDisplay" (click)="openItem('lightCfg')"></ion-icon>
</ion-item-divider> </ion-item-divider>
<div *ngIf="isOpenLight" @shrink > <div *ngIf="isOpenLight && isLightDisplay" @shrink >
<ion-item-sliding *ngFor="let allCfg of light.controlConfig" > <ion-item-sliding *ngFor="let allCfg of light.controlConfig" >
<ion-item class="fanItem"> <ion-item class="fanItem">
<ion-grid> <ion-grid>
...@@ -303,19 +303,19 @@ ...@@ -303,19 +303,19 @@
<tr style="height: 30px"> <tr style="height: 30px">
<th>温度</th> <th>温度</th>
<td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.TU" (ionFocus)="tempHaveTouch($event)" class="tdBorder"></ion-input></td> <td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.TU" (ionFocus)="tempHaveTouch($event)" class="tdBorder"></ion-input></td>
<td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.TL" (ionFocus)="tempHaveTouch($event)" class="tdBorder" style="border-right: 1px solid"></ion-input></td> <td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.TL" (ionFocus)="tempHaveTouch($event)" class="tdBorder" style="border-right: 1px solid lightgray;"></ion-input></td>
<td></td> <td></td>
</tr> </tr>
<tr style="height: 30px"> <tr style="height: 30px">
<th>湿度</th> <th>湿度</th>
<td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.HU" (ionFocus)="humHaveTouch($event)" class="tdBorder"></ion-input></td> <td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.HU" (ionFocus)="humHaveTouch($event)" class="tdBorder"></ion-input></td>
<td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.HL" (ionFocus)="humHaveTouch($event)" class="tdBorder" style="border-right: 1px solid"></ion-input></td> <td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.HL" (ionFocus)="humHaveTouch($event)" class="tdBorder" style="border-right: 1px solid lightgray;"></ion-input></td>
<td>% rH</td> <td>% rH</td>
</tr> </tr>
<tr style="height: 30px"> <tr style="height: 30px">
<th>氨气</th> <th>氨气</th>
<td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.NH3U" (ionFocus)="humHaveTouch($event)" class="tdBorder" style="border-bottom: 1px solid"></ion-input></td> <td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.NH3U" (ionFocus)="humHaveTouch($event)" class="tdBorder" style="border-bottom: 1px solid lightgray;"></ion-input></td>
<td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.NH3L" (ionFocus)="humHaveTouch($event)" class="tdBorder" style="border-right: 1px solid; border-bottom: 1px solid"></ion-input></td> <td><ion-input [(ngModel)]="curCowshed.environmentConfigJson.NH3L" (ionFocus)="humHaveTouch($event)" class="tdBorder" style="border-right: 1px solid lightgray; border-bottom: 1px solid lightgray;"></ion-input></td>
<td>ppm</td> <td>ppm</td>
</tr> </tr>
......
...@@ -67,6 +67,9 @@ export class EnvCfgPage implements OnInit { ...@@ -67,6 +67,9 @@ export class EnvCfgPage implements OnInit {
isOpenInHouse = false; isOpenInHouse = false;
isOpenEnvironment = false; isOpenEnvironment = false;
isOpenHeatStress = false; isOpenHeatStress = false;
isLightDisplay = false;
isShowerDisplay = false;
isFanDisplay = false;
private $ionicPopup: any; private $ionicPopup: any;
...@@ -144,6 +147,7 @@ export class EnvCfgPage implements OnInit { ...@@ -144,6 +147,7 @@ export class EnvCfgPage implements OnInit {
init() { init() {
this.getData(0); this.getData(0);
// 替换模式 添加模式返回时
this.ac.queryParams.subscribe((data) => { this.ac.queryParams.subscribe((data) => {
if (data) { if (data) {
if (data.addModelCfg) { if (data.addModelCfg) {
...@@ -319,6 +323,7 @@ export class EnvCfgPage implements OnInit { ...@@ -319,6 +323,7 @@ export class EnvCfgPage implements OnInit {
// }; // };
// END---------------------------------------------------- // END----------------------------------------------------
if (data) { if (data) {
data.environmentConfigJson = JSON.parse(data.environmentConfigJson.toString());
this.curCowshed = data; this.curCowshed = data;
this.curCowshed.isWisdomModelChecked = this.curCowshed.isWisdomModel ? true : false; this.curCowshed.isWisdomModelChecked = this.curCowshed.isWisdomModel ? true : false;
this.initConfig(); this.initConfig();
...@@ -331,7 +336,9 @@ export class EnvCfgPage implements OnInit { ...@@ -331,7 +336,9 @@ export class EnvCfgPage implements OnInit {
} }
// 显示牛舍配置信息 // 显示牛舍配置信息
// 控制模式为[手控]时,模式框非表示
initConfig() { initConfig() {
const configInfo = this.curCowshed.config; const configInfo = this.curCowshed.config;
// 各设备配置情报 // 各设备配置情报
if (configInfo && configInfo.constructor === Array) { if (configInfo && configInfo.constructor === Array) {
...@@ -339,6 +346,8 @@ export class EnvCfgPage implements OnInit { ...@@ -339,6 +346,8 @@ export class EnvCfgPage implements OnInit {
switch (value.fieldDeviceType) { switch (value.fieldDeviceType) {
case '风机': case '风机':
this.fan = value; this.fan = value;
this.isFanDisplay = this.fan.controlModel === 0 ? false : true;
break; break;
case '喷淋' : case '喷淋' :
const showerConfig = JSON.parse(value.controlConfig); const showerConfig = JSON.parse(value.controlConfig);
...@@ -346,6 +355,8 @@ export class EnvCfgPage implements OnInit { ...@@ -346,6 +355,8 @@ export class EnvCfgPage implements OnInit {
this.shower.controlModel = value.controlModel; this.shower.controlModel = value.controlModel;
this.shower.dataConfig = value.dataConfig; this.shower.dataConfig = value.dataConfig;
this.shower.controlConfig = showerConfig; this.shower.controlConfig = showerConfig;
this.isShowerDisplay = this.shower.controlModel === 0 ? false : true;
break; break;
case '照明' : case '照明' :
const lightConfig = JSON.parse(value.controlConfig); const lightConfig = JSON.parse(value.controlConfig);
...@@ -353,6 +364,8 @@ export class EnvCfgPage implements OnInit { ...@@ -353,6 +364,8 @@ export class EnvCfgPage implements OnInit {
this.light.controlModel = value.controlModel; this.light.controlModel = value.controlModel;
this.light.dataConfig = value.dataConfig; this.light.dataConfig = value.dataConfig;
this.light.controlConfig = lightConfig; this.light.controlConfig = lightConfig;
this.isLightDisplay = this.light.controlModel === 0 ? false : true;
break; break;
case '水槽' : case '水槽' :
const waterChannelConfig = JSON.parse(value.controlConfig); const waterChannelConfig = JSON.parse(value.controlConfig);
...@@ -366,14 +379,22 @@ export class EnvCfgPage implements OnInit { ...@@ -366,14 +379,22 @@ export class EnvCfgPage implements OnInit {
} }
}); });
} }
// 环境预警参数 }
// if (this.curCowshed.environmentConfigJson) {
// const temperatureCfg = {tittle: '温度', top: this.curCowshed.environmentConfigJson.TU, workModeChange(device) {
// lower : this.curCowshed.environmentConfigJson.TL, symbol: '℃'}; switch (device) {
// const humidityCfg = {tittle: '湿度', top: this.curCowshed.environmentConfigJson.HU, case 'fan':
// lower : this.curCowshed.environmentConfigJson.HL, symbol: '%'}; this.isFanDisplay = this.fan.controlModel === 0 ? false : true;
// this.environmentConfig.push(temperatureCfg, humidityCfg); break;
// } case 'shower' :
this.isShowerDisplay = this.shower.controlModel === 0 ? false : true;
break;
case 'light' :
this.isLightDisplay = this.light.controlModel === 0 ? false : true;
break;
default:
break;
}
} }
toggle(isWisdomModelChecked) { toggle(isWisdomModelChecked) {
......
...@@ -19,30 +19,48 @@ ...@@ -19,30 +19,48 @@
<v-kanban class="home-bar" name="温度" [inData]="item.temp" iconClass="vo v-wendu" iconColor="#285B90" iconSize="20px" fontSize="14px"></v-kanban> <v-kanban class="home-bar" name="温度" [inData]="item.temp" iconClass="vo v-wendu" iconColor="#285B90" iconSize="20px" fontSize="14px"></v-kanban>
<v-kanban class="home-bar" name="湿度" [inData]="item.humi" iconClass="vo v-shidu" iconColor="#285B90" iconSize="20px" fontSize="14px"></v-kanban> <v-kanban class="home-bar" name="湿度" [inData]="item.humi" iconClass="vo v-shidu" iconColor="#285B90" iconSize="20px" fontSize="14px"></v-kanban>
<v-kanban class="home-bar" name="热应激" [inData]="item.heatStressLevelName" iconClass="vo v-nav-ico" [iconColor]="item.heatStressColor" iconSize="20px" fontSize="14px"></v-kanban> <v-kanban class="home-bar" name="热应激" [inData]="item.heatStressLevelName" iconClass="vo v-nav-ico" [iconColor]="item.heatStressColor" iconSize="20px" fontSize="14px"></v-kanban>
<v-kanban class="home-bar" name="在舍状态" [inData]="item.inHouse.inHouse === 1 ? '在舍' : '离舍'" iconClass="vo v-dapeng-" iconColor="#285B90" iconSize="20px" fontSize="14px"></v-kanban> <v-kanban class="home-bar" name="在舍状态" [inData]="inHouseName" iconClass="vo v-dapeng-" iconColor="#285B90" iconSize="20px" fontSize="14px"></v-kanban>
</div> </div>
<div class="inHouse"> <div class="inHouseDiv">
<ion-label class="inHouseLabel">在离舍开关控制</ion-label> <ion-label class="inHouseLabel">在离舍开关控制</ion-label>
<ion-toggle [(ngModel)]="item.inHouse.inHouse" (click)="inHouseControl(item.inHouse)"></ion-toggle> <ion-toggle [(ngModel)]="inHouseState" [checked]="inHouseState" (click)="inHouseControl(inHouseState)"></ion-toggle>
<!--<v-switch (click)="inHouseControl(item.inHouse)" [value]="item.inHouse.inHouse" [loading]="loading"></v-switch>--> <!--<v-switch (click)="inHouseControl(item.inHouse)" [value]="item.inHouse.inHouse" [loading]="loading"></v-switch>-->
</div> </div>
</ion-header> </ion-header>
<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>
<ion-tab-bar slot="top"> <ion-tab-bar slot="top">
<ion-tab-button tab="fan" class="tabSelected"> <ion-tab-button tab="tab-fan" class="tabSelected" >
<ion-label>风机</ion-label> <ion-label>风机</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="shower" class="tabSelected" [routerLink]="showerLink"> <!--[rootParams]="fieldRegionNo"--> <ion-tab-button tab="tab-shower" class="tabSelected" [routerLink]="showerLink"> <!--[rootParams]="fieldRegionNo"-->
<ion-label>喷淋</ion-label> <ion-label>喷淋</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="light" class="tabSelected" [routerLink]="lightLink"> <ion-tab-button tab="tab-light" class="tabSelected" [routerLink]="lightLink">
<ion-label>照明</ion-label> <ion-label>照明</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="waterchannel" class="tabSelected" [routerLink]="waterchannelLink"> <ion-tab-button tab="tab-waterchannel" class="tabSelected" [routerLink]="waterchannelLink">
<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-tabs>-->
<!--<ion-tab-bar slot="top">-->
<!--<ion-tab-button tab="tab-fan" class="tabSelected">-->
<!--<ion-label>风机</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="tab-shower" class="tabSelected"> &lt;!&ndash;[href]="showerLink" target="_self"&ndash;&gt;-->
<!--<ion-label>喷淋</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="tab-light" class="tabSelected"> &lt;!&ndash; [href]="lightLink" target="_self" &ndash;&gt;-->
<!--<ion-label>照明</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="tab-waterchannel" class="tabSelected"> &lt;!&ndash; [href]="waterchannelLink" target="_self" &ndash;&gt;-->
<!--<ion-label>水槽</ion-label>-->
<!--</ion-tab-button>-->
<!--</ion-tab-bar>-->
<!--</ion-tabs>-->
</ion-content> </ion-content>
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
// --background: #62C7CC; // --background: #62C7CC;
} }
.inHouse { .inHouseDiv {
background-color: rgb(240, 240, 240); background-color: rgb(240, 240, 240);
height: 35px; height: 40px;
padding-right: 10px; padding-right: 10px;
padding: 5px; padding: 5px;
text-align: right; text-align: right;
......
...@@ -33,13 +33,16 @@ export class EnvDetailPage implements OnInit { ...@@ -33,13 +33,16 @@ export class EnvDetailPage implements OnInit {
isWisdomModel: 1, isWisdomModel: 1,
alarm: 1, alarm: 1,
inHouse: { inHouse: {
inHouse: 1, inHouse: 0,
inHouseState: false,
inHouseName: '离舍', inHouseName: '离舍',
fieldDeviceNo: '', fieldDeviceNo: '',
fieldDeviceType: '', fieldDeviceType: '',
}, },
ts: 0 ts: 0
}; };
inHouseName = '离舍';
inHouseState = false;
fieldRegionNo = ''; fieldRegionNo = '';
loading = false; loading = false;
...@@ -50,7 +53,7 @@ export class EnvDetailPage implements OnInit { ...@@ -50,7 +53,7 @@ export class EnvDetailPage implements OnInit {
isLoading: true isLoading: true
}; };
// fan = '/env-detail/fan'; fanLink = '';
showerLink = ''; showerLink = '';
lightLink = ''; lightLink = '';
waterchannelLink = ''; waterchannelLink = '';
...@@ -59,6 +62,12 @@ export class EnvDetailPage implements OnInit { ...@@ -59,6 +62,12 @@ export class EnvDetailPage implements OnInit {
this.init(); this.init();
} }
// ionic的生命周期函数
// ionViewWillEnter() {
// console.log('ionViewWillEnter');
// this.init();
// }
init() { init() {
this.comm.isLoading = false; this.comm.isLoading = false;
this.comm.remain = 0; this.comm.remain = 0;
...@@ -68,18 +77,6 @@ export class EnvDetailPage implements OnInit { ...@@ -68,18 +77,6 @@ export class EnvDetailPage implements OnInit {
}); });
} }
initLayout() {
this.showerLink = '/env-detail/shower/' + this.fieldRegionNo;
this.lightLink = '/env-detail/light/' + this.fieldRegionNo;
this.waterchannelLink = '/env-detail/waterchannel/' + this.fieldRegionNo;
if (this.item) {
this.item.heatStressColor = this.item.heatStressLevel === 0 ? '#71fa1d' :
this.item.heatStressLevel === 1 ? '#71fa1d' :
this.item.heatStressLevel === 2 ? '#FAB139' :
this.item.heatStressLevel === 3 ? '#ff6a1f' : '#b22222';
}
}
getData(time) { getData(time) {
if (time) { if (time) {
this.load.toLoad('加载中...', false); this.load.toLoad('加载中...', false);
...@@ -89,6 +86,9 @@ export class EnvDetailPage implements OnInit { ...@@ -89,6 +86,9 @@ export class EnvDetailPage implements OnInit {
this.item = data; this.item = data;
this.item.heatStressLevelName = this.getHeatStressLevelName(data.heatStressLevel); this.item.heatStressLevelName = this.getHeatStressLevelName(data.heatStressLevel);
this.item.inHouse.inHouseName = this.getInHouseState(data.inHouse.inHouse); this.item.inHouse.inHouseName = this.getInHouseState(data.inHouse.inHouse);
this.item.inHouse.inHouseState = data.inHouse.inHouse === 1 ? true : false;
this.inHouseName = this.getInHouseState(data.inHouse.inHouse);
this.inHouseState = data.inHouse.inHouse === 1 ? true : false;
this.initLayout(); this.initLayout();
} }
}]); }]);
...@@ -118,6 +118,23 @@ export class EnvDetailPage implements OnInit { ...@@ -118,6 +118,23 @@ export class EnvDetailPage implements OnInit {
// END---------------------------------------------- // END----------------------------------------------
} }
initLayout() {
// this.showerLink = '/env-detail/shower/' + this.fieldRegionNo;
// this.lightLink = '/env-detail/light/' + this.fieldRegionNo;
// this.waterchannelLink = '/env-detail/waterchannel/' + this.fieldRegionNo;
this.fanLink = '/env-detail/tab-fan/';
this.showerLink = '/env-detail/tab-shower/' + this.fieldRegionNo;
this.lightLink = '/env-detail/tab-light/' + this.fieldRegionNo;
this.waterchannelLink = '/env-detail/tab-waterchannel/' + this.fieldRegionNo;
if (this.item) {
this.item.heatStressColor = this.item.heatStressLevel === 0 ? '#71fa1d' :
this.item.heatStressLevel === 1 ? '#71fa1d' :
this.item.heatStressLevel === 2 ? '#FAB139' :
this.item.heatStressLevel === 3 ? '#ff6a1f' : '#b22222';
}
}
getHeatStressLevelName(level) { getHeatStressLevelName(level) {
let levelName = ''; let levelName = '';
switch (level) { switch (level) {
...@@ -159,12 +176,12 @@ export class EnvDetailPage implements OnInit { ...@@ -159,12 +176,12 @@ export class EnvDetailPage implements OnInit {
} }
// 在离舍开关控制 // 在离舍开关控制
inHouseControl(inHouse) { inHouseControl(inHouseState) {
if (inHouse.fieldDeviceNo !== null && inHouse.fieldDeviceNo !== '') { if (this.item.inHouse.fieldDeviceNo !== null && this.item.inHouse.fieldDeviceNo !== '') {
const opt = {fieldDeviceNo: '', fieldDeviceType: '', op: 0, ts: 0}; const opt = {fieldDeviceNo: '', fieldDeviceType: '', op: 0, ts: 0};
opt.fieldDeviceNo = inHouse.fieldDeviceNo; opt.fieldDeviceNo = this.item.inHouse.fieldDeviceNo;
opt.fieldDeviceType = inHouse.fieldDeviceType; opt.fieldDeviceType = this.item.inHouse.fieldDeviceType;
opt.op = inHouse.inHouse ? 1 : 0; opt.op = inHouseState ? 1 : 0;
opt.ts = new Date().valueOf(); opt.ts = new Date().valueOf();
this.comm.remain = 20; this.comm.remain = 20;
......
...@@ -67,6 +67,7 @@ export class EnvFanPage implements OnInit { ...@@ -67,6 +67,7 @@ export class EnvFanPage implements OnInit {
this.initButtons(); this.initButtons();
} }
this.load.offLoad();
}]); }]);
// START-------------------------------------------------------------------- // START--------------------------------------------------------------------
...@@ -158,7 +159,7 @@ export class EnvFanPage implements OnInit { ...@@ -158,7 +159,7 @@ export class EnvFanPage implements OnInit {
// }); // });
// } // }
this.api.presentMsgToast(data.message); this.api.presentMsgToast(data.message);
this.getData(0); this.getData(1);
this.comm.remain = 0; this.comm.remain = 0;
btn.load = false; btn.load = false;
}]); }]);
...@@ -182,12 +183,13 @@ export class EnvFanPage implements OnInit { ...@@ -182,12 +183,13 @@ export class EnvFanPage implements OnInit {
this.comm.remain = 20; this.comm.remain = 20;
this.api.control.controlCowedSwitch([req, (data) => { this.api.control.controlCowedSwitch([req, (data) => {
// if (data && data.code === 1) { // if (data && data.code === 1) {
// this.getData(0); // this.getData(1);
// this.api.presentMsgToast(data.message); // this.api.presentMsgToast(data.message);
// } else { // } else {
// this.getData(0);
// this.api.presentMsgToast(data.message); // this.api.presentMsgToast(data.message);
// } // }
this.getData(0); this.getData(1);
this.api.presentMsgToast(data.message); this.api.presentMsgToast(data.message);
this.comm.remain = 0; this.comm.remain = 0;
// btn.load = false; // btn.load = false;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<div class="content"> <div class="content">
<span *ngIf="item.temp !== null" class="detailInfo" style="width: 40%">温度: &nbsp;&nbsp;{{item.temp}} ℃</span> <span *ngIf="item.temp !== null" class="detailInfo" style="width: 40%">温度: &nbsp;&nbsp;{{item.temp}} ℃</span>
<span *ngIf="item.humi !== null" class="detailInfo" style="width: 40%">湿度: &nbsp;&nbsp;{{item.humi}} % rH</span> <span *ngIf="item.humi !== null" class="detailInfo" style="width: 40%">湿度: &nbsp;&nbsp;{{item.humi}} % rH</span>
<span *ngIf="item.humi !== null" class="detailInfo" style="width: 40%">氨气: &nbsp;&nbsp;{{item.NH3}} ppm</span> <span *ngIf="item.NH3 !== null" class="detailInfo" style="width: 40%">氨气: &nbsp;&nbsp;{{item.NH3}} ppm</span>
<span *ngIf="item.heatStressLevel !== null" class="detailInfo" style="width: 40%">热应激: &nbsp;&nbsp;<span class="warmColor{{item.heatStressLevel}}">{{item.heatStressLevelName}}</span></span> <span *ngIf="item.heatStressLevel !== null" class="detailInfo" style="width: 40%">热应激: &nbsp;&nbsp;<span class="warmColor{{item.heatStressLevel}}">{{item.heatStressLevelName}}</span></span>
</div> </div>
<div class="bottom"> <div class="bottom">
......
...@@ -49,6 +49,18 @@ export class EnvLightPage implements OnInit { ...@@ -49,6 +49,18 @@ export class EnvLightPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
// this.route.paramMap.subscribe(params => {
// this.fieldRegionNo = params.get('fieldRegionNo');
// });
// this.getData(0);
}
ionViewWillEnter() {
console.log('ionViewWillEnter_shower');
this.init();
}
init() {
this.route.paramMap.subscribe(params => { this.route.paramMap.subscribe(params => {
this.fieldRegionNo = params.get('fieldRegionNo'); this.fieldRegionNo = params.get('fieldRegionNo');
}); });
...@@ -93,6 +105,7 @@ export class EnvLightPage implements OnInit { ...@@ -93,6 +105,7 @@ export class EnvLightPage implements OnInit {
this.initButtons(); this.initButtons();
} }
this.load.offLoad();
}]); }]);
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
width: 17px; width: 17px;
height: 17px; height: 17px;
border-radius: 17px; border-radius: 17px;
background-color: #2ecc71; background-color: #28c9bd;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
box-shadow: #ccc 0.5px 0.5px 3px; box-shadow: #ccc 0.5px 0.5px 3px;
......
...@@ -52,6 +52,7 @@ export class EnvShowerPage implements OnInit { ...@@ -52,6 +52,7 @@ export class EnvShowerPage implements OnInit {
} }
ionViewWillEnter() { ionViewWillEnter() {
console.log('ionViewWillEnter_shower');
this.init(); this.init();
} }
init() { init() {
...@@ -78,6 +79,7 @@ export class EnvShowerPage implements OnInit { ...@@ -78,6 +79,7 @@ export class EnvShowerPage implements OnInit {
}); });
this.initButtons(); this.initButtons();
} }
this.load.offLoad();
}]); }]);
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
width: 17px; width: 17px;
height: 17px; height: 17px;
border-radius: 17px; border-radius: 17px;
background-color: #2ecc71; background-color: #28c9bd;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
box-shadow: #ccc 0.5px 0.5px 3px; box-shadow: #ccc 0.5px 0.5px 3px;
......
...@@ -29,6 +29,12 @@ export class EnvWaterchannelPage implements OnInit { ...@@ -29,6 +29,12 @@ export class EnvWaterchannelPage implements OnInit {
this.init(); this.init();
} }
// ionic的生命周期函数
ionViewWillEnter() {
console.log('ionViewWillEnter_waterChannel');
this.init();
}
init() { init() {
this.route.paramMap.subscribe(params => { this.route.paramMap.subscribe(params => {
this.fieldRegionNo = params.get('fieldRegionNo'); this.fieldRegionNo = params.get('fieldRegionNo');
...@@ -44,6 +50,7 @@ export class EnvWaterchannelPage implements OnInit { ...@@ -44,6 +50,7 @@ export class EnvWaterchannelPage implements OnInit {
if (data) { if (data) {
this.devices = data.param; this.devices = data.param;
} }
this.load.offLoad();
}]); }]);
} }
......
...@@ -65,7 +65,7 @@ const routes: Routes = [ ...@@ -65,7 +65,7 @@ const routes: Routes = [
EnvAnalPage, EnvAnalPage,
EnvAlarmPage, EnvAlarmPage,
EnvCfgPage, EnvCfgPage,
//EnvDetailPage, // EnvDetailPage,
// EnvFanPage, // EnvFanPage,
// EnvShowerPage, // EnvShowerPage,
// EnvLightPage, // EnvLightPage,
......
...@@ -25,12 +25,12 @@ export class TabsPage implements OnInit { ...@@ -25,12 +25,12 @@ export class TabsPage implements OnInit {
// }); // });
this.totalAlert = 0; this.totalAlert = 0;
this.api.alert.getAll(['{"fieldRegionType":"牛舍"}',(data) => { this.api.alert.getAll([{fieldRegionType: '牛舍'}, (data) => {
if(data.total > 0) { if (data.total > 0) {
this.totalAlert = 0; this.totalAlert = 0;
let rows = data.rows; const rows = data.rows;
if(rows.constructor === Array){ if (rows.constructor === Array) {
rows.map((value, index)=> { rows.map((value, index) => {
this.totalAlert = this.totalAlert + value.devErr + value.alarm; this.totalAlert = this.totalAlert + value.devErr + value.alarm;
}); });
} }
......
export const environment = { export const environment = {
production: true, production: true,
url: 'http://pasture.witium.com/api', // 对外访问测试网地址 // url: 'http://pasture.witium.com/api', // 对外访问测试网地址
// url: 'http://172.16.1.13:8096', // 测试 // mqttUrl: '120.27.235.39'
mqttUrl: '120.27.235.39'
url: 'http://172.16.1.52:8096',
mqttUrl: '172.16.1.24',
}; };
...@@ -22,7 +22,6 @@ export const environment = { ...@@ -22,7 +22,6 @@ export const environment = {
// mqttUrl: '120.27.235.39' // mqttUrl: '120.27.235.39'
// mqttUrl: '120.27.235.31' // mqttUrl: '120.27.235.31'
// url: 'http://pasture.witium.com.cn/api', // 对外访问测试网地址 // url: 'http://pasture.witium.com.cn/api', // 对外访问测试网地址
// mqttUrl: '172.16.1.24:48083', // mqttUrl: '172.16.1.24:48083',
}; };
......
...@@ -73,7 +73,7 @@ ol, ul { ...@@ -73,7 +73,7 @@ ol, ul {
width: 17px; width: 17px;
height: 17px; height: 17px;
border-radius: 17px; border-radius: 17px;
background-color: #2ecc71; background-color: #28c9bd;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
box-shadow: #ccc 0.5px 0.5px 3px; box-shadow: #ccc 0.5px 0.5px 3px;
......
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