邵佳豪 4 years ago
parent
commit
a12c15b4db
  1. 5
      src/app/app.component.html
  2. 12
      src/app/app.component.scss
  3. 10
      src/app/app.component.ts
  4. 4
      src/app/app.module.ts
  5. 2
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  6. 16
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  7. 18
      src/app/key-unit/edit-unit-info/edit-unit-info.component.html
  8. 3
      src/app/key-unit/key-unit.module.ts
  9. 64
      src/app/key-unit/router-gis/router-gis.component.html
  10. 123
      src/app/key-unit/router-gis/router-gis.component.scss
  11. 176
      src/app/key-unit/router-gis/router-gis.component.ts
  12. 18
      src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html
  13. 16
      src/app/key-unit/view-unit-details/view-unit-details.component.html
  14. 56
      src/app/key-unit/water-road/water-road.component.html
  15. 59
      src/app/key-unit/water-road/water-road.component.scss
  16. 237
      src/app/key-unit/water-road/water-road.component.ts
  17. 18
      src/app/mask-layer.service.ts
  18. 46
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  19. 2
      src/app/plan-audit/wait-examineer/wait-examineer.component.scss
  20. 109
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  21. 1
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  22. 4
      src/app/plan-management/meet-plan/meet-plan.component.html
  23. 7
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
  24. 3
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
  25. 4
      src/app/plan-management/type-plan/type-plan.component.html
  26. 17
      src/app/ui/collection-tools-plan/collection-tools.component.html
  27. 115
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  28. 7
      src/app/ui/collection-tools-plan/save.ts
  29. 17
      src/app/ui/collection-tools/collection-tools.component.html
  30. 159
      src/app/ui/collection-tools/collection-tools.component.ts
  31. 19
      src/app/ui/collection-tools/save.ts

5
src/app/app.component.html

@ -1 +1,4 @@
<router-outlet></router-outlet>
<router-outlet></router-outlet>
<div class="maskLayer" *ngIf="isMaskLayerShow">
<mat-spinner [diameter]='50'></mat-spinner>
</div>

12
src/app/app.component.scss

@ -0,0 +1,12 @@
.maskLayer{
position: absolute;
left: 0;
top: 0;
z-index: 2000;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.2);
display: flex;
justify-content: center;
align-items: center;
}

10
src/app/app.component.ts

@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http'
import { Data } from './interface'
import { Router,ActivatedRoute } from '@angular/router'
import {CacheTokenService} from './http-interceptors/cache-token.service'//引入服务
import { MaskLayerService } from './mask-layer.service';
@ -13,9 +14,16 @@ import {CacheTokenService} from './http-interceptors/cache-token.service'//引
})
export class AppComponent {
constructor(private http:HttpClient,private router:Router,public token:CacheTokenService) { }
constructor(private maskLayerService:MaskLayerService,private http:HttpClient,private router:Router,public token:CacheTokenService) { }
isMaskLayerShow:boolean = false
ngOnInit(): void {
//监听遮罩层
this.maskLayerService.getMessage().subscribe((message: any)=>{
this.isMaskLayerShow = message
});
var token = sessionStorage.getItem("token");
var refreshToken = sessionStorage.getItem("refreshToken");
if(token && refreshToken) {

4
src/app/app.module.ts

@ -21,6 +21,7 @@ import { MTokenK1Component } from './m-token-k1/m-token-k1.component' //K1秘钥
import { CountdownModule } from 'ngx-countdown'; //倒计时插件
import { GISManagementModule } from './gis-management/gis-management.module';
import { DataCollectionModule } from './data-collection/data-collection.module';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@NgModule({
declarations: [
@ -42,7 +43,8 @@ import { DataCollectionModule } from './data-collection/data-collection.module';
HttpClientModule,
CountdownModule,
GISManagementModule,
DataCollectionModule
DataCollectionModule,
MatProgressSpinnerModule
],
providers: [httpInterceptorProviders, CacheTokenService,TreeService],
bootstrap: [AppComponent]

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

@ -387,7 +387,7 @@ export class GisLabelingComponent implements OnInit {
// 创建一个 Icon
let startIcon = new AMap.Icon({
image: '../../../assets/images/fireHydrant.png',
imageSize: new AMap.Size(32, 32),
imageSize: new AMap.Size(20, 20),
});
positonList.forEach((item,index)=>{
let marker = new AMap.Marker({

16
src/app/key-unit/edit-plan-info/edit-plan-info.component.html

@ -32,17 +32,27 @@
<app-function-division></app-function-division>
</ng-template>
</mat-tab>
<mat-tab label="7.实景图">
<mat-tab label="7.行车路线">
<ng-template matTabContent>
<app-router-gis></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="8.周边水源">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="9.实景图">
<ng-template matTabContent>
<app-realistic-picture></app-realistic-picture>
</ng-template>
</mat-tab>
<mat-tab label="8.上传CAD">
<mat-tab label="10.上传CAD">
<ng-template matTabContent>
<app-uploading-cad></app-uploading-cad>
</ng-template>
</mat-tab>
<!-- <mat-tab label="9.unity平面图">
<!-- <mat-tab label="11.unity平面图">
<ng-template matTabContent>
<iframe id="main" src="/unityApp2Basic/index.html" name="unityApp" frameborder="0" width="96%" height="100%" style="margin-left: 2%;"></iframe>
</ng-template>

18
src/app/key-unit/edit-unit-info/edit-unit-info.component.html

@ -31,22 +31,32 @@
<app-function-division></app-function-division>
</ng-template>
</mat-tab>
<mat-tab label="6.实景图">
<mat-tab label="6.行车路线">
<ng-template matTabContent>
<app-router-gis></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="7.周边水源">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="8.实景图">
<ng-template matTabContent>
<app-realistic-picture></app-realistic-picture>
</ng-template>
</mat-tab>
<mat-tab label="7.上传CAD">
<mat-tab label="9.上传CAD">
<ng-template matTabContent>
<app-uploading-cad></app-uploading-cad>
</ng-template>
</mat-tab>
<mat-tab label="8.作战部署">
<mat-tab label="10.作战部署">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
</ng-template>
</mat-tab>
<!-- <mat-tab label="9.unity作战部署">
<!-- <mat-tab label="11.unity作战部署">
<ng-template matTabContent>
<iframe id="main" src="/unityApp2/index.html" name="unityApp" frameborder="0" width="100%" height="98%"></iframe>
</ng-template>

3
src/app/key-unit/key-unit.module.ts

@ -137,7 +137,8 @@ import { upname } from './key-unit-management/key-unit-management.component'
FormsModule,
CountdownModule,
FileUploadModule,
UiModule
UiModule,
ReactiveFormsModule,
]
})
export class KeyUnitModule { }

64
src/app/key-unit/router-gis/router-gis.component.html

@ -1,7 +1,63 @@
<div class="content">
<div class="center" id="center"></div>
<div class="btnbox">
<div class="btn" (click)="next()">已到达熟悉单位</div>
<div (click)="back()">取消本次任务</div>
<div class="map" id="map"></div>
<!-- 导航路线 -->
<div class="routeGIS">
<div class="routeHeader">
<label style="bottom: 8px; left: 38px;" class="routeGISPublicIcon" (click)='clearGISRoute()'>清除路线</label>
<label style="bottom: 8px; left: 275px;" class="routeGISPublicIcon" (click)='queryGISRoute()'>查询</label>
<div class="routeLeft" (click)='exchangeGISRoute()'><mat-icon>import_export</mat-icon></div>
<div class="routeContent">
<div class="routeEveryRow">
<label class="routeText"></label>
<input type="text" list="start" [(ngModel)]="routeStart" (ngModelChange)="routeChange(0)">
<datalist id="start">
<option *ngFor="let item of routeStartList" value="{{item.district}} {{item.name}}">
</datalist>
<label class="routeClear" *ngIf="routeStart" (click)='deleteSearchGIS(0)'>×</label>
</div>
<div class="routeEveryRow">
<label class="routeText"></label>
<input type="text" list="end" [(ngModel)]="routeEnd" (ngModelChange)="routeChange(1)">
<datalist id="end">
<option *ngFor="let item of routeEndList" value="{{item.district}} {{item.name}}">
</datalist>
<label class="routeClear" *ngIf="routeEnd" (click)='deleteSearchGIS(1)'>×</label>
</div>
</div>
</div>
<div class="routeCenter" *ngIf="routes.steps.length">
<div style="text-align: center;">
<button class="routeType" [ngClass]="{'selectRouteType': selectType}" (click)='toggleRoute(true)'>推荐方案</button>
<button class="routeType" [ngClass]="{'selectRouteType': !selectType}" (click)='toggleRoute(false)'>躲避拥堵</button>
</div>
<div class="routeTypeExplain" style="text-align: center; font-weight: 550;">
<label>约{{ routes.time / 60 | number:'0.0-0' }}分钟</label>
<label>{{ routes.distance / 1000 | number:'0.1-1' }}公里</label>
</div>
<div class="routeTypeExplain" style="color: rgb(176, 180, 184); margin-top: -10px;">
<label>途径</label>
<span *ngFor="let item of routes.steps">{{item.road? item.road + '>' : null}}</span>
</div>
<div class="routeCenterTB" title="{{routeStart}}">
<p style="background-color: #0080FF;"></p><label style="font-weight: 550;">{{routeStart}}</label>
</div>
<div class="routeCenterTB" *ngFor="let item of routes.steps" style="border-bottom: 1px solid rgb(223, 212, 212);" title="{{item.instruction}}">
<p class="orientation" *ngIf="item.orientation == '西'"></p>
<p class="orientation" *ngIf="item.orientation == '北'"></p>
<p class="orientation" *ngIf="item.orientation == '东'"></p>
<p class="orientation" *ngIf="item.orientation == '南'"></p>
<p class="orientation" *ngIf="item.orientation == '西北'"></p>
<p class="orientation" *ngIf="item.orientation == '西南'"></p>
<p class="orientation" *ngIf="item.orientation == '东北'"></p>
<p class="orientation" *ngIf="item.orientation == '东南'"></p>
<label>{{item.instruction}}</label>
</div>
<div class="routeCenterTB" title="{{routeEnd}}">
<p style="background-color: rgb(250, 21, 21);"></p><label style="font-weight: 550;">{{routeEnd}}</label>
</div>
</div>
</div>
<!-- 导航路线 -->
</div>

123
src/app/key-unit/router-gis/router-gis.component.scss

@ -2,34 +2,111 @@
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 3px;
padding: 1px;
overflow: hidden;
position: relative;
.center {
.map { width: 100%; height: 100%; }
}
//文本溢出
.overflowText {
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.mat-icon, label, button, p, span {cursor:pointer;}
//左侧导航路线
.routeGIS {
width: 340px;
max-height: 700px;
overflow: hidden;
position: absolute;
border-radius: 10px;
background-color: #0080FF;
left: 30px;
top: 15px;
z-index: 6;
display: flex;
flex-direction: column;
.routeHeader {
width: 100%;
height: 740px;
}
.btnbox{
position: absolute;
left: 50%;
bottom: 7%;;
transform: translateX(-50%);
height: 130px;
min-height: 130px;
position: relative;
display: flex;
div{
align-items: center;
justify-content: center;
.routeLeft {
width: 26px;
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;
margin: 0 5px;
box-sizing: border-box;
.mat-icon { font-size: 24px; color: #fff; }
}
.routeContent {
flex: 1;
//起点终点 input
.routeEveryRow {
position: relative;
height: 30px;
margin: 3px 0;
label { position: absolute; color: #fff; }
.routeText {
font-size: 14px;
top: 5.5px;
left: 5px;
}
.routeClear {
top: 0px;
right: 18px;
font-size: 20px;
}
input {
width: 80%;
padding-left: 25px;
height: 30px;
border-radius: 5px;
border: none;
outline: none;
color: #fff;
background-color: #0874DE;
}
}
}
.btn{
background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%);
color: #fff;
}
//导航内容区
.routeCenter::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
.routeCenter {
width: 100%;
overflow-y: auto;
scrollbar-width: none; /* Firefox */
box-sizing: border-box;
background-color: #fff;
border-radius: 0 0 10px 10px;
border: 1px solid rgb(201, 197, 197);
>div {
width: 100%;
height: 30px;
line-height: 30px;
box-sizing: border-box;
margin: 5px 0;
font-size: 12px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
} //div
>div:not(:first-child){ padding: 0 10px; box-sizing: border-box; }
.routeTypeExplain label { margin: 0 10px; }
.routeCenterTB {
p { display: inline-block; margin-right: 10px; width: 30px; height: 30px; border-radius: 50%; color: #fff; text-align: center; font-size: 14px; }
.orientation { color: #0080FF; }
}
}
}
}
.routeGISPublicIcon { position: absolute; color: #fff; font-size: 14px; } //导航 定位部分公共样式
//选择路线 方案 button
.routeType { margin: 0 10px; outline: none; border: none; background-color: transparent; font-size: 14px; font-weight: 550; color: rgb(122, 116, 116); }
.selectRouteType { color: #0080FF; }

176
src/app/key-unit/router-gis/router-gis.component.ts

@ -1,4 +1,5 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, NgZone, OnInit, Output } from '@angular/core';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
declare var AMap: any;
@Component({
@ -8,53 +9,158 @@ declare var AMap: any;
})
export class RouterGISComponent implements OnInit {
@Output() onCustomEvent: EventEmitter<any> = new EventEmitter();//创建实力
constructor() { }
constructor(public _ngZone:NgZone,public snackBar: MatSnackBar,) { }
ngOnInit(): void {
window.setTimeout(()=>{
this.mapInit()
},0)
}
ngAfterViewInit(): void {
}
//地图初始化
mapInit () {
console.log("ditu")
//创建地图
let map = new AMap.Map('center', {
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,
let that = this
var layer = new AMap.createDefaultLayer({
zooms:[3,20], //可见级别
visible:true, //是否可见
opacity:1, //透明度
zIndex:0, //叠加层级
resizeEnable: true //是否监控地图容器尺寸变化,
})
that.map = new AMap.Map('map',{
layers:[layer], //当只想显示标准图层时layers属性可缺省,
});
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:'山东'}], //路线可搜索, 可用坐标
that.map.setCity('上海市');
}
//下一步
next(){
this.emitEvent()
map:any; //地图实例
routeStart:any; //起点
routeStartList:any = [] //起点 搜索结果
routeEnd:any; //终点
routeEndList:any = [] //终点 搜索结果
timeout:any; //延时器
routeGIS:any; //查询结果 规划路线
selectType:boolean = true; //路线选择 推荐方案/躲避用拥堵
//输入框 输入事件
routeChange (e) {
let that = this
window.clearTimeout(this.timeout)
this.timeout = window.setTimeout(()=>{
that.map.getCity( function(info){ //获取当前 city
AMap.plugin(['AMap.AutoComplete'], () =>{
var autoOptions = {city: info.city}
let keywords
e == 0 ? keywords = that.routeStart : keywords = that.routeEnd
var autoComplete = new AMap.Autocomplete(autoOptions);
autoComplete.search(keywords, function(status, result) {
if (result && result.tips && result.tips.length) { //搜索到数据时
that._ngZone.run(()=>{
if(e == 0){
that.routeStartList = result.tips
that.startCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
}else{
that.routeEndList = result.tips
that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
}
});
} //if
})
})
}); //获取当前 city
},500)
}
private emitEvent(){
this.onCustomEvent.emit('data from child');//通过emit可将需要传递的数据发送给父组件
//清空导航输入框
deleteSearchGIS (e) {
if (e==0) {
this.routeStart = null
this.routeStartList = []
this.startCoordinate = null
} else {
this.routeEnd = null
this.routeEndList = []
this.endCoordinate = null
}
}
//取消
back(){
window.history.back();
//清除路线
clearGISRoute () {
this.routeStart = null
this.routeStartList = []
this.routeEnd = null
this.routeEndList = []
this.startCoordinate = null
this.endCoordinate = null
this.routeGIS? this.routeGIS.clear() : null
this.routes = { distance: 0, time: 0, steps: [], }
this.map.setCity('上海市'); //设置地图中心点
}
//交换起始点
exchangeGISRoute () {
let data = this.routeStart
this.routeStart = this.routeEnd
this.routeEnd = data
this.routeStartList = []
this.routeEndList = []
let data2 = this.startCoordinate
this.startCoordinate = this.endCoordinate
this.endCoordinate = data2
}
routes:any = { distance: 0, time: 0, steps: [], };//导航查询结果 路线规划
startCoordinate:any//开始坐标
endCoordinate:any//结束坐标
//导航查询
queryGISRoute () {
if (this.startCoordinate && this.endCoordinate) {
//构造路线导航类
let that = this
this.selectType = true
this.routeGIS? this.routeGIS.clear() : null
this.routeGIS = new AMap.Driving({
map: this.map,
});
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {
that.routes = result.routes[0]
} else { alert('获取驾驶规划路线失败') }
}
);
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择起始点','确定',config);
}
}
//切换 导航模式 推荐方案/躲避拥堵
toggleRoute (e) {
let that = this
if (this.selectType != e) {
this.selectType = e
this.routeGIS? this.routeGIS.clear() : null
this.routeGIS = new AMap.Driving({
map: this.map,
policy: e==true? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC
});
// 根据起终点名称规划驾车导航路线
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {
that.routes = result.routes[0]
} else { alert('获取驾驶规划路线失败') }
}
);
}
}
}

18
src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html

@ -24,22 +24,32 @@
<app-function-division-look></app-function-division-look>
</ng-template>
</mat-tab>
<mat-tab label="6.实景图">
<mat-tab label="6.行车路线">
<ng-template matTabContent>
<app-router-gis></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="7.周边水源">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="8.实景图">
<ng-template matTabContent>
<app-realistic-picture-look></app-realistic-picture-look>
</ng-template>
</mat-tab>
<mat-tab label="7.上传CAD">
<mat-tab label="9.上传CAD">
<ng-template matTabContent>
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<mat-tab label="8.作战部署">
<mat-tab label="10.作战部署">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
</ng-template>
</mat-tab>
<!-- <mat-tab label="9.unity作战部署">
<!-- <mat-tab label="11.unity作战部署">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
<iframe id="main" src="/unityApp2/index.html" name="unityApp" frameborder="0" width="100%" height="98%"></iframe>

16
src/app/key-unit/view-unit-details/view-unit-details.component.html

@ -29,17 +29,27 @@
<app-function-division-look></app-function-division-look>
</ng-template>
</mat-tab>
<mat-tab label="7.实景图">
<mat-tab label="7.行车路线">
<ng-template matTabContent>
<app-router-gis></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="8.周边水源">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="9.实景图">
<ng-template matTabContent>
<app-realistic-picture-look></app-realistic-picture-look>
</ng-template>
</mat-tab>
<mat-tab label="8.上传CAD">
<mat-tab label="10.上传CAD">
<ng-template matTabContent>
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<!-- <mat-tab label="9.unity平面图">
<!-- <mat-tab label="11.unity平面图">
<ng-template matTabContent>
<iframe id="main" src="/unityApp2Basic/index.html" name="unityApp" frameborder="0" width="96%" height="100%" style="margin-left:2%;"></iframe>
</ng-template>

56
src/app/key-unit/water-road/water-road.component.html

@ -1,19 +1,45 @@
<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 class="center" id="center"></div>
<!-- 右上角 -->
<div class="rightTopBox">
<div class="contantbox">
<div class="waterBox">
<form [formGroup]="watertForm" class="inputList" (submit)='waterSubmit(watertForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedWater" (change)="selectedAllWater($event)">全选</mat-checkbox>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let water of waters.controls;let i = index" color="primary" [formControl]="water">{{waterList[i].name}}</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaWater" [(ngModel)]="waterAreaDefault">
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit">确定</button>
<button class="cancel" type="button" (click)="resetWater()">取消显示</button>
</div>
</form>
</div>
</div>
</div>
<!-- 右上角 -->
</div>

59
src/app/key-unit/water-road/water-road.component.scss

@ -78,4 +78,61 @@
background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%);
}
}
}
}
//右上角div
.rightTopBox{
width: 480px;
position: absolute;
left: 30px;
top: 15px;
.contantbox{
width: 100%;
background: #fff;
margin-top: 3px;
border-radius: 6px;
.keyUnitBox,.waterBox,.coverageBox{
box-sizing: border-box;
padding:8px 15px;
font-size: 14px;
color: #333333;
}
.inputList{
.inputItem{
margin-top: 8px;
display: flex;
flex-wrap: wrap;
mat-checkbox{
margin-right: 15px;
}
}
.btnbox{
display: flex;
align-items: center;
justify-content: space-between;
button{
cursor: pointer;
}
.submit{
width: 68px;
height: 30px;
text-align: center;
border: 0;
background: #0080FF;
opacity: 1;
border-radius: 4px;
color: #fff;
}
.cancel{
width: 96px;
height: 30px;
background: #EEF1F5;
opacity: 1;
border-radius: 4px;
border: 0;
color: #333333;
}
}
}
}
}

237
src/app/key-unit/water-road/water-road.component.ts

@ -1,7 +1,8 @@
import { Component, Inject, OnInit } from '@angular/core';
import { Component, ElementRef, Inject, OnInit, Renderer2 } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
declare var AMap: any;
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
declare var AMap: any;
@Component({
selector: 'app-water-road',
@ -10,108 +11,172 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
})
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);
}
constructor(public renderer2: Renderer2,public snackBar: MatSnackBar,public dialog: MatDialog,private fb: FormBuilder) { }
map:any //地图
markers:any = [{_position: [121.472644,31.231706]}] //当前单位坐标
watertForm:FormGroup //gis右上角水源表单
waterList = [
{id:'0',name:'消火栓',selected:false},
{id:'1',name:'消防水池',selected:false},
{id:'2',name:'天然水源',selected:false},
]
waterAreaDefault:any = '0' //默认水源范围
selectedWaterList:any = [] //选择提交的水源
//地图范围圆圈---水源
circleofwater = new AMap.Circle({
center: null,
radius: 0, //半径
strokeOpacity: 1,
fillOpacity: 0.4,
strokeStyle: 'dashed',
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#ee2200',
zIndex: 50,
})
ngOnInit(): void {
this.watertForm = this.fb.group({
waters:this.waterUnits(),
allSelectedWater:new FormControl(),
areaWater:new FormControl()
})
this.waters.valueChanges.subscribe(values => {
let selects:string[] = []
values.forEach((selected:boolean,i:number) => {
selected === true && selects.push(this.waterList[i].id)
});
this.selectedWaterList = selects
})
this.waterList.forEach(item => {
if(item.selected){
this.selectedWaterList.push(item.name)
}
})
setTimeout(() => {
this.creatMap()
}, 0);
}
get waters():any{
return this.watertForm.get('waters')
}
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)
//全选水源
selectedAllWater(event){
if(event.checked){
this.waters.controls.forEach(item => {item.setValue(true)})
}else{
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0')
}
}
//水源提交
waterSubmit(value){
if(this.markers.length == 0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先选择一个单位','确定',config);
}else{
this.createwaterMarker()
this.circleofwater.setRadius(Number(this.waterAreaDefault))
this.circleofwater.setCenter(this.markers[0]._position)
this.circleofwater.setMap(this.map)
if(this.waterAreaDefault == '0'){
this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds())/2)
}
}
}
waterIconList = []; //展示的水源图标
//循环渲染出所有水源markers
createwaterMarker(){
this.waterIconList.forEach((element,index) => { this.map.remove(element) }); //先删除所有标点
this.waterIconList = []
let waterType = this.selectedWaterList //筛选出展示的 水源类型
if (waterType.length) {
let x = JSON.parse( JSON.stringify(this.markers[0]._position[0]) ) //中心标注的 坐标
let y = JSON.parse( JSON.stringify(this.markers[0]._position[1]) ) //中心标注的 坐标
let positonList = [0.015, -0.035, 0.045, 0.061, -0.013, 0.029]
// 创建一个 Icon
let startIcon = new AMap.Icon({
image: '../../../assets/images/fireHydrant.png',
imageSize: new AMap.Size(20, 20),
});
positonList.forEach((item,index)=>{
let marker = new AMap.Marker({
map: this.map,
position: index%2==0? JSON.parse( JSON.stringify([x+item,y-item]) ) : JSON.parse( JSON.stringify([x-item,y+item]) ),
icon: startIcon,
});
this.waterIconList.push(marker)
})
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())
});
positonList.forEach((item,index)=>{
let marker = new AMap.Marker({
map: this.map,
position: index%2==0? JSON.parse( JSON.stringify([x+item,y+item]) ) : JSON.parse( JSON.stringify([x-item,y-item]) ),
icon: startIcon,
});
this.waterIconList.push(marker)
})
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择水源类型','确定',config);
}
}
// this.map.setCity('南宁市')
this.map.add(Arr);//火源标点
//取消显示水源
resetWater(){
this.waterIconList.forEach((element,index) => { this.map.remove(element) }); //先删除所有标点
this.waterIconList = []
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0')
this.map.remove(this.circleofwater)
}
//计算两地距离
Calculationofdistance(bounds){
let p1 = [bounds.northEast.lng, bounds.northEast.lat];
let p2 = [bounds.northEast.lng, bounds.southWest.lat];
// 返回 p1 到 p2 间的地面距离,单位:米
let dis = AMap.GeometryUtil.distance(p1, p2);
return dis
}
//构造水源checkbox控制器
waterUnits() {
const arr = this.waterList.map(item => {
return this.fb.control(item.selected);
});
return this.fb.array(arr);
}
opendialog(){
let dialogRef = this.dialog.open(EditText);
dialogRef.afterClosed().subscribe(data=>{
if(data){
}
});
//地图初始化
creatMap(){
let that = this
var layer = new AMap.createDefaultLayer({
zooms:[3,20], //可见级别
visible:true, //是否可见
opacity:1, //透明度
zIndex:0, //叠加层级
resizeEnable: true //是否监控地图容器尺寸变化,
})
that.map = new AMap.Map('center',{
layers:[layer], //当只想显示标准图层时layers属性可缺省,
});
that.map.setCity('上海市');
}
}
}
//编辑水源道路情况
@Component({
selector: 'app-editBuilding',

18
src/app/mask-layer.service.ts

@ -0,0 +1,18 @@
import { Injectable } from '@angular/core';
import {ReplaySubject} from "rxjs";
import { Observable } from "rxjs";
@Injectable({
providedIn: 'root'
})
export class MaskLayerService {
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
/** * *
* @param message * @returns {Observavle<any>} */
public sendMessage(message: any) {
this._sendMessage.next(message);
}
public getMessage(): Observable <any> {
return this._sendMessage.asObservable();
}
constructor() { }
}

46
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -4,22 +4,22 @@
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="headdiv" style="margin-top: 30px;">
<span>操作类型:</span>
<!-- <input type="radio" name="level" value="1"><span>全部</span>
<input type="radio" name="level" style="margin-left: 50px;" value="2"><span>更新</span>
<input type="radio" name="level" style="margin-left: 50px;" value="3"><span>新增</span>
<input type="radio" name="level" style="margin-left: 50px;" value="4"><span>删除</span> -->
<mat-radio-group name='aaa' [(ngModel)]="level" style="position: relative;bottom: 3px;">
<mat-radio-button class='radio' style="margin-left: 3px;" value="1">全部</mat-radio-button>
<mat-radio-button style="margin-left: 20px;height: 10px;" value="2">更新</mat-radio-button>
<mat-radio-button style="margin-left: 20px;" value="3">新增</mat-radio-button>
<mat-radio-button style="margin-left: 20px;" value="4">删除</mat-radio-button>
</mat-radio-group>
<span style="margin-left: 120px;">共计:80</span>
<input type="radio" name="level" value="" [(ngModel)]="level"><span>全部</span>
<input type="radio" name="level" style="margin-left: 50px;" value="1" [(ngModel)]="level"><span>更新</span>
<input type="radio" name="level" style="margin-left: 50px;" value="0" [(ngModel)]="level"><span>新增</span>
<input type="radio" name="level" style="margin-left: 50px;" value="2" [(ngModel)]="level"><span>删除</span>
<!-- <mat-radio-group name='aaa' [(ngModel)]="level" style="position: relative;bottom: 3px;">
<mat-radio-button class='radio' style="margin-left: 3px;" value="" >全部</mat-radio-button>
<mat-radio-button style="margin-left: 20px;height: 10px;" value="1">更新</mat-radio-button>
<mat-radio-button style="margin-left: 20px;" value="0">新增</mat-radio-button>
<mat-radio-button style="margin-left: 20px;" value="2">删除</mat-radio-button>
</mat-radio-group> -->
<span style="margin-left: 100px;">共计:{{count}}</span>
</div>
<div class="headthree">
<span>类型:</span>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="projectlevel">
<mat-option value="1">Ⅰ级预案</mat-option>
<mat-option value="2">Ⅱ级预案</mat-option>
<mat-option value="3">Ⅲ级预案</mat-option>
@ -32,12 +32,12 @@
</mat-form-field>
<span style="margin-left: 30px;">编制级别:</span>
<mat-form-field>
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="projectlevel">
<mat-select name="preparelevel" placeholder='请选择编制级别' [(ngModel)]="PlanLevel">
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<button mat-raised-button color="primary" style="margin-left: 40px;" type="submit" >查询</button>
<button mat-raised-button color="primary" style="margin-left: 20px;"><img src="../../../assets/images/refresh.png" (click)='record()' > 刷新</button>
<button mat-raised-button color="primary" style="margin-left: 20px;" (click)='record()'><img src="../../../assets/images/refresh.png" > 刷新</button>
</div>
</form>
@ -54,15 +54,17 @@
</table>
<div class="tbodycss" id="tbodydiv" >
<table cellspacing="0" cellpadding="0" id="table" >
<tr *ngFor="let item of tableDate;let key = index" (click)='tableClick($event,key)'>
<tr *ngFor="let item of tableDate;let key = index" >
<td style="width: 15%;">
<mat-checkbox color="primary" ></mat-checkbox>
{{item.contentType=='3'?'预案':''}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.option == '更新','red':item.option == '删除','blue':item.option == '新增'}">{{item.option}}</td>
<input type="radio" name="yuan" value={{item.id}} [(ngModel)]="checked" (click)='radioClick(item)'>
{{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'?
'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':'消防车辆'}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td>
<td style="width: 15%;">{{item.verifyOrganizationName}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.unitstate == '已通过','red':item.unitstate == '已拒绝'}">{{item.verifyState}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'?
'初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}}</td>
<td style="width: 15%;">{{item.creatorName}}</td>
<td style="width: 25%;">{{item.verifyTime|date:'yyyy-MM-dd'}}</td>
<td style="width: 25%;">{{item.createTime|date:'yyyy-MM-dd'}}</td>
</tr>
</table>
</div>
@ -79,8 +81,8 @@
<button mat-raised-button *ngIf="isallDate" style="background-color: #FFCC00; color: #FFFFFF;" (click)="preview()"><img src="../../../assets/images/change.png" style="margin-bottom: 2px;" > 预览得分</button>
</div>
<div class="rightheadtwo">
<button mat-raised-button style="color: #FFFFFF;background-color: #FF7161;float: right;">拒绝</button>
<button mat-raised-button style="color: #FFFFFF;background-color: #38D984;float: right;">同意</button>
<button mat-raised-button style="color: #FFFFFF;background-color: #FF7161;float: right;" (click)='refuse()'>拒绝</button>
<button mat-raised-button style="color: #FFFFFF;background-color: #38D984;float: right;" (click)='agree()'>同意</button>
</div>
</div>

2
src/app/plan-audit/wait-examineer/wait-examineer.component.scss

@ -19,7 +19,7 @@
}
span{
font-size: 16px;
//margin-left: 3px;
margin-left: 3px;
}
input{
margin-left: 15px;

109
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -4,10 +4,11 @@
* @Author: sueRimn
* @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-18 11:07:46
* @LastEditTime: 2021-01-19 14:29:15
*/
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { HttpClient } from '@angular/common/http'
declare var echarts: any;
@ -18,7 +19,7 @@ declare var echarts: any;
})
export class WaitExamineerComponent implements OnInit {
constructor(private http:HttpClient) { }
constructor(private http:HttpClient,public snackBar: MatSnackBar) { }
ngOnInit(): void {
let level = sessionStorage.getItem("level");
@ -29,28 +30,28 @@ export class WaitExamineerComponent implements OnInit {
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
this.PlanLevel=1
this.PlanLevel=0
}
if(level == "1"){//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{name:"支队",value:"1"},
{name:"大队",value:"2"},
{name:"中队",value:"3"}
]
this.PlanLevel=2
this.PlanLevel=1
}
if(level == "2"){//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
this.PlanLevel=4
this.PlanLevel=2
}
if(level == "3"){//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
]
this.PlanLevel=8
this.PlanLevel=3
}
var scrollflaga = true;
var win=document.getElementById('tbodydiv')
@ -75,10 +76,10 @@ export class WaitExamineerComponent implements OnInit {
preparelevels:any
selected = new FormControl(0); //选项卡 实例
level//类型
level=''//操作类型
js//组织机构
addtime//时间
projectlevel//编制级别
projectlevel//预案级别
previewshow=false//预览得分是否显示
tableDate
isallDate=true//是否显示完成数据,默认显示
@ -86,42 +87,108 @@ export class WaitExamineerComponent implements OnInit {
indexbar //饼状图实例
indexzhu
PlanLevel//编制级别
count//一共多少条
checked//是否选中
chuorzhong//判断初审还是终审
radioid//选中的id
//获取表格数据
getAlltabledate(){
let paramsdata:any = {
VerifyType:3,
ContentType:Number(this.level)||'',
Level:this.PlanLevel||''
Operation:this.level||[],
ContentType:Number(this.projectlevel)||[],
Level:this.PlanLevel||[],
verifyState:[0,3]
}
this.http.get("/api/ContentVerifies",{params:paramsdata}).subscribe((data:any)=>{
console.log(data)
//console.log(data)
this.tableDate=data.items
this.count=data.totalCount
})
}
//提交查询
onSubmit(value){
console.log(value)
//console.log(value)
this.getAlltabledate()
}
//刷新
record(){
this.level=''
this.PlanLevel=''
this.projectlevel=''
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
this.PlanLevel=0
}
if(level == "1"){//如果是支队
this.PlanLevel=1
}
if(level == "2"){//如果是大队
this.PlanLevel=2
}
if(level == "3"){//如果是中队
this.PlanLevel=3
}
this.getAlltabledate()
}
//表格点击事件
tableClick(e,key){
//radio点击事件
radioClick(item){
//e.target.parentElement.bgColor='#2196F3'
console.log(e)
console.log(item)
this.chuorzhong=item.verifyState
this.radioid=item.itemId
}
//变更数据和全部数据切换按钮
buttonChange(){
this.isallDate=!this.isallDate
this.previewshow=false
}
//同意操作
agree(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.chuorzhong==2){
this.snackBar.open('审核未通过,请修改后再来审核!','确定',config);
}
if(this.chuorzhong==0){
this.http.put(`/api/PlanAudits/${this.radioid}/First`,{auditStatus:16}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.checked=''
this.getAlltabledate()
})
}
else if(this.chuorzhong==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:2}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.checked=''
this.getAlltabledate()
})
}
}
//拒绝操作
refuse(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.chuorzhong==2){
this.snackBar.open('审核未通过,请修改后再来审核!','确定',config);
}
if(this.chuorzhong==0){
this.http.put(`/api/PlanAudits/${this.radioid}/First`,{auditStatus:4}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.checked=''
this.getAlltabledate()
})
}
else if(this.chuorzhong==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:4}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.checked=''
this.getAlltabledate()
})
}
}
//分数饼状图
bar(){

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

@ -885,6 +885,7 @@ export class AddPlanone {
name: this.selectedPLanName,
planType:Number(this.selectedPLanType),
planMode: Number(this.defaultisshow),
planCategory: Number(this.selectedPLanLevel),
planLevel: PlanLevel,
url: this.webaddress,
attachmentUrls: null

4
src/app/plan-management/meet-plan/meet-plan.component.html

@ -133,10 +133,10 @@
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;">查看预案</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 2 || element.auditStatus == 4" [ngClass]="{'grey': element.auditStatus == '2'}">提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 4" >提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)' *ngIf="element.auditStatus == 8"> 删除</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

7
src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-15 14:11:36
* @LastEditTime: 2021-01-19 15:01:55
-->
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
@ -133,10 +133,11 @@
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;">查看预案</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 2 || element.auditStatus == 4" [ngClass]="{'grey': element.auditStatus == '2'}">提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 4" [ngClass]="{'grey': element.auditStatus == '2'}">提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
<!-- <span style="color: blue;margin-left: 4px;" *ngIf="element.auditStatus == 2">审核通过</span> -->
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)' *ngIf="element.auditStatus == 8"> 删除</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

3
src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-15 15:05:18
* @LastEditTime: 2021-01-19 14:55:16
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -108,6 +108,7 @@ export class OnetwoEntryPlanComponent implements OnInit {
this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount
this.tabledataSource = data.items
console.log(this.tabledataSource)
})
}

4
src/app/plan-management/type-plan/type-plan.component.html

@ -111,10 +111,10 @@
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;">查看预案</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 2 || element.auditStatus == 4" [ngClass]="{'grey': element.auditStatus == '2'}">提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 4" >提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)='readFile(element)'>下载</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)' *ngIf="element.auditStatus == 8"> 删除</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

17
src/app/ui/collection-tools-plan/collection-tools.component.html

@ -7,14 +7,6 @@
<button mat-button (click)="toggle2()">
<mat-icon style="vertical-align: middle;">list</mat-icon>
</button>
<span style="color: gray;margin-right: 10px;margin-left: 10px;">图标大小</span>
<mat-form-field style="margin-top: 3px;">
<mat-select (selectionChange)='iconScale()' [(ngModel)]="selected">
<mat-option value="1">正常</mat-option>
<mat-option value="2">放大2倍</mat-option>
<mat-option value="4">放大4倍</mat-option>
</mat-select>
</mat-form-field>
<button (click)="copyAsset()" class="copytobutn" mat-button title="复制" style="margin:0 5px;" *ngIf="isEditPattern">
<mat-icon style="padding-bottom: 7px;">library_books</mat-icon>
</button>
@ -35,9 +27,6 @@
<span (click)="baseInfo()" [ngClass]="{'selectedPattern': pattern}">
基本信息编辑
</span>
<!-- <span *ngIf="isSixbtn" (click)="wantWork()" [ngClass]="{'selectedPattern': !pattern}">
想定作业编辑
</span> -->
</div>
<span style="position: absolute;right: 60px;cursor: pointer;">
<mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon>
@ -269,7 +258,7 @@
</div>
</div>
<!-- 如果是多点连线 -->
<div *ngIf="canvasAssetObj.InteractiveMode == 1">
<div *ngIf="canvasAssetObj.InteractiveMode == 1 || canvasAssetObj.InteractiveMode == 3">
<p>厚度</p>
<div style="width: 100%;display: flex;vertical-align: top;height: 22px;">
<input type="number" class="smallinput" [(ngModel)]="sliderValueThickness"
@ -291,7 +280,7 @@
</div>
</div>
<div class="colorDiv" *ngIf="isEditPattern">
<div class="colorDiv" *ngIf="isEditPattern && pattern && canvasAssetObj.GameMode == 0">
<ul>
<li (click)="selectcolor(item,key)" class="colorLi" *ngFor="let item of colors,let key=index" [style]="{'background-color':item}"></li>
</ul>
@ -444,7 +433,7 @@
</div>
<div class="body">
<textarea [disabled]="!isEditPattern" *ngIf="detailsAndattentBtn" name="" id="" rows="10" [(ngModel)]="canvasData.selectPanelPointBaseData.description"></textarea>
<textarea [disabled]="!isEditPattern" *ngIf="!detailsAndattentBtn" name="" id="" rows="10" [(ngModel)]="canvasData.selectPanelPointBaseData.nodes"></textarea>
<textarea [disabled]="!isEditPattern" *ngIf="!detailsAndattentBtn" name="" id="" rows="10" [(ngModel)]="canvasData.selectPanelPointBaseData.notes"></textarea>
</div>
</div>
</div>

115
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -12,12 +12,11 @@ import Swiper from 'swiper';
import { saveOneDialogPlan } from './save';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';
import { windows } from 'src/app/interface';
import { GameMode } from 'src/app/working-area/model/gameMode';
import { ActivatedRoute, Router } from '@angular/router';
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
import { MaskLayerService } from 'src/app/mask-layer.service';
import * as ObjectID from 'bson-objectid';
@Component({
selector: 'app-collection-tools-plan',
@ -28,7 +27,7 @@ export class CollectionToolsPlanComponent implements OnInit {
@ViewChild('canvas',{static: true}) canvas:WorkingAreaComponent; //父组件中获得子组件的引用
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { }
constructor(private maskLayerService:MaskLayerService,private tabbarService: TabbarAndScoreService,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { }
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
// tree配置
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
@ -667,14 +666,11 @@ export class CollectionToolsPlanComponent implements OnInit {
this.canvas.on("deselect",obj=>{
this.isShowProperty = false
})
// 监听canvas组件新增素材事件
this.canvas.on("createIcon",obj=>{
this.renovateTreeData(false)
})
// 监听canvas组件删除素材事件
this.canvas.on("deleteIcon",obj=>{
//监听数据变化后
this.canvas.on('canvasDataChanged',()=>{
// 收到数据表示共享数据发生变化
this.renovateTreeData(false)
})
});
}
copyAssetData:any //存储用于复制的素材
@ -688,6 +684,7 @@ export class CollectionToolsPlanComponent implements OnInit {
let buildingId = this.beforeOneCheckedBuilding.id
let floorId = this.selectingSitePlan.id
this.canvas.paste(companyId,buildingId,floorId)
this.renovateTreeData(false)
}
basicInfo:boolean = true //基本信息名称显隐
@ -726,12 +723,13 @@ export class CollectionToolsPlanComponent implements OnInit {
//保存平面图
saveNum :any = []
saveSite(){
//更新用于统计的数据
this.canvasData.updateBuildingData()
if (this.selectingSitePlan && this.selectingSitePlan.id) {
//打开遮罩层
this.maskLayerService.sendMessage(true)
this.saveNum = []
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData));
SitePlanData.data = JSON.stringify(SitePlanData.data)
@ -754,6 +752,7 @@ export class CollectionToolsPlanComponent implements OnInit {
}
if((new Set(adjoinArr)).size != adjoinArr.length){
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -762,6 +761,7 @@ export class CollectionToolsPlanComponent implements OnInit {
}else{
//如果是单位 总平面图
if(this.checkedBuildingIndex==-1){
// console.log(111,SitePlanData)
//保存平面图数据
this.http.post("/api/SitePlanData",SitePlanData,{
params:{
@ -770,13 +770,16 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -792,13 +795,16 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -815,18 +821,25 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('单位毗邻保存失败','确定',config);
if(err == 'infos 有重复方向!'){
this.snackBar.open('单位毗邻同步失败,存在相同方向','确定',config);
}else{
this.snackBar.open('单位毗邻同步失败','确定',config);
}
})
//批量保存单位重点部位
@ -838,18 +851,21 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('单位重点部位保存失败','确定',config);
this.snackBar.open('单位重点部位同步失败','确定',config);
})
//批量保存单位消防设施素材
@ -861,18 +877,22 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('单位消防设施素材保存失败','确定',config);
this.snackBar.open('单位消防设施素材同步失败','确定',config);
})
}else{ //如果是建筑
@ -885,13 +905,17 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -907,13 +931,17 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -926,18 +954,25 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('建筑毗邻保存失败','确定',config);
if(err == 'infos 有重复方向!'){
this.snackBar.open('建筑毗邻同步失败,存在相同方向','确定',config);
}else{
this.snackBar.open('建筑毗邻同步失败','确定',config);
}
})
//批量保存建筑重点部位
@ -945,18 +980,21 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('建筑重点部位保存失败','确定',config);
this.snackBar.open('建筑重点部位同步失败','确定',config);
})
//批量保存建筑消防设施素材
@ -964,18 +1002,21 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('建筑消防设施素材保存失败','确定',config);
this.snackBar.open('建筑消防设施素材同步失败','确定',config);
})
}
@ -991,7 +1032,7 @@ export class CollectionToolsPlanComponent implements OnInit {
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
// console.log('The dialog was closed');
});
}
@ -1016,10 +1057,10 @@ export class CollectionToolsPlanComponent implements OnInit {
//拖拽tree
drop(e){
console.log(1111,e)
// console.log(1111,e)
}
drop2(e){
console.log(222,e)
// console.log(222,e)
}
//创建建筑
@ -1443,7 +1484,7 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.get('/api/CompanyData',{params:this.params}).subscribe((data:any)=>{
this.canvasData.originalcompanyBuildingData = data || {} // 单位原数据
this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {}
this.canvasData.originalcompanyBuildingData.version? null : this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.companyId? null : this.canvasData.originalcompanyBuildingData.companyId = sessionStorage.getItem('companyId')
resolve('success')
})
@ -1456,7 +1497,7 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.get(`/api/SitePlanData`,{params}).subscribe((data:any)=>{
this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null
this.renovateTreeData()
})
@ -1468,7 +1509,7 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.get(`/api/BuildingData`,{params:e}).subscribe((data:any)=>{
this.canvasData.originalcompanyBuildingData = data || {} // 建筑原数据
this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {}
this.canvasData.originalcompanyBuildingData.version? null : this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.buildingId? null : this.canvasData.originalcompanyBuildingData.buildingId = e.buildingId
resolve('success')
})
@ -1481,7 +1522,7 @@ export class CollectionToolsPlanComponent implements OnInit {
this.http.get(`/api/BuildingAreaData`,{params}).subscribe((data:any)=>{
this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null
this.renovateTreeData()
})
@ -1489,7 +1530,6 @@ export class CollectionToolsPlanComponent implements OnInit {
//点击选中 平面图 楼层/区域 时
selectSitePlan (item,index) {
if (this.selectSitePlanIndex != index) {
this.canvasData.selectPanelPoint = new DisposalNodeData();
if (this.canvasData.isChange) { //true 数据被改动
@ -1703,6 +1743,15 @@ export class CollectionToolsPlanComponent implements OnInit {
//复制图层 平面图 楼层/区域
duplicateLayer (item) {
let paramsData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData.data || {} ))
Object.keys(paramsData).forEach((key)=>{
if (key != '图例') {
let ID = ObjectID.default.generate()
paramsData[key].Id = ID
paramsData[ID] = paramsData[key]
delete paramsData[key]
}
}) //图标Id重新赋值
if (this.checkedBuildingIndex==-1) { //总平面图
item.id = ""
item.modifiedTime = new Date()
@ -1710,9 +1759,9 @@ export class CollectionToolsPlanComponent implements OnInit {
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1
this.http.post('/api/SitePlans',item).subscribe((data:any)=>{
let newData = {
version: this.canvasData.originaleveryStoreyData.version || "2.0",
version: "2.0",
id: "",
data: JSON.stringify( JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data)) ) || null,
data: JSON.stringify( paramsData ) || null,
sitePlanId: data.id
}
this.http.post('/api/SitePlanData',newData,{params:this.params}).subscribe(data=>{
@ -1727,9 +1776,9 @@ export class CollectionToolsPlanComponent implements OnInit {
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1
this.http.post('/api/BuildingAreas',item,{params:this.params}).subscribe((data:any)=>{
let newData = {
version: this.canvasData.originaleveryStoreyData.version || "2.0",
version: "2.0",
id: "",
data: JSON.stringify( JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data)) ) || null,
data: JSON.stringify( paramsData ) || null,
buildingAreaId: data.id
}
this.http.post('/api/BuildingAreaData',newData,{params:this.params}).subscribe(data=>{
@ -1839,7 +1888,6 @@ export class CollectionToolsPlanComponent implements OnInit {
});
this.allLibrary = data
this.selectImageIndex = -1
// this.canvas.cancelPaint()
})
}
@ -2024,6 +2072,7 @@ export class CollectionToolsPlanComponent implements OnInit {
// 切换 基本信息时 刷新 删除 建筑楼层 自定义属性
mateDeleteCustomize () {
this.canvasData.selectPanelPointBaseData = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}
this.defaultExpandedKeys = []
this.sitePlanIcon = {fire:0,force:0}
this.sitePlanData.forEach(element => { //楼层

7
src/app/ui/collection-tools-plan/save.ts

@ -90,7 +90,7 @@ export class saveTwoDialogPlan {
nodeItem
itemChildNum = 0 //点击处置节点子数据节点的数量
clickNode(item){
console.log(item)
// console.log(item)
this.nodeItem = item
this.allDisposalNodeChild.forEach(item => {
if(item.id == this.nodeItem.id){
@ -168,14 +168,14 @@ export class saveTwoDialogPlan {
resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点")
})
}).then((values)=>{
console.log(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)
// console.log(7788,data)
let objData = {
id: "",
data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null,
@ -260,7 +260,6 @@ export class saveTwoDialogPlan {
})
}).then((id) => {
let dataNodeData
console.log("qnm",id)
new Promise((resolve,reject) => {
postdata.parentId = id
postdata.level = dispositionNodeData.level + 1

17
src/app/ui/collection-tools/collection-tools.component.html

@ -7,14 +7,6 @@
<button mat-button (click)="toggle2()">
<mat-icon style="vertical-align: middle;">list</mat-icon>
</button>
<span style="color: gray;margin-right: 10px;margin-left: 10px;">图标大小</span>
<mat-form-field style="margin-top: 3px;">
<mat-select (selectionChange)='iconScale()' [(ngModel)]="selected">
<mat-option value="1">正常</mat-option>
<mat-option value="2">放大2倍</mat-option>
<mat-option value="4">放大4倍</mat-option>
</mat-select>
</mat-form-field>
<button (click)="copyAsset()" class="copytobutn" mat-button title="复制" style="margin:0 5px;" *ngIf="isEditPattern">
<mat-icon style="padding-bottom: 7px;">library_books</mat-icon>
</button>
@ -74,7 +66,6 @@
style="font-size: 23px;vertical-align:sub;color: rgb(224, 51, 51);">delete</mat-icon>
</span>
</button>
<!-- <button (click)="yyy()">yyyyy</button> -->
<button mat-button (click)="createBuilding()" *ngIf="isEditPattern && pattern">
<span style="font-size: 24px;">+</span>
</button>
@ -135,7 +126,7 @@
</div>
<div [hidden]="!togglePlane" >
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index" [ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
<label class="overflowText" style="display:inline-block; max-width: 160px;"><mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}</label>
<label class="overflowText" [title]="item.name" style="display:inline-block; max-width: 145px;"><mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}</label>
<a href="javascript:;" class="fireForce" *ngIf="isEditPattern && !pattern">
<img src="../../../assets/images/fire.png" *ngIf="item.fire && item.fire==2">
<img src="../../../assets/images/noFire.png" *ngIf="item.fire && item.fire==1">
@ -269,7 +260,7 @@
</div>
</div>
<!-- 如果是多点连线 -->
<div *ngIf="canvasAssetObj.InteractiveMode == 1">
<div *ngIf="canvasAssetObj.InteractiveMode == 1 || canvasAssetObj.InteractiveMode == 3">
<p>厚度</p>
<div style="width: 100%;display: flex;vertical-align: top;height: 22px;">
<input type="number" class="smallinput" [(ngModel)]="sliderValueThickness"
@ -291,7 +282,7 @@
</div>
</div>
<div class="colorDiv" *ngIf="isEditPattern">
<div class="colorDiv" *ngIf="isEditPattern && pattern && canvasAssetObj.GameMode == 0">
<ul>
<li (click)="selectcolor(item,key)" class="colorLi" *ngFor="let item of colors,let key=index" [style]="{'background-color':item}"></li>
</ul>
@ -444,7 +435,7 @@
</div>
<div class="body">
<textarea [disabled]="!isEditPattern" *ngIf="detailsAndattentBtn" name="" id="" rows="10" [(ngModel)]="canvasData.selectPanelPointBaseData.description"></textarea>
<textarea [disabled]="!isEditPattern" *ngIf="!detailsAndattentBtn" name="" id="" rows="10" [(ngModel)]="canvasData.selectPanelPointBaseData.nodes"></textarea>
<textarea [disabled]="!isEditPattern" *ngIf="!detailsAndattentBtn" name="" id="" rows="10" [(ngModel)]="canvasData.selectPanelPointBaseData.notes"></textarea>
</div>
</div>
</div>

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

@ -12,12 +12,10 @@ import Swiper from 'swiper';
import { saveOneDialog } from './save';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';
import { windows } from 'src/app/interface';
import { GameMode } from 'src/app/working-area/model/gameMode';
import { ActivatedRoute, Router } from '@angular/router';
import { MaskLayerService } from 'src/app/mask-layer.service';
import * as ObjectID from 'bson-objectid';
@Component({
selector: 'app-collection-tools',
@ -28,7 +26,7 @@ export class CollectionToolsComponent implements OnInit {
@ViewChild('canvas',{static: true}) canvas:WorkingAreaComponent; //父组件中获得子组件的引用
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { }
constructor(private maskLayerService:MaskLayerService,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { }
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
// tree配置
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
@ -150,9 +148,6 @@ export class CollectionToolsComponent implements OnInit {
pattern:boolean = true//默认为基本信息编辑
yyy(){
console.log(this.canvasData.selectPanelPoint)
}
//基本信息编辑模式
baseInfo(){
if (!this.pattern) {
@ -230,14 +225,13 @@ export class CollectionToolsComponent implements OnInit {
targetNodeData.forEach(i => {
idArr.push(i.id)
})
console.log(6666666666666,event);
if(this.pos == 0 && event.node.origin.children.length == 1){
console.log("移入,没有兄弟")
// console.log("移入,没有兄弟")
let key = event.dragNode.key
orders[key] = 0
parentId = event.node.key
}else{
console.log("移入,多个兄弟")
// console.log("移入,多个兄弟")
let array = []
targetNodeData.forEach(item => {
if(item.id != event.dragNode.key){ //将拖动项先移除掉
@ -245,13 +239,13 @@ export class CollectionToolsComponent implements OnInit {
}
})
if(event.dragNode.isEnd[event.dragNode.isEnd.length - 1]){ //如果移入到最后一个
console.log("最后")
// console.log("最后")
array.push(event.dragNode.origin)
}else if(event.dragNode.isStart[event.dragNode.isStart.length - 1]){//如果移入到第一个
console.log("第一")
// console.log("第一")
array.unshift(event.dragNode.origin)
}else{//如果移入中间位置
console.log("中间")
// console.log("中间")
array.splice(event.node.origin.order, 0, event.dragNode.origin)
}
array.forEach((item,key) => {
@ -274,7 +268,7 @@ export class CollectionToolsComponent implements OnInit {
})
}
}
isDrag //是否可以拖动
pos//放置位置
beforeDrop = (arg: NzFormatBeforeDropEvent) => {
@ -683,15 +677,11 @@ export class CollectionToolsComponent implements OnInit {
this.canvas.on("deselect",obj=>{
this.isShowProperty = false
})
// 监听canvas组件新增素材事件
this.canvas.on("createIcon",obj=>{
//监听数据变化后
this.canvas.on('canvasDataChanged',()=>{
// 收到数据表示共享数据发生变化
this.renovateTreeData(false)
})
// 监听canvas组件删除素材事件
this.canvas.on("deleteIcon",obj=>{
this.renovateTreeData(false)
})
});
}
copyAssetData:any //存储用于复制的素材
@ -705,6 +695,7 @@ export class CollectionToolsComponent implements OnInit {
let buildingId = this.beforeOneCheckedBuilding.id
let floorId = this.selectingSitePlan.id
this.canvas.paste(companyId,buildingId,floorId)
this.renovateTreeData(false)
}
basicInfo:boolean = true //基本信息名称显隐
@ -743,6 +734,9 @@ export class CollectionToolsComponent implements OnInit {
//保存平面图
saveNum :any = []
saveSite(){
//更新用于统计的数据
this.canvasData.updateBuildingData()
if (this.selectingSitePlan && this.selectingSitePlan.id) {
this.saveNum = []
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData));
@ -754,8 +748,7 @@ export class CollectionToolsComponent implements OnInit {
let adjoinArr = [] //毗邻数组
if(this.pattern){//如果是基本信息编辑模式
//更新用于统计的数据
this.canvasData.updateBuildingData()
this.maskLayerService.sendMessage(true)
for (const key in object) {
if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
@ -772,6 +765,7 @@ export class CollectionToolsComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存失败,毗邻存在相同方向','确定',config);
this.maskLayerService.sendMessage(false)
return false
}else{
//如果是单位 总平面图
@ -784,6 +778,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -791,6 +786,7 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -806,6 +802,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -813,6 +810,7 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -829,6 +827,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -836,11 +835,16 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('单位毗邻保存失败','确定',config);
if(err == 'infos 有重复方向!'){
this.snackBar.open('单位毗邻同步失败,存在相同方向','确定',config);
}else{
this.snackBar.open('单位毗邻同步失败','确定',config);
}
})
//批量保存单位重点部位
@ -852,6 +856,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -859,11 +864,12 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('单位重点部位保存失败','确定',config);
this.snackBar.open('单位重点部位同步失败','确定',config);
})
//批量保存单位消防设施素材
@ -875,6 +881,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -882,11 +889,12 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('单位消防设施素材保存失败','确定',config);
this.snackBar.open('单位消防设施素材同步失败','确定',config);
})
}else{ //如果是建筑
@ -899,6 +907,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -906,6 +915,7 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -921,6 +931,7 @@ export class CollectionToolsComponent implements OnInit {
}).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -928,6 +939,7 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -940,6 +952,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -947,11 +960,16 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('建筑毗邻保存失败','确定',config);
if(err == 'infos 有重复方向!'){
this.snackBar.open('建筑毗邻同步失败,存在相同方向','确定',config);
}else{
this.snackBar.open('建筑毗邻同步失败','确定',config);
}
})
//批量保存建筑重点部位
@ -959,6 +977,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -966,11 +985,12 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('建筑重点部位保存失败','确定',config);
this.snackBar.open('建筑重点部位同步失败','确定',config);
})
//批量保存建筑消防设施素材
@ -978,6 +998,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -985,11 +1006,12 @@ export class CollectionToolsComponent implements OnInit {
this.snackBar.open('保存成功','确定',config);
}
},err=>{
this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.canvasData.isChange = true
this.snackBar.open('建筑消防设施素材保存失败','确定',config);
this.snackBar.open('建筑消防设施素材同步失败','确定',config);
})
}
@ -1005,7 +1027,7 @@ export class CollectionToolsComponent implements OnInit {
});
dialogRef.afterClosed().subscribe(result => {
console.log('The dialog was closed');
// console.log('The dialog was closed');
});
}
@ -1030,10 +1052,10 @@ export class CollectionToolsComponent implements OnInit {
//拖拽tree
drop(e){
console.log(1111,e)
// console.log(1111,e)
}
drop2(e){
console.log(222,e)
// console.log(222,e)
}
//创建建筑
@ -1156,11 +1178,11 @@ export class CollectionToolsComponent implements OnInit {
}
storeyData //将建筑素材和当前楼层素材合二为一
selectPanelPoint //传过来的处置素材
//处理 tree 数据结构
handleTreeData (storeyData) {
handleTreeData (storeyData,selectPanelPoint) {
this.storeyData = storeyData
this.selectPanelPoint = selectPanelPoint
let data = this.allFireElements //所有消防要素模板
let treeData = [] //tree型 处理完成后的数据
data.forEach(element => {
@ -1192,6 +1214,30 @@ export class CollectionToolsComponent implements OnInit {
}
}
}
if(selectPanelPoint.Data){
for(let key in selectPanelPoint.Data.Stock){
selectPanelPoint.Data.Stock[key].isLookPattern = true
if(element.id == selectPanelPoint.Data.Stock[key].FireElementId){
selectPanelPoint.Data.Stock[key].isTemplate = false
selectPanelPoint.Data.Stock[key].isLook = true
element.isNewElement = true //该节点children是否存在新添加的真实素材 标识
//定义查看模式下能看到的元素
element.isLookPattern = true
if(element.parentId){
data.forEach(i => {
if(i.id == element.parentId){
i.isLookPattern = true
}
})
}
//
element.children.push(selectPanelPoint.Data.Stock[key])
}
}
}
data.forEach(item => { if (item.parentId == element.id) {element.children.push(item)} });
});
data.forEach(element => {
@ -1349,7 +1395,16 @@ export class CollectionToolsComponent implements OnInit {
this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key])
}
}
this.handleTreeData(storeyData) //处理tree数据结构
let selectPanelPoint = JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint || {} )) //当前 节点 数据
if(selectPanelPoint.Data){
for(let key in selectPanelPoint.Data.Stock){ //筛选数据 没有匹配全部放入到 其他 数组
let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId )
if (!noMatch) {
this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key])
}
}
}
this.handleTreeData(storeyData,selectPanelPoint) //处理tree数据结构
}
@ -1456,7 +1511,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.get('/api/CompanyData',{params:this.params}).subscribe((data:any)=>{
this.canvasData.originalcompanyBuildingData = data || {} // 单位原数据
this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {}
this.canvasData.originalcompanyBuildingData.version? null : this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.companyId? null : this.canvasData.originalcompanyBuildingData.companyId = sessionStorage.getItem('companyId')
resolve('success')
})
@ -1469,7 +1524,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.get(`/api/SitePlanData`,{params}).subscribe((data:any)=>{
this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null
this.renovateTreeData()
})
@ -1481,7 +1536,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.get(`/api/BuildingData`,{params:e}).subscribe((data:any)=>{
this.canvasData.originalcompanyBuildingData = data || {} // 建筑原数据
this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {}
this.canvasData.originalcompanyBuildingData.version? null : this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.version = "2.0"
this.canvasData.originalcompanyBuildingData.buildingId? null : this.canvasData.originalcompanyBuildingData.buildingId = e.buildingId
resolve('success')
})
@ -1494,7 +1549,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.get(`/api/BuildingAreaData`,{params}).subscribe((data:any)=>{
this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null
this.renovateTreeData()
})
@ -1502,7 +1557,6 @@ export class CollectionToolsComponent implements OnInit {
//点击选中 平面图 楼层/区域 时
selectSitePlan (item,index) {
if (this.selectSitePlanIndex != index) {
this.canvasData.selectPanelPoint = new DisposalNodeData();
if (this.canvasData.isChange) { //true 数据被改动
@ -1716,6 +1770,15 @@ export class CollectionToolsComponent implements OnInit {
//复制图层 平面图 楼层/区域
duplicateLayer (item) {
let paramsData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData.data || {} ))
Object.keys(paramsData).forEach((key)=>{
if (key != '图例') {
let ID = ObjectID.default.generate()
paramsData[key].Id = ID
paramsData[ID] = paramsData[key]
delete paramsData[key]
}
}) //图标Id重新赋值
if (this.checkedBuildingIndex==-1) { //总平面图
item.id = ""
item.modifiedTime = new Date()
@ -1723,9 +1786,9 @@ export class CollectionToolsComponent implements OnInit {
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1
this.http.post('/api/SitePlans',item).subscribe((data:any)=>{
let newData = {
version: this.canvasData.originaleveryStoreyData.version || "2.0",
version: "2.0",
id: "",
data: JSON.stringify( JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data)) ) || null,
data: JSON.stringify( paramsData ) || null,
sitePlanId: data.id
}
this.http.post('/api/SitePlanData',newData,{params:this.params}).subscribe(data=>{
@ -1740,9 +1803,9 @@ export class CollectionToolsComponent implements OnInit {
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1
this.http.post('/api/BuildingAreas',item,{params:this.params}).subscribe((data:any)=>{
let newData = {
version: this.canvasData.originaleveryStoreyData.version || "2.0",
version: "2.0",
id: "",
data: JSON.stringify( JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data)) ) || null,
data: JSON.stringify( paramsData ) || null,
buildingAreaId: data.id
}
this.http.post('/api/BuildingAreaData',newData,{params:this.params}).subscribe(data=>{
@ -1852,7 +1915,6 @@ export class CollectionToolsComponent implements OnInit {
});
this.allLibrary = data
this.selectImageIndex = -1
// this.canvas.cancelPaint()
})
}
@ -2037,6 +2099,7 @@ export class CollectionToolsComponent implements OnInit {
// 切换 基本信息时 刷新 删除 建筑楼层 自定义属性
mateDeleteCustomize () {
this.canvasData.selectPanelPointBaseData = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}
this.defaultExpandedKeys = []
this.sitePlanIcon = {fire:0,force:0}
this.sitePlanData.forEach(element => { //楼层

19
src/app/ui/collection-tools/save.ts

@ -3,6 +3,7 @@ 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' //引入服务
import { MaskLayerService } from 'src/app/mask-layer.service';
// 保存想定作业第一个弹窗
@Component({
selector: 'dialog-overview-example-dialog',
@ -48,6 +49,7 @@ export class saveOneDialog {
export class saveTwoDialog {
constructor(
private maskLayerService:MaskLayerService,
private http:HttpClient,
public dialogRef: MatDialogRef<saveTwoDialog>,
public canvasData: CanvasShareDataService,
@ -90,7 +92,7 @@ export class saveOneDialog {
nodeItem
itemChildNum = 0 //点击处置节点子数据节点的数量
clickNode(item){
console.log(item)
// console.log(item)
this.nodeItem = item
this.allDisposalNodeChild.forEach(item => {
if(item.id == this.nodeItem.id){
@ -102,6 +104,8 @@ export class saveOneDialog {
selectedBuildingData = this.data.selectedBuildingData
selectedSiteData = this.data.selectedSiteData
onSubmit(value,type){
this.maskLayerService.sendMessage(true)
let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name
//如果保存到已有节点
var postdata = {
@ -146,14 +150,14 @@ export class saveOneDialog {
// 保存平面图数据到当前节点
let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint))
postdata.Data = JSON.stringify(postdata.Data)
postdata.DisposalNodeId = istrue.id
// console.log(111,istrue)
this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => {
this.maskLayerService.sendMessage(false)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config)
},err=>{
this.maskLayerService.sendMessage(false)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -176,7 +180,6 @@ export class saveOneDialog {
resolve(data)
})
}).then((data:any)=>{
// console.log(7788,data)
let objData = {
id: "",
data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null,
@ -185,11 +188,13 @@ export class saveOneDialog {
planComponentId: sessionStorage.getItem("planId"),
}
this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => {
this.maskLayerService.sendMessage(false)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config)
},err=>{
this.maskLayerService.sendMessage(false)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -261,7 +266,6 @@ export class saveOneDialog {
})
}).then((id) => {
let dataNodeData
// console.log("qnm",id)
new Promise((resolve,reject) => {
postdata.parentId = id
postdata.level = dispositionNodeData.level + 1
@ -270,9 +274,6 @@ export class saveOneDialog {
})
}).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,
@ -282,12 +283,14 @@ export class saveOneDialog {
}
this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => {
this.maskLayerService.sendMessage(false)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config)
},err=>{
this.maskLayerService.sendMessage(false)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000

Loading…
Cancel
Save