diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html index bd0a257..284a9e3 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html @@ -806,7 +806,7 @@
- + @@ -838,7 +838,7 @@ width: 100%; background-color: #FFFBE8; text-align: center;"> - +
- + @@ -876,7 +876,7 @@
- +
diff --git a/src/app/ui/plan-template/plan-template.component.html b/src/app/ui/plan-template/plan-template.component.html index 4ddb7d7..9877f42 100644 --- a/src/app/ui/plan-template/plan-template.component.html +++ b/src/app/ui/plan-template/plan-template.component.html @@ -65,7 +65,7 @@ 自定义
- + {{item.groupName=='单位概况'?'编辑':'新增'}}
@@ -212,7 +212,19 @@
- +
+ +
+
+ + + + +
+
@@ -223,17 +235,7 @@
-
-
- - - - -
-
+
@@ -241,7 +243,18 @@
- +
+ +
+
+ + + + +
@@ -271,28 +284,29 @@
-->
-
-
- - - - -
-
- +
- +
+ +
+
+ + + + +
+
@@ -322,8 +336,7 @@
-->
-
-
+ +
diff --git a/src/app/ui/plan-template/plan-template.component.scss b/src/app/ui/plan-template/plan-template.component.scss index f310b98..e5ab3c3 100644 --- a/src/app/ui/plan-template/plan-template.component.scss +++ b/src/app/ui/plan-template/plan-template.component.scss @@ -253,25 +253,46 @@ display: flex; flex-direction: row; .attackLeft { - width: 70%; + width: 100%; display: flex; flex-direction: column; .attackleftHead { width: 100%; - height: 40px; + height: 50px; //background-color: #ffd91d; background-color: #FFFBE8; - opacity: 0.7; - input { - background-color: #FFFBE8; - color: #B99A00; - text-align: center; + display: flex; + .headName{ + width: 80%; height: 100%; - width: 100%; - font-size: 16px; - border: none; - outline: none; + input { + background-color: #FFFBE8; + color: #B99A00; + text-align: center; + height: 100%; + width: 100%; + font-size: 16px; + border: none; + outline: none; + } + } + .rightButton{ + height: 100%; + width: 20%; + float: right; + cursor: pointer; + img{ + line-height: 50px; + } + button{ + font-size: 16px; + margin-top: 8px; + } + /* margin-top: 20px; + margin-right: 8%; */ + //margin-left: 40%; } + } .attackleftTable { width: 100%; @@ -316,6 +337,7 @@ } } } + } .attackRight { width: 30%; diff --git a/src/app/ui/plan-template/plan-template.component.ts b/src/app/ui/plan-template/plan-template.component.ts index db69a86..10f65ad 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -855,6 +855,126 @@ export class PlanTemplateComponent implements OnInit { } } + ////修改多行文本,表格行列数量 + updataHl(...num:number[]){ + const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去 + width: '340px', + height:'350px', + disableClose:true, + data:JSON.parse(JSON.stringify(num.length<=2? this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]]:this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]])) + }); + dialogRef.afterClosed().subscribe(result => { + if(result!=undefined){ + if(num.length<=2){ + //外层四种类型编辑行跟列 + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].level==1){ + //表格类型编辑列数 + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr==undefined){ + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr = [] + } + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.length { + element.tabletd.push('') + }); + } + + } + }else{ + //表格类型减少列数 + for(let i=this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.length;i>result.lieNumber;i--){ + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.splice(i-1,1) + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr!=undefined){ + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tabletr.forEach((element) => { + element.tabletd.splice(element.tabletd.length-1,1) + }); + } + } + } + }else if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].level==2){ + //多行文本编辑行列 + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.lengthresult.hNumber;i--){ + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.splice(i-1,1) + } + } + + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].tableth.forEach((element,index,value) => { + if(value[index].lengthresult.lieNumber;a--){ + value[index].splice(index-1,1) + } + } + + }); + + } + }else if(num.length<=3){ + //进攻通道跟单位概况自定义 + //表格类型编辑列数 + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].level==1||this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].level==undefined){ + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.length { + element.tabletd.push('') + }); + } */ + + } + }else{ + //表格类型减少列数 + for(let i=this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.length;i>result.lieNumber;i--){ + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.splice(i-1,1) + + } + } + } + else if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].level==2){ + //多行文本编辑行列 + if(this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.lengthresult.hNumber;i--){ + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.splice(i-1,1) + } + } + + this.newleftTabledata[this.leftclicki].data[num[0]].attribute[num[1]].attinf[num[2]].tableth.forEach((element,index,value) => { + if(value[index].lengthresult.lieNumber;a--){ + value[index].splice(index-1,1) + } + } + + }); + + } + } + console.log(this.newleftTabledata) + } + + }); + } } //新建预案 @Component({ @@ -1370,3 +1490,34 @@ export class disaster{ } } +//修改表格跟多行文本 +@Component({ + selector: 'updataHl', + templateUrl: './updatal.html', + styleUrls: ['./addKeyname.scss'] +}) +export class updataHl{ + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + ngOnInit(): void{ + JSON.parse(JSON.stringify(this.data)) + this.level=this.data.level + console.log(this.data,this.level) + } + level//类型 + headName=this.data.headName||this.data.head//表头名称 + lieNumber=this.data.zdy!=undefined?0:this.data.lieNumber//最小列数 + hNumber=this.data.zdy!=undefined?0:this.data.hNumber//行数 + //取消按钮 + close(){ + this.dialogRef.close(); + } + //确定按钮 + newdisaster(){ + console.log(this.data) + let result={ + lieNumber:this.level==2? this.data.tableth[0].length:this.data.tableth.length, + hNumber:this.data.tableth.length + } + this.dialogRef.close(result); + } +} \ No newline at end of file diff --git a/src/app/ui/plan-template/updatal.html b/src/app/ui/plan-template/updatal.html new file mode 100644 index 0000000..b3f7e64 --- /dev/null +++ b/src/app/ui/plan-template/updatal.html @@ -0,0 +1,34 @@ +
+
+ 修改内容 +
+
+ + + {{headName}} +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
\ No newline at end of file diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index d9b669c..b55b2a3 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -96,6 +96,7 @@ import { TreeDiagramModule } from './ng-tree-diagram/src/ng-tree-diagram'; import { zdyaddGroup } from './plan-template/plan-template.component' import { zdyaddattinf } from './plan-template/plan-template.component' import { zdydisaster } from './plan-template/plan-template.component' +import { updataHl} from './plan-template/plan-template.component' @NgModule({ declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent, @@ -107,7 +108,7 @@ import { zdydisaster } 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,disaster,zdyaddGroup,zdyaddattinf,zdydisaster], + EditBuildingBuilding, leftFunctionalDomainBuildingComponent, editPlaneFigureBuildingComponent, Organization, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf,disaster,zdyaddGroup,zdyaddattinf,zdydisaster,updataHl], imports: [ CommonModule,