Browse Source

[新增]预案模板管理新增预案列表弹窗

zhuzhou
chenjingyu 4 years ago
parent
commit
417690c620
  1. 41
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  2. 35
      src/app/ui/plan-template/addKeyname.html
  3. 77
      src/app/ui/plan-template/addKeyname.scss
  4. 35
      src/app/ui/plan-template/plan-template.component.html
  5. 97
      src/app/ui/plan-template/plan-template.component.scss
  6. 70
      src/app/ui/plan-template/plan-template.component.ts
  7. 10
      src/app/ui/ui-routing.module.ts
  8. 12
      src/app/ui/ui.module.ts
  9. BIN
      src/assets/images/add.png
  10. BIN
      src/assets/images/deleteblue.png
  11. BIN
      src/assets/images/deletehui.png
  12. BIN
      src/assets/images/updatehui.png

41
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 { 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 { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
@ -184,7 +184,12 @@ export class EntryPlanLookComponent implements OnInit {
} }
//编辑预案 //编辑预案
editPlan(e){ editPlan(e){
if(e.planMode == 2){ //如果是在线编辑 const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗')
if (isTrue){
if(e.planType == 1){ //如果是在线编辑
let id = e.id let id = e.id
sessionStorage.setItem("planId",id) sessionStorage.setItem("planId",id)
sessionStorage.setItem("companyId",this.companyId) sessionStorage.setItem("companyId",this.companyId)
@ -194,6 +199,33 @@ export class EntryPlanLookComponent implements OnInit {
let companyId = sessionStorage.getItem("companyId") let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); 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 //所有预案组件 allPlanComponents:any //所有预案组件
companyId : any //新建预案需要使用的id companyId : any //新建预案需要使用的id
@ -257,6 +289,7 @@ export class EntryPlanLookComponent implements OnInit {
} }
//删除预案 //删除预案
deletePlan(plandata){ deletePlan(plandata){
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -266,8 +299,6 @@ export class EntryPlanLookComponent implements OnInit {
this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data=>{ this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data=>{
this.snackBar.open('删除成功!','确定',config); this.snackBar.open('删除成功!','确定',config);
this.getAllPlanComponents() this.getAllPlanComponents()
},err => {
this.snackBar.open(err,'确定',config);
}) })
}else{ }else{
this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data=>{ this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data=>{
@ -276,8 +307,6 @@ export class EntryPlanLookComponent implements OnInit {
config.duration = 3000 config.duration = 3000
this.snackBar.open('删除成功!','确定',config); this.snackBar.open('删除成功!','确定',config);
this.getAllPlanComponents() this.getAllPlanComponents()
},err => {
this.snackBar.open(err,'确定',config);
}) })
} }
} }

35
src/app/ui/plan-template/addKeyname.html

@ -0,0 +1,35 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-20 16:11:57
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-20 17:05:21
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">新增预案模板</span>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案名称" name="companyName" autocomplete="off" [(ngModel)]="unitname" required>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择预案级别' name="unittype" [(ngModel)]="level" required>
<mat-option value="Ⅲ级">Ⅲ级</mat-option>
<mat-option value="Ⅳ级">Ⅳ级</mat-option>
<mat-option value="Ⅴ级">Ⅴ级</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="bottom">
<button mat-raised-button color="primary" (click)='newplan()'>确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
</div>

77
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;
}
}

35
src/app/ui/plan-template/plan-template.component.html

@ -1 +1,34 @@
<p>plan-template works!</p> <!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-19 15:50:20
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-20 17:03:52
-->
<div class="box">
<div class="boxleft">
<div class="lefthead">
<div class="leftheadone">
<span>预案列表</span>
</div>
<div class="leftheadtwo" (click)='addKeyunit()'>
<img src="../../../assets/images/add.png">
<span>新增</span>
</div>
</div>
<div class="leftbox">
<div class="leftbody" *ngFor="let item of newleftTabledata">
<div class="bodyname">
<span>{{item.name}}</span>
</div>
<div class="bodycz">
<span>{{item.level}}</span>
<img src="../../../assets/images/updatehui.png">
<img src="../../../assets/images/deletehui.png">
</div>
</div>
</div>
</div>
<div class="boxright"></div>
</div>

97
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;
}
}

70
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({ @Component({
selector: 'app-plan-template', selector: 'app-plan-template',
@ -7,9 +18,64 @@ import { Component, OnInit } from '@angular/core';
}) })
export class PlanTemplateComponent implements OnInit { export class PlanTemplateComponent implements OnInit {
constructor() { } constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void { 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<addPlanname>,@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)
}
}
} }

10
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 { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { UiComponent } from './ui.component'; import { UiComponent } from './ui.component';
@ -15,6 +23,7 @@ import {UnitInformationComponent} from './unit-information/unit-information.comp
import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component'; import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component';
import { FireFightingFacilitiesFormworkComponent } from './fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component' import { FireFightingFacilitiesFormworkComponent } from './fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component'
import { CollectionToolsComponent } from './collection-tools/collection-tools.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: 'enterpriseuser', component:EnterpriseuserComponent },
{ path: 'fireFightingFacilitiesFormwork', component:FireFightingFacilitiesFormworkComponent }, { path: 'fireFightingFacilitiesFormwork', component:FireFightingFacilitiesFormworkComponent },
{ path: 'collectionTools', component:CollectionToolsComponent }, { path: 'collectionTools', component:CollectionToolsComponent },
{ path: 'PlanTemplate', component:PlanTemplateComponent },
]; ];
@NgModule({ @NgModule({

12
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 {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding} from './collection-tools-building/collection-tools.component'
import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent} from './collection-tools-building/leftFunctionalDomain'; import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent} from './collection-tools-building/leftFunctionalDomain';
import { PlanTemplateComponent } from './plan-template/plan-template.component' import { PlanTemplateComponent } from './plan-template/plan-template.component'
import { addPlanname } from './plan-template/plan-template.component'
@NgModule({ @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: [ imports: [
CommonModule, CommonModule,

BIN
src/assets/images/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

BIN
src/assets/images/deleteblue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

BIN
src/assets/images/deletehui.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

BIN
src/assets/images/updatehui.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Loading…
Cancel
Save