From fd7b11ec894b6f8c5cc736489c0f26eec35ad3ce Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Fri, 11 May 2018 17:20:53 +0800
Subject: [PATCH] 设备 增加 行业

---
 src/app/business/entity/data.ts                                          |    1 
 src/app/routes/devices/basic-info/device-edit/device-edit.component.html |   46 ++++++++++++++--------
 src/app/routes/devices/basic-info/device-edit/device-edit.component.ts   |   22 ++++++++++-
 3 files changed, 50 insertions(+), 19 deletions(-)

diff --git a/src/app/business/entity/data.ts b/src/app/business/entity/data.ts
index 8d91a87..97b6917 100644
--- a/src/app/business/entity/data.ts
+++ b/src/app/business/entity/data.ts
@@ -99,6 +99,7 @@
   mac?: any|Column;
   monitorPoint?: any|Column;
   monitorPointId?: any|Column;
+  professionId?: any|Column;
   name?: any|Column;
   operateUser?: any|Column;
   operateUserId?: any|Column;
diff --git a/src/app/routes/devices/basic-info/device-edit/device-edit.component.html b/src/app/routes/devices/basic-info/device-edit/device-edit.component.html
index 7df6bba..b3b6f4b 100644
--- a/src/app/routes/devices/basic-info/device-edit/device-edit.component.html
+++ b/src/app/routes/devices/basic-info/device-edit/device-edit.component.html
@@ -60,6 +60,22 @@
           </div>
           <div nz-form-item  nz-row class="mb-sm">
             <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
+              <label>������������</label>
+            </div>
+            <div nz-form-control nz-col [nzSpan]="7" nzHasFeedback>
+                <nz-datepicker nzSize="large"  style="width: 100%;" formControlName="createTime" nzShowTime  [nzPlaceHolder]="'������������'"
+                [nzFormat]="'YYYY-MM-DD HH:mm:ss'" ></nz-datepicker>
+            </div>
+            <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
+              <label>������������</label>
+            </div>
+            <div nz-form-control nz-col [nzSpan]="7" nzHasFeedback>
+                <nz-datepicker nzSize="large"  style="width: 100%;" formControlName="installTime" nzShowTime  [nzPlaceHolder]="'������������'"
+                [nzFormat]="'YYYY-MM-DD HH:mm:ss'" ></nz-datepicker>
+            </div>
+          </div>
+          <div nz-form-item  nz-row class="mb-sm">
+            <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
               <label>������������</label>
             </div>
             <div nz-form-control nz-col [nzSpan]="7" nzHasFeedback>
@@ -70,29 +86,25 @@
                 </nz-select>
             </div>
             <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
-              <label>������������</label>
+              <label>������</label>
             </div>
             <div nz-form-control nz-col [nzSpan]="7" nzHasFeedback>
+                <nz-select formControlName="professionId" [nzPlaceHolder]="'������ ������������'"
+                nzAllowClear [nzFilter]="false" nzShowSearch (nzSearchChange)="monitorPointChange($event)" [nzNotFoundContent]="'������������'" >
+                  <nz-option *ngFor="let option of professions" [nzLabel]="option.name" [nzValue]="option.id" [nzDisabled]="option.disabled">
+                  </nz-option>
+                </nz-select>
+            </div>
+          </div>
+          <div nz-form-item  nz-row class="mb-sm">
+            <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
+              <label>������������</label>
+            </div>
+            <div nz-form-control nz-col [nzSpan]="10" nzHasFeedback>
                 <nz-input formControlName="address" maxlength="20" [nzPlaceHolder]="'���������������������������'">
                 </nz-input>
             </div>
           </div>
-          <div nz-form-item  nz-row class="mb-sm">
-              <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
-                <label>������������</label>
-              </div>
-              <div nz-form-control nz-col [nzSpan]="7" nzHasFeedback>
-                  <nz-datepicker nzSize="large"  style="width: 100%;" formControlName="createTime" nzShowTime  [nzPlaceHolder]="'������������'"
-                  [nzFormat]="'YYYY-MM-DD HH:mm:ss'" ></nz-datepicker>
-              </div>
-              <div nz-form-label nz-col [nzSm]="4" [nzXs]="24">
-                <label>������������</label>
-              </div>
-              <div nz-form-control nz-col [nzSpan]="7" nzHasFeedback>
-                  <nz-datepicker nzSize="large"  style="width: 100%;" formControlName="installTime" nzShowTime  [nzPlaceHolder]="'������������'"
-                  [nzFormat]="'YYYY-MM-DD HH:mm:ss'" ></nz-datepicker>
-              </div>
-            </div>
     <div class="modal-footer">
         <button nz-button type="button" (click)="close()">������</button>
         <button nz-button [nzType]="'primary'" [nzLoading]="isSaving">
diff --git a/src/app/routes/devices/basic-info/device-edit/device-edit.component.ts b/src/app/routes/devices/basic-info/device-edit/device-edit.component.ts
index c128c0f..3fa4dfb 100644
--- a/src/app/routes/devices/basic-info/device-edit/device-edit.component.ts
+++ b/src/app/routes/devices/basic-info/device-edit/device-edit.component.ts
@@ -8,7 +8,10 @@
 import { Component, OnInit } from '@angular/core';
 import { Device} from '@business/entity/data';
 import { _Validators } from '@delon/abc';
-import { PageBean } from '@business/entity/grid';
+import { PageBean, ResultBean } from '@business/entity/grid';
+import { _HttpClient } from '@delon/theme';
+import { environment } from '@env/environment';
+import { debug } from 'util';
 
 @Component({
   selector: 'app-device-edit',
@@ -17,6 +20,7 @@
 })
 export class DeviceEditComponent implements OnInit {
   public monitorPoints: any [] = [];
+  public professions: any [] = [];
   public deviceVersions: any [] = [];
   public operateUsers: any [] = [];
   public isSaving = false;
@@ -25,7 +29,8 @@
     private formBuilder: FormBuilder,
     private monitorPointService: MonitorPointService,
     private versionService: VersionService,
-    private operateUserService: OperateUserService
+    private operateUserService: OperateUserService,
+    private  http:_HttpClient
   ) { }
   data: Device;
   validateForm: FormGroup;
@@ -34,14 +39,17 @@
     this.monitorPointChange(null);
     this.deviceVersionChange(null);
     this.operateUserChange(null);
+    this.professionChange();
     if (this.data.createTime == null) {
         this.data.createTime = new Date().getTime();
     }
+    debugger;
     const validates: Device = {
          name: [data.name, [Validators.required]],
          mac: [data.mac, [Validators.required]],
          deviceVersionId: [data.deviceVersionId],
          monitorPointId: [data.monitorPointId],
+         professionId: [data.professionId],
          operateUserId: [data.operateUserId],
          address: [data.address],
          id: [data.id],
@@ -67,6 +75,16 @@
         ToolsService.markAsDirty(this.validateForm);
     }
    }
+   professionChange(){
+     this.http.get<ResultBean<any[]>>(environment.SERVER_BASH_URL+"profession/getall").subscribe(
+         result => {
+             if(!!result.code){
+                 debugger;
+                 this.professions = result.data;
+             }
+         }
+     );
+   }
    monitorPointChange(text) {
     const pageBean: PageBean = {pageIndex: 0, pageSize: 20};
     this.monitorPointService.getPagingList(pageBean, text).subscribe(

--
Gitblit v1.8.0