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
b1f15e75
Commit
b1f15e75
authored
Nov 15, 2019
by
yating.lin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调试
parent
6bcbbc68
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
128 additions
and
75 deletions
+128
-75
package.json
package.json
+1
-1
app-routing.module.ts
src/app/app-routing.module.ts
+19
-10
kanban.component.html
src/app/components/kanban/kanban.component.html
+1
-0
kanban.component.ts
src/app/components/kanban/kanban.component.ts
+3
-0
env-detail.page.html
src/app/envCtrl/env-detail/env-detail.page.html
+12
-12
env-detail.page.ts
src/app/envCtrl/env-detail/env-detail.page.ts
+8
-32
env-history.page.html
src/app/envCtrl/env-history/env-history.page.html
+31
-6
env-history.page.ts
src/app/envCtrl/env-history/env-history.page.ts
+50
-11
env-light.page.ts
src/app/envCtrl/env-light/env-light.page.ts
+2
-2
constants.ts
src/app/service/constants.ts
+1
-1
No files found.
package.json
View file @
b1f15e75
...
...
@@ -102,4 +102,4 @@
"ios"
]
}
}
}
\ No newline at end of file
src/app/app-routing.module.ts
View file @
b1f15e75
...
...
@@ -56,18 +56,27 @@ const routes: Routes = [
{
path
:
'env-detail'
,
component
:
EnvDetailPage
,
children
:
[
{
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'
},
{
path
:
'fan'
,
component
:
EnvFanPage
},
{
path
:
'shower/:fieldRegionNo'
,
component
:
EnvShowerPage
},
{
path
:
'light/:fieldRegionNo'
,
component
:
EnvLightPage
},
{
path
:
'waterchannel/:fieldRegionNo'
,
component
:
EnvWaterchannelPage
},
{
path
:
''
,
redirectTo
:
'fan'
,
pathMatch
:
'prefix'
},
]
// children: [
// {path: 'fan', component: EnvFanPage},
// {path: 'shower', component: EnvShowerPage},
// {path: 'light', component: EnvLightPage},
// {path: 'waterchannel', component: EnvWaterchannelPage},
// {path: '', redirectTo: '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: '
fan', loadChildren: './envCtrl/env-fan/env-fan.module#EnvFanPageModule'
},
// {path: '
shower', loadChildren: './envCtrl/env-shower/env-shower.module#EnvShowerPageModule'
},
// {path: '
light', loadChildren: './envCtrl/env-light/env-light.module#EnvLightPageModule'
},
// {path: '
waterchannel', loadChildren: './envCtrl/env-waterchannel/env-waterchannel.module#EnvWaterchannelPageModule'
},
// {path: '', redirectTo: 'fan', pathMatch : 'prefix'},
// ]
},
...
...
src/app/components/kanban/kanban.component.html
View file @
b1f15e75
<div
class=
"kanban"
>
<div
class=
"title"
style=
""
>
<p
style=
"margin-top:7px"
>
{{name}}
</p>
<!--<p >{{unit}}</p>-->
</div>
<div
class=
"sub"
style=
"text-align: center;margin-top: 15px;"
>
<!--<ion-icon name="ios-heart" style="padding: auto"></ion-icon>-->
...
...
src/app/components/kanban/kanban.component.ts
View file @
b1f15e75
...
...
@@ -10,6 +10,9 @@ export class KanbanComponent implements OnInit {
@
Input
()
name
=
''
;
@
Input
()
unit
=
''
;
@
Input
()
iconClass
=
''
;
...
...
src/app/envCtrl/env-detail/env-detail.page.html
View file @
b1f15e75
...
...
@@ -10,7 +10,7 @@
</ion-toolbar>
<div
class=
"top"
>
<span
[
ngClass
]="{'
online
'
:
item
.
online
,
'
offline
'
:
!
item
.
online
}"
>
{{item.online ? '在线' : '离线'}}
</span>
<span
*
ngIf=
"item.operationModel === 1 || item.operationModel === 0"
class=
"online"
>
{{item.operationModel ? '
平
控' :'现控'}}
</span>
<span
*
ngIf=
"item.operationModel === 1 || item.operationModel === 0"
class=
"online"
>
{{item.operationModel ? '
远
控' :'现控'}}
</span>
<span
*
ngIf=
"item.operationModel === 4"
class=
"offline"
>
现控
</span>
<span
*
ngIf=
"item.operationModel"
[
ngClass
]="{'
online
'
:
item
.
isWisdomModel
,
'
offline
'
:
!
item
.
isWisdomModel
}"
class=
"online"
>
智控
</span>
<span
*
ngIf=
"item.ts"
class=
"right"
style=
"padding-top: 3px;"
>
{{item.ts | date: 'yyyy-MM-dd HH:mm'}}
</span>
...
...
@@ -28,19 +28,19 @@
</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=
"
tab-
fan"
class=
"tabSelected"
>
<ion-tab-button
tab=
"fan"
class=
"tabSelected"
>
<ion-label>
风机
</ion-label>
</ion-tab-button>
<ion-tab-button
tab=
"
tab-
shower"
class=
"tabSelected"
[
routerLink
]="
showerLink
"
>
<!--[rootParams]="fieldRegionNo"-->
<ion-tab-button
tab=
"shower"
class=
"tabSelected"
[
routerLink
]="
showerLink
"
>
<!--[rootParams]="fieldRegionNo"-->
<ion-label>
喷淋
</ion-label>
</ion-tab-button>
<ion-tab-button
tab=
"
tab-
light"
class=
"tabSelected"
[
routerLink
]="
lightLink
"
>
<ion-tab-button
tab=
"light"
class=
"tabSelected"
[
routerLink
]="
lightLink
"
>
<ion-label>
照明
</ion-label>
</ion-tab-button>
<ion-tab-button
tab=
"
tab-
waterchannel"
class=
"tabSelected"
[
routerLink
]="
waterchannelLink
"
>
<ion-tab-button
tab=
"waterchannel"
class=
"tabSelected"
[
routerLink
]="
waterchannelLink
"
>
<ion-label>
水槽
</ion-label>
</ion-tab-button>
</ion-tab-bar>
...
...
@@ -48,16 +48,16 @@
<!--<ion-tabs>-->
<!--<ion-tab-bar slot="top">-->
<!--<ion-tab-button tab="
tab-
fan" class="tabSelected">-->
<!--<ion-tab-button tab="fan" class="tabSelected">-->
<!--<ion-label>风机</ion-label>-->
<!--</ion-tab-button>-->
<!--
<ion-tab-button tab="tab-shower" class="tabSelected"> <!–[rootParams]="fieldRegionNo"
–>-->
<!--
<ion-label>喷淋</ion-label>
-->
<!--
</ion-tab-button>
-->
<!--<ion-tab-button tab="
tab-
light" class="tabSelected">-->
<!--
<!–<ion-tab-button tab="shower" class="tabSelected"> <!–[rootParams]="fieldRegionNo"–>
–>-->
<!--
<!–<ion-label>喷淋</ion-label>–>
-->
<!--
<!–</ion-tab-button>–>
-->
<!--<ion-tab-button tab="light" class="tabSelected">-->
<!--<ion-label>照明</ion-label>-->
<!--</ion-tab-button>-->
<!--<ion-tab-button tab="
tab-
waterchannel" class="tabSelected">-->
<!--<ion-tab-button tab="waterchannel" class="tabSelected">-->
<!--<ion-label>水槽</ion-label>-->
<!--</ion-tab-button>-->
<!--</ion-tab-bar>-->
...
...
src/app/envCtrl/env-detail/env-detail.page.ts
View file @
b1f15e75
...
...
@@ -63,10 +63,10 @@ export class EnvDetailPage implements OnInit {
}
// ionic的生命周期函数
//
ionViewWillEnter() {
//
console.log('ionViewWillEnter');
//
this.init();
//
}
ionViewWillEnter
()
{
console
.
log
(
'ionViewWillEnter'
);
this
.
init
();
}
init
()
{
this
.
comm
.
isLoading
=
false
;
...
...
@@ -92,40 +92,16 @@ export class EnvDetailPage implements OnInit {
this
.
initLayout
();
}
}]);
// START----------------------------------------------
// TODO 测试用准备数据
// this.item = {
// // 3-重度热应激 在线 平控 非智控(自控) 有报警
// fieldRegionNo: 'FRN136641006052720640',
// fieldRegionName: '1号牛舍',
// temp: '23.5',
// humi: '82.8',
// heatStressLevel: '3',
// heatStressLevelName: this.getHeatStressLevelName('3'),
// online: 1, // 0-离线,1-在线
// operationModel: 1, // 0-现控,1-平控
// isWisdomModel: 0, // 0-非智控(自控),1-智控
// alarm: 1,
// inHouse : {
// inHouse: 1,
// inHouseName: this.getInHouseState(1), // 0-离舍,1-在舍},
// fieldDeviceNo: 'FDN15615456135612',
// fieldDeviceType: '牛舍'
// },
// ts: '2019-08-05 23:44',
// };
// this.initLayout();
// 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
;
this
.
fanLink
=
'/env-detail/fan/'
;
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
?
'#52fabb'
:
...
...
src/app/envCtrl/env-history/env-history.page.html
View file @
b1f15e75
...
...
@@ -30,16 +30,41 @@
<!--<ngx-datatable-column name="氨气浓度" prop="NH3" [width]="90">-->
<!--</ngx-datatable-column>-->
<!--</ngx-datatable>-->
<ngx-datatable
class=
"material"
[
rows
]="
tableRows
"
[
columnMode
]="'
force
'"
[
scrollbarH
]="
true
"
[
scrollbarV
]="
true
"
style=
"text-align: center; font-size:14px"
>
<ngx-datatable-column
name=
"时间"
prop=
"ts"
[
width
]="
80
"
>
<!--<ngx-datatable class="material"-->
<!--[rows]="tableRows"-->
<!--[columnMode]="'force'"-->
<!--[scrollbarH]="true"-->
<!--[scrollbarV]="true"-->
<!--[headerHeight]="60"-->
<!--[rowHeight]="'auto'"-->
<!--style="text-align: center; font-size:14px">-->
<!--<ngx-datatable-column name="时间" prop="ts" [width]="70">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column name="热应激" prop="thi" [width]="80">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'温度 <br>℃'" prop="temp" [width]="60">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'湿度 <br>% rH'" prop="humi" [width]="60">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'氨气浓度 <br>ppm'" prop="NH3" [width]="90">-->
<!--</ngx-datatable-column>-->
<!--</ngx-datatable>-->
<ngx-datatable
class=
"material"
[
rows
]="
tableRows
"
[
columnMode
]="'
force
'"
[
scrollbarH
]="
true
"
[
scrollbarV
]="
true
"
[
headerHeight
]="
50
"
style=
"text-align: center; font-size:14px"
>
<ngx-datatable-column
name=
"时间"
prop=
"ts"
[
width
]="
70
"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"热应激"
prop=
"thi"
[
width
]="
8
0
"
>
<ngx-datatable-column
name=
"热应激"
prop=
"thi"
[
width
]="
7
0
"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"温度
"
prop=
"temp"
[
width
]="
8
0
"
>
<ngx-datatable-column
name=
"温度
<br>℃"
prop=
"temp"
[
width
]="
6
0
"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"湿度
"
prop=
"humi"
[
width
]="
8
0
"
>
<ngx-datatable-column
name=
"湿度
<br>% rH"
prop=
"humi"
[
width
]="
6
0
"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"氨气浓度"
prop=
"NH3"
[
width
]="
90
"
>
<ngx-datatable-column
name=
"氨气浓度
<br>ppm
"
prop=
"NH3"
[
width
]="
90
"
>
</ngx-datatable-column>
</ngx-datatable>
</div>
...
...
src/app/envCtrl/env-history/env-history.page.ts
View file @
b1f15e75
...
...
@@ -24,6 +24,20 @@ export class EnvHistoryPage implements OnInit {
chartOption
=
{};
tableRows
=
[];
tableColumns
=
[
{
name
:
'时间'
,
prop
:
'ts'
},
{
name
:
'热应激'
,
prop
:
'thi'
},
{
name
:
'温度 <br> ℃'
,
prop
:
'temp'
},
{
name
:
'湿度 <br> rH'
,
prop
:
'humi'
},
{
name
:
'氨气浓度 <br> ppm'
,
prop
:
'NH3'
}
];
tableColumnWidths
=
[
{
column
:
'ts'
,
width
:
70
},
{
column
:
'thi'
,
width
:
80
},
{
column
:
'temp'
,
width
:
70
},
{
column
:
'humi'
,
width
:
70
},
{
column
:
'NH3'
,
width
:
90
}
]
ngOnInit
()
{
this
.
init
();
...
...
@@ -52,7 +66,7 @@ export class EnvHistoryPage implements OnInit {
}
}]);
req
.
counts
=
1
;
req
.
counts
=
1
0
;
this
.
api
.
cowshedApp
.
getHistoryTableByFieldRegionNo
([
req
,
(
data
)
=>
{
if
(
data
&&
data
.
constructor
===
Array
)
{
...
...
@@ -69,13 +83,13 @@ export class EnvHistoryPage implements OnInit {
const
times
=
[];
if
(
param
.
temp
&&
param
.
temp
.
constructor
===
Array
)
{
param
.
temp
.
map
(
item
=>
{
times
.
push
(
new
Date
(
item
.
time
).
getHours
(
));
temp
.
push
(
item
.
value
);
times
.
push
(
this
.
datePipe
.
transform
(
item
.
time
,
'hh:mm'
));
temp
.
push
(
Number
(
item
.
value
).
toFixed
(
2
)
);
});
}
if
(
param
.
humi
&&
param
.
humi
.
constructor
===
Array
)
{
param
.
humi
.
map
(
item
=>
{
humi
.
push
(
item
.
value
);
humi
.
push
(
Number
(
item
.
value
).
toFixed
(
1
)
);
});
}
if
(
param
.
thi
&&
param
.
thi
.
constructor
===
Array
)
{
...
...
@@ -86,6 +100,24 @@ export class EnvHistoryPage implements OnInit {
this
.
chartOption
=
{
backgroundColor
:
'#fff'
,
tooltip
:
{
trigger
:
'axis'
,
// axisPointer: {
// type: 'cross',
// label: {
// backgroundColor: '#72efff'
// }
// }
axisPointer
:
{
// 坐标轴指示器,坐标轴触发有效
type
:
'line'
,
// 默认为直线,可选为:'line' | 'shadow'
label
:
'cross'
,
show
:
true
},
},
legend
:
{
data
:
[
'温度'
,
'湿度'
,
'热应激'
]
},
visualMap
:
[
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
0
,
min
:
0
,
max
:
400
},
{
show
:
false
,
type
:
'continuous'
,
seriesIndex
:
1
,
dimension
:
0
,
min
:
0
,
max
:
400
}],
...
...
@@ -98,9 +130,9 @@ export class EnvHistoryPage implements OnInit {
{
name
:
'湿度(%)'
,
type
:
'value'
,
max
:
100
,
splitLine
:
{
show
:
false
}}
],
series
:
[
{
data
:
temp
,
type
:
'line'
},
{
data
:
humi
,
yAxisIndex
:
1
,
type
:
'line'
},
{
data
:
thi
,
yAxisIndex
:
1
,
type
:
'line'
}
{
name
:
'温度'
,
data
:
temp
,
type
:
'line'
},
{
name
:
'湿度'
,
data
:
humi
,
yAxisIndex
:
1
,
type
:
'line'
},
{
name
:
'热应激'
,
data
:
thi
,
yAxisIndex
:
1
,
type
:
'line'
}
]
};
}
...
...
@@ -110,12 +142,19 @@ export class EnvHistoryPage implements OnInit {
param
.
map
(
item
=>
{
this
.
tableRows
.
push
({
ts
:
this
.
datePipe
.
transform
(
item
.
ts
,
'hh
-
mm'
),
ts
:
this
.
datePipe
.
transform
(
item
.
ts
,
'hh
:
mm'
),
thi
:
item
.
heatStressLevel
,
temp
:
item
.
temp
,
humi
:
item
.
humi
,
NH3
:
item
.
NH3
temp
:
item
.
temp
.
toFixed
(
2
)
,
humi
:
item
.
humi
.
toFixed
(
1
)
,
NH3
:
item
.
NH3
.
toFixed
(
3
)
});
});
// this.tableColumns.forEach((col: any) => {
// const colReWidth = this.tableColumnWidths.find(colWidth => colWidth.column === col.prop);
// if (colReWidth) {
// col.width = colReWidth.width;
// }
// });
}
}
src/app/envCtrl/env-light/env-light.page.ts
View file @
b1f15e75
...
...
@@ -179,7 +179,7 @@ export class EnvLightPage implements OnInit {
const
msgHeader
=
'照明灯'
;
const
msgOp
=
btn
.
op
?
'关闭'
:
'打开'
;
let
msgContent
=
''
;
if
(
this
.
controlModel
===
0
)
{
if
(
this
.
controlModel
===
Constants
.
CONTROLL_REMOTR
)
{
msgContent
=
'所有'
+
msgHeader
+
'即将'
+
msgOp
+
',要继续吗?'
;
}
else
{
msgContent
=
'确认要'
+
msgOp
+
'所有'
+
msgHeader
+
',并且自动切换至手动模式吗?'
;
...
...
@@ -242,7 +242,7 @@ export class EnvLightPage implements OnInit {
});
// 自动控制时, 强制切换至手动模式
this
.
controlModel
=
this
.
controlModel
===
1
?
0
:
this
.
controlModel
;
this
.
controlModel
=
this
.
controlModel
===
Constants
.
CONTROLL_SELF
?
Constants
.
CONTROLL_REMOTR
:
this
.
controlModel
;
}
// 单个设备控制
...
...
src/app/service/constants.ts
View file @
b1f15e75
...
...
@@ -11,7 +11,7 @@ export class Constants {
// // WISDOM
// // }
public
static
CONTROLL_ON_SITE
=
0
;
// 现控
public
static
CONTROLL_REMOTR
=
1
;
// 远控
public
static
CONTROLL_REMOTR
=
1
;
// 远控
(手动控制)
public
static
CONTROLL_SELF
=
2
;
// 自控
public
static
CONTROLL_WISDOM
=
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