Browse Source

[完善]修复消防设施输入框保存问题

tangshan
邵佳豪 4 years ago
parent
commit
b3e28a0e7a
  1. 2
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  2. 42
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 3
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  4. 87
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  5. 15
      src/app/plan-management/create-plan-online-five/openPlanTool.html
  6. 5
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  7. 4
      src/app/ui/collection-tools/collection-tools.component.ts
  8. BIN
      src/assets/images/2Dplan.png

2
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts

@ -520,7 +520,7 @@ export class FireFightingDeviceComponent implements OnInit {
}else if(item.name == '其它设施'){
putBody = returnBody(this.otherFacilities,'其它设施')
}else if(item.name == '自动消防设施'){
putBody = returnBody(this.otherFacilities,'自动消防设施')
putBody = returnBody(this.automaticFireProtectionFacility,'自动消防设施')
}
if(putBody.length != 0){
this.http.put('/api/BuildingFacilities/FacilityStatUpdate',putBody,{

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

@ -1,11 +1,11 @@
<div class="bigbox">
<div class="titlebox">
<div class="titleitembox">
<div class="item" [ngClass]="{'selectedItem': selectedItem == '封面'}" (click)="clickTitleItem('封面')">
<div title="封面" class="item" [ngClass]="{'selectedItem': selectedItem == '封面'}" (click)="clickTitleItem('封面')">
1.封面
</div>
<div class="item" *ngFor="let item of planTemplateData;let key = index" (click)="clickTitleItem(item)"
[ngClass]="{'selectedItem': selectedItem == item.groupName}">
[ngClass]="{'selectedItem': selectedItem == item.groupName}" [title]="item.groupName">
{{key + 2}}.{{item.groupName}}
</div>
</div>
@ -38,7 +38,7 @@
<div class="content">
<div class="contentitem" *ngFor="let item of sitePlanItems">
<div>
<img (click)="openPlan(item,-1)"
<img (click)="openPlan(item,-1,'平面图')"
[src]="item.imageUrl && item.imageUrl != 'null' ? item.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '/assets/images/2D.jpg'"
alt="">
</div>
@ -63,7 +63,7 @@
<div class="content">
<div class="contentitem" *ngFor="let i of item.plandata">
<div>
<img (click)="openPlan(i,key)"
<img (click)="openPlan(i,key,'平面图')"
[src]="i.imageUrl ? i.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '../../../assets/images/noImg.png'"
alt="">
</div>
@ -141,6 +141,35 @@
</div>
</div>
</div>
<div *ngIf="selectedItem == '预案附件'" class="leftKeyImg">
<div class="keyImgTitle">
预案附件
</div>
<div class="planlist" id="planlist">
<div style="margin: 10px 0;">
<mat-accordion>
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='33px' expandedHeight='33px'
style="position: relative;padding-left:20px;background: #F2F9FF;">
<mat-panel-title>
二维预案列表
</mat-panel-title>
</mat-expansion-panel-header>
<div class="content">
<div class="contentitem" *ngFor="let TwoDPlan of TwoDPlanList">
<div>
<img (click)="openPlan(TwoDPlan,-1,'预案')"
src='/assets/images/2Dplan.png'
alt="">
</div>
<p>{{TwoDPlan.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
<div class="leftBuilding" *ngIf="selectedItem == '单位概况'">
<div class="buildingHead" >
<span>建筑列表</span>
@ -256,9 +285,8 @@
<!-- 模板页面 -->
<div *ngFor="let item of planTemplateData;let key = index">
<div *ngIf="selectedItem == item.groupName">
<div class="centerBox"
*ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'">
*ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='特别警示'&&item.groupName!='处置要点'">
<div class="boxHead">
<span>{{item.groupName}}</span>
</div>
@ -313,7 +341,7 @@
</div>
</div>
</div>
<div class="keyImg" *ngIf="item.groupName == '重点图示' || item.groupName == '交通水源'">
<div class="keyImg" *ngIf="item.groupName == '重点图示' || item.groupName == '交通水源' || item.groupName == '预案附件'">
<div class="keyImgItem" *ngFor="let i of item.attribute;let key = index">
<div class="keyImgTitle">
<input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">

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

@ -42,6 +42,9 @@
box-sizing: border-box;
padding: 0 10px;
font-size: 14px;
overflow: hidden; /*超出部分隐藏*/
white-space: nowrap; /*不换行*/
text-overflow: ellipsis; /*超出部分文字以...显示*/
}
.item:hover {
background: #e8f4fe;

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

@ -78,11 +78,32 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.getAllBuildings()
this.getSitePlan()
this.getRealPicture()
}else if(this.selectedItem == '单位概况'){
} else if (this.selectedItem == '单位概况') {
//this.getAllBuildings()
} else if (this.selectedItem == '预案附件') {
this.getTwoDPlanList()
}
}
//获取当前单位的二维预案
TwoDPlanList: any
getTwoDPlanList() {
let paramsData = {
companyId: this.route.snapshot.queryParams.companyId,
pageSize: "999"
}
this.http.get("/api/PlanComponents", { params: paramsData }).subscribe((data: any) => {
this.TwoDPlanList = data.items.filter((item) => {
return item.planType == 1
})
console.log(this.TwoDPlanList)
})
}
//获取实景图
allRealPicture
getRealPicture() {
@ -125,10 +146,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planTemplateData: any
//获得模板信息
getTemplateData() {
this.http.get('/api/PlanTemplate').subscribe(data => {
this.planTemplateData = JSON.parse(data[2].data).filter(item =>
item.completed == true
)
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe(data => {
console.log('预案内容',data)
// this.planTemplateData = JSON.parse(data.webdata).filter(item =>
// item.completed == true
// )
console.log(this.planTemplateData)
this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') {
@ -141,6 +163,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
element.attribute = [{ name: '', imgArr: [] }]
}
}
if (element.groupName == '预案附件') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
if (element.groupName == '处置要点') {
if (!element.attribute) {
element.attribute = [{ name: '', content: '' }]
@ -153,6 +180,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
});
})
}
@ -166,7 +194,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
//通过左侧查看实景图
gallery
lookkeyImgItemLeft(key1, key2,i) {
lookkeyImgItemLeft(key1, key2, i) {
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
@ -243,12 +271,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
})
this.allBuildings = data
this.planTemplateData[0].building=[]
for(var i=0;i<this.allBuildings.length;i++){
this.planTemplateData[0].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[0].attribute})
this.planTemplateData[0].building = []
for (var i = 0; i < this.allBuildings.length; i++) {
this.planTemplateData[0].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[0].attribute })
}
this.buildingName=this.allBuildings[0].name
this.group=this.planTemplateData[0].building[this.clicki].body
this.buildingName = this.allBuildings[0].name
this.group = this.planTemplateData[0].building[this.clicki].body
console.log(this.planTemplateData)
})
}
@ -261,11 +289,20 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
}
//打开采集工具
openPlan(item, index,type?:string) {
openPlan(item, index, type?: string) {
sessionStorage.setItem("gisplan", 'look')
sessionStorage.setItem("companyId", this.unitId)
// console.log(item)
let data = { select: item, key: index, allBuildings: this.allBuildings,type: type}
console.log(item)
if(type == '预案'){
sessionStorage.setItem("planId", item.id)
sessionStorage.setItem("companyId", this.route.snapshot.queryParams.companyId)
sessionStorage.setItem("buildingTypeId",this.route.snapshot.queryParams.unitTypeId)
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName", item.name)
sessionStorage.setItem("orName", item.name)
sessionStorage.setItem("orId", item.name)
}
let data = { select: item, key: index, allBuildings: this.allBuildings, type: type }
let width = Math.round(document.body.clientWidth * 0.8) + 'px'
let height = Math.round(document.body.clientHeight * 0.9) + 'px'
// console.log('宽度',width)
@ -329,18 +366,18 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
//单位概况左侧建筑点击事件
buildingName
clicki=0
clicki = 0
group
clickBuilding(item,i){
this.buildingName=item.name
this.clicki=i
this.group=this.planTemplateData[0].building[this.clicki].body
clickBuilding(item, i) {
this.buildingName = item.name
this.clicki = i
this.group = this.planTemplateData[0].building[this.clicki].body
//console.log(this.group)
}
//单位概况增加一行
unitadd(surveyName,attacki){
unitadd(surveyName, attacki) {
this.addNumber++
if(surveyName=='进攻通道'){
if (surveyName == '进攻通道') {
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr == undefined) {
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr = []
}
@ -358,11 +395,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
}
//单位概况删除一行
unitDel(surveyName,attacki){
unitDel(surveyName, attacki) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(surveyName=='进攻通道'){
if (surveyName == '进攻通道') {
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr != undefined) {
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.splice(this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length - 1, 1)
this.addNumber--
@ -434,13 +471,13 @@ export class OpenPlanToolDialog {
@ViewChild('plan') plan: any //子组件
type:any//打开的类型 是平面图还是水源
type: any//打开的类型 是平面图还是水源
ngOnInit() {
this.type = this.data.type
}
ngAfterViewInit(): void {
if(this.type != '水源'){
if (this.type != '水源' && this.type != '预案') {
this.noticePlan()
}
}

15
src/app/plan-management/create-plan-online-five/openPlanTool.html

@ -1,10 +1,9 @@
<ng-container *ngIf="type == '水源'; else elseTemplate">
<div class="divbox">
<div class="divbox" *ngIf="type == '水源'">
<app-water-road></app-water-road>
</div>
</ng-container>
<ng-template #elseTemplate>
<div class="divbox">
</div>
<div class="divbox" *ngIf="type == '平面图'">
<app-collection-tools-plan #plan></app-collection-tools-plan>
</div>
</ng-template>
</div>
<div class="divbox" *ngIf="type == '预案'">
<app-collection-tools></app-collection-tools>
</div>

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

@ -94,7 +94,7 @@ export class EntryPlanLookComponent implements OnInit {
ngOnInit(): void {
this.tabledataSource = [
]
// this.getCompanyData()
this.getCompanyData()
this.isoperation = this.route.snapshot.queryParams.operation
this.unitdata.unitname = this.route.snapshot.queryParams.unitName
this.unitdata.organizationName = this.route.snapshot.queryParams.orName
@ -207,7 +207,8 @@ export class EntryPlanLookComponent implements OnInit {
}
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}`)
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 = {};

4
src/app/ui/collection-tools/collection-tools.component.ts

@ -662,8 +662,8 @@ export class CollectionToolsComponent implements OnInit {
}//多个素材共同属性
multipleAssetData: any//当前多选的素材
firstMultipleAssetData: any//当前多选的第一个素材
organizationName: any = this.route.snapshot.queryParams.orName//当前预案单位所属机构名称
organizationId: any = this.route.snapshot.queryParams.orId//当前预案单位所属机构名称
organizationName: any = this.route.snapshot.queryParams.orName || sessionStorage.getItem('orName')//当前预案单位所属机构名称
organizationId: any = this.route.snapshot.queryParams.orId || sessionStorage.getItem('orId')//当前预案单位所属机构名称
ngOnInit(): void {
this.canvasData.isInheritSky = { weather: '', airTemperature: '', windDirection: '', windScale: '', }; //缓存 节点 天气
AxMessageSystem.addListener('selectionChanged', () => {

BIN
src/assets/images/2Dplan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Loading…
Cancel
Save