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
de1e2867
Commit
de1e2867
authored
Nov 13, 2019
by
yating.lin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调试
parent
eba7dfa5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
941 additions
and
728 deletions
+941
-728
env-add-model.page.html
src/app/envCtrl/env-add-model/env-add-model.page.html
+7
-7
env-add-model.page.ts
src/app/envCtrl/env-add-model/env-add-model.page.ts
+6
-7
env-alarm-detail.page.scss
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.scss
+2
-2
env-alarm.page.scss
src/app/envCtrl/env-alarm/env-alarm.page.scss
+1
-1
env-alarm.page.ts
src/app/envCtrl/env-alarm/env-alarm.page.ts
+5
-5
env-cfg.page.html
src/app/envCtrl/env-cfg/env-cfg.page.html
+34
-97
env-cfg.page.scss
src/app/envCtrl/env-cfg/env-cfg.page.scss
+8
-0
env-cfg.page.ts
src/app/envCtrl/env-cfg/env-cfg.page.ts
+336
-304
env-change-model.page.html
src/app/envCtrl/env-change-model/env-change-model.page.html
+8
-8
env-change-model.page.ts
src/app/envCtrl/env-change-model/env-change-model.page.ts
+15
-8
env-detail.page.html
src/app/envCtrl/env-detail/env-detail.page.html
+1
-1
env-detail.page.ts
src/app/envCtrl/env-detail/env-detail.page.ts
+27
-18
env-fan.page.html
src/app/envCtrl/env-fan/env-fan.page.html
+6
-6
env-fan.page.ts
src/app/envCtrl/env-fan/env-fan.page.ts
+49
-31
env-history.page.ts
src/app/envCtrl/env-history/env-history.page.ts
+32
-31
env-home.page.html
src/app/envCtrl/env-home/env-home.page.html
+6
-6
env-home.page.ts
src/app/envCtrl/env-home/env-home.page.ts
+94
-90
env-light.page.html
src/app/envCtrl/env-light/env-light.page.html
+10
-6
env-light.page.scss
src/app/envCtrl/env-light/env-light.page.scss
+12
-2
env-light.page.ts
src/app/envCtrl/env-light/env-light.page.ts
+123
-50
env-shower.page.html
src/app/envCtrl/env-shower/env-shower.page.html
+24
-13
env-shower.page.scss
src/app/envCtrl/env-shower/env-shower.page.scss
+33
-3
env-shower.page.ts
src/app/envCtrl/env-shower/env-shower.page.ts
+39
-19
env-waterchannel.page.html
src/app/envCtrl/env-waterchannel/env-waterchannel.page.html
+5
-5
env-waterchannel.page.scss
src/app/envCtrl/env-waterchannel/env-waterchannel.page.scss
+42
-0
env-waterchannel.page.ts
src/app/envCtrl/env-waterchannel/env-waterchannel.page.ts
+9
-3
api.ts
src/app/service/api.ts
+3
-3
shower-0.png
src/assets/img/shower-0.png
+0
-0
shower-1.png
src/assets/img/shower-1.png
+0
-0
environment.ts
src/environments/environment.ts
+4
-2
No files found.
src/app/envCtrl/env-add-model/env-add-model.page.html
View file @
de1e2867
...
@@ -8,20 +8,20 @@
...
@@ -8,20 +8,20 @@
</ion-header>
</ion-header>
<ion-content
style=
"background-color: #F3F4F4;"
>
<ion-content
style=
"background-color: #F3F4F4;"
>
<div
style=
"max-height: calc(100% - 100px);overflow-y:auto;"
>
<div
style=
"max-height: calc(100% - 100px);overflow-y:auto;"
>
<ion-item-sliding
*
ngFor=
"let
c
fg of controlConfig"
>
<ion-item-sliding
*
ngFor=
"let
allC
fg of 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
class=
"inputText"
[(
ngModel
)]="
cf
g
.
name
"
style=
"width:80px;"
></ion-input>
<ion-input
class=
"inputText"
[(
ngModel
)]="
allCfg
.
confi
g
.
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=
"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
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
cf
g
.
interval
"
></ion-input>
<ion-input
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
allCfg
.
confi
g
.
interval
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,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
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
cf
g
.
T
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input>
<ion-input
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
allCfg
.
confi
g
.
T
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
></ion-input>
<ion-label>
℃
</ion-label>
<ion-label>
℃
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -39,14 +39,14 @@
...
@@ -39,14 +39,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
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
cf
g
.
A
"
></ion-input>
<ion-input
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
allCfg
.
confi
g
.
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
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
cf
g
.
B
"
></ion-input>
<ion-input
class=
"inputText"
style=
"width:50px;"
[(
ngModel
)]="
allCfg
.
confi
g
.
B
"
></ion-input>
<ion-label>
秒
</ion-label>
<ion-label>
秒
</ion-label>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
</ion-item>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-item-options
side=
"end"
>
<div
style=
"text-content: center; background-color: lightgray;"
>
<div
style=
"text-content: center; background-color: lightgray;"
>
<ion-icon
name=
"remove-circle"
color=
'danger'
class=
"deleteIcon"
(
click
)="
deleteModel
(
cf
g
)"
style=
"margin-top: 120px;"
></ion-icon>
<ion-icon
name=
"remove-circle"
color=
'danger'
class=
"deleteIcon"
(
click
)="
deleteModel
(
allCfg
.
confi
g
)"
style=
"margin-top: 120px;"
></ion-icon>
</div>
</div>
</ion-item-options>
</ion-item-options>
</ion-item-sliding>
</ion-item-sliding>
...
...
src/app/envCtrl/env-add-model/env-add-model.page.ts
View file @
de1e2867
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Api
}
from
'../../service/api'
;
import
{
NavController
,
PickerController
}
from
'@ionic/angular'
;
import
{
NavController
,
PickerController
}
from
'@ionic/angular'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
Load
}
from
'../../service/load'
;
import
{
Transfer
}
from
'../../service/transfer'
;
@
Component
({
@
Component
({
selector
:
'v-env-add-model'
,
selector
:
'v-env-add-model'
,
...
@@ -25,18 +21,21 @@ export class EnvAddModelPage implements OnInit {
...
@@ -25,18 +21,21 @@ export class EnvAddModelPage implements OnInit {
}
}
init
()
{
init
()
{
this
.
controlConfig
=
[{
id
:
1
,
name
:
''
,
interval
:
''
,
T
:
''
,
A
:
''
,
B
:
''
}];
this
.
controlConfig
=
[{
id
:
1
,
config
:
{
id
:
1
,
name
:
''
,
interval
:
''
,
T
:
''
,
A
:
''
,
B
:
''
}
}];
}
}
addModel
()
{
addModel
()
{
const
modelCount
=
this
.
controlConfig
.
length
;
const
modelCount
=
this
.
controlConfig
.
length
;
this
.
controlConfig
.
push
({
id
:
modelCount
+
1
,
name
:
''
,
interval
:
''
,
T
:
''
,
A
:
''
,
B
:
''
});
this
.
controlConfig
.
push
({
id
:
modelCount
+
1
,
config
:
{
id
:
modelCount
+
1
,
name
:
''
,
interval
:
''
,
T
:
''
,
A
:
''
,
B
:
''
}
});
}
}
deleteModel
(
one
)
{
deleteModel
(
one
)
{
const
updateModel
=
this
.
controlConfig
.
filter
(
data
=>
data
.
id
!==
one
.
id
);
const
updateModel
=
this
.
controlConfig
.
filter
(
data
=>
data
.
id
!==
one
.
id
);
this
.
controlConfig
=
updateModel
;
this
.
controlConfig
=
updateModel
;
this
.
controlConfig
.
forEach
((
item
,
index
)
=>
item
.
id
=
index
+
1
);
this
.
controlConfig
.
forEach
((
item
,
index
)
=>
{
item
.
id
=
index
+
1
;
item
.
config
.
id
=
index
+
1
;
});
}
}
saveModels
()
{
saveModels
()
{
...
...
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.scss
View file @
de1e2867
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
}
}
.popLabel
{
.popLabel
{
width
:
120px
;
//
width: 120px;
font-size
:
15px
;
font-size
:
15px
;
--padding-start
:
5px
;
--padding-start
:
5px
;
--padding-end
:
5px
;
--padding-end
:
5px
;
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
}
}
.popContent
{
.popContent
{
width
:
135px
!
important
;
//
width: 135px !important;
margin-bottom
:
5px
;
margin-bottom
:
5px
;
margin-right
:
5px
;
margin-right
:
5px
;
--padding-start
:
5px
;
--padding-start
:
5px
;
...
...
src/app/envCtrl/env-alarm/env-alarm.page.scss
View file @
de1e2867
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
}
}
.popContent
{
.popContent
{
width
:
135px
!
important
;
//
width: 135px !important;
margin-bottom
:
5px
;
margin-bottom
:
5px
;
margin-right
:
5px
;
margin-right
:
5px
;
--padding-start
:
5px
;
--padding-start
:
5px
;
...
...
src/app/envCtrl/env-alarm/env-alarm.page.ts
View file @
de1e2867
...
@@ -71,20 +71,20 @@ export class EnvAlarmPage implements OnInit {
...
@@ -71,20 +71,20 @@ export class EnvAlarmPage implements OnInit {
connectedCallback
()
{
connectedCallback
()
{
this
.
innerHTML
=
`
this
.
innerHTML
=
`
<ion-list class="popContent">
<ion-list class="popContent">
<ion-radio-group style="
width: 135px;
">
<ion-radio-group style="">
<ion-item style="
width: 135px;
">
<ion-item style="">
<ion-label class="popLabel">近一年</ion-label>
<ion-label class="popLabel">近一年</ion-label>
<ion-radio slot="start" value="12" checked id="popSelect1"></ion-radio>
<ion-radio slot="start" value="12" checked id="popSelect1"></ion-radio>
</ion-item>
</ion-item>
<ion-item style="
width: 135px;
">
<ion-item style="">
<ion-label class="popLabel">近六个月</ion-label>
<ion-label class="popLabel">近六个月</ion-label>
<ion-radio slot="start" value="6" id="popSelect2"></ion-radio>
<ion-radio slot="start" value="6" id="popSelect2"></ion-radio>
</ion-item>
</ion-item>
<ion-item style="
width: 135px;
">
<ion-item style="">
<ion-label class="popLabel">近三个月</ion-label>
<ion-label class="popLabel">近三个月</ion-label>
<ion-radio slot="start" value="3" id="popSelect3"></ion-radio>
<ion-radio slot="start" value="3" id="popSelect3"></ion-radio>
</ion-item>
</ion-item>
<ion-item style="
width: 135px;
">
<ion-item style="">
<ion-label class="popLabel">近一个月</ion-label>
<ion-label class="popLabel">近一个月</ion-label>
<ion-radio slot="start" value="1" id="popSelect4"></ion-radio>
<ion-radio slot="start" value="1" id="popSelect4"></ion-radio>
</ion-item>
</ion-item>
...
...
src/app/envCtrl/env-cfg/env-cfg.page.html
View file @
de1e2867
This diff is collapsed.
Click to expand it.
src/app/envCtrl/env-cfg/env-cfg.page.scss
View file @
de1e2867
...
@@ -81,3 +81,11 @@
...
@@ -81,3 +81,11 @@
margin-left
:
10px
;
margin-left
:
10px
;
margin-right
:
10px
;
margin-right
:
10px
;
}
}
.heatSelect
{
font-size
:
12px
;
--padding-bottom
:
0px
;
--padding-end
:
0px
;
--padding-start
:
0px
;
--padding-top
:
0px
;
}
src/app/envCtrl/env-cfg/env-cfg.page.ts
View file @
de1e2867
This diff is collapsed.
Click to expand it.
src/app/envCtrl/env-change-model/env-change-model.page.html
View file @
de1e2867
...
@@ -8,14 +8,14 @@
...
@@ -8,14 +8,14 @@
</ion-header>
</ion-header>
<ion-content
style=
"background-color: #F3F4F4;"
>
<ion-content
style=
"background-color: #F3F4F4;"
>
<div
style=
"max-height: calc(100% - 100px);overflow-y:auto;"
>
<div
style=
"max-height: calc(100% - 100px);overflow-y:auto;"
>
<ion-item-sliding
*
ngFor=
"let
c
fg of controlConfig"
>
<ion-item-sliding
*
ngFor=
"let
allC
fg of 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
class=
"inputText"
style=
"width:80px;"
[(
ngModel
)]="
cf
g
.
name
"
></ion-input>
<ion-input
class=
"inputText"
style=
"width:80px;"
[(
ngModel
)]="
allCfg
.
confi
g
.
name
"
></ion-input>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -24,14 +24,14 @@
...
@@ -24,14 +24,14 @@
<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 placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="tempHaveTouch()" style="width:50px;"></ion-input>-->
<ion-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
cf
g
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
></ion-datetime>
<ion-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
allCfg
.
confi
g
.
startDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
></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=
"fanItem"
lines=
"none"
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-label
style=
"width:
8
0px"
>
~
</ion-label>
<ion-label
style=
"width:
6
0px"
>
~
</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
class=
"inputDateTime timepicker"
[(
ngModel
)]="
cf
g
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
></ion-datetime>
<ion-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
allCfg
.
confi
g
.
stopDate
"
displayFormat=
"MM-DD"
cancelText=
"取消"
doneText=
"确认"
></ion-datetime>
</ion-item>
</ion-item>
</ion-col>
</ion-col>
</ion-row>
</ion-row>
...
@@ -39,14 +39,14 @@
...
@@ -39,14 +39,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"
>
开灯时间
</ion-label>
<ion-label
style=
"width:80px"
>
开灯时间
</ion-label>
<ion-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
cf
g
.
on
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
></ion-datetime>
<ion-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
allCfg
.
confi
g
.
on
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
></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
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-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
cf
g
.
off
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
></ion-datetime>
<ion-datetime
class=
"inputDateTime timepicker"
[(
ngModel
)]="
allCfg
.
confi
g
.
off
"
displayFormat=
"HH:mm"
cancelText=
"取消"
doneText=
"确认"
></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>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</ion-grid>
</ion-grid>
</ion-item>
</ion-item>
<ion-item-options
side=
"end"
>
<ion-item-options
side=
"end"
>
<div
style=
"text-content: center; background-color: lightgray;"
(
click
)="
deleteModel
(
c
fg
)"
>
<div
style=
"text-content: center; background-color: lightgray;"
(
click
)="
deleteModel
(
allC
fg
)"
>
<ion-icon
name=
"remove-circle"
color=
'danger'
class=
"deleteIcon"
style=
"margin-top: 70px;"
></ion-icon>
<ion-icon
name=
"remove-circle"
color=
'danger'
class=
"deleteIcon"
style=
"margin-top: 70px;"
></ion-icon>
</div>
</div>
</ion-item-options>
</ion-item-options>
...
...
src/app/envCtrl/env-change-model/env-change-model.page.ts
View file @
de1e2867
...
@@ -27,26 +27,33 @@ export class EnvChangeModelPage implements OnInit {
...
@@ -27,26 +27,33 @@ export class EnvChangeModelPage implements OnInit {
}
}
init
()
{
init
()
{
this
.
controlConfig
=
[{
id
:
1
,
name
:
''
,
startDate
:
''
,
stopDate
:
''
,
on
:
''
,
off
:
''
}];
this
.
controlConfig
=
[{
id
:
1
,
config
:
{
id
:
1
,
name
:
''
,
startDate
:
''
,
stopDate
:
''
,
on
:
''
,
off
:
''
}
}];
}
}
addModel
()
{
addModel
()
{
const
modelCount
=
this
.
controlConfig
.
length
;
const
modelCount
=
this
.
controlConfig
.
length
;
this
.
controlConfig
.
push
({
id
:
modelCount
+
1
,
name
:
''
,
startDate
:
''
,
stopDate
:
''
,
on
:
''
,
off
:
''
});
this
.
controlConfig
.
push
({
id
:
modelCount
+
1
,
config
:
{
id
:
modelCount
+
1
,
name
:
''
,
startDate
:
''
,
stopDate
:
''
,
on
:
''
,
off
:
''
}});
}
}
deleteModel
(
one
)
{
deleteModel
(
one
)
{
const
updateModel
=
this
.
controlConfig
.
filter
(
data
=>
data
.
id
!==
one
.
id
);
const
updateModel
=
this
.
controlConfig
.
filter
(
data
=>
data
.
id
!==
one
.
id
);
this
.
controlConfig
=
updateModel
;
this
.
controlConfig
=
updateModel
;
this
.
controlConfig
.
forEach
((
item
,
index
)
=>
item
.
id
=
index
+
1
);
this
.
controlConfig
.
forEach
((
item
,
index
)
=>
{
item
.
id
=
index
+
1
;
item
.
config
.
id
=
index
+
1
;
});
}
}
saveModels
()
{
saveModels
()
{
this
.
controlConfig
.
forEach
((
item
)
=>
{
this
.
controlConfig
.
forEach
((
item
,
index
)
=>
{
item
.
on
=
this
.
formatTime
(
item
.
on
);
item
.
id
=
index
+
1
;
item
.
off
=
this
.
formatTime
(
item
.
off
);
item
.
config
.
id
=
index
+
1
;
item
.
startDate
=
this
.
formatDate
(
item
.
startDate
);
item
.
config
.
on
=
this
.
formatTime
(
item
.
config
.
on
);
item
.
stopDate
=
this
.
formatDate
(
item
.
stopDate
);
item
.
config
.
off
=
this
.
formatTime
(
item
.
config
.
off
);
item
.
config
.
startDate
=
this
.
formatDate
(
item
.
config
.
startDate
);
item
.
config
.
stopDate
=
this
.
formatDate
(
item
.
config
.
stopDate
);
});
});
const
query
=
'?changeModelCfg='
+
JSON
.
stringify
(
this
.
controlConfig
);
const
query
=
'?changeModelCfg='
+
JSON
.
stringify
(
this
.
controlConfig
);
// this.nav.navigateForward('', );
// this.nav.navigateForward('', );
...
...
src/app/envCtrl/env-detail/env-detail.page.html
View file @
de1e2867
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<v-kanban
class=
"home-bar"
name=
"温度"
[
inData
]="
item
.
temp
"
iconClass=
"vo v-wendu"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"温度"
[
inData
]="
item
.
temp
"
iconClass=
"vo v-wendu"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"湿度"
[
inData
]="
item
.
humi
"
iconClass=
"vo v-shidu"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"湿度"
[
inData
]="
item
.
humi
"
iconClass=
"vo v-shidu"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"热应激"
[
inData
]="
item
.
heatStressLevelName
"
iconClass=
"vo v-nav-ico"
[
iconColor
]="
item
.
heatStressColor
"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"热应激"
[
inData
]="
item
.
heatStressLevelName
"
iconClass=
"vo v-nav-ico"
[
iconColor
]="
item
.
heatStressColor
"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"在舍状态"
[
inData
]="
item
.
inHouse
.
inHouse
Name
"
iconClass=
"vo v-dapeng-"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"在舍状态"
[
inData
]="
item
.
inHouse
.
inHouse
=
==
1
?
'在舍'
:
'离舍'
"
iconClass=
"vo v-dapeng-"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
</div>
</div>
<div
class=
"inHouse"
>
<div
class=
"inHouse"
>
<ion-label
class=
"inHouseLabel"
>
在离舍开关控制
</ion-label>
<ion-label
class=
"inHouseLabel"
>
在离舍开关控制
</ion-label>
...
...
src/app/envCtrl/env-detail/env-detail.page.ts
View file @
de1e2867
...
@@ -18,7 +18,7 @@ export class EnvDetailPage implements OnInit {
...
@@ -18,7 +18,7 @@ export class EnvDetailPage implements OnInit {
private
load
:
Load
,
private
load
:
Load
,
private
tf
:
Transfer
)
{}
private
tf
:
Transfer
)
{}
item
:
any
=
{
item
=
{
factoryNo
:
''
,
factoryNo
:
''
,
factoryName
:
''
,
factoryName
:
''
,
fieldRegionNo
:
''
,
fieldRegionNo
:
''
,
...
@@ -26,13 +26,15 @@ export class EnvDetailPage implements OnInit {
...
@@ -26,13 +26,15 @@ export class EnvDetailPage implements OnInit {
temp
:
0
,
temp
:
0
,
humi
:
0
,
humi
:
0
,
heatStressLevel
:
0
,
heatStressLevel
:
0
,
heatStressColor
:
'#71fa1d'
,
heatStressLevelName
:
'无'
,
online
:
0
,
online
:
0
,
operationModel
:
1
,
operationModel
:
1
,
isWisdomModel
:
1
,
isWisdomModel
:
1
,
alarm
:
1
,
alarm
:
1
,
inHouse
:
{
inHouse
:
{
inHouse
:
1
,
inHouse
:
1
,
inHouseName
:
''
,
inHouseName
:
'
离舍
'
,
fieldDeviceNo
:
''
,
fieldDeviceNo
:
''
,
fieldDeviceType
:
''
,
fieldDeviceType
:
''
,
},
},
...
@@ -62,8 +64,8 @@ export class EnvDetailPage implements OnInit {
...
@@ -62,8 +64,8 @@ export class EnvDetailPage implements OnInit {
this
.
comm
.
remain
=
0
;
this
.
comm
.
remain
=
0
;
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
this
.
fieldRegionNo
=
data
.
no
;
this
.
fieldRegionNo
=
data
.
no
;
});
this
.
getData
(
0
);
this
.
getData
(
0
);
});
}
}
initLayout
()
{
initLayout
()
{
...
@@ -104,7 +106,12 @@ export class EnvDetailPage implements OnInit {
...
@@ -104,7 +106,12 @@ export class EnvDetailPage implements OnInit {
// operationModel: 1, // 0-现控,1-平控
// operationModel: 1, // 0-现控,1-平控
// isWisdomModel: 0, // 0-非智控(自控),1-智控
// isWisdomModel: 0, // 0-非智控(自控),1-智控
// alarm: 1,
// alarm: 1,
// inHouse : this.getInHouseState(1), // 0-离舍,1-在舍
// inHouse : {
// inHouse: 1,
// inHouseName: this.getInHouseState(1), // 0-离舍,1-在舍},
// fieldDeviceNo: 'FDN15615456135612',
// fieldDeviceType: '牛舍'
// },
// ts: '2019-08-05 23:44',
// ts: '2019-08-05 23:44',
// };
// };
// this.initLayout();
// this.initLayout();
...
@@ -114,19 +121,19 @@ export class EnvDetailPage implements OnInit {
...
@@ -114,19 +121,19 @@ export class EnvDetailPage implements OnInit {
getHeatStressLevelName
(
level
)
{
getHeatStressLevelName
(
level
)
{
let
levelName
=
''
;
let
levelName
=
''
;
switch
(
level
)
{
switch
(
level
)
{
case
'0'
:
case
0
:
levelName
=
'无'
;
levelName
=
'无'
;
break
;
break
;
case
'1'
:
case
1
:
levelName
=
'轻'
;
levelName
=
'轻'
;
break
;
break
;
case
'2'
:
case
2
:
levelName
=
'中'
;
levelName
=
'中'
;
break
;
break
;
case
'3'
:
case
3
:
levelName
=
'重'
;
levelName
=
'重'
;
break
;
break
;
case
'4'
:
case
4
:
levelName
=
'II重'
;
levelName
=
'II重'
;
break
;
break
;
default
:
default
:
...
@@ -154,21 +161,23 @@ export class EnvDetailPage implements OnInit {
...
@@ -154,21 +161,23 @@ export class EnvDetailPage implements OnInit {
// 在离舍开关控制
// 在离舍开关控制
inHouseControl
(
inHouse
)
{
inHouseControl
(
inHouse
)
{
if
(
inHouse
.
fieldDeviceNo
!==
null
&&
inHouse
.
fieldDeviceNo
!==
''
)
{
if
(
inHouse
.
fieldDeviceNo
!==
null
&&
inHouse
.
fieldDeviceNo
!==
''
)
{
const
opt
=
{
fieldDeviceNo
:
''
,
fieldDeviceType
:
''
,
op
:
''
,
ts
:
0
};
const
opt
=
{
fieldDeviceNo
:
''
,
fieldDeviceType
:
''
,
op
:
0
,
ts
:
0
};
opt
.
fieldDeviceNo
=
inHouse
.
fieldDeviceNo
;
opt
.
fieldDeviceNo
=
inHouse
.
fieldDeviceNo
;
opt
.
fieldDeviceType
=
inHouse
.
fieldDeviceType
;
opt
.
fieldDeviceType
=
inHouse
.
fieldDeviceType
;
opt
.
op
=
inHouse
.
inHouse
;
opt
.
op
=
inHouse
.
inHouse
?
1
:
0
;
opt
.
ts
=
new
Date
().
valueOf
();
opt
.
ts
=
new
Date
().
valueOf
();
this
.
comm
.
remain
=
20
;
this
.
comm
.
remain
=
20
;
this
.
api
.
control
.
controlCowedSwitch
([
opt
,
(
data
)
=>
{
this
.
api
.
control
.
controlCowedSwitch
([
opt
,
(
data
)
=>
{
if
(
data
&&
data
.
code
===
1
)
{
// if (data && data.code === 1) {
this
.
getData
(
1
);
// this.getData(1);
this
.
api
.
presentMsgToast
(
data
.
message
);
// this.api.presentMsgToast(data.message);
// this.alarmMsg.locked = false;
// // this.alarmMsg.locked = false;
}
else
{
// } else {
// this.api.presentMsgToast(data.message);
// }
this
.
getData
(
0
);
this
.
api
.
presentMsgToast
(
data
.
message
);
this
.
api
.
presentMsgToast
(
data
.
message
);
}
this
.
comm
.
remain
=
0
;
this
.
comm
.
remain
=
0
;
}]);
}]);
}
}
...
...
src/app/envCtrl/env-fan/env-fan.page.html
View file @
de1e2867
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
margin-bottom: 5px;"
>
控制/状态
</h1>
margin-bottom: 5px;"
>
控制/状态
</h1>
<ion-item
*
ngIf=
"batchSwitch"
lines=
"full"
insert=
"false"
>
<ion-item
*
ngIf=
"batchSwitch"
lines=
"full"
insert=
"false"
>
<ion-label>
一键控制
</ion-label>
<ion-label>
一键控制
</ion-label>
<ion-toggle
slot=
"end"
[
checked
]="
batchSwitch
.
op
=
==
1
"
[
disabled
]="
batchSwitch
.
disabled
"
<ion-toggle
slot=
"end"
[
checked
]="
batchSwitch
.
op
"
[
disabled
]="
batchSwitch
.
disabled
"
(
load
)="
batchSwitch
.
load
"
(
ionChange
)="
toggle
(
batchSwitch
)"
></ion-toggle>
[(
ngModel
)]="
batchSwitch
.
op
"
(
load
)="
batchSwitch
.
load
"
(
click
)="
toggle
(
batchSwitch
)"
></ion-toggle>
<!--<v-switch (click)="allCheck(batchSwitch)" [value]="batchSwitch.op" [disabled]="batchSwitch.disabled" [loading]="batchSwitch.load"></v-switch>-->
<!--<v-switch (click)="allCheck(batchSwitch)" [value]="batchSwitch.op" [disabled]="batchSwitch.disabled" [loading]="batchSwitch.load"></v-switch>-->
</ion-item>
</ion-item>
<div>
<div>
...
@@ -35,10 +35,10 @@
...
@@ -35,10 +35,10 @@
<ion-card-content
class=
"cardContent"
>
<ion-card-content
class=
"cardContent"
>
<!--<ion-toggle slot="middle" [checked]="device.state"></ion-toggle>-->
<!--<ion-toggle slot="middle" [checked]="device.state"></ion-toggle>-->
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 0"
[
checked
]="
batchSwitch
.
op =
==
1
"
[
disabled
]="
device
.
disabled
"
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 0"
[
checked
]="
device
.
op
"
[
disabled
]="
device
.
disabled
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
[(
ngModel
)]="
device
.
op
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 1"
[
checked
]="
batchSwitch
.
op =
==
1
"
[
disabled
]="
device
.
disabled
"
color=
"danger"
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 1"
[
checked
]="
device
.
op
"
[
disabled
]="
device
.
disabled
"
color=
"danger"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
[(
ngModel
)]="
device
.
op
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
<!--<v-switch *ngIf="device.alarm === 0" class="btn-switch" (click)="deviceCheck(device)" [value]="device.state" [disabled]="device.disabled" [loading]="device.load"></v-switch>-->
<!--<v-switch *ngIf="device.alarm === 0" class="btn-switch" (click)="deviceCheck(device)" [value]="device.state" [disabled]="device.disabled" [loading]="device.load"></v-switch>-->
<!--<v-switch *ngIf="device.alarm === 1" class="btn-switch" color="danger" (click)="deviceCheck(device)" [value]="device.state" [disabled]="device.disabled" [loading]="device.load"></v-switch>-->
<!--<v-switch *ngIf="device.alarm === 1" class="btn-switch" color="danger" (click)="deviceCheck(device)" [value]="device.state" [disabled]="device.disabled" [loading]="device.load"></v-switch>-->
</ion-card-content>
</ion-card-content>
...
...
src/app/envCtrl/env-fan/env-fan.page.ts
View file @
de1e2867
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Api
}
from
'../../service/api'
;
import
{
Api
}
from
'../../service/api'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
Load
}
from
'../../service/load'
;
import
{
Load
}
from
'../../service/load'
;
...
@@ -21,7 +21,7 @@ export class EnvFanPage implements OnInit {
...
@@ -21,7 +21,7 @@ export class EnvFanPage implements OnInit {
// 各设备信息
// 各设备信息
devices
=
[];
devices
=
[];
// 一鍵控制按钮
// 一鍵控制按钮
batchSwitch
=
{
op
:
undefined
,
type
:
undefined
,
load
:
false
,
disabled
:
undefined
};
batchSwitch
=
{
op
:
false
,
type
:
undefined
,
load
:
false
,
disabled
:
undefined
};
controlModelOptions
=
[
controlModelOptions
=
[
{
modelId
:
0
,
modelValue
:
'手控模式'
},
{
modelId
:
0
,
modelValue
:
'手控模式'
},
...
@@ -34,11 +34,17 @@ export class EnvFanPage implements OnInit {
...
@@ -34,11 +34,17 @@ export class EnvFanPage implements OnInit {
isLoading
:
true
isLoading
:
true
};
};
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
,
private
alertControlle
:
AlertController
)
{
}
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
,
private
alertControlle
r
:
AlertController
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
ionViewWillEnter
();
this
.
init
();
this
.
init
();
}
}
ionViewWillEnter
()
{
}
init
()
{
init
()
{
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
this
.
fieldRegionNo
=
data
.
no
;
this
.
fieldRegionNo
=
data
.
no
;
...
@@ -50,28 +56,31 @@ export class EnvFanPage implements OnInit {
...
@@ -50,28 +56,31 @@ export class EnvFanPage implements OnInit {
this
.
load
.
toLoad
(
'加载中...'
,
false
);
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
}
this
.
api
.
cowshedApp
.
getFengJiData
([{
fieldRegionNo
:
this
.
fieldRegionNo
},
(
data
)
=>
{
this
.
api
.
cowshedApp
.
getFengJiData
([{
fieldRegionNo
:
this
.
fieldRegionNo
},
(
data
)
=>
{
// if (data && data.fieldRegionNo) {
if
(
data
&&
data
.
fieldRegionNo
)
{
// this.fieldRegionNo = data.fieldRegionNo;
this
.
fieldRegionNo
=
data
.
fieldRegionNo
;
// this.fieldDeviceType = data.fieldDeviceType;
this
.
fieldDeviceType
=
data
.
fieldDeviceType
;
// this.controlModel = data.controlModel;
this
.
controlModel
=
data
.
controlModel
;
// this.devices = data.param;
this
.
devices
=
data
.
param
;
//
this
.
devices
.
forEach
(
device
=>
{
// this.initButtons();
device
.
op
=
device
.
state
===
1
?
true
:
false
;
// }
});
this
.
initButtons
();
}
}]);
// START--------------------------------------------------------------------
// START--------------------------------------------------------------------
// TODO 测试用准备数据
// TODO 测试用准备数据
this
.
fieldDeviceType
=
'风机'
;
//
this.fieldDeviceType = '风机';
this
.
controlModel
=
0
;
//
this.controlModel = 0;
this
.
devices
=
[{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'1号组'
,
state
:
1
,
alarm
:
1
},
//
this.devices = [{fieldDeviceNo: '136641005998194688', fieldDeviceName: '1号组', state: 1, alarm: 1},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'2号组'
,
state
:
0
,
alarm
:
1
},
//
{fieldDeviceNo: '136641005998194688', fieldDeviceName: '2号组', state: 0, alarm: 1},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'3号组'
,
state
:
1
,
alarm
:
0
},
//
{fieldDeviceNo: '136641005998194688', fieldDeviceName: '3号组', state: 1, alarm: 0},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'4号组'
,
state
:
0
,
alarm
:
1
},
//
{fieldDeviceNo: '136641005998194688', fieldDeviceName: '4号组', state: 0, alarm: 1},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'5号组'
,
state
:
1
,
alarm
:
0
},
//
{fieldDeviceNo: '136641005998194688', fieldDeviceName: '5号组', state: 1, alarm: 0},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'6号组'
,
state
:
1
,
alarm
:
0
}];
//
{fieldDeviceNo: '136641005998194688', fieldDeviceName: '6号组', state: 1, alarm: 0}];
this
.
initButtons
();
//
this.initButtons();
// END--------------------------------------------------------------------
// END--------------------------------------------------------------------
}]);
}
}
initButtons
()
{
initButtons
()
{
...
@@ -85,15 +94,17 @@ export class EnvFanPage implements OnInit {
...
@@ -85,15 +94,17 @@ export class EnvFanPage implements OnInit {
// [一键控制]按钮(默认: 开启)
// [一键控制]按钮(默认: 开启)
// 当任意子按钮[关闭]的状态下: 关闭 以外:开启
// 当任意子按钮[关闭]的状态下: 关闭 以外:开启
this
.
batchSwitch
.
op
=
1
;
this
.
batchSwitch
.
op
=
true
;
this
.
devices
.
map
((
device
)
=>
{
this
.
devices
.
map
((
device
)
=>
{
if
(
device
.
state
===
0
)
{
if
(
device
.
op
===
false
)
{
this
.
batchSwitch
.
op
=
0
;
this
.
batchSwitch
.
op
=
false
;
}
}
});
});
}
}
toggle
(
btn
)
{
toggle
(
btn
)
{
// btn.op = btn.op ? 1 : 0;
// event.preventDefault();
// a.loading = true;
// a.loading = true;
this
.
opChangeComfirm
(
btn
);
this
.
opChangeComfirm
(
btn
);
...
@@ -101,8 +112,8 @@ export class EnvFanPage implements OnInit {
...
@@ -101,8 +112,8 @@ export class EnvFanPage implements OnInit {
async
opChangeComfirm
(
btn
)
{
async
opChangeComfirm
(
btn
)
{
const
msgHeader
=
this
.
fieldDeviceType
;
const
msgHeader
=
this
.
fieldDeviceType
;
const
msgOp
=
btn
.
op
?
'
关闭'
:
'打开
'
;
const
msgOp
=
btn
.
op
?
'
打开'
:
'关闭
'
;
const
alert
=
await
this
.
alertControlle
.
create
({
const
alert
=
await
this
.
alertControlle
r
.
create
({
header
:
'请注意'
,
header
:
'请注意'
,
// subHeader: '确定要' + msgOp + ' ' + msgHeader + ' 这个泵吗?',
// subHeader: '确定要' + msgOp + ' ' + msgHeader + ' 这个泵吗?',
message
:
'所有'
+
msgHeader
+
'即将'
+
msgOp
+
',要继续吗?'
,
message
:
'所有'
+
msgHeader
+
'即将'
+
msgOp
+
',要继续吗?'
,
...
@@ -112,7 +123,8 @@ export class EnvFanPage implements OnInit {
...
@@ -112,7 +123,8 @@ export class EnvFanPage implements OnInit {
text
:
'取消'
,
text
:
'取消'
,
cssClass
:
'width: 40%'
,
cssClass
:
'width: 40%'
,
handler
:
()
=>
{
handler
:
()
=>
{
this
.
batchSwitch
.
op
=
btn
.
op
===
0
?
1
:
0
;
this
.
batchSwitch
.
op
=
!
btn
.
op
;
event
.
preventDefault
();
}
}
},
{
},
{
text
:
'确定'
,
text
:
'确定'
,
...
@@ -132,7 +144,7 @@ export class EnvFanPage implements OnInit {
...
@@ -132,7 +144,7 @@ export class EnvFanPage implements OnInit {
const
req
=
{
const
req
=
{
fieldRegionNo
:
this
.
fieldRegionNo
,
fieldRegionNo
:
this
.
fieldRegionNo
,
fieldDeviceType
:
this
.
fieldDeviceType
,
fieldDeviceType
:
this
.
fieldDeviceType
,
op
:
btn
.
op
?
0
:
1
,
op
:
btn
.
op
?
1
:
0
,
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
};
};
this
.
comm
.
remain
=
120
;
this
.
comm
.
remain
=
120
;
...
@@ -150,6 +162,12 @@ export class EnvFanPage implements OnInit {
...
@@ -150,6 +162,12 @@ export class EnvFanPage implements OnInit {
this
.
comm
.
remain
=
0
;
this
.
comm
.
remain
=
0
;
btn
.
load
=
false
;
btn
.
load
=
false
;
}]);
}]);
// 子按钮状态
this
.
devices
.
forEach
((
device
)
=>
{
device
.
state
=
btn
.
op
?
1
:
0
;
device
.
op
=
btn
.
op
;
});
}
}
// 单个设备控制
// 单个设备控制
...
@@ -158,7 +176,7 @@ export class EnvFanPage implements OnInit {
...
@@ -158,7 +176,7 @@ export class EnvFanPage implements OnInit {
const
req
=
{
const
req
=
{
fieldDeviceNo
:
btn
.
fieldDeviceNo
,
fieldDeviceNo
:
btn
.
fieldDeviceNo
,
fieldDeviceType
:
this
.
fieldDeviceType
,
fieldDeviceType
:
this
.
fieldDeviceType
,
op
:
btn
.
state
?
0
:
1
,
op
:
btn
.
op
?
1
:
0
,
ts
:
new
Date
().
valueOf
()
ts
:
new
Date
().
valueOf
()
};
};
this
.
comm
.
remain
=
20
;
this
.
comm
.
remain
=
20
;
...
...
src/app/envCtrl/env-history/env-history.page.ts
View file @
de1e2867
...
@@ -21,38 +21,39 @@ export class EnvHistoryPage implements OnInit {
...
@@ -21,38 +21,39 @@ export class EnvHistoryPage implements OnInit {
item
:
any
=
{};
item
:
any
=
{};
chartOption
=
{};
tableRows
=
[];
// START--------------------------------------------------------------------------------
// START--------------------------------------------------------------------------------
// TODO 以下为假数据 待删除
// TODO 以下为假数据 待删除
chartOption
=
{
// chartOption = {
backgroundColor
:
'#F0F8FF'
,
// backgroundColor: '#F0F8FF',
visualMap
:
[
// visualMap: [
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
0
,
min
:
0
,
max
:
400
},
// {show: false, type: 'continuous', seriesIndex: 0, min: 0, max: 400},
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
1
,
dimension
:
0
,
min
:
0
,
max
:
400
}],
// {show: false, type: 'continuous', seriesIndex: 1, dimension: 0, min: 0, max: 400}],
xAxis
:
{
// xAxis: {
name
:
''
,
type
:
'category'
,
// name: '', type: 'category',
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
],
// data: ['1', '2', '3', '4', '5', '6', '7', '8'],
},
// },
yAxis
:
[
// yAxis: [
{
name
:
'温度(℃)'
,
type
:
'value'
,
splitLine
:
{
show
:
false
}},
// {name: '温度(℃)', type: 'value', splitLine: {show: false}},
{
name
:
'湿度(%)'
,
type
:
'value'
,
max
:
100
,
splitLine
:
{
show
:
false
}}
// {name: '湿度(%)', type: 'value', max: 100, splitLine: {show: false}}
],
// ],
series
:
[
// series: [
{
data
:
[
28
,
32
,
35
,
34
,
30
,
29
,
27
],
type
:
'line'
},
// {data: [28, 32, 35, 34, 30, 29, 27], type: 'line'},
{
data
:
[
15
,
13
,
12
,
11
,
12
,
11
,
87
],
yAxisIndex
:
1
,
type
:
'line'
},
// {data: [15, 13, 12, 11, 12, 11, 87], yAxisIndex: 1, type: 'line'},
{
data
:
[
76
,
45
,
43
,
23
,
34
,
54
,
23
],
yAxisIndex
:
1
,
type
:
'line'
}
// {data: [76, 45, 43, 23, 34, 54, 23], yAxisIndex: 1, type: 'line'}
]
// ]
};
// };
// // 时间 热应激 温度 湿度 光照 风机 喷淋 照明
// 时间 热应激 温度 湿度 光照 风机 喷淋 照明
// tableRows = [
tableRows
=
[
// {ts: '17:00', thi: '轻', temp: '23.8', humi: '56', NH3: '70'},
{
ts
:
'17:00'
,
thi
:
'轻'
,
temp
:
'23.8'
,
humi
:
'56'
,
NH3
:
'70'
},
// {ts: '17:30', thi: '中', temp: '27.2', humi: '43', NH3: '80'},
{
ts
:
'17:30'
,
thi
:
'中'
,
temp
:
'27.2'
,
humi
:
'43'
,
NH3
:
'80'
},
// {ts: '18:00', thi: '轻', temp: '23.2', humi: '61', NH3: '99'},
{
ts
:
'18:00'
,
thi
:
'轻'
,
temp
:
'23.2'
,
humi
:
'61'
,
NH3
:
'99'
},
// {ts: '18:30', thi: '轻', temp: '23.1', humi: '47', NH3: '100'},
{
ts
:
'18:30'
,
thi
:
'轻'
,
temp
:
'23.1'
,
humi
:
'47'
,
NH3
:
'100'
},
// {ts: '19:00', thi: '轻', temp: '20.2', humi: '43', NH3: '60'},
{
ts
:
'19:00'
,
thi
:
'轻'
,
temp
:
'20.2'
,
humi
:
'43'
,
NH3
:
'60'
},
// {ts: '19:30', thi: '轻', temp: '21.6', humi: '34', NH3: '50'},
{
ts
:
'19:30'
,
thi
:
'轻'
,
temp
:
'21.6'
,
humi
:
'34'
,
NH3
:
'50'
},
// {ts: '20:00', thi: '轻', temp: '22.5', humi: '43', NH3: '40'},
{
ts
:
'20:00'
,
thi
:
'轻'
,
temp
:
'22.5'
,
humi
:
'43'
,
NH3
:
'40'
},
// ];
];
// END--------------------------------------------------------------------------------
// END--------------------------------------------------------------------------------
ngOnInit
()
{
ngOnInit
()
{
...
@@ -97,7 +98,7 @@ export class EnvHistoryPage implements OnInit {
...
@@ -97,7 +98,7 @@ export class EnvHistoryPage implements OnInit {
const
humi
=
[];
const
humi
=
[];
const
thi
=
[];
const
thi
=
[];
const
times
=
[];
const
times
=
[];
debugger
;
if
(
param
.
temp
&&
param
.
temp
.
constructor
===
Array
)
{
if
(
param
.
temp
&&
param
.
temp
.
constructor
===
Array
)
{
param
.
temp
.
map
(
item
=>
{
param
.
temp
.
map
(
item
=>
{
times
.
push
(
new
Date
(
item
.
time
).
getHours
());
times
.
push
(
new
Date
(
item
.
time
).
getHours
());
...
...
src/app/envCtrl/env-home/env-home.page.html
View file @
de1e2867
...
@@ -45,10 +45,10 @@
...
@@ -45,10 +45,10 @@
<span
style=
"text-align: center"
>
{{item.fieldRegionName}}
</span><span
style=
"text-align: center; font-size:12px; padding-left:10px; color:red;"
*
ngIf=
"item.operationModel === 4"
>
(部分设备处于现控状态)
</span></div>
<span
style=
"text-align: center"
>
{{item.fieldRegionName}}
</span><span
style=
"text-align: center; font-size:12px; padding-left:10px; color:red;"
*
ngIf=
"item.operationModel === 4"
>
(部分设备处于现控状态)
</span></div>
</div>
</div>
<div
class=
"content"
>
<div
class=
"content"
>
<span
*
ngIf=
"item.temp"
class=
"detailInfo"
style=
"width: 40%"
>
温度:
{{item.temp}} ℃
</span>
<span
*
ngIf=
"item.temp
!== null
"
class=
"detailInfo"
style=
"width: 40%"
>
温度:
{{item.temp}} ℃
</span>
<span
*
ngIf=
"item.humi"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
{{item.humi}} % rH
</span>
<span
*
ngIf=
"item.humi
!== null
"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
{{item.humi}} % rH
</span>
<span
*
ngIf=
"item.humi"
class=
"detailInfo"
style=
"width: 40%"
>
氨气:
{{item.NH3}} ppm
</span>
<span
*
ngIf=
"item.humi
!== null
"
class=
"detailInfo"
style=
"width: 40%"
>
氨气:
{{item.NH3}} ppm
</span>
<span
*
ngIf=
"item.heatStressLevel"
class=
"detailInfo"
style=
"width: 40%"
>
热应激:
<span
class=
"warmColor{{item.heatStressLevel}}"
>
{{item.heatStressLevelName}}
</span></span>
<span
*
ngIf=
"item.heatStressLevel
!== null
"
class=
"detailInfo"
style=
"width: 40%"
>
热应激:
<span
class=
"warmColor{{item.heatStressLevel}}"
>
{{item.heatStressLevelName}}
</span></span>
</div>
</div>
<div
class=
"bottom"
>
<div
class=
"bottom"
>
<div
style=
"width:100%"
>
<div
style=
"width:100%"
>
...
@@ -60,8 +60,8 @@
...
@@ -60,8 +60,8 @@
<!-- 1:远控 0:现控 4:混乱 -->
<!-- 1:远控 0:现控 4:混乱 -->
<div
*
ngIf=
"item.operationModel === 1 || item.operationModel === 0"
class=
"online"
>
{{item.operationModel === 1 ? '远控' :'现控'}}
</div>
<div
*
ngIf=
"item.operationModel === 1 || item.operationModel === 0"
class=
"online"
>
{{item.operationModel === 1 ? '远控' :'现控'}}
</div>
<div
*
ngIf=
"item.operationModel === 4"
class=
"offline"
>
现控
</div>
<div
*
ngIf=
"item.operationModel === 4"
class=
"offline"
>
现控
</div>
<div
*
ngIf=
"item.operationModel"
[
ngClass
]="{'
online
'
:
item
.
isWisdomModel
,
'
offline
'
:
!
item
.
isWisdomModel
}"
class=
"online"
>
智控
</div>
<div
*
ngIf=
"item.operationModel
!== null
"
[
ngClass
]="{'
online
'
:
item
.
isWisdomModel
,
'
offline
'
:
!
item
.
isWisdomModel
}"
class=
"online"
>
智控
</div>
<div
*
ngIf=
"item.ts"
class=
"right"
>
{{item.ts | date: 'yyyy-MM-dd HH:mm'}}
</div>
<div
*
ngIf=
"item.ts
!== null
"
class=
"right"
>
{{item.ts | date: 'yyyy-MM-dd HH:mm'}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/envCtrl/env-home/env-home.page.ts
View file @
de1e2867
...
@@ -69,24 +69,25 @@ export class EnvHomePage implements OnInit {
...
@@ -69,24 +69,25 @@ export class EnvHomePage implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
this
.
init
();
this
.
init
();
this
.
ionViewWillEnter
();
//
this.ionViewWillEnter();
}
}
init
()
{
init
()
{
this
.
getData
(
0
);
}
// ionic的生命周期函数
ionViewWillEnter
()
{
this
.
slideDidChange
();
this
.
slideDidChange
();
this
.
getData
(
0
);
this
.
getData
(
0
);
}
}
// ionic的生命周期函数
// ionViewWillEnter() {
// this.slideDidChange();
// this.getData(0);
// }
getData
(
time
)
{
getData
(
time
)
{
if
(
this
.
isNetConnected
()
===
true
)
{
if
(
this
.
isNetConnected
())
{
if
(
time
)
{
if
(
time
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
}
this
.
api
.
cowshedApp
.
getAll
RegionData
([
''
,
(
data
)
=>
{
this
.
api
.
cowshedApp
.
getAll
([
''
,
(
data
)
=>
{
// 热应激良 热应激差 故障总数
// 热应激良 热应激差 故障总数
if
(
data
)
{
if
(
data
)
{
this
.
thiGood
=
data
.
thiGood
;
this
.
thiGood
=
data
.
thiGood
;
...
@@ -121,6 +122,9 @@ export class EnvHomePage implements OnInit {
...
@@ -121,6 +122,9 @@ export class EnvHomePage implements OnInit {
this
.
isError
=
true
;
this
.
isError
=
true
;
}
}
this
.
displayItems
=
this
.
items
;
this
.
displayItems
=
this
.
items
;
}
this
.
load
.
offLoad
();
}]);
// START--------------------------------------------------------------------
// START--------------------------------------------------------------------
// TODO 测试用准备数据
// TODO 测试用准备数据
...
@@ -134,8 +138,9 @@ export class EnvHomePage implements OnInit {
...
@@ -134,8 +138,9 @@ export class EnvHomePage implements OnInit {
// fieldRegionName: '1号牛舍',
// fieldRegionName: '1号牛舍',
// temp: 23.5,
// temp: 23.5,
// humi: 82,
// humi: 82,
// NH3: 76.786,
// heatStressLevel: '0',
// heatStressLevel: '0',
// heatStressLevelName: this.getHeatStressLevelName('0'
),
// heatStressLevelName: this.getHeatStressLevelName(0
),
// online: 0, // 0-离线,1-在线
// online: 0, // 0-离线,1-在线
// alarm: 0,
// alarm: 0,
// ts: '2019-08-05 23:44',
// ts: '2019-08-05 23:44',
...
@@ -146,8 +151,9 @@ export class EnvHomePage implements OnInit {
...
@@ -146,8 +151,9 @@ export class EnvHomePage implements OnInit {
// fieldRegionName: '2号牛舍',
// fieldRegionName: '2号牛舍',
// temp: 23.5,
// temp: 23.5,
// humi: 82,
// humi: 82,
// NH3: 10.116,
// heatStressLevel: '1',
// heatStressLevel: '1',
// heatStressLevelName: this.getHeatStressLevelName('1'
),
// heatStressLevelName: this.getHeatStressLevelName(1
),
// online: 1, // 0-离线,1-在线
// online: 1, // 0-离线,1-在线
// operationModel: 0, // 0-现控,1-平控
// operationModel: 0, // 0-现控,1-平控
// alarm: 0,
// alarm: 0,
...
@@ -159,8 +165,9 @@ export class EnvHomePage implements OnInit {
...
@@ -159,8 +165,9 @@ export class EnvHomePage implements OnInit {
// fieldRegionName: '3号牛舍',
// fieldRegionName: '3号牛舍',
// temp: 23.5,
// temp: 23.5,
// humi: 82,
// humi: 82,
// NH3: 60.255,
// heatStressLevel: '2',
// heatStressLevel: '2',
// heatStressLevelName: this.getHeatStressLevelName('2'
),
// heatStressLevelName: this.getHeatStressLevelName(2
),
// online: 1, // 0-离线,1-在线
// online: 1, // 0-离线,1-在线
// operationModel: 1, // 0-现控,1-平控
// operationModel: 1, // 0-现控,1-平控
// isWisdomModel: 0, // 0-非智控(手控),1-智控
// isWisdomModel: 0, // 0-非智控(手控),1-智控
...
@@ -173,8 +180,9 @@ export class EnvHomePage implements OnInit {
...
@@ -173,8 +180,9 @@ export class EnvHomePage implements OnInit {
// fieldRegionName: '4号牛舍',
// fieldRegionName: '4号牛舍',
// temp: 23.5,
// temp: 23.5,
// humi: 82,
// humi: 82,
// NH3: 80.213,
// heatStressLevel: '3',
// heatStressLevel: '3',
// heatStressLevelName: this.getHeatStressLevelName('3'
),
// heatStressLevelName: this.getHeatStressLevelName(3
),
// online: 1, // 0-离线,1-在线
// online: 1, // 0-离线,1-在线
// operationModel: 1, // 0-现控,1-平控
// operationModel: 1, // 0-现控,1-平控
// isWisdomModel: 0, // 0-非智控(自控),1-智控
// isWisdomModel: 0, // 0-非智控(自控),1-智控
...
@@ -189,7 +197,7 @@ export class EnvHomePage implements OnInit {
...
@@ -189,7 +197,7 @@ export class EnvHomePage implements OnInit {
// humi: 82.9,
// humi: 82.9,
// NH3: 120.999,
// NH3: 120.999,
// heatStressLevel: '4',
// heatStressLevel: '4',
// heatStressLevelName: this.getHeatStressLevelName('4'
),
// heatStressLevelName: this.getHeatStressLevelName(4
),
// online: 1, // 0-离线,1-在线
// online: 1, // 0-离线,1-在线
// operationModel: 4, // 0-现控,1-平控
// operationModel: 4, // 0-现控,1-平控
// isWisdomModel: 1, // 0-非智控(自控),1-智控
// isWisdomModel: 1, // 0-非智控(自控),1-智控
...
@@ -197,12 +205,8 @@ export class EnvHomePage implements OnInit {
...
@@ -197,12 +205,8 @@ export class EnvHomePage implements OnInit {
// ts: '2019-08-05 23:44',
// ts: '2019-08-05 23:44',
// },
// },
// ];
// ];
// this.displayItems = this.items;
// END--------------------------------------------------------------------
// END--------------------------------------------------------------------
}
}
this
.
load
.
offLoad
();
}]);
}
}
}
slideDidChange
()
{
slideDidChange
()
{
...
@@ -216,19 +220,19 @@ export class EnvHomePage implements OnInit {
...
@@ -216,19 +220,19 @@ export class EnvHomePage implements OnInit {
getHeatStressLevelName
(
codeId
)
{
getHeatStressLevelName
(
codeId
)
{
let
levelName
=
''
;
let
levelName
=
''
;
switch
(
codeId
)
{
switch
(
codeId
)
{
case
'0'
:
case
0
:
levelName
=
'无'
;
levelName
=
'无'
;
break
;
break
;
case
'1'
:
case
1
:
levelName
=
'轻'
;
levelName
=
'轻'
;
break
;
break
;
case
'2'
:
case
2
:
levelName
=
'中'
;
levelName
=
'中'
;
break
;
break
;
case
'3'
:
case
3
:
levelName
=
'重'
;
levelName
=
'重'
;
break
;
break
;
case
'4'
:
case
4
:
levelName
=
'II重'
;
levelName
=
'II重'
;
break
;
break
;
default
:
default
:
...
...
src/app/envCtrl/env-light/env-light.page.html
View file @
de1e2867
...
@@ -34,18 +34,22 @@
...
@@ -34,18 +34,22 @@
margin-bottom: 5px;"
>
控制/状态
</h1>
margin-bottom: 5px;"
>
控制/状态
</h1>
<ion-item
*
ngIf=
"devices"
lines=
"full"
insert=
"false"
>
<ion-item
*
ngIf=
"devices"
lines=
"full"
insert=
"false"
>
<ion-label>
一键控制
</ion-label>
<ion-label>
一键控制
</ion-label>
<!-- <ion-toggle slot="end" [checked]="batchSwitch.op"></ion-toggle>-->
<ion-toggle
slot=
"end"
[
checked
]="
batchSwitch
.
op
"
[
disabled
]="
batchSwitch
.
disabled
"
<v-switch
(
click
)="
allCheck
(
batchSwitch
)"
[
value
]="
batchSwitch
.
op
"
[
disabled
]="
batchSwitch
.
disabled
"
[
loading
]="
batchSwitch
.
load
"
></v-switch>
[(
ngModel
)]="
batchSwitch
.
op
"
(
load
)="
batchSwitch
.
load
"
(
click
)="
toggle
(
batchSwitch
)"
></ion-toggle>
<!--<v-switch (click)="allCheck(batchSwitch)" [value]="batchSwitch.op" [disabled]="batchSwitch.disabled" [loading]="batchSwitch.load"></v-switch>-->
</ion-item>
</ion-item>
<div>
<div>
<ion-card
*
ngFor=
"let device of devices"
class=
"card"
color=
"white"
>
<ion-card
*
ngFor=
"let device of devices"
class=
"card"
color=
"white"
>
<ion-card-header>
<ion-card-header
class=
"cardHeader"
>
<ion-card-subtitle
align=
"center"
>
{{device.fieldDeviceName}}
</ion-card-subtitle>
<ion-card-subtitle
align=
"center"
>
{{device.fieldDeviceName}}
</ion-card-subtitle>
</ion-card-header>
</ion-card-header>
<ion-card-content>
<ion-card-content
class=
"cardContent"
>
<!-- <ion-toggle slot="middle" [checked]="device.state"></ion-toggle>-->
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 0"
[
checked
]="
device
.
op
"
[
disabled
]="
device
.
disabled
"
<v-switch
class=
"btn-switch"
(
click
)="
deviceCheck
(
device
)"
[
value
]="
device
.
state
"
[
disabled
]="
device
.
disabled
"
[
loading
]="
device
.
load
"
></v-switch>
[(
ngModel
)]="
device
.
op
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 1"
[
checked
]="
device
.
op
"
[
disabled
]="
device
.
disabled
"
color=
"danger"
[(
ngModel
)]="
device
.
op
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
<!--<v-switch class="btn-switch" (click)="deviceCheck(device)" [value]="device.state" [disabled]="device.disabled" [loading]="device.load"></v-switch>-->
</ion-card-content>
</ion-card-content>
</ion-card>
</ion-card>
</div>
</div>
...
...
src/app/envCtrl/env-light/env-light.page.scss
View file @
de1e2867
...
@@ -8,8 +8,18 @@ i.vo {
...
@@ -8,8 +8,18 @@ i.vo {
.card
{
.card
{
float
:
none
;
float
:
none
;
display
:
inline-block
;
display
:
inline-block
;
width
:
28%
;
width
:
22%
;
margin
:
10px
10px
5px
5px
;
margin
:
5px
;
}
.cardHeader
{
--padding-inline-start
:
0px
!
important
;
--padding-inline-end
:
0px
!
important
;
padding
:
10px
;
}
.cardContent
{
padding
:
5px
;
text-align
:
center
;
}
}
.btn-switch
{
.btn-switch
{
...
...
src/app/envCtrl/env-light/env-light.page.ts
View file @
de1e2867
...
@@ -2,6 +2,7 @@ import {Component, Input, OnInit} from '@angular/core';
...
@@ -2,6 +2,7 @@ import {Component, Input, OnInit} from '@angular/core';
import
{
Api
}
from
'../../service/api'
;
import
{
Api
}
from
'../../service/api'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
Load
}
from
'../../service/load'
;
import
{
Load
}
from
'../../service/load'
;
import
{
AlertController
}
from
'@ionic/angular'
;
@
Component
({
@
Component
({
selector
:
'v-env-light'
,
selector
:
'v-env-light'
,
...
@@ -35,7 +36,7 @@ export class EnvLightPage implements OnInit {
...
@@ -35,7 +36,7 @@ export class EnvLightPage implements OnInit {
controlModelOptions
=
[
controlModelOptions
=
[
{
modelId
:
0
,
modelValue
:
'手控模式'
},
{
modelId
:
0
,
modelValue
:
'手控模式'
},
{
modelId
:
1
,
modelValue
:
'自控模式'
},
{
modelId
:
1
,
modelValue
:
'自控模式'
},
{
modelId
:
2
,
modelValue
:
'智
慧控制
'
}];
{
modelId
:
2
,
modelValue
:
'智
控模式
'
}];
// 发送指令延时判断
// 发送指令延时判断
comm
=
{
comm
=
{
...
@@ -43,7 +44,8 @@ export class EnvLightPage implements OnInit {
...
@@ -43,7 +44,8 @@ export class EnvLightPage implements OnInit {
isLoading
:
true
isLoading
:
true
};
};
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
,
private
route
:
ActivatedRoute
)
{
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
,
private
route
:
ActivatedRoute
,
private
alertControlle
:
AlertController
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -68,41 +70,104 @@ export class EnvLightPage implements OnInit {
...
@@ -68,41 +70,104 @@ export class EnvLightPage implements OnInit {
this
.
on
=
data
.
controlConfig
.
on
;
this
.
on
=
data
.
controlConfig
.
on
;
this
.
off
=
data
.
controlConfig
.
off
;
this
.
off
=
data
.
controlConfig
.
off
;
this
.
devices
=
data
.
param
;
this
.
devices
=
data
.
param
;
this
.
devices
.
forEach
(
device
=>
{
device
.
op
=
device
.
state
===
1
?
true
:
false
;
});
// --------------------------------------------------------------------
//
START
--------------------------------------------------------------------
// TODO 测试用准备数据
// TODO 测试用准备数据
this
.
fieldRegionNo
=
'FRN136641006052720640'
;
// this.fieldRegionNo = 'FRN136641006052720640';
this
.
startDate
=
'05-01'
;
// this.startDate = '05-01';
this
.
stopDate
=
'08-31'
;
// this.stopDate = '08-31';
// this.fieldDeviceType = '照明';
// // this.fieldDeviceType = '照明';
// this.controlModel = 2;
// // this.controlModel = 2;
this
.
on
=
'19:00'
;
// this.on = '19:00';
this
.
off
=
'05:00'
;
// this.off = '05:00';
this
.
devices
=
[{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'A号照明组'
,
state
:
1
},
// this.devices = [{fieldDeviceNo: '136641005998194688', fieldDeviceName: 'A号照明组', state: 1},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'B号照明组'
,
state
:
0
},
// {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'B号照明组', state: 0},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'C号照明组'
,
state
:
1
},
// {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'C号照明组', state: 1},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'D号照明组'
,
state
:
0
},
// {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'D号照明组', state: 0},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'E号照明组'
,
state
:
1
},
// {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'E号照明组', state: 1},
{
fieldDeviceNo
:
'136641005998194688'
,
fieldDeviceName
:
'F号照明组'
,
state
:
1
}];
// {fieldDeviceNo: '136641005998194688', fieldDeviceName: 'F号照明组', state: 1}];
// --------------------------------------------------------------------
// END--------------------------------------------------------------------
// [智控(2)]的状态下:非活性(true) 以外:活性(false)
this
.
initButtons
();
const
allDisabled
=
this
.
controlModel
===
2
?
true
:
false
;
}
this
.
batchSwitch
.
disabled
=
allDisabled
;
}]);
this
.
devices
.
forEach
((
device
,
i
)
=>
{
}
device
.
disabled
=
allDisabled
;
initButtons
()
{
// 智控:2
if
(
this
.
controlModel
===
2
)
{
this
.
batchSwitch
.
disabled
=
true
;
this
.
devices
.
forEach
((
device
)
=>
{
device
.
disabled
=
true
;
});
}
else
if
(
this
.
controlModel
===
1
)
{
// 自控:1
// 一键控制: 活性 其他按钮: 非活性
this
.
batchSwitch
.
disabled
=
false
;
this
.
devices
.
forEach
((
device
)
=>
{
device
.
disabled
=
true
;
});
}
else
{
// 手控:0
// 一键控制: 活性 其他按钮: 活性
this
.
batchSwitch
.
disabled
=
false
;
this
.
devices
.
forEach
((
device
)
=>
{
device
.
disabled
=
false
;
});
});
}
// 设置[一键控制]按钮(默认: 开启)
// 设置[一键控制]按钮(默认: 开启)
// 当任意子按钮[关闭]的状态下: 关闭 以外:开启
// 当任意子按钮[关闭]的状态下: 关闭 以外:开启
this
.
batchSwitch
.
op
=
1
;
this
.
batchSwitch
.
op
=
true
;
this
.
devices
.
map
((
device
)
=>
{
this
.
devices
.
map
((
device
)
=>
{
if
(
device
.
state
===
0
)
{
if
(
device
.
op
===
false
)
{
this
.
batchSwitch
.
op
=
0
;
this
.
batchSwitch
.
op
=
false
;
}
}
});
});
}
}
}]);
toggle
(
btn
)
{
// btn.op = btn.op ? 1 : 0;
// event.preventDefault();
// a.loading = true;
this
.
opChangeComfirm
(
btn
);
}
async
opChangeComfirm
(
btn
)
{
const
msgHeader
=
'照明灯'
;
const
msgOp
=
btn
.
op
?
'打开'
:
'关闭'
;
let
msgContent
=
''
;
if
(
this
.
controlModel
===
0
)
{
msgContent
=
'所有'
+
msgHeader
+
'即将'
+
msgOp
+
',要继续吗?'
;
}
else
{
msgContent
=
'确认要'
+
msgOp
+
'所有'
+
msgHeader
+
',并且自动切换至手动模式吗?'
;
}
const
alert
=
await
this
.
alertControlle
.
create
({
header
:
'请注意'
,
message
:
msgContent
,
mode
:
'ios'
,
buttons
:
[
{
text
:
'取消'
,
cssClass
:
'width: 40%'
,
handler
:
()
=>
{
this
.
batchSwitch
.
op
=
!
btn
.
op
;
event
.
preventDefault
();
}
},
{
text
:
'确定'
,
cssClass
:
'width: 40%'
,
handler
:
()
=>
{
this
.
allCheck
(
btn
);
}
}
]
});
await
alert
.
present
();
}
}
// 一键控制
// 一键控制
...
@@ -117,21 +182,26 @@ export class EnvLightPage implements OnInit {
...
@@ -117,21 +182,26 @@ export class EnvLightPage implements OnInit {
this
.
comm
.
remain
=
120
;
this
.
comm
.
remain
=
120
;
// 一键开启设备
// 一键开启设备
this
.
api
.
control
.
controlBatchSwitch
([
req
,
(
data
)
=>
{
this
.
api
.
control
.
controlCowedBatchSwitch
([
req
,
(
data
)
=>
{
if
(
data
.
code
===
1
)
{
// if (data.code === 1) {
this
.
getData
(
1
);
// this.getData(1);
this
.
api
.
presentMsgToast
(
data
.
message
);
// this.api.presentMsgToast(data.message);
}
else
{
// } else {
// this.api.presentMsgToast(data.message);
// }
this
.
getData
(
0
);
this
.
api
.
presentMsgToast
(
data
.
message
);
this
.
api
.
presentMsgToast
(
data
.
message
);
}
this
.
comm
.
remain
=
0
;
this
.
comm
.
remain
=
0
;
btn
.
load
=
false
;
btn
.
load
=
false
;
}]);
}]);
// 子按钮状态
// 子按钮状态
this
.
devices
.
forEach
((
device
,
i
)
=>
{
this
.
devices
.
forEach
((
device
)
=>
{
device
.
state
=
btn
.
op
?
0
:
1
;
device
.
op
=
btn
.
op
?
0
:
1
;
});
});
// 自动控制时, 强制切换至手动模式
this
.
controlModel
=
this
.
controlModel
===
1
?
0
:
this
.
controlModel
;
}
}
// 单个设备控制
// 单个设备控制
...
@@ -143,15 +213,18 @@ export class EnvLightPage implements OnInit {
...
@@ -143,15 +213,18 @@ export class EnvLightPage implements OnInit {
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
};
};
this
.
comm
.
remain
=
20
;
this
.
comm
.
remain
=
20
;
this
.
api
.
control
.
controlSwitch
([
req
,
(
data
)
=>
{
this
.
api
.
control
.
controlCowedSwitch
([
req
,
(
data
)
=>
{
if
(
data
&&
data
.
code
===
1
)
{
// if (data && data.code === 1) {
// this.getData(1);
// this.comm.remain = 0;
// this.api.presentMsgToast(data.message);
// } else {
// this.comm.remain = 0;
// this.api.presentMsgToast(data.message);
// }
this
.
getData
(
1
);
this
.
getData
(
1
);
this
.
comm
.
remain
=
0
;
this
.
comm
.
remain
=
0
;
this
.
api
.
presentMsgToast
(
data
.
message
);
this
.
api
.
presentMsgToast
(
data
.
message
);
}
else
{
this
.
comm
.
remain
=
0
;
this
.
api
.
presentMsgToast
(
data
.
message
);
}
btn
.
loading
=
false
;
btn
.
loading
=
false
;
}]);
}]);
}
}
...
...
src/app/envCtrl/env-shower/env-shower.page.html
View file @
de1e2867
...
@@ -23,8 +23,8 @@
...
@@ -23,8 +23,8 @@
line-height: 25px;
line-height: 25px;
margin-bottom: 5px;"
>
供液泵状态
</h1>
margin-bottom: 5px;"
>
供液泵状态
</h1>
<ion-item
lines=
"full"
>
<ion-item
lines=
"full"
>
<div
[
ngClass
]="{'
sucCir
'
:
bump
.
online
,
'
errCir
'
:
!
bump
.
online
}"
></div>
<div
[
ngClass
]="{'
sucCir
'
:
bump
.
alarm =
==
0
,
'
errCir
'
:
bump
.
alarm =
==
0
}"
></div>
<span
class=
"content"
>
{{bump.
online ? '在线' : '离线
'}}
</span>
<span
class=
"content"
>
{{bump.
alarm === 1 ? '异常' : '运行
'}}
</span>
<span
class=
"content"
style=
"margin-left: 30px"
>
压力: {{bump.press}} Mpa
</span>
<span
class=
"content"
style=
"margin-left: 30px"
>
压力: {{bump.press}} Mpa
</span>
</ion-item>
</ion-item>
<h1
style=
"
<h1
style=
"
...
@@ -33,13 +33,13 @@
...
@@ -33,13 +33,13 @@
border-left: 5px solid #28c9bd;
border-left: 5px solid #28c9bd;
line-height: 25px;
line-height: 25px;
margin-bottom: 5px;"
>
时间参数
</h1>
margin-bottom: 5px;"
>
时间参数
</h1>
<ion-item
lines=
"full"
*
ngIf=
"controlConfig.a"
insert=
"false"
>
<ion-item
lines=
"full"
insert=
"false"
>
<span
class=
"content"
>
A区喷淋时间 {{controlConfig.a
}} 秒
</span>
<span
class=
"content"
>
{{param[0].fieldDeviceName}}喷淋时间 {{controlConfig.A
}} 秒
</span>
</ion-item>
</ion-item>
<ion-item
lines=
"full"
*
ngIf=
"controlConfig.b"
insert=
"false"
>
<ion-item
lines=
"full"
insert=
"false"
>
<span
class=
"content"
>
B区喷淋时间 {{controlConfig.b
}} 秒
</span>
<span
class=
"content"
>
{{param[1].fieldDeviceName}}喷淋时间 {{controlConfig.B
}} 秒
</span>
</ion-item>
</ion-item>
<ion-item
lines=
"full"
*
ngIf=
"controlConfig.interval"
insert=
"false"
>
<ion-item
lines=
"full"
insert=
"false"
>
<span
class=
"content"
>
间隔时间 {{controlConfig.interval}} 秒
</span>
<span
class=
"content"
>
间隔时间 {{controlConfig.interval}} 秒
</span>
</ion-item>
</ion-item>
...
@@ -50,15 +50,26 @@
...
@@ -50,15 +50,26 @@
line-height: 25px;
line-height: 25px;
margin-bottom: 5px;"
>
控制/状态
</h1>
margin-bottom: 5px;"
>
控制/状态
</h1>
<div>
<div>
<ion-card
*
ngFor=
"let a of param"
class=
"card"
color=
"white"
>
<ion-card
*
ngFor=
"let device of param"
class=
"card"
color=
"white"
>
<ion-card-header>
<ion-card-header
class=
"cardHeader"
>
<ion-card-title
class=
"card-title"
>
{{a.fieldDeviceName}}
</ion-card-title>
<ion-card-title
class=
"card-title"
>
<div
style=
"width:100%;text-align:center;"
>
<div
style=
"width:48%;display: inline-block; height: 40px;float: left; text-align: center; padding-top: 10px;"
>
<div
style=
"text-align: center;margin:auto"
>
{{device.fieldDeviceName}}
</div>
</div>
<div
style=
"width:48%;display: inline-block"
><img
[
src
]="'../../
assets
/
img
/
shower-
'
+
device
.
state
+
'.
png
'"
style=
"width:50px !important; margin: auto;"
></div>
</div>
</ion-card-title>
</ion-card-header>
</ion-card-header>
<ion-card-content
style=
"margin: 0px; padding-top:0px;
"
>
<ion-card-content
class=
"cardContent
"
>
<span
class=
"content"
>
压力 {{
a
.press}} MPa
</span><br>
<span
class=
"content"
>
压力 {{
device
.press}} MPa
</span><br>
<!-- <ion-toggle [checked]="a.state"></ion-toggle>-->
<!-- <ion-toggle [checked]="a.state"></ion-toggle>-->
<v-switch
class=
"btn-switch"
(
click
)="
deviceCheck
(
a
)"
[
value
]="
a
.
state
"
[
loading
]="
a
.
load
"
></v-switch>
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 0"
[
checked
]="
device
.
op
"
[
disabled
]="
device
.
disabled
"
[(
ngModel
)]="
device
.
op
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
<ion-toggle
class=
"btn-switch"
*
ngIf=
"device.alarm === 1"
[
checked
]="
device
.
op
"
[
disabled
]="
device
.
disabled
"
color=
"danger"
[(
ngModel
)]="
device
.
op
"
(
click
)="
deviceCheck
(
device
)"
></ion-toggle>
<!--<v-switch class="btn-switch" (click)="deviceCheck(a)" [value]="a.state" [loading]="a.load"></v-switch>-->
</ion-card-content>
</ion-card-content>
</ion-card>
</ion-card>
</div>
</div>
...
...
src/app/envCtrl/env-shower/env-shower.page.scss
View file @
de1e2867
.card
{
.card
{
float
:
none
;
float
:
none
;
display
:
inline-block
;
display
:
inline-block
;
width
:
42
%
;
width
:
44
%
;
margin
:
10px
10px
5px
10px
;
margin
:
3%
;
text-align
:
center
;
text-align
:
center
;
}
}
.card-title
{
.card-title
{
font-size
:
20
px
;
font-size
:
16
px
;
}
}
.content
{
.content
{
...
@@ -19,3 +19,33 @@
...
@@ -19,3 +19,33 @@
display
:
inline-block
;
display
:
inline-block
;
margin-top
:
5px
;
margin-top
:
5px
;
}
}
.sucCir
{
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#2ecc71
;
display
:
inline-block
;
vertical-align
:
middle
;
box-shadow
:
#ccc
0
.5px
0
.5px
3px
;
}
.errCir
{
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#cb0000
;
display
:
inline-block
;
vertical-align
:
middle
;
box-shadow
:
#ccc
0
.5px
0
.5px
3px
;
}
.cardHeader
{
--padding-inline-start
:
0px
!
important
;
--padding-inline-end
:
0px
!
important
;
padding
:
10px
;
}
.cardContent
{
padding
:
5px
;
text-align
:
center
;
}
src/app/envCtrl/env-shower/env-shower.page.ts
View file @
de1e2867
...
@@ -27,14 +27,15 @@ export class EnvShowerPage implements OnInit {
...
@@ -27,14 +27,15 @@ export class EnvShowerPage implements OnInit {
// 模式状态
// 模式状态
controlModel
=
0
;
controlModel
=
0
;
// 供液泵状态
// 供液泵状态
bump
=
{
online
:
true
,
press
:
0
};
bump
=
{
alarm
:
0
,
press
:
0
};
// 时间参数
// 时间参数
controlConfig
=
{
controlConfig
=
{
name
:
''
,
name
:
''
,
interval
:
0
,
// 间隔时间
interval
:
0
,
// 间隔时间
a
:
''
,
// A区喷淋时间
A
:
0
,
// A区喷淋时间
t
:
''
,
T
:
0
,
b
:
''
,
// A区喷淋时间
B
:
0
,
// A区喷淋时间
offset
:
0
};
};
// 各设备信息
// 各设备信息
param
=
[];
param
=
[];
...
@@ -42,7 +43,7 @@ export class EnvShowerPage implements OnInit {
...
@@ -42,7 +43,7 @@ export class EnvShowerPage implements OnInit {
controlModelOptions
=
[
controlModelOptions
=
[
{
modelId
:
0
,
modelValue
:
'手控模式'
},
{
modelId
:
0
,
modelValue
:
'手控模式'
},
{
modelId
:
1
,
modelValue
:
'自控模式'
},
{
modelId
:
1
,
modelValue
:
'自控模式'
},
{
modelId
:
2
,
modelValue
:
'智
慧控制
'
}];
{
modelId
:
2
,
modelValue
:
'智
控模式
'
}];
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
,
private
route
:
ActivatedRoute
)
{
}
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
,
private
route
:
ActivatedRoute
)
{
}
...
@@ -50,16 +51,21 @@ export class EnvShowerPage implements OnInit {
...
@@ -50,16 +51,21 @@ export class EnvShowerPage implements OnInit {
this
.
init
();
this
.
init
();
}
}
ionViewWillEnter
()
{
this
.
init
();
}
init
()
{
init
()
{
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
});
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
this
.
getData
(
0
);
this
.
getData
(
0
);
});
}
}
getData
(
time
)
{
getData
(
time
)
{
if
(
time
)
{
if
(
time
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
}
this
.
api
.
cowshedApp
.
getPenLinData
([{
'fieldRegionNo'
:
this
.
fieldRegionNo
},
(
data
)
=>
{
this
.
api
.
cowshedApp
.
getPenLinData
([{
fieldRegionNo
:
this
.
fieldRegionNo
},
(
data
)
=>
{
if
(
data
)
{
if
(
data
)
{
this
.
fieldRegionNo
=
data
.
fieldRegionNo
;
this
.
fieldRegionNo
=
data
.
fieldRegionNo
;
this
.
fieldDeviceType
=
data
.
fieldDeviceType
;
this
.
fieldDeviceType
=
data
.
fieldDeviceType
;
...
@@ -67,29 +73,43 @@ export class EnvShowerPage implements OnInit {
...
@@ -67,29 +73,43 @@ export class EnvShowerPage implements OnInit {
this
.
bump
=
data
.
bump
;
this
.
bump
=
data
.
bump
;
this
.
controlConfig
=
data
.
controlConfig
;
this
.
controlConfig
=
data
.
controlConfig
;
this
.
param
=
data
.
param
;
this
.
param
=
data
.
param
;
this
.
param
.
forEach
(
device
=>
{
device
.
op
=
device
.
cycle
===
1
?
true
:
false
;
});
this
.
initButtons
();
}
}
}]);
}]);
}
}
initButtons
()
{
this
.
param
.
forEach
((
device
)
=>
{
// disabled:手控状态下 活性false 其他非活性true
device
.
disabled
=
this
.
controlModel
===
0
?
false
:
true
;
});
}
// 单个设备控制
// 单个设备控制
deviceCheck
(
btn
)
{
deviceCheck
(
btn
)
{
const
req
=
{
const
req
=
{
fieldDeviceNo
:
btn
.
fieldDeviceNo
,
fieldDeviceNo
:
btn
.
fieldDeviceNo
,
op
:
btn
.
state
?
0
:
1
,
fieldDeviceType
:
this
.
fieldDeviceType
,
op
:
btn
.
op
?
1
:
0
,
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
};
};
this
.
comm
.
remain
=
20
;
this
.
comm
.
remain
=
20
;
this
.
api
.
control
.
controlSwitch
([
req
,
(
data
)
=>
{
this
.
api
.
control
.
controlCowedSwitch
([
req
,
(
data
)
=>
{
if
(
data
&&
data
.
code
===
1
)
{
// if (data && data.code === 1) {
this
.
getData
(
1
);
// this.getData(1);
this
.
comm
.
remain
=
0
;
// this.comm.remain = 0;
this
.
api
.
presentMsgToast
(
data
.
message
);
// this.api.presentMsgToast(data.message);
}
else
{
// } else {
// this.comm.remain = 0;
// this.api.presentMsgToast(data.message);
// }
this
.
getData
(
0
);
this
.
comm
.
remain
=
0
;
this
.
comm
.
remain
=
0
;
this
.
api
.
presentMsgToast
(
data
.
message
);
this
.
api
.
presentMsgToast
(
data
.
message
);
}
btn
.
loading
=
false
;
btn
.
loading
=
false
;
}]);
}]);
}
}
}
}
src/app/envCtrl/env-waterchannel/env-waterchannel.page.html
View file @
de1e2867
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
line-height: 25px;
line-height: 25px;
margin-bottom: 5px;"
>
状态
</h1>
margin-bottom: 5px;"
>
状态
</h1>
<ion-card
*
ngFor=
"let device of devices"
class=
"card"
color=
"white"
>
<ion-card
*
ngFor=
"let device of devices"
class=
"card"
color=
"white"
>
<ion-card-header>
<ion-card-header
class=
"cardTitle"
>
<ion-card-title
>
<span
[
ngClass
]="{'
sucCir
'
:
device
.
online
,
'
errCir
'
:
!
device
.
online
}
"
></span>
{{device .fieldDeviceName}}
</ion-card-title>
<ion-card-title
class=
"cardHeader"
>
<span
class=
"sucCir
"
></span>
{{device .fieldDeviceName}}
</ion-card-title>
</ion-card-header>
</ion-card-header>
<ion-card-content>
<ion-card-content
class=
"cardContent"
>
<span>
当前功率
</span>
<span
>
{{device.kw}} KW
<br></span>
<span>
当前功率
:
</span>
<span
style=
"color:#0bb8cc"
>
{{device.kw}} KW
<br></span>
<span>
估计加热设备台数
</span>
<span
>
{{device.deviceOnlineNum}} 台
</span>
<span>
估计加热设备台数
:
</span>
<span
style=
"color:#0bb8cc"
>
{{device.deviceOnlineNum}} 台
</span>
</ion-card-content>
</ion-card-content>
</ion-card>
</ion-card>
</ion-content>
</ion-content>
src/app/envCtrl/env-waterchannel/env-waterchannel.page.scss
View file @
de1e2867
.card
{
float
:
none
;
display
:
inline-block
;
width
:
97%
;
margin
:
2%
;
}
.cardTitle
{
font-size
:
20px
;
padding
:
0px
;
}
.cardHeader
{
--padding-inline-start
:
0px
!
important
;
--padding-inline-end
:
0px
!
important
;
padding
:
10px
;
font-size
:
20px
;
text-align
:left
;
}
.cardContent
{
padding
:
0px
5px
5px
35px
;
}
.sucCir
{
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#2ecc71
;
display
:
inline-block
;
vertical-align
:
middle
;
box-shadow
:
#ccc
0
.5px
0
.5px
3px
;
}
.errCir
{
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#cb0000
;
display
:
inline-block
;
vertical-align
:
middle
;
box-shadow
:
#ccc
0
.5px
0
.5px
3px
;
}
src/app/envCtrl/env-waterchannel/env-waterchannel.page.ts
View file @
de1e2867
...
@@ -26,15 +26,21 @@ export class EnvWaterchannelPage implements OnInit {
...
@@ -26,15 +26,21 @@ export class EnvWaterchannelPage implements OnInit {
// this.ac.queryParams.subscribe((data) => {
// this.ac.queryParams.subscribe((data) => {
// this.fieldRegionNo = data.no;
// this.fieldRegionNo = data.no;
// });
// });
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
});
this
.
init
();
}
init
()
{
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
this
.
getData
(
0
);
this
.
getData
(
0
);
});
}
}
getData
(
time
)
{
getData
(
time
)
{
if
(
time
)
{
if
(
time
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
}
this
.
api
.
cowshedApp
.
getShuiCaoData
([{
'fieldRegionNo'
:
this
.
fieldRegionNo
},
(
data
)
=>
{
this
.
api
.
cowshedApp
.
getShuiCaoData
([{
fieldRegionNo
:
this
.
fieldRegionNo
},
(
data
)
=>
{
if
(
data
)
{
if
(
data
)
{
this
.
devices
=
data
.
param
;
this
.
devices
=
data
.
param
;
}
}
...
...
src/app/service/api.ts
View file @
de1e2867
...
@@ -33,7 +33,7 @@ export class Api {
...
@@ -33,7 +33,7 @@ export class Api {
public
cowshedApp
=
{
public
cowshedApp
=
{
// 牛舍首页查询
// 牛舍首页查询
getAll
RegionData
:
(
data
)
=>
this
.
trans
(
'get'
,
'/cowshedApp/getAll'
,
data
),
getAll
:
(
data
)
=>
this
.
trans
(
'get'
,
'/cowshedApp/getAll'
,
data
),
// 根据牛舍名称查询牛舍信息
// 根据牛舍名称查询牛舍信息
getAllForLike
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedApp/getAllForLike'
,
data
),
getAllForLike
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedApp/getAllForLike'
,
data
),
// 获取牛舍的基本信息
// 获取牛舍的基本信息
...
@@ -95,8 +95,8 @@ export class Api {
...
@@ -95,8 +95,8 @@ export class Api {
};
};
public
config
=
{
public
config
=
{
get
All
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedConfig/getAll
'
,
data
),
get
ByFieldRegionNo
:
(
data
)
=>
this
.
trans
(
'post'
,
'/config/getByFieldRegionNo
'
,
data
),
updateCo
wshedConfig
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedConfig/updateCowshed
Config'
,
data
),
updateCo
nfig
:
(
data
)
=>
this
.
trans
(
'post'
,
'/config/update
Config'
,
data
),
};
};
public
devicePatternModel
=
{
public
devicePatternModel
=
{
...
...
src/assets/img/shower-0.png
0 → 100644
View file @
de1e2867
1.08 KB
src/assets/img/shower-1.png
0 → 100644
View file @
de1e2867
1.3 KB
src/environments/environment.ts
View file @
de1e2867
...
@@ -4,12 +4,14 @@
...
@@ -4,12 +4,14 @@
export
const
environment
=
{
export
const
environment
=
{
// production: false,
// production: false,
url
:
'http://pasture.witium.com.cn/api'
,
// 对外访问测试网地址
// url: 'http://pasture.witium.com.cn/api', // 对外访问测试网地址
// url: 'http://172.16.1.14:8096',
// url: 'http://cloud-test.witium.com:8096', // 测试
// url: 'http://cloud-test.witium.com:8096', // 测试
// url: 'http://172.16.1.53:8096', // cy
// url: 'http://172.16.1.53:8096', // cy
// url: 'http://172.16.1.51:8097', // lin
// url: 'http://172.16.1.51:8097', // lin
// url: 'http://211.161.200.169:19200', // zz
// url: 'http://211.161.200.169:19200', // zz
//
url: 'http://172.16.1.52:8096', // zz
url
:
'http://172.16.1.52:8096'
,
// zz
// url: 'http://172.16.1.13:8096', // 测试
// url: 'http://172.16.1.13:8096', // 测试
mqttUrl
:
'172.16.1.24'
,
// mqttUrl: '172.16.1.24:48083',
mqttUrl
:
'172.16.1.24'
,
// mqttUrl: '172.16.1.24:48083',
// mqttUrl: '211.161.200.169', // 辉度外网访问mqtt地址
// mqttUrl: '211.161.200.169', // 辉度外网访问mqtt地址
...
...
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