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
a8c27110
Commit
a8c27110
authored
Apr 30, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
3dd7e4c2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
51 additions
and
52 deletions
+51
-52
app.component.ts
src/app/app.component.ts
+0
-4
east.page.html
src/app/east/east.page.html
+3
-3
east.page.ts
src/app/east/east.page.ts
+5
-5
home.page.html
src/app/home/home.page.html
+2
-2
home.page.ts
src/app/home/home.page.ts
+23
-25
transfer.ts
src/app/service/transfer.ts
+1
-1
west.component.html
src/app/west/west.component.html
+8
-8
west.component.ts
src/app/west/west.component.ts
+3
-3
global.scss
src/global.scss
+5
-0
index.html
src/index.html
+1
-1
No files found.
src/app/app.component.ts
View file @
a8c27110
...
...
@@ -58,16 +58,12 @@ export class AppComponent implements AfterViewInit {
this
.
router
.
events
.
subscribe
(
event
=>
{
// 需要放到最后一个执行
if
(
event
instanceof
NavigationEnd
)
{
this
.
url
=
window
.
location
.
pathname
;
const
x
=
<
HTMLBodyElement
>
document
.
getElementsByTagName
(
'v'
+
window
.
location
.
pathname
.
replace
(
/
\/
/
,
'-'
))[
0
];
x
.
style
.
visibility
=
'visible'
;
}
});
}
registerBackButtonAction
()
{
this
.
platform
.
backButton
.
subscribe
(()
=>
{
const
x
=
<
HTMLBodyElement
>
document
.
getElementsByTagName
(
'v'
+
window
.
location
.
pathname
.
replace
(
/
\/
/
,
'-'
))[
0
];
x
.
style
.
visibility
=
'hidden'
;
if
(
this
.
url
===
'/home'
||
this
.
url
===
'/login'
)
{
if
(
this
.
backBtnPressed
)
{
this
.
appMinimize
.
minimize
();
...
...
src/app/east/east.page.html
View file @
a8c27110
...
...
@@ -16,15 +16,15 @@
当前液位:
<div
class=
"process"
>
<div
class=
"inlineProcess"
[
ngStyle
]="{
width:
proc
+
'%'}"
[
ngClass
]="{'
orange
'
:
proc
<
4
&&
proc
>
3.5, 'red': proc
<
3
.
5
}"
>
[
ngClass
]="{'
orange
'
:
yewei
<
3
&&
yewei
>
2.5, 'red': yewei > 3
}">
</div>
</div>
{{yewei}}m
{{yewei
.toFixed(2)
}}m
</ListItem>
<ListItem
multipleLine
>
当前温度:
<div
style=
"display: inline-block;margin-left: calc(100% - 135px);vertical-align: middle"
>
{{temp
.value
}}℃
{{temp}}℃
</div>
</ListItem>
<ListItem
multipleLine
[
extra
]="
s1
"
>
...
...
src/app/east/east.page.ts
View file @
a8c27110
...
...
@@ -11,8 +11,8 @@ export class EastPage implements OnInit {
// 此处处理color原因详见该目录下scss文件
color
=
[
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
];
value
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
];
yewei
=
''
;
temp
:
any
=
'
'
;
yewei
=
0
;
temp
=
'-
'
;
proc
=
0
;
constructor
(
private
tf
:
Transfer
,
private
api
:
Api
)
{
...
...
@@ -36,7 +36,7 @@ export class EastPage implements OnInit {
this
.
api
.
data
.
getRealData
([{
deviceNo
:
'92489110027112448'
},
(
data
)
=>
{
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
.
length
>
0
)
{
this
.
temp
=
data
[
0
]
;
this
.
temp
=
Number
(
data
[
0
].
value
).
toFixed
(
2
)
;
}
}
else
{
this
.
api
.
presentMsgToast
(
'获取数据失败'
);
...
...
@@ -47,8 +47,8 @@ export class EastPage implements OnInit {
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
.
length
>
0
)
{
if
(
data
[
0
].
value
)
{
this
.
yewei
=
Number
(
data
[
0
].
value
).
toFixed
(
2
);
this
.
proc
=
Number
(
data
[
0
].
value
)
*
100
/
6.5
;
this
.
yewei
=
6.5
-
Number
(
data
[
0
].
value
);
this
.
proc
=
100
-
(
Number
(
data
[
0
].
value
)
*
100
/
6.5
)
;
}
}
}
else
{
...
...
src/app/home/home.page.html
View file @
a8c27110
...
...
@@ -18,11 +18,11 @@
<!--</div>-->
<div
class=
"seePart"
>
<v-sub-title
title=
"监测信息"
></v-sub-title>
<div
class=
"item"
*
ngFor=
"let item of items"
>
<div
class=
"item"
*
ngFor=
"let item of items"
(
click
)="
toControl
(
item
.
url
)"
>
<div
class=
"left"
>
{{item.name}}
</div>
<div
class=
"right"
>
<div
class=
"block1"
>
液位: {{item.yewei}}m
</div>
<div
class=
"block2 canClick"
(
click
)="
toControl
(
item
.
url
)"
>
控制
</div>
<div
class=
"block2 canClick"
>
控制
</div>
<div
class=
"gekai"
></div>
<div
class=
"block3"
*
ngIf=
"item.isNB"
>
南水
<span
[
ngClass
]="{'
sucCir
'
:
item
.
nan
,
'
errCir
'
:
!
item
.
nan
}"
></span>
...
...
src/app/home/home.page.ts
View file @
a8c27110
...
...
@@ -147,7 +147,8 @@ export class HomePage implements OnInit, OnDestroy {
isNB
:
1
,
url
:
'west'
};
let
flagd
=
0
,
flagx
=
0
;
let
flagd
=
0
;
// flagx = 0;
// 东中转池 19040003 0号通道为液位
this
.
api
.
data
.
getRealData
([{
deviceNo
:
'92489569504727040'
},
(
data
)
=>
{
flagd
++
;
...
...
@@ -187,7 +188,6 @@ export class HomePage implements OnInit, OnDestroy {
}]);
// 西中转池 19040006 0号通道为液位
this
.
api
.
data
.
getRealData
([{
deviceNo
:
'92490138428510208'
},
(
data
)
=>
{
flagx
++
;
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
.
length
>
0
)
{
if
(
data
[
0
].
value
)
{
...
...
@@ -197,31 +197,29 @@ export class HomePage implements OnInit, OnDestroy {
}
else
{
this
.
api
.
presentMsgToast
(
'获取数据失败'
);
}
if
(
flagx
===
2
)
{
this
.
items
[
1
]
=
xi
;
this
.
items
=
[...
this
.
items
];
}
this
.
items
[
1
]
=
xi
;
this
.
items
=
[...
this
.
items
];
}]);
// 西中转池 19040008 0,1号通道为1号搅拌池 2,3号通道为2号搅拌池
this
.
api
.
data
.
getRealData
([{
deviceNo
:
'92490309405118464'
},
(
data
)
=>
{
flagx
++
;
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
.
length
>
0
)
{
if
(
data
[
0
]
&&
data
[
1
])
{
xi
.
nan
=
!!
(
data
[
0
].
value
===
'1.0'
&&
data
[
1
].
value
===
'1.0'
);
}
if
(
data
[
2
]
&&
data
[
3
])
{
xi
.
bei
=
!!
(
data
[
2
].
value
===
'1.0'
&&
data
[
3
].
value
===
'1.0'
);
}
}
}
else
{
this
.
api
.
presentMsgToast
(
'获取数据失败'
);
}
if
(
flagx
===
2
)
{
this
.
items
[
1
]
=
xi
;
this
.
items
=
[...
this
.
items
];
}
}]);
//
this.api.data.getRealData([{deviceNo: '92490309405118464'}, (data) => {
//
flagx ++;
//
if (data && data.constructor === Array) {
//
if (data.length > 0) {
//
if (data[0] && data[1]) {
//
xi.nan = !!(data[0].value === '1.0' && data[1].value === '1.0');
//
}
//
if (data[2] && data[3]) {
//
xi.bei = !!(data[2].value === '1.0' && data[3].value === '1.0');
//
}
//
}
//
} else {
//
this.api.presentMsgToast('获取数据失败');
//
}
//
if (flagx === 2) {
//
this.items[1] = xi;
//
this.items = [...this.items];
//
}
//
}]);
}
initMqtt
()
{
...
...
src/app/service/transfer.ts
View file @
a8c27110
...
...
@@ -22,7 +22,7 @@ export class Transfer {
setTimeout
(()
=>
{
// 此处是防止移动端自己的back button跳转导致页面空白
x
.
style
.
visibility
=
'visible'
;
},
2
000
);
},
1
000
);
}
}
}
src/app/west/west.component.html
View file @
a8c27110
...
...
@@ -16,10 +16,10 @@
当前液位:
<div
class=
"process"
>
<div
class=
"inlineProcess"
[
ngStyle
]="{
width:
proc
+
'%'}"
[
ngClass
]="{'
orange
'
:
proc
<
4
&&
proc
>
3.5, 'red': proc
<
3
.
5
}"
>
[
ngClass
]="{'
orange
'
:
yewei
<
3
&&
yewei
>
2.5, 'red': yewei >= 3
}">
</div>
</div>
{{yewei}}m
{{yewei
.toFixed(2)
}}m
</ListItem>
<!--<ListItem multipleLine>-->
<!--当前温度:-->
...
...
@@ -27,12 +27,12 @@
<!--{{temp.value}}℃-->
<!--</div>-->
<!--</ListItem>-->
<
ListItem
multipleLine
[
extra
]="
s1
"
>
南水
<
/ListItem
>
<
ListItem
multipleLine
[
extra
]="
s2
"
>
北水
<
/ListItem
>
<
!--<ListItem multipleLine [extra]="s1">--
>
<!--南水-->
<
!--</ListItem>--
>
<
!--<ListItem multipleLine [extra]="s2">--
>
<!--北水-->
<
!--</ListItem>--
>
</div>
<div
class=
"bottomPart"
>
<ListItem
multipleLine
[
extra
]="
s3
"
>
...
...
src/app/west/west.component.ts
View file @
a8c27110
...
...
@@ -12,7 +12,7 @@ export class WestPage implements OnInit {
// 此处处理color原因详见该目录下scss文件
color
=
[
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
,
'#a7aaa6'
];
value
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
];
yewei
=
''
;
yewei
=
0
;
temp
:
any
=
''
;
proc
=
0
;
...
...
@@ -46,8 +46,8 @@ export class WestPage implements OnInit {
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
[
0
].
value
)
{
if
(
data
.
length
>
0
)
{
this
.
yewei
=
Number
(
data
[
0
].
value
).
toFixed
(
2
);
this
.
proc
=
Number
(
data
[
0
].
value
)
*
100
/
6.5
;
this
.
yewei
=
6.5
-
Number
(
data
[
0
].
value
);
this
.
proc
=
100
-
(
Number
(
data
[
0
].
value
)
*
100
/
6.5
)
;
}
}
}
else
{
...
...
src/global.scss
View file @
a8c27110
...
...
@@ -95,3 +95,8 @@ ol, ul {
margin-bottom
:
20px
;
}
img
{
width
:
100%
!
important
;
height
:
100%
;
}
src/index.html
View file @
a8c27110
...
...
@@ -5,7 +5,7 @@
<meta
charset=
"utf-8"
/>
<title>
Ionic App
</title>
<base
href=
"
/
"
/>
<base
href=
"
.
"
/>
<meta
name=
"viewport"
content=
"viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta
name=
"format-detection"
content=
"telephone=no"
/>
...
...
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