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
524b9d31
Commit
524b9d31
authored
Jun 13, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中转池页面改接口
parent
a6970763
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
105 additions
and
218 deletions
+105
-218
alarm.page.ts
src/app/alarm/alarm.page.ts
+0
-4
switch.component.scss
src/app/components/switch/switch.component.scss
+2
-0
east.page.html
src/app/east/east.page.html
+23
-71
east.page.scss
src/app/east/east.page.scss
+0
-4
east.page.ts
src/app/east/east.page.ts
+70
-132
home.page.ts
src/app/home/home.page.ts
+2
-3
api.ts
src/app/service/api.ts
+5
-0
mqtt.ts
src/app/service/mqtt.ts
+0
-1
environment.ts
src/environments/environment.ts
+2
-2
index.html
src/index.html
+1
-1
No files found.
src/app/alarm/alarm.page.ts
View file @
524b9d31
...
@@ -47,7 +47,6 @@ export class AlarmPage implements OnInit {
...
@@ -47,7 +47,6 @@ export class AlarmPage implements OnInit {
this
.
api
.
alarm
.
getAlarmByTerm
([
req
,
(
data
)
=>
{
this
.
api
.
alarm
.
getAlarmByTerm
([
req
,
(
data
)
=>
{
this
.
data
=
[];
this
.
data
=
[];
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
&&
data
.
constructor
===
Array
)
{
console
.
log
(
data
.
length
);
if
(
data
.
length
>
0
)
{
if
(
data
.
length
>
0
)
{
this
.
itemExit
=
true
;
this
.
itemExit
=
true
;
}
else
{
}
else
{
...
@@ -78,7 +77,6 @@ export class AlarmPage implements OnInit {
...
@@ -78,7 +77,6 @@ export class AlarmPage implements OnInit {
this
.
api
.
alarm
.
getAlarmByTerm
([
req
,
(
data
)
=>
{
this
.
api
.
alarm
.
getAlarmByTerm
([
req
,
(
data
)
=>
{
this
.
data
=
[];
this
.
data
=
[];
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
&&
data
.
constructor
===
Array
)
{
console
.
log
(
data
.
length
);
if
(
data
.
length
>
0
)
{
if
(
data
.
length
>
0
)
{
this
.
itemExit
=
true
;
this
.
itemExit
=
true
;
}
else
{
}
else
{
...
@@ -101,10 +99,8 @@ export class AlarmPage implements OnInit {
...
@@ -101,10 +99,8 @@ export class AlarmPage implements OnInit {
choose
(
e
)
{
choose
(
e
)
{
if
(
e
.
detail
.
value
===
'day'
)
{
if
(
e
.
detail
.
value
===
'day'
)
{
this
.
getAlarmOneDay
();
this
.
getAlarmOneDay
();
console
.
log
(
e
.
detail
.
value
);
}
else
{
}
else
{
this
.
getAlarmOneWeek
();
this
.
getAlarmOneWeek
();
console
.
log
(
e
.
detail
.
value
);
}
}
}
}
...
...
src/app/components/switch/switch.component.scss
View file @
524b9d31
...
@@ -79,4 +79,6 @@
...
@@ -79,4 +79,6 @@
padding-top
:
1px
;
padding-top
:
1px
;
width
:
70px
;
width
:
70px
;
margin-left
:
52px
;
margin-left
:
52px
;
height
:
21px
;
float
:
right
;
}
}
src/app/east/east.page.html
View file @
524b9d31
...
@@ -3,98 +3,50 @@
...
@@ -3,98 +3,50 @@
(
onLeftClick
)="
onLeftClick
()"
(
onLeftClick
)="
onLeftClick
()"
style=
"background-color: #28c9bd"
style=
"background-color: #28c9bd"
>
>
东中转池
控制
{{fieldRegionName}}
控制
</Navbar>
</Navbar>
<div
class=
"topPart"
>
<div
class=
"topPart"
>
<!--<div class="online" *ngFor="let one of items">-->
<ListItem
multipleLine
*
ngIf=
"this.yewei"
>
<!--<div class="label">{{one.label}}</div>-->
<!--<div class="btn">-->
<!--<ion-toggle mode="md" color="primary" (ionChange)="toggle(one.type, $event)"></ion-toggle>-->
<!--</div>-->
<!--</div>-->
<ListItem
multipleLine
>
当前液位:
当前液位:
<div
class=
"process"
>
<div
class=
"process"
>
<div
class=
"inlineProcess"
[
ngStyle
]="{
width:
proc
+
'%'}"
<div
[
class
]="'
inlineProcess
'
+
color
"
[
ngStyle
]="{
width:
proc
+
'%'}"
>
[
ngClass
]="{'
orange
'
:
yewei
<
3
&&
yewei
>
2.5, 'red': yewei > 3}">
</div>
</div>
</div>
</div>
{{yewei.toFixed(2)}}m
{{yewei.toFixed(2)}}m
</ListItem>
</ListItem>
<ListItem
multipleLine
>
<ListItem
multipleLine
*
ngIf=
"this.temp"
>
当前温度:
当前温度:
<div
style=
"display: inline-block;margin-left: calc(100% - 145px);vertical-align: middle"
>
<div
style=
"display: inline-block;margin-left: calc(100% - 145px);vertical-align: middle"
>
{{temp}}℃
{{temp.toFixed(2)}}℃
</div>
</ListItem>
<ListItem
multipleLine
[
extra
]="
s1
"
>
南水
</ListItem>
<ListItem
multipleLine
*
ngIf=
"nanClicked"
>
选择开启时间
<Stepper
class=
"stepClass"
[(
ngModel
)]="
duration
"
[
min
]="
1
"
[
showNumber
]="
true
"
></Stepper>
分钟
<div
style=
"text-align: right;padding-top: 10px"
>
<div
Button
style=
"margin-right: 10px"
class=
"btn"
(
click
)="
cancel
()"
[
inline
]="
true
"
[
size
]="'
small
'"
[
type
]="'
default
'"
>
取消
</div>
<div
Button
(
click
)="
confirm
(
0
)"
class=
"btn"
[
inline
]="
true
"
[
size
]="'
small
'"
[
type
]="'
primary
'"
>
确认
</div>
</div>
</ListItem>
<ListItem
multipleLine
[
extra
]="
s2
"
>
北水
</ListItem>
<ListItem
multipleLine
*
ngIf=
"beiClicked"
>
选择开启时间
<Stepper
class=
"stepClass"
[(
ngModel
)]="
duration
"
[
min
]="
1
"
[
showNumber
]="
true
"
></Stepper>
分钟
<div
style=
"text-align: right;padding-top: 10px"
>
<div
Button
style=
"margin-right: 20px"
class=
"btn"
(
click
)="
cancel
()"
[
inline
]="
true
"
[
size
]="'
small
'"
[
type
]="'
default
'"
>
取消
</div>
<div
Button
(
click
)="
confirm
(
1
)"
class=
"btn"
[
inline
]="
true
"
[
size
]="'
small
'"
[
type
]="'
primary
'"
>
确认
</div>
</div>
</div>
</ListItem>
</ListItem>
<div
*
ngFor=
"let a of nb;let i = index"
>
<ListItem
multipleLine
[
extra
]="
a
.
fieldDeviceName =
==
'南水'
?
s1
:
s2
"
>
{{a.fieldDeviceName}}
</ListItem>
<ListItem
multipleLine
*
ngIf=
"a.fieldDeviceName === '南水' ? nanClicked : beiClicked"
>
选择开启时间
<Stepper
class=
"stepClass"
[(
ngModel
)]="
duration
"
[
min
]="
1
"
[
showNumber
]="
true
"
></Stepper>
分钟
<div
style=
"text-align: right;padding-top: 10px"
>
<div
Button
style=
"margin-right: 10px"
class=
"btn"
(
click
)="
cancel
()"
[
inline
]="
true
"
[
size
]="'
small
'"
[
type
]="'
default
'"
>
取消
</div>
<div
Button
(
click
)="
confirm
(
a
)"
class=
"btn"
[
inline
]="
true
"
[
size
]="'
small
'"
[
type
]="'
primary
'"
>
确认
</div>
</div>
</ListItem>
</div>
</div>
</div>
<div
class=
"bottomPart"
>
<div
class=
"bottomPart"
>
<ListItem
multipleLine
[
extra
]="
s3
"
>
<ListItem
multipleLine
*
ngFor=
"let a of devices;let i = index"
>
一号搅拌器
{{a.fieldDeviceName}}
<v-switch
[
value
]="
a
.
value
"
(
click
)="
toggle
(
a
)"
[
loading
]="
a
.
loading
"
></v-switch>
</ListItem>
</ListItem>
<ListItem
multipleLine
[
extra
]="
s4
"
>
二号搅拌器
</ListItem>
<!--<ListItem multipleLine [extra]="s5">-->
<!--三号搅拌器-->
<!--</ListItem>-->
<!--<ListItem multipleLine [extra]="s6">-->
<!--四号搅拌器-->
<!--</ListItem>-->
<!--<ListItem multipleLine [extra]="s7">-->
<!--一号泵-->
<!--</ListItem>-->
<!--<ListItem multipleLine [extra]="s8">-->
<!--二号泵-->
<!--</ListItem>-->
</div>
</div>
</div>
</div>
<ng-template
#
icon
>
<ng-template
#
icon
>
<span
class=
"vo v-back"
></span>
<span
class=
"vo v-back"
></span>
</ng-template>
</ng-template>
<ng-template
#
s1
>
<ng-template
#
s1
>
<v-switch
[
value
]="
value
[
0
]"
[
disabled
]="
beiLoading
||
value
[
0
]
||
value
[
1
]"
(
click
)="
toggle
(
0
)"
[
loading
]="
nanLoading
"
></v-switch>
<v-switch
[
value
]="
value
[
0
]"
[
disabled
]="
beiLoading
||
value
[
0
]
||
value
[
1
]"
(
click
)="
toggle
Nb
(
0
)"
[
loading
]="
nanLoading
"
></v-switch>
</ng-template>
</ng-template>
<ng-template
#
s2
>
<ng-template
#
s2
>
<v-switch
[
value
]="
value
[
1
]"
[
disabled
]="
nanLoading
||
value
[
0
]
||
value
[
1
]"
(
click
)="
toggle
(
1
)"
[
loading
]="
beiLoading
"
></v-switch>
<v-switch
[
value
]="
value
[
1
]"
[
disabled
]="
nanLoading
||
value
[
0
]
||
value
[
1
]"
(
click
)="
toggleNb
(
1
)"
[
loading
]="
beiLoading
"
></v-switch>
</ng-template>
<ng-template
#
s3
>
<v-switch
[
value
]="
value
[
2
]"
(
click
)="
toggle
(
2
)"
[
loading
]="
loading2
"
></v-switch>
</ng-template>
<ng-template
#
s4
>
<v-switch
[
value
]="
value
[
3
]"
(
click
)="
toggle
(
3
)"
[
loading
]="
loading3
"
></v-switch>
</ng-template>
<ng-template
#
s5
>
<v-switch
[
value
]="
value
[
4
]"
[
disabled
]="
true
"
></v-switch>
</ng-template>
<ng-template
#
s6
>
<v-switch
[
value
]="
value
[
5
]"
[
disabled
]="
true
"
></v-switch>
</ng-template>
<ng-template
#
s7
>
<v-switch
[
value
]="
value
[
6
]"
[
disabled
]="
true
"
></v-switch>
</ng-template>
<ng-template
#
s8
>
<v-switch
[
value
]="
value
[
7
]"
[
disabled
]="
true
"
></v-switch>
</ng-template>
</ng-template>
src/app/east/east.page.scss
View file @
524b9d31
...
@@ -16,10 +16,6 @@
...
@@ -16,10 +16,6 @@
height
:
20px
;
height
:
20px
;
}
}
.orange
{
background-color
:
#ffa847
;
}
.red
{
.red
{
background-color
:
#f04844
;
background-color
:
#f04844
;
}
}
...
...
src/app/east/east.page.ts
View file @
524b9d31
This diff is collapsed.
Click to expand it.
src/app/home/home.page.ts
View file @
524b9d31
...
@@ -83,7 +83,6 @@ export class HomePage implements OnInit, OnDestroy {
...
@@ -83,7 +83,6 @@ export class HomePage implements OnInit, OnDestroy {
this
.
load
.
toLoad
(
'加载中...'
,
false
);
this
.
load
.
toLoad
(
'加载中...'
,
false
);
}
}
this
.
api
.
app
.
getAll
([
''
,
(
data
)
=>
{
this
.
api
.
app
.
getAll
([
''
,
(
data
)
=>
{
console
.
log
(
data
);
if
(
data
.
constructor
===
Array
)
{
if
(
data
.
constructor
===
Array
)
{
this
.
data
=
data
;
this
.
data
=
data
;
}
else
{
}
else
{
...
@@ -107,9 +106,9 @@ export class HomePage implements OnInit, OnDestroy {
...
@@ -107,9 +106,9 @@ export class HomePage implements OnInit, OnDestroy {
pullToRefresh
(
event
)
{
pullToRefresh
(
event
)
{
if
(
event
===
'endReachedRefresh'
)
{
if
(
event
===
'endReachedRefresh'
)
{
console
.
log
(
11111111111111
);
//
console.log(11111111111111);
}
else
{
}
else
{
console
.
log
(
22222222222222
);
//
console.log(22222222222222);
}
}
}
}
}
}
src/app/service/api.ts
View file @
524b9d31
...
@@ -48,6 +48,11 @@ export class Api {
...
@@ -48,6 +48,11 @@ export class Api {
getLatestAlarm
:
(
data
)
=>
this
.
trans
(
'get'
,
'/alarm/getLatestAlarm'
,
data
)
getLatestAlarm
:
(
data
)
=>
this
.
trans
(
'get'
,
'/alarm/getLatestAlarm'
,
data
)
};
};
public
control
=
{
controlBatchSwitch
:
(
data
)
=>
this
.
trans
(
'post'
,
'/control/controlBatchSwitch'
,
data
),
controlSwitch
:
(
data
)
=>
this
.
trans
(
'post'
,
'/control/controlSwitch'
,
data
),
};
private
trans
(
type
,
addr
,
data
)
{
private
trans
(
type
,
addr
,
data
)
{
this
.
sendHttpReq
(
type
,
addr
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
this
.
sendHttpReq
(
type
,
addr
,
data
[
0
],
data
[
1
],
data
[
2
],
data
[
3
]);
}
}
...
...
src/app/service/mqtt.ts
View file @
524b9d31
...
@@ -39,7 +39,6 @@ export class Mqtt {
...
@@ -39,7 +39,6 @@ export class Mqtt {
this
.
msg
=
'mqtt连接成功'
;
this
.
msg
=
'mqtt连接成功'
;
this
.
client
.
subscribe
(
this
.
topic
);
this
.
client
.
subscribe
(
this
.
topic
);
this
.
client
.
on
(
'message'
,
(
a
,
b
)
=>
{
this
.
client
.
on
(
'message'
,
(
a
,
b
)
=>
{
console
.
log
(
b
.
toString
());
this
.
localNotifications
.
schedule
([{
this
.
localNotifications
.
schedule
([{
title
:
'牧场报警'
,
title
:
'牧场报警'
,
text
:
JSON
.
parse
(
b
.
toString
())[
0
].
description
,
text
:
JSON
.
parse
(
b
.
toString
())[
0
].
description
,
...
...
src/environments/environment.ts
View file @
524b9d31
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
export
const
environment
=
{
export
const
environment
=
{
production
:
false
,
production
:
false
,
url
:
'http://pasture.witium.com/api'
,
// 对外访问测试网地址
//
url: 'http://pasture.witium.com/api', // 对外访问测试网地址
// url: 'http://cloud-test.witium.com:8096', // 测试
// url: 'http://cloud-test.witium.com:8096', // 测试
// url: 'http://172.16.1.53:8097', // cy
// url: 'http://172.16.1.53:8097', // cy
//
url: 'http://172.16.1.52:8096', // zz
url
:
'http://172.16.1.52:8096'
,
// zz
// url: 'http://172.16.1.13:8094', // 测试
// url: 'http://172.16.1.13:8094', // 测试
};
};
...
...
src/index.html
View file @
524b9d31
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"
en
"
>
<html
lang=
"
zh
"
>
<head>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
...
...
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