diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
index 291f747..caaeed6 100644
--- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
+++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
@@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-06-16 13:56:54
* @LastEditors: sueRimn
- * @LastEditTime: 2021-06-22 17:16:01
+ * @LastEditTime: 2021-06-23 16:26:37
*/
import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core';
@@ -238,6 +238,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData[0].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[0].attribute})
}
this.buildingName=this.allBuildings[0].name
+ this.group=this.planTemplateData[0].building[this.clicki].body
console.log(this.planTemplateData)
})
}
@@ -280,7 +281,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
trackByFn(index) {
return index
}
- //表格增加一行
+ //灾情设定表格增加一行
addNumber = -1
addTd(key, i) {
this.addNumber++
@@ -299,7 +300,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
console.log(this.planTemplateData)
}
- //表格删除一行
+ //灾情设定表格删除一行
delTd(key, i) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@@ -318,14 +319,48 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
//单位概况左侧建筑点击事件
buildingName
clicki=0
+ group
clickBuilding(item,i){
this.buildingName=item.name
this.clicki=i
+ this.group=this.planTemplateData[0].building[this.clicki].body
+ //console.log(this.group)
}
//单位概况增加一行
- unitadd(groupName){
- if(groupName=='进攻通道'){
+ unitadd(surveyName,attacki){
+ this.addNumber++
+ if(surveyName=='进攻通道'){
+ if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr == undefined) {
+ this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr = []
+ }
+ this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.push({ tabletd: [] })
+ for (var j = 0; j < this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tableth.length; j++) {
+ if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr != undefined) {
+ this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr[this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length - 1].tabletd.push('')
+ }
+ else {
+ this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr[this.addNumber].tabletd.push('')
+ }
+ }
+ console.log(this.planTemplateData)
+ }
+ }
+ //单位概况删除一行
+ unitDel(surveyName,attacki){
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ if(surveyName=='进攻通道'){
+ if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr != undefined) {
+ this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.splice(this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length - 1, 1)
+ this.addNumber--
+ if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length == 0) {
+ this.addNumber = -1
+ }
+ } else {
+ this.snackBar.open('请先增加一行!', '确定', config);
+ }
}
}