Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
muChangApp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WitCloud
muChangApp
Commits
afd6fef7
Commit
afd6fef7
authored
Nov 04, 2019
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改牛舍配置页
parent
7631c709
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
542 additions
and
389 deletions
+542
-389
env-cfg.page.html
src/app/envCtrl/env-cfg/env-cfg.page.html
+369
-316
env-cfg.page.scss
src/app/envCtrl/env-cfg/env-cfg.page.scss
+25
-1
env-cfg.page.ts
src/app/envCtrl/env-cfg/env-cfg.page.ts
+141
-72
api.ts
src/app/service/api.ts
+7
-0
No files found.
src/app/envCtrl/env-cfg/env-cfg.page.html
View file @
afd6fef7
...
...
@@ -5,359 +5,412 @@
</ion-header>
<ion-content>
<ion-item
lines=
"full"
>
<ion-label>
请选择牛舍
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
curFieldRegionNo
"
(
ionChange
)="
selectCowshed
()"
>
<ion-select-option
*
ngFor=
"let cowshed of cowshedList"
[
value
]="
cowshed
.
fieldRegionNo
"
>
{{cowshed.fieldRegionName}}
</ion-select-option>
</ion-select>
</ion-item>
<div
*
ngIf=
"curCowshed.fieldRegionName"
>
<ion-item
lines=
"full"
>
<ion-label>
智慧模式选择
</ion-label>
<ion-toggle
slot=
"end"
color=
"secondary"
style=
"width:50px"
[
checked
]="
curCowshed
.
isWisdomModel
"
(
change
)="
updateCowshed
()"
></ion-toggle>
<ion-item
lines=
"full"
style=
"margin-left: 5px;"
>
<ion-label>
请选择牛舍
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
curFieldRegionNo
"
(
ionChange
)="
selectCowshed
()"
>
<ion-select-option
*
ngFor=
"let cowshed of cowshedList"
[
value
]="
cowshed
.
fieldRegionNo
"
>
{{cowshed.fieldRegionName}}
</ion-select-option>
</ion-select>
</ion-item>
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
<ion-item-divider>
<ion-label>
偏差值配置
</ion-label>
</ion-item-divider>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-grid>
<ion-row>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
偏差温度
</ion-label>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
toft
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
偏差湿度
</ion-label>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
hoft
"
(
ionFocus
)="
humHaveFouch
()"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
<ion-label
position=
"fixed"
>
%
</ion-label>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<div
*
ngIf=
"fengJi"
>
<ion-item-divider>
<ion-label>
风机模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
fengJi
.
controlModel
"
[(
value
)]="
fengJi
.
controlModel
"
(
ionChange
)="
workModeEvent
(
fengJi
)"
>
<ion-select-option
value=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
<div
*
ngIf=
"curCowshed.fieldRegionName"
>
<ion-item
lines=
"full"
class=
"subTitle"
>
<ion-label>
智慧模式选择
</ion-label>
<ion-toggle
slot=
"end"
color=
"secondary"
style=
"width:50px"
[(
checked
)]="
curCowshed
.
isWisdomModel
"
></ion-toggle>
</ion-item>
<div
style=
"margin-left: 10px; margin-right: 10px;"
>
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
</div>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
(
click
)="
openProperty
()"
>
偏差值配置
</ion-label>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenProperty"
(
click
)="
openProperty
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenProperty"
(
click
)="
openProperty
()"
></ion-icon>
</ion-item-divider>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenProperty"
>
<ion-grid>
<ion-row>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
开启
温度
</ion-label>
<ion-input
(
ionFocus
)="
tempHaveTouch
()"
[(
ngModel
)]="
fengJi
.
controlConfig
.
TU
"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-label
position=
"fixed"
>
偏差
温度
</ion-label>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
toft
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
关闭温
度
</ion-label>
<ion-input
(
ionFocus
)="
tempHaveTouch
()"
[(
ngModel
)]="
fengJi
.
controlConfig
.
TL
"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
<ion-label
position=
"fixed"
>
偏差湿
度
</ion-label>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
hoft
"
></ion-input>
<ion-label
position=
"fixed"
>
% rH
</ion-label>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item
class=
"fanItem"
lines=
"none"
style=
"padding-left: 10px"
>
<a
(
click
)="
referenceModel
()"
>
参考常用模式
</a>
</ion-item>
</div>
<div
*
ngIf=
"penLin"
>
<ion-item-divider>
<ion-label>
喷淋模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
penLin
.
controlModel
"
[(
value
)]="
penLin
.
controlModel
"
(
ionChange
)="
workModeEvent
(
penLin
)"
>
<ion-select-option
value=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
</ion-item-divider>
<ion-item-sliding
*
ngFor=
"let cfg of penLin.controlConfig"
>
<ion-item
class=
"fanItem"
>
<div
*
ngIf=
"fan"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
style=
"width: 40%"
>
风机模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
fan
.
controlModel
"
[(
value
)]="
fan
.
controlModel
"
(
ionChange
)="
workModeEvent
(
fengJi
)"
>
<ion-select-option
value=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenFan"
(
click
)="
openFan
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenFan"
(
click
)="
openFan
()"
></ion-icon>
</ion-item-divider>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenFan"
>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-input
[(
ngModel
)]="
cfg
.
name
"
(
ionFocus
)="
tempHaveTouch
()"
style=
"width:80px;"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
间隔时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
intverval
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
设置温度
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
T
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
<ion-label>
℃
</ion-label>
</ion-item>
</ion-col>
<!-- <ion-col size="auto" style="font-size: 13px;">-->
<!-- <ion-item class="fanItem" lines="none">-->
<!-- <ion-label style="width:80px">偏差温度</ion-label>-->
<!-- <ion-input [(ngModel)]="penLinCfg.A" (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!-- </ion-item>-->
<!-- </ion-col>-->
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
A区喷水时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
A
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-row>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
开启温度
</ion-label>
<ion-input
required
(
ionFocus
)="
tempHaveTouch
($
event
)"
[(
ngModel
)]="
fan
.
controlConfig
.
TU
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
B区喷水时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
B
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-label
>
秒
</ion-label>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
关闭温度
</ion-label>
<ion-input
required
(
ionFocus
)="
tempHaveTouch
($
event
)"
[(
ngModel
)]="
fan
.
controlConfig
.
TL
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-sliding>
<ion-item
width=
"100%"
lines=
"none"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
addModel
()"
>
添加模式
</ion-button>
</ion-item>
</div>
<ion-item
class=
"fanItem"
lines=
"none"
style=
"padding-left: 10px"
*
ngIf=
"isOpenFan"
>
<a
(
click
)="
referenceModel
()"
>
参考常用模式
</a>
</ion-item>
</div>
<div
*
ngIf=
"zhaoMing"
>
<ion-item-divider>
<ion-label>
照明配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
zhaoMing
.
controlModel
"
[(
value
)]="
zhaoMing
.
controlModel
"
(
ionChange
)="
workModeEvent
(
zhaoMing
)"
>
<ion-select-option
value=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
</ion-item-divider>
<ion-item-sliding
*
ngFor=
"let cfg of zhaoMing.controlConfig"
>
<ion-item
style=
"--padding-start: 0px"
>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
name
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
[(
ngModel
)]="
cfg
.
startDate
"
displayFormat=
"MM-DD"
class=
"timepicker"
(
blur
)="
updateCowshed
()"
></ion-datetime>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
[(
ngModel
)]="
cfg
.
stopDate
"
displayFormat=
"MM-DD"
class=
"timepicker"
(
blur
)="
updateCowshed
()"
></ion-datetime>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
开灯时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
on
"
(
ionFocus
)="
tempHaveTouch
()"
(
onBlur
)="
updateCowshed
()"
></ion-input>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
关灯时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
off
"
(
ionFocus
)="
tempHaveTouch
()"
(
onBlur
)="
updateCowshed
()"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
<div
*
ngIf=
"shower"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
style=
"width: 40%"
>
喷淋模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
shower
.
controlModel
"
[(
value
)]="
shower
.
controlModel
"
(
ionChange
)="
workModeEvent
(
shower
)"
>
<ion-select-option
value=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenShower"
(
click
)="
openShower
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenShower"
(
click
)="
openShower
()"
></ion-icon>
</ion-item-divider>
<div
*
ngIf=
"isOpenShower"
>
<ion-item-sliding
*
ngFor=
"let cfg of shower.controlConfig"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-input
required
[(
ngModel
)]="
cfg
.
name
"
style=
"width:80px;"
></ion-input>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
间隔时间
</ion-label>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
intverval
"
></ion-input>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
设置温度
</ion-label>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
T
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input>
<ion-label>
℃
</ion-label>
</ion-item>
</ion-col>
<!-- <ion-col size="auto" style="font-size: 13px;">-->
<!-- <ion-item class="fanItem" lines="none">-->
<!-- <ion-label style="width:80px">偏差温度</ion-label>-->
<!-- <ion-input [(ngModel)]="penLinCfg.A" (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!-- </ion-item>-->
<!-- </ion-col>-->
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
A区喷水时间
</ion-label>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
A
"
></ion-input>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
B区喷水时间
</ion-label>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
B
"
></ion-input>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-sliding>
</div>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenShower"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
addModel
()"
>
添加模式
</ion-button>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-sliding>
<ion-item
width=
"100%"
lines=
"none"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
changeModel
()"
>
替换模式
</ion-button>
</ion-item>
</div>
</div>
<div
*
ngIf=
"shuiCao"
>
<ion-item-divider>
<ion-label>
水槽预警时间段配置
</ion-label>
</ion-item-divider>
<ion-item-sliding>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
[(
ngModel
)]="
shuiCao
.
controlConfig
.
startDate
"
displayFormat=
"MM-DD"
class=
"timepicker"
(
change
)="
updateCowshed
()"
></ion-datetime>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
[(
ngModel
)]="
shuiCao
.
controlConfig
.
stopDate
"
displayFormat=
"MM-DD"
class=
"timepicker"
(
change
)="
updateCowshed
()"
></ion-datetime>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-label
text-wrap
color=
"danger"
>
上述时间段内,加热设备电流过低时,系统将会发出预警信息
</ion-label>
</ion-row>
</ion-grid>
<div
*
ngIf=
"light"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
style=
"width: 40%"
>
照明配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
light
.
controlModel
"
[(
value
)]="
light
.
controlModel
"
(
ionChange
)="
workModeEvent
(
light
)"
>
<ion-select-option
value=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenLight"
(
click
)="
openLight
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenLight"
(
click
)="
openLight
()"
></ion-icon>
</ion-item-divider>
<div
*
ngIf=
"isOpenLight"
>
<ion-item-sliding
*
ngFor=
"let cfg of light.controlConfig"
>
<ion-item
style=
"--padding-start: 0px"
>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
name
"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
required
[(
ngModel
)]="
cfg
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
required
[(
ngModel
)]="
cfg
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
开灯时间
</ion-label>
<ion-datetime
required
[(
ngModel
)]="
cfg
.
on
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<!--<ion-input style="width:50px;" [(ngModel)]="cfg.on" (ionFocus)="tempHaveTouch()"></ion-input>-->
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
关灯时间
</ion-label>
<ion-datetime
required
[(
ngModel
)]="
cfg
.
off
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<!--<ion-input style="width:50px;" [(ngModel)]="cfg.off" (ionFocus)="tempHaveTouch()"></ion-input>-->
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-sliding>
</div>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenLight"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
changeModel
()"
>
替换模式
</ion-button>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-sliding>
</div>
</div>
<div
*
ngIf=
"waterChannel"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
水槽预警时间段配置
</ion-label>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenWaterChannel"
(
click
)="
openWaterChannel
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenWaterChannel"
(
click
)="
openWaterChannel
()"
></ion-icon>
</ion-item-divider>
<ion-item-sliding
*
ngIf=
"isOpenWaterChannel"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
required
[(
ngModel
)]="
waterChannel
.
controlConfig
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
required
[(
ngModel
)]="
waterChannel
.
controlConfig
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
</ion-item>
</ion-col>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-label
text-wrap
color=
"danger"
>
上述时间段内,加热设备电流过低时,系统将会发出预警信息
</ion-label>
</ion-row>
</ion-grid>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-sliding>
</div>
<ion-item-divider>
<ion-label>
牛群在/离舍配置
</ion-label>
</ion-item-divider>
<ion-item
class=
"fanItem"
>
<ion-grid>
<!--<ion-row>-->
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
牛群在/离舍配置
</ion-label>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenInHouse"
(
click
)="
openInHouse
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenInHouse"
(
click
)="
openInHouse
()"
></ion-icon>
</ion-item-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenInHouse"
>
<ion-grid>
<!--<ion-row>-->
<!--<ion-col>牛群回舍时需恢复上述的设备</ion-col>-->
<!--</ion-row>-->
<!--<ion-row>-->
<!--</ion-row>-->
<!--<ion-row>-->
<!--<ion-col *ngFor="let device of curCowshed.leave">-->
<!--<ion-item lines="none" class="cow">-->
<!--<ion-label>{{device}}</ion-label>-->
<!--<!– <ion-checkbox color="primary" class="cowCheckBox" slot="start" [(ngModel)]="curCowshed.propertyConfig.toft"></ion-checkbox>–>-->
<!--</ion-item>-->
<!--<ion-item lines="none" class="cow">-->
<!--<ion-label>{{device}}</ion-label>-->
<!--<!– <ion-checkbox color="primary" class="cowCheckBox" slot="start" [(ngModel)]="curCowshed.propertyConfig.toft"></ion-checkbox>–>-->
<!--</ion-item>-->
<!--</ion-col>-->
<!--</ion-row>-->
<!--<ion-row>-->
<!--</ion-row>-->
<!--<ion-row>-->
<!--<ion-col>牛群离舍时需完全关闭的设备</ion-col>-->
<!--</ion-row>-->
<!--<ion-row>-->
<!--</ion-row>-->
<!--<ion-row>-->
<!--<ion-col *ngFor="let device of curCowshed.back">-->
<!--<ion-item lines="none" class="cow">-->
<!--<ion-label>{{device}}</ion-label>-->
<!--<!– <ion-checkbox color="primary" class="cowCheckBox" slot="start" [(ngModel)]="curCowshed.propertyConfig.toft"></ion-checkbox>–>-->
<!--</ion-item>-->
<!--<ion-item lines="none" class="cow">-->
<!--<ion-label>{{device}}</ion-label>-->
<!--<!– <ion-checkbox color="primary" class="cowCheckBox" slot="start" [(ngModel)]="curCowshed.propertyConfig.toft"></ion-checkbox>–>-->
<!--</ion-item>-->
<!--</ion-col>-->
<!--</ion-row>-->
<ion-row>
<ion-col>
牛群回舍时需恢复上述的设备
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
牛群离舍时需完全关闭的设备
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<!--</ion-row>-->
<ion-row>
<ion-col>
牛群回舍时需恢复上述的设备
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
牛群离舍时需完全关闭的设备
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item-divider>
<ion-label>
环境参数预警配置
</ion-label>
</ion-item-divider>
<ion-item
class=
"fanItem"
>
<ion-grid>
<div>
<ngx-datatable
class=
'material'
[
rows
]="
environmentConfig
"
[
columnMode
]="'
force
'"
style=
"white-space: nowrap; text-align: center"
>
<ngx-datatable-column
name=
""
prop=
"tittle"
width=
"50px;"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"上限"
prop=
"top"
width=
"20px;"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"下限"
prop=
"lower"
width=
"20px;"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
""
prop=
"symbol"
width=
"5px;"
style=
"margin-left: 0px"
>
</ngx-datatable-column>
</ngx-datatable>
</div>
</ion-grid>
</ion-item>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
环境参数预警配置
</ion-label>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenEnvironment"
(
click
)="
openEnvironment
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenEnvironment"
(
click
)="
openEnvironment
()"
></ion-icon>
</ion-item-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenEnvironment"
>
<ion-grid>
<div
style=
"text-align: center; margin-top:10px; margin-bottom: 10px"
>
<!--<ngx-datatable class='material' [rows]="environmentConfig" [columnMode]="'force'" style="white-space: nowrap; text-align: center">-->
<!--<ngx-datatable-column name="" prop="tittle" width="50px;">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column name="上限" prop="top" width="20px;" >-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column name="下限" prop="lower" width="20px;">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column name="" prop="symbol" width="5px;" style="margin-left: 0px">-->
<!--</ngx-datatable-column>-->
<!--</ngx-datatable>-->
<table
style=
"width:80%; display: inline-block;"
>
<tr>
<th
style=
"width:20%"
></th>
<td
style=
"width:30%"
>
上限
</td>
<td
style=
"width:30%"
>
下限
</td>
<td
style=
"width:10%"
></td>
</tr>
<tr>
<th>
温度
</th>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TU
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input></td>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TL
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input></td>
<td>
℃
</td>
</tr>
<tr>
<th>
湿度
</th>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HU
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HL
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td>
% rH
</td>
</tr>
<tr>
<th>
氨气
</th>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HU
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HL
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td>
ppm
</td>
</tr>
<ion-item-divider>
<ion-label>
环境参数配置
</ion-label>
</ion-item-divider>
</table>
</div>
</ion-grid>
</ion-item>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-row>
<ion-item
lines=
"none"
class=
"thiItem"
>
热应激配置
</ion-item>
</ion-row>
<ion-row>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
环境参数配置
</ion-label>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenHeatStress"
(
click
)="
openHeatStress
()"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenHeatStress"
(
click
)="
openHeatStress
()"
></ion-icon>
</ion-item-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenHeatStress"
>
<ion-grid>
<ion-row>
<ion-item
lines=
"none"
class=
"thiItem"
>
热应激配置
</ion-item>
</ion-row>
<ion-row>
<ion-item
lines=
"none"
class=
"thiItem"
>
计算公式 0.81* 温度 +(0.99*温度-14.3)*湿度+46.3
</ion-item>
</ion-row>
<ion-row>
<ion-item
lines=
"none"
class=
"thiItem"
>
等级临界值
</ion-item>
</ion-row>
<ion-row>
<ion-col
class=
"thiItem"
>
应激等级
</ion-col>
<ion-col
class=
"thiItem"
>
THI值(
<
)</
ion-col
>
<ion-col
class=
"thiItem"
>
预警等级
</ion-col>
</ion-row>
<ion-row
*
ngFor=
"let heatStress of curCowshed.heatStressList"
>
<ion-col
class=
"thiItem"
>
{{heatStress.heatStressLevel}}
</ion-col>
<ion-col
class=
"thiItem"
>
{{heatStress.thi}}
</ion-col>
<ion-col
class=
"thiItem"
>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
heatStress
.
alarmLevel
"
[(
value
)]="
heatStress
.
alarmLevel
"
(
ionChange
)="
workModeEvent
(
heatStress
)"
>
<ion-select-option
value=
"无"
>
无
</ion-select-option>
<ion-select-option
value=
"低"
>
低
</ion-select-option>
<ion-select-option
value=
"中"
>
中
</ion-select-option>
<ion-select-option
value=
"高"
>
高
</ion-select-option>
</ion-select>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
</div>
</ion-row>
<ion-row>
<ion-item
lines=
"none"
class=
"thiItem"
>
等级临界值
</ion-item>
</ion-row>
<ion-row>
<ion-col
class=
"thiItem"
>
应激等级
</ion-col>
<ion-col
class=
"thiItem"
>
THI值(
<
)</
ion-col
>
<ion-col
class=
"thiItem"
>
预警等级
</ion-col>
</ion-row>
<ion-row
*
ngFor=
"let heatStress of curCowshed.heatStressList"
>
<ion-col
class=
"thiItem"
>
{{heatStress.heatStressLevel}}
</ion-col>
<ion-col
class=
"thiItem"
>
{{heatStress.thi}}
</ion-col>
<ion-col
class=
"thiItem"
>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
heatStress
.
alarmLevel
"
[(
value
)]="
heatStress
.
alarmLevel
"
(
ionChange
)="
workModeEvent
(
heatStress
)"
>
<ion-select-option
value=
"无"
>
无
</ion-select-option>
<ion-select-option
value=
"低"
>
低
</ion-select-option>
<ion-select-option
value=
"中"
>
中
</ion-select-option>
<ion-select-option
value=
"高"
>
高
</ion-select-option>
</ion-select>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item
width=
"100%"
lines=
"none"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
updateCowshed
()"
>
保存配置
</ion-button>
</ion-item>
</div>
</ion-content>
src/app/envCtrl/env-cfg/env-cfg.page.scss
View file @
afd6fef7
...
...
@@ -15,7 +15,7 @@
.fanItem
{
font-size
:
13px
;
--padding-start
:
0px
--padding-start
:
5px
;
}
.cow
{
...
...
@@ -45,3 +45,27 @@
.addBtn
{
width
:
100%
;
}
.itemDriver
{
--inner-padding-end
:
50px
;
}
.iconOpen
{
font-size
:
20px
;
}
.subTitle
{
font-size
:
16px
;
border-left
:
5px
solid
#62C7CC
;
font-weight
:
bold
;
margin-left
:
5px
;
margin-bottom
:
3px
;
}
.selectFont
{
font-weight
:
normal
;
}
.popContent
{
text-align
:
center
;
}
src/app/envCtrl/env-cfg/env-cfg.page.ts
View file @
afd6fef7
...
...
@@ -2,7 +2,6 @@ import {Component, OnInit} from '@angular/core';
import
{
PickerController
,
AlertController
}
from
'@ionic/angular'
;
import
{
Api
}
from
'../../service/api'
;
import
{
Load
}
from
'../../service/load'
;
import
{
NgxDatatableModule
}
from
'@swimlane/ngx-datatable'
;
@
Component
({
selector
:
'v-env-cfg'
,
...
...
@@ -17,9 +16,9 @@ export class EnvCfgPage implements OnInit {
'selecting'
:
false
,
};
light
=
{
'selecting'
:
false
,
};
//
light = {
//
'selecting': false,
//
};
constructor
(
public
alerCtrl
:
AlertController
,
private
pickerController
:
PickerController
,
private
api
:
Api
,
private
load
:
Load
)
{
}
...
...
@@ -40,16 +39,29 @@ export class EnvCfgPage implements OnInit {
back
:
[],
environmentConfigJson
:
{
TU
:
0
,
TL
:
0
,
HU
:
0
,
HL
:
0
},
heatStressList
:
[]
};
// 各设备配置信息
fengJi
:
any
=
{};
penLin
:
any
=
{};
zhaoMing
:
any
=
{};
shuiCao
:
any
=
{};
fan
:
any
=
{};
shower
:
any
=
{};
light
:
any
=
{};
waterChannel
:
any
=
{};
// 环境参数预警配置
environmentConfig
=
[];
// 设置菜单折叠/打开
isOpenProperty
=
false
;
isOpenFan
=
false
;
isOpenShower
=
false
;
isOpenLight
=
false
;
isOpenWaterChannel
=
false
;
isOpenInHouse
=
false
;
isOpenEnvironment
=
false
;
isOpenHeatStress
=
false
;
private
$ionicPopup
:
any
;
async
openPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
)
{
async
openPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
,
event
)
{
const
picker
=
await
this
.
pickerController
.
create
({
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
buttons
:
[
...
...
@@ -63,7 +75,8 @@ export class EnvCfgPage implements OnInit {
{
text
:
'确认'
,
handler
:
(
value
)
=>
{
// console.log(`Got Value ${value}`);
event
.
target
.
value
=
value
.
col0
.
text
;
console
.
log
(
value
.
value
);
this
.
fanMode
.
selecting
=
false
;
}
}
...
...
@@ -76,7 +89,7 @@ export class EnvCfgPage implements OnInit {
const
columns
=
[];
for
(
let
i
=
0
;
i
<
numColumns
;
i
++
)
{
columns
.
push
({
name
:
`col
-
${
i
}
`
,
name
:
`col
${
i
}
`
,
options
:
this
.
getColumnOptions
(
i
,
numOptions
,
columnOptions
)
});
}
...
...
@@ -96,16 +109,6 @@ export class EnvCfgPage implements OnInit {
ngOnInit
()
{
// this.pickerController = document.querySelector('ion-picker-controller');
this
.
defaultColumnOptions
=
[
[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
]
];
this
.
init
();
}
...
...
@@ -201,52 +204,59 @@ export class EnvCfgPage implements OnInit {
}
workModeEvent
(
item
)
{
this
.
updateCowshed
();
//
this.updateCowshed();
}
async
openCalendarPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
)
{
const
picker
=
await
this
.
pickerController
.
create
({
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
buttons
:
[
{
text
:
'Cancel'
,
role
:
'cancel'
,
handler
:
()
=>
{
this
.
fanMode
.
selecting
=
false
;
}
},
{
text
:
'Confirm'
,
handler
:
(
value
)
=>
{
console
.
log
(
`Got Value
${
value
}
`
);
this
.
fanMode
.
selecting
=
false
;
}
}
]
});
await
picker
.
present
();
}
//
async openCalendarPicker(numColumns = 1, numOptions = 5, columnOptions = this.defaultColumnOptions) {
//
const picker = await this.pickerController.create({
//
columns: this.getColumns(numColumns, numOptions, columnOptions),
//
buttons: [
//
{
//
text: 'Cancel',
//
role: 'cancel',
//
handler: () => {
//
this.fanMode.selecting = false;
//
}
//
},
//
{
//
text: 'Confirm',
//
handler: (value) => {
//
console.log(`Got Value ${value}`);
//
this.fanMode.selecting = false;
//
}
//
}
//
]
//
});
//
await picker.present();
//
}
tempHaveTouch
()
{
tempHaveTouch
(
event
)
{
for
(
let
i
=
10
;
i
<=
50
;
i
++
)
{
this
.
defaultColumnOptions
[
0
][
i
-
10
]
=
i
.
toString
();
}
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
this
.
openPicker
(
10
,
50
);
this
.
openPicker
(
1
,
41
,
this
.
defaultColumnOptions
,
event
);
}
}
humHaveFouch
()
{
humHaveTouch
(
event
)
{
for
(
let
i
=
0
;
i
<=
100
;
i
++
)
{
this
.
defaultColumnOptions
[
0
][
i
]
=
i
.
toString
();
}
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
this
.
openPicker
(
0
,
100
);
this
.
openPicker
(
1
,
101
,
this
.
defaultColumnOptions
,
event
);
}
}
lightTimeHaveFouch
()
{
console
.
log
(
'lightTimeHaveFouch'
);
if
(
this
.
light
.
selecting
===
false
)
{
this
.
light
.
selecting
=
true
;
this
.
openPicker
();
}
//
console.log('lightTimeHaveFouch');
//
if (this.light.selecting === false) {
//
this.light.selecting = true;
//
this.openPicker();
//
}
}
// 获取当前牛舍配置信息
...
...
@@ -334,16 +344,16 @@ export class EnvCfgPage implements OnInit {
configInfo
.
map
((
value
,
index
)
=>
{
switch
(
value
.
fieldDeviceType
)
{
case
'风机'
:
this
.
f
engJi
=
value
;
this
.
f
an
=
value
;
break
;
case
'喷淋'
:
this
.
penLin
=
value
;
this
.
shower
=
value
;
break
;
case
'照明'
:
this
.
zhaoMing
=
value
;
this
.
light
=
value
;
break
;
case
'水槽'
:
this
.
shuiCao
=
value
;
this
.
waterChannel
=
value
;
break
;
default
:
break
;
...
...
@@ -351,19 +361,18 @@ export class EnvCfgPage implements OnInit {
});
}
// 环境预警参数
if
(
this
.
curCowshed
.
environmentConfigJson
)
{
const
temperatureCfg
=
{
tittle
:
'温度'
,
top
:
this
.
curCowshed
.
environmentConfigJson
.
TU
,
lower
:
this
.
curCowshed
.
environmentConfigJson
.
TL
,
symbol
:
'℃'
};
const
humidityCfg
=
{
tittle
:
'湿度'
,
top
:
this
.
curCowshed
.
environmentConfigJson
.
HU
,
lower
:
this
.
curCowshed
.
environmentConfigJson
.
HL
,
symbol
:
'%'
};
this
.
environmentConfig
.
push
(
temperatureCfg
,
humidityCfg
);
}
//
if (this.curCowshed.environmentConfigJson) {
//
const temperatureCfg = {tittle: '温度', top: this.curCowshed.environmentConfigJson.TU,
//
lower : this.curCowshed.environmentConfigJson.TL, symbol: '℃'};
//
const humidityCfg = {tittle: '湿度', top: this.curCowshed.environmentConfigJson.HU,
//
lower : this.curCowshed.environmentConfigJson.HL, symbol: '%'};
//
this.environmentConfig.push(temperatureCfg, humidityCfg);
//
}
}
// 修改牛舍配置
updateCowshed
()
{
this
.
api
.
config
.
updateCowshedConfig
([
this
.
curCowshed
,
(
data
)
=>
{
if
(
data
)
{
console
.
log
(
'更新成功'
);
}
else
{
...
...
@@ -375,19 +384,45 @@ export class EnvCfgPage implements OnInit {
}
referenceModel
()
{
this
.
selectModel
(
'风机'
,
0
);
let
fanModels
=
{};
this
.
api
.
devicePatternModel
.
getByFactoryNoAndType
([{
factoryNo
:
this
.
curCowshed
.
factoryNo
,
fieldDeviceType
:
'风机'
},
(
data
)
=>
{
// TODO 测试用数据
data
=
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'模式一'
,
fieldDeviceType
:
'风机'
,
configJson
:
[{
name
:
'春季'
,
TU
:
20
,
TL
:
-
10
},
{
name
:
'夏季'
,
TU
:
21
,
TL
:
-
11
},
{
name
:
'秋季'
,
TU
:
22
,
TL
:
-
12
},
{
name
:
'冬季'
,
TU
:
23
,
TL
:
-
13
},
],
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
}
if
(
data
)
{
fanModels
=
data
;
this
.
selectModel
(
'风机'
,
0
,
fanModels
);
}
this
.
load
.
offLoad
();
}]);
}
addModel
()
{
this
.
selectModel
(
'照明'
,
1
);
const
lightModels
=
{};
this
.
selectModel
(
'照明'
,
1
,
lightModels
);
}
changeModel
()
{
this
.
selectModel
(
'喷淋'
,
1
);
const
showerModels
=
{};
this
.
selectModel
(
'喷淋'
,
1
,
showerModels
);
}
// 参考:0 添加/替换:1
async
selectModel
(
deviceName
,
ref
)
{
async
selectModel
(
deviceName
,
ref
,
models
)
{
const
alert
=
await
this
.
alerCtrl
.
create
({
header
:
deviceName
+
'常用模式选择'
,
inputs
:
[
...
...
@@ -395,7 +430,8 @@ export class EnvCfgPage implements OnInit {
type
:
'radio'
,
label
:
'春季'
,
value
:
'Spring'
,
checked
:
false
},
checked
:
false
},
{
type
:
'radio'
,
label
:
'夏季'
,
...
...
@@ -411,8 +447,16 @@ export class EnvCfgPage implements OnInit {
label
:
'冬季'
,
value
:
'Winter'
,
checked
:
false
}],
buttons
:
[{
text
:
'取消'
,
cssClass
:
'width: 40%'
},
{
text
:
'确定'
,
cssClass
:
'width: 40%'
}]
buttons
:
[
{
text
:
'取消'
,
cssClass
:
'width: 40%'
},
{
text
:
'确定'
,
cssClass
:
'width: 40%'
,
handler
:
(
value
)
=>
{
// event.target.value = value.col0.text;
// console.log(value.value);
// this.fanMode.selecting = false;
}}]
});
if
(
1
===
ref
)
{
alert
.
inputs
.
push
({
...
...
@@ -424,4 +468,29 @@ export class EnvCfgPage implements OnInit {
await
alert
.
present
();
}
openProperty
()
{
this
.
isOpenProperty
=
!
this
.
isOpenProperty
;
}
openFan
()
{
this
.
isOpenFan
=
!
this
.
isOpenFan
;
}
openShower
()
{
this
.
isOpenShower
=
!
this
.
isOpenShower
;
}
openLight
()
{
this
.
isOpenLight
=
!
this
.
isOpenLight
;
}
openWaterChannel
()
{
this
.
isOpenWaterChannel
=
!
this
.
isOpenWaterChannel
;
}
openInHouse
()
{
this
.
isOpenInHouse
=
!
this
.
isOpenInHouse
;
}
openEnvironment
()
{
this
.
isOpenEnvironment
=
!
this
.
isOpenEnvironment
;
}
openHeatStress
()
{
this
.
isOpenHeatStress
=
!
this
.
isOpenHeatStress
;
}
}
src/app/service/api.ts
View file @
afd6fef7
...
...
@@ -95,6 +95,13 @@ export class Api {
updateCowshedConfig
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedConfig/updateCowshedConfig'
,
data
),
};
public
devicePatternModel
=
{
getByFactoryNoAndType
:
(
data
)
=>
this
.
trans
(
'post'
,
'/devicePatternModel/getByFactoryNoAndType'
,
data
),
addDevicePatternModel
:
(
data
)
=>
this
.
trans
(
'post'
,
'/devicePatternModel/addDevicePatternModel'
,
data
),
updateDevicePatternModel
:
(
data
)
=>
this
.
trans
(
'post'
,
'/devicePatternModel/updateDevicePatternModel'
,
data
),
deleteDevicePatternModel
:
(
data
)
=>
this
.
trans
(
'post'
,
'/devicePatternModel/deleteDevicePatternModel'
,
data
),
};
private
trans
(
type
,
addr
,
data
)
{
this
.
sendHttpReq
(
type
,
addr
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment