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
f683a72f
Commit
f683a72f
authored
Nov 05, 2019
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改牛舍配置页: 风机,水槽,照明模式添加或替换
parent
afd6fef7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
342 additions
and
117 deletions
+342
-117
animations.ts
src/app/animations/animations.ts
+90
-0
env-cfg.page.html
src/app/envCtrl/env-cfg/env-cfg.page.html
+43
-42
env-cfg.page.ts
src/app/envCtrl/env-cfg/env-cfg.page.ts
+209
-75
No files found.
src/app/animations/animations.ts
0 → 100644
View file @
f683a72f
import
{
BrowserAnimationsModule
}
from
'@angular/platform-browser/animations'
;
import
{
trigger
,
state
,
style
,
transition
,
animate
,
keyframes
}
from
'@angular/animations'
;
// 动画时间线
const
time
=
'300ms'
;
const
styles
=
{
ease
:
time
+
' ease '
,
linear
:
time
+
' linear '
,
easeIn
:
time
+
' ease-in'
,
easeOut
:
time
+
' ease-out'
,
stepStart
:
time
+
' step-start'
,
stepEnd
:
time
+
' step-end'
,
easeInOut
:
time
+
' ease-in-out'
,
faseOutSlowIn
:
time
+
' cubic-bezier(0.4, 0, 0.2, 1)'
,
inOutBack
:
time
+
' cubic-bezier(0.68, -0.55, 0.27, 1.55)'
,
inOutCubic
:
time
+
' cubic-bezier(0.65, 0.05, 0.36, 1)'
,
inOutQuadratic
:
time
+
' cubic-bezier(0.46, 0.03, 0.52, 0.96)'
,
inOutSine
:
time
+
' cubic-bezier(0.45, 0.05, 0.55, 0.95)'
}
// 动画配置
const
opts
=
{
fadeIn
:
[
style
({
opacity
:
0
}),
animate
(
styles
.
inOutBack
,
style
({
opacity
:
1
})),
],
fadeOut
:
[
style
({
opacity
:
1
}),
animate
(
styles
.
inOutBack
,
style
({
opacity
:
0
}))
],
shrink
:
[
style
({
height
:
'*'
}),
animate
(
styles
.
easeOut
,
style
({
height
:
0
}))
],
stretch
:
[
style
({
height
:
'0'
}),
animate
(
styles
.
easeIn
,
style
({
height
:
'*'
}))
],
flyIn
:
[
style
({
transform
:
'translateY(-50%)'
,
zIndex
:
'-5'
}),
// translateX(-100%)
animate
(
styles
.
easeIn
,
style
({
transform
:
'translateY(0)'
}))
],
flyOut
:
[
style
({
zIndex
:
'-5'
}),
animate
(
styles
.
easeIn
,
style
({
transform
:
'translateY(-50%)'
}))
],
// flyIn: [
// style({ transform: 'translateX(-100%)' }), // translateX(-100%)
// animate(styles.inOutBack, style({ transform: '*' }))
// ],
// flyOut: [
// style({ transform: '*' }),
// animate(styles.inOutBack, style({ transform: 'translateX(-100%)' }))
// ],
zoomIn
:
[
style
({
transform
:
'scale(.5)'
}),
animate
(
styles
.
inOutBack
,
style
({
transform
:
'*'
}))
],
zoomOut
:
[
style
({
transform
:
'*'
}),
animate
(
styles
.
inOutBack
,
style
({
transform
:
'scale(.5)'
}))
]
}
// 导出动画时间线定义,供自定义动画的时候使用
export
const
animStyle
=
styles
// 导出动画
export
const
fadeIn
=
[
trigger
(
'fadeIn'
,
[
transition
(
'void => *'
,
opts
.
fadeIn
)])]
export
const
fadeOut
=
[
trigger
(
'fadeOut'
,
[
transition
(
'* => void'
,
opts
.
fadeOut
)])]
export
const
stretch
=
[
trigger
(
'stretch'
,
[
transition
(
'void => *'
,
opts
.
stretch
)])]
export
const
shrink
=
[
trigger
(
'shrink'
,
[
transition
(
'* => void'
,
opts
.
shrink
)])]
export
const
flyIn
=
[
trigger
(
'flyIn'
,
[
transition
(
'void => *'
,
opts
.
flyIn
)])]
export
const
flyOut
=
[
trigger
(
'flyOut'
,
[
transition
(
'* => void'
,
opts
.
flyOut
)])]
export
const
zoomIn
=
[
trigger
(
'zoomIn'
,
[
transition
(
'void => *'
,
opts
.
zoomIn
)])]
export
const
zoomOut
=
[
trigger
(
'zoomOut'
,
[
transition
(
'* => void'
,
opts
.
zoomOut
)])]
export
const
animations
=
[
trigger
(
'animations'
,
[
transition
(
'* => fadeIn'
,
opts
.
fadeIn
),
transition
(
'* => fadeIn'
,
opts
.
fadeOut
),
transition
(
'* => shrink'
,
opts
.
shrink
),
transition
(
'* => stretch'
,
opts
.
stretch
),
transition
(
'* => flyIn'
,
opts
.
flyIn
),
transition
(
'* => flyOut'
,
opts
.
flyOut
),
transition
(
'* => zoomIn'
,
opts
.
zoomIn
),
transition
(
'* => zoomOut'
,
opts
.
zoomOut
)
])
]
src/app/envCtrl/env-cfg/env-cfg.page.html
View file @
f683a72f
...
@@ -20,11 +20,12 @@
...
@@ -20,11 +20,12 @@
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
</div>
</div>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
(
click
)="
openProperty
()"
>
偏差值配置
</ion-label>
<ion-label>
偏差值配置
</ion-label>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenProperty"
(
click
)="
open
Property
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenProperty"
(
click
)="
open
Item
('
propertyCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenProperty"
(
click
)="
open
Property
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenProperty"
(
click
)="
open
Item
('
propertyCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenProperty"
>
<!--<ion-item class="fanItem" lines="none" *ngIf="isOpenProperty" @flyIn @flyOut >-->
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenProperty"
@
flyIn
@
flyOut
>
<ion-grid>
<ion-grid>
<ion-row>
<ion-row>
<ion-col>
<ion-col>
...
@@ -51,8 +52,8 @@
...
@@ -51,8 +52,8 @@
<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
)="
open
Fan
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenFan"
(
click
)="
open
Item
('
fanCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenFan"
(
click
)="
open
Fan
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenFan"
(
click
)="
open
Item
('
fanCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenFan"
>
<ion-item
class=
"fanItem"
lines=
"none"
*
ngIf=
"isOpenFan"
>
<ion-grid>
<ion-grid>
...
@@ -60,14 +61,14 @@
...
@@ -60,14 +61,14 @@
<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
required
(
ionFocus
)="
tempHaveTouch
($
event
)"
[(
ngModel
)]="
fan
.
controlConfig
.
TU
"
></ion-input>
<ion-input
(
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
required
(
ionFocus
)="
tempHaveTouch
($
event
)"
[(
ngModel
)]="
fan
.
controlConfig
.
TL
"
></ion-input>
<ion-input
(
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>
...
@@ -75,7 +76,7 @@
...
@@ -75,7 +76,7 @@
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<ion-item
class=
"fanItem"
lines=
"none"
style=
"padding-left: 10px"
*
ngIf=
"isOpenFan"
>
<ion-item
class=
"fanItem"
lines=
"none"
style=
"padding-left: 10px"
*
ngIf=
"isOpenFan"
>
<a
(
click
)="
r
eferenceModel
()"
>
参考常用模式
</a>
<a
(
click
)="
onR
eferenceModel
()"
>
参考常用模式
</a>
</ion-item>
</ion-item>
</div>
</div>
...
@@ -86,8 +87,8 @@
...
@@ -86,8 +87,8 @@
<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
)="
open
Shower
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenShower"
(
click
)="
open
Item
('
showerCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenShower"
(
click
)="
open
Shower
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenShower"
(
click
)="
open
Item
('
showerCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<div
*
ngIf=
"isOpenShower"
>
<div
*
ngIf=
"isOpenShower"
>
<ion-item-sliding
*
ngFor=
"let cfg of shower.controlConfig"
>
<ion-item-sliding
*
ngFor=
"let cfg of shower.controlConfig"
>
...
@@ -97,13 +98,13 @@
...
@@ -97,13 +98,13 @@
<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
required
[(
ngModel
)]="
cfg
.
name
"
style=
"width:80px;"
></ion-input>
<ion-input
[(
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=
"
timepicker
Item"
lines=
"none"
>
<ion-item
class=
"
fan
Item"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
间隔时间
</ion-label>
<ion-label
style=
"width:80px"
>
间隔时间
</ion-label>
<ion-input
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
intv
erval
"
></ion-input>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
int
erval
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -112,7 +113,7 @@
...
@@ -112,7 +113,7 @@
<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
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
T
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input>
<ion-input
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>
...
@@ -127,14 +128,14 @@
...
@@ -127,14 +128,14 @@
<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
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
A
"
></ion-input>
<ion-input
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
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
B
"
></ion-input>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
B
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -147,7 +148,7 @@
...
@@ -147,7 +148,7 @@
</ion-item-sliding>
</ion-item-sliding>
</div>
</div>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenShower"
>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenShower"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
a
ddModel
()"
>
添加模式
</ion-button>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
onA
ddModel
()"
>
添加模式
</ion-button>
</ion-item>
</ion-item>
</div>
</div>
...
@@ -158,8 +159,8 @@
...
@@ -158,8 +159,8 @@
<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
)="
open
Light
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenLight"
(
click
)="
open
Item
('
lightCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenLight"
(
click
)="
open
Light
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenLight"
(
click
)="
open
Item
('
lightCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<div
*
ngIf=
"isOpenLight"
>
<div
*
ngIf=
"isOpenLight"
>
<ion-item-sliding
*
ngFor=
"let cfg of light.controlConfig"
>
<ion-item-sliding
*
ngFor=
"let cfg of light.controlConfig"
>
...
@@ -169,7 +170,7 @@
...
@@ -169,7 +170,7 @@
<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
required
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
name
"
></ion-input>
<ion-input
style=
"width:50px;"
[(
ngModel
)]="
cfg
.
name
"
></ion-input>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -178,14 +179,14 @@
...
@@ -178,14 +179,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
required
[(
ngModel
)]="
cfg
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<ion-datetime
[(
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
required
[(
ngModel
)]="
cfg
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<ion-datetime
[(
ngModel
)]="
cfg
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -193,14 +194,14 @@
...
@@ -193,14 +194,14 @@
<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-datetime
required
[(
ngModel
)]="
cfg
.
on
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<ion-datetime
[(
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-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-datetime
required
[(
ngModel
)]="
cfg
.
off
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<ion-datetime
[(
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-input style="width:50px;" [(ngModel)]="cfg.off" (ionFocus)="tempHaveTouch()"></ion-input>-->
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -213,15 +214,15 @@
...
@@ -213,15 +214,15 @@
</ion-item-sliding>
</ion-item-sliding>
</div>
</div>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenLight"
>
<ion-item
width=
"100%"
lines=
"none"
*
ngIf=
"isOpenLight"
>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
c
hangeModel
()"
>
替换模式
</ion-button>
<ion-button
color=
"secondary"
class=
"addBtn"
round
(
click
)="
onC
hangeModel
()"
>
替换模式
</ion-button>
</ion-item>
</ion-item>
</div>
</div>
<div
*
ngIf=
"waterChannel"
>
<div
*
ngIf=
"waterChannel"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<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
)="
open
WaterChannel
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenWaterChannel"
(
click
)="
open
Item
('
waterChannelCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenWaterChannel"
(
click
)="
open
WaterChannel
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenWaterChannel"
(
click
)="
open
Item
('
waterChannelCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<ion-item-sliding
*
ngIf=
"isOpenWaterChannel"
>
<ion-item-sliding
*
ngIf=
"isOpenWaterChannel"
>
<ion-item
class=
"fanItem"
>
<ion-item
class=
"fanItem"
>
...
@@ -231,14 +232,14 @@
...
@@ -231,14 +232,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
required
[(
ngModel
)]="
waterChannel
.
controlConfig
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<ion-datetime
[(
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
required
[(
ngModel
)]="
waterChannel
.
controlConfig
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
class=
"timepicker"
></ion-datetime>
<ion-datetime
[(
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>
...
@@ -255,8 +256,8 @@
...
@@ -255,8 +256,8 @@
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<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
)="
openI
nHouse
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenInHouse"
(
click
)="
openI
tem
('
inHouseCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenInHouse"
(
click
)="
openI
nHouse
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenInHouse"
(
click
)="
openI
tem
('
inHouseCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenInHouse"
>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenInHouse"
>
<ion-grid>
<ion-grid>
...
@@ -327,8 +328,8 @@
...
@@ -327,8 +328,8 @@
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<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
)="
open
Environment
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenEnvironment"
(
click
)="
open
Item
('
environmentCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenEnvironment"
(
click
)="
open
Environment
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenEnvironment"
(
click
)="
open
Item
('
environmentCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenEnvironment"
>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenEnvironment"
>
<ion-grid>
<ion-grid>
...
@@ -352,20 +353,20 @@
...
@@ -352,20 +353,20 @@
</tr>
</tr>
<tr>
<tr>
<th>
温度
</th>
<th>
温度
</th>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TU
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input></td>
<td><ion-input
[(
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><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TL
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input></td>
<td>
℃
</td>
<td>
℃
</td>
</tr>
</tr>
<tr>
<tr>
<th>
湿度
</th>
<th>
湿度
</th>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HU
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td><ion-input
[(
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><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HL
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td>
% rH
</td>
<td>
% rH
</td>
</tr>
</tr>
<tr>
<tr>
<th>
氨气
</th>
<th>
氨气
</th>
<td><ion-input
required
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HU
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td><ion-input
[(
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><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HL
"
(
ionFocus
)="
humHaveTouch
($
event
)"
></ion-input></td>
<td>
ppm
</td>
<td>
ppm
</td>
</tr>
</tr>
...
@@ -376,8 +377,8 @@
...
@@ -376,8 +377,8 @@
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<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
)="
open
HeatStress
(
)"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenHeatStress"
(
click
)="
open
Item
('
heatStressCfg
'
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenHeatStress"
(
click
)="
open
HeatStress
(
)"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenHeatStress"
(
click
)="
open
Item
('
heatStressCfg
'
)"
></ion-icon>
</ion-item-divider>
</ion-item-divider>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenHeatStress"
>
<ion-item
class=
"fanItem"
*
ngIf=
"isOpenHeatStress"
>
<ion-grid>
<ion-grid>
...
...
src/app/envCtrl/env-cfg/env-cfg.page.ts
View file @
f683a72f
...
@@ -2,11 +2,15 @@ import {Component, OnInit} from '@angular/core';
...
@@ -2,11 +2,15 @@ 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
{
shrink
,
stretch
,
zoomIn
,
zoomOut
,
fadeIn
,
fadeOut
,
flyIn
,
flyOut
}
from
'../../animations/animations'
;
@
Component
({
@
Component
({
selector
:
'v-env-cfg'
,
selector
:
'v-env-cfg'
,
templateUrl
:
'./env-cfg.page.html'
,
templateUrl
:
'./env-cfg.page.html'
,
styleUrls
:
[
'./env-cfg.page.scss'
],
styleUrls
:
[
'./env-cfg.page.scss'
],
animations
:
[
shrink
,
stretch
,
zoomIn
,
zoomOut
,
fadeIn
,
fadeOut
,
flyIn
,
flyOut
]
})
})
export
class
EnvCfgPage
implements
OnInit
{
export
class
EnvCfgPage
implements
OnInit
{
...
@@ -19,7 +23,6 @@ export class EnvCfgPage implements OnInit {
...
@@ -19,7 +23,6 @@ export class EnvCfgPage implements OnInit {
// 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
)
{
}
}
...
@@ -232,7 +235,7 @@ export class EnvCfgPage implements OnInit {
...
@@ -232,7 +235,7 @@ export class EnvCfgPage implements OnInit {
tempHaveTouch
(
event
)
{
tempHaveTouch
(
event
)
{
for
(
let
i
=
10
;
i
<=
50
;
i
++
)
{
for
(
let
i
=
10
;
i
<=
50
;
i
++
)
{
this
.
defaultColumnOptions
[
0
][
i
-
10
]
=
i
.
toString
();
this
.
defaultColumnOptions
[
0
][
i
-
9
]
=
i
.
toString
();
}
}
if
(
this
.
fanMode
.
selecting
===
false
)
{
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
this
.
fanMode
.
selecting
=
true
;
...
@@ -243,7 +246,7 @@ export class EnvCfgPage implements OnInit {
...
@@ -243,7 +246,7 @@ export class EnvCfgPage implements OnInit {
humHaveTouch
(
event
)
{
humHaveTouch
(
event
)
{
for
(
let
i
=
0
;
i
<=
100
;
i
++
)
{
for
(
let
i
=
0
;
i
<=
100
;
i
++
)
{
this
.
defaultColumnOptions
[
0
][
i
]
=
i
.
toString
();
this
.
defaultColumnOptions
[
0
][
i
+
1
]
=
i
.
toString
();
}
}
if
(
this
.
fanMode
.
selecting
===
false
)
{
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
this
.
fanMode
.
selecting
=
true
;
...
@@ -279,8 +282,8 @@ export class EnvCfgPage implements OnInit {
...
@@ -279,8 +282,8 @@ export class EnvCfgPage implements OnInit {
},
},
{
fieldDeviceType
:
'喷淋'
,
{
fieldDeviceType
:
'喷淋'
,
controlModel
:
'1'
,
controlModel
:
'1'
,
controlConfig
:
[{
id
:
'111'
,
name
:
'模式一'
,
T
:
21
,
A
:
35
,
B
:
45
,
int
v
erval
:
55
},
controlConfig
:
[{
id
:
'111'
,
name
:
'模式一'
,
T
:
21
,
A
:
35
,
B
:
45
,
interval
:
55
},
{
id
:
'222'
,
name
:
'模式二'
,
T
:
21
,
A
:
35
,
B
:
45
,
int
v
erval
:
55
}]
{
id
:
'222'
,
name
:
'模式二'
,
T
:
21
,
A
:
35
,
B
:
45
,
interval
:
55
}]
},
},
{
fieldDeviceType
:
'照明'
,
{
fieldDeviceType
:
'照明'
,
controlModel
:
'1'
,
controlModel
:
'1'
,
...
@@ -383,82 +386,219 @@ export class EnvCfgPage implements OnInit {
...
@@ -383,82 +386,219 @@ export class EnvCfgPage implements OnInit {
}]);
}]);
}
}
r
eferenceModel
()
{
onR
eferenceModel
()
{
let
f
anModels
=
{};
let
popF
anModels
=
{};
this
.
api
.
devicePatternModel
.
getByFactoryNoAndType
([{
factoryNo
:
this
.
curCowshed
.
factoryNo
,
fieldDeviceType
:
'风机'
},
(
data
)
=>
{
this
.
api
.
devicePatternModel
.
getByFactoryNoAndType
([{
factoryNo
:
this
.
curCowshed
.
factoryNo
,
fieldDeviceType
:
'风机'
},
(
data
)
=>
{
// ---------------------------------------------------------
// TODO 测试用数据
// TODO 测试用数据
data
=
{
data
=
[
{
patternModelNo
:
'1234681324789546'
,
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'
模式一
'
,
patternModelName
:
'
春季1
'
,
fieldDeviceType
:
'风机'
,
fieldDeviceType
:
'风机'
,
configJson
:
[{
name
:
'春季'
,
TU
:
20
,
TL
:
-
10
},
configJson
:
{
name
:
'模式名A'
,
TU
:
20
,
TL
:
-
10
},
{
name
:
'夏季'
,
TU
:
21
,
TL
:
-
11
},
{
name
:
'秋季'
,
TU
:
22
,
TL
:
-
12
},
{
name
:
'冬季'
,
TU
:
23
,
TL
:
-
13
},
],
factoryNo
:
'FN108050436279648256'
,
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
factoryName
:
'一厂'
,
remark
:
'测试'
remark
:
'测试'
}
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'夏季2'
,
fieldDeviceType
:
'风机'
,
configJson
:
{
name
:
'模式名A'
,
TU
:
20
,
TL
:
-
10
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'秋季3'
,
fieldDeviceType
:
'风机'
,
configJson
:
{
name
:
'模式名A'
,
TU
:
20
,
TL
:
-
10
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'冬季4'
,
fieldDeviceType
:
'风机'
,
configJson
:
{
name
:
'模式名'
,
TU
:
20
,
TL
:
-
10
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
}];
// ---------------------------------------------------------
if
(
data
)
{
if
(
data
)
{
f
anModels
=
data
;
popF
anModels
=
data
;
this
.
selectModel
(
'风机'
,
0
,
f
anModels
);
this
.
selectModel
(
'风机'
,
1
,
popF
anModels
);
}
}
this
.
load
.
offLoad
();
this
.
load
.
offLoad
();
}]);
}]);
}
}
addModel
()
{
onAddModel
()
{
const
lightModels
=
{};
let
popShowerModels
=
{};
this
.
selectModel
(
'照明'
,
1
,
lightModels
);
this
.
api
.
devicePatternModel
.
getByFactoryNoAndType
([{
factoryNo
:
this
.
curCowshed
.
factoryNo
,
fieldDeviceType
:
'喷淋'
},
(
data
)
=>
{
// ---------------------------------------------------------
// TODO 测试用数据
data
=
[{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'春季1'
,
fieldDeviceType
:
'喷淋'
,
configJson
:
{
name
:
'模式名A'
,
T
:
25
,
offset
:
3
,
A
:
25
,
B
:
25
,
interval
:
30
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'夏季2'
,
fieldDeviceType
:
'喷淋'
,
configJson
:
{
name
:
'模式名A'
,
T
:
25
,
offset
:
3
,
A
:
25
,
B
:
25
,
interval
:
30
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'秋季3'
,
fieldDeviceType
:
'风机'
,
configJson
:
{
name
:
'模式名A'
,
T
:
25
,
offset
:
3
,
A
:
25
,
B
:
25
,
interval
:
30
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'冬季4'
,
fieldDeviceType
:
'风机'
,
configJson
:
{
name
:
'模式名A'
,
T
:
25
,
offset
:
3
,
A
:
25
,
B
:
25
,
interval
:
30
},
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
}];
// ---------------------------------------------------------
if
(
data
)
{
popShowerModels
=
data
;
this
.
selectModel
(
'喷淋'
,
2
,
popShowerModels
);
}
this
.
load
.
offLoad
();
}]);
}
}
changeModel
()
{
onChangeModel
()
{
const
showerModels
=
{};
let
popLightModels
=
{};
this
.
selectModel
(
'喷淋'
,
1
,
showerModels
);
this
.
api
.
devicePatternModel
.
getByFactoryNoAndType
([{
factoryNo
:
this
.
curCowshed
.
factoryNo
,
fieldDeviceType
:
'照明'
},
(
data
)
=>
{
// ---------------------------------------------------------
// TODO 测试用数据
data
=
[{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'春季1'
,
fieldDeviceType
:
'照明'
,
configJson
:
[{
name
:
'模式名A'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
},
{
name
:
'模式名B'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
}],
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'夏季2'
,
fieldDeviceType
:
'风机'
,
configJson
:
[{
name
:
'模式名A'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
},
{
name
:
'模式名B'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
}],
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'秋季3'
,
fieldDeviceType
:
'风机'
,
configJson
:
[{
name
:
'模式名A'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
},
{
name
:
'模式名B'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
}],
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
},
{
patternModelNo
:
'1234681324789546'
,
patternModelName
:
'冬季4'
,
fieldDeviceType
:
'风机'
,
configJson
:
[{
name
:
'模式名A'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
},
{
name
:
'模式名B'
,
startDate
:
'03-01'
,
stopDate
:
'05-01'
,
on
:
'19:00'
,
off
:
'07:00'
}],
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
remark
:
'测试'
}];
// ---------------------------------------------------------
if
(
data
)
{
popLightModels
=
data
;
this
.
selectModel
(
'照明'
,
3
,
popLightModels
);
}
this
.
load
.
offLoad
();
}]);
}
}
// 参考:0 添加/替换:1
// 风机:替换模式
async
selectModel
(
deviceName
,
ref
,
models
)
{
referenceModel
(
models
,
selectedName
)
{
if
(
selectedName
)
{
const
selectedModel
=
models
.
filter
(
data
=>
data
.
patternModelName
===
selectedName
);
this
.
fan
.
controlConfig
.
TU
=
selectedModel
[
0
].
configJson
.
TU
;
this
.
fan
.
controlConfig
.
TL
=
selectedModel
[
0
].
configJson
.
TL
;
}
}
// 喷淋:替换模式
addModel
(
models
,
selectedName
)
{
if
(
selectedName
)
{
const
selectedModel
=
models
.
filter
(
data
=>
data
.
patternModelName
===
selectedName
);
this
.
shower
.
controlConfig
.
push
(
selectedModel
[
0
].
configJson
);
}
}
// 照明:添加模式
changeModel
(
models
,
selectedName
)
{
if
(
selectedName
)
{
const
selectedModel
=
models
.
filter
(
data
=>
data
.
patternModelName
===
selectedName
);
this
.
light
.
controlConfig
=
selectedModel
[
0
].
configJson
;
}
}
// 设备:风机1 喷淋2 照明3
async
selectModel
(
deviceName
,
device
,
models
)
{
const
list
=
[];
if
(
models
&&
models
.
constructor
===
Array
)
{
models
.
forEach
((
item
)
=>
{
list
.
push
({
type
:
'radio'
,
label
:
item
.
patternModelName
,
value
:
item
.
patternModelName
,
checked
:
false
});
});
}
const
alert
=
await
this
.
alerCtrl
.
create
({
const
alert
=
await
this
.
alerCtrl
.
create
({
header
:
deviceName
+
'常用模式选择'
,
header
:
deviceName
+
'常用模式选择'
,
inputs
:
[
inputs
:
list
,
{
type
:
'radio'
,
label
:
'春季'
,
value
:
'Spring'
,
checked
:
false
},
{
type
:
'radio'
,
label
:
'夏季'
,
value
:
'Summer'
,
checked
:
false
},
{
type
:
'radio'
,
label
:
'秋季'
,
value
:
'Autumn'
,
checked
:
false
},
{
type
:
'radio'
,
label
:
'冬季'
,
value
:
'Winter'
,
checked
:
false
}],
buttons
:
[
buttons
:
[
{
text
:
'取消'
,
cssClass
:
'width: 40%'
},
{
text
:
'取消'
,
cssClass
:
'width: 40%'
},
{
{
text
:
'确定'
,
text
:
'确定'
,
cssClass
:
'width: 40%'
,
cssClass
:
'width: 40%'
,
handler
:
(
value
)
=>
{
handler
:
(
value
)
=>
{
// event.target.value = value.col0.text;
// 自定义
// console.log(value.value);
if
(
value
===
'other'
)
{
// this.fanMode.selecting = false;
// TODO
}
else
{
if
(
1
===
device
)
{
this
.
referenceModel
(
models
,
value
);
}
else
if
(
2
===
device
)
{
this
.
addModel
(
models
,
value
);
}
else
{
this
.
changeModel
(
models
,
value
);
}
}
}}]
}}]
});
});
if
(
1
===
ref
)
{
if
(
2
===
device
||
3
===
device
)
{
alert
.
inputs
.
push
({
alert
.
inputs
.
push
({
type
:
'radio'
,
type
:
'radio'
,
label
:
'自定义'
,
label
:
'自定义'
,
...
@@ -468,29 +608,23 @@ export class EnvCfgPage implements OnInit {
...
@@ -468,29 +608,23 @@ export class EnvCfgPage implements OnInit {
await
alert
.
present
();
await
alert
.
present
();
}
}
openProperty
()
{
openItem
(
param
)
{
this
.
isOpenProperty
=
!
this
.
isOpenProperty
;
if
(
param
===
'propertyCfg'
)
{
}
this
.
isOpenProperty
=
!
this
.
isOpenProperty
;
openFan
()
{
}
else
if
(
param
===
'fanCfg'
)
{
this
.
isOpenFan
=
!
this
.
isOpenFan
;
this
.
isOpenFan
=
!
this
.
isOpenFan
;
}
}
else
if
(
param
===
'showerCfg'
)
{
openShower
()
{
this
.
isOpenShower
=
!
this
.
isOpenShower
;
this
.
isOpenShower
=
!
this
.
isOpenShower
;
}
else
if
(
param
===
'lightCfg'
)
{
}
this
.
isOpenLight
=
!
this
.
isOpenLight
;
openLight
()
{
}
else
if
(
param
===
'waterChannelCfg'
)
{
this
.
isOpenLight
=
!
this
.
isOpenLight
;
this
.
isOpenWaterChannel
=
!
this
.
isOpenWaterChannel
;
}
}
else
if
(
param
===
'inHouseCfg'
)
{
openWaterChannel
()
{
this
.
isOpenInHouse
=
!
this
.
isOpenInHouse
;
this
.
isOpenWaterChannel
=
!
this
.
isOpenWaterChannel
;
}
else
if
(
param
===
'environmentCfg'
)
{
}
this
.
isOpenEnvironment
=
!
this
.
isOpenEnvironment
;
openInHouse
()
{
}
else
if
(
param
===
'heatStressCfg'
)
{
this
.
isOpenInHouse
=
!
this
.
isOpenInHouse
;
this
.
isOpenHeatStress
=
!
this
.
isOpenHeatStress
;
}
}
openEnvironment
()
{
this
.
isOpenEnvironment
=
!
this
.
isOpenEnvironment
;
}
openHeatStress
()
{
this
.
isOpenHeatStress
=
!
this
.
isOpenHeatStress
;
}
}
}
}
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