Commit 3f9db925 authored by yating.lin's avatar yating.lin

调整layout

parent 08c984d9
...@@ -57,9 +57,9 @@ const routes: Routes = [ ...@@ -57,9 +57,9 @@ const routes: Routes = [
component: EnvDetailPage, component: EnvDetailPage,
children: [ children: [
{path: 'fan', component: EnvFanPage}, {path: 'fan', component: EnvFanPage},
{path: 'shower/:fieldRegionNo', component: EnvShowerPage}, {path: 'shower/:fieldRegionNo/:operationModel', component: EnvShowerPage},
{path: 'light/:fieldRegionNo', component: EnvLightPage}, {path: 'light/:fieldRegionNo/:operationModel', component: EnvLightPage},
{path: 'waterchannel/:fieldRegionNo', component: EnvWaterchannelPage}, {path: 'waterchannel/:fieldRegionNo/:operationModel', component: EnvWaterchannelPage},
{path: '', redirectTo: 'fan', pathMatch : 'prefix'}, {path: '', redirectTo: 'fan', pathMatch : 'prefix'},
] ]
......
...@@ -6,8 +6,17 @@ ...@@ -6,8 +6,17 @@
<ion-title mode="ios" class="title">喷淋模式填写</ion-title> <ion-title mode="ios" class="title">喷淋模式填写</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content style="background-color: #F3F4F4;"> <ion-content style="background-color: lightgray;">
<div style="max-height: calc(100% - 100px);overflow-y:auto;"> <div style="width: 100%; margin-top:15px;">
<div class="top-line">
</div>
<div class="top-img">
<img src="../../../assets/img/喷淋.png" class="img">
</div>
<div class="top-line">
</div>
</div>
<div style="max-height: calc(100% - 100px);overflow-y:auto;" class="parentDiv">
<ion-item-sliding *ngFor="let allCfg of controlConfig"> <ion-item-sliding *ngFor="let allCfg of controlConfig">
<ion-item class="fanItem"> <ion-item class="fanItem">
<ion-grid> <ion-grid>
...@@ -62,6 +71,7 @@ ...@@ -62,6 +71,7 @@
<ion-item width="100%" lines="none"> <ion-item width="100%" lines="none">
<ion-icon name="add-circle" color="secondary" class="addIcon" (click)="addModel()"></ion-icon> <ion-icon name="add-circle" color="secondary" class="addIcon" (click)="addModel()"></ion-icon>
</ion-item> </ion-item>
</div> </div>
<div style="text-align: center; width:100%; position: absolute; bottom: 10px;"> <div style="text-align: center; width:100%; position: absolute; bottom: 10px;">
<ion-button (click)="goBack()" class="btn" color="light" slot="start" style="margin-right: 20px;">取消</ion-button> <ion-button (click)="goBack()" class="btn" color="light" slot="start" style="margin-right: 20px;">取消</ion-button>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
} }
.addIcon { .addIcon {
margin-left: 160px; margin-left: calc(46%);
} }
.deleteIcon { .deleteIcon {
...@@ -22,3 +22,30 @@ ...@@ -22,3 +22,30 @@
width: 35%; width: 35%;
} }
.parentDiv {
width: 94%;
//margin-top: 10px;
background-color: #ffffff;
border-radius: 7px;
padding: 5px;
}
.img {
width:40px !important;
}
.top-img {
width: 16%;
display: inline-block;
text-align: center;
float: left;
}
.top-line {
width: 40%;
height: 2px;
border-bottom: 1px solid lightgray;
display: inline-block;
margin: 15px 0px 14px 5px;
float: left;
}
...@@ -17,31 +17,35 @@ ...@@ -17,31 +17,35 @@
</ion-segment-button> </ion-segment-button>
</ion-segment> </ion-segment>
<ion-item lines="full" class="ionItem" color="gray"> <ion-item lines="full" class="ionItem" style="height: 45px;"> <!-- color="gray" -->
<ion-select interface="popover" placeholder="状态" [(ngModel)]="disposeState" (onClick)="refresh()" id="selectState"> <div style="float:left; display: inline-block; position: relative; width:40%; padding-top: 10px;">
<ion-select-option value="全部" class="popLabel">全部</ion-select-option> <ion-select class="selectBtn font-content" interface="popover" placeholder="状态" [(ngModel)]="disposeState" (ionChange)="refresh()" id="selectState">
<ion-select-option value="0" class="popLabel">待修复</ion-select-option> <ion-select-option value="全部" class="popLabel">全部</ion-select-option>
<ion-select-option value="1" class="popLabel">已修复</ion-select-option> <ion-select-option value="0" class="popLabel">待修复</ion-select-option>
</ion-select> <ion-select-option value="1" class="popLabel">已修复</ion-select-option>
<ion-select interface="popover" placeholder="类型" [(ngModel)]="fieldDeviceType" (click)="refresh()" id="selectType"> </ion-select>
<ion-select-option *ngFor="let option of typeOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option> </div>
<!--<ion-select-option value="全部" class="popLabel">全部</ion-select-option>--> <div style="float:left; display: inline-block; position: relative; width:40%; padding-top: 10px;">
<!--<ion-select-option value="环境" class="popLabel">环境</ion-select-option>--> <ion-select class="selectBtn font-content" interface="popover" placeholder="类型" [(ngModel)]="fieldDeviceType" (ionChange)="refresh()" id="selectType">
<!--<ion-select-option value="风机" class="popLabel">风机</ion-select-option>--> <ion-select-option *ngFor="let option of typeOptions" [value]="option.modelId">{{option.modelValue}}</ion-select-option>
<!--<ion-select-option value="喷淋" class="popLabel">喷淋</ion-select-option>--> <!--<ion-select-option value="全部" class="popLabel">全部</ion-select-option>-->
<!--<ion-select-option value="照明" class="popLabel">照明</ion-select-option>--> <!--<ion-select-option value="环境" class="popLabel">环境</ion-select-option>-->
<!--<ion-select-option value="水槽" class="popLabel">水槽</ion-select-option>--> <!--<ion-select-option value="风机" class="popLabel">风机</ion-select-option>-->
</ion-select> <!--<ion-select-option value="喷淋" class="popLabel">喷淋</ion-select-option>-->
<!--<ion-select-option value="照明" class="popLabel">照明</ion-select-option>-->
<!--<ion-select-option value="水槽" class="popLabel">水槽</ion-select-option>-->
</ion-select>
</div>
</ion-item> </ion-item>
<ion-item lines="full" class="ionItem" color="gray" style="height: 45px; --inner-padding-end: 0px;"> <ion-item lines="full" class="ionItem" color="gray" style="height: 45px; --inner-padding-end: 0px;">
<div style="width: 28%"> <div style="width: 26%">
<ion-datetime class="content-text-color" style="position: relative;" displayFormat="YYYY/MM" cancelText="取消" doneText="确认" [(ngModel)]="startTime" (click)="refresh()" id="selectStartTime"></ion-datetime> <ion-datetime class="content-text-color" style="position: relative;" displayFormat="YYYY/MM" cancelText="取消" doneText="确认" [(ngModel)]="startTime" (click)="refresh()" id="selectStartTime"></ion-datetime>
</div> </div>
<div style="width: 2%"> <div style="width: 4%">
<span>~</span> <span class="font-content">~</span>
</div> </div>
<div style="width: 30%"> <div style="width: 28%">
<ion-datetime class="content-text-color" style="position: relative;" displayFormat="YYYY/MM" cancelText="取消" doneText="确认" [(ngModel)]="stopTime" style="margin-left: 3px;" (click)="refresh()" id="selectStopTime"></ion-datetime> <ion-datetime class="content-text-color" style="position: relative;" displayFormat="YYYY/MM" cancelText="取消" doneText="确认" [(ngModel)]="stopTime" style="margin-left: 3px;" (click)="refresh()" id="selectStopTime"></ion-datetime>
</div> </div>
<div style="width: 40%; padding-right: 15px;"> <div style="width: 40%; padding-right: 15px;">
...@@ -75,15 +79,16 @@ ...@@ -75,15 +79,16 @@
<div class="detailContent"> <div class="detailContent">
<div class="timeline" *ngIf="troubleList.length > 0"> <div class="timeline" *ngIf="troubleList.length > 0">
<div class="entry" *ngFor="let item of troubleList"> <div class="entry outDiv" *ngFor="let item of troubleList">
<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>
<p class="font-ts" style="font-size:13px !important">{{item.troubleTime}}</p> <p class="font-ts" style="font-size:13px !important">{{item.troubleTime}}</p>
</div> </div>
<div class="body"> <div class="body inDiv">
<h3 style="margin-bottom: 5px;" class="font-content-title">{{item.description}}</h3>
<div> <div id="parentDiv" >
<div style="width:65%; float: left"> <div style="width:65%; float: left">
<h3 style="margin-bottom: 5px;" class="font-content-title">{{item.description}}</h3>
<div *ngIf="item.data !== null && item.data.temp !== undefined && item.data.temp !== null && item.data.temp !== ''" class="warnContent font-content">温度: {{item.data.temp}} ℃</div> <div *ngIf="item.data !== null && item.data.temp !== undefined && item.data.temp !== null && item.data.temp !== ''" class="warnContent font-content">温度: {{item.data.temp}} ℃</div>
<div *ngIf="item.data !== null && item.data.humi !== undefined && item.data.humi !== null && item.data.humi !== ''" class="warnContent font-content">湿度: {{item.data.humi}} %</div> <div *ngIf="item.data !== null && item.data.humi !== undefined && item.data.humi !== null && item.data.humi !== ''" class="warnContent font-content">湿度: {{item.data.humi}} %</div>
<div *ngIf="item.data !== null && item.data.heatStressLevel !== undefined && item.data.heatStressLevel !== null && item.data.heatStressLevel !== ''" class="warnContent font-content">热应激等级: {{item.data.heatStressLevel}}</div> <div *ngIf="item.data !== null && item.data.heatStressLevel !== undefined && item.data.heatStressLevel !== null && item.data.heatStressLevel !== ''" class="warnContent font-content">热应激等级: {{item.data.heatStressLevel}}</div>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
font-size: 13px; font-size: 13px;
--padding-start: 5px; --padding-start: 5px;
--padding-end: 0px; --padding-end: 0px;
height: 35px; height: 30px;
} }
.popLabel { .popLabel {
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
width:60px !important; width:60px !important;
} }
.deviceIcon { .deviceIcon {
width:50px !important; width:45px !important;
} }
.detailContent { .detailContent {
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
top: 0px; top: 0px;
left: calc(30% + 15px); left: calc(30% + 15px);
bottom: 0px; bottom: 0px;
width: 4px; width: 3px;
background: #ddd; background: #ddd;
} }
.timeline:after { .timeline:after {
...@@ -105,6 +105,17 @@ ...@@ -105,6 +105,17 @@
clear: both; clear: both;
} }
.outDiv{
overflow: hidden;
margin-top: 15px;
}
.inDiv {
margin: 3px;
padding-bottom: 10px;
border-bottom: 1px solid lightgray;
}
.entry { .entry {
clear: both; clear: both;
text-align: left; text-align: left;
...@@ -139,9 +150,15 @@ ...@@ -139,9 +150,15 @@
font-size: 100%; font-size: 100%;
} }
.entry .body { .entry .body {
margin: 0 0 30px; //margin: 0 0 30px;
//float: right;
//width: 65%;
//padding-left: 15px;
margin: 0 0 5px;
padding-bottom: 30px;
float: right; float: right;
width: 65%; width: 62%;
padding-left: 15px; padding-left: 15px;
} }
.entry .body p { .entry .body p {
...@@ -152,6 +169,11 @@ ...@@ -152,6 +169,11 @@
font-weight: 400; font-weight: 400;
} }
.itemColor { .itemColor {
--background: auto; --background: auto;
} }
.selectBtn {
--padding-top: 0px;
}
...@@ -95,8 +95,9 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -95,8 +95,9 @@ export class EnvAlarmDetailPage implements OnInit {
this.setDateInterval(this.curInterval); this.setDateInterval(this.curInterval);
this.showArea(data.displayArea); this.showArea(data.displayArea);
this.getTroubleList(true); this.setOperation(this.displayArea);
this.getAlarmList(true); // this.getTroubleList(true);
// this.getAlarmList(true);
}); });
} }
...@@ -105,6 +106,25 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -105,6 +106,25 @@ export class EnvAlarmDetailPage implements OnInit {
this.stopTime = this.datePipe.transform(new Date(), 'yyyy-MM'); this.stopTime = this.datePipe.transform(new Date(), 'yyyy-MM');
} }
setOperation(displayArea) {
if (displayArea === 'trouble') {
this.typeOptions = [
{modelId: '全部', modelValue: '全部'},
{modelId: '风机', modelValue: '风机'},
{modelId: '喷淋', modelValue: '喷淋'},
{modelId: '照明', modelValue: '照明'},
{modelId: '水槽', modelValue: '水槽'}];
} else {
this.typeOptions = [
{modelId: '全部', modelValue: '全部'},
{modelId: '环境', modelValue: '环境'},
{modelId: '风机', modelValue: '风机'},
{modelId: '喷淋', modelValue: '喷淋'},
{modelId: '照明', modelValue: '照明'},
{modelId: '水槽', modelValue: '水槽'}];
}
}
showArea(displayArea) { showArea(displayArea) {
this.isTroubleDis = displayArea === 'trouble' ? true : false; this.isTroubleDis = displayArea === 'trouble' ? true : false;
this.isAlarmDis = displayArea === 'alarm' ? true : false; this.isAlarmDis = displayArea === 'alarm' ? true : false;
...@@ -133,9 +153,10 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -133,9 +153,10 @@ export class EnvAlarmDetailPage implements OnInit {
item.troubleTime = this.api.formatTime('yyyy-MM-dd hh:mm:ss', new Date(item.troubleTime)); item.troubleTime = this.api.formatTime('yyyy-MM-dd hh:mm:ss', new Date(item.troubleTime));
}); });
} }
if (isInit) { // if (isInit) {
this.detailInfo = data; // this.detailInfo = data;
} // }
this.detailInfo = data;
this.detailInfoLength = data.devErrTotal; this.detailInfoLength = data.devErrTotal;
this.appendItems(data.trouble, data.devErrTotal); this.appendItems(data.trouble, data.devErrTotal);
}]); }]);
...@@ -165,9 +186,10 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -165,9 +186,10 @@ export class EnvAlarmDetailPage implements OnInit {
item.troubleTime = this.api.formatTime('yyyy-MM-dd hh:mm:ss', new Date(item.alarmTime)); item.troubleTime = this.api.formatTime('yyyy-MM-dd hh:mm:ss', new Date(item.alarmTime));
}); });
} }
if (isInit) { // if (isInit) {
this.detailInfo = data; // this.detailInfo = data;
} // }
this.detailInfo = data;
this.detailInfoLength = data.alarmTotal; this.detailInfoLength = data.alarmTotal;
this.appendItems(data.trouble, data.alarmTotal); this.appendItems(data.trouble, data.alarmTotal);
}]); }]);
...@@ -178,7 +200,7 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -178,7 +200,7 @@ export class EnvAlarmDetailPage implements OnInit {
// await this.wait(500); // await this.wait(500);
// console.log(allDataLength); // console.log(allDataLength);
// console.log(this.troubleList.length); // console.log(this.troubleList.length);
if (trouble && trouble.length > 0 ) { if (trouble.length > 0 && this.troubleList.length < allDataLength) {
for (let i = 0; i < trouble.length; i++) { for (let i = 0; i < trouble.length; i++) {
this.troubleList.push(trouble[i]); this.troubleList.push(trouble[i]);
this.displayLength = this.displayLength + 1; this.displayLength = this.displayLength + 1;
...@@ -223,9 +245,11 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -223,9 +245,11 @@ export class EnvAlarmDetailPage implements OnInit {
document.getElementById('infiniteScroll').removeAttribute('disabled'); document.getElementById('infiniteScroll').removeAttribute('disabled');
if (ev.target.value === 'alarm') { if (ev.target.value === 'alarm') {
this.displayArea = 'alarm'; this.displayArea = 'alarm';
this.setOperation('alarm');
this.getAlarmList(true); this.getAlarmList(true);
} else { } else {
this.displayArea = 'trouble'; this.displayArea = 'trouble';
this.setOperation('trouble');
this.getTroubleList(true); this.getTroubleList(true);
} }
}, 1000); }, 1000);
...@@ -305,6 +329,7 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -305,6 +329,7 @@ export class EnvAlarmDetailPage implements OnInit {
} }
refresh() { refresh() {
this.waiting();
console.log('refresh'); console.log('refresh');
this.detailInfo = {}; this.detailInfo = {};
this.troubleList = []; this.troubleList = [];
...@@ -329,7 +354,7 @@ export class EnvAlarmDetailPage implements OnInit { ...@@ -329,7 +354,7 @@ export class EnvAlarmDetailPage implements OnInit {
cssClass: 'main-color', cssClass: 'main-color',
mode: 'ios', mode: 'ios',
message: '', message: '',
duration: 1000 duration: 2000
}); });
await loading.present(); await loading.present();
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)"> <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content></ion-refresher-content> <ion-refresher-content></ion-refresher-content>
</ion-refresher> </ion-refresher>
<ion-card *ngFor="let item of alarmItems" style="margin-top:10px; margin-bottom:0px;"> <ion-card *ngFor="let item of alarmItems" style="margin-top:10px; margin-bottom:0px;" color="white">
<ion-card-header style="padding-top: 3px; padding-bottom: 3px;"> <ion-card-header style="padding-top: 3px; padding-bottom: 3px;">
<ion-card-title style="display: inline-block" style="width:100%"> <ion-card-title style="display: inline-block" style="width:100%">
<div class="cardTitle"> <div class="cardTitle">
......
...@@ -350,7 +350,7 @@ export class EnvAnalPage implements OnInit { ...@@ -350,7 +350,7 @@ export class EnvAnalPage implements OnInit {
{ {
type: 'value', type: 'value',
scale: true, scale: true,
name: '湿度(% rH)', name: '湿度(% RH)',
// max: 1200, // max: 1200,
// min: 0, // min: 0,
boundaryGap: [0.1, 0.1] boundaryGap: [0.1, 0.1]
......
This diff is collapsed.
...@@ -60,11 +60,14 @@ ...@@ -60,11 +60,14 @@
font-weight: bold; font-weight: bold;
margin-left: 5px; margin-left: 5px;
// margin-bottom: 3px; // margin-bottom: 3px;
border-bottom: 1px solid rgba(173, 173, 173, 0.5); //border-bottom: 1px solid rgba(173, 173, 173, 0.5);
border-bottom: 1px solid lightgray;
} }
.selectFont { .selectFont {
font-weight: normal; font-weight: normal;
font-size: 13px;
color: #8e8e8e;
} }
.popContent { .popContent {
...@@ -89,3 +92,71 @@ ...@@ -89,3 +92,71 @@
--padding-start: 0px; --padding-start: 0px;
--padding-top: 0px; --padding-top: 0px;
} }
.itemColor {
--background: auto;
}
.clearColor {
background-color: unset;
}
.parentDiv {
width: 94%;
margin: auto;
background-color: #ffffff;
border-radius: 7px;
padding: 10px 5px 10px 5px;
}
.item-title-div {
margin-left: 3px;
margin-right: 3px;
overflow: hidden;
border: 1px solid #d3d3d394;
background-color: rgba(0, 0, 0, 0.03);
border-radius: 2px;
}
.item-content-div {
margin-left: 3px;
margin-right: 3px;
margin-bottom: 3px;
overflow: hidden;
border: 1px solid #d3d3d394;
border-radius: 2px;
padding-left: 10px;
padding-right: 10px;
height: 35px;
padding-top: inherit;
}
.icon-up-down {
width:15%;
text-align:center;
display: inline-block;
float: left;
padding-top: 9px;
}
.sliding-grid {
--ion-grid-padding: 0px;
}
.sliding-col {
font-size: 13px;
flex: 0 0 auto;
width: auto;
--ion-grid-column-padding: 0px;
}
.sliding-item {
--inner-padding-top: 0px;
--inner-padding-bottom: 0px;
--padding-top: 0px;
--padding-bottom: 0px;
}
.input-tb-text {
color: black;
}
...@@ -107,7 +107,7 @@ export class EnvCfgPage implements OnInit { ...@@ -107,7 +107,7 @@ export class EnvCfgPage implements OnInit {
this.comm.isLoading = true; this.comm.isLoading = true;
} }
}, 1000) ; }, 1000) ;
this.init(); // this.init();
} }
ionViewWillLeave() { ionViewWillLeave() {
...@@ -494,28 +494,28 @@ export class EnvCfgPage implements OnInit { ...@@ -494,28 +494,28 @@ export class EnvCfgPage implements OnInit {
} }
} }
if (this.light.controlModel === Constants.CONTROLL_SELF) { if (this.light.controlModel === Constants.CONTROLL_SELF) {
let hasError = false; let lightHasError = false;
let hasBlank = false; let hasBlank = false;
this.light.controlConfig.map(allCfg => { this.light.controlConfig.map(allCfg => {
if (!hasError) { if (!hasBlank) {
hasError = this.isEmpty(allCfg.config.name); // hasError = this.isEmpty(allCfg.config.name);
hasBlank = true; hasBlank = this.isEmpty(allCfg.config.name);
} }
if (!hasError) { if (!hasBlank) {
hasError = this.isEmpty(allCfg.config.startDate); // hasError = this.isEmpty(allCfg.config.startDate);
hasBlank = true; hasBlank = this.isEmpty(allCfg.config.startDate);
} }
if (!hasError) { if (!hasBlank) {
hasError = this.isEmpty(allCfg.config.stopDate); // hasError = this.isEmpty(allCfg.config.stopDate);
hasBlank = true; hasBlank = this.isEmpty(allCfg.config.stopDate);
} }
if (!hasError) { if (!hasBlank) {
hasError = this.isEmpty(allCfg.config.on); // hasError = this.isEmpty(allCfg.config.on);
hasBlank = true; hasBlank = this.isEmpty(allCfg.config.on);
} }
if (!hasError) { if (!hasBlank) {
hasError = this.isEmpty(allCfg.config.off); // hasError = this.isEmpty(allCfg.config.off);
hasBlank = true; hasBlank = this.isEmpty(allCfg.config.off);
} }
// if (!hasError) { // if (!hasError) {
...@@ -524,15 +524,15 @@ export class EnvCfgPage implements OnInit { ...@@ -524,15 +524,15 @@ export class EnvCfgPage implements OnInit {
// if (!hasError) { // if (!hasError) {
// hasError = this.validateDate(allCfg.config.stopDate); // hasError = this.validateDate(allCfg.config.stopDate);
// } // }
if (!hasError) { if (!hasBlank) {
hasError = this.validateDateFromTo(allCfg.config.startDate, allCfg.config.stopDate); lightHasError = this.validateDateFromTo(allCfg.config.startDate, allCfg.config.stopDate);
} }
}); });
if (hasError && hasBlank) { if (lightHasError && hasBlank) {
this.api.presentMsgToast('请完成喷淋配置'); this.api.presentMsgToast('请完成照明配置');
return false; return false;
} else if (hasError && !hasBlank) { } else if (lightHasError && !hasBlank) {
this.api.presentMsgToast('喷淋配置: 请输入正确的日期范围'); this.api.presentMsgToast('照明配置: 请输入正确的日期范围');
return false; return false;
} }
} }
...@@ -604,10 +604,10 @@ export class EnvCfgPage implements OnInit { ...@@ -604,10 +604,10 @@ export class EnvCfgPage implements OnInit {
validateDateFromTo(dateFrom, dateTo) { validateDateFromTo(dateFrom, dateTo) {
let hasError = false; let hasError = false;
const fromMonth = parseInt(dateFrom.slice(0, 2), 10); const fromMonth = parseInt(dateFrom.slice(0, 2), 10);
const fromDay = parseInt(dateFrom.slice(2, 4), 10); const fromDay = parseInt(dateFrom.slice(3, 5), 10);
const from = new Date(new Date().getFullYear(), fromMonth, fromDay).valueOf(); const from = new Date(new Date().getFullYear(), fromMonth, fromDay).valueOf();
const toMonth = parseInt(dateTo.slice(0, 2), 10); const toMonth = parseInt(dateTo.slice(0, 2), 10);
const toDay = parseInt(dateTo.slice(2, 4), 10); const toDay = parseInt(dateTo.slice(3, 5), 10);
const to = new Date(new Date().getFullYear(), toMonth, toDay).valueOf(); const to = new Date(new Date().getFullYear(), toMonth, toDay).valueOf();
if (from > to) { if (from > to) {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
} }
.addIcon { .addIcon {
margin-left: 160px; margin-left: calc(46%);
} }
.deleteIcon { .deleteIcon {
......
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
</div> </div>
<div style="background-color: #F0F0F0;" align="center"> <div style="background-color: #F0F0F0;" align="center">
<v-kanban-small class="home-bar" name="温度" [inData]="item.temp" iconWidth="50%" unit="℃" [iconImg]="'../../assets/img/icon-temp.png'" [fontColor]="item.tempColor" fontSize="14px"></v-kanban-small> <v-kanban-small class="home-bar" name="温度" [inData]="item.temp" iconWidth="50%" unit="℃" [iconImg]="'../../assets/img/icon-temp.png'" [fontColor]="item.tempColor" fontSize="14px"></v-kanban-small>
<v-kanban-small class="home-bar" name="湿度" [inData]="item.humi" iconWidth="50%" unit="% rH" [iconImg]="'../../assets/img/icon-humi.png'" [fontColor]="item.humiColor" fontSize="14px"></v-kanban-small> <v-kanban-small class="home-bar" name="湿度" [inData]="item.humi" iconWidth="50%" unit="% RH" [iconImg]="'../../assets/img/icon-humi.png'" [fontColor]="item.humiColor" fontSize="14px"></v-kanban-small>
<v-kanban-small class="home-bar" name="热应激" [inData]="item.heatStressLevelName" iconWidth="35%" [iconImg]="'../../assets/img/icon-heat.png'" [fontColor]="item.heatStressColor" fontSize="14px"></v-kanban-small> <v-kanban-small class="home-bar" name="热应激" [inData]="item.heatStressLevelName" iconWidth="35%" [iconImg]="'../../assets/img/icon-heat.png'" [fontColor]="item.heatStressColor" fontSize="14px"></v-kanban-small>
<v-kanban-small class="home-bar" name="在离舍" [inData]="inHouseName" iconWidth="35%" [iconImg]="'../../assets/img/icon-house.png'" iconColor="#61C7CC" fontSize="14px"></v-kanban-small> <v-kanban-small class="home-bar" name="在离舍" [inData]="inHouseName" iconWidth="35%" [iconImg]="'../../assets/img/icon-house.png'" iconColor="#61C7CC" fontSize="14px"></v-kanban-small>
</div> </div>
<div class="inHouseDiv font-content-title"> <div class="inHouseDiv font-content-title">
<ion-label class="inHouseLabel normalColor">在离舍开关控制</ion-label> <ion-label class="inHouseLabel normalColor">在离舍开关控制</ion-label>
<ion-toggle mode="ios" color="secondary" [(ngModel)]="inHouseState" [checked]="inHouseState" (click)="inHouseControl(inHouseState)"></ion-toggle> <ion-toggle mode="ios" color="secondary" [(ngModel)]="inHouseState" [checked]="inHouseState" [disabled]="inHouseDisabled"
(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>
......
...@@ -5,6 +5,7 @@ import {ActivatedRoute} from '@angular/router'; ...@@ -5,6 +5,7 @@ import {ActivatedRoute} from '@angular/router';
import {Load} from '../../service/load'; import {Load} from '../../service/load';
import {Transfer} from '../../service/transfer'; import {Transfer} from '../../service/transfer';
import {Loading} from '../../service/loading'; import {Loading} from '../../service/loading';
import {Constants} from '../../service/constants';
@Component({ @Component({
selector: 'v-env-detail', selector: 'v-env-detail',
...@@ -55,6 +56,8 @@ export class EnvDetailPage implements OnInit { ...@@ -55,6 +56,8 @@ export class EnvDetailPage implements OnInit {
inHouseState = false; inHouseState = false;
fieldRegionNo = ''; fieldRegionNo = '';
operationModel = 0;
inHouseDisabled = false;
// 发送指令延时判断 // 发送指令延时判断
comm = { comm = {
...@@ -83,6 +86,7 @@ export class EnvDetailPage implements OnInit { ...@@ -83,6 +86,7 @@ export class EnvDetailPage implements OnInit {
this.ac.queryParams.subscribe((data) => { this.ac.queryParams.subscribe((data) => {
if (data.no) { if (data.no) {
this.fieldRegionNo = data.no; this.fieldRegionNo = data.no;
this.operationModel = data.operationModel;
this.getData(0); this.getData(0);
} }
}); });
...@@ -102,15 +106,16 @@ export class EnvDetailPage implements OnInit { ...@@ -102,15 +106,16 @@ export class EnvDetailPage implements OnInit {
this.inHouseName = this.getInHouseState(data.inHouse.inHouse); this.inHouseName = this.getInHouseState(data.inHouse.inHouse);
this.inHouseState = data.inHouse.inHouse === 1 ? true : false; this.inHouseState = data.inHouse.inHouse === 1 ? true : false;
this.initLayout(environmentConfigJson); this.initLayout(environmentConfigJson);
this.setConfusionModelControll();
} }
}]); }]);
} }
initLayout(environmentConfigJson) { initLayout(environmentConfigJson) {
this.fanLink = '/env-detail/fan/'; this.fanLink = '/env-detail/fan/';
this.showerLink = '/env-detail/shower/' + this.fieldRegionNo; this.showerLink = '/env-detail/shower/' + this.fieldRegionNo + '/' + this.item.operationModel;
this.lightLink = '/env-detail/light/' + this.fieldRegionNo; this.lightLink = '/env-detail/light/' + this.fieldRegionNo + '/' + this.item.operationModel;
this.waterchannelLink = '/env-detail/waterchannel/' + this.fieldRegionNo; this.waterchannelLink = '/env-detail/waterchannel/' + this.fieldRegionNo + '/' + this.item.operationModel;
if (this.item) { if (this.item) {
this.item.heatStressColor = this.item.heatStressLevel === 0 ? '#61C7CC' : this.item.heatStressColor = this.item.heatStressLevel === 0 ? '#61C7CC' :
...@@ -220,4 +225,13 @@ export class EnvDetailPage implements OnInit { ...@@ -220,4 +225,13 @@ export class EnvDetailPage implements OnInit {
// event.target.complete(); // event.target.complete();
// }, 2000); // }, 2000);
// } // }
setConfusionModelControll() {
// 混乱模式
if (this.item.operationModel === Constants.CONTROLL_CONFUSION) {
this.inHouseDisabled = true;
} else {
this.inHouseDisabled = false;
}
}
} }
...@@ -18,6 +18,7 @@ export class EnvFanPage implements OnInit { ...@@ -18,6 +18,7 @@ export class EnvFanPage implements OnInit {
/* 风机 */ /* 风机 */
// 牧场区域编号 // 牧场区域编号
fieldRegionNo = ''; fieldRegionNo = '';
operationModel = 0;
// 牧场设备类型 // 牧场设备类型
fieldDeviceType = ''; fieldDeviceType = '';
// 模式状态 // 模式状态
...@@ -75,6 +76,7 @@ export class EnvFanPage implements OnInit { ...@@ -75,6 +76,7 @@ export class EnvFanPage implements OnInit {
init() { init() {
this.ac.queryParams.subscribe((data) => { this.ac.queryParams.subscribe((data) => {
this.fieldRegionNo = data.no; this.fieldRegionNo = data.no;
this.operationModel = data.operationModel;
this.getData(0); this.getData(0);
}); });
} }
...@@ -93,6 +95,7 @@ export class EnvFanPage implements OnInit { ...@@ -93,6 +95,7 @@ export class EnvFanPage implements OnInit {
}); });
this.initButtons(); this.initButtons();
this.setConfusionModelControll();
} }
this.load.offLoad(); this.load.offLoad();
}]); }]);
...@@ -216,32 +219,13 @@ export class EnvFanPage implements OnInit { ...@@ -216,32 +219,13 @@ export class EnvFanPage implements OnInit {
}]); }]);
} }
setConfusionModelControll() {
// async presentLoading() { // 混乱模式
// const loading = await this.loadingController.create({ if (this.operationModel === Constants.CONTROLL_CONFUSION) {
// message: '通信中,还剩60秒', this.batchSwitch.disabled = true;
// duration: 60000 this.devices.forEach((device) => {
// }); device.disabled = true;
// await loading.present(); });
// let item = 60; }
// setInterval(() => { }
// item--;
// loading.message = '通信中,还剩' + item + '秒';
// }, 1000)
//
// const { role, data } = await loading.onDidDismiss();
//
// console.log('Loading dismissed!');
// }
// async presentLoadingWithOptions() {
// const loading = await this.loadingController.create({
// spinner: null,
// duration: 5000,
// message: '加载中...',
// translucent: true,
// cssClass: 'custom-class custom-loading'
// });
// return await loading.present();
// }
} }
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<!--</ngx-datatable-column>--> <!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'温度 <br>℃'" prop="temp" [width]="60">--> <!--<ngx-datatable-column [name]="'温度 <br>℃'" prop="temp" [width]="60">-->
<!--</ngx-datatable-column>--> <!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'湿度 <br>% rH'" prop="humi" [width]="60">--> <!--<ngx-datatable-column [name]="'湿度 <br>% RH'" prop="humi" [width]="60">-->
<!--</ngx-datatable-column>--> <!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'氨气浓度 <br>ppm'" prop="NH3" [width]="90">--> <!--<ngx-datatable-column [name]="'氨气浓度 <br>ppm'" prop="NH3" [width]="90">-->
<!--</ngx-datatable-column>--> <!--</ngx-datatable-column>-->
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column name="温度<br>℃" prop="temp" [width]="60"> <ngx-datatable-column name="温度<br>℃" prop="temp" [width]="60">
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column name="湿度<br>% rH" prop="humi" [width]="60"> <ngx-datatable-column name="湿度<br>% RH" prop="humi" [width]="60">
</ngx-datatable-column> </ngx-datatable-column>
<ngx-datatable-column name="氨气浓度<br>ppm" prop="NH3" [width]="90"> <ngx-datatable-column name="氨气浓度<br>ppm" prop="NH3" [width]="90">
</ngx-datatable-column> </ngx-datatable-column>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)"> <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content></ion-refresher-content> <ion-refresher-content></ion-refresher-content>
</ion-refresher> </ion-refresher>
<h1 class="main-title">故障统计</h1> <h1 class="main-title">牛舍状况统计</h1>
<div style="margin:1%"> <div style="margin:1%">
<v-kanban-double class="kanban-double" [name1]="'热应激'" [name2]="'故障'" <v-kanban-double class="kanban-double" [name1]="'热应激'" [name2]="'故障'"
[inData1]="thiGood" [inData2]="thiBad" [inData3]="alarmTotal" [inData1]="thiGood" [inData2]="thiBad" [inData3]="alarmTotal"
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
<div *ngIf="item.NH3 === '--'" class="detailInfo" style="width: 40%">氨气: &nbsp;{{'--'}}ppm</div> <div *ngIf="item.NH3 === '--'" class="detailInfo" style="width: 40%">氨气: &nbsp;{{'--'}}ppm</div>
<div *ngIf="item.temp !== '--'" class="detailInfo" style="width: 40%">温度: &nbsp;<span class="{{item.tempColor}}Color">{{item.temp | number:'0.1-1'}}℃</span></div> <div *ngIf="item.temp !== '--'" class="detailInfo" style="width: 40%">温度: &nbsp;<span class="{{item.tempColor}}Color">{{item.temp | number:'0.1-1'}}℃</span></div>
<div *ngIf="item.temp === '--'" class="detailInfo" style="width: 40%">温度: &nbsp;{{'--'}}℃</div> <div *ngIf="item.temp === '--'" class="detailInfo" style="width: 40%">温度: &nbsp;{{'--'}}℃</div>
<div *ngIf="item.humi !== '--'" class="detailInfo" style="width: 40%">湿度: &nbsp;<span class="{{item.humiColor}}Color">{{item.humi | number:'0.0-0'}}% rH</span></div> <div *ngIf="item.humi !== '--'" class="detailInfo" style="width: 40%">湿度: &nbsp;<span class="{{item.humiColor}}Color">{{item.humi | number:'0.0-0'}}% RH</span></div>
<div *ngIf="item.humi === '--'" class="detailInfo" style="width: 40%">湿度: &nbsp;{{'--'}}% rH</div> <div *ngIf="item.humi === '--'" class="detailInfo" style="width: 40%">湿度: &nbsp;{{'--'}}% RH</div>
</div> </div>
<div class="bottom"> <div class="bottom">
<div style="width:100%; margin-top:10px"> <div style="width:100%; margin-top:10px">
......
...@@ -220,7 +220,7 @@ export class EnvHomePage implements OnInit { ...@@ -220,7 +220,7 @@ export class EnvHomePage implements OnInit {
} }
toControl(one) { toControl(one) {
const query = '/env-detail?no=' + one.fieldRegionNo; const query = '/env-detail?no=' + one.fieldRegionNo + '&operationModel=' + one.operationModel;
this.tf.transfer({ this.tf.transfer({
url: '/' + one.url, url: '/' + one.url,
query: query, query: query,
......
...@@ -16,6 +16,7 @@ export class EnvLightPage implements OnInit { ...@@ -16,6 +16,7 @@ export class EnvLightPage implements OnInit {
/* 照明 */ /* 照明 */
// 牧场区域编号 // 牧场区域编号
fieldRegionNo = ''; fieldRegionNo = '';
operationModel = 0;
// 牧场设备类型 // 牧场设备类型
fieldDeviceType = ''; fieldDeviceType = '';
// 模式状态 // 模式状态
...@@ -86,6 +87,7 @@ export class EnvLightPage implements OnInit { ...@@ -86,6 +87,7 @@ export class EnvLightPage implements OnInit {
init() { init() {
this.route.paramMap.subscribe(params => { this.route.paramMap.subscribe(params => {
this.fieldRegionNo = params.get('fieldRegionNo'); this.fieldRegionNo = params.get('fieldRegionNo');
this.operationModel = + params.get('operationModel');
}); });
this.getData(0); this.getData(0);
} }
...@@ -111,33 +113,13 @@ export class EnvLightPage implements OnInit { ...@@ -111,33 +113,13 @@ export class EnvLightPage implements OnInit {
}); });
this.initButtons(); this.initButtons();
this.setConfusionModelControll();
} }
this.load.offLoad(); this.load.offLoad();
}]); }]);
} }
initButtons() { initButtons() {
// // 智控:2
// if (this.controlModel === 2) {
// this.batchSwitch.disabled = true;
// this.devices.forEach((device) => {
// device.disabled = true;
// });
// } else if (this.controlModel === 1) {
// // 自控:1
// // 一键控制: 活性 其他按钮: 非活性
// this.batchSwitch.disabled = false;
// this.devices.forEach((device) => {
// device.disabled = true;
// });
// } else {
// // 手控:0
// // 一键控制: 活性 其他按钮: 活性
// this.batchSwitch.disabled = false;
// this.devices.forEach((device) => {
// device.disabled = false;
// });
// }
if (this.controlModel === Constants.CONTROLL_REMOTR || this.controlModel === Constants.CONTROLL_SELF) { if (this.controlModel === Constants.CONTROLL_REMOTR || this.controlModel === Constants.CONTROLL_SELF) {
// 远控+自控 的场合 // 远控+自控 的场合
...@@ -229,7 +211,7 @@ export class EnvLightPage implements OnInit { ...@@ -229,7 +211,7 @@ export class EnvLightPage implements OnInit {
// 一键开启设备 // 一键开启设备
this.api.control.controlCowedBatchSwitch([req, (data) => { this.api.control.controlCowedBatchSwitch([req, (data) => {
if (data.code === 1) { if (data.code === 1) {
this.getData(1); this.getData(0);
this.api.presentMsgToast(data.message); this.api.presentMsgToast(data.message);
} else { } else {
this.getData(0); this.getData(0);
...@@ -278,4 +260,13 @@ export class EnvLightPage implements OnInit { ...@@ -278,4 +260,13 @@ export class EnvLightPage implements OnInit {
}]); }]);
} }
setConfusionModelControll() {
// 混乱模式
if (this.operationModel === Constants.CONTROLL_CONFUSION) {
this.batchSwitch.disabled = true;
this.devices.forEach((device) => {
device.disabled = true;
});
}
}
} }
...@@ -26,6 +26,7 @@ export class EnvShowerPage implements OnInit { ...@@ -26,6 +26,7 @@ export class EnvShowerPage implements OnInit {
// 牧场区域编号 // 牧场区域编号
fieldRegionNo = ''; fieldRegionNo = '';
operationModel = 0;
// 牧场设备类型 // 牧场设备类型
fieldDeviceType = ''; fieldDeviceType = '';
// 模式状态 // 模式状态
...@@ -108,6 +109,7 @@ export class EnvShowerPage implements OnInit { ...@@ -108,6 +109,7 @@ export class EnvShowerPage implements OnInit {
init() { init() {
this.route.paramMap.subscribe(params => { this.route.paramMap.subscribe(params => {
this.fieldRegionNo = params.get('fieldRegionNo'); this.fieldRegionNo = params.get('fieldRegionNo');
this.operationModel = + params.get('operationModel');
this.getData(0); this.getData(0);
}); });
} }
...@@ -137,6 +139,7 @@ export class EnvShowerPage implements OnInit { ...@@ -137,6 +139,7 @@ export class EnvShowerPage implements OnInit {
this.fieldDeviceNameB = this.param[1].fieldDeviceName; this.fieldDeviceNameB = this.param[1].fieldDeviceName;
} }
this.initButtons(); this.initButtons();
this.setConfusionModelControll();
} }
this.load.offLoad(); this.load.offLoad();
}]); }]);
...@@ -181,4 +184,13 @@ export class EnvShowerPage implements OnInit { ...@@ -181,4 +184,13 @@ export class EnvShowerPage implements OnInit {
btn.loading = false; btn.loading = false;
}]); }]);
} }
setConfusionModelControll() {
// 混乱模式
if (this.operationModel === Constants.CONTROLL_CONFUSION) {
this.param.forEach((device) => {
device.disabled = true;
});
}
}
} }
...@@ -14,4 +14,5 @@ export class Constants { ...@@ -14,4 +14,5 @@ export class Constants {
public static CONTROLL_REMOTR = 1; // 远控(手动控制) public static CONTROLL_REMOTR = 1; // 远控(手动控制)
public static CONTROLL_SELF = 2; // 自控 public static CONTROLL_SELF = 2; // 自控
public static CONTROLL_WISDOM = 3; // 智慧控制 public static CONTROLL_WISDOM = 3; // 智慧控制
public static CONTROLL_CONFUSION = 4; // 智慧控制
} }
...@@ -162,8 +162,12 @@ img { ...@@ -162,8 +162,12 @@ img {
} }
.font-content { .font-content {
font-size: 13px !important;
color: #8e8e8e !important;
}
.font-input {
font-size: 13px; font-size: 13px;
color: #8e8e8e;
} }
.font-note { .font-note {
...@@ -172,8 +176,8 @@ img { ...@@ -172,8 +176,8 @@ img {
} }
.font-smaller { .font-smaller {
font-size: 12px; font-size: 12px !important;
color: #8e8e8e; color: #8e8e8e !important;
} }
.font-mini { .font-mini {
...@@ -186,6 +190,11 @@ img { ...@@ -186,6 +190,11 @@ img {
color: #8e8e8e; color: #8e8e8e;
} }
.font-alarm {
font-size: 13px;
color: #F2401C;
}
.content-text-color { .content-text-color {
color: #8e8e8e; color: #8e8e8e;
} }
...@@ -319,5 +328,5 @@ img { ...@@ -319,5 +328,5 @@ img {
} }
.ion-segment-button { .ion-segment-button {
font-size: 16px; font-size: 15px;
} }
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