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

alarm页面修改

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