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

alarm页面修改

parent 8a34da97
...@@ -4,17 +4,9 @@ ...@@ -4,17 +4,9 @@
style="background-color: #28c9bd" style="background-color: #28c9bd"
>报警信息</Navbar> >报警信息</Navbar>
<!--<SegmentedControl class = "nav-title" [values]="['今日报警信息', '近一周报警信息']"--> <SegmentedControl class="nav-title" [values]="['今日报警信息', '近一周报警信息']"
<!--(onChange)="choose($event)"></SegmentedControl>--> (onChange)="choose($event)"
></SegmentedControl>
<ion-segment class = "nav-title" (ionChange)="choose($event)" color="secondary">
<ion-segment-button value="day">
<ion-label>今日报警信息</ion-label>
</ion-segment-button>
<ion-segment-button value="week">
<ion-label>近一周报警信息</ion-label>
</ion-segment-button>
</ion-segment>
<div class="alarmCon"> <div class="alarmCon">
<div class="alarmItemBefore" *ngIf="itemExit;else other_content"> <div class="alarmItemBefore" *ngIf="itemExit;else other_content">
......
...@@ -20,8 +20,10 @@ ...@@ -20,8 +20,10 @@
} }
.nav-title{ .nav-title{
height: 40px; height: 30px;
padding: 5px 0;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
border-radius: 0;
} }
.empty-content{ .empty-content{
...@@ -34,4 +36,4 @@ ...@@ -34,4 +36,4 @@
margin-top: 2em; margin-top: 2em;
font-size: 32px; font-size: 32px;
} }
} }
\ No newline at end of file
...@@ -13,16 +13,11 @@ export class AlarmPage implements OnInit { ...@@ -13,16 +13,11 @@ export class AlarmPage implements OnInit {
constructor(private tf: Transfer, private api: Api, private load: Load) { constructor(private tf: Transfer, private api: Api, private load: Load) {
} }
req = {startTime: 0, endTime: 0}; req = {startTime: 0, endTime: 0};
itemExit = false; itemExit = false;
data = [ data = [];
{time: 1506743279334, con: '11111111111111111111111', name: '池子名字'},
{time: 1506743273434, con: '22222222222222222222222', name: '池子名字'},
{time: 1506743212334, con: '33333333333333333333333', name: '池子名字'},
{time: 1506743314334, con: '44444444444444444444444', name: '池子名字'}
];
ngOnInit() { ngOnInit() {
this.getData(); this.getData();
...@@ -30,10 +25,7 @@ export class AlarmPage implements OnInit { ...@@ -30,10 +25,7 @@ export class AlarmPage implements OnInit {
getData() { getData() {
this.load.toLoad('加载中...', false); this.load.toLoad('加载中...', false);
setTimeout(() => { this.getAlarmOneDay();
this.getAlarmOneDay();
this.load.offLoad();
}, 2000);
} }
getAlarmOneWeek() { getAlarmOneWeek() {
...@@ -53,10 +45,11 @@ export class AlarmPage implements OnInit { ...@@ -53,10 +45,11 @@ export class AlarmPage implements OnInit {
this.itemExit = false; this.itemExit = false;
} }
data.map((value, index) => { data.map((value, index) => {
const it = {time: 1506743279334, con: '11111111111111111111111', name: '池子名字'}; const it = {
it.con = value.description; con: value.description,
it.time = value.alarmTime; time: value.alarmTime,
it.name = value.fieldRegionName; name: value.fieldRegionName,
};
this.data.push(it); this.data.push(it);
}); });
...@@ -84,20 +77,23 @@ export class AlarmPage implements OnInit { ...@@ -84,20 +77,23 @@ export class AlarmPage implements OnInit {
} }
data.map((value, index) => { data.map((value, index) => {
const it = {time: 1506743279334, con: '11111111111111111111111', name: '池子名字'}; const it = {
it.con = value.description; con: value.description,
it.time = value.alarmTime; time: value.alarmTime,
it.name = value.fieldRegionName; name: value.fieldRegionName,
};
this.data.push(it); this.data.push(it);
}); });
} else { } else {
this.itemExit = false; this.itemExit = false;
} }
this.load.offLoad();
}]); }]);
} }
choose(e) { choose(e) {
if (e.detail.value === 'day') { if (e.selectedIndex === 0) {
this.getAlarmOneDay(); this.getAlarmOneDay();
} else { } else {
this.getAlarmOneWeek(); this.getAlarmOneWeek();
......
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