diff --git a/src/app/key-unit/key-unit-management/resultcompanyPlan.html b/src/app/key-unit/key-unit-management/resultcompanyPlan.html index 4159eb7..4cfb2ac 100644 --- a/src/app/key-unit/key-unit-management/resultcompanyPlan.html +++ b/src/app/key-unit/key-unit-management/resultcompanyPlan.html @@ -11,7 +11,7 @@
-

预案名称:{{planName}}

+

单位名称:{{planName}}

提交时间:{{createTime| date:'yyyy-MM-dd HH:mm:ss'||''}}

发起申请:{{organizationName ||''}}

diff --git a/src/app/pipes/boolean.pipe.ts b/src/app/pipes/boolean.pipe.ts index 025507f..a2e8c63 100644 --- a/src/app/pipes/boolean.pipe.ts +++ b/src/app/pipes/boolean.pipe.ts @@ -63,3 +63,21 @@ export class differentContentTitle implements PipeTransform { } } +@Pipe({ name: 'yuan' }) +export class yuan implements PipeTransform { + transform(value: string): string { + if (value == 'LevelOne') { + return '一级预案' + } else if (value == 'LevelTwo') { + return '二级预案' + } else if (value == 'LevelThree') { + return '三级预案' + }else if (value == 'LevelFour') { + return '四级预案' + }else if (value == 'LevelFive') { + return '五级预案' + }else if (value == 'PlanText') { + return '文本预案' + } + } +} diff --git a/src/app/plan-audit/plan-record/plan-record.component.html b/src/app/plan-audit/plan-record/plan-record.component.html index 7d4e87a..ee9faee 100644 --- a/src/app/plan-audit/plan-record/plan-record.component.html +++ b/src/app/plan-audit/plan-record/plan-record.component.html @@ -186,12 +186,12 @@
-
- - - +
+ +
diff --git a/src/app/plan-audit/plan-record/plan-record.component.ts b/src/app/plan-audit/plan-record/plan-record.component.ts index cc6a04c..546791b 100644 --- a/src/app/plan-audit/plan-record/plan-record.component.ts +++ b/src/app/plan-audit/plan-record/plan-record.component.ts @@ -96,7 +96,6 @@ export class PlanRecordComponent implements OnInit { //获取表格数据 getAlltabledate() { - let paramsdata: any = { Operation: this.level || [], ContentType: Number(this.projectlevel) || [], @@ -185,13 +184,16 @@ export class PlanRecordComponent implements OnInit { this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => { this.companyId = data.companyId this.companyName = data.companyName - if (data.planMode == 2) { - this.bianzhi = true - this.src = `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false` - //this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}` - } else { - this.bianzhi = false + //this.bianzhi = false if (data.planType != 2 && data.planType != 1) { + if (data.planMode == 2) { + this.showtype = 0 + this.bianzhi = true + this.src = `/CreatePlanOnlineFive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false` + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); + //this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}` + } else{ + this.bianzhi = false this.fetchUrl = data.attachmentUrls[0] var index = this.fetchUrl.indexOf("\/") if (this.fetchUrl.substr(0, index) == 'psw') { @@ -211,6 +213,8 @@ export class PlanRecordComponent implements OnInit { } else { this.lookWord() } + } + } else { this.organizationName = item.organizationName this.planData = data @@ -221,7 +225,7 @@ export class PlanRecordComponent implements OnInit { //this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); //window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`) } - } + @@ -248,16 +252,15 @@ export class PlanRecordComponent implements OnInit { //毕升 lookWord() { this.showtype = 0 - let src let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase() if (suffix == 'docx' || suffix == 'doc') { let arr = this.fetchUrl.split('.') arr[arr.length - 1] = 'pdf' - src = `/api/Objects/PlanPlatform/` + arr.join('.') + this.src = `/api/Objects/PlanPlatform/` + arr.join('.') } else if (suffix == 'pdf') { - src = `/api/Objects/PlanPlatform/` + this.fetchUrl + this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl } - this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src); + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); } //查看按钮跳转 lookNew() { @@ -272,7 +275,6 @@ export class PlanRecordComponent implements OnInit { this.compantData = { name: '', buildingTypes: [], address: '' } this.planType = this.planData.planMode let data = this.planData - // console.log(data) if (data.planType == 1) { this.twoOrthree = 2 } else if (data.planType == 2) { diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index 300f880..22d0fed 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -57,7 +57,7 @@
- +
diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.scss b/src/app/plan-audit/wait-examineer/wait-examineer.component.scss index 57c2287..8b8e8ec 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.scss +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.scss @@ -11,8 +11,9 @@ background-color: #ffffff; display: flex; flex-direction: column; - overflow: auto; + //overflow: auto; .lefthead { + height: 30%; display: flex; flex-direction: column; .headdiv { @@ -131,13 +132,13 @@ } .tablediv { width: 100%; - height: 100%; + height: 70%; .tbodycss { @media screen and (min-device-width: 1400px) { overflow-y: auto; } - height: 650px; + height: 600px; width: 100%; .selectedTr { background-color: #b3d3ee; diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts index dfb6ac5..9440632 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts @@ -179,14 +179,14 @@ export class WaitExamineerComponent implements OnInit { bianzhi = false radioClick(e, item) { this.selectedItem = item - console.log(item) + //console.log(item) // console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) ) if (item.contentType == 11 && this.selectedItem.differentContent) { let differentContent = JSON.parse(this.selectedItem.differentContent) - console.log('差异信息', differentContent) + //console.log('差异信息', differentContent) // 单位信息 @@ -222,7 +222,7 @@ export class WaitExamineerComponent implements OnInit { this.differentContentOfBuildingsInfo.childrens.forEach(element => { element.difData = resolveDiff(element.childrens) }); - console.log('建筑信息', this.differentContentOfBuildingsInfo) + //console.log('建筑信息', this.differentContentOfBuildingsInfo) //功能分区 let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) this.differentContentOfFunction = [] @@ -296,7 +296,7 @@ export class WaitExamineerComponent implements OnInit { }) } else { this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => { - console.log('预案信息',data) + //console.log('预案信息',data) this.companyId = data.companyId this.companyName = data.companyName if (data.planType != 2 && data.planType != 1) { @@ -357,16 +357,16 @@ export class WaitExamineerComponent implements OnInit { lookWord() { console.log('lookWord') this.showtype = 0 - let src + //let src let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase() if (suffix == 'docx' || suffix == 'doc') { let arr = this.fetchUrl.split('.') arr[arr.length - 1] = 'pdf' - src = `/api/Objects/PlanPlatform/` + arr.join('.') + this.src = `/api/Objects/PlanPlatform/` + arr.join('.') } else if (suffix == 'pdf') { - src = `/api/Objects/PlanPlatform/` + this.fetchUrl + this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl } - this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src); + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); } //查看按钮跳转 lookNew() { 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 0722c08..d34426d 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 @@ -11,6 +11,10 @@
+ + @@ -23,7 +27,9 @@ visibility 退出预览
- +
+ +
@@ -258,8 +264,8 @@
-
- +
+
@@ -428,12 +434,11 @@
-
- {{item.groupName}} + *ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='封面'"> +
+ {{item.groupName}} + +
{{element.headName}} - - + + + + +
@@ -476,14 +482,16 @@
- + + + @@ -561,7 +569,7 @@ -
+ +
类型 预案类型
- + - +
@@ -607,7 +615,7 @@
- +
@@ -649,15 +657,15 @@
-
+
-->
-
{{item.groupName}} -
+
-->
-
- {{item.groupName}} -
-
-
- -
{{ i.name }}
- delete - -
-
- -
- {{i.cantent}} -
-
-
- -
- -
-
-
-
- {{item.groupName}} -
-
-
- -
{{ i.name }}
-
-
- -
- {{i.cantent}} -
-
-
-
-
+
{{element.surveyName}} + (click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'&&element.surveyName!='进攻通道'">
@@ -868,39 +803,15 @@
-
-
+
+
- - + + - - - - - - -
{{info.propertyName}}{{info.value}}
-
-
-
-
-
-
- - - - - + + -
{{info.propertyValue}}
+
+
@@ -926,17 +838,19 @@ width: 100%; background-color: #FFFBE8; text-align: center;"> - {{attack.name}} + + +
-
+
- - + + + -
{{info.value}}
+
@@ -961,9 +875,10 @@
-
- - +
+ + + -
{{info.value}}
+
- + @@ -999,7 +914,7 @@ font-size: 16px; text-align: center;">{{info.value}} -
+
@@ -1021,7 +936,7 @@
- + @@ -1041,7 +956,7 @@
- + @@ -1066,7 +981,7 @@
- +
@@ -1088,7 +1003,7 @@
- + @@ -1111,7 +1026,7 @@
- +
@@ -1136,6 +1051,139 @@ + +
+ + +
+
+ {{element.headName}} + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ {{element.tableth[tablethi]}} + +
+ + +
+ {{itemtr.tabletd[tabletdi]}} +
+ + +
{{element.tableth||''}}
+ +
+
+
+ + + + + + + + +
+ {{itemthj.head}} + + {{itemthj.body}} +
+
+
+
+ + + +
+ +
+
+ delete + + +
+
+ + +
+
+
+ +
+
+
diff --git a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss index 9a7c908..f5573d9 100644 --- a/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss +++ b/src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss @@ -1,6 +1,34 @@ * { scrollbar-width: none; /* Firefox */ } +//黄色标题右侧添加删除按钮样式封装 +@mixin amg(){ + img { + cursor: pointer; + width: 18px; + height: 18px; + float: right; + margin-top: 10px; + margin-right: 10px; + } +} +//span标签通用 +@mixin span { + text-align: center; + font-size: 16px; + color: #2196F3; + height: 40px; + line-height: 40px; +} +//input标签 +@mixin input($backgroudcolor) { + height: 100%; + width: 100%; + font-size: 16px; + border: none; + outline: none; + background-color: $backgroudcolor; +} ::-webkit-scrollbar { display: none; /* Chrome Safari */ } @@ -58,6 +86,11 @@ position: absolute; right: 24px; top: 7px; + input { + width: 100%; + height: 22px; + line-height: 22px; + border-radius: 3px;} button { margin-left: 10px; mat-icon { @@ -74,6 +107,22 @@ box-sizing: border-box; padding-top: 66px; overflow-y: auto; + .shadow{ + height: 95%; + width: 97%; + margin: 10px 10px 10px 10px; + /* position:absolute; + left:0; + top:0; */ + z-index:998; + background-color:#FFFFFF; + opacity:0.6; + mat-spinner{ + position: relative; + top: 40%; + left: 45%; + } + } .leftbox { position: fixed; width: 14%; @@ -238,11 +287,7 @@ text-align: center; background-color: #e1f1ff; span{ - text-align: center; - font-size: 16px; - color: #2196F3; - height: 40px; - line-height: 40px; + @include span() } } .newBody{ @@ -396,6 +441,7 @@ min-height: 97%; box-sizing: border-box; padding: 10px 10px 0; + .cover { width: 100%; min-height: 780px; @@ -477,14 +523,7 @@ line-height: 40px; color: #b99a00; } - img { - cursor: pointer; - width: 20px; - height: 20px; - float: right; - margin-top: 10px; - margin-right: 10px; - } + @include amg() } .body { width: 100%; @@ -497,6 +536,16 @@ width: 100%; border-collapse: collapse; //background-color: #E8E9E9; + img{ + /* position: relative; + bottom: 30px; + left: 700px; */ + float: right; + width: 30px; + height: 26px; + margin-top: 12px; + cursor: pointer; + } } th { //background-color: #E8E9E9; @@ -713,14 +762,7 @@ line-height: 40px; color: #ffffff; } - img { - cursor: pointer; - width: 20px; - height: 20px; - float: right; - margin-top: 10px; - margin-right: 10px; - } + @include amg() } .body { width: 100%; @@ -728,6 +770,8 @@ .attack { width: 100%; height: 100%; + display: flex; + flex-direction: column; .attackhead { width: 100%; height: 40px; @@ -740,14 +784,15 @@ line-height: 40px; color: #b99a00; } - img { + /* img { cursor: pointer; width: 20px; height: 20px; float: right; margin-top: 10px; margin-right: 10px; - } + } */ + @include amg() } .attackbody { width: 100%; @@ -799,15 +844,13 @@ width: 100%; display: flex; flex-direction: column; - - } .onetext{ - height: 40px; + height: 42px; width: 100%; - border-bottom: 1px solid #F2F4F5; + border-bottom: 1px solid #E8E9E9; span{ - height: 40px; + height: 100%; width: 40%; font-size: 16px; background-color: #F2F4F5; @@ -818,23 +861,23 @@ font-size: 16px; border: none; outline: none; - border-bottom: 1px solid #F2F4F5; + //border-bottom: 1px solid #E8E9E9; } img{ height: 20px; width: 20px; position: relative; - top: 10px; + top: 12px; } } .file{ width: 100%; height: 100%; .fileHead{ - height: 40px; + height: 42px; width: 100%; background-color: #FFFBE8; - text-align: center; + span { font-size: 16px; text-align: center; @@ -842,6 +885,16 @@ line-height: 40px; color: #b99a00; } + input{ + height: 40px; + background-color: #FFFBE8; + font-size: 16px; + border: none; + outline: none; + color: #b99a00; + text-align: center; + } + @include amg() } .fileBody{ height: 100%; @@ -875,16 +928,21 @@ } } .fourTexttwo{ - height: 40px; + height: 42px; width: 50%; - border-bottom: 1px solid #F2F4F5; + border-bottom: 1px solid #E8E9E9; input{ height: 40px; //width: 60%; font-size: 16px; border: none; outline: none; - + } + img{ + height: 20px; + width: 20px; + position: relative; + //top: 12px; } } } @@ -906,14 +964,7 @@ background-color: #FFFBE8; color: #b99a00; } - img { - cursor: pointer; - width: 20px; - height: 20px; - float: right; - margin-top: 10px; - margin-right: 10px; - } + @include amg() } .partsBody{ width: 100%; @@ -922,9 +973,9 @@ flex-direction: column; .duohang{ width: 100%; - height: 40px; + height: 42px; display: flex; - //border-bottom: 1px solid #FFFFFF; + border-bottom: 1px solid #E8E9E9; .duohangHalf{ height: 40px; width: 50%; @@ -1007,13 +1058,14 @@ width: 100%; height: 36px; line-height: 36px; - background-color: #e1f1ff; - text-align: center; - color: white; + background-color: #e8f4fe; + //text-align: center; + color: #2196F3; input { background-color: #e1f1ff; color: #2196F3; - text-align: center; + //text-align: center; + margin-left: 20px; height: 100%; width: 90%; font-size: 16px; @@ -1026,6 +1078,9 @@ top: 4px; cursor: pointer; } + span{ + margin-left: 20px; + } } .attack { width: 100%; @@ -1211,14 +1266,7 @@ line-height: 40px; color: #b99a00; } - img { - cursor: pointer; - width: 20px; - height: 20px; - float: right; - margin-top: 10px; - margin-right: 10px; - } + @include amg() } .body { width: 100%; @@ -1231,6 +1279,7 @@ width: 100%; border-collapse: collapse; //background-color: #E8E9E9; + } th { //background-color: #E8E9E9; @@ -1242,7 +1291,7 @@ background-color: #e8e9e9; text-align: center; height: 100%; - width: 100%; + width: 95%; font-size: 16px; border: none; outline: none; 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 0abb294..01bf697 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 @@ -56,11 +56,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit { planLevel: string//预案级别 blockyl = true + zaixianDr=false ngOnInit(): void { this.planLevel = this.route.snapshot.queryParams.planCategory if (this.route.snapshot.queryParams.pattern == 'false') { this.pattern = 'look' this.blockyl = false + this.clickTitleItem('单位概况') } else { this.pattern = 'edit' } @@ -157,6 +159,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit { data.items.forEach(element => { if (element.id == this.route.snapshot.queryParams.companyId) { this.unitData = element + if((this.unitData.buildingTypes[0].name=='高层建筑'||this.unitData.buildingTypes[0].name=='居民小区'||this.unitData.buildingTypes[0].name=='厂房' + ||this.unitData.buildingTypes[0].name=='商市场'||this.unitData.buildingTypes[0].name=='医院'||this.unitData.buildingTypes[0].name=='学校' + ||this.unitData.buildingTypes[0].name=='宾馆'||this.unitData.buildingTypes[0].name=='娱乐场所'||this.unitData.buildingTypes[0].name=='餐饮业' + ||this.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院' + ||this.unitData.buildingTypes[0].name=='会议中心'||this.unitData.buildingTypes[0].name=='储罐类'||this.unitData.buildingTypes[0].name=='化工生产')&&this.planLevel=='5'){ + this.zaixianDr=true + } //console.log('单位列表信息', this.unitData) this.getTemplateData() } @@ -227,7 +236,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }) this.buData = JSON.parse(JSON.stringify(this.buData)) console.log(this.buData) - this.buData.forEach((pvalue, pindex, parr) => { + this.buData[0].forEach((pvalue, pindex, parr) => { if (parr[pindex].length > 0) { parr[pindex].forEach((nval, nindex, narr) => { this.planTemplateData[index].building[pindex].body[5].attinf[0].body[0].value = nval.name @@ -245,6 +254,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { selectedContent:any async clickTitleItem(item) { //this.planTemplateData[key].new=true + this.selectedContent = item this.addNumber = -1 this.yinruData = { @@ -343,7 +353,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit { //console.log(this.buildZong) let index = this.getArrayIndex(this.planTemplateData,'单位概况') this.planTemplateData[index].building.forEach(element => { - element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci + if(element.body[0].completed){ + element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci element.body[0].attinf[1].value = element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name element.body[0].attinf[2].value = element.body[0].attinf[2].olddata = this.unitData.contacts element.body[0].attinf[3].value = element.body[0].attinf[3].olddata = this.unitData.phone @@ -360,14 +371,14 @@ export class CreatePlanOnlineFiveComponent implements OnInit { }); }); } + } + }); - // console.log(this.planTemplateData) - } /* else if (this.selectedItem == '单位概况') { - //this.getAllBuildings() - } */ else if (this.selectedItem == '预案附件') { + console.log(this.planTemplateData) + } else if (this.selectedItem == '预案附件') { this.getTwoDPlanList() }else if(this.selectedItem == '新建'){ const dialogRef = this.dialog.open(newTitle, {//调用open方法打开对话框并且携带参数过去 @@ -385,7 +396,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { //delete this.planTemplateData[this.planTemplateData.length-3] } //JSON.parse(JSON.stringify(this.planTemplateData)) - console.log(this.planTemplateData) + //console.log(this.planTemplateData) }); } } @@ -413,7 +424,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { drop(event: CdkDragDrop) { moveItemInArray(this.planTemplateData, event.previousIndex, event.currentIndex); - console.log('拖拽标题', this.planTemplateData) + //console.log('拖拽标题', this.planTemplateData) } //获取建筑信息 @@ -599,11 +610,27 @@ export class CreatePlanOnlineFiveComponent implements OnInit { element.attribute = [{ name: '特别警示', content: '' }] } } + if(element.groupName=='三位概况'){ + this.clickTitleItem('单位概况') + } }); if(this.planLevel=='4'){ this.planTemplateData.push({completed: true,groupName: '新建'}) } - + this.planTemplateData.forEach(element => { + if(element.attribute!=undefined){ + /* element.attribute.forEach((item,index,value) => { + if(value[index].level!=undefined&&value[index].level==1){ + value[index].lieNumber=value[index].tableth.length + } + }); */ + for(let i=0;i { + if(result!=undefined){ + //外层四种类型编辑行跟列 + if((num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).level==1){ + //表格类型编辑列数 + if((num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tabletr==undefined){ + (num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tabletr = [] + } + if((num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tableth.length { + element.tabletd.push('') + }); + } + + } + }else{ + //表格类型减少列数 + for(let i=(num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tableth.length;i>result.lieNumber;i--){ + (num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tableth.splice(i-1,1) + if((num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tabletr!=undefined){ + (num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tabletr.forEach((element) => { + element.tabletd.splice(element.tabletd.length-1,1) + }); + } + } + } + }else if((num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).level==2){ + //多行文本编辑行列 + if((num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tableth.lengthresult.hNumber;i--){ + (num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tableth.splice(i-1,1) + } + } + + (num.length<3? this.planTemplateData[num[0]].attribute[num[1]]:this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]]).tableth.forEach((element,index,value) => { + if(value[index].lengthresult.lieNumber;a--){ + value[index].splice(index-1,1) + } + } + + }); + + } + + console.log(this.planTemplateData) + } + + }); + } + //新建内容向上排序 + upPai(zi,attributei){ + var temp + if(attributei!=0){ + for (let index = attributei-1; index >=0; index--) { + temp=this.planTemplateData[zi].attribute[index] + this.planTemplateData[zi].attribute[index]=this.planTemplateData[zi].attribute[attributei] + this.planTemplateData[zi].attribute[attributei]=temp + return + } + + } + } + //新建内容向下排序 + downPai(zi,attributei){ + var temp + if (attributei!=this.planTemplateData[zi].attribute.length-1) { + for (let index = attributei+1; index < this.planTemplateData[zi].attribute.length; index++) { + temp=this.planTemplateData[zi].attribute[index] + this.planTemplateData[zi].attribute[index]=this.planTemplateData[zi].attribute[attributei] + this.planTemplateData[zi].attribute[attributei]=temp + return + + } + + } } //单位概况左侧建筑点击事件 buildingName @@ -1229,61 +1367,119 @@ export class CreatePlanOnlineFiveComponent implements OnInit { // console.log(item, this.clicki) } //单位概况增加一行 - unitadd(surveyName, attacki, i) { -  let index = this.getArrayIndex(this.planTemplateData,'单位概况') - + unitadd(surveyName, attacki, i,fileNum?:number) { + let index = this.getArrayIndex(this.planTemplateData,'单位概况') this.addNumber++ - if (surveyName == '进攻通道') { - if (this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr == undefined) { - this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr = [] - } - this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.push({ tabletd: [] }) - for (var j = 0; j < this.planTemplateData[index].building[attacki].body[4].attinf[i].tableth.length; j++) { - if (this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr != undefined) { - this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr[this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.length - 1].tabletd.push('') - } - else { - this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr[this.addNumber].tabletd.push('') + this.planTemplateData[index].building[attacki].body.forEach((value,bodyi,arr)=>{ + if(surveyName==arr[bodyi].surveyName){ + console.log(bodyi) + if(arr[bodyi].zdy==undefined){ + if (surveyName == '进攻通道') { + if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr == undefined) { + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr = [] + } + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr.push({ tabletd: [] }) + for (var j = 0; j < this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tableth.length; j++) { + if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr != undefined) { + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr[this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.length - 1].tabletd.push('') + } + else { + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr[this.addNumber].tabletd.push('') + } + } + + // console.log(this.planTemplateData) + } + else if (surveyName == '功能分区') { + // console.log(attacki) + this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '' }) + } else if (surveyName == '重点部位') { + this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] }) + } + else if(surveyName == '单位基本信息'||surveyName == '建筑信息'){ + this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true }) + } else if(surveyName == '四周毗邻'){ + this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:false }) + this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:true }) + }else if(surveyName == '消防设施'){ + if(fileNum==0){ + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.push({ name: '', value: '',completed:true,zdy:true}) + }else{ + this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true,facilityItems:[] }) + } + + } + }else{ + this.addAttribute(surveyName,attacki,i,1,surveyName) } + + } + }) + console.log(this.planTemplateData) + } + //单位概况自定义表格新增一行 + unitNewadd(...num:number[]){ + console.log(num) + if (this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tableth == undefined||this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tableth.length==0) { + //this.planTemplateData[key].attribute[i].tabletr = [] + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请先编辑列!', '确定', config); + }else{ + if(this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr == undefined){ + this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr = [] + } + this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr.push({ tabletd: [] }) + for(var j = 0; j < this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tableth.length; j++) { + if (this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr != undefined) { + this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr[this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr.length - 1].tabletd.push('') + } + else { + this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].tabletr[this.addNumber].tabletd.push('') } - - // console.log(this.planTemplateData) } - else if (surveyName == '功能分区') { - // console.log(attacki) - this.planTemplateData[index].building[attacki].body[6].attinf.push({ name: '', value: '' }) - } else if (surveyName == '重点部位') { - this.planTemplateData[index].building[attacki].body[5].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] }) } + console.log(this.planTemplateData) + //this.planTemplateData[num[0]].building[num[1]].body[num[2]].attinf[num[3]].push() } //单位概况删除一行 - unitDel(surveyName, attacki, i) { + unitDel(surveyName, attacki, i,fileNum?:number) { let index = this.getArrayIndex(this.planTemplateData,'单位概况') const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let isTrue = confirm('您确定要删除该条信息吗') - if (surveyName == '进攻通道') { - if (isTrue) { - if (this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr != undefined) { - this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.splice(this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.length - 1, 1) - this.addNumber-- - if (this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.length == 0) { - this.addNumber = -1 + this.planTemplateData[index].building[attacki].body.forEach((value,bodyi,arr) => { + if(surveyName==arr[bodyi].surveyName){ + if (surveyName == '进攻通道') { + if (isTrue) { + if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr != undefined) { + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr.splice(this.planTemplateData[index].building[attacki].body[4].attinf[i].tabletr.length - 1, 1) + this.addNumber-- + if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr.length == 0) { + this.addNumber = -1 + } + } else { + this.snackBar.open('请先增加一行!', '确定', config); + } } - } else { - this.snackBar.open('请先增加一行!', '确定', config); + } else if (surveyName == '功能分区'||surveyName=='重点部位'||surveyName=='单位基本信息'||surveyName=='建筑信息'||surveyName=='消防设施') { + if (isTrue) { + if(surveyName=='消防设施'&&fileNum!=undefined){ + this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.splice(fileNum,1) + }else{ + this.planTemplateData[index].building[attacki].body[bodyi].attinf.splice(i, 1) + } + + } + }else if(surveyName == '四周毗邻'){ + this.planTemplateData[index].building[attacki].body[bodyi].attinf.splice(i, 1) + this.planTemplateData[index].building[attacki].body[bodyi].attinf.splice(i-1, 1) } } - } else if (surveyName == '功能分区') { - if (isTrue) { - this.planTemplateData[index].building[attacki].body[6].attinf.splice(i, 1) - } - } else if (surveyName == '重点部位') { - if (isTrue) { - this.planTemplateData[index].building[attacki].body[5].attinf.splice(i, 1) - } - } + }); + } //分段上传 @@ -1333,6 +1529,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { pattern: string = 'edit' preview() { this.pattern = 'look' + this.clickTitleItem('单位概况') } quitPreview() { this.pattern = 'edit' @@ -1395,13 +1592,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit { oldData = false clickoldData() { this.oldData = !this.oldData - } //新增功能(社会联动等引用) searchType = '0' //打开自定义新增具体内容 tuTrue=false - addAttribute(groupName,key){ + addAttribute(groupName,attacki?:any, bi?:any,fileNum?:any,surveyName?:string){ + let index = this.getArrayIndex(this.planTemplateData,'单位概况') const dialogRef = this.dialog.open(disaster, {//调用open方法打开对话框并且携带参数过去 width: '340px', height:'450px', @@ -1409,26 +1606,38 @@ export class CreatePlanOnlineFiveComponent implements OnInit { data:this.planTemplateData }); dialogRef.afterClosed().subscribe(result => { - console.log(result) if(result!=undefined){ - this.planTemplateData.forEach((value,index,array)=>{ - if(array[index].groupName==groupName){ - if(array[index].attribute==undefined){ - array[index].attribute=[] - array[index].attribute.push(result) - }else{ - array[index].attribute.push(result) - } - if(result.level==2){ - for(var i=0;i{ + if(array[index].groupName==groupName){ + if(array[index].attribute==undefined){ + array[index].attribute=[] + array[index].attribute.push(result) + }else{ + array[index].attribute.push(result) + } + if(result.level==2){ + for(let i=0;i{ + console.log(data) + if(data==null){ + this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config); + }else{ + this.fileData=JSON.parse(JSON.stringify(data)) + this.fileData.forEach((value,index,array) => { + if(value.groupName=='交通水源'||value.groupName=='重点图示'){ + value.attribute.forEach(element => { + element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length) + }); + } + this.planTemplateData.forEach((pvalue,pindex,parr) => { + if(parr[1].building==undefined){ + if(array[index].groupName==parr[pindex].groupName){ + parr[pindex].attribute=array[index].attribute + } + }else{ + if(array[index].groupName==parr[pindex].groupName&&pindex!=1){ + parr[pindex].attribute=array[index].attribute + }else if(array[index].groupName==parr[pindex].groupName&&pindex==1){ + parr[pindex].building[0].body=array[index].attribute + } + } + }); + + }); + //console.log(this.fileData) + this.snackBar.open('解析成功!', '确定', config); + } + this.iftrue=false + e.target.value='' + }) + } + //消防设施新增一条数据 + zdyXf(groupName){ + const dialogRef = this.dialog.open(disaster, {//调用open方法打开对话框并且携带参数过去 + width: '340px', + height:'450px', + disableClose:true, + data:this.planTemplateData + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + if(result!=undefined){ + this.planTemplateData.forEach((value,index,array)=>{ + if(array[index].groupName==groupName){ + if(array[index].attribute==undefined){ + array[index].attribute=[] + array[index].attribute.push(result) + }else{ + array[index].attribute.push(result) + } + if(result.level==2){ + for(var i=0;i,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + ngOnInit(): void{ + JSON.parse(JSON.stringify(this.data)) + this.level=Number(this.data.level) + console.log(this.data) + } + level//类型 + headName=this.data.headName//表头名称 + 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/plan-management/create-plan-online-five/updatal.html b/src/app/plan-management/create-plan-online-five/updatal.html new file mode 100644 index 0000000..0a3b90b --- /dev/null +++ b/src/app/plan-management/create-plan-online-five/updatal.html @@ -0,0 +1,34 @@ +
+
+ 修改内容 +
+
+ + + {{headName}} +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + +
+
\ No newline at end of file diff --git a/src/app/plan-management/plan-management.module.ts b/src/app/plan-management/plan-management.module.ts index 9266f39..969afe1 100644 --- a/src/app/plan-management/plan-management.module.ts +++ b/src/app/plan-management/plan-management.module.ts @@ -72,12 +72,13 @@ import { KeyUnitModule } from '../key-unit/key-unit.module'; import { yinYong } from './create-plan-online-five/create-plan-online-five.component' import { newTitle } from './create-plan-online-five/create-plan-online-five.component' import { disaster } from './create-plan-online-five/create-plan-online-five.component' +import { updataHl } from './create-plan-online-five/create-plan-online-five.component' @NgModule({ declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult, typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, - OpenPlanToolDialog,yinYong,newTitle,disaster], + OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl], imports: [ CommonModule, PlanManagementRoutingModule, diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.html b/src/app/statistic-analysis/combined-query/combined-query.component.html new file mode 100644 index 0000000..be0d92f --- /dev/null +++ b/src/app/statistic-analysis/combined-query/combined-query.component.html @@ -0,0 +1,153 @@ + +
+ + + +
+
+
+
+ + + + + + 包含下级 + 包含下级 +
+
+ clear +
+ + + +
  • {{node.name}}
  • +
    + + +
  • {{node.name}}
  • +
    +
    +
    +
    +
    + + + + + + + 🠊 + + + + +
    +
    + + + + 二维预案 + 三维预案 + 其他预案 + 文本预案 + + + +
    +
    + + + + + {{unit.name}} + + + +
    +
    + + + + 新增 + 维护更新 + + +
    +
    + + + + Ⅰ级预案 + Ⅱ级预案 + Ⅲ级预案 + Ⅳ级预案 + Ⅴ级预案 + + +
    +
    + + + + 从高到低 + 从低到高 + + +
    +
    + + + + 从高到低 + 从低到高 + + +
    +
    + + + +
    +
    +
    + +
    + +
    +
    + + + + + + + + + +
    {{item}}
    {{eletd}}
    + + + + + + + + + +
    {{item}}
    {{eletd}}
    + 暂无数据 +
    +
    +
    +
    + +
    +
    diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.scss b/src/app/statistic-analysis/combined-query/combined-query.component.scss new file mode 100644 index 0000000..70a7520 --- /dev/null +++ b/src/app/statistic-analysis/combined-query/combined-query.component.scss @@ -0,0 +1,265 @@ +.header { + width: 100%; + padding: 12px 10px; + box-sizing: border-box; + .queryBox { + box-sizing: border-box; + padding: 5px 0 0 5px; + // margin-left: 50px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items:center; + // justify-content:center; + .queryField { + //margin: 0 10px; + input { + width: 180px; + height: 22px; + line-height: 22px; + border-radius: 3px; + } + @media screen and (min-device-width:1400px){ + margin: 3px 20px; + } + @media screen and (max-device-width:1400px)and (min-device-width:1200px){ + margin: 3px 10px; + mat-form-field{ + width: 180px; + } + } + @media screen and (max-device-width:1200px){ + margin: 3px 0 3px 10px; + mat-form-field{ + width: 120px; + } + } + + } + + + } //queryBox + .butclass{ + button{ + width: 80px;height: 36px; + font-size: 16px; + } +} + .ordiv{ + position: relative; + .organizationbox{ + width:450px; + height: 200px; + background: white; + position: absolute; + top: 48px; + left: 77px; + z-index: 999; + border: 1px solid grey; + overflow-y: auto; + li{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + mat-tree-node{ + cursor: pointer; + white-space:pre; + } + mat-tree-node:hover{ + background: rgba(225, 225, 225, 0.8); + } + .closediv{ + z-index: 100; + position: absolute; + right: 0; + top: 0; + width: 30px; + height: 30px; + cursor: pointer; + line-height: 30px; + text-align: center; + } + .closediv:hover{ + background:rgba(225, 225, 225, 0.8); + } + } + + } + } + .body{ + height: 100%; + width: 100%; + .buttonbox{ + padding-left: 50px; + button{ + margin:0 10px + } + } + .tablebox{ + height: 620px; + overflow-y: auto; + //margin-bottom: 15px; + table{ + width: 100%; + background-color: white; + margin-top: 15px; + table-layout: fixed; + thead,tr{ + border-bottom: 1px solid grey; + } + th { + border-bottom: 1px solid #999; + //width: 30%; + font-size: 16px; + text-align: center; + height: 60px; + line-height: 60px; + } + td { + + height: 50px; + //line-height: 50px; + text-align: center; + font-size: 16px; + margin-left: 3px; + border-bottom: 1px solid #999; + .spantext{ + margin-left: 7px; + } + .buleColor{ + color: #2196f3; + } + } + } + mat-paginator{ + width:100%; + // margin-left: 2%; + // margin-top: 30px; + } + } + } + .mat-header-cell{ + text-align: center; +} +.mat-cell{ + text-align: center; + +} + +//完整度 +.integrityDiv{ + width: 180px; + height: 30px; + background-color: #e2e7ee; + // background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32); + margin: 0 auto; + position: relative; + .integrityNum{ + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + color: black; + font-weight: 800; + font-size: 15px; + cursor: default; + } + .integrityColorDiv{ + height: 100%; + } + .integrityDetails{ + position: absolute; + display: none; + width: 350px; + height:280px; + border: 1px solid rgba(0, 0, 0, 0.22); + background-color: white; + .integrityDetailsTop{ + width: 100%; + height: 23px; + line-height:23px; + border-bottom: 1px solid rgba(0, 0, 0, 0.22); + margin-bottom: 1px; + font-size: 14px; + span{ + display: inline-block; + text-align: center; + font-weight: 800; + } + .span1{ + width: 25%; + } + .span2{ + width: 60%; + } + .span3{ + width: 15%; + } + } + .integrityDetailsBody{ + ul{ + li{ + width: 100%; + height: 23px; + line-height: 23px; + margin: 3px 0; + div{ + float: left; + font-size: 13px; + } + .name{ + width: 25%; + height: 100%; + } + .colorDiv{ + width: 60%; + height: 100%; + position: relative; + .colorDivBac{ + width: 90%; + height: 100%; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); + background-color: #dfe5ec; + border-radius: 5px; + .colorDivCon{ + border-radius: 5px; + height: 100%; + background-color: #2398f1; + } + } + span{ + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); + // color: white; + font-weight: 600; + } + } + .number{ + width: 15%; + height: 100%; + } + } + } + + } + } + .bottomposition{ + top: 2px; + left: 188px; + } + .topposition{ + top: -252px; + left: 188px; + } +} +.integrityDiv:hover{ + .integrityDetails{ + display: block; + } +} \ No newline at end of file diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.spec.ts b/src/app/statistic-analysis/combined-query/combined-query.component.spec.ts new file mode 100644 index 0000000..9b36c52 --- /dev/null +++ b/src/app/statistic-analysis/combined-query/combined-query.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CombinedQueryComponent } from './combined-query.component'; + +describe('CombinedQueryComponent', () => { + let component: CombinedQueryComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CombinedQueryComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CombinedQueryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.ts b/src/app/statistic-analysis/combined-query/combined-query.component.ts new file mode 100644 index 0000000..6cb7d81 --- /dev/null +++ b/src/app/statistic-analysis/combined-query/combined-query.component.ts @@ -0,0 +1,567 @@ +import { Component, OnInit, ViewChild, Inject } from '@angular/core'; +import { HttpClient } from '@angular/common/http' +import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; +import { MatPaginator } from '@angular/material/paginator'; +import { FlatTreeControl } from '@angular/cdk/tree'; +import { FormControl } from '@angular/forms'; +import { Router, ActivatedRoute } from '@angular/router' +import { PageEvent } from '@angular/material/paginator'; +import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { TreeService } from '../../http-interceptors/tree.service' +import { Viewer } from 'photo-sphere-viewer'; +import { timeStamp } from 'console'; + +@Component({ + selector: 'app-combined-query', + templateUrl: './combined-query.component.html', + styleUrls: ['./combined-query.component.scss'] +}) +export class CombinedQueryComponent implements OnInit { + + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + + ngOnInit(): void { + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false + } + this.getunitdata(); + this.getOrganizations(); + this.getUnittype(); + this.getAllPlanInfo(); + let level = sessionStorage.getItem("level"); + this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length) + } + private _transformer = (node, level: number) => { //初始化tree + return { + expandable: !!node.children && node.children.length > 0, + name: node.name, + level: level, + id: node.id, + parentId: node.parentId, + children: node.children + }; + } + treeControl = new FlatTreeControl(node => node.level, node => node.expandable); + treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); + dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); + myControl = new FormControl(); + hasChild = (_: number, node: any) => node.expandable; + displayedColumns: string[] = ['组织名称', '总数'];//, 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation' + yuanColumns:string[]=['组织名称', '总数']; + allorganizations: any //所有组织机构 + allunittype: any //所有单位类型 + tabledataSource=[] //单位表格数据 + yuanTable=[]//预案表格数据 + excelData:any + url + findTj=0//查询条件 + + preparelevels:Number=0 + pcMore//pc更多 + pcput = false//pc收起 + pcfind//pc查询 + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput + } + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput + } + + allPlanInfo: any //存储所有预案信息 + lable=['单位查询','预案查询'] + selected = new FormControl(0); //选项卡实例 + //判断选了哪一个 + selectedIndexChange(e){ + this.selected.setValue(e) + this.preparelevels=Number(e) + this.getAllPlanInfo() + } + //获得所有预案或单位信息 + tableDataNull=false + async getAllPlanInfo() { + /* this.planCategory=new Array(); + this.reservePlanType=new Array(); */ + let paramsdata:any={ + QueryMode:this.preparelevels, + OrganizationId:this.jsId||'', + HasChildren:this.jscheck||'', + TimeIntervalStart:this.dwaddtime||'', + TimeIntervalEnd:this.dwendtime||'', + BuildingTypeIds:this.unittype||[], + CompanyStatuses:this.preparelevel||[], + SortBy:'totalCount', + SortType:this.integritySort + } + let yuandata={ + QueryMode:this.preparelevels, + OrganizationId:this.yuanjsId||'', + HasChildren:this.yuanjscheck||'', + TimeIntervalStart:this.yuanaddtime||'', + TimeIntervalEnd:this.yuanendtime||'', + PlanCategories:this.planCategory||[], + PlanTypes:this.reservePlanType||[], + SortBy:'totalCount', + SortType:this.yuanintegritySort + } + let result = await new Promise((resolve, reject)=>{ + this.http.get("/api/StatisticsAnalysis/ReportTable", { params:this.preparelevels==0? paramsdata:yuandata }).subscribe((data: any) => { + console.log(data) + this.excelData=data + if(data.length==0){ + this.tableDataNull=true + }else{ + this.tableDataNull=false + if(this.preparelevels==0){ + //单位查询 + if(this.preparelevel.length==0){ + //必须选择单位状态 + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请选择单位状态', '确定', config); + }else{ + this.tabledataSource=[] + this.displayedColumns=['组织名称', '总数'] + data.forEach((element,i,value) => { + this.tabledataSource.push({name:[element.orgName,element.companyStatistics.totalCount]}) + if(value[0].companyStatistics.buildingTypesCounts!=null){ + value[i].companyStatistics.buildingTypesCounts.forEach((build,bi,bvalue) => { + if(i==0){ + this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName) + this.tabledataSource[0].name.push(value[0].companyStatistics.buildingTypesCounts[bi].count) + }else{ + this.tabledataSource[i].name.push(bvalue[bi].count) + } + /* this.tabledataSource.forEach((td,ti,tval)=>{ + tval[ti].name.push(item.count) + }) */ + }); + + } + }); + } + } + else if(this.preparelevels==1){ + //预案查询 + this.yuanColumns=['组织名称', '总数'] + this.yuanTable=[{name:[0,0]}] + if(this.planCategory.length!=0){ + this.planCategory.forEach(element=>{ + if(element==1){ + this.yuanColumns.push('Ⅰ级') + this.yuanTable[0].name.push(0) + }else if(element==2){ + this.yuanColumns.push('Ⅱ级') + this.yuanTable[0].name.push(0) + }else if(element==3){ + this.yuanColumns.push('Ⅲ级') + this.yuanTable[0].name.push(0) + }else if(element==4){ + this.yuanColumns.push('Ⅳ级') + this.yuanTable[0].name.push(0) + }else if(element==5){ + this.yuanColumns.push('Ⅴ级') + this.yuanTable[0].name.push(0) + } + }) + } + if(this.reservePlanType.length!=0){ + this.reservePlanType.forEach(element => { + if(element==1){ + this.yuanColumns.push('二维') + this.yuanTable[0].name.push(0) + }else if(element==2){ + this.yuanColumns.push('三维') + this.yuanTable[0].name.push(0) + }else if(element==4){ + this.yuanColumns.push('其他') + this.yuanTable[0].name.push(0) + }else if(element==16){ + this.yuanColumns.push('文本') + this.yuanTable[0].name.push(0) + } + }); + } + + data.forEach((element,i,value) => { + if(i==0){ + this.yuanTable[0].name[0]=value[0].orgName + this.yuanTable[0].name[1]=value[0].planStatistics.totalCount + }else{ + this.yuanTable.push({name:[value[i].orgName,value[i].planStatistics.totalCount]}) + } + }); + this.yuanTable.forEach((element,i,value)=>{ + if(i>0){ + for(let a=value[i].name.length;a{ + this.yuanColumns.forEach((th,thi,thvalu)=>{ + data.forEach((element,i,value) => { + //预案级别数据 + if(value[i].planStatistics.planCategoryStatistics!=null){ + value[i].planStatistics.planCategoryStatistics.planCategories.forEach((jibie,ji,jval) => { + if(thvalu[thi].indexOf(jval[ji].planCategoryName)!=-1&&yuani==i){ + yuanval[yuani].name[thi]=jval[ji].count + } + }); + } + if(value[i].planStatistics.planTypeStatistics!=null){ + //预案类型数据 + value[i].planStatistics.planTypeStatistics.planTypes.forEach((planlx,lxi,lxval) => { + if(thvalu[thi].indexOf(lxval[lxi].planTypeName)!=-1&&yuani==i){ + yuanval[yuani].name[thi]=lxval[lxi].count + } + }); + } + + }); + }) + + }) + } + } + //this.tabledataSource=data + + console.log(this.yuanColumns) + console.log(this.yuanTable) + + resolve(this.excelData) + } + ) + }) + + } + + colorRgb(sColor) { + var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + var sColor = sColor.toLowerCase(); + if (sColor && reg.test(sColor)) { + if (sColor.length === 4) { + var sColorNew = "#"; + for (var i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); + } + sColor = sColorNew; + } + //处理六位的颜色值 + var sColorChange = []; + for (var i = 1; i < 7; i += 2) { + sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + } + return sColorChange; + } else { + return sColor; + } + } + colorHex(rgb) { + var _this = rgb; + var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; + if (/^(rgb|RGB)/.test(_this)) { + var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); + var strHex = "#"; + for (var i = 0; i < aColor.length; i++) { + var hex: any = Number(aColor[i]).toString(16); + hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 + if (hex === "0") { + hex += hex; + } + strHex += hex; + } + if (strHex.length !== 7) { + strHex = _this; + } + return strHex; + } else if (reg.test(_this)) { + var aNum = _this.replace(/#/, "").split(""); + if (aNum.length === 6) { + return _this; + } else if (aNum.length === 3) { + var numHex = "#"; + for (var i = 0; i < aNum.length; i += 1) { + numHex += (aNum[i] + aNum[i]); + } + return numHex; + } + } else { + return _this; + } + } + + gradientColor(startColor, endColor, step) { + let _this = this + let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 + let startR = startRGB[0]; + let startG = startRGB[1]; + let startB = startRGB[2]; + + let endRGB = _this.colorRgb(endColor); + let endR = endRGB[0]; + let endG = endRGB[1]; + let endB = endRGB[2]; + + let sR = (endR - startR) / step;//总差值 + let sG = (endG - startG) / step; + let sB = (endB - startB) / step; + + var colorArr = []; + for (var i = 0; i < step; i++) { + //计算每一步的hex值 + var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')'); + colorArr.push(hex); + } + return colorArr; + } + integrity(width) { + let _this = this + + let style: any = {} + style.width = width + '%'; + if (width < 30) { + let colorArr = this.gradientColor('#D50000', '#E53935', 30); + for (let i = 0; i < 30; i++) { + if (i == width) { + style.background = colorArr[i] + } + } + } + if (width >= 30 && width < 60) { + let colorArr = this.gradientColor('#FF9800', '#E65100', 30); + for (let i = 30; i < 60; i++) { + if (i == width) { + style.background = colorArr[i - 30] + } + } + } + if (width >= 60) { + let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); + for (let i = 60; i <= 100; i++) { + if (i == width) { + style.background = colorArr[i - 60] + } + } + } + return style + } + integrityDetails(width, zong) { + let style: any = {} + style.width = (width / zong) * 100 + '%'; + return style + } + + + + //得到当前单位信息 + getunitdata() { + this.http.get("/api/Account/Profiles").subscribe( + (data: any) => { + this.organizationName = data.organizationName + } + ) + } + dwaddtime//单位查询开始时间 + dwendtime//单位结束时间 + yuanaddtime//预案查询开始时间 + yuanendtime//预案查询结束时间 + integrityScoreMin//完整度最小值 + integrityScoreMax//完整度最大值 + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 + //得到当前单位所在组织机构的tree型数据 + getpresentOrganization() { + this.newallorganizations = this.allorganizations + this.newallorganizations.forEach(item => { + item.children = [] + this.newallorganizations.forEach(element => { + if (element.parentId == item.id) { + item.children.push(element) + } + }); + }); + this.http.get("/api/Account/Profiles").subscribe( + (data: any) => { + this.organizationName = data.organizationName + if (this.organizationName) { + this.newallorganizations.forEach(item => { + if (item.name == this.organizationName) { + this.dataSource.data = [item] + } + }); + } else { + this.dataSource.data = this.tree.toTree(this.treedata); + } + } + ) + + } + //获得所有组织机构 + getOrganizations() { + this.http.get('/api/Organizations').subscribe( + (data: any) => { + this.allorganizations = data + this.treedata = this.tree.toTree(data); + this.getpresentOrganization(); + } + ) + } + + //获得所有单位类型 + getUnittype() { + this.http.get('/api/BuildingTypes/Simple').subscribe( + data => { + this.allunittype = data + } + ) + } + //辖区中队div是否显示 + isorganizationbox: boolean = false + //点击辖区中队树,将选择的辖区中队添加到变量 + add(node) { + this.isorganizationbox = false + if(this.preparelevels==0){ + this.js = node.name + this.jsId = node.id + }else if(this.preparelevels==1){ + this.yuanjs=node.name + this.yuanjsId=node.id + } + + } + //关闭辖区中队隐藏框 + closeorganizationbox() { + this.isorganizationbox = false + } + //打开辖区中队隐藏框 + openorganizationbox() { + this.isorganizationbox = true + } + //关闭出现的组织机构div + closediv() { + this.isorganizationbox = false + } + //查询 + onSubmit(e) { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.dwendtimethis.yuanendtime){ + this.snackBar.open('开始时间不能早于结束时间', '确定', config); + } + this.getAllPlanInfo(); + } + companyName: any //单位名称 + js: any //单位所选组织机构 + jsId: any //单位所选组织机构的id + jscheck: boolean //单位所选组织机构勾选框 + yuanjs: any //预案所选组织机构 + yuanjsId: any //预案所选组织机构的id + yuanjscheck: boolean //预案所选组织机构勾选框 + unittype=[] //单位类型 + reservePlanType=[] //预案类型 + preparelevel=[1] //单位状态 + plcheck: boolean //编制级别勾选框 + planCategory=[] //预案级别 + integritySort=1 //单位排序字段 + yuanintegritySort=1 //预案排序字段 + //重置 + reset() { + if(this.preparelevels==0){ + this.js = '' + this.jsId = '' + this.jscheck = false + this.unittype = [] + this.preparelevel = [0] + this.dwaddtime = '' + this.dwendtime = '' + }else if(this.preparelevels==1){ + this.yuanaddtime='' + this.yuanendtime='' + this.yuanjs='' + this.yuanjsId='' + this.yuanjscheck=false + this.reservePlanType = [] + this.planCategory = [] + } + + //重新获取初始化列表 + this.getAllPlanInfo(); + } + exal(){ + var uri = 'data:application/vnd.ms-excel;base64,', + + template = '{table}
    ', + + base64 = function(s) { + + return window.btoa(unescape(encodeURIComponent(s))) + + }, + + format = function(s, c) { + + return s.replace(/{(\w+)}/g, function(m, p) { + + return c[p]; + + }) + + } + + return function(table, name) { + + if (!table.nodeType) table = document.getElementById(table); + + var ctx = { + + worksheet: name || 'Worksheet', + + table: table.innerHTML + + }; + + window.location.href = uri + base64(format(template, ctx)); + + } + } + + export(){ + const httpOptions = { + responseType: 'blob' as 'json' + }; + this.http.post(`/api/StatisticsAnalysis/Excel?queryMode=${this.preparelevels}`,this.excelData,httpOptions).subscribe((data:any) => { + // // 文件名中有中文 则对文件名进行转码 + const link = document.createElement('a'); + const blob = new Blob([data], {type: 'application/vnd.ms-excel'}); + link.setAttribute('href', window.URL.createObjectURL(blob)); + link.setAttribute('download', '报表统计'+'.xls'); + link.style.visibility = 'hidden'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }) + } + + + +} diff --git a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html index d1c0b0b..dec496c 100644 --- a/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html +++ b/src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html @@ -30,10 +30,10 @@
    -
    +
    -
    +
    \ No newline at end of file diff --git a/src/app/statistic-analysis/statistic-analysis-routing.module.ts b/src/app/statistic-analysis/statistic-analysis-routing.module.ts index 1720cad..b3dd69c 100644 --- a/src/app/statistic-analysis/statistic-analysis-routing.module.ts +++ b/src/app/statistic-analysis/statistic-analysis-routing.module.ts @@ -37,6 +37,7 @@ import { CompangInfoComponent } from './compang-info/compang-info.component' import { AllPlanComponent } from './all-plan/all-plan.component' import { PlanAnalysisBySynthesisComponent } from './plan-analysis-by-synthesis/plan-analysis-by-synthesis.component'; import { RealMonitoringComponent } from './real-monitoring/real-monitoring.component' +import { CombinedQueryComponent } from './combined-query/combined-query.component' const routes: Routes = [ { path: 'statePageOne', component: PageOneComponent }, @@ -71,7 +72,8 @@ const routes: Routes = [ { path: 'CompangInfo', component: CompangInfoComponent }, { path: 'AllPlan', component: AllPlanComponent }, { path: 'PlanAnalysisBySynthesis', component: PlanAnalysisBySynthesisComponent }, - { path: 'RealMonitoring', component: RealMonitoringComponent } + { path: 'RealMonitoring', component: RealMonitoringComponent }, + { path :'CombinedQuery',component:CombinedQueryComponent} ]; @NgModule({ diff --git a/src/app/statistic-analysis/statistic-analysis.module.ts b/src/app/statistic-analysis/statistic-analysis.module.ts index fc7d228..f8a1607 100644 --- a/src/app/statistic-analysis/statistic-analysis.module.ts +++ b/src/app/statistic-analysis/statistic-analysis.module.ts @@ -74,7 +74,8 @@ import { PsViewer }from './all-plan/all-plan.component'; import { GkPsViewer2, PlanAnalysisBySynthesisComponent } from './plan-analysis-by-synthesis/plan-analysis-by-synthesis.component' import { PlanManagementModule } from '../plan-management/plan-management.module'; import { RealMonitoringComponent } from './real-monitoring/real-monitoring.component'; -import { lookunit }from './all-plan/all-plan.component' +import { lookunit }from './all-plan/all-plan.component'; +import { CombinedQueryComponent } from './combined-query/combined-query.component' @NgModule({ declarations: [GkPsViewer2,PageOneComponent, PageTwoTimeComponent, PageTwoNameComponent, PageZhongDuiDetailsComponent, @@ -84,7 +85,7 @@ import { lookunit }from './all-plan/all-plan.component' BuildingTypeTwoReverseComponent, BuildingTypeThreeDetailsComponent, AddUnitOneComponent, AddUnitTwoTypeStatisticsComponent, AddUnitTwoTypeDetailsComponent, AddUnitTwoTimeComponent,AddUnitThreeLineDetailsComponent,AddUnitThreeBarDetailsComponent, HomeComponent, DeleteThereLineDetailsComponent, PageThereComponent, PageThereYearComponent, DeleteTwoNewaddComponent, - CompangInfoComponent, AllPlanComponent,PsViewer, RealMonitoringComponent,PlanAnalysisBySynthesisComponent,lookunit], + CompangInfoComponent, AllPlanComponent,PsViewer, RealMonitoringComponent,PlanAnalysisBySynthesisComponent,lookunit, CombinedQueryComponent], imports: [ CommonModule, StatisticAnalysisRoutingModule, diff --git a/src/app/ui/plan-template/Disaster.html b/src/app/ui/plan-template/Disaster.html index a82bacd..1b07d6e 100644 --- a/src/app/ui/plan-template/Disaster.html +++ b/src/app/ui/plan-template/Disaster.html @@ -21,10 +21,10 @@
    -
    +
    - +
    diff --git a/src/app/ui/plan-template/plan-template.component.html b/src/app/ui/plan-template/plan-template.component.html index 6adc72b..813f4ef 100644 --- a/src/app/ui/plan-template/plan-template.component.html +++ b/src/app/ui/plan-template/plan-template.component.html @@ -19,7 +19,7 @@
    -
    +
    {{item.unitname}}
    @@ -40,15 +40,15 @@ {{unitName}}
    - +
    - + - +
    @@ -60,9 +60,13 @@
    -
    +
    - 编辑 + 自定义 +
    +
    + + {{item.groupName=='单位概况'?'编辑':'新增'}}
    @@ -87,8 +91,10 @@
    - + +
    @@ -169,7 +175,7 @@ (click)='delattAndfileOne(item.groupName,element.surveyName,i)'> 删除 @@ -194,7 +200,7 @@ - 删除 + 删除 @@ -208,7 +214,19 @@
    - +
    + +
    +
    + + + + +
    +
    @@ -219,29 +237,78 @@
    -
    -
    - - - - + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + + +
    +
    +
    + + + + + +
    + + + +
    +
    +
    + + +
    +
    +
    + +
    - -
    +
    - +
    + +
    +
    + + + + +
    +
    @@ -271,8 +338,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 b64a32d..9d2c261 100644 --- a/src/app/ui/plan-template/plan-template.component.ts +++ b/src/app/ui/plan-template/plan-template.component.ts @@ -227,6 +227,7 @@ export class PlanTemplateComponent implements OnInit { } //右侧新增分组点击事件 addGroupClick(){ + var temp const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -246,6 +247,19 @@ export class PlanTemplateComponent implements OnInit { }); dialogRef.afterClosed().subscribe(result => { console.log(result,this.newleftTabledata) + /* if(result.length>this.newleftTabledata[this.leftclicki].data.length){ + this.newleftTabledata[this.leftclicki].data.forEach((item,i,value)=>{ + result.forEach((element,ri,rval) => { + if(value[i].groupName==rval[ri].groupName){ + console.log('000') + } + }); + }) + + this.newleftTabledata[this.leftclicki].data.push(result) + } */ + //this.newleftTabledata[this.leftclicki].data.push({groupName: '预案附件', completed: false}) + console.log(result) this.newleftTabledata.forEach((value,index,array)=>{ if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){ if(result!=undefined){ @@ -253,7 +267,8 @@ export class PlanTemplateComponent implements OnInit { //添加分组名称 if(array[index].data==null||array[index].data.length==0){ array[index].data=result - }else{ + } + else{ array[index].data[i].completed=rarr[i].completed } @@ -265,8 +280,31 @@ export class PlanTemplateComponent implements OnInit { }) }); } - console.log(this.newleftTabledata) + } + //自定义新增分组 + zdyaddGroup(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitName==undefined){ + this.snackBar.open('请选择预案模板!','确定',config); + }else{ + const dialogRef = this.dialog.open(zdyaddGroup, {//调用open方法打开对话框并且携带参数过去 + width: '340px', + height:'200px', + disableClose:true, + data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + if(result!=undefined){ + this.newleftTabledata[this.leftclicki].data.push({groupName:result,completed: true,attribute:[],zdy:true}) + } + + }); + } + } //删除分组 deleteGroup(groupName){ @@ -275,7 +313,8 @@ export class PlanTemplateComponent implements OnInit { if(isTrue){ this.group.forEach((element,index,array)=>{ if(array[index].groupName==groupName){ - this.group.splice(index,1) + //this.group.splice(index,1) + array[index].completed=false } }) } @@ -283,7 +322,9 @@ export class PlanTemplateComponent implements OnInit { } //新增属性 groupName - addAttribute(groupName){ + ziint=0 + addAttribute(zi,groupName){ + this.ziint=zi this.groupPanle=true this.groupName=groupName if(groupName=='单位概况'){ @@ -348,6 +389,26 @@ export class PlanTemplateComponent implements OnInit { this.groupPanle=true this.accordion.closeAll() } + //自定义新增属性 + zdyaddAttribute(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + const dialogRef = this.dialog.open(zdyaddattinf, {//调用open方法打开对话框并且携带参数过去 + width: '340px', + height:'200px', + disableClose:true, + data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + if(result!=undefined){ + this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result,zdy:true,attinf:[]}) + } + console.log(this.group) + }); + this.accordion.closeAll() + } //删除具体属性 delAttribute(groupName,surveyName){ let isTrue = confirm('您确定要删除吗') @@ -356,7 +417,12 @@ export class PlanTemplateComponent implements OnInit { if (array[index].groupName==groupName) { array[index].attribute.forEach((element,i) => { if(element.surveyName==surveyName){ - array[index].attribute[i].completed=false + if(array[index].attribute[i].zdy!=undefined){ + array[index].attribute.splice(i,1) + }else{ + array[index].attribute[i].completed=false + } + } }); } @@ -367,25 +433,61 @@ export class PlanTemplateComponent implements OnInit { } //新增属性信息 danweiInfTable=[] - addAttInfo(surveyName){ - if(surveyName=='进攻通道'){ - 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}) + addAttInfo(surveyName,suri){ + if(surveyName!='单位基本信息'&&surveyName!='建筑信息'&&surveyName!='四周毗邻'&&surveyName!='消防设施'&&surveyName!='重点部位'&&surveyName!='功能分区'){ + if(surveyName=='进攻通道'){ + if(this.group[0].attribute[suri].attinf==undefined){ + this.group[0].attribute[suri].attinf=[] + this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true}) + }else{ + this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true}) + } + } + else{ + const dialogRef = this.dialog.open(zdydisaster, {//调用open方法打开对话框并且携带参数过去 + width: '340px', + height:'450px', + disableClose:true, + data:this.group + }); + dialogRef.afterClosed().subscribe(result => { + console.log(result) + if(result!=undefined){ + this.group[0].attribute.forEach((value,index,array)=>{ + if(array[index].surveyName==surveyName){ + if(array[index].attinf==undefined){ + array[index].attinf=[] + array[index].attinf.push(result) + }else{ + array[index].attinf.push(result) + } + if(result.level==2){ + for(var i=0;i { - console.log(result) + //console.log(result) if(result!=undefined){ this.newleftTabledata[this,this.leftclicki].data.forEach((value,index,array)=>{ if(value.groupName=='单位概况'){ @@ -456,14 +558,34 @@ export class PlanTemplateComponent implements OnInit { } //消防设施表格具体属性删除 - fileDel(i,f){ + fileDel(suri,i,f){ let isTrue = confirm('您确定要删除该条信息吗') if(isTrue){ - this.group[0].attribute[3].attinf[i].facilityItems[f].completed=false + this.group[0].attribute[suri].attinf[i].facilityItems[f].completed=false + } + + } + //单位概况自定义新增表格数据 + zdyattackAdd(suri,i,level){ + /* this.group[0].attribute.forEach((value,index,array)=>{ + if (array[index].groupName==name) { + if(level==1){ + this.group[index].attribute[i].tableth.push('') + }else if(level==2){ + this.group[index].attribute[i].tableth.push({head:'',body:''}) + } + } + }) */ + this.group[0].attribute[suri].attinf[i].tableth.push('') + } + //单位概况自定义删除一条数据 + zdyDelDisaster(suri,attributei){ + let isTrue = confirm('您确定要删除该条信息吗') + if(isTrue){ + this.group[0].attribute[suri].attinf.splice(attributei,1) } } - //进攻通道 //进攻通道,灾情设定及其他增加表格数据 attackAdd(name,i,level){ @@ -530,6 +652,243 @@ export class PlanTemplateComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 + let linshi=[ + { + "attribute": [ + { + "attinf": [ + { + "value": "", + "olddata": "", + "completed": false, + "propertyName": "统一社会信用代码", + "propertyType": 0 + }, + { + "value": "", + "olddata": "", + "completed": false, + "propertyName": "单位类型", + "propertyType": 0 + }, + { + "value": "", + "olddata": "", + "completed": true, + "propertyName": "单位地址", + "propertyType": 0, + "analysisWord": { + "valueAxis": [ 1, 1 ], + "tableIndex": 0, + "valueField": "propertyValue" + } + }, + { + "value": "", + "olddata": "", + "completed": true, + "propertyName": "联系人", + "propertyType": 0, + "analysisWord": { + "valueAxis": [ 1, 5 ], + "tableIndex": 0, + "valueField": "propertyValue" + } + }, + { + "value": "", + "olddata": "", + "completed": false, + "propertyName": "辖区中队", + "propertyType": 0 + }, + { + "value": "", + "olddata": "", + "completed": true, + "propertyName": "联系电话", + "propertyType": 0, + "analysisWord": { + "valueAxis": [ 1, 5 ], + "tableIndex": 0, + "valueField": "propertyValue" + } + } + ], + "completed": true, + "surveyName": "单位基本信息" + }, + { + "completed": false, + "surveyName": "建筑信息" + }, + { + "attinf": [ + { + "name": "东", + "value": "", + "analysisWord": { + "valueAxis": [ 2, 2 ], + "tableIndex": 0, + "valueField": "value" + } + }, + { + "name": "西", + "value": "", + "analysisWord": { + "valueAxis": [ 2, 4 ], + "tableIndex": 0, + "valueField": "value" + } + }, + { + "name": "南", + "value": "", + "analysisWord": { + "valueAxis": [ 3, 2 ], + "tableIndex": 0, + "valueField": "value" + } + }, + { + "name": "北", + "value": "", + "analysisWord": { + "valueAxis": [ 3, 4 ], + "tableIndex": 0, + "valueField": "value" + } + } + ], + "completed": true, + "surveyName": "四周毗邻" + }, + { + "completed": false, + "surveyName": "消防设施" + }, + { + "completed": false, + "surveyName": "进攻通道" + }, + { + "attinf": [ + { + "body": [ + { + "name": "重点部位名称", + "value": "" + }, + { + "name": "重点部位所在位置", + "value": "" + }, + { + "name": "建筑结构", + "value": "" + }, + { + "name": "使用性质", + "value": "" + }, + { + "name": "主要危险性", + "value": "" + } + ], + "heafName": "" + } + ], + "completed": false, + "surveyName": "重点部位" + }, + { + "attinf": [ + { + "name": "", + "value": "" + } + ], + "completed": false, + "surveyName": "功能分区" + }, + { + "zdy": true, + "attinf": [ + { + "level": "3", + "tableth": "", + "headName": "备注详情", + "analysisWord": { + "valueAxis": [ 4, 1 ], + "tableIndex": 0, + "valueField": "tableth" + } + } + ], + "completed": true, + "surveyName": "备注" + } + ], + "completed": true, + "groupName": "单位概况" + }, + { + "completed": false, + "groupName": "灾情设定" + }, + { + "completed": false, + "groupName": "力量调集" + }, + { + "completed": false, + "groupName": "组织指挥" + }, + { + "completed": false, + "groupName": "作战行动" + }, + { + "completed": false, + "groupName": "社会联动" + }, + { + "completed": false, + "groupName": "勤务保障" + }, + { + "completed": false, + "groupName": "特别警示" + }, + { + "completed": false, + "groupName": "辅助决策" + }, + { + "completed": true, + "groupName": "交通水源", + "manualWord": { + "valueAxis": [ 1, 6 ], + "KeyAxis": [ 0, 6 ], + "tableIndex": 0 + } + }, + { + "completed": true, + "groupName": "重点图示" + }, + { + "completed": false, + "groupName": "处置要点" + }, + { + "completed": false, + "groupName": "预案附件" + } + ] + let body={ id:this.Id, basicCategoryId:this.newleftTabledata[this.leftclicki].basicCategoryId, @@ -537,7 +896,7 @@ export class PlanTemplateComponent implements OnInit { planCategory:Number(this.newleftTabledata[this.leftclicki].planCategory), data:JSON.stringify(this.newleftTabledata[this.leftclicki].data) } - console.log(`ary`, this.newleftTabledata, `key:`, this.leftclicki) + console.log(`ary`, this.newleftTabledata, `key:`, body) if(this.newleftTabledata[this.leftclicki].id==undefined){ /* this.http.post("/api/PlanTemplate",this.newleftTabledata[this.leftclicki]).subscribe((data:any)=>{ this.snackBar.open('创建成功!','确定',config); @@ -624,15 +983,14 @@ export class PlanTemplateComponent implements OnInit { } //第二层向上排序 zaiTop(zi,attributei){ + console.log(zi,attributei) var temp if(attributei!=0){ for (let index = attributei-1; index >=0; index--) { - if(this.group[zi].attribute[index].completed){ - temp=this.group[zi].attribute[index] + temp=this.group[zi].attribute[index] this.group[zi].attribute[index]=this.group[zi].attribute[attributei] this.group[zi].attribute[attributei]=temp - return - } + return } @@ -644,12 +1002,10 @@ export class PlanTemplateComponent implements OnInit { var temp if (attributei!=this.group[zi].attribute.length-1) { for (let index = attributei+1; index < this.group[zi].attribute.length; index++) { - if(this.group[zi].attribute[index].completed){ - temp=this.group[zi].attribute[index] - this.group[zi].attribute[index]=this.group[zi].attribute[attributei] - this.group[zi].attribute[attributei]=temp - return - } + temp=this.group[zi].attribute[index] + this.group[zi].attribute[index]=this.group[zi].attribute[attributei] + this.group[zi].attribute[attributei]=temp + return } @@ -720,6 +1076,158 @@ export class PlanTemplateComponent implements OnInit { } } + //单位概况自定义内容向上排序 + adyTop(suri,attributei){ + var temp + if(attributei!=0){ + for (let index = attributei-1; index >=0; index--) { + if(this.group[0].attribute[suri].completed){ + temp=this.group[0].attribute[suri].attinf[index] + this.group[0].attribute[suri].attinf[index]=this.group[0].attribute[suri].attinf[attributei] + this.group[0].attribute[suri].attinf[attributei]=temp + return + } + + } + + } + } + //自定义单位概况内容乡下排序 + adyDown(suri,attributei){ + var temp + if (attributei!=this.group[0].attribute[suri].attinf.length-1) { + for (let index = attributei+1; index < this.group[0].attribute[suri].attinf.length; index++) { + if(this.group[0].attribute[suri].completed){ + temp=this.group[0].attribute[suri].attinf[index] + this.group[0].attribute[suri].attinf[index]=this.group[0].attribute[suri].attinf[attributei] + this.group[0].attribute[suri].attinf[attributei]=temp + return + } + + } + + } + } + ////修改多行文本,表格行列数量 + 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({ @@ -930,6 +1438,35 @@ export class addGroup{ } } +//自定义新增分组 +@Component({ + selector: 'zdyaddGroup', + templateUrl: './zdyaddgroup.html', + styleUrls: ['./addgroup.scss'] +}) +export class zdyaddGroup{ + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + ngOnInit(): void{ + //console.log(this.data) + } + groupName + //取消按钮 + close(){ + this.dialogRef.close(); + } + //确定提交 + newGroup(){ + console.log(this.groupName) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.groupName==''||this.groupName==undefined){ + this.snackBar.open('请输入分组名称!','确定',config); + }else{ + this.dialogRef.close(this.groupName); + } + } +} //单位概况新增弹窗 @Component({ selector: 'adddwsurvey', @@ -947,10 +1484,11 @@ export class adddwsurvey{ ] ngOnInit(): void{ console.log(this.data) + this.data=JSON.parse(JSON.stringify(this.data)) this.data.forEach(element => { if(element.groupName=='单位概况'&&element.attribute!=undefined){ - //this.addwsurvey=element.attribute - element.attribute.forEach((datavalue,index,dataarr) => { + this.addwsurvey=element.attribute + /* element.attribute.forEach((datavalue,index,dataarr) => { this.addwsurvey.forEach((value,i,arr)=>{ if(dataarr[index].surveyName==arr[i].surveyName){ if(dataarr[index].completed==true&&arr[i].completed==false){ @@ -958,9 +1496,10 @@ ngOnInit(): void{ } } }) - }); + }); */ } }); + console.log(this.addwsurvey) } //取消按钮 close(){ @@ -971,6 +1510,35 @@ defineClick(){ this.dialogRef.close(this.addwsurvey) } } +//单位概况自定义新增弹窗 +@Component({ + selector: 'zdyaddattinf', + templateUrl: './zdyaddgroup.html', + styleUrls: ['./addgroup.scss'] +}) +export class zdyaddattinf{ + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + ngOnInit(): void{ + //console.log(this.data) + } + groupName + //取消按钮 + close(){ + this.dialogRef.close(); + } + //确定提交 + newGroup(){ + console.log(this.groupName) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.groupName==''||this.groupName==undefined){ + this.snackBar.open('请输入属性名称!','确定',config); + }else{ + this.dialogRef.close(this.groupName); + } + } +} //编辑单位概况单位基本信息属性信息弹窗 @Component({ selector: 'addattinf', @@ -988,19 +1556,24 @@ export class addattinf{ {propertyName:'单位地址',completed:false,propertyType:0,value:'',olddata:''}, /* {propertyName:'单位照片',completed:false,propertyType:0,value:''} *///,default:'-',must:'是',danwei:'-' ] -addAttinfBuild +addAttinfBuild=[] +buildnewDate=[] addAttinfFile +filenewDate=[] facilityItems ngOnInit(): void{ console.log(this.data) this.getattinf() } //获取弹窗信息 -getattinf(){ +async getattinf(){ + //this.data.newleftTabledata=JSON.parse(JSON.stringify(this.data.newleftTabledata)) + if(this.data.facilityItems==undefined){ + this.data.newleftTabledata=JSON.parse(JSON.stringify(this.data.newleftTabledata)) this.data.newleftTabledata[this.data.leftclicki].data.forEach(element => { if(element.groupName=='单位概况'&&element.attribute!=undefined){ - element.attribute.forEach(value => { + element.attribute.forEach(async value => { if(value.surveyName=='单位基本信息'&&value.attinf!=undefined){ //this.addAttinf=value.attinf value.attinf.forEach((datavalue,index,dataarr) => { @@ -1019,36 +1592,69 @@ getattinf(){ }) } */ else if(value.surveyName=='建筑信息'&&value.attinf==undefined){ + this.addAttinfBuild=[] let paramsdata:any ={ categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId } this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ - this.addAttinfBuild=data[0].propertyInfos + data.forEach(buildDate => { + this.addAttinfBuild.push(...buildDate.propertyInfos) + + }); this.addAttinfBuild.forEach(element => { element.completed=false element.olddata=element.propertyValue }); - console.log(this.addAttinfBuild) + //console.log(this.addAttinfBuild) }) }else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){ + this.buildnewDate=[] this.addAttinfBuild=value.attinf + this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild)) let paramsdata:any ={ categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId } - this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ - this.addAttinfBuild=data[0].propertyInfos - this.addAttinfBuild.forEach((element,ei,earr) => { - value.attinf.forEach((elattinf,fi,farr) => { - if(earr[ei].propertyName==farr[fi].propertyName){ - earr[ei].completed=farr[fi].completed - } - + let restlt=await new Promise((resolve) => { + this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ + data.forEach((buildDate,buildi,buildarr) => { + this.buildnewDate.push(...buildarr[buildi].propertyInfos) + resolve(data) }); - - element.olddata=element.propertyValue - }); + this.buildnewDate.forEach(element => { + element.completed=false + element.olddata=element.propertyValue + }); + }) + }) + this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate)) + let temp=0 + this.buildnewDate.forEach((buildval,buindi,buildarr)=>{ + temp=0 + this.addAttinfBuild.forEach((addval,addi,addarr)=>{ + if(buildval.propertyName==addval.propertyName){ + temp++ + } + }) + if(temp==0){ + console.log(buildval) + this.addAttinfBuild.push(buildval) + } + }) + this.addAttinfBuild.forEach((addval,addi,addarr)=>{ + temp=0 + this.buildnewDate.forEach((buildval,buindi,buildarr)=>{ + if(buildarr[buindi].propertyName==addarr[addi].propertyName){ + temp++ + } + }) + if(temp==0){ + console.log(addarr[addi]) + this.addAttinfBuild.splice(addi,1) + } + }) + console.log(this.buildnewDate) console.log(this.addAttinfBuild) - }) + }else if(value.surveyName=='消防设施'&&value.attinf==undefined){ let paramsdata:any ={ categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId @@ -1063,13 +1669,56 @@ getattinf(){ console.log(this.addAttinfFile) }) }else if(value.surveyName=='消防设施'&&value.attinf!=undefined){ + this.filenewDate=[] this.addAttinfFile=value.attinf + this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile)) + let paramsdata:any ={ + categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId + } + let restlt=await new Promise((resolve) => { + this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ + data.forEach((buildDate,buildi,buildarr) => { + this.filenewDate.push(buildDate) + resolve(data) + }); + this.filenewDate.forEach(element => { + element.completed=false + element.olddata=element.propertyValue + }); + }) + }) + this.filenewDate=JSON.parse(JSON.stringify(this.filenewDate)) + let temp=0 + this.filenewDate.forEach((buildval,buindi,buildarr)=>{ + temp=0 + this.filenewDate.forEach((addval,addi,addarr)=>{ + if(buildval.propertyName==addval.propertyName){ + temp++ + } + }) + if(temp==0){ + console.log(buildval) + this.filenewDate.push(buildval) + } + }) + this.filenewDate.forEach((addval,addi,addarr)=>{ + temp=0 + this.filenewDate.forEach((buildval,buindi,buildarr)=>{ + if(buildarr[buindi].propertyName==addarr[addi].propertyName){ + temp++ + } + }) + if(temp==0){ + console.log(addarr[addi]) + this.filenewDate.splice(addi,1) + } + }) } }); } }); }else{ - this.facilityItems=this.data.facilityItems + this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems)) console.log(this.facilityItems) /* this.facilityItems.forEach(element => { element.completed=false @@ -1087,7 +1736,56 @@ defineClick(){ this.addAttinfBuild:this.data.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) } } - +//单位概况自定义新增四个分类 +@Component({ + selector: 'zdydisaster', + templateUrl: './Disaster.html', + styleUrls: ['./addKeyname.scss'] +}) +export class zdydisaster{ + 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//列数 + hNumber//行数 + //取消按钮 + 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.level!=2&&this.level!=1)&&(this.headName==undefined||this.headName=='')){ + this.snackBar.open('请输入表头名称!','确定',config); + }else if(this.level==2&&(this.lieNumber==0||this.lieNumber==undefined) ){ + this.snackBar.open('请输入列数!','确定',config); + }else if(this.level==2&&(this.lieNumber==0||this.lieNumber==undefined)){ + this.snackBar.open('请输入行数!','确定',config); + } + else{ + let tree={ + json:[], + name: '' + } + let attrubute={ + headName:this.headName, + level:this.level, + tableth:this.level==1||this.level==2?[]:this.level==3?'':tree, + lieNumber:this.lieNumber, + hNumber:this.hNumber + } + this.dialogRef.close(attrubute); + } + + } +} //灾情设定弹窗 @Component({ selector: 'disaster', @@ -1133,3 +1831,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..5def8db --- /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/plan-template/zdyaddgroup.html b/src/app/ui/plan-template/zdyaddgroup.html new file mode 100644 index 0000000..bf7bcd5 --- /dev/null +++ b/src/app/ui/plan-template/zdyaddgroup.html @@ -0,0 +1,17 @@ +
    +
    + 自定义新增 +
    +
    +
    + + + + +
    +
    +
    + + +
    +
    \ No newline at end of file diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index 089dffd..b55b2a3 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -93,6 +93,10 @@ import { addattinf } from './plan-template/plan-template.component' import { disaster } from './plan-template/plan-template.component' import { BrowserModule } from '@angular/platform-browser'; 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, @@ -104,7 +108,7 @@ import { TreeDiagramModule } from './ng-tree-diagram/src/ng-tree-diagram'; 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], + EditBuildingBuilding, leftFunctionalDomainBuildingComponent, editPlaneFigureBuildingComponent, Organization, PlanTemplateComponent, addPlanname, upPlanname, addGroup, adddwsurvey, addattinf,disaster,zdyaddGroup,zdyaddattinf,zdydisaster,updataHl], imports: [ CommonModule, diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index fd47146..51efe69 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -24,10 +24,10 @@ export class AxLegend extends AxShape { super(assetData, workingArea); this.angle = -this.workingArea.backgroundImage.angle; this.name = this.assetData.Id; - this.pivot.set(this.assetData.PivotX, this.assetData.PivotY); + this.pivot.set(this.assetData.PivotX == undefined ? 0 : this.assetData.PivotX, this.assetData.PivotY == undefined ? 0 : this.assetData.PivotY); this.x = this.assetData.Point.x; this.y = this.assetData.Point.y; - this.scale.set(this.assetData.Scale); + this.scale.set(this.assetData.Scale == undefined ? 1 : this.assetData.Scale); this.shapeMap = shapeMap; this.createPoint(); this.refresh(); diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index de50e34..6f723ea 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -1239,7 +1239,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV RuleValue: '', PhysicalUnit: '', PropertyName: '列', - PropertyType: '2', + PropertyType: 2, PropertyValue: '2', }, ], @@ -1274,6 +1274,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.emit('createIcon', axLegend); } else { const axLegend = new AxLegend(data, this, shapeMap); + axLegend.assetData.PropertyInfos[0].PropertyType = Number(axLegend.assetData.PropertyInfos[0].PropertyType); axLegend.assetData.PropertyInfos[0].PropertyValue = String(axLegend.assetData.PropertyInfos[0].PropertyValue); } } diff --git a/src/assets/images/addyello.png b/src/assets/images/addyello.png new file mode 100644 index 0000000..dc78a14 Binary files /dev/null and b/src/assets/images/addyello.png differ diff --git a/src/assets/images/delyello.png b/src/assets/images/delyello.png new file mode 100644 index 0000000..2294fb1 Binary files /dev/null and b/src/assets/images/delyello.png differ diff --git a/src/assets/images/downyello.png b/src/assets/images/downyello.png new file mode 100644 index 0000000..01b0950 Binary files /dev/null and b/src/assets/images/downyello.png differ diff --git a/src/assets/images/uoyello.png b/src/assets/images/uoyello.png new file mode 100644 index 0000000..2d8ddfe Binary files /dev/null and b/src/assets/images/uoyello.png differ diff --git a/src/assets/images/updatabai.png b/src/assets/images/updatabai.png new file mode 100644 index 0000000..f009270 Binary files /dev/null and b/src/assets/images/updatabai.png differ diff --git a/src/assets/images/updateyello.png b/src/assets/images/updateyello.png new file mode 100644 index 0000000..fc373e3 Binary files /dev/null and b/src/assets/images/updateyello.png differ