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
6817aec5
Commit
6817aec5
authored
Sep 11, 2019
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
牛舍配置页改修 牛舍历史数据微调
parent
80b92e88
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
620 additions
and
454 deletions
+620
-454
env-cfg.page.html
src/app/envCtrl/env-cfg/env-cfg.page.html
+280
-255
env-cfg.page.ts
src/app/envCtrl/env-cfg/env-cfg.page.ts
+230
-69
env-history.page.html
src/app/envCtrl/env-history/env-history.page.html
+31
-42
env-history.page.scss
src/app/envCtrl/env-history/env-history.page.scss
+14
-4
env-history.page.ts
src/app/envCtrl/env-history/env-history.page.ts
+59
-83
env-home.page.html
src/app/envCtrl/env-home/env-home.page.html
+1
-1
api.ts
src/app/service/api.ts
+5
-0
No files found.
src/app/envCtrl/env-cfg/env-cfg.page.html
View file @
6817aec5
...
...
@@ -7,15 +7,39 @@
<ion-content>
<ion-item
lines=
"full"
>
<ion-label>
请选择牛舍
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
(
ionChange
)="
selFarmEvent
()"
>
<ion-select-option
*
ngFor=
"let
a of cowFarm"
value=
"a.value"
>
{{a.n
ame}}
</ion-select-option>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
curFieldRegionNo
"
(
ionChange
)="
selectCowshed
()"
>
<ion-select-option
*
ngFor=
"let
cowshed of cowshedList"
[
value
]="
cowshed
.
fieldRegionNo
"
>
{{cowshed.fieldRegionN
ame}}
</ion-select-option>
</ion-select>
</ion-item>
<div
*
ngIf=
"curCowshed.fieldRegionName"
>
<ion-item
lines=
"full"
>
<ion-label>
智慧模式选择
</ion-label>
<ion-toggle
slot=
"end"
name=
"apple"
color=
"secondary"
checked
style=
"width:50px
"
></ion-toggle>
<ion-toggle
slot=
"end"
color=
"secondary"
style=
"width:50px"
[
checked
]="
curCowshed
.
isWisdomModel
"
></ion-toggle>
</ion-item>
<ion-label
text-wrap
color=
"danger"
style=
"margin-left: 20px"
>
选择智慧模式时,风机/喷淋/照明的控制将强制进入有环境条件影响的自控模式
</ion-label>
<ion-item-divider>
<ion-label>
偏差值配置
</ion-label>
</ion-item-divider>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-grid>
<ion-row>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
偏差温度
</ion-label>
<ion-input
placeholder=
"25"
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
toft
"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-col>
<ion-col>
<ion-item
class=
"fanItem"
>
<ion-label
position=
"fixed"
>
偏差湿度
</ion-label>
<ion-input
placeholder=
"25"
[(
ngModel
)]="
curCowshed
.
propertyConfig
.
hoft
"
(
ionFocus
)="
fanTempHaveFouch
()"
></ion-input>
<ion-label
position=
"fixed"
>
℃
</ion-label>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<ion-item-divider>
<ion-label>
风机模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
[(
ngModel
)]="
workModeSetting
.
workMode
"
[(
value
)]="
workModeSetting
.
workMode
"
(
ionChange
)="
workModeEvent
()"
>
...
...
@@ -178,14 +202,14 @@
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
日期范围
</ion-label>
<!--<ion-input placeholder={{cfg.startTime}} (ionFocus)="fanTempHaveFouch()" style="width:50px;"></ion-input>-->
<ion-datetime
displayFormat=
"MM-DD"
placeholder=
"Date"
class=
"timepicker
"
></ion-datetime>
<ion-datetime
displayFormat=
"MM-DD"
placeholder=
"Date"
class=
"timepicker"
[(
ngModel
)]="
shuiCao
.
startDate
"
></ion-datetime>
</ion-item>
</ion-col>
<ion-col
size=
"auto"
style=
"font-size: 13px;"
>
<ion-item
class=
"timepickerItem"
lines=
"none"
>
<ion-label
style=
"width:80px"
>
~
</ion-label>
<!--<ion-input placeholder={{cfg.endTime}} (ionFocus)="fanTempHaveFouch()" style="width:50px;"></ion-input>-->
<ion-datetime
displayFormat=
"MM-DD"
placeholder=
"Date"
class=
"timepicker
"
></ion-datetime>
<ion-datetime
displayFormat=
"MM-DD"
placeholder=
"Date"
class=
"timepicker"
[(
ngModel
)]="
shuiCao
.
stopDate
"
></ion-datetime>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -305,4 +329,5 @@
</ion-row>
</ion-grid>
</ion-item>
</div>
</ion-content>
src/app/envCtrl/env-cfg/env-cfg.page.ts
View file @
6817aec5
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
PickerController
}
from
'@ionic/angular'
;
import
{
Api
}
from
'../../service/api'
;
import
{
Load
}
from
'../../service/load'
;
@
Component
({
selector
:
'v-env-cfg'
,
...
...
@@ -9,69 +11,112 @@ import {PickerController} from '@ionic/angular';
export
class
EnvCfgPage
implements
OnInit
{
// 工作模式
workModeSetting
=
{
'workMode'
:
'1'
,
'DeviceNo'
:
''
,
'workModeOld'
:
'1'
};
workModeSetting
=
{
'workMode'
:
'1'
,
'DeviceNo'
:
''
,
'workModeOld'
:
'1'
};
defaultColumnOptions
=
[];
fanMode
=
{
'selecting'
:
false
,
}
'selecting'
:
false
,
};
light
=
{
'selecting'
:
false
,
}
'selecting'
:
false
,
}
;
fanCfg
=
[{
'name'
:
'模式一'
,
'timeInterval'
:
25
,
'tempSet'
:
25
,
'tempOffset'
:
3
,
'ATmr'
:
20
,
'BTmr'
:
20
,
},{
'name'
:
'模式二'
,
'timeInterval'
:
25
,
'tempSet'
:
30
,
'tempOffset'
:
3
,
'ATmr'
:
20
,
'BTmr'
:
20
,
},{
'name'
:
'模式三'
,
'timeInterval'
:
25
,
'tempSet'
:
20
,
'tempOffset'
:
3
,
'ATmr'
:
20
,
'BTmr'
:
20
,
},]
lightCfg
=
[{
'name'
:
'模式一'
,
'timeInterval'
:
25
,
'startTime'
:
25
,
'endTime'
:
3
,
'onTime'
:
20
,
'offTime'
:
20
,
},{
'name'
:
'模式二'
,
'timeInterval'
:
25
,
'startTime'
:
30
,
'endTime'
:
3
,
'onTime'
:
20
,
'offTime'
:
20
,
},]
constructor
(
private
pickerController
:
PickerController
)
{
}
async
openPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
){
'name'
:
'模式一'
,
'timeInterval'
:
25
,
'tempSet'
:
25
,
'tempOffset'
:
3
,
'ATmr'
:
20
,
'BTmr'
:
20
,
},
{
'name'
:
'模式二'
,
'timeInterval'
:
25
,
'tempSet'
:
30
,
'tempOffset'
:
3
,
'ATmr'
:
20
,
'BTmr'
:
20
,
},
{
'name'
:
'模式三'
,
'timeInterval'
:
25
,
'tempSet'
:
20
,
'tempOffset'
:
3
,
'ATmr'
:
20
,
'BTmr'
:
20
,
},
];
lightCfg
=
[{
'name'
:
'模式一'
,
'timeInterval'
:
25
,
'startTime'
:
25
,
'endTime'
:
3
,
'onTime'
:
20
,
'offTime'
:
20
,
},
{
'name'
:
'模式二'
,
'timeInterval'
:
25
,
'startTime'
:
30
,
'endTime'
:
3
,
'onTime'
:
20
,
'offTime'
:
20
,
},
];
constructor
(
private
pickerController
:
PickerController
,
private
api
:
Api
,
private
load
:
Load
)
{
}
isError
=
false
;
cowshedList
=
[];
curFieldRegionNo
=
''
;
// 当前牛舍信息
curCowshed
=
{
factoryNo
:
''
,
factoryName
:
''
,
fieldRegionNo
:
''
,
fieldRegionName
:
''
,
isWisdomModel
:
0
,
propertyConfig
:
{
toft
:
''
,
hoft
:
''
},
config
:
[{
fieldDeviceType
:
''
,
controlModel
:
0
,
controlConfig
:
[{
TU
:
0
,
TL
:
0
,
id
:
''
,
name
:
''
,
T
:
0
,
A
:
0
,
B
:
0
,
intverval
:
0
,
startDate
:
''
,
stopDate
:
''
,
on
:
''
,
off
:
''
,
power
:
0
}
]
}],
leave
:
[],
back
:
[],
environmentConfigJson
:
{
TU
:
''
,
TL
:
''
,
HU
:
''
,
HL
:
''
},
heatStressList
:
[]
};
// 各设备配置信息
fengJi
=
{};
penLin
=
{};
zhaoMing
=
{};
shuiCao
=
{};
async
openPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
)
{
const
picker
=
await
this
.
pickerController
.
create
({
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
buttons
:
[
{
text
:
'Cancel'
,
role
:
'cancel'
,
handler
:
()
=>
{
handler
:
()
=>
{
this
.
fanMode
.
selecting
=
false
;
}
},
...
...
@@ -88,7 +133,7 @@ export class EnvCfgPage implements OnInit {
}
getColumns
(
numColumns
,
numOptions
,
columnOptions
)
{
le
t
columns
=
[];
cons
t
columns
=
[];
for
(
let
i
=
0
;
i
<
numColumns
;
i
++
)
{
columns
.
push
({
name
:
`col-
${
i
}
`
,
...
...
@@ -99,12 +144,12 @@ export class EnvCfgPage implements OnInit {
}
getColumnOptions
(
columnIndex
,
numOptions
,
columnOptions
)
{
le
t
options
=
[];
cons
t
options
=
[];
for
(
let
i
=
0
;
i
<
numOptions
;
i
++
)
{
options
.
push
({
text
:
columnOptions
[
columnIndex
][
i
%
numOptions
],
value
:
i
})
})
;
}
return
options
;
}
...
...
@@ -120,6 +165,32 @@ export class EnvCfgPage implements OnInit {
'5'
]
];
this
.
init
();
}
init
()
{
this
.
getData
(
0
);
}
getData
(
time
)
{
if
(
time
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
this
.
api
.
cowshedApp
.
getAllRegionData
([
''
,
(
data
)
=>
{
// 获取所有牛舍信息
if
(
data
)
{
// 牛舍列表
if
(
data
.
resultIndexDataListForAppVos
&&
data
.
resultIndexDataListForAppVos
.
constructor
===
Array
)
{
this
.
isError
=
false
;
this
.
cowshedList
=
data
.
resultIndexDataListForAppVos
;
}
else
{
this
.
api
.
presentMsgToast
(
'获取数据失败'
);
this
.
isError
=
true
;
}
}
this
.
load
.
offLoad
();
}]);
}
workModeEvent
()
{
...
...
@@ -145,14 +216,14 @@ export class EnvCfgPage implements OnInit {
// }]);
}
async
openCalendarPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
){
async
openCalendarPicker
(
numColumns
=
1
,
numOptions
=
5
,
columnOptions
=
this
.
defaultColumnOptions
)
{
const
picker
=
await
this
.
pickerController
.
create
({
columns
:
this
.
getColumns
(
numColumns
,
numOptions
,
columnOptions
),
buttons
:
[
{
text
:
'Cancel'
,
role
:
'cancel'
,
handler
:
()
=>
{
handler
:
()
=>
{
this
.
fanMode
.
selecting
=
false
;
}
},
...
...
@@ -168,22 +239,112 @@ export class EnvCfgPage implements OnInit {
await
picker
.
present
();
}
fanTempHaveFouch
(){
fanTempHaveFouch
()
{
console
.
log
(
'fanTempHaveFouch'
);
if
(
this
.
fanMode
.
selecting
===
false
)
{
if
(
this
.
fanMode
.
selecting
===
false
)
{
this
.
fanMode
.
selecting
=
true
;
this
.
openPicker
();
}
}
lightTimeHaveFouch
(){
lightTimeHaveFouch
()
{
console
.
log
(
'lightTimeHaveFouch'
);
if
(
this
.
light
.
selecting
===
false
)
{
if
(
this
.
light
.
selecting
===
false
)
{
this
.
light
.
selecting
=
true
;
this
.
openPicker
();
}
}
// 获取当前牛舍配置信息
selectCowshed
()
{
this
.
api
.
config
.
getAll
([{
'fieldRegionNo'
:
this
.
curFieldRegionNo
},
(
data
)
=>
{
if
(
data
)
{
this
.
curCowshed
=
data
;
// ----------------------------------------------------
// TODO 测试用准备数据
this
.
curCowshed
=
{
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
fieldRegionNo
:
'FRN136641006052720640'
,
fieldRegionName
:
'1号牛舍'
,
isWisdomModel
:
1
,
propertyConfig
:
{
toft
:
'1.5'
,
hoft
:
'2'
},
config
:
[
{
fieldDeviceType
:
'风机'
,
controlModel
:
0
,
controlConfig
:
[{
TU
:
28
,
TL
:
20
}],
},
{
fieldDeviceType
:
'喷淋'
,
controlModel
:
1
,
controlConfig
:
[{
id
:
'111'
,
name
:
'模式一'
,
T
:
21
,
A
:
35
,
B
:
45
,
intverval
:
55
},
{
id
:
'222'
,
name
:
'模式二'
,
T
:
21
,
A
:
35
,
B
:
45
,
intverval
:
55
}]
},
{
fieldDeviceType
:
'照明'
,
controlModel
:
1
,
controlConfig
:
[{
id
:
'111'
,
name
:
'模式A'
,
startDate
:
'10-01'
,
stopDate
:
'11-02'
,
on
:
'19:00'
,
off
:
'05:00'
},
{
id
:
'111'
,
name
:
'模式B'
,
startDate
:
'10-01'
,
stopDate
:
'11-02'
,
on
:
'19:00'
,
off
:
'05:00'
}]
},
{
fieldDeviceType
:
'水槽'
,
controlModel
:
0
,
controlConfig
:
[{
power
:
100
,
startDate
:
'10-01'
,
stopDate
:
'11-02'
}],
}
],
leave
:
[
'风机'
,
'喷淋'
,
'水槽'
],
back
:
[
'风机'
,
'喷淋'
,
'水槽'
],
environmentConfigJson
:
{
HL
:
0
,
HU
:
100
,
TL
:
-
10
,
TU
:
50
},
heatStressList
:
[
{
heatStressLevel
:
'无应激'
,
'alarmLevel'
:
'无'
,
'thi'
:
68
},
{
'heatStressLevel'
:
'轻度应激'
,
'alarmLevel'
:
'低'
,
'thi'
:
72
},
{
'heatStressLevel'
:
'中度应激'
,
'alarmLevel'
:
'中'
,
'thi'
:
80
},
{
'heatStressLevel'
:
'重度应激'
,
'alarmLevel'
:
'高'
,
'thi'
:
90
},
{
'heatStressLevel'
:
'II重度应激'
,
'alarmLevel'
:
'高'
,
'thi'
:
100
}
]
};
// ----------------------------------------------------
this
.
initConfig
();
}
else
{
this
.
api
.
presentMsgToast
(
'获取数据失败'
);
this
.
isError
=
true
;
}
this
.
load
.
offLoad
();
}]);
}
// 显示牛舍配置信息
initConfig
()
{
const
configInfo
=
this
.
curCowshed
.
config
;
if
(
configInfo
&&
configInfo
.
constructor
===
Array
)
{
configInfo
.
map
((
value
,
index
)
=>
{
if
(
'风机'
===
value
.
fieldDeviceType
)
{
this
.
fengJi
=
value
;
}
else
if
(
'喷淋'
===
value
.
fieldDeviceType
)
{
this
.
penLin
=
value
;
}
else
if
(
'照明'
===
value
.
fieldDeviceType
)
{
this
.
zhaoMing
=
value
;
}
else
if
(
'水槽'
===
value
.
fieldDeviceType
)
{
this
.
shuiCao
=
value
;
}
});
}
}
}
src/app/envCtrl/env-history/env-history.page.html
View file @
6817aec5
<ion-header>
<ion-toolbar>
<ion-title
class=
"title"
>
{{item.fieldRegionName}}历史数据
</ion-title>
<ion-toolbar
color=
"secondary"
>
<ion-buttons
slot=
"start"
>
<ion-back-button
text=
""
></ion-back-button>
</ion-buttons>
<ion-title
mode=
"ios"
class=
"title"
>
{{item.fieldRegionName}}历史数据
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content
color=
'light'
style=
"height: 100%"
>
<ion-content
color=
'light'
style=
"height: 100%; padding-top: 30px;"
>
<div
style=
"padding-top: 10px"
>
<h1
class=
"subTittle"
>
牛舍热应激状态
</h1>
<span
[
ngClass
]="{'
perfect
'
:
analResult =
==
'优','
good
'
:
analResult =
==
'良','
bad
'
:
analResult =
==
'差'}"
margin-start=
"10px;"
>
{{analResult}}
</span>
<h1
style=
"
font-size: 16px;
padding-left: 5px;
border-left: 5px solid #28c9bd;
line-height: 25px;
margin-bottom: 5px;"
>
牛舍热应激状态
</h1>
<span
[
ngClass
]="{'
perfect
'
:
analResult =
==
'优','
good
'
:
analResult =
==
'良','
bad
'
:
analResult =
==
'差'}"
>
{{analResult}}
</span>
<h1
style=
"
font-size: 16px;
padding-left: 5px;
border-left: 5px solid #28c9bd;
line-height: 25px;
margin-bottom: 5px;"
>
近8个小时环境参数曲线
</h1>
<h1
class=
"subTittle"
>
近8个小时环境参数曲线
</h1>
<div
echarts
[
options
]="
chartOption
"
class=
"demo-chart"
></div>
<h1
style=
"
font-size: 16px;
padding-left: 5px;
border-left: 5px solid #28c9bd;
line-height: 25px;
margin-bottom: 5px;"
>
近8个小时环境参数表
</h1>
<h1
class=
"subTittle"
>
近8个小时环境参数表
</h1>
<div>
<ngx-datatable
class=
'material'
[
rows
]="
rows
"
[
columnMode
]="'
force
'"
[
scrollbarH
]="
true
"[
scrollbarV
]="
true
"
style=
"white-space: nowrap;
"
>
<ngx-datatable
class=
'material'
[
rows
]="
rows
"
[
columnMode
]="'
force
'"
[
scrollbarH
]="
true
"[
scrollbarV
]="
true
"
style=
"white-space: nowrap; text-align: center
"
>
<ngx-datatable-column
name=
"时间"
prop=
"time"
width=
"100"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"热应激"
prop=
"thi"
width=
"60"
>
...
...
@@ -46,5 +34,6 @@
</ngx-datatable-column>
</ngx-datatable>
</div>
</div>
</ion-content>
src/app/envCtrl/env-history/env-history.page.scss
View file @
6817aec5
...
...
@@ -2,7 +2,7 @@
@import
'~@swimlane/ngx-datatable/release/themes/material.css'
;
@import
'~@swimlane/ngx-datatable/release/assets/icons.css'
;
.perfect
{
.perfect
{
width
:
30px
;
height
:
30px
;
background-color
:green
;
...
...
@@ -35,12 +35,22 @@
color
:white
;
}
.demo-chart
{
.demo-chart
{
width
:
100%
;
height
:
230px
;
}
.title
{
.title
{
text-align
:
center
;
padding-left
:
0px
padding-left
:
0px
;
font-weight
:
lighter
;
font-size
:
large
}
.subTittle
{
font-size
:
16px
;
padding-left
:
5px
;
border-left
:
5px
solid
#28c9bd
;
line-height
:
25px
;
margin-bottom
:
5px
;
}
src/app/envCtrl/env-history/env-history.page.ts
View file @
6817aec5
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
Api
}
from
'../../service/api'
;
import
{
Load
}
from
'../../service/load'
;
import
{
NgxDatatableModule
}
from
'@swimlane/ngx-datatable'
;
import
{
NgxDatatableModule
}
from
'@swimlane/ngx-datatable'
;
@
Component
({
selector
:
'v-env-history'
,
...
...
@@ -11,7 +11,9 @@ import { NgxDatatableModule } from '@swimlane/ngx-datatable';
})
export
class
EnvHistoryPage
implements
OnInit
{
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
)
{
}
constructor
(
private
api
:
Api
,
private
ac
:
ActivatedRoute
,
private
load
:
Load
)
{
}
item
=
{
fieldRegionNo
:
''
};
// TODO 以下为假数据 待删除
...
...
@@ -19,60 +21,33 @@ export class EnvHistoryPage implements OnInit {
chartOption
=
{
backgroundColor
:
'#F0F8FF'
,
visualMap
:
[{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
0
,
min
:
0
,
max
:
400
},
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
1
,
dimension
:
0
,
min
:
0
,
max
:
400
}],
visualMap
:
[
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
0
,
min
:
0
,
max
:
400
},
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
1
,
dimension
:
0
,
min
:
0
,
max
:
400
}],
xAxis
:
{
name
:
'时间'
,
type
:
'category'
,
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
]
name
:
''
,
type
:
'category'
,
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
],
},
yAxis
:
[{
name
:
'温度(℃)'
,
type
:
'value'
,
splitLine
:
{
show
:
false
}
},
{
name
:
'湿度(%)'
,
type
:
'value'
,
max
:
100
,
splitLine
:
{
show
:
false
}
}],
series
:
[{
data
:
[
28
,
32
,
35
,
34
,
30
,
29
,
27
],
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'
}]
yAxis
:
[
{
name
:
'温度(℃)'
,
type
:
'value'
,
splitLine
:
{
show
:
false
}},
{
name
:
'湿度(%)'
,
type
:
'value'
,
max
:
100
,
splitLine
:
{
show
:
false
}}
],
series
:
[
{
data
:
[
28
,
32
,
35
,
34
,
30
,
29
,
27
],
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'
}
]
};
// 时间 热应激 温度 湿度 光照 风机 喷淋 照明
rows
=
[
{
time
:
'17:00'
,
thi
:
'轻'
,
temp
:
'23.8'
,
humi
:
'56'
,
AA
:
'70'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'17:30'
,
thi
:
'中'
,
temp
:
'27.2'
,
humi
:
'43'
,
AA
:
'80'
,
BB
:
'55%'
,
CC
:
'X'
,
DD
:
'O'
},
{
time
:
'18:00'
,
thi
:
'轻'
,
temp
:
'23.2'
,
humi
:
'61'
,
AA
:
'99'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'18:30'
,
thi
:
'轻'
,
temp
:
'23.1'
,
humi
:
'47'
,
AA
:
'100'
,
BB
:
'55%'
,
CC
:
'X'
,
DD
:
'O'
},
{
time
:
'19:00'
,
thi
:
'轻'
,
temp
:
'20.2'
,
humi
:
'43'
,
AA
:
'60'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'19:30'
,
thi
:
'轻'
,
temp
:
'21.6'
,
humi
:
'34'
,
AA
:
'50'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'20:00'
,
thi
:
'轻'
,
temp
:
'22.5'
,
humi
:
'43'
,
AA
:
'40'
,
BB
:
'55%'
,
CC
:
'X'
,
DD
:
'O'
},
{
time
:
'17:00'
,
thi
:
'轻'
,
temp
:
'23.8'
,
humi
:
'56'
,
AA
:
'70'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'17:30'
,
thi
:
'中'
,
temp
:
'27.2'
,
humi
:
'43'
,
AA
:
'80'
,
BB
:
'55%'
,
CC
:
'X'
,
DD
:
'O'
},
{
time
:
'18:00'
,
thi
:
'轻'
,
temp
:
'23.2'
,
humi
:
'61'
,
AA
:
'99'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'18:30'
,
thi
:
'轻'
,
temp
:
'23.1'
,
humi
:
'47'
,
AA
:
'100'
,
BB
:
'55%'
,
CC
:
'X'
,
DD
:
'O'
},
{
time
:
'19:00'
,
thi
:
'轻'
,
temp
:
'20.2'
,
humi
:
'43'
,
AA
:
'60'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'19:30'
,
thi
:
'轻'
,
temp
:
'21.6'
,
humi
:
'34'
,
AA
:
'50'
,
BB
:
'55%'
,
CC
:
'O'
,
DD
:
'X'
},
{
time
:
'20:00'
,
thi
:
'轻'
,
temp
:
'22.5'
,
humi
:
'43'
,
AA
:
'40'
,
BB
:
'55%'
,
CC
:
'X'
,
DD
:
'O'
},
];
...
...
@@ -83,16 +58,17 @@ export class EnvHistoryPage implements OnInit {
this
.
getData
(
0
);
// TODO 待删除
for
(
let
i
=
0
;
i
<
8
;
i
++
)
{
this
.
chartOption
.
xAxis
.
data
=
[
'8'
,
'7'
,
'6'
,
'5'
,
'4'
,
'3'
,
'2'
,
'1'
];
}
this
.
chartOption
.
xAxis
.
data
=
[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
];
// for (let i = 0; i < 8; i++) {
// this.chartOption.xAxis.data = ['1', '2', '3', '4', '5', '6', '7', '8'];
// }
}
getData
(
time
)
{
if
(
time
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
this
.
api
.
cowshedApp
.
getRealDataByFieldRegionNo
([{
'fieldRegionNo'
:
this
.
item
.
fieldRegionNo
},
(
data
)
=>
{
this
.
api
.
cowshedApp
.
getRealDataByFieldRegionNo
([{
'fieldRegionNo'
:
this
.
item
.
fieldRegionNo
},
(
data
)
=>
{
if
(
data
)
{
this
.
item
=
data
;
...
...
src/app/envCtrl/env-home/env-home.page.html
View file @
6817aec5
...
...
@@ -3,7 +3,7 @@
<ion-buttons
slot=
"start"
>
<ion-back-button
color=
"secondary"
defaultHref=
"/index"
text=
""
></ion-back-button>
</ion-buttons>
<ion-searchbar
(
ionInput
)="
getItems
($
event
)"
(
ionClear
)="
resetItems
()"
debounce=
"1000"
></ion-searchbar>
<ion-searchbar
(
ionInput
)="
getItems
($
event
)"
(
ionClear
)="
resetItems
()"
debounce=
"1000"
style=
"height: 40px;"
></ion-searchbar>
<!--<ion-searchbar (ionInput)="getItems($event)" [(ngModel)]="searchItem"></ion-searchbar>-->
<!--<div class="topSearch">
<SearchBar [placeholder]="'点击此处进行搜索'" [(ngModel)]="searchText"
...
...
src/app/service/api.ts
View file @
6817aec5
...
...
@@ -90,6 +90,11 @@ export class Api {
controlSwitch
:
(
data
)
=>
this
.
trans
(
'post'
,
'/control/controlSwitch'
,
data
),
};
public
config
=
{
getAll
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedConfig/getAll'
,
data
),
updateCowshedConfig
:
(
data
)
=>
this
.
trans
(
'post'
,
'/cowshedConfig/updateCowshedConfig'
,
data
),
};
private
trans
(
type
,
addr
,
data
)
{
this
.
sendHttpReq
(
type
,
addr
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment