-
+
+
diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss
index 39680d4..5848e9f 100644
--- a/src/app/ui/plan-template/plan-template.component.scss
+++ b/src/app/ui/plan-template/plan-template.component.scss
@@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-19 15:50:20
* @LastEditors: sueRimn
- * @LastEditTime: 2021-06-01 16:46:43
+ * @LastEditTime: 2021-06-03 16:57:21
*/
.box{
height: 97%;
@@ -245,12 +245,12 @@
}
th{
- background-color: #F9F9F9;
+ background-color: #E8E9E9;
height: 40px;
font-size: 16px;
text-align: center;
input{
- background-color: #FFFFFF;
+ //background-color: #FFFFFF;
text-align: center;
height: 100%;
width: 100%;
@@ -259,6 +259,9 @@
outline: none;
}
}
+ textarea{
+ width: 100%;
+ }
}
}
.attackRight{
@@ -271,4 +274,12 @@
}
}
}
+}
+//滚动条样式
+::-webkit-scrollbar {
+ width: 6px;
+ background-color: white;
+}
+::-webkit-scrollbar-thumb {
+ background-color: #2196f3;
}
\ 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 660219b..5c28b50 100644
--- a/src/app/ui/plan-template/plan-template.component.ts
+++ b/src/app/ui/plan-template/plan-template.component.ts
@@ -1,10 +1,26 @@
+/*
+ * @Descripttion:
+ * @version:
+ * @Author: sueRimn
+ * @Date: 2021-05-31 10:40:01
+ * @LastEditors: sueRimn
+ * @LastEditTime: 2021-06-03 17:08:37
+ */
+/*
+ * @Descripttion:
+ * @version:
+ * @Author: sueRimn
+ * @Date: 2021-05-31 10:40:01
+ * @LastEditors: sueRimn
+ * @LastEditTime: 2021-06-02 09:22:24
+ */
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-19 15:50:20
* @LastEditors: sueRimn
- * @LastEditTime: 2021-06-01 16:39:49
+ * @LastEditTime: 2021-06-02 09:18:05
*/
import { Component, Inject, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@@ -144,11 +160,11 @@ export class PlanTemplateComponent implements OnInit {
if(this.unitName==undefined){
this.snackBar.open('请选择预案模板!','确定',config);
}else{
- this.newleftTabledata.forEach((value,index,array)=>{
+ /* this.newleftTabledata.forEach((value,index,array)=>{
if(array[index].buildingTypeId==this.buildingTypeId){
this.group=array[index].data
}
- })
+ }) */
const dialogRef = this.dialog.open(addGroup, {//调用open方法打开对话框并且携带参数过去
width: '240px',
height:'590px',
@@ -172,7 +188,7 @@ export class PlanTemplateComponent implements OnInit {
})
});
}
- //console.log(this.newleftTabledata)
+ console.log(this.newleftTabledata)
}
//删除分组
@@ -189,8 +205,10 @@ export class PlanTemplateComponent implements OnInit {
this.newleftTabledata[this.leftclicki].data=this.group
}
//新增属性
+ groupName
addAttribute(groupName){
this.groupPanle=true
+ this.groupName=groupName
if(groupName=='单位概况'){
const dialogRef = this.dialog.open(adddwsurvey, {//调用open方法打开对话框并且携带参数过去
width: '240px',
@@ -199,7 +217,7 @@ export class PlanTemplateComponent implements OnInit {
data:this.group
});
dialogRef.afterClosed().subscribe(result => {
- console.log(result)
+ //console.log(result)
if(result!=undefined){
this.group.forEach((value,index,array)=>{
if(array[index].groupName=='单位概况'){
@@ -209,6 +227,30 @@ export class PlanTemplateComponent implements OnInit {
}
//console.log(this.newleftTabledata)
});
+ }else if(groupName=='灾情设定'){
+ const dialogRef = this.dialog.open(disaster, {//调用open方法打开对话框并且携带参数过去
+ width: '340px',
+ height:'400px',
+ disableClose:true,
+ data:this.group
+ });
+ dialogRef.afterClosed().subscribe(result => {
+ console.log(result)
+ if(result!=undefined){
+ this.group.forEach((value,index,array)=>{
+ if(array[index].groupName=='灾情设定'){
+ if(array[index].attribute==undefined){
+ array[index].attribute=[]
+ array[index].attribute.push(result)
+ }else{
+ array[index].attribute.push(result)
+ }
+
+ }
+ })
+ }
+ console.log(this.newleftTabledata)
+ });
}
}
//删除具体属性
@@ -232,7 +274,13 @@ export class PlanTemplateComponent implements OnInit {
danweiInfTable=[]
addAttInfo(surveyName){
if(surveyName=='进攻通道'){
- this.attack.push({head:'进出口',tableth:[]})
+ if(this.group[0].attribute[4].attinf==undefined){
+ this.group[0].attribute[4].attinf=[]
+ this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true})
+ }else{
+ this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true})
+ }
+
}else{
this.attPanle=true
const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去
@@ -273,7 +321,7 @@ export class PlanTemplateComponent implements OnInit {
//array[index].attribute[i].completed=false
attarr[i].attinf.forEach((attinfValue,attinfi,attinfarr) => {
if(attinfValue.propertyName==propertyName){
- attinfarr[attinfi].completed=false
+ attinfarr[attinfi].splice(attinfi,i)
}
});
}
@@ -284,7 +332,7 @@ export class PlanTemplateComponent implements OnInit {
this.newleftTabledata[this.leftclicki].data=this.group
console.log(this.newleftTabledata)
}
- //消防设施具体属性编辑
+ //消防设施表格具体属性编辑
fileAdd(facilityItems,filei){
const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去
width: '240px',
@@ -309,7 +357,7 @@ export class PlanTemplateComponent implements OnInit {
console.log(this.newleftTabledata)
});
}
- //消防设施具体属性删除
+ //消防设施表格具体属性删除
fileDel(i,f){
let isTrue = confirm('您确定要删除该条信息吗')
if(isTrue){
@@ -318,9 +366,50 @@ export class PlanTemplateComponent implements OnInit {
}
//进攻通道
- attack=[]
- attackAdd(){
- this.attack.length+1
+
+ //进攻通道,灾情设定增加表格数据
+ attackAdd(name,i){
+ //console.log(name,i)
+ if(name=='进攻通道'){
+ this.group[0].attribute[4].attinf[i].tableth.push('')
+ }else if(name=='灾情设定'){
+ this.group[1].attribute[i].tableth.push('')
+ }
+ console.log(this.newleftTabledata)
+ }
+ //进攻通道,消防设施一级菜单删除
+ delattAndfileOne(groupName,surveyName,indexOne){
+ let isTrue = confirm('您确定要删除该条信息吗')
+ if(isTrue){
+ this.group.forEach((value,index,array)=>{
+ if (array[index].groupName==groupName) {
+ array[index].attribute.forEach((element,i,attarr) => {
+ if(element.surveyName==surveyName){
+ if(surveyName=='消防设施'){
+ element.attinf[indexOne].completed=false
+ }
+ else{
+ element.attinf.splice(indexOne,1)
+ }
+ }
+ });
+ }
+ })
+ }
+ this.newleftTabledata[this.leftclicki].data=this.group
+ console.log(this.newleftTabledata)
+ }
+ //input key值,一个字符焦点消失问题
+ trackByFn(index){
+ return index
+ }
+ //灾情设定删除一条
+ delDisaster(i){
+ let isTrue = confirm('您确定要删除该条信息吗')
+ if(isTrue){
+ this.group[1].attribute.splice(i,1)
+ }
+
}
//保存
save(){
@@ -501,8 +590,8 @@ export class addGroup{
]
groupName=[]
ngOnInit(): void{
- //console.log(this.data)
- if(this.data.length!=0||this.data!=null){
+ console.log(this.data)
+ if(this.data!=null){
this.addgtoup=this.data
}
@@ -656,4 +745,44 @@ defineClick(){
this.dialogRef.close(this.data.surveyName=='单位基本信息'?this.addAttinf:this.data.surveyName=='建筑信息'?
this.addAttinfBuild:this.data.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems)
}
-}
\ No newline at end of file
+}
+
+//灾情设定弹窗
+@Component({
+ selector: 'disaster',
+ templateUrl: './Disaster.html',
+ styleUrls: ['./addKeyname.scss']
+})
+export class disaster{
+ constructor(private http: HttpClient,public dialogRef: MatDialogRef
,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
+ ngOnInit(): void{
+ console.log(this.data)
+ }
+ level//类型
+ headName//表头名称
+ lieNumber//列数
+ //取消按钮
+ close(){
+ this.dialogRef.close();
+ }
+ //确定按钮
+ newdisaster(){
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ if(this.level==undefined||this.level==''){
+ this.snackBar.open('请选择类型!','确定',config);
+ }else if(this.headName==undefined||this.headName==''){
+ this.snackBar.open('请输入表头名称!','确定',config);
+ }else{
+ let attrubute={
+ headName:this.headName,
+ level:this.level,
+ tableth:[]
+ //lieNumber:this.lieNumber,
+ }
+ this.dialogRef.close(attrubute);
+ }
+
+ }
+}
diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts
index d1bbed9..f11828f 100644
--- a/src/app/ui/ui.module.ts
+++ b/src/app/ui/ui.module.ts
@@ -90,6 +90,7 @@ import { upPlanname } from './plan-template/plan-template.component'
import { addGroup } from './plan-template/plan-template.component'
import { adddwsurvey } from './plan-template/plan-template.component'
import { addattinf } from './plan-template/plan-template.component'
+import { disaster } from './plan-template/plan-template.component'
@NgModule({
declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,
@@ -101,7 +102,7 @@ import { addattinf } from './plan-template/plan-template.component'
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, upPlanname, addGroup, adddwsurvey, addattinf],
+ EditBuildingBuilding, leftFunctionalDomainBuildingComponent, editPlaneFigureBuildingComponent, Organization, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf,disaster],
imports: [
CommonModule,