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
e2d344a5
Commit
e2d344a5
authored
Nov 14, 2019
by
yating.lin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调试
parent
de1e2867
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
341 additions
and
230 deletions
+341
-230
config.xml
config.xml
+1
-1
app-routing.module.ts
src/app/app-routing.module.ts
+12
-5
env-alarm-detail.page.html
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.html
+1
-2
env-alarm-detail.page.ts
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.ts
+118
-106
env-alarm.page.scss
src/app/envCtrl/env-alarm/env-alarm.page.scss
+12
-1
env-alarm.page.ts
src/app/envCtrl/env-alarm/env-alarm.page.ts
+46
-45
env-cfg.page.html
src/app/envCtrl/env-cfg/env-cfg.page.html
+16
-16
env-cfg.page.ts
src/app/envCtrl/env-cfg/env-cfg.page.ts
+29
-8
env-detail.page.html
src/app/envCtrl/env-detail/env-detail.page.html
+26
-8
env-detail.page.scss
src/app/envCtrl/env-detail/env-detail.page.scss
+2
-2
env-detail.page.ts
src/app/envCtrl/env-detail/env-detail.page.ts
+36
-19
env-fan.page.ts
src/app/envCtrl/env-fan/env-fan.page.ts
+5
-3
env-home.page.html
src/app/envCtrl/env-home/env-home.page.html
+1
-1
env-light.page.ts
src/app/envCtrl/env-light/env-light.page.ts
+13
-0
env-shower.page.scss
src/app/envCtrl/env-shower/env-shower.page.scss
+1
-1
env-shower.page.ts
src/app/envCtrl/env-shower/env-shower.page.ts
+2
-0
env-waterchannel.page.scss
src/app/envCtrl/env-waterchannel/env-waterchannel.page.scss
+1
-1
env-waterchannel.page.ts
src/app/envCtrl/env-waterchannel/env-waterchannel.page.ts
+7
-0
tabs.module.ts
src/app/envCtrl/tabs/tabs.module.ts
+1
-1
tabs.page.ts
src/app/envCtrl/tabs/tabs.page.ts
+5
-5
environment.prod.ts
src/environments/environment.prod.ts
+5
-3
environment.ts
src/environments/environment.ts
+0
-1
global.scss
src/global.scss
+1
-1
No files found.
config.xml
View file @
e2d344a5
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"com.witium.muchang.test"
version=
"2.9.
1
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"com.witium.muchang.test"
version=
"2.9.
2
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
牧场云
</name>
<description>
test
</description>
<author
email=
"frank.feng@witium.com"
href=
"http://muchang.witium.com/"
>
Van.chen - frank.feng
</author>
...
...
src/app/app-routing.module.ts
View file @
e2d344a5
...
...
@@ -56,12 +56,19 @@ const routes: Routes = [
{
path
:
'env-detail'
,
component
:
EnvDetailPage
,
children
:
[
{
path
:
'fan'
,
component
:
EnvFanPage
},
{
path
:
'shower/:fieldRegionNo'
,
component
:
EnvShowerPage
},
{
path
:
'light/:fieldRegionNo'
,
component
:
EnvLightPage
},
{
path
:
'waterchannel/:fieldRegionNo'
,
component
:
EnvWaterchannelPage
},
{
path
:
''
,
redirectTo
:
'fan'
,
pathMatch
:
'prefix'
},
{
path
:
'
tab-
fan'
,
component
:
EnvFanPage
},
{
path
:
'
tab-
shower/:fieldRegionNo'
,
component
:
EnvShowerPage
},
{
path
:
'
tab-
light/:fieldRegionNo'
,
component
:
EnvLightPage
},
{
path
:
'
tab-
waterchannel/:fieldRegionNo'
,
component
:
EnvWaterchannelPage
},
{
path
:
''
,
redirectTo
:
'
tab-
fan'
,
pathMatch
:
'prefix'
},
]
// children: [
// {path: 'tab-fan', component: EnvFanPage},
// {path: 'tab-shower', component: EnvShowerPage},
// {path: 'tab-light', component: EnvLightPage},
// {path: 'tab-waterchannel', component: EnvWaterchannelPage},
// {path: '', redirectTo: 'tab-fan', pathMatch : 'prefix'},
// ]
},
// { path: 'env-detail', loadChildren: './envCtrl/env-detail/env-detail.module#EnvDetailPageModule' },
...
...
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.html
View file @
e2d344a5
...
...
@@ -57,10 +57,9 @@
</div>
</ion-item>
<div
style=
"padding:5px;"
>
<div
class=
"detailContent"
>
<div
class=
"timeline"
>
<div
class=
"timeline"
*
ngIf=
"detailInfo.trouble"
>
<div
class=
"entry"
*
ngFor=
"let item of detailInfo.trouble"
>
<div
class=
"title"
>
<div><img
[
src
]="'../../
assets
/
img
/'
+
item
.
fieldDeviceType
+
'.
png
'"
class=
"deviceIcon"
></div>
...
...
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.ts
View file @
e2d344a5
This diff is collapsed.
Click to expand it.
src/app/envCtrl/env-alarm/env-alarm.page.scss
View file @
e2d344a5
...
...
@@ -67,7 +67,7 @@
}
.alarmNum
{
border-radius
:
1
0
px
;
border-radius
:
1
7
px
;
background-color
:
#d33939
;
display
:
inline-block
;
vertical-align
:
middle
;
...
...
@@ -76,6 +76,17 @@
color
:
white
;
margin-left
:
10px
;
font-size
:
12px
;
width
:
16px
;
height
:
16px
;
text-align
:
center
;
//width: 17px;
//height: 17px;
//border-radius: 17px;
//background-color: #28c9bd;
//display: inline-block;
//vertical-align: middle;
//box-shadow: #ccc 0.5px 0.5px 3px;
}
.label
{
...
...
src/app/envCtrl/env-alarm/env-alarm.page.ts
View file @
e2d344a5
...
...
@@ -11,47 +11,49 @@ import {Load} from '../../service/load';
})
export
class
EnvAlarmPage
implements
OnInit
{
alarmItems
=
[{
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
fieldRegionNo
:
'FRN110268534764224511'
,
fieldRegionName
:
'1号牛舍'
,
devErr
:
36
,
devErrTotal
:
55
,
alarm
:
20
,
alarmTotal
:
55
,
total
:
56
},
{
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
fieldRegionNo
:
'FRN110268534764224512'
,
fieldRegionName
:
'2号牛舍'
,
devErr
:
36
,
devErrTotal
:
55
,
alarm
:
20
,
alarmTotal
:
55
,
total
:
56
},
{
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
fieldRegionNo
:
'FRN110268534764224513'
,
fieldRegionName
:
'3号牛舍'
,
devErr
:
36
,
devErrTotal
:
55
,
alarm
:
20
,
alarmTotal
:
55
,
total
:
56
},
{
factoryNo
:
'FN108050436279648256'
,
factoryName
:
'一厂'
,
fieldRegionNo
:
'FRN110268534764224514'
,
fieldRegionName
:
'4号牛舍'
,
devErr
:
36
,
devErrTotal
:
55
,
alarm
:
20
,
alarmTotal
:
55
,
total
:
56
}];
alarmItems
=
[];
// TODO 测试用数据
// alarmItems = [{
// factoryNo: 'FN108050436279648256',
// factoryName: '一厂',
// fieldRegionNo: 'FRN110268534764224511',
// fieldRegionName: '1号牛舍',
// devErr: 36,
// devErrTotal: 55,
// alarm: 20,
// alarmTotal: 55,
// total: 56
// }, {
// factoryNo: 'FN108050436279648256',
// factoryName: '一厂',
// fieldRegionNo: 'FRN110268534764224512',
// fieldRegionName: '2号牛舍',
// devErr: 36,
// devErrTotal: 55,
// alarm: 20,
// alarmTotal: 55,
// total: 56
// }, {
// factoryNo: 'FN108050436279648256',
// factoryName: '一厂',
// fieldRegionNo: 'FRN110268534764224513',
// fieldRegionName: '3号牛舍',
// devErr: 36,
// devErrTotal: 55,
// alarm: 20,
// alarmTotal: 55,
// total: 56
// }, {
// factoryNo: 'FN108050436279648256',
// factoryName: '一厂',
// fieldRegionNo: 'FRN110268534764224514',
// fieldRegionName: '4号牛舍',
// devErr: 36,
// devErrTotal: 55,
// alarm: 20,
// alarmTotal: 55,
// total: 56
// }];
curFieldRegion
=
{
factoryNo
:
''
,
factoryName
:
''
,
...
...
@@ -151,12 +153,11 @@ export class EnvAlarmPage implements OnInit {
dismissPopover
(
interval
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
const
condition
=
{
fieldRegionNo
:
this
.
curFieldRegion
.
fieldRegionNo
,
startTime
:
this
.
getStartTime
(
interval
),
const
condition
=
{
fieldRegionNo
:
this
.
curFieldRegion
.
fieldRegionNo
,
startTime
:
this
.
getStartTime
(
interval
).
valueOf
(),
stopTime
:
new
Date
().
valueOf
()
};
console
.
log
(
condition
.
startTime
);
console
.
log
(
condition
.
stopTime
);
this
.
api
.
alert
.
getByTerm
([
condition
,
(
data
)
=>
{
if
(
data
&&
data
.
fieldRegionNo
)
{
...
...
src/app/envCtrl/env-cfg/env-cfg.page.html
View file @
e2d344a5
...
...
@@ -48,13 +48,13 @@
<div
*
ngIf=
"fan"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
style=
"width: 40%"
>
风机模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
fan
.
controlModel
"
>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
fan
.
controlModel
"
(
ionChange
)="
workModeChange
('
fan
')"
>
<ion-select-option
*
ngFor=
"let option of controlModelOptions"
[
value
]="
option
.
modelId
"
>
{{option.modelValue}}
</ion-select-option>
</ion-select>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenFan"
(
click
)="
openItem
('
fanCfg
')"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenFan"
(
click
)="
openItem
('
fanCfg
')"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenFan
&& isFanDisplay
"
(
click
)="
openItem
('
fanCfg
')"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenFan
&& isFanDisplay
"
(
click
)="
openItem
('
fanCfg
')"
></ion-icon>
</ion-item-divider>
<div
*
ngIf=
"isOpenFan"
@
shrink
>
<div
*
ngIf=
"isOpenFan
&& isFanDisplay
"
@
shrink
>
<ion-item
class=
"fanItem"
lines=
"none"
>
<ion-grid>
<ion-row>
...
...
@@ -85,13 +85,13 @@
<div
*
ngIf=
"shower"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
style=
"width: 40%"
>
喷淋模式配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
shower
.
controlModel
"
>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
shower
.
controlModel
"
(
ionChange
)="
workModeChange
('
shower
')"
>
<ion-select-option
*
ngFor=
"let option of controlModelOptions"
[
value
]="
option
.
modelId
"
>
{{option.modelValue}}
</ion-select-option>
</ion-select>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenShower"
(
click
)="
openItem
('
showerCfg
')"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenShower"
(
click
)="
openItem
('
showerCfg
')"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenShower
&& isShowerDisplay
"
(
click
)="
openItem
('
showerCfg
')"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenShower
&& isShowerDisplay
"
(
click
)="
openItem
('
showerCfg
')"
></ion-icon>
</ion-item-divider>
<div
*
ngIf=
"isOpenShower"
@
shrink
>
<div
*
ngIf=
"isOpenShower
&& isShowerDisplay
"
@
shrink
>
<ion-item-sliding
*
ngFor=
"let allCfg of shower.controlConfig"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
...
...
@@ -154,13 +154,13 @@
<div
*
ngIf=
"light"
>
<ion-item-divider
sticky=
"true"
class=
"itemDriver subTitle"
>
<ion-label
style=
"width: 40%"
>
照明配置
</ion-label>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
light
.
controlModel
"
>
<ion-select
multiple=
"false"
cancelText=
"取消"
okText=
"确认"
class=
"selectFont"
[(
ngModel
)]="
light
.
controlModel
"
(
ionChange
)="
workModeChange
('
light
')"
>
<ion-select-option
*
ngFor=
"let option of controlModelOptions"
[
value
]="
option
.
modelId
"
>
{{option.modelValue}}
</ion-select-option>
</ion-select>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenLight"
(
click
)="
openItem
('
lightCfg
')"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenLight"
(
click
)="
openItem
('
lightCfg
')"
></ion-icon>
<ion-icon
name=
"add"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"!isOpenLight
&& isLightDisplay
"
(
click
)="
openItem
('
lightCfg
')"
></ion-icon>
<ion-icon
name=
"remove"
slot=
"end"
class=
"iconOpen"
*
ngIf=
"isOpenLight
&& isLightDisplay
"
(
click
)="
openItem
('
lightCfg
')"
></ion-icon>
</ion-item-divider>
<div
*
ngIf=
"isOpenLight"
@
shrink
>
<div
*
ngIf=
"isOpenLight
&& isLightDisplay
"
@
shrink
>
<ion-item-sliding
*
ngFor=
"let allCfg of light.controlConfig"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
...
...
@@ -303,19 +303,19 @@
<tr
style=
"height: 30px"
>
<th>
温度
</th>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TU
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
class=
"tdBorder"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TL
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-right: 1px solid"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
TL
"
(
ionFocus
)="
tempHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-right: 1px solid
lightgray;
"
></ion-input></td>
<td>
℃
</td>
</tr>
<tr
style=
"height: 30px"
>
<th>
湿度
</th>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HU
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HL
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-right: 1px solid"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
HL
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-right: 1px solid
lightgray;
"
></ion-input></td>
<td>
% rH
</td>
</tr>
<tr
style=
"height: 30px"
>
<th>
氨气
</th>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
NH3U
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-bottom: 1px solid"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
NH3L
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-right: 1px solid
; border-bottom: 1px solid
"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
NH3U
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-bottom: 1px solid
lightgray;
"
></ion-input></td>
<td><ion-input
[(
ngModel
)]="
curCowshed
.
environmentConfigJson
.
NH3L
"
(
ionFocus
)="
humHaveTouch
($
event
)"
class=
"tdBorder"
style=
"border-right: 1px solid
lightgray; border-bottom: 1px solid lightgray;
"
></ion-input></td>
<td>
ppm
</td>
</tr>
...
...
src/app/envCtrl/env-cfg/env-cfg.page.ts
View file @
e2d344a5
...
...
@@ -67,6 +67,9 @@ export class EnvCfgPage implements OnInit {
isOpenInHouse
=
false
;
isOpenEnvironment
=
false
;
isOpenHeatStress
=
false
;
isLightDisplay
=
false
;
isShowerDisplay
=
false
;
isFanDisplay
=
false
;
private
$ionicPopup
:
any
;
...
...
@@ -144,6 +147,7 @@ export class EnvCfgPage implements OnInit {
init
()
{
this
.
getData
(
0
);
// 替换模式 添加模式返回时
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
if
(
data
)
{
if
(
data
.
addModelCfg
)
{
...
...
@@ -319,6 +323,7 @@ export class EnvCfgPage implements OnInit {
// };
// END----------------------------------------------------
if
(
data
)
{
data
.
environmentConfigJson
=
JSON
.
parse
(
data
.
environmentConfigJson
.
toString
());
this
.
curCowshed
=
data
;
this
.
curCowshed
.
isWisdomModelChecked
=
this
.
curCowshed
.
isWisdomModel
?
true
:
false
;
this
.
initConfig
();
...
...
@@ -331,7 +336,9 @@ export class EnvCfgPage implements OnInit {
}
// 显示牛舍配置信息
// 控制模式为[手控]时,模式框非表示
initConfig
()
{
const
configInfo
=
this
.
curCowshed
.
config
;
// 各设备配置情报
if
(
configInfo
&&
configInfo
.
constructor
===
Array
)
{
...
...
@@ -339,6 +346,8 @@ export class EnvCfgPage implements OnInit {
switch
(
value
.
fieldDeviceType
)
{
case
'风机'
:
this
.
fan
=
value
;
this
.
isFanDisplay
=
this
.
fan
.
controlModel
===
0
?
false
:
true
;
break
;
case
'喷淋'
:
const
showerConfig
=
JSON
.
parse
(
value
.
controlConfig
);
...
...
@@ -346,6 +355,8 @@ export class EnvCfgPage implements OnInit {
this
.
shower
.
controlModel
=
value
.
controlModel
;
this
.
shower
.
dataConfig
=
value
.
dataConfig
;
this
.
shower
.
controlConfig
=
showerConfig
;
this
.
isShowerDisplay
=
this
.
shower
.
controlModel
===
0
?
false
:
true
;
break
;
case
'照明'
:
const
lightConfig
=
JSON
.
parse
(
value
.
controlConfig
);
...
...
@@ -353,6 +364,8 @@ export class EnvCfgPage implements OnInit {
this
.
light
.
controlModel
=
value
.
controlModel
;
this
.
light
.
dataConfig
=
value
.
dataConfig
;
this
.
light
.
controlConfig
=
lightConfig
;
this
.
isLightDisplay
=
this
.
light
.
controlModel
===
0
?
false
:
true
;
break
;
case
'水槽'
:
const
waterChannelConfig
=
JSON
.
parse
(
value
.
controlConfig
);
...
...
@@ -366,14 +379,22 @@ export class EnvCfgPage implements OnInit {
}
});
}
// 环境预警参数
// if (this.curCowshed.environmentConfigJson) {
// const temperatureCfg = {tittle: '温度', top: this.curCowshed.environmentConfigJson.TU,
// lower : this.curCowshed.environmentConfigJson.TL, symbol: '℃'};
// const humidityCfg = {tittle: '湿度', top: this.curCowshed.environmentConfigJson.HU,
// lower : this.curCowshed.environmentConfigJson.HL, symbol: '%'};
// this.environmentConfig.push(temperatureCfg, humidityCfg);
// }
}
workModeChange
(
device
)
{
switch
(
device
)
{
case
'fan'
:
this
.
isFanDisplay
=
this
.
fan
.
controlModel
===
0
?
false
:
true
;
break
;
case
'shower'
:
this
.
isShowerDisplay
=
this
.
shower
.
controlModel
===
0
?
false
:
true
;
break
;
case
'light'
:
this
.
isLightDisplay
=
this
.
light
.
controlModel
===
0
?
false
:
true
;
break
;
default
:
break
;
}
}
toggle
(
isWisdomModelChecked
)
{
...
...
src/app/envCtrl/env-detail/env-detail.page.html
View file @
e2d344a5
...
...
@@ -19,30 +19,48 @@
<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
.
heatStressLevelName
"
iconClass=
"vo v-nav-ico"
[
iconColor
]="
item
.
heatStressColor
"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"在舍状态"
[
inData
]="
i
tem
.
inHouse
.
inHouse =
==
1
?
'在舍'
:
'离舍'
"
iconClass=
"vo v-dapeng-"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
<v-kanban
class=
"home-bar"
name=
"在舍状态"
[
inData
]="
i
nHouseName
"
iconClass=
"vo v-dapeng-"
iconColor=
"#285B90"
iconSize=
"20px"
fontSize=
"14px"
></v-kanban>
</div>
<div
class=
"inHouse"
>
<div
class=
"inHouse
Div
"
>
<ion-label
class=
"inHouseLabel"
>
在离舍开关控制
</ion-label>
<ion-toggle
[(
ngModel
)]="
i
tem
.
inHouse
.
inHouse
"
(
click
)="
inHouseControl
(
item
.
inHous
e
)"
></ion-toggle>
<ion-toggle
[(
ngModel
)]="
i
nHouseState
"
[
checked
]="
inHouseState
"
(
click
)="
inHouseControl
(
inHouseStat
e
)"
></ion-toggle>
<!--<v-switch (click)="inHouseControl(item.inHouse)" [value]="item.inHouse.inHouse" [loading]="loading"></v-switch>-->
</div>
</ion-header>
<ion-content
style=
"background-color: #F3F4F4;"
>
<
!--<ion-router-outlet></ion-router-outlet>--
>
<
ion-router-outlet></ion-router-outlet
>
<ion-tabs>
<ion-tab-bar
slot=
"top"
>
<ion-tab-button
tab=
"
fan"
class=
"tabSelected"
>
<ion-tab-button
tab=
"
tab-fan"
class=
"tabSelected"
>
<ion-label>
风机
</ion-label>
</ion-tab-button>
<ion-tab-button
tab=
"shower"
class=
"tabSelected"
[
routerLink
]="
showerLink
"
>
<!--[rootParams]="fieldRegionNo"-->
<ion-tab-button
tab=
"
tab-
shower"
class=
"tabSelected"
[
routerLink
]="
showerLink
"
>
<!--[rootParams]="fieldRegionNo"-->
<ion-label>
喷淋
</ion-label>
</ion-tab-button>
<ion-tab-button
tab=
"light"
class=
"tabSelected"
[
routerLink
]="
lightLink
"
>
<ion-tab-button
tab=
"
tab-
light"
class=
"tabSelected"
[
routerLink
]="
lightLink
"
>
<ion-label>
照明
</ion-label>
</ion-tab-button>
<ion-tab-button
tab=
"waterchannel"
class=
"tabSelected"
[
routerLink
]="
waterchannelLink
"
>
<ion-tab-button
tab=
"
tab-
waterchannel"
class=
"tabSelected"
[
routerLink
]="
waterchannelLink
"
>
<ion-label>
水槽
</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
<!--<ion-tabs>-->
<!--<ion-tab-bar slot="top">-->
<!--<ion-tab-button tab="tab-fan" class="tabSelected">-->
<!--<ion-label>风机</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="tab-shower" class="tabSelected"> <!–[href]="showerLink" target="_self"–>-->
<!--<ion-label>喷淋</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="tab-light" class="tabSelected"> <!– [href]="lightLink" target="_self" –>-->
<!--<ion-label>照明</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="tab-waterchannel" class="tabSelected"> <!– [href]="waterchannelLink" target="_self" –>-->
<!--<ion-label>水槽</ion-label>-->
<!--</ion-tab-button>-->
<!--</ion-tab-bar>-->
<!--</ion-tabs>-->
</ion-content>
src/app/envCtrl/env-detail/env-detail.page.scss
View file @
e2d344a5
...
...
@@ -61,9 +61,9 @@
// --background: #62C7CC;
}
.inHouse
{
.inHouse
Div
{
background-color
:
rgb
(
240
,
240
,
240
);
height
:
35
px
;
height
:
40
px
;
padding-right
:
10px
;
padding
:
5px
;
text-align
:
right
;
...
...
src/app/envCtrl/env-detail/env-detail.page.ts
View file @
e2d344a5
...
...
@@ -33,13 +33,16 @@ export class EnvDetailPage implements OnInit {
isWisdomModel
:
1
,
alarm
:
1
,
inHouse
:
{
inHouse
:
1
,
inHouse
:
0
,
inHouseState
:
false
,
inHouseName
:
'离舍'
,
fieldDeviceNo
:
''
,
fieldDeviceType
:
''
,
},
ts
:
0
};
inHouseName
=
'离舍'
;
inHouseState
=
false
;
fieldRegionNo
=
''
;
loading
=
false
;
...
...
@@ -50,7 +53,7 @@ export class EnvDetailPage implements OnInit {
isLoading
:
true
};
// fan = '/env-detail/fan
';
fanLink
=
'
'
;
showerLink
=
''
;
lightLink
=
''
;
waterchannelLink
=
''
;
...
...
@@ -59,6 +62,12 @@ export class EnvDetailPage implements OnInit {
this
.
init
();
}
// ionic的生命周期函数
// ionViewWillEnter() {
// console.log('ionViewWillEnter');
// this.init();
// }
init
()
{
this
.
comm
.
isLoading
=
false
;
this
.
comm
.
remain
=
0
;
...
...
@@ -68,18 +77,6 @@ export class EnvDetailPage implements OnInit {
});
}
initLayout
()
{
this
.
showerLink
=
'/env-detail/shower/'
+
this
.
fieldRegionNo
;
this
.
lightLink
=
'/env-detail/light/'
+
this
.
fieldRegionNo
;
this
.
waterchannelLink
=
'/env-detail/waterchannel/'
+
this
.
fieldRegionNo
;
if
(
this
.
item
)
{
this
.
item
.
heatStressColor
=
this
.
item
.
heatStressLevel
===
0
?
'#71fa1d'
:
this
.
item
.
heatStressLevel
===
1
?
'#71fa1d'
:
this
.
item
.
heatStressLevel
===
2
?
'#FAB139'
:
this
.
item
.
heatStressLevel
===
3
?
'#ff6a1f'
:
'#b22222'
;
}
}
getData
(
time
)
{
if
(
time
)
{
this
.
load
.
toLoad
(
'加载中...'
,
false
);
...
...
@@ -89,6 +86,9 @@ export class EnvDetailPage implements OnInit {
this
.
item
=
data
;
this
.
item
.
heatStressLevelName
=
this
.
getHeatStressLevelName
(
data
.
heatStressLevel
);
this
.
item
.
inHouse
.
inHouseName
=
this
.
getInHouseState
(
data
.
inHouse
.
inHouse
);
this
.
item
.
inHouse
.
inHouseState
=
data
.
inHouse
.
inHouse
===
1
?
true
:
false
;
this
.
inHouseName
=
this
.
getInHouseState
(
data
.
inHouse
.
inHouse
);
this
.
inHouseState
=
data
.
inHouse
.
inHouse
===
1
?
true
:
false
;
this
.
initLayout
();
}
}]);
...
...
@@ -118,6 +118,23 @@ export class EnvDetailPage implements OnInit {
// END----------------------------------------------
}
initLayout
()
{
// this.showerLink = '/env-detail/shower/' + this.fieldRegionNo;
// this.lightLink = '/env-detail/light/' + this.fieldRegionNo;
// this.waterchannelLink = '/env-detail/waterchannel/' + this.fieldRegionNo;
this
.
fanLink
=
'/env-detail/tab-fan/'
;
this
.
showerLink
=
'/env-detail/tab-shower/'
+
this
.
fieldRegionNo
;
this
.
lightLink
=
'/env-detail/tab-light/'
+
this
.
fieldRegionNo
;
this
.
waterchannelLink
=
'/env-detail/tab-waterchannel/'
+
this
.
fieldRegionNo
;
if
(
this
.
item
)
{
this
.
item
.
heatStressColor
=
this
.
item
.
heatStressLevel
===
0
?
'#71fa1d'
:
this
.
item
.
heatStressLevel
===
1
?
'#71fa1d'
:
this
.
item
.
heatStressLevel
===
2
?
'#FAB139'
:
this
.
item
.
heatStressLevel
===
3
?
'#ff6a1f'
:
'#b22222'
;
}
}
getHeatStressLevelName
(
level
)
{
let
levelName
=
''
;
switch
(
level
)
{
...
...
@@ -159,12 +176,12 @@ export class EnvDetailPage implements OnInit {
}
// 在离舍开关控制
inHouseControl
(
inHouse
)
{
if
(
inHouse
.
fieldDeviceNo
!==
null
&&
inHouse
.
fieldDeviceNo
!==
''
)
{
inHouseControl
(
inHouse
State
)
{
if
(
this
.
item
.
inHouse
.
fieldDeviceNo
!==
null
&&
this
.
item
.
inHouse
.
fieldDeviceNo
!==
''
)
{
const
opt
=
{
fieldDeviceNo
:
''
,
fieldDeviceType
:
''
,
op
:
0
,
ts
:
0
};
opt
.
fieldDeviceNo
=
inHouse
.
fieldDeviceNo
;
opt
.
fieldDeviceType
=
inHouse
.
fieldDeviceType
;
opt
.
op
=
inHouse
.
inHous
e
?
1
:
0
;
opt
.
fieldDeviceNo
=
this
.
item
.
inHouse
.
fieldDeviceNo
;
opt
.
fieldDeviceType
=
this
.
item
.
inHouse
.
fieldDeviceType
;
opt
.
op
=
inHouse
Stat
e
?
1
:
0
;
opt
.
ts
=
new
Date
().
valueOf
();
this
.
comm
.
remain
=
20
;
...
...
src/app/envCtrl/env-fan/env-fan.page.ts
View file @
e2d344a5
...
...
@@ -67,6 +67,7 @@ export class EnvFanPage implements OnInit {
this
.
initButtons
();
}
this
.
load
.
offLoad
();
}]);
// START--------------------------------------------------------------------
...
...
@@ -158,7 +159,7 @@ export class EnvFanPage implements OnInit {
// });
// }
this
.
api
.
presentMsgToast
(
data
.
message
);
this
.
getData
(
0
);
this
.
getData
(
1
);
this
.
comm
.
remain
=
0
;
btn
.
load
=
false
;
}]);
...
...
@@ -182,12 +183,13 @@ export class EnvFanPage implements OnInit {
this
.
comm
.
remain
=
20
;
this
.
api
.
control
.
controlCowedSwitch
([
req
,
(
data
)
=>
{
// if (data && data.code === 1) {
// this.getData(
0
);
// this.getData(
1
);
// this.api.presentMsgToast(data.message);
// } else {
// this.getData(0);
// this.api.presentMsgToast(data.message);
// }
this
.
getData
(
0
);
this
.
getData
(
1
);
this
.
api
.
presentMsgToast
(
data
.
message
);
this
.
comm
.
remain
=
0
;
// btn.load = false;
...
...
src/app/envCtrl/env-home/env-home.page.html
View file @
e2d344a5
...
...
@@ -47,7 +47,7 @@
<div
class=
"content"
>
<span
*
ngIf=
"item.temp !== null"
class=
"detailInfo"
style=
"width: 40%"
>
温度:
{{item.temp}} ℃
</span>
<span
*
ngIf=
"item.humi !== null"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
{{item.humi}} % rH
</span>
<span
*
ngIf=
"item.
humi
!== null"
class=
"detailInfo"
style=
"width: 40%"
>
氨气:
{{item.NH3}} ppm
</span>
<span
*
ngIf=
"item.
NH3
!== null"
class=
"detailInfo"
style=
"width: 40%"
>
氨气:
{{item.NH3}} ppm
</span>
<span
*
ngIf=
"item.heatStressLevel !== null"
class=
"detailInfo"
style=
"width: 40%"
>
热应激:
<span
class=
"warmColor{{item.heatStressLevel}}"
>
{{item.heatStressLevelName}}
</span></span>
</div>
<div
class=
"bottom"
>
...
...
src/app/envCtrl/env-light/env-light.page.ts
View file @
e2d344a5
...
...
@@ -49,6 +49,18 @@ export class EnvLightPage implements OnInit {
}
ngOnInit
()
{
// this.route.paramMap.subscribe(params => {
// this.fieldRegionNo = params.get('fieldRegionNo');
// });
// this.getData(0);
}
ionViewWillEnter
()
{
console
.
log
(
'ionViewWillEnter_shower'
);
this
.
init
();
}
init
()
{
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
});
...
...
@@ -93,6 +105,7 @@ export class EnvLightPage implements OnInit {
this
.
initButtons
();
}
this
.
load
.
offLoad
();
}]);
}
...
...
src/app/envCtrl/env-shower/env-shower.page.scss
View file @
e2d344a5
...
...
@@ -24,7 +24,7 @@
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#2
ecc71
;
background-color
:
#2
8c9bd
;
display
:
inline-block
;
vertical-align
:
middle
;
box-shadow
:
#ccc
0
.5px
0
.5px
3px
;
...
...
src/app/envCtrl/env-shower/env-shower.page.ts
View file @
e2d344a5
...
...
@@ -52,6 +52,7 @@ export class EnvShowerPage implements OnInit {
}
ionViewWillEnter
()
{
console
.
log
(
'ionViewWillEnter_shower'
);
this
.
init
();
}
init
()
{
...
...
@@ -78,6 +79,7 @@ export class EnvShowerPage implements OnInit {
});
this
.
initButtons
();
}
this
.
load
.
offLoad
();
}]);
}
...
...
src/app/envCtrl/env-waterchannel/env-waterchannel.page.scss
View file @
e2d344a5
...
...
@@ -25,7 +25,7 @@
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#2
ecc71
;
background-color
:
#2
8c9bd
;
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 @
e2d344a5
...
...
@@ -29,6 +29,12 @@ export class EnvWaterchannelPage implements OnInit {
this
.
init
();
}
// ionic的生命周期函数
ionViewWillEnter
()
{
console
.
log
(
'ionViewWillEnter_waterChannel'
);
this
.
init
();
}
init
()
{
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
...
...
@@ -44,6 +50,7 @@ export class EnvWaterchannelPage implements OnInit {
if
(
data
)
{
this
.
devices
=
data
.
param
;
}
this
.
load
.
offLoad
();
}]);
}
...
...
src/app/envCtrl/tabs/tabs.module.ts
View file @
e2d344a5
...
...
@@ -65,7 +65,7 @@ const routes: Routes = [
EnvAnalPage
,
EnvAlarmPage
,
EnvCfgPage
,
//EnvDetailPage,
//
EnvDetailPage,
// EnvFanPage,
// EnvShowerPage,
// EnvLightPage,
...
...
src/app/envCtrl/tabs/tabs.page.ts
View file @
e2d344a5
...
...
@@ -25,12 +25,12 @@ export class TabsPage implements OnInit {
// });
this
.
totalAlert
=
0
;
this
.
api
.
alert
.
getAll
([
'{"fieldRegionType":"牛舍"}'
,
(
data
)
=>
{
if
(
data
.
total
>
0
)
{
this
.
api
.
alert
.
getAll
([
{
fieldRegionType
:
'牛舍'
},
(
data
)
=>
{
if
(
data
.
total
>
0
)
{
this
.
totalAlert
=
0
;
le
t
rows
=
data
.
rows
;
if
(
rows
.
constructor
===
Array
)
{
rows
.
map
((
value
,
index
)
=>
{
cons
t
rows
=
data
.
rows
;
if
(
rows
.
constructor
===
Array
)
{
rows
.
map
((
value
,
index
)
=>
{
this
.
totalAlert
=
this
.
totalAlert
+
value
.
devErr
+
value
.
alarm
;
});
}
...
...
src/environments/environment.prod.ts
View file @
e2d344a5
export
const
environment
=
{
production
:
true
,
url
:
'http://pasture.witium.com/api'
,
// 对外访问测试网地址
// url: 'http://172.16.1.13:8096', // 测试
mqttUrl
:
'120.27.235.39'
// url: 'http://pasture.witium.com/api', // 对外访问测试网地址
// mqttUrl: '120.27.235.39'
url
:
'http://172.16.1.52:8096'
,
mqttUrl
:
'172.16.1.24'
,
};
src/environments/environment.ts
View file @
e2d344a5
...
...
@@ -22,7 +22,6 @@ export const environment = {
// mqttUrl: '120.27.235.39'
// mqttUrl: '120.27.235.31'
// url: 'http://pasture.witium.com.cn/api', // 对外访问测试网地址
// mqttUrl: '172.16.1.24:48083',
};
...
...
src/global.scss
View file @
e2d344a5
...
...
@@ -73,7 +73,7 @@ ol, ul {
width
:
17px
;
height
:
17px
;
border-radius
:
17px
;
background-color
:
#2
ecc71
;
background-color
:
#2
8c9bd
;
display
:
inline-block
;
vertical-align
:
middle
;
box-shadow
:
#ccc
0
.5px
0
.5px
3px
;
...
...
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