邵佳豪 3 years ago
parent
commit
015ad26daa
  1. 22
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  2. 27
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 7
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  4. 321
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  5. 9
      src/app/plan-management/entry-plan-look/AddPlanone.html
  6. 16
      src/app/plan-management/entry-plan-look/changeUrl.html
  7. 6
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  8. 13
      src/app/plan-management/entry-plan-look/entry-plan-look.component.scss
  9. 330
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  10. 3
      src/app/plan-management/plan-management.module.ts
  11. 11
      src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html
  12. 8
      src/app/tabbar/tabbar.component.html
  13. 56
      src/app/tabbar/tabbar.component.ts
  14. 2
      src/app/ui/plan-template/plan-template.component.html
  15. 1
      src/app/ui/plan-template/plan-template.component.scss
  16. 473
      src/app/ui/plan-template/plan-template.component.ts
  17. 2
      src/app/ui/plan-template/zdyaddgroup.html

22
src/app/gis-management/gis-labeling/gis-labeling.component.ts

@ -424,7 +424,7 @@ export class GisLabelingComponent implements OnInit {
<div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">15022215122</label></div> <div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">15022215122</label></div>
</div> </div>
<div style="display: flex; margin-top: 10px;margin-left:8px""> <div style="display: flex; margin-top: 10px;margin-left:8px"">
<div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;"></label></div> <div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;">${e.organizationName || "暂无数据"}</label></div>
<div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">500</label></div> <div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">500</label></div>
</div> </div>
<div style="display: flex; margin-top: 10px;margin-left:8px""> <div style="display: flex; margin-top: 10px;margin-left:8px"">
@ -438,7 +438,6 @@ export class GisLabelingComponent implements OnInit {
<div class="btn" id="baseInformation"><img src="../../../assets/images/basicinfoicon.png" alt=""></div> <div class="btn" id="baseInformation"><img src="../../../assets/images/basicinfoicon.png" alt=""></div>
<div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div> <div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div>
<div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div> <div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div>
<div class="btn" id="threeeScene"><img src="../../../assets/images/3dicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div> <div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div> <div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div>
</div> </div>
@ -453,7 +452,7 @@ export class GisLabelingComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(item) })//基本信息点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(item) })//基本信息点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(item) })//导航点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(item) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(item) })//全景漫游点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(item) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(item) })//三维场景点击事件 //this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(item) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(item) })//查看预案点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(item) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(item) })//分享点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(item) })//分享点击事件
} }
@ -1211,7 +1210,7 @@ export class GisLabelingComponent implements OnInit {
<div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">15022215122</label></div> <div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">15022215122</label></div>
</div> </div>
<div style="display: flex; margin-top: 10px;margin-left:8px""> <div style="display: flex; margin-top: 10px;margin-left:8px"">
<div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;"></label></div> <div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;">${e.organizationName || "暂无数据"}</label></div>
<div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">500</label></div> <div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">500</label></div>
</div> </div>
<div style="display: flex; margin-top: 10px;margin-left:8px""> <div style="display: flex; margin-top: 10px;margin-left:8px"">
@ -1225,7 +1224,6 @@ export class GisLabelingComponent implements OnInit {
<div class="btn" id="baseInformation"><img src="../../../assets/images/basicinfoicon.png" alt=""></div> <div class="btn" id="baseInformation"><img src="../../../assets/images/basicinfoicon.png" alt=""></div>
<div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div> <div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div>
<div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div> <div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div>
<div class="btn" id="threeeScene"><img src="../../../assets/images/3dicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div> <div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div> <div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div>
</div> </div>
@ -1240,7 +1238,7 @@ export class GisLabelingComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 //this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件
marker.on('click', (ev) => { //marker点击事件 marker.on('click', (ev) => { //marker点击事件
@ -1253,7 +1251,7 @@ export class GisLabelingComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 //this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件
}) })
@ -1628,8 +1626,16 @@ export class LookPlanDialog {
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
} }
if (e.planMode == 3) { //如果是跳转网页 if (e.planMode == 3) { //如果是跳转网页
if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url) sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`) if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${e.url}?unitId=${this.data.id}&unitName=${this.data.name}&editMode=false`)
} else {
window.open(`/planManagement/webLook`)
}
}
} }
} }

27
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -3,7 +3,7 @@
<div class="titleitembox" cdkDropList cdkDropListOrientation="horizontal" (cdkDropListDropped)="drop($event)"> <div class="titleitembox" cdkDropList cdkDropListOrientation="horizontal" (cdkDropListDropped)="drop($event)">
<div cdkDrag class="item" *ngFor="let item of planTemplateData;let key = index" (click)="clickTitleItem(item)" <div cdkDrag class="item" *ngFor="let item of planTemplateData;let key = index" (click)="clickTitleItem(item)"
[ngClass]="{'selectedItem': selectedItem == item.groupName||item.groupName=='新建'}" [title]="item.groupName" [ngClass]="{'selectedItem': selectedItem == item.groupName||item.groupName=='新建'}" [title]="item.groupName"
[cdkDragDisabled]="item.groupName == '封面'"> [cdkDragDisabled]="item.groupName == '封面'" [style.display]="item.completed==true?'block':'none'">
<img src="../../../assets/images/add.png" *ngIf="item.groupName=='新建'"> <img src="../../../assets/images/add.png" *ngIf="item.groupName=='新建'">
{{item.groupName!='新建'?key + 1:''}}.{{item.groupName}} {{item.groupName!='新建'?key + 1:''}}.{{item.groupName}}
<img style="height: 38%;" src="../../../assets/images/update.png" *ngIf="item.new!=undefined" (click)='upName(key,item.groupName)' > <img style="height: 38%;" src="../../../assets/images/update.png" *ngIf="item.new!=undefined" (click)='upName(key,item.groupName)' >
@ -679,17 +679,17 @@
border: 0; border: 0;
box-sizing: border-box; box-sizing: border-box;
padding: 0 5px;"> {{ i.name }} </div> padding: 0 5px;"> {{ i.name }} </div>
<mat-icon class="deleteItem" *ngIf="key != 0 && pattern == 'edit'" <img src="../../../assets/images/deletered.png" class="deleteItem" *ngIf="key != 0 && pattern == 'edit'"
(click)="deleteItem(item,key)">delete (click)="deleteItem(item,key)" />
</mat-icon>
</div> </div>
<div class="keyImgImg"> <div class="keyImgImg">
<div style="margin-top: 10px; <div style="margin-top: 10px;
text-align: center; text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index"> position: relative;" class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index">
<mat-icon *ngIf="pattern == 'edit'" class="deleteImg" <img src="../../../assets/images/deletered.png" *ngIf="pattern == 'edit'" class="deleteImg"
(click)="deleteImgItem(i.imgArr,imgkey)">delete (click)="deleteImgItem(i.imgArr,imgkey)"/>
</mat-icon>
<img style="max-width: 100%; <img style="max-width: 100%;
width: auto; width: auto;
height: auto;" [src]="imgUrl" alt=""> height: auto;" [src]="imgUrl" alt="">
@ -721,6 +721,7 @@
opacity: 1; opacity: 1;
height: 40px; height: 40px;
line-height: 40px;">{{itemunit.name}}</span> line-height: 40px;">{{itemunit.name}}</span>
<img src="../../../assets/images/update.png" *ngIf="haveNew!=undefined" (click)='unitZdyaaa()'>
</div> </div>
<div class="unitbody" *ngFor="let element of itemunit.body;let elei=index" style=" height: 100%; <div class="unitbody" *ngFor="let element of itemunit.body;let elei=index" style=" height: 100%;
width: 100%; width: 100%;
@ -738,7 +739,8 @@
color: #ffffff;">{{element.surveyName}}</span> color: #ffffff;">{{element.surveyName}}</span>
<!-- <img src="../../../assets/images/deletered.png" > --> <!-- <img src="../../../assets/images/deletered.png" > -->
<img src="../../../assets/images/addbai.png" <img src="../../../assets/images/addbai.png"
(click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'&&element.surveyName!='进攻通道'"> (click)='unitadd(element.surveyName,uniti,elei)' *ngIf="pattern == 'edit'">
<img src="../../../assets/images/delyello.png" *ngIf="haveNew!=undefined">
</div> </div>
<div class="body"> <div class="body">
<!-- 进攻通道 --> <!-- 进攻通道 -->
@ -838,7 +840,8 @@
width: 100%; width: 100%;
background-color: #FFFBE8; background-color: #FFFBE8;
text-align: center;"> text-align: center;">
<input type="text" placeholder="请输入内容" [(ngModel)]="attack.name" [readonly]='attack.zdy==undefined'> <input type="text" placeholder="请输入内容" [(ngModel)]="attack.name" [readonly]='attack.zdy==undefined' *ngIf="pattern == 'edit'">
<span style=" margin-left: 20px;font-size: 16px;color: #b99a00;opacity: 1;height: 40px;line-height: 40px;" *ngIf="pattern != 'edit'">{{attack.name}}</span>
<img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'&&attack.zdy!=undefined" <img src="../../../assets/images/delyello.png" *ngIf="pattern == 'edit'&&attack.zdy!=undefined"
(click)='unitDel(element.surveyName,uniti,attacki)'> (click)='unitDel(element.surveyName,uniti,attacki)'>
<img src="../../../assets/images/addyello.png" <img src="../../../assets/images/addyello.png"
@ -925,12 +928,12 @@
background-color: #FFFBE8; background-color: #FFFBE8;
text-align: center;"> text-align: center;">
<input type="text" placeholder="请输入内容" [(ngModel)]="parts.heafName" *ngIf="pattern == 'edit'"> <input type="text" placeholder="请输入内容" [(ngModel)]="parts.heafName" *ngIf="pattern == 'edit'">
<textarea [(ngModel)]="parts.heafName" *ngIf="pattern == 'look'" style="width: 100%;height: 100%;color: #b99a00;" disabled></textarea> <!-- <textarea [(ngModel)]="parts.heafName" *ngIf="pattern == 'look'" style="width: 100%;height: 100%;color: #b99a00;" disabled></textarea> -->
<!-- <span style="font-size: 16px; <span style="font-size: 16px;
text-align: center; text-align: center;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #b99a00;" *ngIf="pattern == 'look'">{{parts.heafName}}</span> --> color: #b99a00;" *ngIf="pattern == 'look'">{{parts.heafName}}</span>
<img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'"> <img src="../../../assets/images/deletered.png" (click)='unitDel(element.surveyName,uniti,infoi)' *ngIf="pattern == 'edit'">
</div> </div>
<div class="partsBody"> <div class="partsBody">

7
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -744,6 +744,13 @@
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
img{
cursor: pointer;
float: right;
position: relative;
top: 10px;
right: 10px;
}
} }
.unitbody { .unitbody {
height: 100%; height: 100%;

321
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -20,6 +20,7 @@ import { TreeService } from '../../http-interceptors/tree.service'
import Viewer from 'viewerjs'; import Viewer from 'viewerjs';
import { async } from 'rxjs/internal/scheduler/async'; import { async } from 'rxjs/internal/scheduler/async';
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { adddwsurvey, addGroup } from '@src/app/ui/plan-template/plan-template.component';
declare var $: any declare var $: any
@Component({ @Component({
selector: 'app-create-plan-online-five', selector: 'app-create-plan-online-five',
@ -57,13 +58,18 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planLevel: string//预案级别 planLevel: string//预案级别
blockyl = true blockyl = true
zaixianDr=false zaixianDr=false
haveNew=false
ngOnInit(): void { ngOnInit(): void {
this.haveNew=this.route.snapshot.queryParams.haveNew
console.log(this.route.snapshot.queryParams.wordChange)
this.planLevel = this.route.snapshot.queryParams.planCategory this.planLevel = this.route.snapshot.queryParams.planCategory
if (this.route.snapshot.queryParams.pattern == 'false') { if (this.route.snapshot.queryParams.pattern == 'false') {
this.pattern = 'look' this.pattern = 'look'
this.blockyl = false this.blockyl = false
this.clickTitleItem('单位概况') this.selectedItem='单位概况'
//this.clickTitleItem(this.planTemplateData[1])
} else { } else {
this.selectedItem='封面'
this.pattern = 'edit' this.pattern = 'edit'
} }
this.getUnitData() this.getUnitData()
@ -159,11 +165,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
data.items.forEach(element => { data.items.forEach(element => {
if (element.id == this.route.snapshot.queryParams.companyId) { if (element.id == this.route.snapshot.queryParams.companyId) {
this.unitData = element this.unitData = element
if((this.unitData.buildingTypes[0].name=='高层建筑'||this.unitData.buildingTypes[0].name=='居民小区'||this.unitData.buildingTypes[0].name=='厂房' if(this.planLevel=='5'){
||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 this.zaixianDr=true
} }
//console.log('单位列表信息', this.unitData) //console.log('单位列表信息', this.unitData)
@ -235,7 +237,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}) })
this.buData = JSON.parse(JSON.stringify(this.buData)) this.buData = JSON.parse(JSON.stringify(this.buData))
console.log(this.buData)
this.buData[0].forEach((pvalue, pindex, parr) => { this.buData[0].forEach((pvalue, pindex, parr) => {
if (parr[pindex].length > 0) { if (parr[pindex].length > 0) {
parr[pindex].forEach((nval, nindex, narr) => { parr[pindex].forEach((nval, nindex, narr) => {
@ -354,13 +355,29 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
let index = this.getArrayIndex(this.planTemplateData,'单位概况') let index = this.getArrayIndex(this.planTemplateData,'单位概况')
this.planTemplateData[index].building.forEach(element => { this.planTemplateData[index].building.forEach(element => {
if(element.body[0].completed){ if(element.body[0].completed){
element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci element.body[0].attinf.forEach((arrval,atti,attarr) => {
if(arrval.propertyName=='统一社会信用代码'){
arrval.value=arrval.olddata=this.unitData.usci
}else if(arrval.propertyName=='单位类型'){
arrval.value=arrval.olddata=this.unitData.buildingTypes[0].name
}else if(arrval.propertyName=='联系人'){
arrval.value=arrval.olddata=this.unitData.contacts
}else if(arrval.propertyName=='联系电话'){
arrval.value=arrval.olddata=this.unitData.phone
}else if(arrval.propertyName=='辖区中队'){
arrval.value=arrval.olddata=this.unitData.organizationName
}else if(arrval.propertyName=='单位地址'){
arrval.value=arrval.olddata=this.unitData.address
}
});
/* 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[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[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 element.body[0].attinf[3].value = element.body[0].attinf[3].olddata = this.unitData.phone
element.body[0].attinf[4].value = element.body[0].attinf[4].olddata = this.unitData.organizationName element.body[0].attinf[4].value = element.body[0].attinf[4].olddata = this.unitData.organizationName
element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address */
if (element.body[1].attinf != undefined) {
if (element.body.length>1&&element.body[1].attinf != undefined) {
element.body[1].attinf.forEach(eBuild => { element.body[1].attinf.forEach(eBuild => {
this.buildZong.forEach(oldBuild => { this.buildZong.forEach(oldBuild => {
if (oldBuild.buildingBasicGroups.length > 0) { if (oldBuild.buildingBasicGroups.length > 0) {
@ -375,8 +392,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}); });
console.log(this.planTemplateData) console.log(this.planTemplateData)
} else if (this.selectedItem == '预案附件') { } else if (this.selectedItem == '预案附件') {
this.getTwoDPlanList() this.getTwoDPlanList()
@ -457,7 +472,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
//console.log(this.buildingsData) //console.log(this.buildingsData)
if (this.planTemplateData[index].building == undefined) { if (this.planTemplateData[index].building == undefined) {
this.planTemplateData[index].building = [] this.planTemplateData[index].building = []
if (this.planTemplateData[index].attribute[1].attinf != undefined) { /* if (this.planTemplateData[index].attribute[1].attinf != undefined) {
this.planTemplateData[index].attribute[1].attinf.forEach(pData => { this.planTemplateData[index].attribute[1].attinf.forEach(pData => {
this.buildingsData.forEach((bDara, bi, bArr) => { this.buildingsData.forEach((bDara, bi, bArr) => {
if (bDara.buildingBasicGroups.length > 0) { if (bDara.buildingBasicGroups.length > 0) {
@ -467,7 +482,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
}) })
}); });
} } */
for (var i = 0; i < this.buildDataName.length; i++) { for (var i = 0; i < this.buildDataName.length; i++) {
if (i == 0) { if (i == 0) {
@ -547,92 +562,142 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planTemplateData: any planTemplateData: any
//获得模板信息 //获得模板信息
getTemplateData() { danweInfo={
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => { //若选择自定义,默认三条信息
//console.log('预案内容', data) attribute:[
this.planTemplateData = JSON.parse(data.webTextData).filter(item => {
item.completed == true attinf:[
) {completed: true,olddata: "",propertyName: "联系人",propertyType: 0,propertyValue: "",value: ""},
//console.log(this.planTemplateData) {completed: true,olddata: "",propertyName: "联系电话",propertyType: 0,propertyValue: "",value: ""},
if (this.planTemplateData[0].groupName != '封面') { {completed: true,olddata: "",propertyName: "单位地址",propertyType: 0,propertyValue: "",value: ""}
let obj = { ],
completed: true, completed: true,
groupName: "封面", surveyName: "单位基本信息"
attribute: {
planNumber: '',
planName: this.route.snapshot.queryParams.planName,
objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name,
planLevel: '',
disasterType: '火灾',
fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '',
producer: {
name: '',
duty: ''
},
verifier: {
name: '',
duty: ''
},
auditTime: ''
}
}
this.planTemplateData.unshift(obj)
}
else if (this.planTemplateData[0].groupName == '封面') {
this.planTemplateData[0].attribute.objName = this.unitData.name
} }
this.planTemplateData.forEach(element => { ],
if (element.groupName == '重点图示') { completed: true,
if (!element.attribute) { groupName: "单位概况"
element.attribute = [{ name: '', imgArr: [] }] }
} getTemplateData() {
} this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
if (element.groupName == '交通水源') { console.log('预案内容', data)
if (!element.attribute) { if(this.route.snapshot.queryParams.haveNew!=undefined&&data.webTextData==null){
element.attribute = [{ name: '', imgArr: [] }] this.planTemplateData=[]
} let obj = {
} completed: true,
if (element.groupName == '预案附件') { groupName: "封面",
if (!element.attribute) { attribute: {
element.attribute = [{ name: '', imgArr: [] }] planNumber: '',
planName: this.route.snapshot.queryParams.planName,
objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name,
planLevel: '',
disasterType: '火灾',
fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '',
producer: {
name: '',
duty: ''
},
verifier: {
name: '',
duty: ''
},
auditTime: ''
}
} }
} this.planTemplateData.unshift(obj)
if (element.groupName == '处置要点') { this.planTemplateData.push(this.danweInfo)
if (!element.attribute) { this.planTemplateData.push({completed: true,groupName: '新建'})
element.attribute = [{ name: '', content: '' }] console.log(this.planTemplateData)
}else if(data.webTextData!=null){
this.planTemplateData = JSON.parse(data.webTextData).filter(item =>
item.completed == true
)
//this.planTemplateData=JSON.parse(data.webTextData)
console.log(this.planTemplateData)
if (this.planTemplateData[0].groupName != '封面') {
let obj = {
completed: true,
groupName: "封面",
attribute: {
planNumber: '',
planName: this.route.snapshot.queryParams.planName,
objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name,
planLevel: '',
disasterType: '火灾',
fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '',
producer: {
name: '',
duty: ''
},
verifier: {
name: '',
duty: ''
},
auditTime: ''
}
}
this.planTemplateData.unshift(obj)
} }
} else if (this.planTemplateData[0].groupName == '封面') {
if (element.groupName == '特别警示') { this.planTemplateData[0].attribute.objName = this.unitData.name
if (!element.attribute) {
element.attribute = [{ name: '特别警示', content: '' }]
} }
} this.planTemplateData.forEach(element => {
if(element.groupName=='三位概况'){ if (element.groupName == '重点图示') {
this.clickTitleItem('单位概况') if (!element.attribute) {
} element.attribute = [{ name: '', imgArr: [] }]
}); }
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
} }
}); */ if (element.groupName == '交通水源') {
for(let i=0;i<element.attribute.length;i++){ if (!element.attribute) {
if(element.attribute[i].level!=undefined&&element.attribute[i].level==1){ element.attribute = [{ name: '', imgArr: [] }]
element.attribute[i].lieNumber=element.attribute[i].tableth.length }
} }
if (element.groupName == '预案附件') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
if (element.groupName == '处置要点') {
if (!element.attribute) {
element.attribute = [{ name: '', content: '' }]
}
}
if (element.groupName == '特别警示') {
if (!element.attribute) {
element.attribute = [{ name: '特别警示', content: '' }]
}
}
if(element.groupName=='单位概况'){
this.clickTitleItem(this.planTemplateData[1])
}
});
if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){
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<element.attribute.length;i++){
if(element.attribute[i].level!=undefined&&element.attribute[i].level==1){
element.attribute[i].lieNumber=element.attribute[i].tableth.length
}
}
}
});
console.log(this.planTemplateData)
} }
}); })
console.log(this.planTemplateData)
})
} }
//引入数据json //引入数据json
@ -1375,6 +1440,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
console.log(bodyi) console.log(bodyi)
if(arr[bodyi].zdy==undefined){ if(arr[bodyi].zdy==undefined){
if (surveyName == '进攻通道') { if (surveyName == '进攻通道') {
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[]
}
if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr == undefined) { 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 = []
} }
@ -1397,11 +1465,17 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] }) 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 == '建筑信息'){ else if(surveyName == '单位基本信息'||surveyName == '建筑信息'){
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[]
}
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true }) this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true })
} else if(surveyName == '四周毗邻'){ } 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:false })
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:true }) this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:true })
}else if(surveyName == '消防设施'){ }else if(surveyName == '消防设施'){
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[]
}
if(fileNum==0){ if(fileNum==0){
this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.push({ name: '', value: '',completed:true,zdy:true}) this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.push({ name: '', value: '',completed:true,zdy:true})
}else{ }else{
@ -1700,21 +1774,22 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
fileData fileData
iftrue=false iftrue=false
fileSc(e){ fileSc(e){
this.clickTitleItem(this.planTemplateData[1])
this.iftrue=true this.iftrue=true
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
let formData = new FormData() let formData = new FormData()
formData.append("file", e.target.files[0]) formData.append("file", e.target.files[0])
console.log(formData)
let type=this.unitData.buildingTypes[0].name=='高层建筑'?1:this.unitData.buildingTypes[0].name=='居民小区'?2:this.unitData.buildingTypes[0].name=='厂房'?3 let type=this.unitData.buildingTypes[0].name=='高层建筑'?1:this.unitData.buildingTypes[0].name=='居民小区'?2:this.unitData.buildingTypes[0].name=='厂房'?3
:(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.unitData.buildingTypes[0].name=='影剧院'||this.unitData.buildingTypes[0].name=='展览建筑'||this.unitData.buildingTypes[0].name=='养老院'
||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':this.unitData.buildingTypes[0].name=='化工生产'?'hgFivePlan':'' ||this.unitData.buildingTypes[0].name=='会议中心')?4:this.unitData.buildingTypes[0].name=='储罐类'?'StorageTankFivePlan':
/* let fileData={ this.unitData.buildingTypes[0].name=='化工生产'?'ChemicalProductionFivePlan':this.unitData.buildingTypes[0].name=='轨道交通'?'MetroFivePlan':
type:this.unitData.buildingTypes[0].name=='高层建筑'?1:2, this.unitData.buildingTypes[0].name=='地下建筑'?'UndergroundBuildingFivePlan':this.unitData.buildingTypes[0].name=='农村'?'CountrysideFivePlan':''
file:formData
} */
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{ this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{
console.log(data) console.log(data)
if(data==null){ if(data==null){
@ -1724,11 +1799,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.fileData.forEach((value,index,array) => { this.fileData.forEach((value,index,array) => {
if(value.groupName=='交通水源'||value.groupName=='重点图示'){ if(value.groupName=='交通水源'||value.groupName=='重点图示'){
value.attribute.forEach(element => { value.attribute.forEach(element => {
element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length) if(element.imgArr!=undefined&&element.imgArr.length>0){
element.imgArr[0]=element.imgArr[0].slice(25,element.imgArr[0].length)
}
}); });
} }
this.planTemplateData.forEach((pvalue,pindex,parr) => { this.planTemplateData.forEach((pvalue,pindex,parr) => {
if(parr[1].building==undefined){ if(parr[1].building==undefined){
this.planTemplateData[index].building = []
if(array[index].groupName==parr[pindex].groupName){ if(array[index].groupName==parr[pindex].groupName){
parr[pindex].attribute=array[index].attribute parr[pindex].attribute=array[index].attribute
} }
@ -1740,7 +1819,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
} }
}); });
}); });
//console.log(this.fileData) //console.log(this.fileData)
this.snackBar.open('解析成功!', '确定', config); this.snackBar.open('解析成功!', '确定', config);
@ -1788,6 +1867,47 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
console.log(this.planTemplateData) console.log(this.planTemplateData)
}); });
} }
//单位概况自定义新增数据
unitZdyaaa(){
let list=[]
let index = this.getArrayIndex(this.planTemplateData,'单位概况')
const dialogRef = this.dialog.open(adddwsurvey, {//调用open方法打开对话框并且携带参数过去
width: '240px',
height:'420px',
disableClose:true,
data:this.planTemplateData
});
dialogRef.afterClosed().subscribe(result => {
console.log(result)
if(result!=undefined){
if(result.length>this.planTemplateData.length){
result.forEach((valuer,i,rarr) => {
let temp=0
this.planTemplateData[index].attribute.forEach((group,gi,garr) => {
if(valuer.surveyName==group.surveyName){
temp++
}
})
if(temp==0){
//将缺少的填上
this.planTemplateData[index].attribute.push(valuer)
}
});
}
result.forEach((valuer,i,rarr) => {
this.planTemplateData[index].attribute.forEach((group,gi,garr) => {
if(garr[gi].surveyName==rarr[i].surveyName){
garr[gi].completed=rarr[i].completed
}
});
})
this.planTemplateData[index].building[this.clicki].body=this.planTemplateData[index].attribute
}
console.log(this.planTemplateData)
})
}
} }
@ -2000,4 +2120,5 @@ export class updataHl{
} }
this.dialogRef.close(result); this.dialogRef.close(result);
} }
} }

9
src/app/plan-management/entry-plan-look/AddPlanone.html

@ -62,9 +62,13 @@
<span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span> <span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span>
</div> </div>
<div *ngIf="inputword"> <div *ngIf="inputword">
<mat-radio-button value="2" style="margin-right: 10px;">在线编制</mat-radio-button> <mat-radio-button value="2" style="margin-right: 10px;">模板在线编制</mat-radio-button>
<button mat-raised-button *ngIf="isinput" (click)='createWord()'>在线编制预案</button> <!-- <button mat-raised-button *ngIf="isinput" (click)='createWord()'>在线编制预案</button> -->
</div> </div>
<div *ngIf="inputNew">
<mat-radio-button value="4" style="margin-right: 10px;">自定义在线编制</mat-radio-button>
</div>
<!-- <div *ngIf="inputword"> <!-- <div *ngIf="inputword">
<mat-radio-button value="1" style="margin-right: 10px;">导入word文档</mat-radio-button> <mat-radio-button value="1" style="margin-right: 10px;">导入word文档</mat-radio-button>
<input type="file" name="" id="" *ngIf="isinput" (change)="fileInput($event)"> <input type="file" name="" id="" *ngIf="isinput" (change)="fileInput($event)">
@ -84,6 +88,7 @@
</div> </div>
</mat-radio-group> </mat-radio-group>
</div> </div>
<!-- --> <!-- -->
<div class="progressBox" *ngIf="uploadisLoading"> <div class="progressBox" *ngIf="uploadisLoading">

16
src/app/plan-management/entry-plan-look/changeUrl.html

@ -0,0 +1,16 @@
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="topbox" style="text-align: center;">
<span mat-dialog-title>更改三维预案路径</span>
</div>
<div class="mainbox">
<mat-form-field>
<input matInput placeholder="更改三维预案路径" [(ngModel)]="planUrl"
name='name' required>
</mat-form-field>
</div>
<div class="btn" style="margin-top:10px;">
<button mat-raised-button color="primary" >确定</button>
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button>
</div>
</form>

6
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -7,6 +7,9 @@
* @LastEditTime: 2021-08-24 14:01:03 * @LastEditTime: 2021-08-24 14:01:03
--> -->
<!-- <p>录入预案</p> --> <!-- <p>录入预案</p> -->
<div class="shadow" *ngIf="spinner==true">
<mat-spinner></mat-spinner>
</div>
<div style="overflow: auto;height: 100%;"> <div style="overflow: auto;height: 100%;">
<div class="header" style="position: relative;"> <div class="header" style="position: relative;">
<div> <div>
@ -81,6 +84,7 @@
<th mat-header-cell *matHeaderCellDef>操作</th> <th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span> <span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span>
<span (click)="upzhuanMb(element)" *ngIf="element.planMode==1&&element.planType==16&&element.planCategory==5">转在线导入</span>
<span (click)="editPlan(element)" <span (click)="editPlan(element)"
[ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span> [ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span>
<span (click)="lookPlan(element)" *ngIf="element.planType == 2 || element.planType == 16">查看</span> <span (click)="lookPlan(element)" *ngIf="element.planType == 2 || element.planType == 16">查看</span>
@ -109,4 +113,4 @@
</mat-paginator> </mat-paginator>
</div> </div>
</div> </div>
</div> </div>

13
src/app/plan-management/entry-plan-look/entry-plan-look.component.scss

@ -171,4 +171,17 @@
} }
} }
}
.shadow{
height: 100%;
width: 100%;
z-index:998;
background-color:#FFFFFF;
opacity:0.3;
mat-spinner{
position: relative;
top: 40%;
left: 40%;
}
} }

330
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -14,6 +14,7 @@ import { async } from '@angular/core/testing';
import { Viewer } from 'photo-sphere-viewer'; import { Viewer } from 'photo-sphere-viewer';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper'; import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import Swiper from 'swiper'; import Swiper from 'swiper';
import { resolve } from 'dns';
declare var CryptoJS declare var CryptoJS
@Component({ @Component({
selector: 'app-entry-plan-look', selector: 'app-entry-plan-look',
@ -173,56 +174,9 @@ export class EntryPlanLookComponent implements OnInit {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
if (e.auditStatus == 8) { let isTrue = confirm('您确定编辑吗,若是公开预案会变成未公开状态')
if (e.planType == 1) { //如果是在线编辑 if(isTrue){
let id = e.id if (e.auditStatus == 8) {
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", this.companyId)
sessionStorage.setItem("buildingTypeId", this.unittypeId)
sessionStorage.setItem("editable", "1")
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
}
else if (e.planType == 16) {
if (e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`)
}
else {
let body = {};
let resetAudit = true
let headers = new HttpHeaders({
'Content-Type': 'text/json'
});
let options = {
headers
};
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => {
this.getAllPlanComponents()
this.lookPlan(e)
}/* ,err => {
this.snackBar.open(err,'确定',config);
} */)
}
}
else if (e.planType == 2) { //三维预案
if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`)
} else {
window.open(`/planManagement/webLook`)
}
}
} else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}
} else {
let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗')
if (isTrue) {
if (e.planType == 1) { //如果是在线编辑 if (e.planType == 1) { //如果是在线编辑
let id = e.id let id = e.id
sessionStorage.setItem("planId", id) sessionStorage.setItem("planId", id)
@ -235,8 +189,12 @@ export class EntryPlanLookComponent implements OnInit {
} }
else if (e.planType == 16) { else if (e.planType == 16) {
if (e.attachmentUrls == null) { if (e.attachmentUrls == null) {
console.log(this.compantData) if(e.planMode==4){
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true&haveNew=true`)
}else{
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=true`)
}
} }
else { else {
let body = {}; let body = {};
@ -251,13 +209,28 @@ export class EntryPlanLookComponent implements OnInit {
this.getAllPlanComponents() this.getAllPlanComponents()
this.lookPlan(e) this.lookPlan(e)
}/* ,err => { }/* ,err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err,'确定',config);
} */) } */)
} }
} }
else if (e.planType == 2) { //三维预案 else if (e.planType == 2) { //三维预案
if (e.url.indexOf('app') == 0) { const dialogRef = this.dialog.open(ChangeUrl, {
//改网址
data: { element: e }
});
dialogRef.afterClosed().subscribe(
data => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功!', '确定', config);
this.getAllPlanComponents()
}
}
);
/* if (e.url.indexOf('app') == 0) {
window.location.href = e.url window.location.href = e.url
} else { } else {
sessionStorage.setItem("url", e.url) sessionStorage.setItem("url", e.url)
@ -266,15 +239,80 @@ export class EntryPlanLookComponent implements OnInit {
} else { } else {
window.open(`/planManagement/webLook`) window.open(`/planManagement/webLook`)
} }
} } */
} else { } else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
} }
} else {
let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗')
if (isTrue) {
if (e.planType == 1) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", this.companyId)
sessionStorage.setItem("buildingTypeId", this.unittypeId)
sessionStorage.setItem("editable", "1")
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
}
else if (e.planType == 16) {
if (e.attachmentUrls == null) {
console.log(this.compantData)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`)
}
else {
let body = {};
let resetAudit = true
let headers = new HttpHeaders({
'Content-Type': 'text/json'
});
let options = {
headers
};
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => {
this.getAllPlanComponents()
this.lookPlan(e)
}/* ,err => {
this.snackBar.open(err,'确定',config);
} */)
}
}
else if (e.planType == 2) { //三维预案
/* if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`)
} else {
window.open(`/planManagement/webLook`)
}
} */
const dialogRef = this.dialog.open(ChangeUrl, {
data: { element: e }
});
dialogRef.afterClosed().subscribe(
data => {
if (data) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功!', '确定', config);
this.getAllPlanComponents()
}
}
);
} else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}
}
} }
} }
} }
allPlanComponents: any //所有预案组件 allPlanComponents: any //所有预案组件
companyId: any //新建预案需要使用的id companyId: any //新建预案需要使用的id
@ -348,6 +386,8 @@ export class EntryPlanLookComponent implements OnInit {
this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data => { this.http.delete(`/api/PlanComponents2D/${plandata.id}`).subscribe(data => {
this.snackBar.open('删除成功!', '确定', config); this.snackBar.open('删除成功!', '确定', config);
this.getAllPlanComponents() this.getAllPlanComponents()
},err=>{
this.snackBar.open(err, '确定', config);
}) })
} else { } else {
this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data => { this.http.delete(`/api/PlanComponents/${plandata.id}`).subscribe(data => {
@ -356,6 +396,8 @@ export class EntryPlanLookComponent implements OnInit {
config.duration = 3000 config.duration = 3000
this.snackBar.open('删除成功!', '确定', config); this.snackBar.open('删除成功!', '确定', config);
this.getAllPlanComponents() this.getAllPlanComponents()
},err=>{
this.snackBar.open(err, '确定', config);
}) })
} }
} }
@ -456,12 +498,12 @@ export class EntryPlanLookComponent implements OnInit {
let file = this.download let file = this.download
let fileSize = file.fileLength//下载文件的总大小 let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
console.log(file)
if (file && fileSize <= shardSize) { //<=10MB时直接下载 if (file && fileSize <= shardSize) { //<=10MB时直接下载
this.downloadisLoading = true this.downloadisLoading = true
// this.setFileLoading() // this.setFileLoading()
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => {
console.log(data)
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
@ -558,6 +600,74 @@ export class EntryPlanLookComponent implements OnInit {
} }
); );
} }
//上传word转在线编制
spinner=false//圈圈是否存在
async upzhuanMb(element){
this.spinner=true
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
let objectName//预案文件名称
let formData = new FormData()
//模板导入接口传参
let type=this.unitdata.unittype=='高层建筑'?1:this.unitdata.unittype=='居民小区'?2:this.unitdata.unittype=='厂房'?3
:(this.unitdata.unittype=='商市场'||this.unitdata.unittype=='医院'||this.unitdata.unittype=='学校'
||this.unitdata.unittype=='宾馆'||this.unitdata.unittype=='娱乐场所'||this.unitdata.unittype=='餐饮业'
||this.unitdata.unittype=='影剧院'||this.unitdata.unittype=='展览建筑'||this.unitdata.unittype=='养老院'
||this.unitdata.unittype=='会议中心')?4:this.unitdata.unittype=='储罐类'?'StorageTankFivePlan'
:this.unitdata.unittype=='化工生产'?'ChemicalProductionFivePlan':this.unitdata.unittype=='农村'?'CountrysideFivePlan':''
let blob=[]
/*
,blob
*/
let fileRuquest=await new Promise((resolve,reject)=>{
this.http.get(`/api/ObjectMetadata/PlanPlatform/`+element.attachmentUrls[0]).subscribe((obdata: any) => {
objectName=obdata.objectName
this.http.get(`/api/Objects/PlanPlatform/${objectName}`, { responseType: 'blob' },).subscribe(blobdata => {
resolve(blobdata)
})
})
})
blob.push(fileRuquest)//接收返回的blob类型数据
let file=new File(blob,objectName)//转化为file类型
formData.append('file',file)
let pData//接受返回的模板信息数据
/*
线json,pData
*/
let pRequest=await new Promise((resolve,rejest)=>{
this.http.post(`/api/OfficeExtract/ExtractWordPlan?type=${type}`,formData).subscribe((data:any)=>{
resolve(data)
},err=>{
this.spinner=false
this.snackBar.open('解析失败,请确定好格式再重新上传!', '确定', config);
})
})
pData=pRequest
/* 调用新建预案接口,新建一条新的预案,并跳转新建在线编制页面 */
let body={
name:(element.planCategory==3?'Ⅲ级':element.planCategory==4?'Ⅳ级':element.planCategory==5?'Ⅴ级':'')+ element.name+'转在线编制',
planType: element.planType,
planMode: 2,
planLevel: element.planLevel,
planCategory:element.planCategory,
webTextData:JSON.stringify(pData)
}
let planData
let newyuan=await new Promise((resolve,reject)=>{
this.http.post('/api/PlanComponents', body, {
params: {
companyId: this.route.snapshot.queryParams.unitId
}
}).subscribe(plandata => {
resolve(plandata)
})
})
planData=newyuan
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.route.snapshot.queryParams.unitId}&planName=${planData.name}&unitName=${this.unitdata.unitname}&planCategory=${planData.planCategory}&planId=${planData.id}&&wordChange=true`)
this.getAllPlanComponents()
this.spinner=false
}
} }
@ -849,6 +959,7 @@ export class AddPlanone {
inputword: boolean = false //导入文档 inputword: boolean = false //导入文档
onlineedit: boolean = false //在线编辑 onlineedit: boolean = false //在线编辑
website: boolean = false //网页地址 website: boolean = false //网页地址
inputNew :boolean=false //自定义编辑
next(formdata) { next(formdata) {
//console.log(formdata.value.firstCtrlthree) //console.log(formdata.value.firstCtrlthree)
//console.log(this.file) //console.log(this.file)
@ -867,16 +978,26 @@ export class AddPlanone {
this.inputword = true this.inputword = true
this.onlineedit = false this.onlineedit = false
this.website = false this.website = false
this.inputNew=true
}
if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {//&& formdata.value.firstCtrlthree != '4'
this.localup = true
this.inputword = true
this.inputNew=true
this.onlineedit = false
this.website = false
} }
if (formdata.value.firstCtrltwo == '1') { //如果是2D预案 if (formdata.value.firstCtrltwo == '1') { //如果是2D预案
this.localup = true this.localup = true
this.inputword = false this.inputword = false
this.onlineedit = true this.onlineedit = true
this.website = true this.website = true
this.inputNew=false
} }
if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') { if (formdata.value.firstCtrltwo == '2' || formdata.value.firstCtrltwo == '4') {
this.localup = true this.localup = true
this.inputword = false this.inputword = false
this.inputNew=false
this.onlineedit = false this.onlineedit = false
this.website = true this.website = true
this.pswShow = true this.pswShow = true
@ -904,7 +1025,7 @@ export class AddPlanone {
//文本预案在线编制跳转 //文本预案在线编制跳转
newleftTabledata newleftTabledata
planData planData
createWord() { createWord(haveNew) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -940,7 +1061,7 @@ export class AddPlanone {
let open = this.newleftTabledata.filter((value, index, array) => { let open = this.newleftTabledata.filter((value, index, array) => {
return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel
}) })
if (open.length > 0) { if(haveNew==true){
this.http.post('/api/PlanComponents', { this.http.post('/api/PlanComponents', {
id: "", id: "",
name: this.selectedPLanName, name: this.selectedPLanName,
@ -958,11 +1079,34 @@ export class AddPlanone {
this.planData = plandata this.planData = plandata
this.dialogRef.close(plandata); this.dialogRef.close(plandata);
//console.log(plandata) //console.log(plandata)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}`) window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`)
}) })
} else { }else{
this.snackBar.open('请先创建模板!', '确定', config); if (open.length > 0) {
this.http.post('/api/PlanComponents', {
id: "",
name: this.selectedPLanName,
planType: Number(this.selectedPLanType),
planMode: Number(this.defaultisshow),
planLevel: PlanLevel,
planCategory: Number(this.selectedPLanLevel),
url: "",
//attachmentUrls: [`${this.objectName}`]
}, {
params: {
companyId: this.data.companyId
}
}).subscribe(plandata => {
this.planData = plandata
this.dialogRef.close(plandata);
//console.log(plandata)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}&haveNew=${haveNew}`)
})
} else {
this.snackBar.open('请先创建模板!', '确定', config);
}
} }
}) })
@ -1019,7 +1163,10 @@ export class AddPlanone {
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
//this.snackBar.open('暂不支持导入','确定',config); //this.snackBar.open('暂不支持导入','确定',config);
this.createWord() this.createWord(false)
}
if(this.defaultisshow == '4'){
this.createWord(true)
} }
if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址 if (this.defaultisshow == '3' && (this.webaddress == "" || this.webaddress == null)) { //如果是填写网址
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
@ -1152,13 +1299,6 @@ export class AddPlanone {
} }
//下载文件弹出框 //下载文件弹出框
@Component({ @Component({
selector: 'downloadfile', selector: 'downloadfile',
@ -1328,4 +1468,46 @@ export class ImgDetails {
this.rotationAngle = this.rotationAngle + 90 this.rotationAngle = this.rotationAngle + 90
if (this.rotationAngle === 360) { this.rotationAngle = 0 } if (this.rotationAngle === 360) { this.rotationAngle = 0 }
} }
}
//修改三维预案地址
@Component({
selector: 'changename',
templateUrl: './changeurl.html',
styleUrls: ['./entry-plan-look.component.scss']
})
export class ChangeUrl{
constructor(private http: HttpClient, public dialogRef: MatDialogRef<ChangeUrl>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { }
planUrl: any//预案路径
updata//修改后的data
ngOnInit(): void {
this.planUrl = this.data.element.url
}
onNoClick(): void {
this.dialogRef.close();
}
onSubmit(value) {
let headers = new HttpHeaders({
'Content-Type': 'text/json'
});
let options = {
headers
};
let body = {
url: value.url,
auditStatus:8
}
this.http.put(`/api/PlanComponents/${this.data.element.id}`, body, options).subscribe(data => {
console.log(data)
this.updata=data
this.dialogRef.close("success");
sessionStorage.setItem("url", this.updata.url)
if ((this.updata.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${this.updata.url}?unitId=${this.updata.companyId}&unitName=${this.updata.name}&editMode=true`)
} else {
window.open(`/planManagement/webLook`)
}
})
}
} }

3
src/app/plan-management/plan-management.module.ts

@ -73,12 +73,13 @@ import { yinYong } from './create-plan-online-five/create-plan-online-five.compo
import { newTitle } 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 { disaster } from './create-plan-online-five/create-plan-online-five.component'
import { updataHl } from './create-plan-online-five/create-plan-online-five.component' import { updataHl } from './create-plan-online-five/create-plan-online-five.component'
import {ChangeUrl} from './entry-plan-look/entry-plan-look.component'
@NgModule({ @NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult, WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent,
OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl], OpenPlanToolDialog,yinYong,newTitle,disaster,updataHl,ChangeUrl],
imports: [ imports: [
CommonModule, CommonModule,
PlanManagementRoutingModule, PlanManagementRoutingModule,

11
src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.html

@ -31,9 +31,16 @@
<app-indexCondition *ngIf="selectedBtn=='tiaojian'"></app-indexCondition> <app-indexCondition *ngIf="selectedBtn=='tiaojian'"></app-indexCondition>
<div class="echartsbox" > <div class="echartsbox" >
<div id="pie"> <div id="pie">
</div> </div>
<div id="pieTwo"></div> <span style="position: relative;top: 3%;right: 15%;cursor: pointer;" >
<mat-icon >autorenew</mat-icon>
</span>
<div id="pieTwo">
</div>
<span style="position: relative;top: 3%;right: 15%;cursor: pointer;" >
<mat-icon >autorenew</mat-icon>
</span>
</div> </div>
</div> </div>

8
src/app/tabbar/tabbar.component.html

@ -214,15 +214,15 @@
</div> </div>
<div class="isUpdates" *ngIf="isUpdates"> <div class="isUpdates" *ngIf="isUpdates">
<span class="name" (click)="submitAudit()" <!-- <span class="name" (click)="submitAudit()"
*ngIf="!contentVerify || contentVerify.verifyState == 5 || contentVerify.verifyState == 4">提交审核</span> *ngIf="!contentVerify || contentVerify.verifyState == 5 || contentVerify.verifyState == 4">提交审核</span>
<span class="name" (click)="cancelAudit()" *ngIf="contentVerify && contentVerify.verifyState == 3">撤销审核</span> <span class="name" (click)="cancelAudit()" *ngIf="contentVerify && contentVerify.verifyState == 3">撤销审核</span> -->
<span class="span" *ngIf="contentVerify && contentVerify.verifyState == 3">( <!-- <span class="span" *ngIf="contentVerify && contentVerify.verifyState == 3">(
<span *ngIf="contentVerify.operation == 2" style="color: red;">删除</span> <span *ngIf="contentVerify.operation == 2" style="color: red;">删除</span>
<span *ngIf="contentVerify.operation == 0">新增</span> <span *ngIf="contentVerify.operation == 0">新增</span>
<span *ngIf="contentVerify.operation == 1">更新</span> <span *ngIf="contentVerify.operation == 1">更新</span>
待审核)</span> 待审核)</span> -->
<span [matTooltip]="contentVerify.remark" class="span" <span [matTooltip]="contentVerify.remark" class="span"
*ngIf="contentVerify && contentVerify.verifyState == 4">(审核通过)</span> *ngIf="contentVerify && contentVerify.verifyState == 4">(审核通过)</span>
<span [matTooltip]="contentVerify.remark" class="span" <span [matTooltip]="contentVerify.remark" class="span"

56
src/app/tabbar/tabbar.component.ts

@ -104,35 +104,43 @@ export class TabbarComponent implements OnInit {
} }
//提交单位审核 //提交单位审核
submitAudit(){ submitAudit(){
let body:any = { let isTrue = confirm('您确定要审核该条信息吗')
title : sessionStorage.getItem('companyName'), if(isTrue){
Operation : sessionStorage.getItem('contentVerify') ? 1 : 0, let body:any = {
itemId : sessionStorage.getItem('companyId'), title : sessionStorage.getItem('companyName'),
verifyState : 3, Operation : sessionStorage.getItem('contentVerify') ? 1 : 0,
contentType : 11 itemId : sessionStorage.getItem('companyId'),
verifyState : 3,
contentType : 11
}
this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
},err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
} }
this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{
this.contentVerify = data }
sessionStorage.setItem('contentVerify',JSON.stringify(data)) //撤销单位审核
},err=>{ cancelAudit(){
let isTrue = confirm('您确定要撤销审核该条信息吗')
if(isTrue){
this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data=>{
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
},
err=>{
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open(err,'确定',config); this.snackBar.open(err,'确定',config);
}) })
} }
//撤销单位审核
cancelAudit(){
this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data=>{
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
},
err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
} }
//初始化下载 //初始化下载
downloadFile () { downloadFile () {

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

@ -175,7 +175,7 @@
(click)='delattAndfileOne(item.groupName,element.surveyName,i)'><img (click)='delattAndfileOne(item.groupName,element.surveyName,i)'><img
src="../../../assets/images/deletehui.png"> 删除</button> src="../../../assets/images/deletehui.png"> 删除</button>
<button mat-raised-button color="primary" style="margin-right: 10px;" <button mat-raised-button color="primary" style="margin-right: 10px;"
(click)='fileAdd(attinf.facilityItems,i)'><img src="../../../assets/images/updatabai.png"> (click)='fileAdd(attinf.facilityItems,i,attinf.name)'><img src="../../../assets/images/updatabai.png">
编辑</button> 编辑</button>
<img src="../../../assets/images/downpaixu.png" alt="" style="height: 15px;margin-right: 8px;float: right;position: relative;top: 17px;" (click)='threeDown(zi,suri,i)'> <img src="../../../assets/images/downpaixu.png" alt="" style="height: 15px;margin-right: 8px;float: right;position: relative;top: 17px;" (click)='threeDown(zi,suri,i)'>
<img src="../../../assets/images/toppaixu.png" alt="" style="height: 15px;float: right;position: relative;top: 17px;" (click)='threeTop(zi,suri,i)'> <img src="../../../assets/images/toppaixu.png" alt="" style="height: 15px;float: right;position: relative;top: 17px;" (click)='threeTop(zi,suri,i)'>

1
src/app/ui/plan-template/plan-template.component.scss

@ -63,6 +63,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: auto;
.selectedTr { .selectedTr {
background-color: #e1f1ff; background-color: #e1f1ff;
span { span {

473
src/app/ui/plan-template/plan-template.component.ts

@ -29,10 +29,6 @@ export class PlanTemplateComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.getLeftdata() this.getLeftdata()
this.tree = {
json:this.treedate,
config: this.treeConfig
};
} }
groupPanle=true//分组展开 groupPanle=true//分组展开
attPanle=true attPanle=true
@ -41,23 +37,7 @@ export class PlanTemplateComponent implements OnInit {
/* {planCategory:3,basicCategoryId:"5e7c49e861550e2754d461ce",buildingTypeId: "5e7c8ffba3050b1a840ed4b6",unitname:'',data:[]}, /* {planCategory:3,basicCategoryId:"5e7c49e861550e2754d461ce",buildingTypeId: "5e7c8ffba3050b1a840ed4b6",unitname:'',data:[]},
{planCategory:5,basicCategoryId:"60127efe2757e904e5721d83",buildingTypeId: "5e7c9018a3050b1a840ed4b7",unitname:'地下建筑',data:[]} */ {planCategory:5,basicCategoryId:"60127efe2757e904e5721d83",buildingTypeId: "5e7c9018a3050b1a840ed4b7",unitname:'地下建筑',data:[]} */
] ]
//树形结构数据
treedate=[
{
"guid": "bc4c7a02-5379-4046-92be-12c67af4295a",
"displayName": "Elentrix",
"children": [
/* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2",
"28aac445-83b1-464d-9695-a4157dab6eac" */
]
}
]
tree
treeConfig = {
nodeWidth: 90,
nodeHeight: 60
};
group=[] group=[]
getLeftdata(){ getLeftdata(){
this.http.get("/api/PlanTemplate").subscribe((data:any)=>{ this.http.get("/api/PlanTemplate").subscribe((data:any)=>{
@ -234,11 +214,6 @@ export class PlanTemplateComponent implements OnInit {
if(this.unitName==undefined){ if(this.unitName==undefined){
this.snackBar.open('请选择预案模板!','确定',config); this.snackBar.open('请选择预案模板!','确定',config);
}else{ }else{
/* this.newleftTabledata.forEach((value,index,array)=>{
if(array[index].buildingTypeId==this.buildingTypeId){
this.group=array[index].data
}
}) */
const dialogRef = this.dialog.open(addGroup, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(addGroup, {//调用open方法打开对话框并且携带参数过去
width: '240px', width: '240px',
height:'620px', height:'620px',
@ -247,19 +222,6 @@ export class PlanTemplateComponent implements OnInit {
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
console.log(result,this.newleftTabledata) 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)=>{ this.newleftTabledata.forEach((value,index,array)=>{
if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){ if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){
if(result!=undefined){ if(result!=undefined){
@ -269,7 +231,12 @@ export class PlanTemplateComponent implements OnInit {
array[index].data=result array[index].data=result
} }
else{ else{
array[index].data[i].completed=rarr[i].completed array[index].data.forEach((group,gi,garr) => {
if(garr[gi].groupName==rarr[i].groupName){
garr[gi].completed=rarr[i].completed
}
});
//array[index].data[i].completed=rarr[i].completed
} }
}); });
@ -299,9 +266,13 @@ export class PlanTemplateComponent implements OnInit {
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
console.log(result) console.log(result)
if(result!=undefined){ if(result!=undefined){
this.newleftTabledata[this.leftclicki].data.push({groupName:result,completed: true,attribute:[],zdy:true}) if(this.newleftTabledata[this.leftclicki].data==null){
//this.newleftTabledata[this.leftclicki].data=[]
this.newleftTabledata[this.leftclicki].data=result.addgtoup
}
this.newleftTabledata[this.leftclicki].data.push({groupName:result.groupName,completed: true,attribute:[],zdy:true})
} }
this.group=this.newleftTabledata[this.leftclicki].data
}); });
} }
@ -344,7 +315,12 @@ export class PlanTemplateComponent implements OnInit {
if(array[index].attribute==null){ if(array[index].attribute==null){
array[index].attribute=result array[index].attribute=result
}else{ }else{
array[index].attribute[i].completed=rarr[i].completed array[index].attribute.forEach((att,atti,attary) => {
if(rarr[i].surveyName==attary[atti].surveyName){
attary[atti].completed=rarr[i].completed
}
});
//array[index].attribute[i].completed=rarr[i].completed
} }
}); });
@ -403,7 +379,10 @@ export class PlanTemplateComponent implements OnInit {
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
console.log(result) console.log(result)
if(result!=undefined){ if(result!=undefined){
this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result,zdy:true,attinf:[]}) if(this.newleftTabledata[this.leftclicki].data[0].attribute==null){
this.newleftTabledata[this.leftclicki].data[0].attribute=result.addwsurvey
}
this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result.groupName,zdy:true,attinf:[]})
} }
console.log(this.group) console.log(this.group)
}); });
@ -436,6 +415,7 @@ export class PlanTemplateComponent implements OnInit {
addAttInfo(surveyName,suri){ addAttInfo(surveyName,suri){
if(surveyName!='单位基本信息'&&surveyName!='建筑信息'&&surveyName!='四周毗邻'&&surveyName!='消防设施'&&surveyName!='重点部位'&&surveyName!='功能分区'){ if(surveyName!='单位基本信息'&&surveyName!='建筑信息'&&surveyName!='四周毗邻'&&surveyName!='消防设施'&&surveyName!='重点部位'&&surveyName!='功能分区'){
if(surveyName=='进攻通道'){ if(surveyName=='进攻通道'){
//进攻通道只有表格
if(this.group[0].attribute[suri].attinf==undefined){ if(this.group[0].attribute[suri].attinf==undefined){
this.group[0].attribute[suri].attinf=[] this.group[0].attribute[suri].attinf=[]
this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true}) this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true})
@ -530,13 +510,13 @@ export class PlanTemplateComponent implements OnInit {
console.log(this.newleftTabledata) console.log(this.newleftTabledata)
} }
//消防设施表格具体属性编辑 //消防设施表格具体属性编辑
fileAdd(facilityItems,filei){ fileAdd(facilityItems,filei,filename){
if(facilityItems.length!=0){ if(facilityItems.length!=0){
const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去
width: '240px', width: '240px',
height:'400px', height:'400px',
disableClose:true, disableClose:true,
data:{facilityItems:facilityItems} data:{facilityItems:facilityItems,filename,newleftTabledata:this.newleftTabledata,leftclicki:this.leftclicki}
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
console.log(result) console.log(result)
@ -550,7 +530,7 @@ export class PlanTemplateComponent implements OnInit {
}); });
} }
}) })
this.group=this.newleftTabledata[this,this.leftclicki].data this.group=this.newleftTabledata[this.leftclicki].data
} }
console.log(this.newleftTabledata) console.log(this.newleftTabledata)
}); });
@ -652,242 +632,6 @@ export class PlanTemplateComponent implements OnInit {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 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={ let body={
id:this.Id, id:this.Id,
@ -1108,7 +852,7 @@ export class PlanTemplateComponent implements OnInit {
} }
} }
////修改多行文本,表格行列数量 //修改多行文本,表格行列数量
updataHl(...num:number[]){ updataHl(...num:number[]){
const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去
width: '340px', width: '340px',
@ -1258,6 +1002,7 @@ export class addPlanname{
close(){ close(){
this.dialogRef.close(); this.dialogRef.close();
} }
//确定按钮
newplan(){ newplan(){
this.unitname=document.getElementById('unit').innerText this.unitname=document.getElementById('unit').innerText
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
@ -1404,17 +1149,7 @@ export class addGroup{
//复选框点击事件 //复选框点击事件
clicki clicki
checkClick(){ checkClick(){
//this.clicki=i
//console.log(e,item)
/* if (e.checked) {
this.groupName.push(item)
}else {
this.groupName.forEach((value,index,array)=>{
if(value==item){
this.groupName.splice(index,1)
}
})
} */
console.log(this.data) console.log(this.data)
} }
//确定提交 //确定提交
@ -1450,20 +1185,52 @@ export class zdyaddGroup{
//console.log(this.data) //console.log(this.data)
} }
groupName groupName
addgtoup=[
{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:false},
{groupName:'交通水源',completed:false},{groupName:'重点图示',completed:false},{groupName:'处置要点',completed:false},
{groupName:'预案附件',completed:false}
]
newGroups:boolean
//取消按钮 //取消按钮
close(){ close(){
this.dialogRef.close(); this.dialogRef.close();
} }
//判断是否是分组存在的数据
groupHave(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
try{
this.addgtoup.forEach(item=>{
if(item.groupName==this.groupName){
this.newGroups=false
this.snackBar.open('您输入的内容跟新增分组里面的内容重复,请点击新增分组寻找!','确定',config);
throw Error();
}else{
this.newGroups=true
}
})
}catch(e){
}
}
//确定提交 //确定提交
newGroup(){ newGroup(){
console.log(this.groupName) console.log(this.groupName)
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 5000
if(this.groupName==''||this.groupName==undefined){ if(this.groupName==''||this.groupName==undefined){
this.snackBar.open('请输入分组名称!','确定',config); this.snackBar.open('请输入分组名称!','确定',config);
}else{ }else{
this.dialogRef.close(this.groupName); if(this.newGroups==true){
this.dialogRef.close({groupName:this.groupName,addgtoup:this.addgtoup});
}
} }
} }
} }
@ -1478,17 +1245,17 @@ export class adddwsurvey{
addwsurvey=[ addwsurvey=[
{surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false}, {surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false},
{surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]}, {surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]},
{surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false}, {surveyName:'消防设施',completed:false},
{surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]}, {surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]},
{surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]} {surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]}
] ]//{surveyName:'进攻通道',completed:false},
ngOnInit(): void{ ngOnInit(): void{
console.log(this.data) console.log(this.data)
this.data=JSON.parse(JSON.stringify(this.data)) this.data=JSON.parse(JSON.stringify(this.data))
this.data.forEach(element => { this.data.forEach(element => {
if(element.groupName=='单位概况'&&element.attribute!=undefined){ if(element.groupName=='单位概况'&&element.attribute!=undefined){
this.addwsurvey=element.attribute //this.addwsurvey=element.attribute
/* element.attribute.forEach((datavalue,index,dataarr) => { element.attribute.forEach((datavalue,index,dataarr) => {
this.addwsurvey.forEach((value,i,arr)=>{ this.addwsurvey.forEach((value,i,arr)=>{
if(dataarr[index].surveyName==arr[i].surveyName){ if(dataarr[index].surveyName==arr[i].surveyName){
if(dataarr[index].completed==true&&arr[i].completed==false){ if(dataarr[index].completed==true&&arr[i].completed==false){
@ -1496,7 +1263,7 @@ ngOnInit(): void{
} }
} }
}) })
}); */ });
} }
}); });
console.log(this.addwsurvey) console.log(this.addwsurvey)
@ -1521,11 +1288,39 @@ export class zdyaddattinf{
ngOnInit(): void{ ngOnInit(): void{
//console.log(this.data) //console.log(this.data)
} }
newGroups:boolean
groupName groupName
addwsurvey=[
{surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false},
{surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]},
{surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false},
{surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]},
{surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]}
]
//取消按钮 //取消按钮
close(){ close(){
this.dialogRef.close(); this.dialogRef.close();
} }
//判断是否跟系统内置的名称重复
groupHave(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
try{
this.addwsurvey.forEach(item=>{
if(item.surveyName==this.groupName){
this.newGroups=false
this.snackBar.open('您输入的内容跟编辑里面的内容重复,请点击编辑寻找!','确定',config);
//跳出foreach循环
throw Error();
}else{
this.newGroups=true
}
})
}catch(e){
}
}
//确定提交 //确定提交
newGroup(){ newGroup(){
console.log(this.groupName) console.log(this.groupName)
@ -1535,7 +1330,10 @@ export class zdyaddattinf{
if(this.groupName==''||this.groupName==undefined){ if(this.groupName==''||this.groupName==undefined){
this.snackBar.open('请输入属性名称!','确定',config); this.snackBar.open('请输入属性名称!','确定',config);
}else{ }else{
this.dialogRef.close(this.groupName); if(this.newGroups){
this.dialogRef.close({groupName:this.groupName,addwsurvey:this.addwsurvey});
}
} }
} }
} }
@ -1608,12 +1406,13 @@ async getattinf(){
//console.log(this.addAttinfBuild) //console.log(this.addAttinfBuild)
}) })
}else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){ }else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){
this.buildnewDate=[] this.buildnewDate=[] //接受接口返回的新数据
this.addAttinfBuild=value.attinf this.addAttinfBuild=value.attinf //模板传过来的数据
this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild)) this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild))
let paramsdata:any ={ let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId
} }
/* 请求接口,做差异化对比 */
let restlt=await new Promise((resolve) => { let restlt=await new Promise((resolve) => {
this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
data.forEach((buildDate,buildi,buildarr) => { data.forEach((buildDate,buildi,buildarr) => {
@ -1627,6 +1426,7 @@ async getattinf(){
}) })
}) })
this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate)) this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate))
//差异化比较
let temp=0 let temp=0
this.buildnewDate.forEach((buildval,buindi,buildarr)=>{ this.buildnewDate.forEach((buildval,buindi,buildarr)=>{
temp=0 temp=0
@ -1636,6 +1436,7 @@ async getattinf(){
} }
}) })
if(temp==0){ if(temp==0){
//模板数据少于接口数据
console.log(buildval) console.log(buildval)
this.addAttinfBuild.push(buildval) this.addAttinfBuild.push(buildval)
} }
@ -1649,6 +1450,7 @@ async getattinf(){
}) })
if(temp==0){ if(temp==0){
console.log(addarr[addi]) console.log(addarr[addi])
//模板数据多了
this.addAttinfBuild.splice(addi,1) this.addAttinfBuild.splice(addi,1)
} }
}) })
@ -1683,7 +1485,7 @@ async getattinf(){
}); });
this.filenewDate.forEach(element => { this.filenewDate.forEach(element => {
element.completed=false element.completed=false
element.olddata=element.propertyValue //element.olddata=element.propertyValue
}); });
}) })
}) })
@ -1691,26 +1493,26 @@ async getattinf(){
let temp=0 let temp=0
this.filenewDate.forEach((buildval,buindi,buildarr)=>{ this.filenewDate.forEach((buildval,buindi,buildarr)=>{
temp=0 temp=0
this.filenewDate.forEach((addval,addi,addarr)=>{ this.addAttinfFile.forEach((addval,addi,addarr)=>{
if(buildval.propertyName==addval.propertyName){ if(buildval.name==addval.name){
temp++ temp++
} }
}) })
if(temp==0){ if(temp==0){
console.log(buildval) console.log(buildval)
this.filenewDate.push(buildval) this.addAttinfFile.push(buildval)
} }
}) })
this.filenewDate.forEach((addval,addi,addarr)=>{ this.addAttinfFile.forEach((addval,addi,addarr)=>{
temp=0 temp=0
this.filenewDate.forEach((buildval,buindi,buildarr)=>{ this.filenewDate.forEach((buildval,buindi,buildarr)=>{
if(buildarr[buindi].propertyName==addarr[addi].propertyName){ if(buildarr[buindi].name==addarr[addi].name){
temp++ temp++
} }
}) })
if(temp==0){ if(temp==0){
console.log(addarr[addi]) console.log(addarr[addi])
this.filenewDate.splice(addi,1) this.addAttinfFile.splice(addi,1)
} }
}) })
} }
@ -1718,11 +1520,52 @@ async getattinf(){
} }
}); });
}else{ }else{
//消防设施最里层数据
let apifile
this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems)) this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems))
console.log(this.facilityItems) console.log(this.facilityItems)
/* this.facilityItems.forEach(element => { //请求接口,看数据是否有变化
element.completed=false let paramsdata:any ={
}); */ categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId
}
let fileResult=await new Promise((resolve) => {
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{
resolve(data)
})
})
apifile=fileResult
let apifileData//消防设施最内层数据
apifile.forEach(element => {
if(element.name==this.data.filename){
apifileData=element.facilityItems
}
});
console.log(apifileData)
let temp=0
apifileData.forEach((buildval,buindi,buildarr)=>{
temp=0
this.facilityItems.forEach((addval,addi,addarr)=>{
if(buildval.name==addval.name){
temp++
}
})
if(temp==0){
console.log(buildval)
this.facilityItems.push(buildval)
}
})
this.facilityItems.forEach((addval,addi,addarr)=>{
temp=0
apifileData.forEach((buildval,buindi,buildarr)=>{
if(buildarr[buindi].name==addarr[addi].name){
temp++
}
})
if(temp==0){
console.log(addarr[addi])
this.facilityItems.splice(addi,1)
}
})
} }
} }

2
src/app/ui/plan-template/zdyaddgroup.html

@ -6,7 +6,7 @@
<div class="group" > <div class="group" >
<label style="margin-right: 10px;">自定义名称:</label> <label style="margin-right: 10px;">自定义名称:</label>
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<input matInput placeholder="请输入自定义名称" autocomplete="off" [(ngModel)]="groupName" required> <input matInput placeholder="请输入自定义名称" (keyup)='groupHave()' autocomplete="off" [(ngModel)]="groupName" required>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>

Loading…
Cancel
Save