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 0000000..3140227 Binary files /dev/null and b/src/assets/images/add.png differ diff --git a/src/assets/images/deleteblue.png b/src/assets/images/deleteblue.png new file mode 100644 index 0000000..dbb906a Binary files /dev/null and b/src/assets/images/deleteblue.png differ diff --git a/src/assets/images/deletehui.png b/src/assets/images/deletehui.png new file mode 100644 index 0000000..538aced Binary files /dev/null and b/src/assets/images/deletehui.png differ diff --git a/src/assets/images/updatehui.png b/src/assets/images/updatehui.png new file mode 100644 index 0000000..ee4b534 Binary files /dev/null and b/src/assets/images/updatehui.png differ