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
3f9db925
Commit
3f9db925
authored
Nov 21, 2019
by
yating.lin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整layout
parent
08c984d9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
1006 additions
and
454 deletions
+1006
-454
app-routing.module.ts
src/app/app-routing.module.ts
+3
-3
env-add-model.page.html
src/app/envCtrl/env-add-model/env-add-model.page.html
+12
-2
env-add-model.page.scss
src/app/envCtrl/env-add-model/env-add-model.page.scss
+28
-1
env-alarm-detail.page.html
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.html
+28
-23
env-alarm-detail.page.scss
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.scss
+27
-5
env-alarm-detail.page.ts
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.ts
+35
-10
env-alarm.page.html
src/app/envCtrl/env-alarm/env-alarm.page.html
+1
-1
env-anal.page.ts
src/app/envCtrl/env-anal/env-anal.page.ts
+1
-1
env-cfg.page.html
src/app/envCtrl/env-cfg/env-cfg.page.html
+696
-316
env-cfg.page.scss
src/app/envCtrl/env-cfg/env-cfg.page.scss
+72
-1
env-cfg.page.ts
src/app/envCtrl/env-cfg/env-cfg.page.ts
+25
-25
env-change-model.page.scss
src/app/envCtrl/env-change-model/env-change-model.page.scss
+1
-1
env-detail.page.html
src/app/envCtrl/env-detail/env-detail.page.html
+3
-2
env-detail.page.ts
src/app/envCtrl/env-detail/env-detail.page.ts
+17
-3
env-fan.page.ts
src/app/envCtrl/env-fan/env-fan.page.ts
+12
-28
env-history.page.html
src/app/envCtrl/env-history/env-history.page.html
+2
-2
env-home.page.html
src/app/envCtrl/env-home/env-home.page.html
+3
-3
env-home.page.ts
src/app/envCtrl/env-home/env-home.page.ts
+1
-1
env-light.page.ts
src/app/envCtrl/env-light/env-light.page.ts
+13
-22
env-shower.page.ts
src/app/envCtrl/env-shower/env-shower.page.ts
+12
-0
constants.ts
src/app/service/constants.ts
+1
-0
牛舍.png
src/assets/img/牛舍.png
+0
-0
global.scss
src/global.scss
+13
-4
No files found.
src/app/app-routing.module.ts
View file @
3f9db925
...
...
@@ -57,9 +57,9 @@ const routes: Routes = [
component
:
EnvDetailPage
,
children
:
[
{
path
:
'fan'
,
component
:
EnvFanPage
},
{
path
:
'shower/:fieldRegionNo'
,
component
:
EnvShowerPage
},
{
path
:
'light/:fieldRegionNo'
,
component
:
EnvLightPage
},
{
path
:
'waterchannel/:fieldRegionNo'
,
component
:
EnvWaterchannelPage
},
{
path
:
'shower/:fieldRegionNo
/:operationModel
'
,
component
:
EnvShowerPage
},
{
path
:
'light/:fieldRegionNo
/:operationModel
'
,
component
:
EnvLightPage
},
{
path
:
'waterchannel/:fieldRegionNo
/:operationModel
'
,
component
:
EnvWaterchannelPage
},
{
path
:
''
,
redirectTo
:
'fan'
,
pathMatch
:
'prefix'
},
]
...
...
src/app/envCtrl/env-add-model/env-add-model.page.html
View file @
3f9db925
...
...
@@ -6,8 +6,17 @@
<ion-title
mode=
"ios"
class=
"title"
>
喷淋模式填写
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content
style=
"background-color: #F3F4F4;"
>
<div
style=
"max-height: calc(100% - 100px);overflow-y:auto;"
>
<ion-content
style=
"background-color: lightgray;"
>
<div
style=
"width: 100%; margin-top:15px;"
>
<div
class=
"top-line"
>
</div>
<div
class=
"top-img"
>
<img
src=
"../../../assets/img/喷淋.png"
class=
"img"
>
</div>
<div
class=
"top-line"
>
</div>
</div>
<div
style=
"max-height: calc(100% - 100px);overflow-y:auto;"
class=
"parentDiv"
>
<ion-item-sliding
*
ngFor=
"let allCfg of controlConfig"
>
<ion-item
class=
"fanItem"
>
<ion-grid>
...
...
@@ -62,6 +71,7 @@
<ion-item
width=
"100%"
lines=
"none"
>
<ion-icon
name=
"add-circle"
color=
"secondary"
class=
"addIcon"
(
click
)="
addModel
()"
></ion-icon>
</ion-item>
</div>
<div
style=
"text-align: center; width:100%; position: absolute; bottom: 10px;"
>
<ion-button
(
click
)="
goBack
()"
class=
"btn"
color=
"light"
slot=
"start"
style=
"margin-right: 20px;"
>
取消
</ion-button>
...
...
src/app/envCtrl/env-add-model/env-add-model.page.scss
View file @
3f9db925
...
...
@@ -9,7 +9,7 @@
}
.addIcon
{
margin-left
:
160px
;
margin-left
:
calc
(
46%
)
;
}
.deleteIcon
{
...
...
@@ -22,3 +22,30 @@
width
:
35%
;
}
.parentDiv
{
width
:
94%
;
//margin-top: 10px;
background-color
:
#ffffff
;
border-radius
:
7px
;
padding
:
5px
;
}
.img
{
width
:
40px
!
important
;
}
.top-img
{
width
:
16%
;
display
:
inline-block
;
text-align
:
center
;
float
:
left
;
}
.top-line
{
width
:
40%
;
height
:
2px
;
border-bottom
:
1px
solid
lightgray
;
display
:
inline-block
;
margin
:
15px
0px
14px
5px
;
float
:
left
;
}
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.html
View file @
3f9db925
...
...
@@ -17,31 +17,35 @@
</ion-segment-button>
</ion-segment>
<ion-item
lines=
"full"
class=
"ionItem"
color=
"gray"
>
<ion-select
interface=
"popover"
placeholder=
"状态"
[(
ngModel
)]="
disposeState
"
(
onClick
)="
refresh
()"
id=
"selectState"
>
<ion-select-option
value=
"全部"
class=
"popLabel"
>
全部
</ion-select-option>
<ion-select-option
value=
"0"
class=
"popLabel"
>
待修复
</ion-select-option>
<ion-select-option
value=
"1"
class=
"popLabel"
>
已修复
</ion-select-option>
</ion-select>
<ion-select
interface=
"popover"
placeholder=
"类型"
[(
ngModel
)]="
fieldDeviceType
"
(
click
)="
refresh
()"
id=
"selectType"
>
<ion-select-option
*
ngFor=
"let option of typeOptions"
[
value
]="
option
.
modelId
"
>
{{option.modelValue}}
</ion-select-option>
<!--<ion-select-option value="全部" class="popLabel">全部</ion-select-option>-->
<!--<ion-select-option value="环境" class="popLabel">环境</ion-select-option>-->
<!--<ion-select-option value="风机" class="popLabel">风机</ion-select-option>-->
<!--<ion-select-option value="喷淋" class="popLabel">喷淋</ion-select-option>-->
<!--<ion-select-option value="照明" class="popLabel">照明</ion-select-option>-->
<!--<ion-select-option value="水槽" class="popLabel">水槽</ion-select-option>-->
</ion-select>
<ion-item
lines=
"full"
class=
"ionItem"
style=
"height: 45px;"
>
<!-- color="gray" -->
<div
style=
"float:left; display: inline-block; position: relative; width:40%; padding-top: 10px;"
>
<ion-select
class=
"selectBtn font-content"
interface=
"popover"
placeholder=
"状态"
[(
ngModel
)]="
disposeState
"
(
ionChange
)="
refresh
()"
id=
"selectState"
>
<ion-select-option
value=
"全部"
class=
"popLabel"
>
全部
</ion-select-option>
<ion-select-option
value=
"0"
class=
"popLabel"
>
待修复
</ion-select-option>
<ion-select-option
value=
"1"
class=
"popLabel"
>
已修复
</ion-select-option>
</ion-select>
</div>
<div
style=
"float:left; display: inline-block; position: relative; width:40%; padding-top: 10px;"
>
<ion-select
class=
"selectBtn font-content"
interface=
"popover"
placeholder=
"类型"
[(
ngModel
)]="
fieldDeviceType
"
(
ionChange
)="
refresh
()"
id=
"selectType"
>
<ion-select-option
*
ngFor=
"let option of typeOptions"
[
value
]="
option
.
modelId
"
>
{{option.modelValue}}
</ion-select-option>
<!--<ion-select-option value="全部" class="popLabel">全部</ion-select-option>-->
<!--<ion-select-option value="环境" class="popLabel">环境</ion-select-option>-->
<!--<ion-select-option value="风机" class="popLabel">风机</ion-select-option>-->
<!--<ion-select-option value="喷淋" class="popLabel">喷淋</ion-select-option>-->
<!--<ion-select-option value="照明" class="popLabel">照明</ion-select-option>-->
<!--<ion-select-option value="水槽" class="popLabel">水槽</ion-select-option>-->
</ion-select>
</div>
</ion-item>
<ion-item
lines=
"full"
class=
"ionItem"
color=
"gray"
style=
"height: 45px; --inner-padding-end: 0px;"
>
<div
style=
"width: 2
8
%"
>
<div
style=
"width: 2
6
%"
>
<ion-datetime
class=
"content-text-color"
style=
"position: relative;"
displayFormat=
"YYYY/MM"
cancelText=
"取消"
doneText=
"确认"
[(
ngModel
)]="
startTime
"
(
click
)="
refresh
()"
id=
"selectStartTime"
></ion-datetime>
</div>
<div
style=
"width:
2
%"
>
<span>
~
</span>
<div
style=
"width:
4
%"
>
<span
class=
"font-content"
>
~
</span>
</div>
<div
style=
"width:
30
%"
>
<div
style=
"width:
28
%"
>
<ion-datetime
class=
"content-text-color"
style=
"position: relative;"
displayFormat=
"YYYY/MM"
cancelText=
"取消"
doneText=
"确认"
[(
ngModel
)]="
stopTime
"
style=
"margin-left: 3px;"
(
click
)="
refresh
()"
id=
"selectStopTime"
></ion-datetime>
</div>
<div
style=
"width: 40%; padding-right: 15px;"
>
...
...
@@ -75,15 +79,16 @@
<div
class=
"detailContent"
>
<div
class=
"timeline"
*
ngIf=
"troubleList.length > 0"
>
<div
class=
"entry"
*
ngFor=
"let item of troubleList"
>
<div
class=
"entry
outDiv
"
*
ngFor=
"let item of troubleList"
>
<div
class=
"title"
>
<div><img
[
src
]="'../../
assets
/
img
/'
+
item
.
fieldDeviceType
+
'.
png
'"
class=
"deviceIcon"
></div>
<p
class=
"font-ts"
style=
"font-size:13px !important"
>
{{item.troubleTime}}
</p>
</div>
<div
class=
"body"
>
<h3
style=
"margin-bottom: 5px;"
class=
"font-content-title"
>
{{item.description}}
</h3>
<div>
<div
class=
"body
inDiv
"
>
<div
id=
"parentDiv"
>
<div
style=
"width:65%; float: left"
>
<h3
style=
"margin-bottom: 5px;"
class=
"font-content-title"
>
{{item.description}}
</h3>
<div
*
ngIf=
"item.data !== null && item.data.temp !== undefined && item.data.temp !== null && item.data.temp !== ''"
class=
"warnContent font-content"
>
温度: {{item.data.temp}} ℃
</div>
<div
*
ngIf=
"item.data !== null && item.data.humi !== undefined && item.data.humi !== null && item.data.humi !== ''"
class=
"warnContent font-content"
>
湿度: {{item.data.humi}} %
</div>
<div
*
ngIf=
"item.data !== null && item.data.heatStressLevel !== undefined && item.data.heatStressLevel !== null && item.data.heatStressLevel !== ''"
class=
"warnContent font-content"
>
热应激等级: {{item.data.heatStressLevel}}
</div>
...
...
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.scss
View file @
3f9db925
...
...
@@ -32,7 +32,7 @@
font-size
:
13px
;
--padding-start
:
5px
;
--padding-end
:
0px
;
height
:
3
5
px
;
height
:
3
0
px
;
}
.popLabel
{
...
...
@@ -61,7 +61,7 @@
width
:
60px
!
important
;
}
.deviceIcon
{
width
:
50
px
!
important
;
width
:
45
px
!
important
;
}
.detailContent
{
...
...
@@ -96,7 +96,7 @@
top
:
0px
;
left
:
calc
(
30%
+
15px
);
bottom
:
0px
;
width
:
4
px
;
width
:
3
px
;
background
:
#ddd
;
}
.timeline
:after
{
...
...
@@ -105,6 +105,17 @@
clear
:
both
;
}
.outDiv
{
overflow
:
hidden
;
margin-top
:
15px
;
}
.inDiv
{
margin
:
3px
;
padding-bottom
:
10px
;
border-bottom
:
1px
solid
lightgray
;
}
.entry
{
clear
:
both
;
text-align
:
left
;
...
...
@@ -139,9 +150,15 @@
font-size
:
100%
;
}
.entry
.body
{
margin
:
0
0
30px
;
//margin: 0 0 30px;
//float: right;
//width: 65%;
//padding-left: 15px;
margin
:
0
0
5px
;
padding-bottom
:
30px
;
float
:
right
;
width
:
6
5
%
;
width
:
6
2
%
;
padding-left
:
15px
;
}
.entry
.body
p
{
...
...
@@ -152,6 +169,11 @@
font-weight
:
400
;
}
.itemColor
{
--background
:
auto
;
}
.selectBtn
{
--padding-top
:
0px
;
}
src/app/envCtrl/env-alarm-detail/env-alarm-detail.page.ts
View file @
3f9db925
...
...
@@ -95,8 +95,9 @@ export class EnvAlarmDetailPage implements OnInit {
this
.
setDateInterval
(
this
.
curInterval
);
this
.
showArea
(
data
.
displayArea
);
this
.
getTroubleList
(
true
);
this
.
getAlarmList
(
true
);
this
.
setOperation
(
this
.
displayArea
);
// this.getTroubleList(true);
// this.getAlarmList(true);
});
}
...
...
@@ -105,6 +106,25 @@ export class EnvAlarmDetailPage implements OnInit {
this
.
stopTime
=
this
.
datePipe
.
transform
(
new
Date
(),
'yyyy-MM'
);
}
setOperation
(
displayArea
)
{
if
(
displayArea
===
'trouble'
)
{
this
.
typeOptions
=
[
{
modelId
:
'全部'
,
modelValue
:
'全部'
},
{
modelId
:
'风机'
,
modelValue
:
'风机'
},
{
modelId
:
'喷淋'
,
modelValue
:
'喷淋'
},
{
modelId
:
'照明'
,
modelValue
:
'照明'
},
{
modelId
:
'水槽'
,
modelValue
:
'水槽'
}];
}
else
{
this
.
typeOptions
=
[
{
modelId
:
'全部'
,
modelValue
:
'全部'
},
{
modelId
:
'环境'
,
modelValue
:
'环境'
},
{
modelId
:
'风机'
,
modelValue
:
'风机'
},
{
modelId
:
'喷淋'
,
modelValue
:
'喷淋'
},
{
modelId
:
'照明'
,
modelValue
:
'照明'
},
{
modelId
:
'水槽'
,
modelValue
:
'水槽'
}];
}
}
showArea
(
displayArea
)
{
this
.
isTroubleDis
=
displayArea
===
'trouble'
?
true
:
false
;
this
.
isAlarmDis
=
displayArea
===
'alarm'
?
true
:
false
;
...
...
@@ -133,9 +153,10 @@ export class EnvAlarmDetailPage implements OnInit {
item
.
troubleTime
=
this
.
api
.
formatTime
(
'yyyy-MM-dd hh:mm:ss'
,
new
Date
(
item
.
troubleTime
));
});
}
if
(
isInit
)
{
this
.
detailInfo
=
data
;
}
// if (isInit) {
// this.detailInfo = data;
// }
this
.
detailInfo
=
data
;
this
.
detailInfoLength
=
data
.
devErrTotal
;
this
.
appendItems
(
data
.
trouble
,
data
.
devErrTotal
);
}]);
...
...
@@ -165,9 +186,10 @@ export class EnvAlarmDetailPage implements OnInit {
item
.
troubleTime
=
this
.
api
.
formatTime
(
'yyyy-MM-dd hh:mm:ss'
,
new
Date
(
item
.
alarmTime
));
});
}
if
(
isInit
)
{
this
.
detailInfo
=
data
;
}
// if (isInit) {
// this.detailInfo = data;
// }
this
.
detailInfo
=
data
;
this
.
detailInfoLength
=
data
.
alarmTotal
;
this
.
appendItems
(
data
.
trouble
,
data
.
alarmTotal
);
}]);
...
...
@@ -178,7 +200,7 @@ export class EnvAlarmDetailPage implements OnInit {
// await this.wait(500);
// console.log(allDataLength);
// console.log(this.troubleList.length);
if
(
trouble
&&
trouble
.
length
>
0
)
{
if
(
trouble
.
length
>
0
&&
this
.
troubleList
.
length
<
allDataLength
)
{
for
(
let
i
=
0
;
i
<
trouble
.
length
;
i
++
)
{
this
.
troubleList
.
push
(
trouble
[
i
]);
this
.
displayLength
=
this
.
displayLength
+
1
;
...
...
@@ -223,9 +245,11 @@ export class EnvAlarmDetailPage implements OnInit {
document
.
getElementById
(
'infiniteScroll'
).
removeAttribute
(
'disabled'
);
if
(
ev
.
target
.
value
===
'alarm'
)
{
this
.
displayArea
=
'alarm'
;
this
.
setOperation
(
'alarm'
);
this
.
getAlarmList
(
true
);
}
else
{
this
.
displayArea
=
'trouble'
;
this
.
setOperation
(
'trouble'
);
this
.
getTroubleList
(
true
);
}
},
1000
);
...
...
@@ -305,6 +329,7 @@ export class EnvAlarmDetailPage implements OnInit {
}
refresh
()
{
this
.
waiting
();
console
.
log
(
'refresh'
);
this
.
detailInfo
=
{};
this
.
troubleList
=
[];
...
...
@@ -329,7 +354,7 @@ export class EnvAlarmDetailPage implements OnInit {
cssClass
:
'main-color'
,
mode
:
'ios'
,
message
:
''
,
duration
:
1
000
duration
:
2
000
});
await
loading
.
present
();
...
...
src/app/envCtrl/env-alarm/env-alarm.page.html
View file @
3f9db925
...
...
@@ -8,7 +8,7 @@
<ion-refresher
slot=
"fixed"
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
<ion-card
*
ngFor=
"let item of alarmItems"
style=
"margin-top:10px; margin-bottom:0px;"
>
<ion-card
*
ngFor=
"let item of alarmItems"
style=
"margin-top:10px; margin-bottom:0px;"
color=
"white"
>
<ion-card-header
style=
"padding-top: 3px; padding-bottom: 3px;"
>
<ion-card-title
style=
"display: inline-block"
style=
"width:100%"
>
<div
class=
"cardTitle"
>
...
...
src/app/envCtrl/env-anal/env-anal.page.ts
View file @
3f9db925
...
...
@@ -350,7 +350,7 @@ export class EnvAnalPage implements OnInit {
{
type
:
'value'
,
scale
:
true
,
name
:
'湿度(%
r
H)'
,
name
:
'湿度(%
R
H)'
,
// max: 1200,
// min: 0,
boundaryGap
:
[
0.1
,
0.1
]
...
...
src/app/envCtrl/env-cfg/env-cfg.page.html
View file @
3f9db925
This diff is collapsed.
Click to expand it.
src/app/envCtrl/env-cfg/env-cfg.page.scss
View file @
3f9db925
...
...
@@ -60,11 +60,14 @@
font-weight
:
bold
;
margin-left
:
5px
;
// margin-bottom: 3px;
border-bottom
:
1px
solid
rgba
(
173
,
173
,
173
,
0
.5
);
//border-bottom: 1px solid rgba(173, 173, 173, 0.5);
border-bottom
:
1px
solid
lightgray
;
}
.selectFont
{
font-weight
:
normal
;
font-size
:
13px
;
color
:
#8e8e8e
;
}
.popContent
{
...
...
@@ -89,3 +92,71 @@
--padding-start
:
0px
;
--padding-top
:
0px
;
}
.itemColor
{
--background
:
auto
;
}
.clearColor
{
background-color
:
unset
;
}
.parentDiv
{
width
:
94%
;
margin
:
auto
;
background-color
:
#ffffff
;
border-radius
:
7px
;
padding
:
10px
5px
10px
5px
;
}
.item-title-div
{
margin-left
:
3px
;
margin-right
:
3px
;
overflow
:
hidden
;
border
:
1px
solid
#d3d3d3
94
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.03
);
border-radius
:
2px
;
}
.item-content-div
{
margin-left
:
3px
;
margin-right
:
3px
;
margin-bottom
:
3px
;
overflow
:
hidden
;
border
:
1px
solid
#d3d3d3
94
;
border-radius
:
2px
;
padding-left
:
10px
;
padding-right
:
10px
;
height
:
35px
;
padding-top
:
inherit
;
}
.icon-up-down
{
width
:
15%
;
text-align
:center
;
display
:
inline-block
;
float
:
left
;
padding-top
:
9px
;
}
.sliding-grid
{
--ion-grid-padding
:
0px
;
}
.sliding-col
{
font-size
:
13px
;
flex
:
0
0
auto
;
width
:
auto
;
--ion-grid-column-padding
:
0px
;
}
.sliding-item
{
--inner-padding-top
:
0px
;
--inner-padding-bottom
:
0px
;
--padding-top
:
0px
;
--padding-bottom
:
0px
;
}
.input-tb-text
{
color
:
black
;
}
src/app/envCtrl/env-cfg/env-cfg.page.ts
View file @
3f9db925
...
...
@@ -107,7 +107,7 @@ export class EnvCfgPage implements OnInit {
this
.
comm
.
isLoading
=
true
;
}
},
1000
)
;
this
.
init
();
//
this.init();
}
ionViewWillLeave
()
{
...
...
@@ -494,28 +494,28 @@ export class EnvCfgPage implements OnInit {
}
}
if
(
this
.
light
.
controlModel
===
Constants
.
CONTROLL_SELF
)
{
let
h
asError
=
false
;
let
lightH
asError
=
false
;
let
hasBlank
=
false
;
this
.
light
.
controlConfig
.
map
(
allCfg
=>
{
if
(
!
has
Error
)
{
hasError
=
this
.
isEmpty
(
allCfg
.
config
.
name
);
hasBlank
=
t
rue
;
if
(
!
has
Blank
)
{
//
hasError = this.isEmpty(allCfg.config.name);
hasBlank
=
t
his
.
isEmpty
(
allCfg
.
config
.
name
)
;
}
if
(
!
has
Error
)
{
hasError
=
this
.
isEmpty
(
allCfg
.
config
.
startDate
);
hasBlank
=
t
rue
;
if
(
!
has
Blank
)
{
//
hasError = this.isEmpty(allCfg.config.startDate);
hasBlank
=
t
his
.
isEmpty
(
allCfg
.
config
.
startDate
)
;
}
if
(
!
has
Error
)
{
hasError
=
this
.
isEmpty
(
allCfg
.
config
.
stopDate
);
hasBlank
=
t
rue
;
if
(
!
has
Blank
)
{
//
hasError = this.isEmpty(allCfg.config.stopDate);
hasBlank
=
t
his
.
isEmpty
(
allCfg
.
config
.
stopDate
)
;
}
if
(
!
has
Error
)
{
hasError
=
this
.
isEmpty
(
allCfg
.
config
.
on
);
hasBlank
=
t
rue
;
if
(
!
has
Blank
)
{
//
hasError = this.isEmpty(allCfg.config.on);
hasBlank
=
t
his
.
isEmpty
(
allCfg
.
config
.
on
)
;
}
if
(
!
has
Error
)
{
hasError
=
this
.
isEmpty
(
allCfg
.
config
.
off
);
hasBlank
=
t
rue
;
if
(
!
has
Blank
)
{
//
hasError = this.isEmpty(allCfg.config.off);
hasBlank
=
t
his
.
isEmpty
(
allCfg
.
config
.
off
)
;
}
// if (!hasError) {
...
...
@@ -524,15 +524,15 @@ export class EnvCfgPage implements OnInit {
// if (!hasError) {
// hasError = this.validateDate(allCfg.config.stopDate);
// }
if
(
!
has
Error
)
{
h
asError
=
this
.
validateDateFromTo
(
allCfg
.
config
.
startDate
,
allCfg
.
config
.
stopDate
);
if
(
!
has
Blank
)
{
lightH
asError
=
this
.
validateDateFromTo
(
allCfg
.
config
.
startDate
,
allCfg
.
config
.
stopDate
);
}
});
if
(
h
asError
&&
hasBlank
)
{
this
.
api
.
presentMsgToast
(
'请完成
喷淋
配置'
);
if
(
lightH
asError
&&
hasBlank
)
{
this
.
api
.
presentMsgToast
(
'请完成
照明
配置'
);
return
false
;
}
else
if
(
h
asError
&&
!
hasBlank
)
{
this
.
api
.
presentMsgToast
(
'
喷淋
配置: 请输入正确的日期范围'
);
}
else
if
(
lightH
asError
&&
!
hasBlank
)
{
this
.
api
.
presentMsgToast
(
'
照明
配置: 请输入正确的日期范围'
);
return
false
;
}
}
...
...
@@ -604,10 +604,10 @@ export class EnvCfgPage implements OnInit {
validateDateFromTo
(
dateFrom
,
dateTo
)
{
let
hasError
=
false
;
const
fromMonth
=
parseInt
(
dateFrom
.
slice
(
0
,
2
),
10
);
const
fromDay
=
parseInt
(
dateFrom
.
slice
(
2
,
4
),
10
);
const
fromDay
=
parseInt
(
dateFrom
.
slice
(
3
,
5
),
10
);
const
from
=
new
Date
(
new
Date
().
getFullYear
(),
fromMonth
,
fromDay
).
valueOf
();
const
toMonth
=
parseInt
(
dateTo
.
slice
(
0
,
2
),
10
);
const
toDay
=
parseInt
(
dateTo
.
slice
(
2
,
4
),
10
);
const
toDay
=
parseInt
(
dateTo
.
slice
(
3
,
5
),
10
);
const
to
=
new
Date
(
new
Date
().
getFullYear
(),
toMonth
,
toDay
).
valueOf
();
if
(
from
>
to
)
{
...
...
src/app/envCtrl/env-change-model/env-change-model.page.scss
View file @
3f9db925
...
...
@@ -13,7 +13,7 @@
}
.addIcon
{
margin-left
:
160px
;
margin-left
:
calc
(
46%
)
;
}
.deleteIcon
{
...
...
src/app/envCtrl/env-detail/env-detail.page.html
View file @
3f9db925
...
...
@@ -17,13 +17,14 @@
</div>
<div
style=
"background-color: #F0F0F0;"
align=
"center"
>
<v-kanban-small
class=
"home-bar"
name=
"温度"
[
inData
]="
item
.
temp
"
iconWidth=
"50%"
unit=
"℃"
[
iconImg
]="'../../
assets
/
img
/
icon-temp
.
png
'"
[
fontColor
]="
item
.
tempColor
"
fontSize=
"14px"
></v-kanban-small>
<v-kanban-small
class=
"home-bar"
name=
"湿度"
[
inData
]="
item
.
humi
"
iconWidth=
"50%"
unit=
"%
r
H"
[
iconImg
]="'../../
assets
/
img
/
icon-humi
.
png
'"
[
fontColor
]="
item
.
humiColor
"
fontSize=
"14px"
></v-kanban-small>
<v-kanban-small
class=
"home-bar"
name=
"湿度"
[
inData
]="
item
.
humi
"
iconWidth=
"50%"
unit=
"%
R
H"
[
iconImg
]="'../../
assets
/
img
/
icon-humi
.
png
'"
[
fontColor
]="
item
.
humiColor
"
fontSize=
"14px"
></v-kanban-small>
<v-kanban-small
class=
"home-bar"
name=
"热应激"
[
inData
]="
item
.
heatStressLevelName
"
iconWidth=
"35%"
[
iconImg
]="'../../
assets
/
img
/
icon-heat
.
png
'"
[
fontColor
]="
item
.
heatStressColor
"
fontSize=
"14px"
></v-kanban-small>
<v-kanban-small
class=
"home-bar"
name=
"在离舍"
[
inData
]="
inHouseName
"
iconWidth=
"35%"
[
iconImg
]="'../../
assets
/
img
/
icon-house
.
png
'"
iconColor=
"#61C7CC"
fontSize=
"14px"
></v-kanban-small>
</div>
<div
class=
"inHouseDiv font-content-title"
>
<ion-label
class=
"inHouseLabel normalColor"
>
在离舍开关控制
</ion-label>
<ion-toggle
mode=
"ios"
color=
"secondary"
[(
ngModel
)]="
inHouseState
"
[
checked
]="
inHouseState
"
(
click
)="
inHouseControl
(
inHouseState
)"
></ion-toggle>
<ion-toggle
mode=
"ios"
color=
"secondary"
[(
ngModel
)]="
inHouseState
"
[
checked
]="
inHouseState
"
[
disabled
]="
inHouseDisabled
"
(
click
)="
inHouseControl
(
inHouseState
)"
></ion-toggle>
<!--<v-switch (click)="inHouseControl(item.inHouse)" [value]="item.inHouse.inHouse" [loading]="loading"></v-switch>-->
</div>
</ion-header>
...
...
src/app/envCtrl/env-detail/env-detail.page.ts
View file @
3f9db925
...
...
@@ -5,6 +5,7 @@ import {ActivatedRoute} from '@angular/router';
import
{
Load
}
from
'../../service/load'
;
import
{
Transfer
}
from
'../../service/transfer'
;
import
{
Loading
}
from
'../../service/loading'
;
import
{
Constants
}
from
'../../service/constants'
;
@
Component
({
selector
:
'v-env-detail'
,
...
...
@@ -55,6 +56,8 @@ export class EnvDetailPage implements OnInit {
inHouseState
=
false
;
fieldRegionNo
=
''
;
operationModel
=
0
;
inHouseDisabled
=
false
;
// 发送指令延时判断
comm
=
{
...
...
@@ -83,6 +86,7 @@ export class EnvDetailPage implements OnInit {
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
if
(
data
.
no
)
{
this
.
fieldRegionNo
=
data
.
no
;
this
.
operationModel
=
data
.
operationModel
;
this
.
getData
(
0
);
}
});
...
...
@@ -102,15 +106,16 @@ export class EnvDetailPage implements OnInit {
this
.
inHouseName
=
this
.
getInHouseState
(
data
.
inHouse
.
inHouse
);
this
.
inHouseState
=
data
.
inHouse
.
inHouse
===
1
?
true
:
false
;
this
.
initLayout
(
environmentConfigJson
);
this
.
setConfusionModelControll
();
}
}]);
}
initLayout
(
environmentConfigJson
)
{
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
;
this
.
showerLink
=
'/env-detail/shower/'
+
this
.
fieldRegionNo
+
'/'
+
this
.
item
.
operationModel
;
this
.
lightLink
=
'/env-detail/light/'
+
this
.
fieldRegionNo
+
'/'
+
this
.
item
.
operationModel
;
this
.
waterchannelLink
=
'/env-detail/waterchannel/'
+
this
.
fieldRegionNo
+
'/'
+
this
.
item
.
operationModel
;
if
(
this
.
item
)
{
this
.
item
.
heatStressColor
=
this
.
item
.
heatStressLevel
===
0
?
'#61C7CC'
:
...
...
@@ -220,4 +225,13 @@ export class EnvDetailPage implements OnInit {
// event.target.complete();
// }, 2000);
// }
setConfusionModelControll
()
{
// 混乱模式
if
(
this
.
item
.
operationModel
===
Constants
.
CONTROLL_CONFUSION
)
{
this
.
inHouseDisabled
=
true
;
}
else
{
this
.
inHouseDisabled
=
false
;
}
}
}
src/app/envCtrl/env-fan/env-fan.page.ts
View file @
3f9db925
...
...
@@ -18,6 +18,7 @@ export class EnvFanPage implements OnInit {
/* 风机 */
// 牧场区域编号
fieldRegionNo
=
''
;
operationModel
=
0
;
// 牧场设备类型
fieldDeviceType
=
''
;
// 模式状态
...
...
@@ -75,6 +76,7 @@ export class EnvFanPage implements OnInit {
init
()
{
this
.
ac
.
queryParams
.
subscribe
((
data
)
=>
{
this
.
fieldRegionNo
=
data
.
no
;
this
.
operationModel
=
data
.
operationModel
;
this
.
getData
(
0
);
});
}
...
...
@@ -93,6 +95,7 @@ export class EnvFanPage implements OnInit {
});
this
.
initButtons
();
this
.
setConfusionModelControll
();
}
this
.
load
.
offLoad
();
}]);
...
...
@@ -216,32 +219,13 @@ export class EnvFanPage implements OnInit {
}]);
}
// async presentLoading() {
// const loading = await this.loadingController.create({
// message: '通信中,还剩60秒',
// duration: 60000
// });
// await loading.present();
// let item = 60;
// setInterval(() => {
// item--;
// loading.message = '通信中,还剩' + item + '秒';
// }, 1000)
//
// const { role, data } = await loading.onDidDismiss();
//
// console.log('Loading dismissed!');
// }
// async presentLoadingWithOptions() {
// const loading = await this.loadingController.create({
// spinner: null,
// duration: 5000,
// message: '加载中...',
// translucent: true,
// cssClass: 'custom-class custom-loading'
// });
// return await loading.present();
// }
setConfusionModelControll
()
{
// 混乱模式
if
(
this
.
operationModel
===
Constants
.
CONTROLL_CONFUSION
)
{
this
.
batchSwitch
.
disabled
=
true
;
this
.
devices
.
forEach
((
device
)
=>
{
device
.
disabled
=
true
;
});
}
}
}
src/app/envCtrl/env-history/env-history.page.html
View file @
3f9db925
...
...
@@ -44,7 +44,7 @@
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'温度 <br>℃'" prop="temp" [width]="60">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'湿度 <br>%
r
H'" prop="humi" [width]="60">-->
<!--<ngx-datatable-column [name]="'湿度 <br>%
R
H'" prop="humi" [width]="60">-->
<!--</ngx-datatable-column>-->
<!--<ngx-datatable-column [name]="'氨气浓度 <br>ppm'" prop="NH3" [width]="90">-->
<!--</ngx-datatable-column>-->
...
...
@@ -62,7 +62,7 @@
</ngx-datatable-column>
<ngx-datatable-column
name=
"温度<br>℃"
prop=
"temp"
[
width
]="
60
"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"湿度<br>%
r
H"
prop=
"humi"
[
width
]="
60
"
>
<ngx-datatable-column
name=
"湿度<br>%
R
H"
prop=
"humi"
[
width
]="
60
"
>
</ngx-datatable-column>
<ngx-datatable-column
name=
"氨气浓度<br>ppm"
prop=
"NH3"
[
width
]="
90
"
>
</ngx-datatable-column>
...
...
src/app/envCtrl/env-home/env-home.page.html
View file @
3f9db925
...
...
@@ -27,7 +27,7 @@
<ion-refresher
slot=
"fixed"
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
<h1
class=
"main-title"
>
故障
统计
</h1>
<h1
class=
"main-title"
>
牛舍状况
统计
</h1>
<div
style=
"margin:1%"
>
<v-kanban-double
class=
"kanban-double"
[
name1
]="'热应激'"
[
name2
]="'故障'"
[
inData1
]="
thiGood
"
[
inData2
]="
thiBad
"
[
inData3
]="
alarmTotal
"
...
...
@@ -54,8 +54,8 @@
<div
*
ngIf=
"item.NH3 === '--'"
class=
"detailInfo"
style=
"width: 40%"
>
氨气:
{{'--'}}ppm
</div>
<div
*
ngIf=
"item.temp !== '--'"
class=
"detailInfo"
style=
"width: 40%"
>
温度:
<span
class=
"{{item.tempColor}}Color"
>
{{item.temp | number:'0.1-1'}}℃
</span></div>
<div
*
ngIf=
"item.temp === '--'"
class=
"detailInfo"
style=
"width: 40%"
>
温度:
{{'--'}}℃
</div>
<div
*
ngIf=
"item.humi !== '--'"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
<span
class=
"{{item.humiColor}}Color"
>
{{item.humi | number:'0.0-0'}}%
r
H
</span></div>
<div
*
ngIf=
"item.humi === '--'"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
{{'--'}}%
r
H
</div>
<div
*
ngIf=
"item.humi !== '--'"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
<span
class=
"{{item.humiColor}}Color"
>
{{item.humi | number:'0.0-0'}}%
R
H
</span></div>
<div
*
ngIf=
"item.humi === '--'"
class=
"detailInfo"
style=
"width: 40%"
>
湿度:
{{'--'}}%
R
H
</div>
</div>
<div
class=
"bottom"
>
<div
style=
"width:100%; margin-top:10px"
>
...
...
src/app/envCtrl/env-home/env-home.page.ts
View file @
3f9db925
...
...
@@ -220,7 +220,7 @@ export class EnvHomePage implements OnInit {
}
toControl
(
one
)
{
const
query
=
'/env-detail?no='
+
one
.
fieldRegionNo
;
const
query
=
'/env-detail?no='
+
one
.
fieldRegionNo
+
'&operationModel='
+
one
.
operationModel
;
this
.
tf
.
transfer
({
url
:
'/'
+
one
.
url
,
query
:
query
,
...
...
src/app/envCtrl/env-light/env-light.page.ts
View file @
3f9db925
...
...
@@ -16,6 +16,7 @@ export class EnvLightPage implements OnInit {
/* 照明 */
// 牧场区域编号
fieldRegionNo
=
''
;
operationModel
=
0
;
// 牧场设备类型
fieldDeviceType
=
''
;
// 模式状态
...
...
@@ -86,6 +87,7 @@ export class EnvLightPage implements OnInit {
init
()
{
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
this
.
operationModel
=
+
params
.
get
(
'operationModel'
);
});
this
.
getData
(
0
);
}
...
...
@@ -111,33 +113,13 @@ export class EnvLightPage implements OnInit {
});
this
.
initButtons
();
this
.
setConfusionModelControll
();
}
this
.
load
.
offLoad
();
}]);
}
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;
// });
// }
if
(
this
.
controlModel
===
Constants
.
CONTROLL_REMOTR
||
this
.
controlModel
===
Constants
.
CONTROLL_SELF
)
{
// 远控+自控 的场合
...
...
@@ -229,7 +211,7 @@ export class EnvLightPage implements OnInit {
// 一键开启设备
this
.
api
.
control
.
controlCowedBatchSwitch
([
req
,
(
data
)
=>
{
if
(
data
.
code
===
1
)
{
this
.
getData
(
1
);
this
.
getData
(
0
);
this
.
api
.
presentMsgToast
(
data
.
message
);
}
else
{
this
.
getData
(
0
);
...
...
@@ -278,4 +260,13 @@ export class EnvLightPage implements OnInit {
}]);
}
setConfusionModelControll
()
{
// 混乱模式
if
(
this
.
operationModel
===
Constants
.
CONTROLL_CONFUSION
)
{
this
.
batchSwitch
.
disabled
=
true
;
this
.
devices
.
forEach
((
device
)
=>
{
device
.
disabled
=
true
;
});
}
}
}
src/app/envCtrl/env-shower/env-shower.page.ts
View file @
3f9db925
...
...
@@ -26,6 +26,7 @@ export class EnvShowerPage implements OnInit {
// 牧场区域编号
fieldRegionNo
=
''
;
operationModel
=
0
;
// 牧场设备类型
fieldDeviceType
=
''
;
// 模式状态
...
...
@@ -108,6 +109,7 @@ export class EnvShowerPage implements OnInit {
init
()
{
this
.
route
.
paramMap
.
subscribe
(
params
=>
{
this
.
fieldRegionNo
=
params
.
get
(
'fieldRegionNo'
);
this
.
operationModel
=
+
params
.
get
(
'operationModel'
);
this
.
getData
(
0
);
});
}
...
...
@@ -137,6 +139,7 @@ export class EnvShowerPage implements OnInit {
this
.
fieldDeviceNameB
=
this
.
param
[
1
].
fieldDeviceName
;
}
this
.
initButtons
();
this
.
setConfusionModelControll
();
}
this
.
load
.
offLoad
();
}]);
...
...
@@ -181,4 +184,13 @@ export class EnvShowerPage implements OnInit {
btn
.
loading
=
false
;
}]);
}
setConfusionModelControll
()
{
// 混乱模式
if
(
this
.
operationModel
===
Constants
.
CONTROLL_CONFUSION
)
{
this
.
param
.
forEach
((
device
)
=>
{
device
.
disabled
=
true
;
});
}
}
}
src/app/service/constants.ts
View file @
3f9db925
...
...
@@ -14,4 +14,5 @@ export class Constants {
public
static
CONTROLL_REMOTR
=
1
;
// 远控(手动控制)
public
static
CONTROLL_SELF
=
2
;
// 自控
public
static
CONTROLL_WISDOM
=
3
;
// 智慧控制
public
static
CONTROLL_CONFUSION
=
4
;
// 智慧控制
}
src/assets/img/牛舍.png
0 → 100644
View file @
3f9db925
1.02 KB
src/global.scss
View file @
3f9db925
...
...
@@ -162,8 +162,12 @@ img {
}
.font-content
{
font-size
:
13px
!
important
;
color
:
#8e8e8e
!
important
;
}
.font-input
{
font-size
:
13px
;
color
:
#8e8e8e
;
}
.font-note
{
...
...
@@ -172,8 +176,8 @@ img {
}
.font-smaller
{
font-size
:
12px
;
color
:
#8e8e8e
;
font-size
:
12px
!
important
;
color
:
#8e8e8e
!
important
;
}
.font-mini
{
...
...
@@ -186,6 +190,11 @@ img {
color
:
#8e8e8e
;
}
.font-alarm
{
font-size
:
13px
;
color
:
#F2401C
;
}
.content-text-color
{
color
:
#8e8e8e
;
}
...
...
@@ -319,5 +328,5 @@ img {
}
.ion-segment-button
{
font-size
:
1
6
px
;
font-size
:
1
5
px
;
}
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