Commit 524b9d31 authored by van.chen's avatar van.chen

中转池页面改接口

parent a6970763
...@@ -47,7 +47,6 @@ export class AlarmPage implements OnInit { ...@@ -47,7 +47,6 @@ export class AlarmPage implements OnInit {
this.api.alarm.getAlarmByTerm([req, (data) => { this.api.alarm.getAlarmByTerm([req, (data) => {
this.data = []; this.data = [];
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
console.log(data.length);
if (data.length > 0) { if (data.length > 0) {
this.itemExit = true; this.itemExit = true;
} else { } else {
...@@ -78,7 +77,6 @@ export class AlarmPage implements OnInit { ...@@ -78,7 +77,6 @@ export class AlarmPage implements OnInit {
this.api.alarm.getAlarmByTerm([req, (data) => { this.api.alarm.getAlarmByTerm([req, (data) => {
this.data = []; this.data = [];
if (data && data.constructor === Array) { if (data && data.constructor === Array) {
console.log(data.length);
if (data.length > 0) { if (data.length > 0) {
this.itemExit = true; this.itemExit = true;
} else { } else {
...@@ -101,10 +99,8 @@ export class AlarmPage implements OnInit { ...@@ -101,10 +99,8 @@ export class AlarmPage implements OnInit {
choose(e) { choose(e) {
if (e.detail.value === 'day') { if (e.detail.value === 'day') {
this.getAlarmOneDay(); this.getAlarmOneDay();
console.log(e.detail.value);
} else { } else {
this.getAlarmOneWeek(); this.getAlarmOneWeek();
console.log(e.detail.value);
} }
} }
......
...@@ -79,4 +79,6 @@ ...@@ -79,4 +79,6 @@
padding-top: 1px; padding-top: 1px;
width: 70px; width: 70px;
margin-left: 52px; margin-left: 52px;
height: 21px;
float: right;
} }
...@@ -3,98 +3,50 @@ ...@@ -3,98 +3,50 @@
(onLeftClick)="onLeftClick()" (onLeftClick)="onLeftClick()"
style="background-color: #28c9bd" style="background-color: #28c9bd"
> >
东中转池控制 {{fieldRegionName}}控制
</Navbar> </Navbar>
<div class="topPart"> <div class="topPart">
<!--<div class="online" *ngFor="let one of items">--> <ListItem multipleLine *ngIf="this.yewei">
<!--<div class="label">{{one.label}}</div>-->
<!--<div class="btn">-->
<!--<ion-toggle mode="md" color="primary" (ionChange)="toggle(one.type, $event)"></ion-toggle>-->
<!--</div>-->
<!--</div>-->
<ListItem multipleLine>
当前液位: 当前液位:
<div class="process"> <div class="process">
<div class="inlineProcess" [ngStyle]="{width: proc + '%'}" <div [class]="'inlineProcess ' + color" [ngStyle]="{width: proc + '%'}">
[ngClass]="{'orange': yewei < 3 && yewei > 2.5, 'red': yewei > 3}">
</div> </div>
</div> </div>
{{yewei.toFixed(2)}}m {{yewei.toFixed(2)}}m
</ListItem> </ListItem>
<ListItem multipleLine> <ListItem multipleLine *ngIf="this.temp">
当前温度: 当前温度:
<div style="display: inline-block;margin-left: calc(100% - 145px);vertical-align: middle"> <div style="display: inline-block;margin-left: calc(100% - 145px);vertical-align: middle">
{{temp}}℃ {{temp.toFixed(2)}}℃
</div>
</ListItem>
<ListItem multipleLine [extra]="s1">
南水
</ListItem>
<ListItem multipleLine *ngIf="nanClicked">
选择开启时间
<Stepper class="stepClass" [(ngModel)]="duration" [min]="1" [showNumber]="true"></Stepper>分钟
<div style="text-align: right;padding-top: 10px">
<div Button style="margin-right: 10px" class="btn" (click)="cancel()" [inline]="true" [size]="'small'" [type]="'default'">取消</div>
<div Button (click)="confirm(0)" class="btn" [inline]="true" [size]="'small'" [type]="'primary'">确认</div>
</div>
</ListItem>
<ListItem multipleLine [extra]="s2">
北水
</ListItem>
<ListItem multipleLine *ngIf="beiClicked">
选择开启时间
<Stepper class="stepClass" [(ngModel)]="duration" [min]="1" [showNumber]="true"></Stepper>分钟
<div style="text-align: right;padding-top: 10px">
<div Button style="margin-right: 20px" class="btn" (click)="cancel()" [inline]="true" [size]="'small'" [type]="'default'">取消</div>
<div Button (click)="confirm(1)" class="btn" [inline]="true" [size]="'small'" [type]="'primary'">确认</div>
</div> </div>
</ListItem> </ListItem>
<div *ngFor="let a of nb;let i = index">
<ListItem multipleLine [extra]="a.fieldDeviceName === '南水' ? s1 : s2">
{{a.fieldDeviceName}}
</ListItem>
<ListItem multipleLine *ngIf="a.fieldDeviceName === '南水' ? nanClicked : beiClicked">
选择开启时间
<Stepper class="stepClass" [(ngModel)]="duration" [min]="1" [showNumber]="true"></Stepper>分钟
<div style="text-align: right;padding-top: 10px">
<div Button style="margin-right: 10px" class="btn" (click)="cancel()" [inline]="true" [size]="'small'" [type]="'default'">取消</div>
<div Button (click)="confirm(a)" class="btn" [inline]="true" [size]="'small'" [type]="'primary'">确认</div>
</div>
</ListItem>
</div>
</div> </div>
<div class="bottomPart"> <div class="bottomPart">
<ListItem multipleLine [extra]="s3"> <ListItem multipleLine *ngFor="let a of devices;let i = index">
一号搅拌器 {{a.fieldDeviceName}}
<v-switch [value]="a.value" (click)="toggle(a)" [loading]="a.loading"></v-switch>
</ListItem> </ListItem>
<ListItem multipleLine [extra]="s4">
二号搅拌器
</ListItem>
<!--<ListItem multipleLine [extra]="s5">-->
<!--三号搅拌器-->
<!--</ListItem>-->
<!--<ListItem multipleLine [extra]="s6">-->
<!--四号搅拌器-->
<!--</ListItem>-->
<!--<ListItem multipleLine [extra]="s7">-->
<!--一号泵-->
<!--</ListItem>-->
<!--<ListItem multipleLine [extra]="s8">-->
<!--二号泵-->
<!--</ListItem>-->
</div> </div>
</div> </div>
<ng-template #icon> <ng-template #icon>
<span class="vo v-back"></span> <span class="vo v-back"></span>
</ng-template> </ng-template>
<ng-template #s1> <ng-template #s1>
<v-switch [value]="value[0]" [disabled]="beiLoading || value[0] || value[1]" (click)="toggle(0)" [loading]="nanLoading"></v-switch> <v-switch [value]="value[0]" [disabled]="beiLoading || value[0] || value[1]" (click)="toggleNb(0)" [loading]="nanLoading"></v-switch>
</ng-template> </ng-template>
<ng-template #s2> <ng-template #s2>
<v-switch [value]="value[1]" [disabled]="nanLoading || value[0] || value[1]" (click)="toggle(1)" [loading]="beiLoading"></v-switch> <v-switch [value]="value[1]" [disabled]="nanLoading || value[0] || value[1]" (click)="toggleNb(1)" [loading]="beiLoading"></v-switch>
</ng-template>
<ng-template #s3>
<v-switch [value]="value[2]" (click)="toggle(2)" [loading]="loading2"></v-switch>
</ng-template>
<ng-template #s4>
<v-switch [value]="value[3]" (click)="toggle(3)" [loading]="loading3"></v-switch>
</ng-template>
<ng-template #s5>
<v-switch [value]="value[4]" [disabled]="true"></v-switch>
</ng-template>
<ng-template #s6>
<v-switch [value]="value[5]" [disabled]="true"></v-switch>
</ng-template>
<ng-template #s7>
<v-switch [value]="value[6]" [disabled]="true"></v-switch>
</ng-template>
<ng-template #s8>
<v-switch [value]="value[7]" [disabled]="true"></v-switch>
</ng-template> </ng-template>
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
height: 20px; height: 20px;
} }
.orange {
background-color: #ffa847;
}
.red { .red {
background-color: #f04844; background-color: #f04844;
} }
......
This diff is collapsed.
...@@ -83,7 +83,6 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -83,7 +83,6 @@ export class HomePage implements OnInit, OnDestroy {
this.load.toLoad('加载中...', false); this.load.toLoad('加载中...', false);
} }
this.api.app.getAll(['', (data) => { this.api.app.getAll(['', (data) => {
console.log(data);
if (data.constructor === Array) { if (data.constructor === Array) {
this.data = data; this.data = data;
} else { } else {
...@@ -107,9 +106,9 @@ export class HomePage implements OnInit, OnDestroy { ...@@ -107,9 +106,9 @@ export class HomePage implements OnInit, OnDestroy {
pullToRefresh(event) { pullToRefresh(event) {
if (event === 'endReachedRefresh') { if (event === 'endReachedRefresh') {
console.log(11111111111111); // console.log(11111111111111);
} else { } else {
console.log(22222222222222); // console.log(22222222222222);
} }
} }
} }
...@@ -48,6 +48,11 @@ export class Api { ...@@ -48,6 +48,11 @@ export class Api {
getLatestAlarm: (data) => this.trans('get', '/alarm/getLatestAlarm', data) getLatestAlarm: (data) => this.trans('get', '/alarm/getLatestAlarm', data)
}; };
public control = {
controlBatchSwitch: (data) => this.trans('post', '/control/controlBatchSwitch', data),
controlSwitch: (data) => this.trans('post', '/control/controlSwitch', data),
};
private trans(type, addr, data) { private trans(type, addr, data) {
this.sendHttpReq(type, addr, data[0], data[1], data[2], data[3]); this.sendHttpReq(type, addr, data[0], data[1], data[2], data[3]);
} }
......
...@@ -39,7 +39,6 @@ export class Mqtt { ...@@ -39,7 +39,6 @@ export class Mqtt {
this.msg = 'mqtt连接成功'; this.msg = 'mqtt连接成功';
this.client.subscribe(this.topic); this.client.subscribe(this.topic);
this.client.on('message', (a, b) => { this.client.on('message', (a, b) => {
console.log(b.toString());
this.localNotifications.schedule([{ this.localNotifications.schedule([{
title: '牧场报警', title: '牧场报警',
text: JSON.parse(b.toString())[0].description, text: JSON.parse(b.toString())[0].description,
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
export const environment = { export const environment = {
production: false, production: false,
url: 'http://pasture.witium.com/api', // 对外访问测试网地址 // url: 'http://pasture.witium.com/api', // 对外访问测试网地址
// url: 'http://cloud-test.witium.com:8096', // 测试 // url: 'http://cloud-test.witium.com:8096', // 测试
// 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:8094', // 测试 // url: 'http://172.16.1.13:8094', // 测试
}; };
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
......
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