From 1bf1750a2c2cafdbd7413fe18d16915a7f71ff52 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Thu, 05 Jul 2018 11:54:46 +0800
Subject: [PATCH] 设备保存bug修复
---
src/app/routes/devices/basic-info/device-edit/device-edit.component.html | 2 +-
src/app/routes/devices/basic-info/device-edit/device-edit.component.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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 9816dc7..e9400e4 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
@@ -117,7 +117,7 @@
</nz-select>
<button nz-button type="button" (click)="close()">������</button>
- <button nz-button [nzType]="'primary'" [nzLoading]="isSaving">
+ <button nz-button [nzType]="'primary'" (click)="save(null,validateForm.value,validateForm.valid)" [nzLoading]="isSaving">
<span>
������
<span *ngIf="isSaving">���</span>
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 26d687b..fe4d7da 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
@@ -115,7 +115,7 @@
this.subject.destroy();
}
save($event, value, valid) {
- $event.preventDefault();
+ const _prevent = !!$event ? $event.preventDefault() : null ;
if (valid) {
this.isSaving = true;
this.data = value;
--
Gitblit v1.8.0