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
Show 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,96 +5,105 @@
...
@@ -5,96 +5,105 @@
</ion-header>
</ion-header>
<ion-content>
<ion-content>
<ion-item
lines=
"full
"
>
<ion-item
lines=
"full"
style=
"margin-left: 5px;
"
>
<ion-label>
请选择牛舍
</ion-label>
<ion-label>
请选择牛舍
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
curFieldRegionNo
"
(
ionChange
)="
selectCowshed
()"
>
<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-option
*
ngFor=
"let cowshed of cowshedList"
[
value
]="
cowshed
.
fieldRegionNo
"
>
{{cowshed.fieldRegionName}}
</ion-select-option>
</ion-select>
</ion-select>
</ion-item>
</ion-item>
<div
*
ngIf=
"curCowshed.fieldRegionName"
>
<div
*
ngIf=
"curCowshed.fieldRegionName"
>
<ion-item
lines=
"full
"
>
<ion-item
lines=
"full"
class=
"subTitle
"
>
<ion-label>
智慧模式选择
</ion-label>
<ion-label>
智慧模式选择
</ion-label>
<ion-toggle
slot=
"end"
color=
"secondary"
style=
"width:50px"
[
checked
]="
curCowshed
.
isWisdomModel
"
(
change
)="
updateCowshed
()
"
></ion-toggle>
<ion-toggle
slot=
"end"
color=
"secondary"
style=
"width:50px"
[(
checked
)]="
curCowshed
.
isWisdomModel
"
></ion-toggle>
</ion-item>
</ion-item>
<div
style=
"margin-left: 10px; margin-right: 10px;"
>
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
<ion-item-divider>
</div>
<ion-label>
偏差值配置
</ion-label>
<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-divider>
<ion-item
class=
"fanItem"
lines=
"none
"
>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenProperty
"
>
<ion-grid>
<ion-grid>
<ion-row>
<ion-row>
<ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
偏差温度
</ion-label>
<ion-label
position=
"fixed"
>
偏差温度
</ion-label>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
toft
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
toft
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
偏差湿度
</ion-label>
<ion-label
position=
"fixed"
>
偏差湿度
</ion-label>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
hoft
"
(
ionFocus
)="
humHaveFouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
hoft
"
></ion-input>
<ion-label
position=
"fixed"
>
%
</ion-label>
<ion-label
position=
"fixed"
>
% rH
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<div
*
ngIf=
"fengJi
"
>
<div
*
ngIf=
"fan
"
>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
>
风机模式配置
</ion-label>
<ion-label
style=
"width: 40%"
>
风机模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
fengJi
.
controlModel
"
[(
value
)]="
fengJi
.
controlModel
"
(
ionChange
)="
workModeEvent
(
fengJi
)"
>
<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=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
</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-divider>
<ion-item
class=
"fanItem"
lines=
"none
"
>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenFan
"
>
<ion-grid>
<ion-grid>
<ion-row>
<ion-row>
<ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
开启温度
</ion-label>
<ion-label
position=
"fixed"
>
开启温度
</ion-label>
<ion-input
(
ionFocus
)="
tempHaveTouch
()"
[(
ngModel
)]="
fengJi
.
controlConfig
.
TU
"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
(
ionFocus
)="
tempHaveTouch
($
event
)"
[(
ngModel
)]="
fan
.
controlConfig
.
TU
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
关闭温度
</ion-label>
<ion-label
position=
"fixed"
>
关闭温度
</ion-label>
<ion-input
(
ionFocus
)="
tempHaveTouch
()"
[(
ngModel
)]="
fengJi
.
controlConfig
.
TL
"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
(
ionFocus
)="
tempHaveTouch
($
event
)"
[(
ngModel
)]="
fan
.
controlConfig
.
TL
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<ion-item
class=
"fanItem"
lines=
"none"
style=
"padding-left: 10px
"
>
<ion-item
class=
"fanItem"
lines=
"none"
style=
"padding-left: 10px"
*
ngIf=
"isOpenFan
"
>
<a
(
click
)="
referenceModel
()"
>
参考常用模式
</a>
<a
(
click
)="
referenceModel
()"
>
参考常用模式
</a>
</ion-item>
</ion-item>
</div>
</div>
<div
*
ngIf=
"penLin
"
>
<div
*
ngIf=
"shower
"
>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
>
喷淋模式配置
</ion-label>
<ion-label
style=
"width: 40%"
>
喷淋模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
penLin
.
controlModel
"
[(
value
)]="
penLin
.
controlModel
"
(
ionChange
)="
workModeEvent
(
penLin
)"
>
<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=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
</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>
</ion-item-divider>
<ion-item-sliding
*
ngFor=
"let cfg of penLin.controlConfig"
>
<div
*
ngIf=
"isOpenShower"
>
<ion-item-sliding
*
ngFor=
"let cfg of shower.controlConfig"
>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-input
[(
ngModel
)]="
cfg
.
name
"
(
ionFocus
)="
tempHaveTouch
()"
style=
"width:80px;"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
[(
ngModel
)]="
cfg
.
name
"
style=
"width:80px;
"
></ion-input>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
间隔时间
</ion-label>
<ion-label
style=
"width:80px"
>
间隔时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
intverval
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
intverval
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -103,29 +112,29 @@
...
@@ -103,29 +112,29 @@
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
设置温度
</ion-label>
<ion-label
style=
"width:80px"
>
设置温度
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
T
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
(
)"
></ion-input>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
T
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input>
<ion-label>
℃
</ion-label>
<ion-label>
℃
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<!-- <ion-col size="auto" style="font-size: 13px;">-->
<!-- <ion-col size="auto" style="font-size: 13px;">-->
<!-- <ion-item class="fanItem" lines="none">-->
<!-- <ion-item class="fanItem" lines="none">-->
<!-- <ion-label style="width:80px">偏差温度</ion-label>-->
<!-- <ion-label style="width:80px">偏差温度</ion-label>-->
<!-- <ion-input [(ngModel)]="penLinCfg.A" (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!-- <ion-input [(ngModel)]="penLinCfg.A" (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!-- </ion-item>-->
<!-- </ion-item>-->
<!-- </ion-col>-->
<!-- </ion-col>-->
</ion-row>
</ion-row>
<ion-row
style=
"width: 100%"
>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
A区喷水时间
</ion-label>
<ion-label
style=
"width:80px"
>
A区喷水时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
A
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
A
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
B区喷水时间
</ion-label>
<ion-label
style=
"width:80px"
>
B区喷水时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
B
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
B
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -136,27 +145,31 @@
...
@@ -136,27 +145,31 @@
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-options>
</ion-item-sliding>
</ion-item-sliding>
<ion-item
width=
"100%"
lines=
"none"
>
</div>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenShower"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
addModel
()"
>
添加模式
</ion-button>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
addModel
()"
>
添加模式
</ion-button>
</ion-item>
</ion-item>
</div>
</div>
<div
*
ngIf=
"zhaoMing
"
>
<div
*
ngIf=
"light
"
>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
>
照明配置
</ion-label>
<ion-label
style=
"width: 40%"
>
照明配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
zhaoMing
.
controlModel
"
[(
value
)]="
zhaoMing
.
controlModel
"
(
ionChange
)="
workModeEvent
(
zhaoMing
)"
>
<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=
"0"
>
手控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
<ion-select-option
value=
"1"
>
自控模式
</ion-select-option>
</ion-select>
</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>
</ion-item-divider>
<ion-item-sliding
*
ngFor=
"let cfg of zhaoMing.controlConfig"
>
<div
*
ngIf=
"isOpenLight"
>
<ion-item-sliding
*
ngFor=
"let cfg of light.controlConfig"
>
<ion-item
style=
"--padding-start: 0px"
>
<ion-item
style=
"--padding-start: 0px"
>
<ion-grid>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-row
style=
"width: 100%"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-label
style=
"width:80px"
>
模式名
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
name
"
(
ionFocus
)="
tempHaveTouch
()"
(
ionBlur
)="
updateCowshed
()
"
></ion-input>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
name
"
></ion-input>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -165,14 +178,14 @@
...
@@ -165,14 +178,14 @@
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!--<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-datetime
required
[(
ngModel
)]="
cfg
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker
"
></ion-datetime>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!--<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-datetime
required
[(
ngModel
)]="
cfg
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker
"
></ion-datetime>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -180,13 +193,15 @@
...
@@ -180,13 +193,15 @@
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
开灯时间
</ion-label>
<ion-label
style=
"width:80px"
>
开灯时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
on
"
(
ionFocus
)="
tempHaveTouch
()"
(
onBlur
)="
updateCowshed
()"
></ion-input>
<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-item>
</ion-col>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-item
style=
"font-size: 13px;--padding-start: 0px"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
关灯时间
</ion-label>
<ion-label
style=
"width:80px"
>
关灯时间
</ion-label>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
off
"
(
ionFocus
)="
tempHaveTouch
()"
(
onBlur
)="
updateCowshed
()"
></ion-input>
<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-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -196,16 +211,19 @@
...
@@ -196,16 +211,19 @@
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
<ion-button
color=
'danger'
expand=
"full"
style=
"width:15%;height:90%"
>
删除
</ion-button>
</ion-item-options>
</ion-item-options>
</ion-item-sliding>
</ion-item-sliding>
<ion-item
width=
"100%"
lines=
"none"
>
</div>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenLight"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
changeModel
()"
>
替换模式
</ion-button>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
changeModel
()"
>
替换模式
</ion-button>
</ion-item>
</ion-item>
</div>
</div>
<div
*
ngIf=
"shuiCao
"
>
<div
*
ngIf=
"waterChannel
"
>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
水槽预警时间段配置
</ion-label>
<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-divider>
<ion-item-sliding
>
<ion-item-sliding
*
ngIf=
"isOpenWaterChannel"
>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-grid>
<ion-row
style=
"width: 100%"
>
<ion-row
style=
"width: 100%"
>
...
@@ -213,14 +231,14 @@
...
@@ -213,14 +231,14 @@
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!--<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-datetime
required
[(
ngModel
)]="
waterChannel
.
controlConfig
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker
"
></ion-datetime>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!--<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-datetime
required
[(
ngModel
)]="
waterChannel
.
controlConfig
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker
"
></ion-datetime>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -235,10 +253,12 @@
...
@@ -235,10 +253,12 @@
</ion-item-sliding>
</ion-item-sliding>
</div>
</div>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
牛群在/离舍配置
</ion-label>
<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-divider>
<ion-item
class=
"fanItem
"
>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenInHouse
"
>
<ion-grid>
<ion-grid>
<!--<ion-row>-->
<!--<ion-row>-->
<!--<ion-col>牛群回舍时需恢复上述的设备</ion-col>-->
<!--<ion-col>牛群回舍时需恢复上述的设备</ion-col>-->
...
@@ -247,7 +267,7 @@
...
@@ -247,7 +267,7 @@
<!--<ion-col *ngFor="let device of curCowshed.leave">-->
<!--<ion-col *ngFor="let device of curCowshed.leave">-->
<!--<ion-item lines="none" class="cow">-->
<!--<ion-item lines="none" class="cow">-->
<!--<ion-label>{{device}}</ion-label>-->
<!--<ion-label>{{device}}</ion-label>-->
<!--<!– <ion-checkbox color="primary" class="cowCheckBox" slot="start" [(ngModel)]="curCowshed.propertyConfig.toft"></ion-checkbox>–>-->
<!--<!– <ion-checkbox color="primary" class="cowCheckBox" slot="start" [(ngModel)]="curCowshed.propertyConfig.toft"></ion-checkbox>–>-->
<!--</ion-item>-->
<!--</ion-item>-->
<!--</ion-col>-->
<!--</ion-col>-->
<!--</ion-row>-->
<!--</ion-row>-->
...
@@ -268,17 +288,17 @@
...
@@ -268,17 +288,17 @@
<ion-row>
<ion-row>
<ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -288,48 +308,78 @@
...
@@ -288,48 +308,78 @@
<ion-row>
<ion-row>
<ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
风机
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
喷淋
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
<ion-col>
<ion-col>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-item
lines=
"none"
class=
"cow"
><ion-label>
照明
</ion-label>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start"
(
click
)="
updateCowshed
()
"
></ion-checkbox>
<ion-checkbox
color=
"primary"
class=
"cowCheckBox"
slot=
"start
"
></ion-checkbox>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
环境参数预警配置
</ion-label>
<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-divider>
<ion-item
class=
"fanItem
"
>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenEnvironment
"
>
<ion-grid>
<ion-grid>
<div>
<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 class='material' [rows]="environmentConfig" [columnMode]="'force'" style="white-space: nowrap; text-align: center">-->
<ngx-datatable-column
name=
""
prop=
"tittle"
width=
"50px;"
>
<!--<ngx-datatable-column name="" prop="tittle" width="50px;">-->
</ngx-datatable-column>
<!--</ngx-datatable-column>-->
<ngx-datatable-column
name=
"上限"
prop=
"top"
width=
"20px;"
>
<!--<ngx-datatable-column name="上限" prop="top" width="20px;" >-->
</ngx-datatable-column>
<!--</ngx-datatable-column>-->
<ngx-datatable-column
name=
"下限"
prop=
"lower"
width=
"20px;"
>
<!--<ngx-datatable-column name="下限" prop="lower" width="20px;">-->
</ngx-datatable-column>
<!--</ngx-datatable-column>-->
<ngx-datatable-column
name=
""
prop=
"symbol"
width=
"5px;"
style=
"margin-left: 0px"
>
<!--<ngx-datatable-column name="" prop="symbol" width="5px;" style="margin-left: 0px">-->
</ngx-datatable-column>
<!--</ngx-datatable-column>-->
</ngx-datatable>
<!--</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>
</table>
</div>
</div>
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<ion-item-divider
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label>
环境参数配置
</ion-label>
<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-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenHeatStress"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
<ion-grid>
<ion-row>
<ion-row>
<ion-item
lines=
"none"
class=
"thiItem"
>
热应激配置
</ion-item>
<ion-item
lines=
"none"
class=
"thiItem"
>
热应激配置
</ion-item>
...
@@ -359,5 +409,8 @@
...
@@ -359,5 +409,8 @@
</ion-row>
</ion-row>
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<ion-item
width=
"100%"
lines=
"none"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
updateCowshed
()"
>
保存配置
</ion-button>
</ion-item>
</div>
</div>
</ion-content>
</ion-content>
src/app/envCtrl/env-cfg/env-cfg.page.scss
View file @
afd6fef7
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
.fanItem
{
.fanItem
{
font-size
:
13px
;
font-size
:
13px
;
--padding-start
:
0px
--padding-start
:
5px
;
}
}
.cow
{
.cow
{
...
@@ -45,3 +45,27 @@
...
@@ -45,3 +45,27 @@
.addBtn
{
.addBtn
{
width
:
100%
;
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';
...
@@ -2,7 +2,6 @@ import {Component, OnInit} from '@angular/core';
import
{
PickerController
,
AlertController
}
from
'@ionic/angular'
;
import
{
PickerController
,
AlertController
}
from
'@ionic/angular'
;
import
{
Api
}
from
'../../service/api'
;
import
{
Api
}
from
'../../service/api'
;
import
{
Load
}
from
'../../service/load'
;
import
{
Load
}
from
'../../service/load'
;
import
{
NgxDatatableModule
}
from
'@swimlane/ngx-datatable'
;
@
Component
({
@
Component
({
selector
:
'v-env-cfg'
,
selector
:
'v-env-cfg'
,
...
@@ -17,9 +16,9 @@ export class EnvCfgPage implements OnInit {
...
@@ -17,9 +16,9 @@ export class EnvCfgPage implements OnInit {
'selecting'
:
false
,
'selecting'
:
false
,
};
};
light
=
{
//
light = {
'selecting'
:
false
,
//
'selecting': false,
};
//
};
constructor
(
public
alerCtrl
:
AlertController
,
private
pickerController
:
PickerController
,
private
api
:
Api
,
private
load
:
Load
)
{
constructor
(
public
alerCtrl
:
AlertController
,
private
pickerController
:
PickerController
,
private
api
:
Api
,
private
load
:
Load
)
{
}
}
...
@@ -40,16 +39,29 @@ export class EnvCfgPage implements OnInit {
...
@@ -40,16 +39,29 @@ export class EnvCfgPage implements OnInit {
back
:
[],
back
:
[],
environmentConfigJson
:
{
TU
:
0
,
TL
:
0
,
HU
:
0
,
HL
:
0
},
environmentConfigJson
:
{
TU
:
0
,
TL
:
0
,
HU
:
0
,
HL
:
0
},
heatStressList
:
[]
};
heatStressList
:
[]
};
// 各设备配置信息
// 各设备配置信息
fengJi
:
any
=
{};
fan
:
any
=
{};
penLin
:
any
=
{};
shower
:
any
=
{};
zhaoMing
:
any
=
{};
light
:
any
=
{};
shuiCao
:
any
=
{};
waterChannel
:
any
=
{};
// 环境参数预警配置
// 环境参数预警配置
environmentConfig
=
[];
environmentConfig
=
[];
// 设置菜单折叠/打开
isOpenProperty
=
false
;
isOpenFan
=
false
;
isOpenShower
=
false
;
isOpenLight
=
false
;
isOpenWaterChannel
=
false
;
isOpenInHouse
=
false
;
isOpenEnvironment
=
false
;
isOpenHeatStress
=
false
;
private
$ionicPopup
:
any
;
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
({
const
picker
=
await
this
.
pickerController
.
create
({
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
buttons
:
[
buttons
:
[
...
@@ -63,7 +75,8 @@ export class EnvCfgPage implements OnInit {
...
@@ -63,7 +75,8 @@ export class EnvCfgPage implements OnInit {
{
{
text
:
'确认'
,
text
:
'确认'
,
handler
:
(
value
)
=>
{
handler
:
(
value
)
=>
{
// console.log(`Got Value ${value}`);
event
.
target
.
value
=
value
.
col0
.
text
;
console
.
log
(
value
.
value
);
this
.
fanMode
.
selecting
=
false
;
this
.
fanMode
.
selecting
=
false
;
}
}
}
}
...
@@ -76,7 +89,7 @@ export class EnvCfgPage implements OnInit {
...
@@ -76,7 +89,7 @@ export class EnvCfgPage implements OnInit {
const
columns
=
[];
const
columns
=
[];
for
(
let
i
=
0
;
i
<
numColumns
;
i
++
)
{
for
(
let
i
=
0
;
i
<
numColumns
;
i
++
)
{
columns
.
push
({
columns
.
push
({
name
:
`col
-
${
i
}
`
,
name
:
`col
${
i
}
`
,
options
:
this
.
getColumnOptions
(
i
,
numOptions
,
columnOptions
)
options
:
this
.
getColumnOptions
(
i
,
numOptions
,
columnOptions
)
});
});
}
}
...
@@ -96,16 +109,6 @@ export class EnvCfgPage implements OnInit {
...
@@ -96,16 +109,6 @@ export class EnvCfgPage implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
// this.pickerController = document.querySelector('ion-picker-controller');
// this.pickerController = document.querySelector('ion-picker-controller');
this
.
defaultColumnOptions
=
[
[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
]
];
this
.
init
();
this
.
init
();
}
}
...
@@ -201,52 +204,59 @@ export class EnvCfgPage implements OnInit {
...
@@ -201,52 +204,59 @@ export class EnvCfgPage implements OnInit {
}
}
workModeEvent
(
item
)
{
workModeEvent
(
item
)
{
this
.
updateCowshed
();
//
this.updateCowshed();
}
}
async
openCalendarPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
)
{
//
async openCalendarPicker(numColumns = 1, numOptions = 5, columnOptions = this.defaultColumnOptions) {
const
picker
=
await
this
.
pickerController
.
create
({
//
const picker = await this.pickerController.create({
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
//
columns: this.getColumns(numColumns, numOptions, columnOptions),
buttons
:
[
//
buttons: [
{
//
{
text
:
'Cancel'
,
//
text: 'Cancel',
role
:
'cancel'
,
//
role: 'cancel',
handler
:
()
=>
{
//
handler: () => {
this
.
fanMode
.
selecting
=
false
;
//
this.fanMode.selecting = false;
}
//
}
},
//
},
{
//
{
text
:
'Confirm'
,
//
text: 'Confirm',
handler
:
(
value
)
=>
{
//
handler: (value) => {
console
.
log
(
`Got Value
${
value
}
`
);
//
console.log(`Got Value ${value}`);
this
.
fanMode
.
selecting
=
false
;
//
this.fanMode.selecting = false;
}
//
}
}
//
}
]
//
]
});
//
});
await
picker
.
present
();
//
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
)
{
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
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
)
{
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
this
.
fanMode
.
selecting
=
true
;
this
.
openPicker
(
0
,
100
);
this
.
openPicker
(
1
,
101
,
this
.
defaultColumnOptions
,
event
);
}
}
}
}
lightTimeHaveFouch
()
{
lightTimeHaveFouch
()
{
console
.
log
(
'lightTimeHaveFouch'
);
//
console.log('lightTimeHaveFouch');
if
(
this
.
light
.
selecting
===
false
)
{
//
if (this.light.selecting === false) {
this
.
light
.
selecting
=
true
;
//
this.light.selecting = true;
this
.
openPicker
();
//
this.openPicker();
}
//
}
}
}
// 获取当前牛舍配置信息
// 获取当前牛舍配置信息
...
@@ -334,16 +344,16 @@ export class EnvCfgPage implements OnInit {
...
@@ -334,16 +344,16 @@ export class EnvCfgPage implements OnInit {
configInfo
.
map
((
value
,
index
)
=>
{
configInfo
.
map
((
value
,
index
)
=>
{
switch
(
value
.
fieldDeviceType
)
{
switch
(
value
.
fieldDeviceType
)
{
case
'风机'
:
case
'风机'
:
this
.
f
engJi
=
value
;
this
.
f
an
=
value
;
break
;
break
;
case
'喷淋'
:
case
'喷淋'
:
this
.
penLin
=
value
;
this
.
shower
=
value
;
break
;
break
;
case
'照明'
:
case
'照明'
:
this
.
zhaoMing
=
value
;
this
.
light
=
value
;
break
;
break
;
case
'水槽'
:
case
'水槽'
:
this
.
shuiCao
=
value
;
this
.
waterChannel
=
value
;
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -351,19 +361,18 @@ export class EnvCfgPage implements OnInit {
...
@@ -351,19 +361,18 @@ export class EnvCfgPage implements OnInit {
});
});
}
}
// 环境预警参数
// 环境预警参数
if
(
this
.
curCowshed
.
environmentConfigJson
)
{
//
if (this.curCowshed.environmentConfigJson) {
const
temperatureCfg
=
{
tittle
:
'温度'
,
top
:
this
.
curCowshed
.
environmentConfigJson
.
TU
,
//
const temperatureCfg = {tittle: '温度', top: this.curCowshed.environmentConfigJson.TU,
lower
:
this
.
curCowshed
.
environmentConfigJson
.
TL
,
symbol
:
'℃'
};
//
lower : this.curCowshed.environmentConfigJson.TL, symbol: '℃'};
const
humidityCfg
=
{
tittle
:
'湿度'
,
top
:
this
.
curCowshed
.
environmentConfigJson
.
HU
,
//
const humidityCfg = {tittle: '湿度', top: this.curCowshed.environmentConfigJson.HU,
lower
:
this
.
curCowshed
.
environmentConfigJson
.
HL
,
symbol
:
'%'
};
//
lower : this.curCowshed.environmentConfigJson.HL, symbol: '%'};
this
.
environmentConfig
.
push
(
temperatureCfg
,
humidityCfg
);
//
this.environmentConfig.push(temperatureCfg, humidityCfg);
}
//
}
}
}
// 修改牛舍配置
// 修改牛舍配置
updateCowshed
()
{
updateCowshed
()
{
this
.
api
.
config
.
updateCowshedConfig
([
this
.
curCowshed
,
(
data
)
=>
{
this
.
api
.
config
.
updateCowshedConfig
([
this
.
curCowshed
,
(
data
)
=>
{
if
(
data
)
{
if
(
data
)
{
console
.
log
(
'更新成功'
);
console
.
log
(
'更新成功'
);
}
else
{
}
else
{
...
@@ -375,19 +384,45 @@ export class EnvCfgPage implements OnInit {
...
@@ -375,19 +384,45 @@ export class EnvCfgPage implements OnInit {
}
}
referenceModel
()
{
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
()
{
addModel
()
{
this
.
selectModel
(
'照明'
,
1
);
const
lightModels
=
{};
this
.
selectModel
(
'照明'
,
1
,
lightModels
);
}
}
changeModel
()
{
changeModel
()
{
this
.
selectModel
(
'喷淋'
,
1
);
const
showerModels
=
{};
this
.
selectModel
(
'喷淋'
,
1
,
showerModels
);
}
}
// 参考:0 添加/替换:1
// 参考:0 添加/替换:1
async
selectModel
(
deviceName
,
ref
)
{
async
selectModel
(
deviceName
,
ref
,
models
)
{
const
alert
=
await
this
.
alerCtrl
.
create
({
const
alert
=
await
this
.
alerCtrl
.
create
({
header
:
deviceName
+
'常用模式选择'
,
header
:
deviceName
+
'常用模式选择'
,
inputs
:
[
inputs
:
[
...
@@ -395,7 +430,8 @@ export class EnvCfgPage implements OnInit {
...
@@ -395,7 +430,8 @@ export class EnvCfgPage implements OnInit {
type
:
'radio'
,
type
:
'radio'
,
label
:
'春季'
,
label
:
'春季'
,
value
:
'Spring'
,
value
:
'Spring'
,
checked
:
false
},
checked
:
false
},
{
{
type
:
'radio'
,
type
:
'radio'
,
label
:
'夏季'
,
label
:
'夏季'
,
...
@@ -411,8 +447,16 @@ export class EnvCfgPage implements OnInit {
...
@@ -411,8 +447,16 @@ export class EnvCfgPage implements OnInit {
label
:
'冬季'
,
label
:
'冬季'
,
value
:
'Winter'
,
value
:
'Winter'
,
checked
:
false
}],
checked
:
false
}],
buttons
:
[{
text
:
'取消'
,
cssClass
:
'width: 40%'
},
buttons
:
[
{
text
:
'确定'
,
cssClass
:
'width: 40%'
}]
{
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
)
{
if
(
1
===
ref
)
{
alert
.
inputs
.
push
({
alert
.
inputs
.
push
({
...
@@ -424,4 +468,29 @@ export class EnvCfgPage implements OnInit {
...
@@ -424,4 +468,29 @@ export class EnvCfgPage implements OnInit {
await
alert
.
present
();
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 {
...
@@ -95,6 +95,13 @@ export class Api {
updateCowshedConfig
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedConfig/updateCowshedConfig'
,
data
),
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
)
{
private
trans
(
type
,
addr
,
data
)
{
this
.
sendHttpReq
(
type
,
addr
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
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