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
875260b8
Commit
875260b8
authored
Jun 25, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加载
parent
12e033d7
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
13 deletions
+17
-13
alarm.page.ts
src/app/alarm/alarm.page.ts
+0
-2
alarm-bar.component.scss
src/app/components/alarm-bar/alarm-bar.component.scss
+5
-2
alarm-bar.component.ts
src/app/components/alarm-bar/alarm-bar.component.ts
+0
-1
home.page.ts
src/app/home/home.page.ts
+1
-1
mine.page.ts
src/app/mine/mine.page.ts
+1
-1
other.page.ts
src/app/other/other.page.ts
+2
-1
api.ts
src/app/service/api.ts
+3
-3
mqtt.ts
src/app/service/mqtt.ts
+3
-2
environment.prod.ts
src/environments/environment.prod.ts
+1
-0
environment.ts
src/environments/environment.ts
+1
-0
No files found.
src/app/alarm/alarm.page.ts
View file @
875260b8
...
@@ -75,14 +75,12 @@ export class AlarmPage implements OnInit {
...
@@ -75,14 +75,12 @@ export class AlarmPage implements OnInit {
}
else
{
}
else
{
this
.
itemExit
=
false
;
this
.
itemExit
=
false
;
}
}
data
.
map
((
value
,
index
)
=>
{
data
.
map
((
value
,
index
)
=>
{
const
it
=
{
const
it
=
{
con
:
value
.
description
,
con
:
value
.
description
,
time
:
value
.
alarmTime
,
time
:
value
.
alarmTime
,
name
:
value
.
fieldRegionName
,
name
:
value
.
fieldRegionName
,
};
};
this
.
data
.
push
(
it
);
this
.
data
.
push
(
it
);
});
});
}
else
{
}
else
{
...
...
src/app/components/alarm-bar/alarm-bar.component.scss
View file @
875260b8
...
@@ -26,9 +26,10 @@
...
@@ -26,9 +26,10 @@
.alarmItem
{
.alarmItem
{
width
:
100%
;
width
:
100%
;
height
:
60px
;
color
:
#ff0000
;
color
:
#ff0000
;
font-size
:
12px
;
font-size
:
12px
;
height
:
auto
;
position
:
relative
;
}
}
.alarmItem.active
{
.alarmItem.active
{
...
@@ -45,10 +46,12 @@
...
@@ -45,10 +46,12 @@
.alarmTime
{
.alarmTime
{
text-align
:
right
;
text-align
:
right
;
padding-right
:
10px
;
color
:
#ff0000
;
color
:
#ff0000
;
font-size
:
12px
;
font-size
:
12px
;
padding-top
:
5px
;
padding-top
:
5px
;
position
:
absolute
;
bottom
:
0
;
right
:
10px
;
}
}
@-webkit-keyframes
slideIn
{
@-webkit-keyframes
slideIn
{
...
...
src/app/components/alarm-bar/alarm-bar.component.ts
View file @
875260b8
...
@@ -37,5 +37,4 @@ export class AlarmBarComponent implements OnInit {
...
@@ -37,5 +37,4 @@ export class AlarmBarComponent implements OnInit {
}
}
}]);
}]);
}
}
}
}
src/app/home/home.page.ts
View file @
875260b8
...
@@ -147,7 +147,7 @@ export class HomePage implements OnInit, OnDestroy {
...
@@ -147,7 +147,7 @@ export class HomePage implements OnInit, OnDestroy {
case
'出料池'
:
case
'出料池'
:
ret
=
'chuliao.jpg'
;
ret
=
'chuliao.jpg'
;
break
;
break
;
case
'沉
沙
池'
:
case
'沉
砂
池'
:
ret
=
'chensha.jpg'
;
ret
=
'chensha.jpg'
;
break
;
break
;
default
:
default
:
...
...
src/app/mine/mine.page.ts
View file @
875260b8
...
@@ -40,6 +40,6 @@ export class MinePage implements OnInit {
...
@@ -40,6 +40,6 @@ export class MinePage implements OnInit {
}
}
onLeftClick
()
{
onLeftClick
()
{
this
.
tf
.
transfer
({
url
:
'/
home
'
});
this
.
tf
.
transfer
({
url
:
'/
index
'
});
}
}
}
}
src/app/other/other.page.ts
View file @
875260b8
...
@@ -101,7 +101,8 @@ export class OtherPage implements OnInit {
...
@@ -101,7 +101,8 @@ export class OtherPage implements OnInit {
const
req
=
{
const
req
=
{
fieldRegionNo
:
this
.
fieldRegionNo
,
fieldRegionNo
:
this
.
fieldRegionNo
,
op
:
a
.
v
?
0
:
1
,
op
:
a
.
v
?
0
:
1
,
type
:
a
.
t
type
:
a
.
t
,
ts
:
parseInt
((
new
Date
().
getTime
()
/
1000
).
toString
(),
10
)
};
};
this
.
api
.
control
.
controlBatchSwitch
([
req
,
(
data
)
=>
{
this
.
api
.
control
.
controlBatchSwitch
([
req
,
(
data
)
=>
{
if
(
data
.
code
===
1
)
{
if
(
data
.
code
===
1
)
{
...
...
src/app/service/api.ts
View file @
875260b8
...
@@ -105,10 +105,10 @@ export class Api {
...
@@ -105,10 +105,10 @@ export class Api {
async
presentMsgToast
(
msg
,
wz
?,
t
?)
{
async
presentMsgToast
(
msg
,
wz
?,
t
?)
{
const
toast
=
await
this
.
toast
.
create
({
const
toast
=
await
this
.
toast
.
create
({
message
:
msg
,
message
:
msg
,
duration
:
t
?
t
:
2
000
,
duration
:
t
?
t
:
5
000
,
mode
:
'ios'
,
mode
:
'ios'
,
cssClass
:
'msgToast'
,
cssClass
:
'msgToast'
,
position
:
wz
?
wz
:
'
bottom
'
position
:
wz
?
wz
:
'
top
'
});
});
toast
.
present
();
toast
.
present
();
}
}
...
@@ -118,7 +118,7 @@ export class Api {
...
@@ -118,7 +118,7 @@ export class Api {
message
:
msg
,
message
:
msg
,
showCloseButton
:
true
,
showCloseButton
:
true
,
position
:
position
,
position
:
position
,
closeButtonText
:
btn
,
closeButtonText
:
'取消'
,
mode
:
'ios'
,
mode
:
'ios'
,
cssClass
:
'btnToast'
cssClass
:
'btnToast'
});
});
...
...
src/app/service/mqtt.ts
View file @
875260b8
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
LocalNotifications
}
from
'@ionic-native/local-notifications/ngx'
;
import
{
LocalNotifications
}
from
'@ionic-native/local-notifications/ngx'
;
import
{
Api
}
from
'./api'
;
import
{
Api
}
from
'./api'
;
import
{
environment
}
from
'../../environments/environment'
;
declare
var
mqtt
:
any
;
declare
var
mqtt
:
any
;
...
@@ -34,7 +35,7 @@ export class Mqtt {
...
@@ -34,7 +35,7 @@ export class Mqtt {
}
}
public
initMqtt
(
name
)
{
public
initMqtt
(
name
)
{
this
.
client
=
mqtt
.
connect
(
'ws://
172.16.1.24
:8083/mqtt'
,
this
.
options
);
this
.
client
=
mqtt
.
connect
(
'ws://
'
+
environment
.
mqttUrl
+
'
:8083/mqtt'
,
this
.
options
);
this
.
topic
=
'Pasture/'
+
name
+
'/Alarm'
;
this
.
topic
=
'Pasture/'
+
name
+
'/Alarm'
;
this
.
client
.
on
(
'connect'
,
()
=>
{
this
.
client
.
on
(
'connect'
,
()
=>
{
...
@@ -53,7 +54,7 @@ export class Mqtt {
...
@@ -53,7 +54,7 @@ export class Mqtt {
led
:
'#ff0000'
led
:
'#ff0000'
}]);
}]);
this
.
api
.
presentMsgToast
(
this
.
api
.
presentMsgToast
(
this
.
api
.
formatTime
(
'yyyy-MM-dd hh:mm:ss'
,
new
Date
(
obj
.
alarmTime
))
+
' '
+
obj
.
description
,
'
bottom
'
,
5000
this
.
api
.
formatTime
(
'yyyy-MM-dd hh:mm:ss'
,
new
Date
(
obj
.
alarmTime
))
+
' '
+
obj
.
description
,
'
top
'
,
5000
);
);
});
});
});
});
...
...
src/environments/environment.prod.ts
View file @
875260b8
...
@@ -2,4 +2,5 @@ export const environment = {
...
@@ -2,4 +2,5 @@ export const environment = {
production
:
true
,
production
:
true
,
url
:
'http://pasture.witium.com/api'
,
// 对外访问测试网地址
url
:
'http://pasture.witium.com/api'
,
// 对外访问测试网地址
// url: 'http://172.16.1.13:8096', // 测试
// url: 'http://172.16.1.13:8096', // 测试
mqttUrl
:
'120.27.235.39'
};
};
src/environments/environment.ts
View file @
875260b8
...
@@ -9,6 +9,7 @@ export const environment = {
...
@@ -9,6 +9,7 @@ export const environment = {
// 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:8096', // 测试
// url: 'http://172.16.1.13:8096', // 测试
mqttUrl
:
'172.16.1.24'
};
};
/*
/*
...
...
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