72 changed files with 6222 additions and 57 deletions
@ -1,6 +1,6 @@ |
|||||||
{ |
{ |
||||||
"/api": { |
"/api": { |
||||||
"target": "http://121.37.20.190:8000", |
"target": "http://39.106.78.171:8000", |
||||||
"secure": false, |
"secure": false, |
||||||
"changeOrigin": true |
"changeOrigin": true |
||||||
} |
} |
||||||
|
@ -0,0 +1,3 @@ |
|||||||
|
<div class="content"> |
||||||
|
实战演练记录 |
||||||
|
</div> |
@ -0,0 +1,7 @@ |
|||||||
|
.content { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 1px; |
||||||
|
overflow: hidden; |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { ActualCombatDrillComponent } from './actual-combat-drill.component'; |
||||||
|
|
||||||
|
describe('ActualCombatDrillComponent', () => { |
||||||
|
let component: ActualCombatDrillComponent; |
||||||
|
let fixture: ComponentFixture<ActualCombatDrillComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ ActualCombatDrillComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(ActualCombatDrillComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,15 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-actual-combat-drill', |
||||||
|
templateUrl: './actual-combat-drill.component.html', |
||||||
|
styleUrls: ['./actual-combat-drill.component.scss'] |
||||||
|
}) |
||||||
|
export class ActualCombatDrillComponent implements OnInit { |
||||||
|
|
||||||
|
constructor() { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
<div class="content"> |
||||||
|
|
||||||
|
<div class="addBox" *ngIf="isLook == 'edit'"> |
||||||
|
<div><button (click)='add()'>新增</button></div> |
||||||
|
<div><button style="background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%);" (click)='keep()'>保存</button></div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="center"> |
||||||
|
<div class="fatherDiv"> |
||||||
|
|
||||||
|
<div class="matterDiv" *ngFor="let item of imagesData;let key = index"> |
||||||
|
<div class="leftDiv"> |
||||||
|
<div>问题{{item.index}}:</div> |
||||||
|
<div *ngIf="isLook == 'edit'"><button (click)='delete(key)'>删除</button></div> |
||||||
|
</div> |
||||||
|
<div class="rightDiv"> |
||||||
|
<div style="height: 45%;"> |
||||||
|
<textarea maxlength="500" [(ngModel)]="item.matter" name="matter" [readonly]="isLook == 'look'"></textarea> |
||||||
|
</div> |
||||||
|
<div style="height: 55%;" class="imagesBox"> |
||||||
|
|
||||||
|
<div class="everyImg" *ngIf="isLook == 'edit'"> |
||||||
|
<a href="javascript:;" class="a-upload"> |
||||||
|
<input type="file" (change)='selectFile($event,item)'>+ |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
<div class="everyImg" *ngFor="let items of item.imgURL;let keys = index" id="viewerjs{{key}}{{keys}}"> |
||||||
|
<img [src]='items' [attr.data-original]="items.split('?')[0]"> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div *ngIf="!imagesData.length" class="noData">暂无数据</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
@ -0,0 +1,134 @@ |
|||||||
|
.content { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
background: #F4F5F9; |
||||||
|
padding: 5px; |
||||||
|
overflow: hidden; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
.center { |
||||||
|
flex: 1; |
||||||
|
overflow: hidden; |
||||||
|
.fatherDiv { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
overflow-x: hidden; |
||||||
|
overflow-y: auto; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 10px |
||||||
|
} |
||||||
|
} |
||||||
|
.addBox { |
||||||
|
margin-top: 15px; |
||||||
|
>div { |
||||||
|
display: inline-block; |
||||||
|
width: 50%; |
||||||
|
} |
||||||
|
button { |
||||||
|
width: 15%; |
||||||
|
height: 36px; |
||||||
|
line-height: 36px; |
||||||
|
color: #fff; |
||||||
|
background: #4582FC; |
||||||
|
border-radius: 30px; |
||||||
|
outline: none; |
||||||
|
border: none; |
||||||
|
display: block; |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.noData { |
||||||
|
width: 100%; |
||||||
|
text-align: center; |
||||||
|
font-size: 16px; |
||||||
|
margin-top: 30px; |
||||||
|
} |
||||||
|
//问题div |
||||||
|
.matterDiv { |
||||||
|
width: 100%; |
||||||
|
height: 180px; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 5px; |
||||||
|
margin-top: 10px; |
||||||
|
background-color: #fff; |
||||||
|
border-radius: 20px; |
||||||
|
display: flex; |
||||||
|
.leftDiv { |
||||||
|
width: 70px; |
||||||
|
text-align: center; |
||||||
|
height: 100%; |
||||||
|
margin-right: 5px; |
||||||
|
>div {font-size: 16px;} |
||||||
|
button { |
||||||
|
height: 22px; |
||||||
|
background-color:#fff; |
||||||
|
border-radius: 10px; |
||||||
|
border: 1px solid red; |
||||||
|
color: red; |
||||||
|
font-size: 12px; |
||||||
|
} |
||||||
|
} |
||||||
|
.rightDiv { |
||||||
|
flex: 1; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
textarea { |
||||||
|
vertical-align: middle; |
||||||
|
border-radius: 10px; |
||||||
|
background-color: #F4F5F9; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 5px; |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
resize: none; |
||||||
|
border: none; |
||||||
|
outline: none; |
||||||
|
} |
||||||
|
.imagesBox::-webkit-scrollbar {display:none} |
||||||
|
.imagesBox { |
||||||
|
overflow-x: auto; |
||||||
|
overflow-y: hidden; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 5px; |
||||||
|
.everyImg { |
||||||
|
width: 100px; |
||||||
|
min-width: 100px; |
||||||
|
max-width: 100px; |
||||||
|
max-height: 90px; |
||||||
|
height: 100%; |
||||||
|
border: 1px dashed #c5c7cc; |
||||||
|
margin-right: 10px; |
||||||
|
//上传CAD弹窗 inputfile |
||||||
|
.a-upload { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
position: relative; |
||||||
|
cursor: pointer; |
||||||
|
color: #888; |
||||||
|
text-align: center; |
||||||
|
font-size: 70px; |
||||||
|
overflow: hidden; |
||||||
|
display: inline-block; |
||||||
|
} |
||||||
|
.a-upload input { |
||||||
|
position: absolute; |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
right: 0; |
||||||
|
top: 0; |
||||||
|
opacity: 0; |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { FindProblemComponent } from './find-problem.component'; |
||||||
|
|
||||||
|
describe('FindProblemComponent', () => { |
||||||
|
let component: FindProblemComponent; |
||||||
|
let fixture: ComponentFixture<FindProblemComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ FindProblemComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(FindProblemComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,103 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import { HttpClient,HttpHeaders, HttpEventType } from '@angular/common/http'; |
||||||
|
import { MatSnackBar ,MatSnackBarConfig} from '@angular/material/snack-bar'; |
||||||
|
import Viewer from 'viewerjs'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-find-problem', |
||||||
|
templateUrl: './find-problem.component.html', |
||||||
|
styleUrls: ['./find-problem.component.scss'] |
||||||
|
}) |
||||||
|
export class FindProblemComponent implements OnInit { |
||||||
|
|
||||||
|
constructor(public snackBar: MatSnackBar,private http: HttpClient) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.imagesData = JSON.parse ( JSON.parse(JSON.stringify(localStorage.getItem('matterData'))) || '[]' ) |
||||||
|
this.isLook = sessionStorage.getItem('six') |
||||||
|
window.setTimeout(()=>{ |
||||||
|
this.updateIMG() |
||||||
|
},0) |
||||||
|
} |
||||||
|
|
||||||
|
isLook:string//查看模式
|
||||||
|
imagesData = [] |
||||||
|
templateData = {index: 1, matter: '', imgURL:[]} //模板数据
|
||||||
|
|
||||||
|
//刷新图片 大图
|
||||||
|
updateIMG () { |
||||||
|
this.imagesData.forEach((item,index)=>{ |
||||||
|
item.imgURL.forEach((element,indexs) => { |
||||||
|
new Viewer(document.getElementById(`viewerjs${index}${indexs}`),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
}); |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
//获取问题个数
|
||||||
|
matterIndex () { |
||||||
|
let index |
||||||
|
if (this.imagesData.length) { |
||||||
|
index = this.imagesData[this.imagesData.length-1].index+1 |
||||||
|
return index |
||||||
|
} else { |
||||||
|
return 1 |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//上传文件
|
||||||
|
selectFile (e,item) { |
||||||
|
let file = e.target.files[0] || null //获取上传的文件
|
||||||
|
let fileSize = file.size || null //上传文件的总大小
|
||||||
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
||||||
|
|
||||||
|
if (file && fileSize<=shardSize) { //上传文件<=5MB时
|
||||||
|
let formData = new FormData() |
||||||
|
formData.append("file",file) |
||||||
|
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{ |
||||||
|
item.imgURL.push(`/api/Objects/PlanPlatform/${data.objectName}?x-oss-process=image/resize,m_fill,h_90,w_100`) |
||||||
|
window.setTimeout(()=>{ |
||||||
|
this.updateIMG() |
||||||
|
},0) |
||||||
|
}) |
||||||
|
} else { |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('请上传小于5M图片','确定',config); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//新增
|
||||||
|
add () { |
||||||
|
let data = JSON.parse(JSON.stringify( this.templateData )); |
||||||
|
data.index = this.matterIndex() |
||||||
|
this.imagesData.push(data) |
||||||
|
} |
||||||
|
|
||||||
|
//删除
|
||||||
|
delete (index) { |
||||||
|
let isTrue = confirm('您确定要删除吗?') |
||||||
|
if (isTrue) { |
||||||
|
this.imagesData.splice(index,1) |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('删除成功','确定',config); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//保存
|
||||||
|
keep () { |
||||||
|
let data = JSON.stringify ( JSON.parse(JSON.stringify( this.imagesData )) ) |
||||||
|
localStorage.setItem('matterData',data) |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
<!-- |
||||||
|
* @Descripttion: |
||||||
|
* @version: |
||||||
|
* @Author: sueRimn |
||||||
|
* @Date: 2020-11-05 15:27:58 |
||||||
|
* @LastEditors: sueRimn |
||||||
|
* @LastEditTime: 2020-11-07 13:08:20 |
||||||
|
--> |
||||||
|
<div class="box"> |
||||||
|
<div class="addbw"> |
||||||
|
<span style="margin-left: 8%;">添加熟悉部位:</span> |
||||||
|
<button style="font-size: 16px;" *ngFor="let item of knowBw; let key=index" (click)="addRoute($event,item)">{{item.name}}</button> |
||||||
|
<button class="button" (click)="savaClick()" *ngIf="pattern == 'edit'">保存</button> |
||||||
|
</div> |
||||||
|
<div class="addRoute"> |
||||||
|
<span style="margin-left: 8%;">添加路线:</span> |
||||||
|
<input onfocus=this.blur() type="text" > |
||||||
|
<div class="xxx"> |
||||||
|
<span class="floot" [ngClass]="{'beijicolor': chooseid ==key}" (click)="knowroutwClick(key,item)" *ngFor="let item of uploadSucced; let key=index">{{item.name}}-></span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="bottomAll" *ngIf="showorfalse == 'show'"> |
||||||
|
<div class="upload"> |
||||||
|
<div class="uploadingimg" id="viewerjs"> |
||||||
|
<img [src]="imgsrc" [attr.data-original]="imgsrc.split('?')[0]" alt=""> |
||||||
|
</div> |
||||||
|
<div class="image" *ngIf="inputShow && pattern == 'edit'"> |
||||||
|
<input id="selectedfile" (change)="filechange($event)" type="file" name="imgFile"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="remarks"> |
||||||
|
<div style="font-size: 16px;">备注:</div> |
||||||
|
<textarea [disabled]="pattern == 'look'" name="" id="" cols="50" rows="10" [(ngModel)]="uploadSucced[chooseid].smark"></textarea> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,114 @@ |
|||||||
|
.box{ |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
//添加熟悉部位 |
||||||
|
.addbw{ |
||||||
|
height: 100px; |
||||||
|
line-height: 100px; |
||||||
|
width: 100%; |
||||||
|
font-size: 18px; |
||||||
|
button{ |
||||||
|
margin-left:8px; |
||||||
|
} |
||||||
|
.button { |
||||||
|
background-color: #4CAF50; /* Green */ |
||||||
|
border: 1px; |
||||||
|
color: white; |
||||||
|
padding:3px; |
||||||
|
text-align: center; |
||||||
|
text-decoration: none; |
||||||
|
display: inline-block; |
||||||
|
font-size:18px; |
||||||
|
margin-left: 30px; |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
//添加路线 |
||||||
|
.addRoute{ |
||||||
|
height:100px; |
||||||
|
line-height: 100px; |
||||||
|
position:relative; |
||||||
|
white-space: nowrap; |
||||||
|
input{ |
||||||
|
width:60%; |
||||||
|
margin-left: 8px; |
||||||
|
border-top: none; |
||||||
|
border-left: none; |
||||||
|
border-right: none; |
||||||
|
font-size: 0.15625rem; |
||||||
|
outline: none; |
||||||
|
background-color: transparent; |
||||||
|
} |
||||||
|
hr{ |
||||||
|
width: 5.859375rem; |
||||||
|
margin-left: 0.78125rem |
||||||
|
|
||||||
|
} |
||||||
|
.xxx{ |
||||||
|
display: inline-block; |
||||||
|
position: absolute; |
||||||
|
left: 15%; |
||||||
|
bottom: 5px; |
||||||
|
} |
||||||
|
.floot{ |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
span{ |
||||||
|
font-size:18px; |
||||||
|
} |
||||||
|
//底部div |
||||||
|
.bottomAll{ |
||||||
|
width: 100%; |
||||||
|
height: 230px; |
||||||
|
margin-top: 0.488281rem; |
||||||
|
display: flex; |
||||||
|
.upload{ |
||||||
|
position: relative; |
||||||
|
flex: 1; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
.uploadingimg{ |
||||||
|
width: 45%; |
||||||
|
height: 75%; |
||||||
|
top: 0.058594rem; |
||||||
|
position: absolute; |
||||||
|
left: 15%; |
||||||
|
border-radius:3px; |
||||||
|
img{ |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
.image{ |
||||||
|
width: 45%; |
||||||
|
height: 75%; |
||||||
|
left: 15%; |
||||||
|
top: 0.058594rem; |
||||||
|
position: absolute; |
||||||
|
border-radius:3px; |
||||||
|
input{ |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
opacity: 0; |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.remarks{ |
||||||
|
flex: 1; |
||||||
|
input{ |
||||||
|
width: 30%; |
||||||
|
height: 30%; |
||||||
|
} |
||||||
|
textarea{ |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
//熟悉路线选中样式 |
||||||
|
.beijicolor{ |
||||||
|
border: 1px solid #000000; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { KnowRouteComponent } from './know-route.component'; |
||||||
|
|
||||||
|
describe('KnowRouteComponent', () => { |
||||||
|
let component: KnowRouteComponent; |
||||||
|
let fixture: ComponentFixture<KnowRouteComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ KnowRouteComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(KnowRouteComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,157 @@ |
|||||||
|
/* |
||||||
|
* @Descripttion:
|
||||||
|
* @version:
|
||||||
|
* @Author: sueRimn |
||||||
|
* @Date: 2020-11-05 15:27:58 |
||||||
|
* @LastEditors: sueRimn |
||||||
|
* @LastEditTime: 2020-11-07 20:00:19 |
||||||
|
*/ |
||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import { HttpClient,HttpHeaders, HttpEventType } from '@angular/common/http'; |
||||||
|
import { MatSnackBar ,MatSnackBarConfig} from '@angular/material/snack-bar'; |
||||||
|
import { FileUploader, FileItem } from 'ng2-file-upload' |
||||||
|
import Viewer from 'viewerjs'; |
||||||
|
@Component({ |
||||||
|
selector: 'app-know-route', |
||||||
|
templateUrl: './know-route.component.html', |
||||||
|
styleUrls: ['./know-route.component.scss'] |
||||||
|
}) |
||||||
|
export class KnowRouteComponent implements OnInit { |
||||||
|
|
||||||
|
constructor(public snackBar: MatSnackBar,private http: HttpClient) { } |
||||||
|
|
||||||
|
|
||||||
|
pattern:any = sessionStorage.getItem("six")//模式
|
||||||
|
ngOnInit(): void { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//input框显隐
|
||||||
|
inputShow=true |
||||||
|
//控制底部div显隐
|
||||||
|
showorfalse="www" |
||||||
|
//判断选中路线的值
|
||||||
|
chooseid:any |
||||||
|
//熟悉路线对象
|
||||||
|
knowRoute=[{name:``,idnum:""}] |
||||||
|
//熟悉部位对象
|
||||||
|
knowBw=[{name:"消控室"},{name:"水泵房"},{name:"疏散楼梯"},{name:"各楼层"},{name:"楼层消火栓"},{name:"水泵结合器"},{name:"室外消防水源"}] |
||||||
|
textareazhi:"" |
||||||
|
//没有上传图片时显示的图片,当上传后就会被替换,即保存时需要传的图片地址参数
|
||||||
|
imgsrc = "../../../assets/images/upload.jpg" |
||||||
|
imgUrl = ""//返回来的图片地址后缀
|
||||||
|
file: any; //上传的文件
|
||||||
|
objectName: any; //上传对象名
|
||||||
|
uploadId: any; //上传分块上传事件编号
|
||||||
|
isspinner:boolean=false //控制进度圈的显示隐藏
|
||||||
|
PartNumberETag: any = []; //分块上传每次返回需要保存的信息
|
||||||
|
//change选择文件
|
||||||
|
filechange(e) { |
||||||
|
this.file = e.target.files[0] || null //上传的文件
|
||||||
|
var reader = new FileReader(); |
||||||
|
reader.readAsDataURL(this.file); |
||||||
|
var image:any = new Image(); |
||||||
|
reader.onload = function(){ |
||||||
|
image.src = reader.result |
||||||
|
} |
||||||
|
setTimeout(() => { |
||||||
|
if(image.width>=4096 || image.height>=5000 ){
|
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config); |
||||||
|
}else{ |
||||||
|
if(this.file){ |
||||||
|
this.startUploading() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
}, 500); |
||||||
|
}
|
||||||
|
//上传文件
|
||||||
|
startUploading() { |
||||||
|
this.isspinner = true |
||||||
|
let file = this.file || null //获取上传的文件
|
||||||
|
let fileSize = file.size || null //上传文件的总大小
|
||||||
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
||||||
|
|
||||||
|
if (file && fileSize <= shardSize) { //上传文件<=5MB时
|
||||||
|
// this.upload()
|
||||||
|
let formData = new FormData() |
||||||
|
formData.append("file",file) |
||||||
|
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{ |
||||||
|
this.isspinner = false |
||||||
|
this.imgUrl = data.objectName |
||||||
|
this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` |
||||||
|
console.log(this.imgsrc) |
||||||
|
this.uploadSucced[this.chooseid].src=this.imgsrc |
||||||
|
this.inputShow=false |
||||||
|
|
||||||
|
console.log(this.uploadSucced) |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('上传成功','确定',config); |
||||||
|
}) |
||||||
|
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
|
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//熟悉部位点击事件
|
||||||
|
addRoute(event,item){ |
||||||
|
if(this.pattern == 'edit'){ |
||||||
|
|
||||||
|
this.knowRoute.push({name:event.target.innerHTML,idnum:"🠖"}) |
||||||
|
this.uploadSucced.push({name:item.name,src:"",smark:""}) |
||||||
|
}else{ |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('处于查看模式','确定',config); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
savekey |
||||||
|
uploadSucced:any = JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx")) || []//上传成功暂存对象
|
||||||
|
gallery |
||||||
|
//熟悉路线点击事件
|
||||||
|
knowroutwClick(key,item){ |
||||||
|
this.showorfalse = "show" |
||||||
|
this.chooseid=key |
||||||
|
setTimeout(() => { |
||||||
|
if(document.getElementById('viewerjs')){ |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
} |
||||||
|
}, 0); |
||||||
|
if( JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx")) |
||||||
|
&& JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key]
|
||||||
|
&& JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].src!=""){ |
||||||
|
this.imgsrc=JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].src |
||||||
|
this.textareazhi=JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].smark |
||||||
|
this.inputShow=false |
||||||
|
}else if(this.uploadSucced[key].src!=""){ |
||||||
|
this.imgsrc=this.uploadSucced[key].src |
||||||
|
this.inputShow=false |
||||||
|
}else{ |
||||||
|
this.imgsrc="../../../assets/images/upload.jpg" |
||||||
|
this.textareazhi="" |
||||||
|
this.inputShow=true |
||||||
|
} |
||||||
|
} |
||||||
|
//保存点击事件
|
||||||
|
savaClick(){ |
||||||
|
localStorage.setItem(sessionStorage.getItem("companyId")+"xxx",JSON.stringify(this.uploadSucced)) |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,96 @@ |
|||||||
|
<!-- 现场照片 --> |
||||||
|
<table > |
||||||
|
<tr> |
||||||
|
<td> |
||||||
|
<div class="noImg" *ngIf="!unitImg"> |
||||||
|
<div> |
||||||
|
<img class="camera" src="../../../assets/images/camera.png" alt=""> |
||||||
|
</div> |
||||||
|
<p>熟悉单位照片</p> |
||||||
|
<div> |
||||||
|
<span>单位整体建筑或大门照片,要求照拍照时要求设置拍照日期</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="input" *ngIf="!unitImg && iseditsix"> |
||||||
|
<input type="file" (change)="filechange1($event,'1')" name="imgFile"> |
||||||
|
</div> |
||||||
|
<div *ngIf="unitImg" id="viewerjs1"> |
||||||
|
<img class="image" [src]="unitImg" alt="" [attr.data-original]="unitImg.split('?')[0]"> |
||||||
|
</div> |
||||||
|
<div *ngIf="unitImg && iseditsix" class="deleteicon"> |
||||||
|
<button mat-icon-button (click)="deleteimg('1')"> |
||||||
|
<mat-icon>delete</mat-icon> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</td> |
||||||
|
|
||||||
|
<td> |
||||||
|
<div class="noImg" *ngIf="!lingdaoImg"> |
||||||
|
<div> |
||||||
|
<img src="../../../assets/images/camera.png" alt=""> |
||||||
|
</div> |
||||||
|
<p>领导带队现场熟悉照片</p> |
||||||
|
<div> |
||||||
|
<span>人员现场熟悉照片,要求有带队领导及熟悉人员现场熟悉场景,拍照时要求设置拍照日期</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="input" *ngIf="!lingdaoImg && iseditsix"> |
||||||
|
<input type="file" (change)="filechange1($event,'2')" name="imgFile"> |
||||||
|
</div> |
||||||
|
<div *ngIf="lingdaoImg" id="viewerjs2"> |
||||||
|
<img class="image" [src]="lingdaoImg" alt="" [attr.data-original]="lingdaoImg.split('?')[0]"> |
||||||
|
</div> |
||||||
|
<div *ngIf="lingdaoImg && iseditsix" class="deleteicon"> |
||||||
|
<button mat-icon-button (click)="deleteimg('2')"> |
||||||
|
<mat-icon>delete</mat-icon> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td> |
||||||
|
<div class="noImg" *ngIf="!peopleImg"> |
||||||
|
<div> |
||||||
|
<img src="../../../assets/images/camera.png" alt=""> |
||||||
|
</div> |
||||||
|
<p>人员现场熟悉照片</p> |
||||||
|
<div> |
||||||
|
<span>人员现场熟悉照片,要求有熟悉人员现场熟悉场景,拍照时要求设置拍照日期</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="input" *ngIf="!peopleImg && iseditsix"> |
||||||
|
<input type="file" (change)="filechange1($event,'3')" name="imgFile"> |
||||||
|
</div> |
||||||
|
<div *ngIf="peopleImg" id="viewerjs3"> |
||||||
|
<img class="image" [src]="peopleImg" alt="" [attr.data-original]="peopleImg.split('?')[0]"> |
||||||
|
</div> |
||||||
|
<div *ngIf="peopleImg && iseditsix" class="deleteicon"> |
||||||
|
<button mat-icon-button (click)="deleteimg('3')"> |
||||||
|
<mat-icon>delete</mat-icon> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</td> |
||||||
|
<td> |
||||||
|
<div class="noImg" *ngIf="!keysiteImg"> |
||||||
|
<div> |
||||||
|
<img src="../../../assets/images/camera.png" alt=""> |
||||||
|
</div> |
||||||
|
<p>单位重点部位照片</p> |
||||||
|
<div> |
||||||
|
<span>重点部位照片,拍照时要求设置拍照日期</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="input" *ngIf="!keysiteImg && iseditsix"> |
||||||
|
<input type="file" (change)="filechange1($event,'4')" name="imgFile"> |
||||||
|
</div> |
||||||
|
<div *ngIf="keysiteImg" id="viewerjs4"> |
||||||
|
<img class="image" [src]="keysiteImg" alt="" [attr.data-original]="keysiteImg.split('?')[0]"> |
||||||
|
</div> |
||||||
|
<div *ngIf="keysiteImg && iseditsix" class="deleteicon"> |
||||||
|
<button mat-icon-button (click)="deleteimg('4')"> |
||||||
|
<mat-icon>delete</mat-icon> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</table> |
@ -0,0 +1,39 @@ |
|||||||
|
table{ |
||||||
|
margin: 0 auto; |
||||||
|
width: 85%; |
||||||
|
height: 80%; |
||||||
|
margin-top: 3%; |
||||||
|
border-collapse: collapse; |
||||||
|
td{ |
||||||
|
position: relative; |
||||||
|
width: 50%; |
||||||
|
height: 50%; |
||||||
|
p{ |
||||||
|
font-size: 20px; |
||||||
|
margin: 8px 0; |
||||||
|
} |
||||||
|
span{ |
||||||
|
font-size: 15px; |
||||||
|
font-weight: 500; |
||||||
|
color: gray; |
||||||
|
} |
||||||
|
input{ |
||||||
|
position: absolute; |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
left: 0; |
||||||
|
top: 0; |
||||||
|
opacity: 0; |
||||||
|
} |
||||||
|
.image{ |
||||||
|
height: 100%; |
||||||
|
width: 299px; |
||||||
|
} |
||||||
|
.deleteicon{ |
||||||
|
position: absolute; |
||||||
|
right: 50px; |
||||||
|
top: 50px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
table,table tr th, table tr td { border:1px solid black;text-align: center; } |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { PhotoofthesceneComponent } from './photoofthescene.component'; |
||||||
|
|
||||||
|
describe('PhotoofthesceneComponent', () => { |
||||||
|
let component: PhotoofthesceneComponent; |
||||||
|
let fixture: ComponentFixture<PhotoofthesceneComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ PhotoofthesceneComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(PhotoofthesceneComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,180 @@ |
|||||||
|
import { HttpClient } from '@angular/common/http'; |
||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import { MatSnackBar ,MatSnackBarConfig} from '@angular/material/snack-bar'; |
||||||
|
import Viewer from 'viewerjs'; |
||||||
|
@Component({ |
||||||
|
selector: 'app-photoofthescene', |
||||||
|
templateUrl: './photoofthescene.component.html', |
||||||
|
styleUrls: ['./photoofthescene.component.scss'] |
||||||
|
}) |
||||||
|
export class PhotoofthesceneComponent implements OnInit { |
||||||
|
|
||||||
|
constructor(private http: HttpClient,public snackBar: MatSnackBar) { } |
||||||
|
gallery//viewerJs实例
|
||||||
|
isEditPattern = true |
||||||
|
|
||||||
|
iseditsix = true |
||||||
|
ngOnInit(): void { |
||||||
|
if(sessionStorage.getItem("six") == "look"){ |
||||||
|
this.iseditsix = false |
||||||
|
}else if(sessionStorage.getItem("six") == "edit"){ |
||||||
|
this.iseditsix = true |
||||||
|
} |
||||||
|
setTimeout(() => { |
||||||
|
if(document.getElementById('viewerjs1')){ |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs1'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
} |
||||||
|
if(document.getElementById('viewerjs2')){ |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs2'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
} |
||||||
|
if(document.getElementById('viewerjs3')){ |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs3'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
} |
||||||
|
if(document.getElementById('viewerjs4')){ |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs4'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
} |
||||||
|
}, 0); |
||||||
|
|
||||||
|
if(localStorage.getItem("pattern")=="edit"){ |
||||||
|
this.isEditPattern = true |
||||||
|
}else if(localStorage.getItem("pattern") == "look"){ |
||||||
|
this.isEditPattern = false |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
unitImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "1") || "" |
||||||
|
lingdaoImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "2") || "" |
||||||
|
peopleImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "3") || "" |
||||||
|
keysiteImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "4") || "" |
||||||
|
|
||||||
|
//删除照片
|
||||||
|
deleteimg(num){ |
||||||
|
var msg = "您真的确定要删除吗?";
|
||||||
|
if (confirm(msg)==true){
|
||||||
|
localStorage.removeItem(sessionStorage.getItem('companyId')+num) |
||||||
|
if(num == "1"){ |
||||||
|
this.unitImg = "" |
||||||
|
} |
||||||
|
if(num == "2"){ |
||||||
|
this.lingdaoImg = "" |
||||||
|
} |
||||||
|
if(num == "3"){ |
||||||
|
this.peopleImg = "" |
||||||
|
} |
||||||
|
if(num == "4"){ |
||||||
|
this.keysiteImg = "" |
||||||
|
} |
||||||
|
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} |
||||||
|
//熟悉单位照片上传
|
||||||
|
file:any |
||||||
|
filechange1(e,index){ |
||||||
|
this.file = e.target.files[0] || null //上传的文件
|
||||||
|
var reader = new FileReader(); |
||||||
|
reader.readAsDataURL(this.file); |
||||||
|
var image:any = new Image(); |
||||||
|
reader.onload = function(){ |
||||||
|
image.src = reader.result |
||||||
|
} |
||||||
|
setTimeout(() => { |
||||||
|
if(image.width>=4096 || image.height>=5000 ){
|
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config); |
||||||
|
}else{ |
||||||
|
if(this.file){ |
||||||
|
this.startUploading(index) |
||||||
|
} |
||||||
|
} |
||||||
|
}, 500); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
isspinner:any //进度圈
|
||||||
|
imgUrl:any //上传后的图片地址
|
||||||
|
imgsrc:any //上传后的缩略图地址
|
||||||
|
|
||||||
|
//上传文件
|
||||||
|
startUploading(type) { |
||||||
|
this.isspinner = true |
||||||
|
let file = this.file || null //获取上传的文件
|
||||||
|
let fileSize = file.size || null //上传文件的总大小
|
||||||
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
||||||
|
|
||||||
|
if (file && fileSize <= shardSize) { //上传文件<=5MB时
|
||||||
|
// this.upload()
|
||||||
|
let formData = new FormData() |
||||||
|
formData.append("file",file) |
||||||
|
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{ |
||||||
|
this.isspinner = false |
||||||
|
this.imgUrl = data.objectName |
||||||
|
this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` |
||||||
|
localStorage.setItem(sessionStorage.getItem("companyId") + type, this.imgsrc) |
||||||
|
if(type == '1'){ |
||||||
|
this.unitImg = this.imgsrc |
||||||
|
setTimeout(() => { |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs1'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
}, 0); |
||||||
|
} |
||||||
|
if(type == '2'){ |
||||||
|
this.lingdaoImg = this.imgsrc |
||||||
|
setTimeout(() => { |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs2'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
}, 0); |
||||||
|
} |
||||||
|
if(type == '3'){ |
||||||
|
this.peopleImg = this.imgsrc |
||||||
|
setTimeout(() => { |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs3'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
}, 0); |
||||||
|
} |
||||||
|
if(type == '4'){ |
||||||
|
this.keysiteImg = this.imgsrc |
||||||
|
setTimeout(() => { |
||||||
|
this.gallery = new Viewer(document.getElementById('viewerjs4'),{ |
||||||
|
url: 'data-original' |
||||||
|
}); |
||||||
|
}, 0); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('上传成功','确定',config); |
||||||
|
|
||||||
|
|
||||||
|
}) |
||||||
|
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
|
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('请上传小于5M图片','确定',config); |
||||||
|
// let data = { filename: file.name }
|
||||||
|
// this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.unitinfo.id}`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
|
||||||
|
// this.objectName = data.objectName
|
||||||
|
// this.uploadId = data.uploadId
|
||||||
|
// this.subsectionUploading()
|
||||||
|
// })
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
<div class="content"> |
||||||
|
<div class="center" id="center"></div> |
||||||
|
<div class="btnbox"> |
||||||
|
<div class="btn" (click)="next()">已到达熟悉单位</div> |
||||||
|
<div (click)="back()">取消本次任务</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,35 @@ |
|||||||
|
.content { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 3px; |
||||||
|
overflow: hidden; |
||||||
|
position: relative; |
||||||
|
.center { |
||||||
|
width: 100%; |
||||||
|
height: 740px; |
||||||
|
} |
||||||
|
.btnbox{ |
||||||
|
position: absolute; |
||||||
|
left: 50%; |
||||||
|
bottom: 7%;; |
||||||
|
transform: translateX(-50%); |
||||||
|
display: flex; |
||||||
|
div{ |
||||||
|
text-align: center; |
||||||
|
width:130px; |
||||||
|
height: 48px; |
||||||
|
line-height: 48px; |
||||||
|
opacity: 1; |
||||||
|
border-radius: 30px; |
||||||
|
font-size: 16px; |
||||||
|
margin: 0 12px; |
||||||
|
background: #E9EAF3; |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
.btn{ |
||||||
|
background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%); |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { RouterGISComponent } from './router-gis.component'; |
||||||
|
|
||||||
|
describe('RouterGISComponent', () => { |
||||||
|
let component: RouterGISComponent; |
||||||
|
let fixture: ComponentFixture<RouterGISComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ RouterGISComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(RouterGISComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,25 @@ |
|||||||
|
<div class="box" style="height: 100%;"> |
||||||
|
<div *ngIf="!isnext" class="table"> |
||||||
|
<table> |
||||||
|
<tr> |
||||||
|
<th class="firstContent"></th> |
||||||
|
<th>熟悉记录</th> |
||||||
|
<th>记录时间</th> |
||||||
|
<th>带队领导</th> |
||||||
|
<th>上传人员</th> |
||||||
|
<th>操作</th> |
||||||
|
</tr> |
||||||
|
<tr *ngFor="let item of tableData"> |
||||||
|
<td class="firstContent"><mat-checkbox></mat-checkbox></td> |
||||||
|
<td class="overflowText">{{item.target}}</td> |
||||||
|
<td class="overflowText">{{item.time}}</td> |
||||||
|
<td>{{item.leadTheTeam}}</td> |
||||||
|
<td>{{item.updateStaff}}</td> |
||||||
|
<td class="fontColor" (click)='viewDetails()'>查看详情</td> |
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
<div *ngIf="isnext" class="app" style="height: 100%;"> |
||||||
|
<app-training-recordinfo></app-training-recordinfo> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,37 @@ |
|||||||
|
.box { |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 5px; |
||||||
|
overflow: hidden; |
||||||
|
.table { |
||||||
|
width: 100%; |
||||||
|
max-height: 100%; |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
table { |
||||||
|
width: 100%; |
||||||
|
background: #2196f3; |
||||||
|
text-align: center; |
||||||
|
border-collapse:collapse; |
||||||
|
word-break:break-all; |
||||||
|
word-wrap:break-all; |
||||||
|
table-layout:fixed; |
||||||
|
.firstContent { width:50px; } |
||||||
|
th { |
||||||
|
height: 50px; |
||||||
|
font-weight: normal; |
||||||
|
font-size: 18px; |
||||||
|
color: #fff; |
||||||
|
// border-bottom: 1px solid rgb(211, 207, 207); |
||||||
|
} |
||||||
|
td { |
||||||
|
height: 50px; |
||||||
|
font-size: 15px; |
||||||
|
background-color: #fff; |
||||||
|
border-top: 1px solid rgb(211, 207, 207); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.fontColor{ |
||||||
|
cursor: pointer; |
||||||
|
color: #2196f3; |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { SixFamiliarListComponent } from './six-familiar-list.component'; |
||||||
|
|
||||||
|
describe('SixFamiliarListComponent', () => { |
||||||
|
let component: SixFamiliarListComponent; |
||||||
|
let fixture: ComponentFixture<SixFamiliarListComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ SixFamiliarListComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(SixFamiliarListComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,31 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-six-familiar-list', |
||||||
|
templateUrl: './six-familiar-list.component.html', |
||||||
|
styleUrls: ['./six-familiar-list.component.scss'] |
||||||
|
}) |
||||||
|
export class SixFamiliarListComponent implements OnInit { |
||||||
|
|
||||||
|
constructor() { } |
||||||
|
tableData :any = [ |
||||||
|
{target: '记录1', time: '2020-10-29 07:19', leadTheTeam: '郑子墨', updateStaff: '赵竹林', }, |
||||||
|
{target: '记录2', time: '2020-11-02 07:19', leadTheTeam: '何先超', updateStaff: '何晨', }, |
||||||
|
{target: '记录3', time: '2020-11-02 11:19', leadTheTeam: '吴洁丽', updateStaff: '赵玉', }, |
||||||
|
{target: '记录4', time: '2020-11-03 07:19', leadTheTeam: '吴毅溪', updateStaff: '赵晓慧', }, |
||||||
|
{target: '记录5', time: '2020-11-07 07:19', leadTheTeam: '周伟林', updateStaff: '李英顺', }, |
||||||
|
{target: '记录6', time: '2020-11-11 07:19', leadTheTeam: '李林颖', updateStaff: '吴思怡', }, |
||||||
|
{target: '记录7', time: '2020-11-12 07:19', leadTheTeam: '李双杆', updateStaff: '钱浩宇', }, |
||||||
|
{target: '记录8', time: '2020-11-14 11:19', leadTheTeam: '孙正荣', updateStaff: '孙正云', }, |
||||||
|
{target: '记录9', time: '2020-11-17 07:19', leadTheTeam: '赵虎林', updateStaff: '冯燕', }, |
||||||
|
{target: '记录10', time: '2020-11-20 07:19', leadTheTeam: '周伟林', updateStaff: '李英顺', }, |
||||||
|
{target: '记录11', time: '2020-11-22 07:19', leadTheTeam: '冯燕', updateStaff: '冯靖宇', }, |
||||||
|
] |
||||||
|
ngOnInit(): void { |
||||||
|
} |
||||||
|
//点击查看详情
|
||||||
|
isnext = false |
||||||
|
viewDetails(){ |
||||||
|
this.isnext = true |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
<div class="contentMap" id="contentMap"> |
||||||
|
|
||||||
|
</div> |
@ -0,0 +1,6 @@ |
|||||||
|
<div class="content"> |
||||||
|
|
||||||
|
<div class="mapCenter" id="mapCenter"> |
||||||
|
<app-routerMap></app-routerMap> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,21 @@ |
|||||||
|
.content { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 1px; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
//地图div |
||||||
|
.mapCenter { |
||||||
|
width: 700px; |
||||||
|
height: 500px; |
||||||
|
margin: 100px auto; |
||||||
|
border: 1px solid #000; |
||||||
|
} |
||||||
|
|
||||||
|
//地图组件 |
||||||
|
.contentMap { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { SixFamiliarityComponent } from './six-familiarity.component'; |
||||||
|
|
||||||
|
describe('SixFamiliarityComponent', () => { |
||||||
|
let component: SixFamiliarityComponent; |
||||||
|
let fixture: ComponentFixture<SixFamiliarityComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ SixFamiliarityComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(SixFamiliarityComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,74 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
declare var AMap: any; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-six-familiarity', |
||||||
|
templateUrl: './six-familiarity.component.html', |
||||||
|
styleUrls: ['./six-familiarity.component.scss'] |
||||||
|
}) |
||||||
|
export class SixFamiliarityComponent implements OnInit { |
||||||
|
|
||||||
|
constructor() { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
ngAfterViewInit(): void { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//地图组件
|
||||||
|
@Component({ |
||||||
|
selector: 'app-routerMap', |
||||||
|
templateUrl: './routerMap.html', |
||||||
|
styleUrls: ['./six-familiarity.component.scss'] |
||||||
|
}) |
||||||
|
export class routerMapComponent implements OnInit { |
||||||
|
|
||||||
|
constructor() { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
ngAfterViewInit(): void { |
||||||
|
window.setTimeout(()=>{ |
||||||
|
this.mapInit() |
||||||
|
},0) |
||||||
|
} |
||||||
|
|
||||||
|
//地图初始化
|
||||||
|
mapInit () { |
||||||
|
//创建地图
|
||||||
|
let map = new AMap.Map('contentMap', { |
||||||
|
resizeEnable: true, |
||||||
|
cursor: 'default', |
||||||
|
zooms:[6,18], |
||||||
|
}); |
||||||
|
//构造路线导航类 实际路线
|
||||||
|
let driving = new AMap.Driving({ |
||||||
|
map: map, |
||||||
|
showTraffic: true, |
||||||
|
isOutline: true, |
||||||
|
}); |
||||||
|
driving.search( [{keyword: '广西消防总队',city:'广西'},{keyword: '万科公园里',city:'广西'},{keyword: '南宁明安医院',city:'广西'}], ); |
||||||
|
//构造路线导航类 导航路线
|
||||||
|
let drivingTwo = new AMap.Driving({ |
||||||
|
map: map, |
||||||
|
showTraffic: false, |
||||||
|
}); |
||||||
|
drivingTwo.search( [{keyword: '广西消防总队',city:'广西'},{keyword: '南宁明安医院',city:'广西'}], ); |
||||||
|
//function (status,result) { console.log(status,result) } //地图路线 匹配起始点回调函数
|
||||||
|
//new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719) / [{keyword: '淄博站',city:'山东'},{keyword: '淄博北站',city:'山东'}], //路线可搜索, 可用坐标
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,79 @@ |
|||||||
|
<!-- |
||||||
|
* @Descripttion: |
||||||
|
* @version: |
||||||
|
* @Author: sueRimn |
||||||
|
* @Date: 2020-11-06 10:44:49 |
||||||
|
* @LastEditors: sueRimn |
||||||
|
* @LastEditTime: 2020-11-06 17:07:16 |
||||||
|
--> |
||||||
|
<div class="bigbox"> |
||||||
|
<!-- <div class="title"> |
||||||
|
<app-title [title]="title"></app-title> |
||||||
|
</div> --> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<div class="cardbox"> |
||||||
|
<mat-tab-group style="height: 100%;" [selectedIndex]="tabsSelectedIndex" (selectedTabChange)="selectedtab($event)"> |
||||||
|
|
||||||
|
<mat-tab label="行驶路线"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-router-gis (onCustomEvent)="onCustom($event)"></app-router-gis> |
||||||
|
</ng-template> |
||||||
|
|
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="熟悉路线"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-know-route></app-know-route> |
||||||
|
</ng-template> |
||||||
|
|
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="单位基本情况"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-basicinfo *ngIf="sixeditpattern"></app-basicinfo> |
||||||
|
<app-basicinfo-look *ngIf="!sixeditpattern"></app-basicinfo-look> |
||||||
|
</ng-template> |
||||||
|
|
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="平面图" > |
||||||
|
<ng-template matTabContent > |
||||||
|
<app-collection-tools></app-collection-tools> |
||||||
|
</ng-template> |
||||||
|
|
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="安全疏散设施情况"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-fire-fighting-device *ngIf="sixeditpattern"></app-fire-fighting-device> |
||||||
|
<app-fire-fighting-device-look *ngIf="!sixeditpattern"></app-fire-fighting-device-look> |
||||||
|
</ng-template> |
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="消防设施情况"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-fire-fighting-device *ngIf="sixeditpattern"></app-fire-fighting-device> |
||||||
|
<app-fire-fighting-device-look *ngIf="!sixeditpattern"></app-fire-fighting-device-look> |
||||||
|
</ng-template> |
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="水源道路情况"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-water-road></app-water-road> |
||||||
|
</ng-template> |
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="重点部位情况"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-function-division *ngIf="sixeditpattern"></app-function-division> |
||||||
|
<app-function-division-look *ngIf="!sixeditpattern"></app-function-division-look> |
||||||
|
</ng-template> |
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="发现问题"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-find-problem></app-find-problem> |
||||||
|
</ng-template> |
||||||
|
</mat-tab> |
||||||
|
<mat-tab label="现场照片"> |
||||||
|
<ng-template matTabContent> |
||||||
|
<app-photoofthescene></app-photoofthescene> |
||||||
|
</ng-template> |
||||||
|
</mat-tab> |
||||||
|
</mat-tab-group> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,31 @@ |
|||||||
|
.bigbox{ |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
background: #F4F5F9; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
overflow: hidden; |
||||||
|
.title{ |
||||||
|
width: 100%; |
||||||
|
height: 0.585938rem; |
||||||
|
} |
||||||
|
.content{ |
||||||
|
flex: 1; |
||||||
|
overflow: hidden; |
||||||
|
.cardbox{ |
||||||
|
margin: 0 auto; |
||||||
|
margin-top:0.195313rem; |
||||||
|
background-color: #fff; |
||||||
|
border-radius: 0.048828rem; |
||||||
|
width:100%; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.mat-tab-body-wrapper { |
||||||
|
height: 100%; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
.mat-tab-body-wrapper{ |
||||||
|
height: 100%!important; |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { TrainingRecordinfoComponent } from './training-recordinfo.component'; |
||||||
|
|
||||||
|
describe('TrainingRecordinfoComponent', () => { |
||||||
|
let component: TrainingRecordinfoComponent; |
||||||
|
let fixture: ComponentFixture<TrainingRecordinfoComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ TrainingRecordinfoComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(TrainingRecordinfoComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,29 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-training-recordinfo', |
||||||
|
templateUrl: './training-recordinfo.component.html', |
||||||
|
styleUrls: ['./training-recordinfo.component.scss'] |
||||||
|
}) |
||||||
|
export class TrainingRecordinfoComponent implements OnInit { |
||||||
|
tabsSelectedIndex:any = 0//当前选项卡值
|
||||||
|
constructor() { } |
||||||
|
title:any = "训练记录信息" |
||||||
|
|
||||||
|
sixeditpattern = true |
||||||
|
ngOnInit(): void { |
||||||
|
if(sessionStorage.getItem("six") == "edit"){ |
||||||
|
this.sixeditpattern = true |
||||||
|
}else{ |
||||||
|
this.sixeditpattern = false |
||||||
|
} |
||||||
|
} |
||||||
|
onCustom($event){ |
||||||
|
console.log($event);//data from child
|
||||||
|
this.tabsSelectedIndex = 1 |
||||||
|
} |
||||||
|
selectedtab(e){ |
||||||
|
sessionStorage.setItem("tabsindex",e.index) |
||||||
|
// console.log(e.index)
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
<div class="dialogbox"> |
||||||
|
<div class="title"> |
||||||
|
<span style="color: #FC7045;">说明:</span> |
||||||
|
<span>水源情况主要包括消火栓位置、管径、外观完好情况、停车取水位置试水情况,消防水池位置、容量、停车取水位置、取水测试情况,取消码头位置、水位、停车取水位置等;道路情况主要包括道路长度、宽度、起始点、沿线重点单位、立交、桥梁、涵洞及其通车能力。</span> |
||||||
|
<span style="color: #FC7045;">【该项主要在道路水源熟悉时填写】</span> |
||||||
|
</div> |
||||||
|
<div class="text"> |
||||||
|
<textarea [disabled]="!iseditsix" name="" id="" cols="30" rows="10" placeholder="请输入水源情况" [(ngModel)]="textcontant"></textarea> |
||||||
|
</div> |
||||||
|
<div class="btnbox"> |
||||||
|
<div *ngIf="iseditsix" (click)="ok()">确认</div> |
||||||
|
<div (click)="cancel()">取消</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,19 @@ |
|||||||
|
<div class="content"> |
||||||
|
<div class="center" id="map"></div> |
||||||
|
<!-- <div class="textbox"> |
||||||
|
<div class="btn"> |
||||||
|
<span> |
||||||
|
<mat-icon (click)="save()">description</mat-icon> |
||||||
|
<mat-icon (click)="clickicon()">create</mat-icon> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<div class="text" [hidden]="!isshow"> |
||||||
|
<textarea [(ngModel)]="textcontant" name="" id="" cols="28" rows="18" placeholder="水源情况主要包括消火栓位置、管径、外观完好情况、停车取水位置试水情况,消防水池位置、容量、停车取水位置、取水测试情况,取消码头位置、水位、停车取水位置等;道路情况主要包括道路长度、宽度、起始点、沿线重点单位、立交、桥梁、涵洞及其通车能力。【该项主要在道路水源熟悉时填写】"></textarea> |
||||||
|
</div> |
||||||
|
</div> --> |
||||||
|
<div class="editbtn" (click)="opendialog()"> |
||||||
|
<p style="margin-top: 20px;"><mat-icon>create</mat-icon></p> |
||||||
|
<p style="font-size: 16px;color: #fff;">编辑</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
@ -0,0 +1,81 @@ |
|||||||
|
.content { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 0.244141rem; |
||||||
|
overflow: hidden; |
||||||
|
position: relative; |
||||||
|
.center { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
.textbox{ |
||||||
|
position: absolute; |
||||||
|
z-index: 999; |
||||||
|
right: 0.244141rem; |
||||||
|
top:0.244141rem; |
||||||
|
.btn{ |
||||||
|
text-align: right; |
||||||
|
} |
||||||
|
} |
||||||
|
.editbtn{ |
||||||
|
text-align: center; |
||||||
|
position: absolute; |
||||||
|
right: 50px; |
||||||
|
bottom: 50px; |
||||||
|
width: 80px; |
||||||
|
height: 80px; |
||||||
|
background: linear-gradient(360deg, #FC7045 0%, #FF4923 100%); |
||||||
|
box-shadow: 0px 2px 10px #D8A798; |
||||||
|
border-radius: 50%; |
||||||
|
opacity: 1; |
||||||
|
p{ |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.dialogbox{ |
||||||
|
width: 800px; |
||||||
|
height: 600px; |
||||||
|
.title{ |
||||||
|
span{ |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
} |
||||||
|
.text{ |
||||||
|
width: 97%; |
||||||
|
height: 420px; |
||||||
|
margin-top:30px; |
||||||
|
background: #F4F5F9; |
||||||
|
|
||||||
|
border-radius: 10px; |
||||||
|
textarea{ |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
} |
||||||
|
.btnbox{ |
||||||
|
display: flex; |
||||||
|
margin-top: 30px; |
||||||
|
justify-content: center; |
||||||
|
div{ |
||||||
|
cursor: pointer; |
||||||
|
font-size: 16px; |
||||||
|
width: 180px; |
||||||
|
height: 48px; |
||||||
|
line-height: 48px; |
||||||
|
text-align: center; |
||||||
|
background: #E9EAF3; |
||||||
|
opacity: 1; |
||||||
|
border-radius: 30px; |
||||||
|
margin: 0 10px; |
||||||
|
} |
||||||
|
div:nth-child(1){ |
||||||
|
color: #fff; |
||||||
|
background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { WaterRoadComponent } from './water-road.component'; |
||||||
|
|
||||||
|
describe('WaterRoadComponent', () => { |
||||||
|
let component: WaterRoadComponent; |
||||||
|
let fixture: ComponentFixture<WaterRoadComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ WaterRoadComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(WaterRoadComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
@ -0,0 +1,148 @@ |
|||||||
|
import { Component, Inject, OnInit } from '@angular/core'; |
||||||
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||||
|
declare var AMap: any; |
||||||
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-water-road', |
||||||
|
templateUrl: './water-road.component.html', |
||||||
|
styleUrls: ['./water-road.component.scss'] |
||||||
|
}) |
||||||
|
export class WaterRoadComponent implements OnInit { |
||||||
|
|
||||||
|
constructor(public snackBar: MatSnackBar,public dialog: MatDialog) { } |
||||||
|
isshow:boolean = true |
||||||
|
textcontant:any = localStorage.getItem(sessionStorage.getItem("companyId") + "waterroad") || "" |
||||||
|
clickicon(){ |
||||||
|
this.isshow = !this.isshow |
||||||
|
} |
||||||
|
save(){ |
||||||
|
localStorage.setItem(sessionStorage.getItem("companyId") + "waterroad",this.textcontant) |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config); |
||||||
|
} |
||||||
|
map:any //地图
|
||||||
|
|
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
|
||||||
|
setTimeout(() => { |
||||||
|
this.creatMap() |
||||||
|
|
||||||
|
}, 0); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
creatMap(){ |
||||||
|
var satellite = new AMap.TileLayer.Satellite(); |
||||||
|
var roadNet = new AMap.TileLayer.RoadNet(); |
||||||
|
|
||||||
|
// 创建一个 icon
|
||||||
|
var startIcon = new AMap.Icon({ |
||||||
|
image: '../../../assets/images/fireHydrant.png', |
||||||
|
// // 图标所用图片大小
|
||||||
|
imageSize: new AMap.Size(20, 20), |
||||||
|
// // 图标取图偏移量
|
||||||
|
// imageOffset: new AMap.Pixel(-9, -3)
|
||||||
|
}); |
||||||
|
let arr = [{lng:108.299405,lat: 22.894884}, |
||||||
|
{lng:108.597409,lat: 22.80883}, |
||||||
|
{lng:108.689419,lat: 23.061775}, |
||||||
|
{lng:107.971188,lat: 22.950537}, |
||||||
|
{lng:107.847592,lat: 23.090833}, |
||||||
|
{lng:108.176374,lat: 22.790585}, |
||||||
|
{lng:108.407087,lat: 22.671522}, |
||||||
|
{lng:108.158521,lat: 22.61322}, |
||||||
|
{lng:107.925062,lat: 22.565038}, |
||||||
|
{lng:108.180494,lat: 22.501616}, |
||||||
|
{lng:107.743222,lat: 22.535121}, |
||||||
|
{lng:108.373809,lat: 22.764746}, |
||||||
|
{lng:108.378895,lat: 22.761877}, |
||||||
|
{lng:108.383337,lat: 22.766467}, |
||||||
|
{lng:108.37647,lat: 22.763341}, |
||||||
|
{lng:108.37662,lat: 22.767397}, |
||||||
|
{lng:108.378916,lat: 22.758513}, |
||||||
|
{lng:108.379045,lat: 22.765695}, |
||||||
|
{lng:108.384731,lat: 22.760096},] |
||||||
|
let Arr = [] |
||||||
|
arr.forEach(item=>{ |
||||||
|
let viaMarker = new AMap.Marker({ |
||||||
|
position: new AMap.LngLat(item.lng, item.lat), |
||||||
|
icon: startIcon, |
||||||
|
offset: new AMap.Pixel(-10, -10) |
||||||
|
}) |
||||||
|
Arr.push(viaMarker) |
||||||
|
}) |
||||||
|
var markerIcon = new AMap.Icon({
|
||||||
|
image:"//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png", |
||||||
|
size: new AMap.Size(52, 52), //图标大小
|
||||||
|
imageSize: new AMap.Size(26,36) |
||||||
|
})
|
||||||
|
let marker1 = new AMap.Marker({ |
||||||
|
icon: markerIcon, |
||||||
|
position: [108.377865, 22.763499], |
||||||
|
offset: new AMap.Pixel(-4, -50) |
||||||
|
}); |
||||||
|
|
||||||
|
this.map = new AMap.Map('map',{ |
||||||
|
center: [108.377865, 22.763499], //初始地图中心点
|
||||||
|
zoom: 16 |
||||||
|
}); |
||||||
|
marker1.setMap(this.map); |
||||||
|
this.map.on('click', (e) => { |
||||||
|
console.log(e.lnglat.getLng() + ',' + e.lnglat.getLat())
|
||||||
|
}); |
||||||
|
|
||||||
|
// this.map.setCity('南宁市')
|
||||||
|
this.map.add(Arr);//火源标点
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
opendialog(){ |
||||||
|
let dialogRef = this.dialog.open(EditText); |
||||||
|
dialogRef.afterClosed().subscribe(data=>{ |
||||||
|
if(data){ |
||||||
|
|
||||||
|
} |
||||||
|
});
|
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//编辑水源道路情况
|
||||||
|
@Component({ |
||||||
|
selector: 'app-editBuilding', |
||||||
|
templateUrl: './edittext.html', |
||||||
|
styleUrls: ['./water-road.component.scss'] |
||||||
|
}) |
||||||
|
export class EditText { |
||||||
|
|
||||||
|
constructor(public snackBar: MatSnackBar,public dialog: MatDialog,public dialogRef: MatDialogRef<EditText>,@Inject(MAT_DIALOG_DATA) public data) { } |
||||||
|
textcontant:any = localStorage.getItem(sessionStorage.getItem("companyId") + "waterroad") || ""//输入内容
|
||||||
|
iseditsix = true |
||||||
|
ngOnInit(): void { |
||||||
|
if(sessionStorage.getItem("six") == "look"){ |
||||||
|
this.iseditsix = false |
||||||
|
}else if(sessionStorage.getItem("six") == "edit"){ |
||||||
|
this.iseditsix = true |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//确定
|
||||||
|
ok(){ |
||||||
|
localStorage.setItem(sessionStorage.getItem("companyId") + "waterroad",this.textcontant) |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config); |
||||||
|
this.dialogRef.close(); |
||||||
|
} |
||||||
|
//取消
|
||||||
|
cancel(){ |
||||||
|
this.dialogRef.close(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
<div class="functionalDomainContent"> |
||||||
|
<div mat-dialog-title> |
||||||
|
<label *ngIf="!data.parentId">新建处置节点</label> |
||||||
|
<label *ngIf="data.parentId">新建节点</label> |
||||||
|
</div> |
||||||
|
|
||||||
|
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<mat-form-field> |
||||||
|
<input matInput name="name" required ngModel placeholder="名称"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="submitBottom"> |
||||||
|
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
</form> |
||||||
|
|
||||||
|
</div> |
@ -0,0 +1,38 @@ |
|||||||
|
<div class="functionalDomainContent"> |
||||||
|
<div mat-dialog-title> |
||||||
|
<label *ngIf="!data.isBuilding">新建平面图</label> |
||||||
|
<label *ngIf="data.isBuilding">新建楼层/区域</label> |
||||||
|
</div> |
||||||
|
|
||||||
|
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<mat-form-field> |
||||||
|
<input matInput name="name" required ngModel placeholder="名称"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="keyMargin" *ngIf="data.isBuilding"> |
||||||
|
<mat-checkbox name="isRefugeStorey" [(ngModel)]="checked">是否为避难层</mat-checkbox> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<mat-form-field> |
||||||
|
<input matInput name="area" type="number" required ngModel placeholder="面积 (平方米)"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<textarea name="details" ngModel placeholder="详情"></textarea> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="submitBottom"> |
||||||
|
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
</form> |
||||||
|
|
||||||
|
</div> |
@ -0,0 +1,25 @@ |
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||||
|
|
||||||
|
import { CollectionToolsComponent } from './collection-tools.component'; |
||||||
|
|
||||||
|
describe('CollectionToolsComponent', () => { |
||||||
|
let component: CollectionToolsComponent; |
||||||
|
let fixture: ComponentFixture<CollectionToolsComponent>; |
||||||
|
|
||||||
|
beforeEach(async(() => { |
||||||
|
TestBed.configureTestingModule({ |
||||||
|
declarations: [ CollectionToolsComponent ] |
||||||
|
}) |
||||||
|
.compileComponents(); |
||||||
|
})); |
||||||
|
|
||||||
|
beforeEach(() => { |
||||||
|
fixture = TestBed.createComponent(CollectionToolsComponent); |
||||||
|
component = fixture.componentInstance; |
||||||
|
fixture.detectChanges(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('should create', () => { |
||||||
|
expect(component).toBeTruthy(); |
||||||
|
}); |
||||||
|
}); |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@ |
|||||||
|
<div mat-dialog-title>新增建筑</div> |
||||||
|
<div> |
||||||
|
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<input type="text" matInput ngModel |
||||||
|
required name="propertyName" placeholder="建筑名称" autocomplete="off"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<mat-select [(value)]="selected" required ngModel name="buildingId" placeholder="建筑类型"> |
||||||
|
<mat-option *ngFor="let item of allBuildingType" [value]="item.id"> |
||||||
|
{{item.name}} |
||||||
|
</mat-option> |
||||||
|
</mat-select> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-actions> |
||||||
|
<button mat-raised-button color="primary" type="submit" |
||||||
|
[disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,23 @@ |
|||||||
|
<div mat-dialog-title>编辑建筑</div> |
||||||
|
<div> |
||||||
|
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<input type="text" matInput [(ngModel)]="defaultName" required name="propertyName" placeholder="建筑名称" autocomplete="off"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<mat-select required [(ngModel)]="defaultBuildingType" name="buildingId" placeholder="建筑类型"> |
||||||
|
<mat-option *ngFor="let item of allBuildingType" [value]="item.id"> |
||||||
|
{{item.name}} |
||||||
|
</mat-option> |
||||||
|
</mat-select> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-actions> |
||||||
|
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid">确定</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,23 @@ |
|||||||
|
<div class="functionalDomainContent"> |
||||||
|
<div mat-dialog-title> |
||||||
|
<label>修改灾情节点名称</label> |
||||||
|
</div> |
||||||
|
|
||||||
|
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<mat-form-field> |
||||||
|
<input matInput name="name" required [(ngModel)]="nodeName" placeholder="名称"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="submitBottom"> |
||||||
|
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
</form> |
||||||
|
|
||||||
|
</div> |
@ -0,0 +1,39 @@ |
|||||||
|
<div class="functionalDomainContent"> |
||||||
|
|
||||||
|
<div mat-dialog-title> |
||||||
|
<label *ngIf="!data.isBuilding">编辑平面图</label> |
||||||
|
<label *ngIf="data.isBuilding">编辑楼层/区域</label> |
||||||
|
</div> |
||||||
|
|
||||||
|
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<mat-form-field> |
||||||
|
<input matInput name="name" required [(ngModel)]="name" placeholder="名称"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="keyMargin" *ngIf="data.isBuilding"> |
||||||
|
<mat-checkbox name="isRefugeStorey" [(ngModel)]="checked">是否为避难层</mat-checkbox> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<mat-form-field> |
||||||
|
<input matInput name="area" type="number" required [(ngModel)]="area" placeholder="面积 (平方米)"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="keyMargin"> |
||||||
|
<textarea name="details" [(ngModel)]="details" placeholder="详情"></textarea> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="submitBottom"> |
||||||
|
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
</form> |
||||||
|
|
||||||
|
</div> |
@ -0,0 +1,180 @@ |
|||||||
|
import { Component, OnInit, Inject } from '@angular/core'; |
||||||
|
import { HttpClient, HttpHeaders } from '@angular/common/http'; |
||||||
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||||
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-leftFunctionalDomain-plan', |
||||||
|
templateUrl: './addPlaneFigure.html', |
||||||
|
styleUrls: ['./panel.scss'] |
||||||
|
}) |
||||||
|
export class leftFunctionalDomainComponentPlan implements OnInit { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http:HttpClient, |
||||||
|
public dialog: MatDialog, |
||||||
|
public snackBar: MatSnackBar, |
||||||
|
public dialogRef: MatDialogRef<any>, |
||||||
|
@Inject(MAT_DIALOG_DATA) public data) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
params = {companyId: sessionStorage.getItem('companyId')} |
||||||
|
checked:boolean = false;//是否为避难层
|
||||||
|
|
||||||
|
//提交表单创建平面图
|
||||||
|
onSubmit (e) { |
||||||
|
if (!this.data.isBuilding) { //总平面图 创建平面图
|
||||||
|
let data = { |
||||||
|
companyId: sessionStorage.getItem('companyId'), |
||||||
|
name: e.name, |
||||||
|
order: this.data.order, |
||||||
|
area:e.area, |
||||||
|
details:e.details, |
||||||
|
enabled: true, |
||||||
|
modifiedTime: new Date(), |
||||||
|
} |
||||||
|
this.http.post('/api/SitePlans',data).subscribe(data=>{ |
||||||
|
this.dialogRef.close('总平面图'); |
||||||
|
}) |
||||||
|
} else { //建筑 创建楼层/区域
|
||||||
|
let data = { |
||||||
|
isRefugeStorey: e.isRefugeStorey, |
||||||
|
buildingId: this.data.Panel.id, |
||||||
|
name: e.name, |
||||||
|
order: this.data.order, |
||||||
|
area:e.area, |
||||||
|
details:e.details, |
||||||
|
enabled: true, |
||||||
|
modifiedTime: new Date(), |
||||||
|
} |
||||||
|
this.http.post('/api/BuildingAreas',data,{params:this.params}).subscribe(data=>{ |
||||||
|
this.dialogRef.close('建筑'); |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
//编辑平面图 楼层/区域
|
||||||
|
@Component({ |
||||||
|
selector: 'app-editPlaneFigure-plan', |
||||||
|
templateUrl: './editPlaneFigure.html', |
||||||
|
styleUrls: ['./panel.scss'] |
||||||
|
}) |
||||||
|
export class editPlaneFigureComponentPlan implements OnInit { |
||||||
|
|
||||||
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<any>,@Inject(MAT_DIALOG_DATA) public data) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.name = this.data.buildingData.name || '' |
||||||
|
this.checked = this.data.buildingData.isRefugeStorey || false |
||||||
|
this.area = this.data.buildingData.area || 0 |
||||||
|
this.details = this.data.buildingData.details || '' |
||||||
|
} |
||||||
|
|
||||||
|
params = {companyId: sessionStorage.getItem('companyId')} |
||||||
|
name:any; //name
|
||||||
|
checked:boolean = false;//是否为避难层
|
||||||
|
area:number; //面积
|
||||||
|
details:string; //详情
|
||||||
|
|
||||||
|
//提交表单修改平面图
|
||||||
|
onSubmit (e) { |
||||||
|
if (!this.data.isBuilding) { //总平面图 修改平面图
|
||||||
|
let data = { |
||||||
|
companyId: sessionStorage.getItem('companyId'), |
||||||
|
id: this.data.buildingData.id, |
||||||
|
name: e.name, |
||||||
|
cadUrl: this.data.buildingData.cadUrl, |
||||||
|
imageUrl: this.data.buildingData.imageUrl, |
||||||
|
imageAngle: this.data.buildingData.imageAngle, |
||||||
|
order: this.data.buildingData.order, |
||||||
|
area:e.area, |
||||||
|
details:e.details, |
||||||
|
enabled: this.data.buildingData.enabled, |
||||||
|
modifiedTime: new Date(), |
||||||
|
} |
||||||
|
this.http.put(`/api/SitePlans/${this.data.buildingData.id}`,data).subscribe(data=>{ |
||||||
|
this.dialogRef.close('总平面图'); |
||||||
|
}) |
||||||
|
} else { //建筑 修改楼层/区域
|
||||||
|
let data = { |
||||||
|
isRefugeStorey: e.isRefugeStorey, |
||||||
|
buildingId: this.data.Panel.id, |
||||||
|
id: this.data.buildingData.id, |
||||||
|
name: e.name, |
||||||
|
cadUrl: this.data.buildingData.cadUrl, |
||||||
|
imageUrl: this.data.buildingData.imageUrl, |
||||||
|
imageAngle: this.data.buildingData.imageAngle, |
||||||
|
order: this.data.buildingData.order, |
||||||
|
area:e.area, |
||||||
|
details:e.details, |
||||||
|
enabled: this.data.buildingData.enabled, |
||||||
|
modifiedTime: new Date(), |
||||||
|
} |
||||||
|
this.http.put(`/api/BuildingAreas/${this.data.buildingData.id}`,data,{params:this.params}).subscribe(data=>{ |
||||||
|
this.dialogRef.close('建筑'); |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//创建 处置预案 节点
|
||||||
|
@Component({ |
||||||
|
selector: 'app-addDisposalNode-plan', |
||||||
|
templateUrl: './addDisposalNode.html', |
||||||
|
styleUrls: ['./panel.scss'] |
||||||
|
}) |
||||||
|
export class addDisposalNodeComponentPlan implements OnInit { |
||||||
|
|
||||||
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<any>,@Inject(MAT_DIALOG_DATA) public data) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
} |
||||||
|
|
||||||
|
//提交表单
|
||||||
|
onSubmit (e) { |
||||||
|
this.data.name = e.name |
||||||
|
this.http.post('/api/DisposalNodes',this.data).subscribe(data=>{ |
||||||
|
this.dialogRef.close('success'); |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//编辑 处置预案 节点
|
||||||
|
@Component({ |
||||||
|
selector: 'app-editDisposalNode-plan', |
||||||
|
templateUrl: './editDisposalNode.html', |
||||||
|
styleUrls: ['./panel.scss'] |
||||||
|
}) |
||||||
|
export class editDisposalNodeComponentPlan implements OnInit { |
||||||
|
|
||||||
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<any>,@Inject(MAT_DIALOG_DATA) public data) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.nodeName = JSON.parse(JSON.stringify( this.data.name || '' ))
|
||||||
|
} |
||||||
|
nodeName:string; |
||||||
|
|
||||||
|
//提交表单
|
||||||
|
onSubmit (e) { |
||||||
|
this.data.name = e.name |
||||||
|
this.http.put(`/api/DisposalNodes/${this.data.id}`,this.data).subscribe(data=>{ |
||||||
|
this.dialogRef.close(e.name); |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,291 @@ |
|||||||
|
.matIcons { |
||||||
|
color: #8E909F; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//平面图 素材库 公共样式 头部 |
||||||
|
.planarGraphHeader{ |
||||||
|
height: 35px; |
||||||
|
min-height: 35px; |
||||||
|
cursor: pointer; |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
padding: 0 24px; |
||||||
|
border-radius: 5px; |
||||||
|
font-family: Roboto, "Helvetica Neue", sans-serif; |
||||||
|
font-size: 15px; |
||||||
|
font-weight: 400; |
||||||
|
color: #000; |
||||||
|
background: linear-gradient(to top,#cdced1,#FFF); |
||||||
|
} |
||||||
|
//平面图头部字体图标样式 |
||||||
|
.hover { |
||||||
|
width: 18px; |
||||||
|
height: 18px; |
||||||
|
margin-left: 90px; |
||||||
|
border: 1px solid #999; |
||||||
|
border-radius: 3px; |
||||||
|
.mat-icon {font-size: 18px; color: #999;} |
||||||
|
} |
||||||
|
.hover:hover { |
||||||
|
background-color: #4DA5FA; |
||||||
|
.mat-icon {color: #fff;} |
||||||
|
} |
||||||
|
|
||||||
|
//平面图 |
||||||
|
.sitePlanContent { |
||||||
|
position: relative; |
||||||
|
width: 100%; |
||||||
|
height: 35px; |
||||||
|
line-height: 35px; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 0 10px 0 25px; |
||||||
|
.mat-icon { |
||||||
|
font-size: 20px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//火源/力量 图标 |
||||||
|
.fireForce { |
||||||
|
display: block; |
||||||
|
float: right; |
||||||
|
margin: 8px 5px 0 0; |
||||||
|
width: 40px; |
||||||
|
height: 20px; |
||||||
|
line-height: 20px; |
||||||
|
text-align: center; |
||||||
|
position: relative; |
||||||
|
overflow: hidden; |
||||||
|
img{ |
||||||
|
width: 20px; |
||||||
|
height: 20px; |
||||||
|
} |
||||||
|
} |
||||||
|
//替换底图 inputfile |
||||||
|
.a-upload { |
||||||
|
display: block; |
||||||
|
float: right; |
||||||
|
margin: 8px 18px 0 0; |
||||||
|
width: 20px; |
||||||
|
height: 20px; |
||||||
|
line-height: 20px; |
||||||
|
text-align: center; |
||||||
|
position: relative; |
||||||
|
overflow: hidden; |
||||||
|
input { |
||||||
|
position: absolute; |
||||||
|
width: 20px; |
||||||
|
height: 20px; |
||||||
|
left: 0; |
||||||
|
top: 0; |
||||||
|
opacity: 0; |
||||||
|
} |
||||||
|
} |
||||||
|
.a-upload:hover { |
||||||
|
.mat-icon { |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
//上传底图 inputfile |
||||||
|
#a-uploadImg { |
||||||
|
display: block; |
||||||
|
width: 300px; |
||||||
|
height: 170px; |
||||||
|
position: fixed; |
||||||
|
top: 40%; |
||||||
|
left: 48%; |
||||||
|
overflow: hidden; |
||||||
|
border-radius: 5px; |
||||||
|
border: 1px solid #999; |
||||||
|
z-index: 999; |
||||||
|
input { |
||||||
|
position: absolute; |
||||||
|
width: 300px; |
||||||
|
height: 170px; |
||||||
|
left: 0; |
||||||
|
top: 0; |
||||||
|
opacity: 0; |
||||||
|
} |
||||||
|
img { |
||||||
|
width: 100%; |
||||||
|
height: auto; |
||||||
|
} |
||||||
|
} |
||||||
|
#a-uploadImg:hover { |
||||||
|
border: 5px solid skyblue; |
||||||
|
} |
||||||
|
|
||||||
|
//hover时显示右边操作栏 |
||||||
|
.sitePlanContent:hover { |
||||||
|
#rightOperate { |
||||||
|
display: block; |
||||||
|
} |
||||||
|
} |
||||||
|
//右边操作栏 |
||||||
|
#rightOperate{ |
||||||
|
width: 50px; |
||||||
|
height: 100px; |
||||||
|
position: absolute; |
||||||
|
top: -32px; |
||||||
|
right: -48px; |
||||||
|
z-index: 99999; |
||||||
|
border-radius: 0 100px 100px 0; |
||||||
|
background-color: #F0F4F7; |
||||||
|
// #F0F4F7 cdced1 |
||||||
|
display: none; |
||||||
|
.functionButton { |
||||||
|
height: 25%; |
||||||
|
line-height: 25px; |
||||||
|
} |
||||||
|
.bigFunctionIcon { |
||||||
|
font-size: 24px; |
||||||
|
} |
||||||
|
.functionIcon { |
||||||
|
color: #999; |
||||||
|
} |
||||||
|
.functionIcon:hover { |
||||||
|
color: #4DA5FA; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//处置预案 素材库 公用div |
||||||
|
.publiclBankPlan { |
||||||
|
flex: 1; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
overflow: hidden; |
||||||
|
padding-bottom: 10px; |
||||||
|
// border-top: 1px dashed #999; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 基本信息/想定作业 切换 |
||||||
|
.scenarioAssignment { |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
.selectEditMode { |
||||||
|
flex: 1; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
.materialBankDIV{ |
||||||
|
flex: 1; |
||||||
|
overflow-x: hidden; |
||||||
|
overflow-y: auto; |
||||||
|
} |
||||||
|
// 基本信息/想定作业 切换 |
||||||
|
//处置预案 |
||||||
|
#terrNodePublic { |
||||||
|
height: 35px; |
||||||
|
line-height: 35px; |
||||||
|
display: flex; |
||||||
|
.textNode {flex: 1;} |
||||||
|
} |
||||||
|
//字体图标 |
||||||
|
.planIconDiv { |
||||||
|
display: inline-block; |
||||||
|
.mat-icon{ |
||||||
|
font-size: 20px; |
||||||
|
width: 20px; |
||||||
|
height: 20px; |
||||||
|
color: #666; |
||||||
|
margin-right: 3px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.mat-expansion-panel-header { |
||||||
|
height: 40px !important; |
||||||
|
} |
||||||
|
//素材库溢出隐藏 |
||||||
|
#materialBank { |
||||||
|
margin: 1px 0; |
||||||
|
} |
||||||
|
//素材库图片flex |
||||||
|
#panelLibrary .text{ |
||||||
|
box-sizing: border-box; |
||||||
|
margin-left: 10px; |
||||||
|
} |
||||||
|
.panelLibraryFlex { |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
flex-wrap: wrap; |
||||||
|
justify-content: space-between; /* 水平居中 */ |
||||||
|
.imgBox { |
||||||
|
width: 70px; |
||||||
|
height: 100px; |
||||||
|
display: inline-block; |
||||||
|
text-align: center; |
||||||
|
border-radius: 3px; |
||||||
|
margin: 5px 0; |
||||||
|
img { |
||||||
|
width: 70px; |
||||||
|
height: auto; |
||||||
|
max-height: 70px; |
||||||
|
cursor:pointer; |
||||||
|
} |
||||||
|
p { |
||||||
|
font-size: 12px; |
||||||
|
cursor:pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//文本溢出 |
||||||
|
.overflowText { |
||||||
|
overflow: hidden; |
||||||
|
text-overflow:ellipsis; |
||||||
|
white-space: nowrap; |
||||||
|
} |
||||||
|
// 楼层/区域 是避难层时 |
||||||
|
.isRefugeStorey { |
||||||
|
color: #fff; |
||||||
|
background-color: rgb(238, 186, 186); |
||||||
|
} |
||||||
|
//选中平面图时 |
||||||
|
.selectSitePlan { |
||||||
|
color: #fff; |
||||||
|
background-color: #6BC2FF; |
||||||
|
} |
||||||
|
//选中素材库图片时 |
||||||
|
.selectImg { |
||||||
|
color: #fff; |
||||||
|
background-color: #4DA5FA; |
||||||
|
} |
||||||
|
//选中 处置节点时 |
||||||
|
.selectanelPoint { |
||||||
|
background-color: #F4C235; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//左侧功能区弹出框样式 |
||||||
|
.keyMargin { |
||||||
|
width: 100%; |
||||||
|
margin: 5px 0; |
||||||
|
.mat-form-field { |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
.submitBottom { |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
flex-wrap: wrap; |
||||||
|
justify-content: space-between; /* 水平居中 */ |
||||||
|
} |
||||||
|
.functionalDomainContent { |
||||||
|
width: 300px; |
||||||
|
height: 100%; |
||||||
|
textarea { |
||||||
|
border-radius: 5px; |
||||||
|
border: 1px solid #999; |
||||||
|
width: 100%; |
||||||
|
height: 120px; |
||||||
|
resize:none; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,301 @@ |
|||||||
|
import { Component, OnInit, Inject } from '@angular/core'; |
||||||
|
import { HttpClient, HttpHeaders } from '@angular/common/http'; |
||||||
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||||
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||||
|
import {CanvasShareDataService,DisposalNodeData} from '../../canvas-share-data.service' //引入服务
|
||||||
|
// 保存想定作业第一个弹窗
|
||||||
|
@Component({ |
||||||
|
selector: 'dialog-overview-example-dialog', |
||||||
|
templateUrl: 'saveOne.html', |
||||||
|
styleUrls: ['./collection-tools.component.scss'] |
||||||
|
}) |
||||||
|
export class saveOneDialogPlan { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http:HttpClient, |
||||||
|
public dialog: MatDialog, |
||||||
|
public snackBar: MatSnackBar, |
||||||
|
public dialogRef: MatDialogRef<saveOneDialogPlan>, |
||||||
|
@Inject(MAT_DIALOG_DATA) public data) {} |
||||||
|
|
||||||
|
onNoClick(): void { |
||||||
|
this.dialogRef.close() |
||||||
|
} |
||||||
|
allDisposalNode = this.data.allDisposalNode |
||||||
|
|
||||||
|
saveType(type){ |
||||||
|
this.dialogRef.close() |
||||||
|
const dialogRef = this.dialog.open(saveTwoDialogPlan, { |
||||||
|
data: {type: type, |
||||||
|
allDisposalNode: this.data.allDisposalNode, |
||||||
|
selectedBuildingData:this.data.selectedBuildingData, |
||||||
|
selectedSiteData:this.data.selectedSiteData, |
||||||
|
siteOrbuilding:this.data.siteOrbuilding, |
||||||
|
disasterId:this.data.disasterId} |
||||||
|
}); |
||||||
|
dialogRef.afterClosed().subscribe(result => { |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
// 保存想定作业第二个弹窗
|
||||||
|
@Component({ |
||||||
|
selector: 'dialog-overview-example-dialog', |
||||||
|
templateUrl: 'saveTwo.html', |
||||||
|
styleUrls: ['./collection-tools.component.scss'] |
||||||
|
}) |
||||||
|
export class saveTwoDialogPlan { |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http:HttpClient, |
||||||
|
public dialogRef: MatDialogRef<saveTwoDialogPlan>, |
||||||
|
public canvasData: CanvasShareDataService, |
||||||
|
public snackBar: MatSnackBar, |
||||||
|
@Inject(MAT_DIALOG_DATA) public data) {} |
||||||
|
|
||||||
|
type = this.data.type |
||||||
|
allDisposalNode = this.data.allDisposalNode |
||||||
|
allPlanDisposalNode = [] |
||||||
|
allRootDisposalNode = [{name:"根节点",id:null}] |
||||||
|
allDisposalNodeChild = [] |
||||||
|
ngOnInit(): void { |
||||||
|
//所有非数据节点
|
||||||
|
this.allDisposalNode.forEach(item => { |
||||||
|
if(!item.sitePlanId && !item.buildingAreaId){ |
||||||
|
this.allPlanDisposalNode.push(item) |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
//所有一级节点
|
||||||
|
this.allDisposalNode.forEach(item => { |
||||||
|
if(!item.parentId){ |
||||||
|
this.allRootDisposalNode.push(item) |
||||||
|
} |
||||||
|
}) |
||||||
|
this.allDisposalNodeChild = JSON.parse(JSON.stringify(this.allDisposalNode)) |
||||||
|
this.allDisposalNodeChild.forEach(item => { |
||||||
|
item.children = [] |
||||||
|
this.allDisposalNodeChild.forEach(i => { |
||||||
|
if(i.parentId == item.id){ |
||||||
|
item.children.push(i) |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
// console.log(this.nodeItem.id)
|
||||||
|
} |
||||||
|
onNoClick(): void { |
||||||
|
this.dialogRef.close(); |
||||||
|
} |
||||||
|
nodeItem |
||||||
|
itemChildNum = 0 //点击处置节点子数据节点的数量
|
||||||
|
clickNode(item){ |
||||||
|
console.log(item) |
||||||
|
this.nodeItem = item |
||||||
|
this.allDisposalNodeChild.forEach(item => { |
||||||
|
if(item.id == this.nodeItem.id){ |
||||||
|
this.itemChildNum = item.children.length |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
selectedBuildingData = this.data.selectedBuildingData |
||||||
|
selectedSiteData = this.data.selectedSiteData |
||||||
|
onSubmit(value,type){ |
||||||
|
// console.log(type)
|
||||||
|
let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name |
||||||
|
//如果保存到已有节点
|
||||||
|
var postdata = { |
||||||
|
id: "", |
||||||
|
name: name, |
||||||
|
level: 0, |
||||||
|
order: this.itemChildNum, |
||||||
|
description: "", |
||||||
|
notes: "", |
||||||
|
weather: null, |
||||||
|
airTemperature: null, |
||||||
|
windDirection: null, |
||||||
|
windScale: null, |
||||||
|
imageNames: null, |
||||||
|
imageUrls: null, |
||||||
|
parentId: this.nodeItem ? this.nodeItem.id : null, |
||||||
|
disasterId: this.data.disasterId, |
||||||
|
planComponentId: sessionStorage.getItem('planId') || '', |
||||||
|
companyId: this.data.siteOrbuilding == -1 ? sessionStorage.getItem('companyId') : null, |
||||||
|
sitePlanId: this.data.siteOrbuilding==-1 ? this.selectedSiteData.id : null, |
||||||
|
buildingId: this.selectedBuildingData.id || null, |
||||||
|
buildingAreaId: this.data.siteOrbuilding!=-1 ? this.selectedSiteData.id : null |
||||||
|
} |
||||||
|
if(type == 'old'){ |
||||||
|
let istrue = this.canvasData.findDisposalNode(this.nodeItem.id,name) |
||||||
|
let putdata = this.nodeItem |
||||||
|
putdata.weather = this.canvasData.selectPanelPointBaseData.weather |
||||||
|
putdata.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) |
||||||
|
putdata.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale)
|
||||||
|
putdata.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection)
|
||||||
|
putdata.description = this.canvasData.selectPanelPointBaseData.description |
||||||
|
putdata.notes = this.canvasData.selectPanelPointBaseData.notes |
||||||
|
|
||||||
|
|
||||||
|
if(istrue){//如果该处置节点下已有同名数据节点 则只修改 2个接口
|
||||||
|
new Promise((resolve,reject)=>{ |
||||||
|
this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { |
||||||
|
resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") |
||||||
|
}) |
||||||
|
}).then((values)=>{ |
||||||
|
this.canvasData.sendMessage('send a message');//发布一条消息
|
||||||
|
// 保存平面图数据到当前节点
|
||||||
|
let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint))
|
||||||
|
postdata.Data = JSON.stringify(postdata.Data) |
||||||
|
this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config) |
||||||
|
},err=>{ |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存失败','确定',config) |
||||||
|
}) |
||||||
|
this.dialogRef.close(); |
||||||
|
this.canvasData.sendMessage('send a message');//发布一条消息
|
||||||
|
}) |
||||||
|
|
||||||
|
}else{//需要3个接口
|
||||||
|
new Promise((resolve,reject)=>{ |
||||||
|
this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { |
||||||
|
resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") |
||||||
|
}) |
||||||
|
}).then((values)=>{ |
||||||
|
console.log(values) |
||||||
|
postdata.level = putdata.level + 1
|
||||||
|
new Promise((resolve,reject) => { |
||||||
|
this.http.post(`/api/DisposalNodes`,postdata).subscribe(data => { |
||||||
|
resolve(data) |
||||||
|
}) |
||||||
|
}).then((data:any)=>{ |
||||||
|
console.log(7788,data) |
||||||
|
let objData = { |
||||||
|
id: "", |
||||||
|
data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, |
||||||
|
version: this.canvasData.selectPanelPoint.Version || "2.0", |
||||||
|
disposalNodeId: data.id, |
||||||
|
planComponentId: sessionStorage.getItem("planId"), |
||||||
|
} |
||||||
|
this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config) |
||||||
|
},err=>{ |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存失败','确定',config) |
||||||
|
}) |
||||||
|
this.dialogRef.close(); |
||||||
|
this.canvasData.sendMessage('send a message');//发布一条消息
|
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
}else{//如果保存到新建节点
|
||||||
|
let dispositionNodeData //处置节点data
|
||||||
|
let order |
||||||
|
let oneLevelNum = [] |
||||||
|
//将order赋值为所有一级节点最后一个+1
|
||||||
|
this.allDisposalNode.forEach(item => { |
||||||
|
if(!item.parentId){ |
||||||
|
oneLevelNum.push(item) |
||||||
|
} |
||||||
|
}) |
||||||
|
if(oneLevelNum.length == 0){ |
||||||
|
order = 0 |
||||||
|
}else{ |
||||||
|
order = oneLevelNum[oneLevelNum.length - 1].order + 1 |
||||||
|
} |
||||||
|
|
||||||
|
if(this.nodeItem){//如果点击了下拉选择框
|
||||||
|
if(this.nodeItem.id != null){ |
||||||
|
this.allDisposalNodeChild.forEach(item => { |
||||||
|
if(item.id == this.nodeItem.id){ |
||||||
|
order = item.children.length |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
dispositionNodeData = { |
||||||
|
id: "", |
||||||
|
name: value.name, |
||||||
|
level: this.nodeItem && this.nodeItem.id != null ? this.nodeItem.level + 1 : 0, |
||||||
|
order: order, |
||||||
|
description: "", |
||||||
|
notes: "", |
||||||
|
weather: null, |
||||||
|
airTemperature: 0, |
||||||
|
windDirection: 0, |
||||||
|
windScale: 0, |
||||||
|
imageNames: null, |
||||||
|
imageUrls: null, |
||||||
|
parentId: this.nodeItem ? this.nodeItem.id : null, |
||||||
|
disasterId: this.data.disasterId, |
||||||
|
planComponentId: sessionStorage.getItem('planId') || '', |
||||||
|
companyId: null, |
||||||
|
sitePlanId: null, |
||||||
|
buildingId: null, |
||||||
|
buildingAreaId: null |
||||||
|
} |
||||||
|
|
||||||
|
dispositionNodeData.weather = this.canvasData.selectPanelPointBaseData.weather |
||||||
|
dispositionNodeData.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) |
||||||
|
dispositionNodeData.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale)
|
||||||
|
dispositionNodeData.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection)
|
||||||
|
dispositionNodeData.description = this.canvasData.selectPanelPointBaseData.description |
||||||
|
dispositionNodeData.notes = this.canvasData.selectPanelPointBaseData.notes |
||||||
|
//1.先创建一个处置节点 然后 .then 2.创建数据节点到刚创建的处置节点 3.然后拿着创建好的数据节点的id 将平面图data保存
|
||||||
|
new Promise((resolve,reject) => { |
||||||
|
this.http.post("/api/DisposalNodes",dispositionNodeData).subscribe((data:any) => { |
||||||
|
resolve(data.id) |
||||||
|
}) |
||||||
|
}).then((id) => { |
||||||
|
let dataNodeData
|
||||||
|
console.log("qnm",id) |
||||||
|
new Promise((resolve,reject) => { |
||||||
|
postdata.parentId = id |
||||||
|
postdata.level = dispositionNodeData.level + 1 |
||||||
|
this.http.post("/api/DisposalNodes",postdata).subscribe((data:any) => { |
||||||
|
resolve(data) |
||||||
|
}) |
||||||
|
}).then((data:any) => { |
||||||
|
// 保存平面图数据到当前节点
|
||||||
|
// console.log(6666,data)
|
||||||
|
// let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint))
|
||||||
|
// postdata.Data = JSON.stringify(postdata.Data)
|
||||||
|
let objData = { |
||||||
|
id: "", |
||||||
|
data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, |
||||||
|
version: this.canvasData.selectPanelPoint.Version || "2.0", |
||||||
|
disposalNodeId: data.id, |
||||||
|
planComponentId: sessionStorage.getItem("planId"), |
||||||
|
} |
||||||
|
|
||||||
|
this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存成功','确定',config) |
||||||
|
|
||||||
|
},err=>{ |
||||||
|
const config = new MatSnackBarConfig(); |
||||||
|
config.verticalPosition = 'top'; |
||||||
|
config.duration = 3000 |
||||||
|
this.snackBar.open('保存失败','确定',config) |
||||||
|
}) |
||||||
|
this.dialogRef.close(); |
||||||
|
this.canvasData.sendMessage("send a message") |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
<div mat-dialog-title>处置节点保存</div> |
||||||
|
<div style="display: flex;"> |
||||||
|
<button mat-stroked-button style="margin-right: 5px;" (click)="saveType('new')">新建节点并保存</button> |
||||||
|
<button mat-stroked-button (click)="saveType('old')">保存到已有节点</button> |
||||||
|
</div> |
@ -0,0 +1,53 @@ |
|||||||
|
<div *ngIf="type == 'new'"> |
||||||
|
<div mat-dialog-title>新增节点</div> |
||||||
|
<div> |
||||||
|
<form (ngSubmit)="onSubmit(form.value,'new')" #form="ngForm" class="example-container"> |
||||||
|
|
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<input type="text" matInput ngModel |
||||||
|
required name="name" placeholder="节点名称" autocomplete="off"> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<mat-select [(value)]="allRootDisposalNode[0].name" required placeholder="父节点名称"> |
||||||
|
<mat-option *ngFor="let item of allRootDisposalNode" [value]="item.name" (click)="clickNode(item)"> |
||||||
|
{{item.name}} |
||||||
|
</mat-option> |
||||||
|
</mat-select> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-actions> |
||||||
|
<button mat-raised-button color="primary" type="submit" |
||||||
|
[disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div *ngIf="type == 'old'"> |
||||||
|
<div mat-dialog-title>保存到已有节点</div> |
||||||
|
<div> |
||||||
|
<form (ngSubmit)="onSubmit(form.value,'old')" #form="ngForm" class="example-container"> |
||||||
|
<div mat-dialog-content> |
||||||
|
<mat-form-field> |
||||||
|
<mat-select required ngModel placeholder="父节点名称" name="nodeId"> |
||||||
|
<mat-option *ngFor="let item of allPlanDisposalNode" [value]="item.id" (click)="clickNode(item)"> |
||||||
|
{{item.name}} |
||||||
|
</mat-option> |
||||||
|
</mat-select> |
||||||
|
</mat-form-field> |
||||||
|
</div> |
||||||
|
<div mat-dialog-actions> |
||||||
|
<button mat-raised-button color="primary" type="submit" |
||||||
|
[disabled]="!form.form.valid"> |
||||||
|
确定 |
||||||
|
</button> |
||||||
|
<button mat-raised-button mat-dialog-close>取消</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,24 @@ |
|||||||
|
<div style="position: relative;width: 1400px;height: 800px;line-height: 800px;" class="swiper-container"> |
||||||
|
<div style="position: absolute;right: -2px;top: -392px;cursor: pointer;z-index: 999;width: 24px;height: 24px;" (click)="closeDialog()"> |
||||||
|
<span><mat-icon>clear</mat-icon></span> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="swiper-wrapper"> |
||||||
|
<div class="swiper-slide" style="text-align: center;" *ngFor="let img of imagesArr"> |
||||||
|
<img id="bigimg" (mousewheel)="zoomimg($event)" style=" |
||||||
|
max-width: 96%; |
||||||
|
max-height: 100%; |
||||||
|
min-width: 1px; |
||||||
|
min-height: 1px; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
bottom: 0; |
||||||
|
right: 0; |
||||||
|
margin: auto;" [src]="img.PropertyValue" alt=""> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- 如果需要导航按钮 --> |
||||||
|
<div class="swiper-button-next"></div> |
||||||
|
<div class="swiper-button-prev"></div> |
||||||
|
</div> |
Loading…
Reference in new issue