From 417690c620e87ab3053fbee7b3f1c236d3cb1b55 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Thu, 20 May 2021 17:21:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E9=A2=84=E6=A1=88=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry-plan-look.component.ts | 57 +++++++--- src/app/ui/plan-template/addKeyname.html | 35 +++++++ src/app/ui/plan-template/addKeyname.scss | 77 ++++++++++++++ .../plan-template.component.html | 35 ++++++- .../plan-template.component.scss | 97 ++++++++++++++++++ .../plan-template/plan-template.component.ts | 70 ++++++++++++- src/app/ui/ui-routing.module.ts | 10 ++ src/app/ui/ui.module.ts | 12 ++- src/assets/images/add.png | Bin 0 -> 553 bytes src/assets/images/deleteblue.png | Bin 0 -> 366 bytes src/assets/images/deletehui.png | Bin 0 -> 335 bytes src/assets/images/updatehui.png | Bin 0 -> 345 bytes 12 files changed, 375 insertions(+), 18 deletions(-) create mode 100644 src/app/ui/plan-template/addKeyname.html create mode 100644 src/app/ui/plan-template/addKeyname.scss create mode 100644 src/assets/images/add.png create mode 100644 src/assets/images/deleteblue.png create mode 100644 src/assets/images/deletehui.png create mode 100644 src/assets/images/updatehui.png 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 6658908..786cab4 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 @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; -import { HttpClient,HttpHeaders } from '@angular/common/http' +import { HttpClient,HttpHeaders,HttpErrorResponse } from '@angular/common/http' import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; @@ -184,16 +184,48 @@ export class EntryPlanLookComponent implements OnInit { } //编辑预案 editPlan(e){ - if(e.planMode == 2){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",this.companyId) - sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","1") - sessionStorage.setItem("planName",e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') + if (isTrue){ + if(e.planType == 1){ //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId",id) + sessionStorage.setItem("companyId",this.companyId) + sessionStorage.setItem("buildingTypeId",this.unittypeId) + sessionStorage.setItem("editable","1") + sessionStorage.setItem("planName",e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); + } + else if(e.planType==16){ + this.lookPlan(e) + // let body={ + // // id:e.planId, + // // resetAudit:true + // "" + // } + let body = JSON.stringify(""); + let resetAudit=true + let headers = new HttpHeaders({ + 'Content-Type': 'text/json' + }); + let options = { + headers + }; + this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data=>{ + this.getAllPlanComponents() + },err => { + this.snackBar.open(err,'确定',config); + }) + } + else{ + + this.snackBar.open('只有二维预案和文本预案可以编辑!','确定',config); + } } + } allPlanComponents:any //所有预案组件 companyId : any //新建预案需要使用的id @@ -257,6 +289,7 @@ export class EntryPlanLookComponent implements OnInit { } //删除预案 deletePlan(plandata){ + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -266,8 +299,6 @@ export class EntryPlanLookComponent implements OnInit { this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data=>{ this.snackBar.open('删除成功!','确定',config); this.getAllPlanComponents() - },err => { - this.snackBar.open(err,'确定',config); }) }else{ this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data=>{ @@ -276,8 +307,6 @@ export class EntryPlanLookComponent implements OnInit { config.duration = 3000 this.snackBar.open('删除成功!','确定',config); this.getAllPlanComponents() - },err => { - this.snackBar.open(err,'确定',config); }) } } diff --git a/src/app/ui/plan-template/addKeyname.html b/src/app/ui/plan-template/addKeyname.html new file mode 100644 index 0000000..0252f14 --- /dev/null +++ b/src/app/ui/plan-template/addKeyname.html @@ -0,0 +1,35 @@ + +
+
+ 新增预案模板 +
+
+ + + + +
+ + +
+ + + + Ⅲ级 + Ⅳ级 + Ⅴ级 + + +
+
+ + +
+
\ No newline at end of file diff --git a/src/app/ui/plan-template/addKeyname.scss b/src/app/ui/plan-template/addKeyname.scss new file mode 100644 index 0000000..9270aa9 --- /dev/null +++ b/src/app/ui/plan-template/addKeyname.scss @@ -0,0 +1,77 @@ +.box{ + height: 100%; + width: 100%; + display: flex; + flex-direction: column; +} +.queryField { + margin: 3px 5px; + input { + width: 100%; + height: 18px; + line-height: 18px; + border-radius: 3px;} + button{ + width: 140px; + font-size: 16px; + } + } + .top{ + width: 100%; + margin-bottom: 20px; + span{ + color: #2196F3; + margin-left: 100px; + font-size: 18px; + } + } + .bottom{ + margin: 10% 30px; + button{ + width: 80px; + height: 36px; + font-size: 16px; + } + } + .fileinput-button { + width: 148px; + height: 36px; + top: 10px; + position: relative; + display: inline-block; + overflow: hidden; + background-color: #2196F3; + color: #FFFFFF; + font-size: 16px; +} + +.fileinput-button input{ + position: absolute; + right: 0px; + top: 0px; + opacity: 0; + -ms-filter: 'alpha(opacity=0)'; +} + +.uping{ + display:flex; + .upclass{ + margin-left: 3px; + height: 30px; + } + .progress{ + position: relative; + top:3% + } + button{ + width: 80px; + height: 30px; + font-size: 10px; + margin-top: 5px; + } + span{ + font-size: 10px; + position: relative; + top: 8px; + } +} diff --git a/src/app/ui/plan-template/plan-template.component.html b/src/app/ui/plan-template/plan-template.component.html index 30676bb..5dfda59 100644 --- a/src/app/ui/plan-template/plan-template.component.html +++ b/src/app/ui/plan-template/plan-template.component.html @@ -1 +1,34 @@ -

plan-template works!

+ +
+
+
+
+ 预案列表 +
+
+ + 新增 +
+
+
+
+
+ {{item.name}} +
+
+ {{item.level}} + + +
+
+
+
+
+
diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss index e69de29..a10162d 100644 --- a/src/app/ui/plan-template/plan-template.component.scss +++ b/src/app/ui/plan-template/plan-template.component.scss @@ -0,0 +1,97 @@ +/* + * @Descripttion: + * @version: + * @Author: sueRimn + * @Date: 2021-05-19 15:50:20 + * @LastEditors: sueRimn + * @LastEditTime: 2021-05-20 15:46:44 + */ +.box{ + height: 97%; + width: 100%; + padding: 10px; + background-color: #F7F8FA; + display: flex; + .boxleft{ + width: 20%; + height: 100%; + background-color: #FFFFFF; + display: flex; + flex-direction: column; + .lefthead{ + height: 50px; + width: 100%; + display: flex; + border-bottom: 1px solid #F7F8FA; + span{ + font-size: 16px; + } + .leftheadone{ + width: 40%; + height: 100%; + span{ + margin: 10px 10px; + height: 50px; + line-height: 50px; + } + } + .leftheadtwo{ + width: 20%; + height: 100%; + margin-left: 50%; + cursor: pointer; + img{ + position: relative; + top: 2px; + } + span{ + //margin-left: 70%; + //margin: 10px 10px; + height: 50px; + line-height: 50px; + } + } + } + .leftbox{ + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + .leftbody{ + width: 100%; + height: 40px; + display: flex; + .bodyname{ + height: 40px; + width: 60%; + span{ + font-size: 16px; + height: 40px; + line-height: 40px; + margin-left: 10px; + } + } + .bodycz{ + height: 40px; + width: 40%; + img{ + margin-left: 10px; + } + span{ + color: #B2BEC7; + font-size: 16px; + height: 40px; + line-height: 40px; + margin-left: 30%; + } + } + } + } + } + .boxright{ + margin-left: 10px; + height: 100%; + width: 78%; + background-color: #FFFFFF; + } +} \ No newline at end of file diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index aa1241b..3067ad3 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -1,4 +1,15 @@ -import { Component, OnInit } from '@angular/core'; +/* + * @Descripttion: + * @version: + * @Author: sueRimn + * @Date: 2021-05-19 15:50:20 + * @LastEditors: sueRimn + * @LastEditTime: 2021-05-20 17:02:03 + */ +import { Component, Inject, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http' +import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @Component({ selector: 'app-plan-template', @@ -7,9 +18,64 @@ import { Component, OnInit } from '@angular/core'; }) export class PlanTemplateComponent implements OnInit { - constructor() { } + constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } ngOnInit(): void { + + } + + //获取左侧单位信息 + newleftTabledata=[] + getLeftdata(){ + /* this.http.get("/api/PlanTemplate").subscribe((data:any)=>{ + this.leftTabledata=data + console.log(this.leftTabledata) + }) */ + } + //新建预案弹窗 + addKeyunit(){ + const dialogRef = this.dialog.open(addPlanname, {//调用open方法打开对话框并且携带参数过去 + width: '340px', + height:'330px', + disableClose:true + + }); + dialogRef.afterClosed().subscribe(result => { + this.newleftTabledata.push(result) + console.log(this.newleftTabledata); + }); } } +//新建预案 +@Component({ + selector: 'addPlanname', + templateUrl: './addKeyname.html', + styleUrls: ['./addKeyname.scss'] +}) +export class addPlanname{ + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + unitname//预案名称 + level//预案级别 + //取消按钮 + close(){ + this.dialogRef.close(); + } + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.unitname==''){ + this.snackBar.open('请输入预案名称!','确定',config); + } + else if(this.level==undefined||this.level==''){ + this.snackBar.open('请输入预案级别!','确定',config); + }else{ + let planData={ + name:this.unitname, + level:this.level + } + this.dialogRef.close(planData) + } + } +} diff --git a/src/app/ui/ui-routing.module.ts b/src/app/ui/ui-routing.module.ts index 0ce7227..b8bf4c7 100644 --- a/src/app/ui/ui-routing.module.ts +++ b/src/app/ui/ui-routing.module.ts @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: sueRimn + * @Date: 2021-01-29 15:54:45 + * @LastEditors: sueRimn + * @LastEditTime: 2021-05-20 10:14:47 + */ import { Routes, RouterModule } from '@angular/router'; import { NgModule } from '@angular/core'; import { UiComponent } from './ui.component'; @@ -15,6 +23,7 @@ import {UnitInformationComponent} from './unit-information/unit-information.comp import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component'; import { FireFightingFacilitiesFormworkComponent } from './fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component' import { CollectionToolsComponent } from './collection-tools/collection-tools.component'; +import { PlanTemplateComponent } from './plan-template/plan-template.component' @@ -34,6 +43,7 @@ const routes: Routes = [ { path: 'enterpriseuser', component:EnterpriseuserComponent }, { path: 'fireFightingFacilitiesFormwork', component:FireFightingFacilitiesFormworkComponent }, { path: 'collectionTools', component:CollectionToolsComponent }, + { path: 'PlanTemplate', component:PlanTemplateComponent }, ]; @NgModule({ diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index 4ce10cf..0b8a357 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -85,8 +85,18 @@ import { editPlaneFigureComponentPlan, leftFunctionalDomainComponentPlan } from import {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding} from './collection-tools-building/collection-tools.component' import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent} from './collection-tools-building/leftFunctionalDomain'; import { PlanTemplateComponent } from './plan-template/plan-template.component' +import { addPlanname } from './plan-template/plan-template.component' @NgModule({ - declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,Organization, PlanTemplateComponent], + declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent, + IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization, + seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus, + NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent, + editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute, + seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent, + addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent, + CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent, + CreateBuildingPlan,EditBuildingPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding, + EditBuildingBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,Organization, PlanTemplateComponent,addPlanname], imports: [ CommonModule, diff --git a/src/assets/images/add.png b/src/assets/images/add.png new file mode 100644 index 0000000000000000000000000000000000000000..31402272f7cfc490b7bc551563bf7c8c024e8cf3 GIT binary patch literal 553 zcmV+^0@nSBP)4f25dOZs6GV3df!k=Ixm`#p7`p>gc!iL{(jOqG5N{0uv9P}HLZ#=L6Y%)D>DnfDEG=-4~SMM>obL>390 zQ(*xy#9XEwQa;2W)k&h(z;C##fnowh%W1=t8%QxgEN4}b{(!&L(7$8X`khiKLUFdO1A zzfldR?!_GqSQ@95D}&`zFAMdlp(-6X)5Q#CJ3lU0wDF5VNV$~lnWPIrBL&wOMPBII zKmQVylCo(!8e~(5UiekNT1fd|ACk6WBEUBi&jhl+Oq>(JH3GHC%Ty|Lek;CEIf0vM r`$);w8DJ>D^YJe{`FPKGTW0nf&}0K!Mb$7L00000NkvXXu0mjfkxKOw literal 0 HcmV?d00001 diff --git a/src/assets/images/deleteblue.png b/src/assets/images/deleteblue.png new file mode 100644 index 0000000000000000000000000000000000000000..dbb906a2023a3797e1562c9650c9a3e27c70054b GIT binary patch literal 366 zcmV-!0g?WRP)Y5Ph?pA|V$L0*VINbO9Uf?feUZjg3Xn%e9u4mbP~%q|jFIFWA}HXlEhh5ETVM z$Q^zzJFTjMoD( zzlAN^DMm8jQTpZlO8yUt9|Z(hotE9K`%#+#RoD}=$;QO{oywE+;@OW^t<1TQvEvpl zx3Rw_A+6V#(33nah*4!BPWoRYS^EXAyCMXwW)bx3TJ!0RTRAiLFUj81&t$^Ox&QzG M07*qoM6N<$g4$}RN&o-= literal 0 HcmV?d00001 diff --git a/src/assets/images/deletehui.png b/src/assets/images/deletehui.png new file mode 100644 index 0000000000000000000000000000000000000000..538aced785c5520c0e5f3b453ae094f89cf6be7c GIT binary patch literal 335 zcmV-V0kHmwP)A-C#I$tKfmrXu0M~CJ}>44m6l727iXZf3S!)!=Z;!UJ=h=G}unCu7^Qz zH@GA3V9&?099P8Pi{CfjFf+^}8s3!~>{7T0S0eVdZ0D>FXMK=57cVLvO1dL>s#>QR?@iFubYy?Xks~}_*LNb9gDN+ii zOlcwPfXQCjm5iHYli6h2JLk;(8$yO7{q{Ct@DApOa>>0;B4pzY49)|z0p`1M$-NqJ za|Qn}zI32Petqo*%$G^YOu-~vITrosRasMyL^vIW?0E<7bE;q_?5iTcRRVQ1>7$Ae z-&2A`;3%Up!J_b(U>Vp5WVKnK9MyrpZkvXs)I2%%xP+IQItSr?@DuKw92UEAw==*d zgOOlJ*z&}FFDpDH0MG)U8N8Pq)x2$uOL%&1?5?ajw`M(=`hgQ%M02*Sy7ezu1@cXu rIY7a7F)bbfA0&PCNx