Commit a8c27110 authored by van.chen's avatar van.chen

init

parent 3dd7e4c2
...@@ -58,16 +58,12 @@ export class AppComponent implements AfterViewInit { ...@@ -58,16 +58,12 @@ export class AppComponent implements AfterViewInit {
this.router.events.subscribe(event => { // 需要放到最后一个执行 this.router.events.subscribe(event => { // 需要放到最后一个执行
if (event instanceof NavigationEnd) { if (event instanceof NavigationEnd) {
this.url = window.location.pathname; this.url = window.location.pathname;
const x = <HTMLBodyElement>document.getElementsByTagName('v' + window.location.pathname.replace(/\//, '-'))[0];
x.style.visibility = 'visible';
} }
}); });
} }
registerBackButtonAction() { registerBackButtonAction() {
this.platform.backButton.subscribe(() => { 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.url === '/home' || this.url === '/login') {
if (this.backBtnPressed) { if (this.backBtnPressed) {
this.appMinimize.minimize(); this.appMinimize.minimize();
......
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
当前液位: 当前液位:
<div class="process"> <div class="process">
<div class="inlineProcess" [ngStyle]="{width: proc + '%'}" <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>
</div> </div>
{{yewei}}m {{yewei.toFixed(2)}}m
</ListItem> </ListItem>
<ListItem multipleLine> <ListItem multipleLine>
当前温度: 当前温度:
<div style="display: inline-block;margin-left: calc(100% - 135px);vertical-align: middle"> <div style="display: inline-block;margin-left: calc(100% - 135px);vertical-align: middle">
{{temp.value}}℃ {{temp}}℃
</div> </div>
</ListItem> </ListItem>
<ListItem multipleLine [extra]="s1"> <ListItem multipleLine [extra]="s1">
......
...@@ -11,8 +11,8 @@ export class EastPage implements OnInit { ...@@ -11,8 +11,8 @@ export class EastPage implements OnInit {
// 此处处理color原因详见该目录下scss文件 // 此处处理color原因详见该目录下scss文件
color = ['#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6']; color = ['#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6'];
value = [false, false, false, false, false, false, false]; value = [false, false, false, false, false, false, false];
yewei = ''; yewei = 0;
temp: any = ''; temp = '-';
proc = 0; proc = 0;
constructor(private tf: Transfer, private api: Api) { constructor(private tf: Transfer, private api: Api) {
...@@ -36,7 +36,7 @@ export class EastPage implements OnInit { ...@@ -36,7 +36,7 @@ export class EastPage implements OnInit {
this.api.data.getRealData([{deviceNo: '92489110027112448'}, (data) => { this.api.data.getRealData([{deviceNo: '92489110027112448'}, (data) => {
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
if (data.length > 0) { if (data.length > 0) {
this.temp = data[0]; this.temp = Number(data[0].value).toFixed(2);
} }
} else { } else {
this.api.presentMsgToast('获取数据失败'); this.api.presentMsgToast('获取数据失败');
...@@ -47,8 +47,8 @@ export class EastPage implements OnInit { ...@@ -47,8 +47,8 @@ export class EastPage implements OnInit {
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
if (data.length > 0) { if (data.length > 0) {
if (data[0].value) { if (data[0].value) {
this.yewei = Number(data[0].value).toFixed(2); this.yewei = 6.5 - Number(data[0].value);
this.proc = Number(data[0].value) * 100 / 6.5; this.proc = 100 - (Number(data[0].value) * 100 / 6.5);
} }
} }
} else { } else {
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
<!--</div>--> <!--</div>-->
<div class="seePart"> <div class="seePart">
<v-sub-title title="监测信息"></v-sub-title> <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="left">{{item.name}}</div>
<div class="right"> <div class="right">
<div class="block1">液位: {{item.yewei}}m</div> <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="gekai"></div>
<div class="block3" *ngIf="item.isNB"> <div class="block3" *ngIf="item.isNB">
南水 <span [ngClass]="{'sucCir': item.nan, 'errCir': !item.nan}"></span>&nbsp;&nbsp; 南水 <span [ngClass]="{'sucCir': item.nan, 'errCir': !item.nan}"></span>&nbsp;&nbsp;
......
...@@ -147,7 +147,8 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -147,7 +147,8 @@ export class HomePage implements OnInit, OnDestroy {
isNB: 1, isNB: 1,
url: 'west' url: 'west'
}; };
let flagd = 0, flagx = 0; let flagd = 0;
// flagx = 0;
// 东中转池 19040003 0号通道为液位 // 东中转池 19040003 0号通道为液位
this.api.data.getRealData([{deviceNo: '92489569504727040'}, (data) => { this.api.data.getRealData([{deviceNo: '92489569504727040'}, (data) => {
flagd ++; flagd ++;
...@@ -187,7 +188,6 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -187,7 +188,6 @@ export class HomePage implements OnInit, OnDestroy {
}]); }]);
// 西中转池 19040006 0号通道为液位 // 西中转池 19040006 0号通道为液位
this.api.data.getRealData([{deviceNo: '92490138428510208'}, (data) => { this.api.data.getRealData([{deviceNo: '92490138428510208'}, (data) => {
flagx ++;
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
if (data.length > 0) { if (data.length > 0) {
if (data[0].value) { if (data[0].value) {
...@@ -197,31 +197,29 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -197,31 +197,29 @@ export class HomePage implements OnInit, OnDestroy {
} else { } else {
this.api.presentMsgToast('获取数据失败'); this.api.presentMsgToast('获取数据失败');
} }
if (flagx === 2) { this.items[1] = xi;
this.items[1] = xi; this.items = [...this.items];
this.items = [...this.items];
}
}]); }]);
// 西中转池 19040008 0,1号通道为1号搅拌池 2,3号通道为2号搅拌池 // 西中转池 19040008 0,1号通道为1号搅拌池 2,3号通道为2号搅拌池
this.api.data.getRealData([{deviceNo: '92490309405118464'}, (data) => { // this.api.data.getRealData([{deviceNo: '92490309405118464'}, (data) => {
flagx ++; // flagx ++;
if (data && data.constructor === Array) { // if (data && data.constructor === Array) {
if (data.length > 0) { // if (data.length > 0) {
if (data[0] && data[1]) { // if (data[0] && data[1]) {
xi.nan = !!(data[0].value === '1.0' && data[1].value === '1.0'); // xi.nan = !!(data[0].value === '1.0' && data[1].value === '1.0');
} // }
if (data[2] && data[3]) { // if (data[2] && data[3]) {
xi.bei = !!(data[2].value === '1.0' && data[3].value === '1.0'); // xi.bei = !!(data[2].value === '1.0' && data[3].value === '1.0');
} // }
} // }
} else { // } else {
this.api.presentMsgToast('获取数据失败'); // this.api.presentMsgToast('获取数据失败');
} // }
if (flagx === 2) { // if (flagx === 2) {
this.items[1] = xi; // this.items[1] = xi;
this.items = [...this.items]; // this.items = [...this.items];
} // }
}]); // }]);
} }
initMqtt() { initMqtt() {
......
...@@ -22,7 +22,7 @@ export class Transfer { ...@@ -22,7 +22,7 @@ export class Transfer {
setTimeout(() => { setTimeout(() => {
// 此处是防止移动端自己的back button跳转导致页面空白 // 此处是防止移动端自己的back button跳转导致页面空白
x.style.visibility = 'visible'; x.style.visibility = 'visible';
}, 2000); }, 1000);
} }
} }
} }
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
当前液位: 当前液位:
<div class="process"> <div class="process">
<div class="inlineProcess" [ngStyle]="{width: proc + '%'}" <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>
</div> </div>
{{yewei}}m {{yewei.toFixed(2)}}m
</ListItem> </ListItem>
<!--<ListItem multipleLine>--> <!--<ListItem multipleLine>-->
<!--当前温度:--> <!--当前温度:-->
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
<!--{{temp.value}}℃--> <!--{{temp.value}}℃-->
<!--</div>--> <!--</div>-->
<!--</ListItem>--> <!--</ListItem>-->
<ListItem multipleLine [extra]="s1"> <!--<ListItem multipleLine [extra]="s1">-->
南水 <!--南水-->
</ListItem> <!--</ListItem>-->
<ListItem multipleLine [extra]="s2"> <!--<ListItem multipleLine [extra]="s2">-->
北水 <!--北水-->
</ListItem> <!--</ListItem>-->
</div> </div>
<div class="bottomPart"> <div class="bottomPart">
<ListItem multipleLine [extra]="s3"> <ListItem multipleLine [extra]="s3">
......
...@@ -12,7 +12,7 @@ export class WestPage implements OnInit { ...@@ -12,7 +12,7 @@ export class WestPage implements OnInit {
// 此处处理color原因详见该目录下scss文件 // 此处处理color原因详见该目录下scss文件
color = ['#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6']; color = ['#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6', '#a7aaa6'];
value = [false, false, false, false, false, false, false]; value = [false, false, false, false, false, false, false];
yewei = ''; yewei = 0;
temp: any = ''; temp: any = '';
proc = 0; proc = 0;
...@@ -46,8 +46,8 @@ export class WestPage implements OnInit { ...@@ -46,8 +46,8 @@ export class WestPage implements OnInit {
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
if (data[0].value) { if (data[0].value) {
if (data.length > 0) { if (data.length > 0) {
this.yewei = Number(data[0].value).toFixed(2); this.yewei = 6.5 - Number(data[0].value);
this.proc = Number(data[0].value) * 100 / 6.5; this.proc = 100 - (Number(data[0].value) * 100 / 6.5);
} }
} }
} else { } else {
......
...@@ -95,3 +95,8 @@ ol, ul { ...@@ -95,3 +95,8 @@ ol, ul {
margin-bottom: 20px; margin-bottom: 20px;
} }
img {
width: 100% !important;
height: 100%;
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Ionic App</title> <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="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" /> <meta name="format-detection" content="telephone=no" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment