From e967b16bd4517f98a8e9306a4c6092e2dea6a567 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Tue, 14 Aug 2018 09:09:07 +0800
Subject: [PATCH] 固定网格
---
src/app/routes/operation/device-status/device-status.component.ts | 80 +++++++++++++++++++++++++---------------
1 files changed, 50 insertions(+), 30 deletions(-)
diff --git a/src/app/routes/operation/device-status/device-status.component.ts b/src/app/routes/operation/device-status/device-status.component.ts
index dbd700b..3dbb923 100644
--- a/src/app/routes/operation/device-status/device-status.component.ts
+++ b/src/app/routes/operation/device-status/device-status.component.ts
@@ -7,12 +7,12 @@
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { SimpleTableColumn, SimpleTableComponent } from '@delon/abc';
import { Subject } from 'rxjs/Subject';
-import { CoordinatesPickerComponent } from 'app/routes/map/coordinates-picker/coordinates-picker.component';
-import { CoorPickerService } from 'app/routes/map/coordinates-picker/coordinates-picker.service';
+import { CoordinatesPickerComponent } from '../../map/coordinates-picker/coordinates-picker.component';
+import { CoorPickerService } from '../../map/coordinates-picker/coordinates-picker.service';
import { OrganizationService } from '@business/services/http/organization.service';
import { ExampleService, Criteria } from '@business/services/util/example.service';
-import { AdjustConfigComponent } from '../../devices/basic-info/adjust-config/adjust-config.component';
import { DeviceEditComponent } from '../../devices/basic-info/device-edit/device-edit.component';
+import { DeviceControllerService } from '../device-controller/device-controller.service';
@Component({
selector: 'app-device-status',
@@ -25,7 +25,7 @@
columns: SimpleTableColumn[] = [
{ title: '������', index: 'id', type: 'checkbox' },
{ title: '������', index: 'name' },
- { title: 'mac', index: 'mac' },
+ { title: 'sim', index: 'mac' },
{
title: '������',
render: 'state-badge'
@@ -35,6 +35,24 @@
{ title: '���������', index: 'operateUser.name' },
{ title: '������������', width: '100px', type: 'date', index: 'createTime' },
{ title: '������������', width: '100px', type: 'date', index: 'installTime' },
+ {
+ title: '���������',
+ buttons: [
+ {
+ text: '������',
+ type: 'none',
+ click: (record: any) => this.addOrModify(record)
+ },
+ {
+ text: '������',
+ type: 'none',
+ click: (record: any) => {
+ this.deviceControllerService.data = record;
+ this.deviceControllerService.incumbent = 'data';
+ }
+ }
+ ]
+ }
];
queryTextStream: Subject<string> = new Subject<string>();
public queryMap: {orgId?: number, mpointId?: number, devMacOrName?: string}
@@ -50,7 +68,8 @@
private modalHelper: ModalHelper,
private coorPickerService: CoorPickerService,
private organizationService: OrganizationService,
- private http: _HttpClient
+ private http: _HttpClient,
+ private deviceControllerService: DeviceControllerService,
) { }
ngOnInit() {
@@ -158,32 +177,33 @@
if (!!configMap['mpointId'] && !d['monitorPoint']) {
data['monitorPoint'] = this.getMonitorPoint(configMap['mpointId']);
}
- this.modalHelper.static(DeviceEditComponent, { data, configMap }).subscribe(
+ const isEditState = false;
+ this.modalHelper.static(DeviceEditComponent, { data,configMap,isEditState }).subscribe(
(ret: { data: any, close: Function }) => {
- // ������������
- if (ret.data['id'] != null) {
- const origData = d;
- const isModified = Object.keys(ret.data).some(
- (key: string) => {
- return ret.data[key] !== origData[key];
- }
- );
- // ������������
- if (!isModified) {
- ret.close();
- this.msgSrv.success('���������������������������');
- return;
- }
- }
- this.deviceService.save(ret.data).subscribe(
- (res: any) => {
- if (res.code === 1) {
- this.load();
- ret.close();
- this.msgSrv.success('���������������������');
- }
- }
- );
+ // // ������������
+ // if (ret.data['id'] != null) {
+ // const origData = d;
+ // const isModified = Object.keys(ret.data).some(
+ // (key: string) => {
+ // return ret.data[key] !== origData[key];
+ // }
+ // );
+ // // ������������
+ // if (!isModified) {
+ // ret.close();
+ // this.msgSrv.success('���������������������������');
+ // return;
+ // }
+ // }
+ // this.deviceService.save(ret.data).subscribe(
+ // (res: any) => {
+ // if (res.code === 1) {
+ // this.load();
+ // ret.close();
+ // this.msgSrv.success('���������������������');
+ // }
+ // }
+ // );
});
}
private getMonitorPoint(mpointId: number) {
--
Gitblit v1.8.0