fengxiang
2018-08-03 f4839b6e3fac1f877190a78c36d7affdde091efe
src/app/routes/operation/device-data/device-data.component.ts
@@ -16,17 +16,40 @@
    public get deviceData() {
        return this.deviceControllerService.data;
    }
    public get deviceStatusName() {
        if(!!this.deviceControllerService
        &&this.deviceControllerService.data
        &&this.deviceControllerService.data.state) {
            switch (this.deviceControllerService.data.state) {
                case "0":
                    return '正常';
                case "1":
                    return '轻度';
                case "2":
                    return '中度';
                case "3":
                    return '严重';
                default:
                    return '离线';
            }
        }else {
         return '离线';
        }
    }
    constructor(
        public msg: NzMessageService, 
        private http: _HttpClient,
        private deviceControllerService:DeviceControllerService,
    ) {}
    ) {
    }
    /**
     * 返回设备列表页面
     * toDeviceStatus
     */
    public toDeviceStatus() {
        this.deviceControllerService.incumbent = 'status';
    }
    ngOnInit() {
        this.http.get('/profile/advanced').subscribe((res: any) => this.data = res);
    }