diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.ts b/src/app/key-unit/key-unit-management/key-unit-management.component.ts
index 3b3fd10..72cdf68 100644
--- a/src/app/key-unit/key-unit-management/key-unit-management.component.ts
+++ b/src/app/key-unit/key-unit-management/key-unit-management.component.ts
@@ -891,7 +891,7 @@ export class KeyUnitManagementComponent implements OnInit {
console.log(element);
const dialogRef = this.dialog.open(UploadDrillComponent, {
width: "700px",
- data: { unitInfo: element },
+ data: { unitInfo: element, isEditMode: true },
});
dialogRef.afterClosed().subscribe((result) => {
diff --git a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html
index 1247ec7..0e7afc6 100644
--- a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html
+++ b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html
@@ -1,4 +1,4 @@
-
上传演练记录
+演练记录
@@ -30,21 +30,24 @@
带队人员:
-
+
熟悉时间:
-
+
调研照片:
-
-
+
+
-
-
+
+
cancel
@@ -61,11 +64,12 @@
水源照片:
-
-
+
+
-
-
+
+
cancel
@@ -75,11 +79,12 @@
疏散通道:
-
-
+
+
-
-
+
+
cancel
@@ -89,11 +94,13 @@
消控室:
-
-
+
+
-
-
+
+
cancel
diff --git a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts
index 0628272..731c91b 100644
--- a/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts
+++ b/src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts
@@ -4,6 +4,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { ObjectsService } from "@src/app/services/objects.service";
import { DatePipe } from "@angular/common";
import { MatSnackBar } from "@angular/material/snack-bar";
+import Viewer from "viewerjs";
@Component({
selector: "app-upload-drill",
templateUrl: "./upload-drill.component.html",
@@ -20,8 +21,11 @@ export class UploadDrillComponent implements OnInit {
public snackBar: MatSnackBar
) {}
+ isEditMode = true;
+
ngOnInit(): void {
console.log(this.data);
+ this.isEditMode = this.data.isEditMode;
this.getData();
}
@@ -128,6 +132,11 @@ export class UploadDrillComponent implements OnInit {
drillId;
isLoadingSave = false;
save() {
+ if (!this.isEditMode) {
+ this.dialogRef.close();
+ return;
+ }
+
if (!this.teamLeader || !this.time) {
this.snackBar.open("请输入带队人员和熟悉时间", "确定", {
verticalPosition: "top",
@@ -146,7 +155,6 @@ export class UploadDrillComponent implements OnInit {
escapeRoute: JSON.stringify(this.routePhoto),
fireControlRoom: JSON.stringify(this.fireControlPhoto),
};
- console.log(body);
if (this.isHttpPost) {
this.http.post("/api/DrillRecords", body).subscribe((data: any) => {
this.drillId = data.id;
@@ -172,4 +180,24 @@ export class UploadDrillComponent implements OnInit {
});
}
}
+
+ //查看图片
+ viewImg(url) {
+ let dom = document.getElementById(`viewerjs`);
+ let pObjs = dom.childNodes;
+ let node = document.createElement("img");
+ node.style.display = "none";
+ node.src = url;
+ node.id = "img";
+ dom.appendChild(node);
+ setTimeout(() => {
+ let viewer = new Viewer(document.getElementById(`viewerjs`), {
+ hidden: () => {
+ dom.removeChild(pObjs[0]);
+ viewer.destroy();
+ },
+ });
+ node.click();
+ }, 0);
+ }
}
diff --git a/src/app/plan-management/drill-record/drill-record.component.html b/src/app/plan-management/drill-record/drill-record.component.html
index 1602a4a..06c529f 100644
--- a/src/app/plan-management/drill-record/drill-record.component.html
+++ b/src/app/plan-management/drill-record/drill-record.component.html
@@ -1,63 +1,59 @@