From 50515a8756093331a34dc4b28d94d6c46a3086ee Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Wed, 28 Jun 2023 15:46:48 +0800
Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=85=AD=E7=86=9F=E6=82=89?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../drill-record/drill-record.component.html | 7 +-
.../drill-record/drill-record.component.ts | 2 +-
.../entry-plan-look.component.html | 1 +
.../entry-plan-look.component.ts | 13 +
.../six-familiarize.component.html | 29 +++
.../six-familiarize.component.scss | 118 +++++++++
.../six-familiarize.component.spec.ts | 25 ++
.../six-familiarize.component.ts | 106 ++++++++
.../plan-management/plan-management.module.ts | 2 +
.../six-familiarity.component.html | 115 ++++-----
.../six-familiarity.component.scss | 148 ++---------
.../six-familiarity.component.ts | 236 +++++++++---------
12 files changed, 487 insertions(+), 315 deletions(-)
create mode 100644 src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.html
create mode 100644 src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.scss
create mode 100644 src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.spec.ts
create mode 100644 src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.ts
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 06c529f..fe3b830 100644
--- a/src/app/plan-management/drill-record/drill-record.component.html
+++ b/src/app/plan-management/drill-record/drill-record.component.html
@@ -3,8 +3,8 @@
\ No newline at end of file
diff --git a/src/app/plan-management/drill-record/drill-record.component.ts b/src/app/plan-management/drill-record/drill-record.component.ts
index b4f9718..d1e588a 100644
--- a/src/app/plan-management/drill-record/drill-record.component.ts
+++ b/src/app/plan-management/drill-record/drill-record.component.ts
@@ -133,7 +133,7 @@ export class DrillRecordComponent implements OnInit {
this.http
.delete(`/api/DrillRecords/${element.id}`)
.subscribe((data: any) => {
- alert('删除成功')
+ alert("删除成功");
this.getTabledataSource();
});
}
diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html
index ef21d13..bcda96a 100644
--- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html
+++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html
@@ -131,6 +131,7 @@
操作 |
+ 六熟悉
查看
下载
diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
index 84976b4..ed394a0 100644
--- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
+++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
@@ -28,6 +28,7 @@ import Swiper from "swiper";
import { resolve } from "dns";
import { DomSanitizer } from "@angular/platform-browser";
import { EditPlanCategoryComponent } from "./edit-plan-category/edit-plan-category.component";
+import { SixFamiliarizeComponent } from "./six-familiarize/six-familiarize.component";
declare var CryptoJS;
@Component({
selector: "app-entry-plan-look",
@@ -149,6 +150,18 @@ export class EntryPlanLookComponent implements OnInit {
this.unittypeId = this.route.snapshot.queryParams.unitTypeId;
this.getAllPlanComponents();
}
+
+ sixFamiliarize(element) {
+ console.log(element);
+ const dialogRef = this.dialog.open(SixFamiliarizeComponent, {
+ width: "700px",
+ data: { planData: element, unitdata: this.unitdata, isEditMode: true },
+ });
+
+ dialogRef.afterClosed().subscribe((result) => {
+ console.log("The dialog was closed");
+ });
+ }
//查看预案
lookPlan(e) {
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
diff --git a/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.html b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.html
new file mode 100644
index 0000000..3d7a77a
--- /dev/null
+++ b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.html
@@ -0,0 +1,29 @@
+六熟悉
+
+
+
+
+ 熟悉对象:
+ {{data.unitdata.unitname}}
+
+
+ 人员数量:
+
+
+
+ 熟悉时间:
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.scss b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.scss
new file mode 100644
index 0000000..d3a5447
--- /dev/null
+++ b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.scss
@@ -0,0 +1,118 @@
+.box {
+ width: 100%;
+ position: relative;
+
+ .contentItem {
+ display: flex;
+ margin: 6px 0;
+ // border-bottom: 1px dashed rgb(180, 178, 178);
+
+ .title {
+ width: 75px;
+ color: #1890ff;
+ display: flex;
+ align-items: center;
+ }
+
+ .content {
+ flex: 1;
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: column;
+
+ div {
+ display: flex;
+ align-items: center;
+
+ input,
+ nz-range-picker {
+ flex: 1;
+ }
+ }
+
+ div {
+ margin-bottom: 8px;
+
+ .name {
+ display: inline-block;
+ width: 70px;
+ margin-right: 3px;
+ text-align: right;
+ }
+ }
+ }
+
+
+ .textbox {
+ height: 32px;
+ line-height: 32px;
+ width: 50%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+
+ }
+
+ .uploadbox {
+ position: relative;
+ display: flex;
+ align-items: center;
+
+ input {
+ width: 88px;
+ height: 32px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ opacity: 0;
+ z-index: 2;
+ cursor: pointer;
+ }
+
+ button {
+ z-index: 1;
+ cursor: pointer;
+ }
+
+ .imgbox {
+ height: 100%;
+ display: flex;
+ align-items: center;
+
+ li {
+ display: flex;
+ align-items: center;
+ position: relative;
+ }
+
+ img {
+ width: 50px;
+ height: 50px;
+ margin: 0 5px;
+ cursor: pointer;
+ }
+
+ .close {
+ position: absolute;
+ right: 0;
+ top: 0;
+ font-size: 15px;
+ cursor: pointer;
+ }
+ }
+ }
+ }
+
+ .mask {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ left: 0;
+ top: 0;
+ background: rgba(0, 0, 0, 0.2);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 3;
+ }
+}
diff --git a/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.spec.ts b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.spec.ts
new file mode 100644
index 0000000..c5ebf28
--- /dev/null
+++ b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SixFamiliarizeComponent } from './six-familiarize.component';
+
+describe('SixFamiliarizeComponent', () => {
+ let component: SixFamiliarizeComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SixFamiliarizeComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SixFamiliarizeComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.ts b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.ts
new file mode 100644
index 0000000..bc2796b
--- /dev/null
+++ b/src/app/plan-management/entry-plan-look/six-familiarize/six-familiarize.component.ts
@@ -0,0 +1,106 @@
+import { HttpClient } from "@angular/common/http";
+import { Component, OnInit, Inject } from "@angular/core";
+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-six-familiarize",
+ templateUrl: "./six-familiarize.component.html",
+ styleUrls: ["./six-familiarize.component.scss"],
+ providers: [DatePipe],
+})
+export class SixFamiliarizeComponent implements OnInit {
+ constructor(
+ public dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data: any,
+ private objectsSer: ObjectsService,
+ private http: HttpClient,
+ private datePipe: DatePipe,
+ public snackBar: MatSnackBar
+ ) {}
+
+ isEditMode = true;
+
+ ngOnInit(): void {
+ console.log(this.data);
+ this.isEditMode = this.data.isEditMode;
+ this.getData();
+ }
+
+ isHttpPost;
+ getData() {
+ this.http
+ .get("/api/SixFamiliars", {
+ params: {
+ PlanComponentId: this.data.planData.id,
+ },
+ })
+ .subscribe((data: any) => {
+ console.log("六熟悉记录数据", data);
+ if (data.totalCount === 0) {
+ this.isHttpPost = true;
+ } else {
+ this.isHttpPost = false;
+ let item = data.items[0];
+ this.familiarizeId = item.id;
+ this.memberCount = item.memberCount;
+ this.time = [item.startTime, item.endTime];
+ }
+ });
+ }
+
+ isLoading = false;
+
+ memberCount;
+ time;
+ familiarizeId;
+ isLoadingSave = false;
+ save() {
+ if (!this.isEditMode) {
+ this.dialogRef.close();
+ return;
+ }
+
+ if (!this.memberCount || !this.time) {
+ this.snackBar.open("请输入人员数量和熟悉时间", "确定", {
+ verticalPosition: "top",
+ duration: 3000,
+ });
+ return;
+ }
+ this.isLoadingSave = true;
+ let body: any = {
+ planComponentId: this.data.planData.id,
+ memberCount: this.memberCount,
+ startTime: this.datePipe.transform(this.time[0], "yyyy-MM-ddTHH:mm:ss"),
+ endTime: this.datePipe.transform(this.time[1], "yyyy-MM-ddTHH:mm:ss"),
+ };
+ if (this.isHttpPost) {
+ this.http.post("/api/SixFamiliars", body).subscribe((data: any) => {
+ this.familiarizeId = data.id;
+ this.isHttpPost = false;
+ this.isLoadingSave = false;
+ this.snackBar.open("保存成功", "确定", {
+ verticalPosition: "top",
+ duration: 3000,
+ });
+ this.dialogRef.close();
+ });
+ } else {
+ body.id = this.familiarizeId;
+ this.http
+ .put(`/api/SixFamiliars/${this.familiarizeId}`, body)
+ .subscribe((data: any) => {
+ this.isLoadingSave = false;
+ this.snackBar.open("保存成功", "确定", {
+ verticalPosition: "top",
+ duration: 3000,
+ });
+ this.dialogRef.close();
+ });
+ }
+ }
+}
diff --git a/src/app/plan-management/plan-management.module.ts b/src/app/plan-management/plan-management.module.ts
index 668124f..5a4e39d 100644
--- a/src/app/plan-management/plan-management.module.ts
+++ b/src/app/plan-management/plan-management.module.ts
@@ -94,6 +94,7 @@ import { NzDatePickerModule } from "ng-zorro-antd/date-picker";
import { NzInputModule } from "ng-zorro-antd/input";
import { NzButtonModule } from "ng-zorro-antd/button";
import { NzTreeSelectModule } from "ng-zorro-antd/tree-select";
+import { SixFamiliarizeComponent } from './entry-plan-look/six-familiarize/six-familiarize.component';
@NgModule({
declarations: [
EntryPlanComponent,
@@ -139,6 +140,7 @@ import { NzTreeSelectModule } from "ng-zorro-antd/tree-select";
EditPlanCategoryComponent,
SixFamiliarityComponent,
DrillRecordComponent,
+ SixFamiliarizeComponent,
],
imports: [
CommonModule,
diff --git a/src/app/plan-management/six-familiarity/six-familiarity.component.html b/src/app/plan-management/six-familiarity/six-familiarity.component.html
index 9319102..0516ad4 100644
--- a/src/app/plan-management/six-familiarity/six-familiarity.component.html
+++ b/src/app/plan-management/six-familiarity/six-familiarity.component.html
@@ -1,63 +1,66 @@
-
+
|