Browse Source

[合并]合并代码

dev
邵佳豪 4 years ago
parent
commit
5786ca80d8
  1. 2
      debug.log
  2. 16
      src/app/app-routing.module.ts
  3. 1
      src/app/canvas-share-data.service.ts
  4. 31
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  5. 37
      src/app/key-unit/allaround/allaround.component.html
  6. 3
      src/app/key-unit/allaround/allaround.component.scss
  7. 9
      src/app/key-unit/allaround/allaround.component.ts
  8. 16
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  9. 20
      src/app/key-unit/edit-unit-info/edit-unit-info.component.html
  10. 94
      src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html
  11. 2
      src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.scss
  12. 10
      src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.ts
  13. 94
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html
  14. 2
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.scss
  15. 10
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  16. 53
      src/app/key-unit/function-division-look/function-division.component.html
  17. 2
      src/app/key-unit/function-division-look/function-division.component.scss
  18. 6
      src/app/key-unit/function-division-look/function-division.component.ts
  19. 51
      src/app/key-unit/function-division/function-division.component.html
  20. 2
      src/app/key-unit/function-division/function-division.component.scss
  21. 7
      src/app/key-unit/function-division/function-division.component.ts
  22. 57
      src/app/key-unit/key-site-look/key-site.component.html
  23. 2
      src/app/key-unit/key-site-look/key-site.component.scss
  24. 7
      src/app/key-unit/key-site-look/key-site.component.ts
  25. 57
      src/app/key-unit/key-site/key-site.component.html
  26. 2
      src/app/key-unit/key-site/key-site.component.scss
  27. 7
      src/app/key-unit/key-site/key-site.component.ts
  28. 2
      src/app/key-unit/realistic-picture-look/realistic-picture.component.scss
  29. 2
      src/app/key-unit/realistic-picture/realistic-picture.component.scss
  30. 122
      src/app/key-unit/uploading-cad-look/uploading-cad.component.html
  31. 125
      src/app/key-unit/uploading-cad/uploading-cad.component.html
  32. 23
      src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html
  33. 18
      src/app/key-unit/view-unit-details/view-unit-details.component.html
  34. 5
      src/app/navigation/navigation.component.ts
  35. 312
      src/app/plan-audit/detachment-level/detachment-level.component.html
  36. 2
      src/app/plan-audit/detachment-level/detachment-level.component.ts
  37. 336
      src/app/plan-audit/plan-audit/plan-audit.component.html
  38. 2
      src/app/plan-audit/plan-audit/plan-audit.component.ts
  39. 117
      src/app/plan-audit/plan-pass/plan-pass.component.html
  40. 27
      src/app/plan-audit/plan-pass/plan-pass.component.ts
  41. 63
      src/app/plan-management/meet-plan/meet-plan.component.html
  42. 3
      src/app/plan-management/meet-plan/meet-plan.component.scss
  43. 357
      src/app/plan-management/meet-plan/meet-plan.component.ts
  44. 32
      src/app/plan-management/meet-plan/newunit.html
  45. 2
      src/app/plan-management/meet-plan/newunit.scss
  46. 34
      src/app/plan-management/onetwo-entry-plan/newunit.html
  47. 2
      src/app/plan-management/onetwo-entry-plan/newunit.scss
  48. 68
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
  49. 3
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss
  50. 374
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
  51. 6
      src/app/plan-management/open-plan/open-plan.component.ts
  52. 6
      src/app/plan-management/pass-plan/pass-plan.component.ts
  53. 37
      src/app/plan-management/type-plan/newunit.html
  54. 25
      src/app/plan-management/type-plan/newunit.scss
  55. 43
      src/app/plan-management/type-plan/type-plan.component.html
  56. 3
      src/app/plan-management/type-plan/type-plan.component.scss
  57. 338
      src/app/plan-management/type-plan/type-plan.component.ts
  58. 2
      src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.scss
  59. 2
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.scss
  60. 2
      src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss
  61. 2
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss
  62. 2
      src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.scss
  63. 2
      src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss
  64. 2
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html
  65. 2
      src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.scss
  66. 2
      src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.scss
  67. 2
      src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.scss
  68. 2
      src/app/statistic-analysis/deleteUnit/delete-one/delete-one.component.html
  69. 2
      src/app/statistic-analysis/deleteUnit/delete-there-line-details/delete-there-line-details.component.scss
  70. 2
      src/app/statistic-analysis/deleteUnit/delete-there/delete-there.component.scss
  71. 2
      src/app/statistic-analysis/deleteUnit/delete-two-newadd/delete-two-newadd.component.scss
  72. 2
      src/app/statistic-analysis/deleteUnit/delete-two/delete-two.component.scss
  73. 2
      src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.scss
  74. 2
      src/app/statistic-analysis/state/page-one/page-one.component.html
  75. 2
      src/app/statistic-analysis/state/page-there-year/page-there-year.component.scss
  76. 2
      src/app/statistic-analysis/state/page-there/page-there.component.scss
  77. 2
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss
  78. 2
      src/app/ui/authority/authority.component.html
  79. 2
      src/app/ui/fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component.scss
  80. 2
      src/app/ui/fire-protection-elements/fire-protection-elements.component.scss
  81. 2
      src/app/ui/material-bank/material-bank.component.scss
  82. 2
      src/app/ui/navmenus/navmenus.component.html
  83. 2
      src/app/ui/role/role.component.html
  84. 2
      src/app/ui/unit-information/unit-information.component.scss
  85. 41
      src/app/working-area/model/arrows.ts
  86. 50
      src/app/working-area/model/axArrowConnector.ts
  87. 368
      src/app/working-area/model/axImageShape.ts
  88. 120
      src/app/working-area/model/axLegend.ts
  89. 12
      src/app/working-area/model/axPreviewImageShape.ts
  90. 159
      src/app/working-area/model/axShape.ts
  91. 3
      src/app/working-area/model/gameMode.ts
  92. 68
      src/app/working-area/model/legend.ts
  93. 97
      src/app/working-area/model/multipointIcon.ts
  94. 134
      src/app/working-area/model/polygonIcon.ts
  95. 665
      src/app/working-area/working-area.component.ts
  96. 2
      src/assets/css/newStyle.css
  97. 2
      src/styles.scss

2
debug.log

@ -0,0 +1,2 @@
[1229/141605.754:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[0104/100053.968:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

16
src/app/app-routing.module.ts

@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { NavigationComponent } from './navigation/navigation.component';
import { LockscreenComponent } from './pages/lockscreen/lockscreen.component';
import {HomeComponent} from './home/home.component'
//路由守卫
@ -11,13 +10,10 @@ import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1秘钥
const routes: Routes = [
{path:'',redirectTo:'login',pathMatch:'full'},
{
path:'',
component:NavigationComponent,
canActivate: [AuthGuard],//守卫验证
path:'',component:NavigationComponent,canActivate: [AuthGuard],//守卫验证
children:[
{path:'ui',loadChildren:() => import('./ui/ui.module').then(m => m.UiModule)},
{path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)},
@ -30,15 +26,9 @@ const routes: Routes = [
{path:'dataCollection',loadChildren:() => import('./data-collection/data-collection.module').then(m => m.DataCollectionModule)},
]
},
{path:'login',
component:LoginComponent},
{path:'getNoMToken',
component:MTokenK1Component, canActivate: [AuthGuard],}, //K1秘钥验证失败是跳转页面
{path:'lockscreen',
component:LockscreenComponent,
canActivate: [AuthGuard]}//守卫验证
{path:'login',component:LoginComponent},
{path:'getNoMToken',component:MTokenK1Component, canActivate: [AuthGuard],}, //K1秘钥验证失败是跳转页面
];
@NgModule({

1
src/app/canvas-share-data.service.ts

@ -8,7 +8,6 @@ import { GameMode } from './working-area/model/gameMode';
export class CanvasShareDataService {
constructor() { }
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
GameMode: any;
isChange = false; // 数据 是否改动

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

@ -20,8 +20,8 @@ export class GisLabelingComponent implements OnInit {
titleList = [ {name:'重点单位',iconImg:'/assets/images/uniticon.png'},
{name:'水源',iconImg:'/assets/images/watericon.png'},
{name:'测量工具',iconImg:'/assets/images/distanceicon.png'},
/* {name:'测面积',iconImg:'/assets/images/areaicon.png'}, */
{name:'图层选择',iconImg:'/assets/images/coverageicon.png'}]
{name:'图层选择',iconImg:'/assets/images/coverageicon.png'}
]
keyUnitList:any = []
waterList = [
{id:'0',name:'消火栓',selected:false},
@ -285,7 +285,7 @@ export class GisLabelingComponent implements OnInit {
`<div style="font-size: 14px" id="gispopupbox">
<div style="color: #0080FF;"><span style="margin-left:8px">${item.name}</span><label style="font-size: 12px; color: #999; margin-left: 10px">${item.address}</label> </div>
<div style="display: flex; margin-top: 10px;margin-left:8px">
<div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;">${item.buildingTypes[0].name || "暂无数据"}</label></div>
<div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;">${item.buildingTypes.length? item.buildingTypes[0].name : "暂无数据"}</label></div>
<div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">${item.contacts || "暂无数据"}</label></div>
</div>
<div style="display: flex; margin-top: 10px;margin-left:8px"">
@ -312,7 +312,7 @@ export class GisLabelingComponent implements OnInit {
<div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div>
<div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div>
<div class="btn" id="threeeScene"><img src="../../../assets/images/3dicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div>
</div>
</div>`
@ -327,7 +327,7 @@ export class GisLabelingComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//分享点击事件
});
markerArr.push(labelMarker)
@ -712,7 +712,7 @@ export class GisLabelingComponent implements OnInit {
let markerContent = `<div style="font-size: 14px" id="gispopupbox">
<div style="color: #0080FF;"><span style="margin-left:8px">${e.name}</span><label style="font-size: 12px; color: #999; margin-left: 10px">${e.address}</label> </div>
<div style="display: flex; margin-top: 10px;margin-left:8px">
<div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;">${e.buildingTypes[0].name || "暂无数据"}</label></div>
<div style="width:240px; overflow: hidden;">: <label style="margin-left: 10px;font-size: 12px;">${e.buildingTypes.length? e.buildingTypes[0].name : "暂无数据"}</label></div>
<div style="flex: 1; margin-left: 25px;">: <label style="margin-left: 10px;font-size: 12px;">${e.contacts || "暂无数据"}</label></div>
</div>
<div style="display: flex; margin-top: 10px;margin-left:8px"">
@ -739,7 +739,7 @@ export class GisLabelingComponent implements OnInit {
<div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div>
<div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div>
<div class="btn" id="threeeScene"><img src="../../../assets/images/3dicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div>
</div>
</div>`
@ -754,7 +754,7 @@ export class GisLabelingComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//分享点击事件
marker.on('click', (ev) => { //marker点击事件
this.infoWindow = new AMap.InfoWindow({
@ -767,7 +767,7 @@ export class GisLabelingComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//分享点击事件
})
@ -793,7 +793,6 @@ export class GisLabelingComponent implements OnInit {
this.leftDivState = false
this.showLeftDiv = false
this.isShowRouteGIS = true
// console.log(1,e)
this.routeEnd = e.name
this.endCoordinate = new AMap.LngLat(e.location.x, e.location.y)
}
@ -868,20 +867,18 @@ export class GisLabelingComponent implements OnInit {
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)
// console.log(666,result)
}else{
that.routeEndList = result.tips
that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
}
});
}
} //if
})
})
}); //获取当前 city
@ -912,7 +909,6 @@ export class GisLabelingComponent implements OnInit {
this.endCoordinate = null
this.routeGIS? this.routeGIS.clear() : null
this.routes = { distance: 0, time: 0, steps: [], }
// console.log(this.selectedUnit)
this.map.setZoomAndCenter(13,[this.selectedUnit.location.x,this.selectedUnit.location.y]); //设置地图中心点
}
@ -941,10 +937,7 @@ export class GisLabelingComponent implements OnInit {
this.routeGIS? this.routeGIS.clear() : null
this.routeGIS = new AMap.Driving({
map: this.map,
});
// console.log(1,this.startCoordinate)
// console.log(2,this.endCoordinate)
// 根据起终点名称规划驾车导航路线
});
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {

37
src/app/key-unit/allaround/allaround.component.html

@ -1,42 +1,5 @@
<div class="content">
<mat-tab-group style="height: 100%;">
<mat-tab label="单位毗邻">
<div class="allImgs">
<div class="imgBox" *ngFor="let item of AllAdjoining" >
<div class="fixedImg" *ngIf="item.imageUrls.length">
<img [src]="item.imgURL" onerror="javascript:this.src='../../../assets/images/upload.png'" (click)='imgdetails(item.imageUrls)'>
</div>
<div class="fixedImg" *ngIf="!item.imageUrls.length">
<img src="../../../assets/images/upload.png" (click)='imgdetails(item.imageUrls)'>
</div>
<div style="margin-top: 5px;">
<label style="margin-left: 25px;">建筑物名称:</label>
<label style="margin-left: 25px;">{{item.name}}</label>
</div>
<div style="margin-top: 5px;">
<label style="margin-left: 25px;">建筑物方向:</label>
<label style="margin-left: 25px;">
<label *ngIf="item.direction==0"></label>
<label *ngIf="item.direction==1">西</label>
<label *ngIf="item.direction==2"></label>
<label *ngIf="item.direction==3"></label>
<label *ngIf="item.direction==4">东南</label>
<label *ngIf="item.direction==5">西南</label>
<label *ngIf="item.direction==6">东北</label>
<label *ngIf="item.direction==7">西北</label>
</label>
</div>
<div style="margin-top: 5px;">
<label style="margin-left: 25px;">图片数量:</label>
<label style="margin-left: 25px;" *ngIf="item.imageUrls.length">{{item.imageUrls.length}}张</label>
<label style="margin-left: 25px;" *ngIf="!item.imageUrls.length">0张</label>
</div>
</div>
<p style="width: 100%;text-align: center;margin-top: 25px;" *ngIf="!AllAdjoining.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of AllBuilding">
<div class="allImgs">

3
src/app/key-unit/allaround/allaround.component.scss

@ -1,7 +1,8 @@
.content {
width: 100%;
height: 90%;
height: 100%;
padding: 10px;
box-sizing: border-box;
overflow-y: auto;
}

9
src/app/key-unit/allaround/allaround.component.ts

@ -17,7 +17,6 @@ export class AllaroundComponent implements OnInit {
constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { }
ngOnInit(): void {
this.getAllCompany()
this.getAllBuilding()
}
@ -42,7 +41,13 @@ export class AllaroundComponent implements OnInit {
this.AllBuilding.forEach(element => {
element.allImgs = []
});
this.getAllArchitecture()}
this.getAllArchitecture()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

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

@ -10,7 +10,6 @@
<mat-tab label="2.平面图">
<ng-template matTabContent>
<app-collection-tools-plan></app-collection-tools-plan>
<!-- <iframe id="main" src="/unityApp2Basic/index.html" name="unityApp" frameborder="0" width="96%" height="100%" style="margin-left: 2%;"></iframe> -->
</ng-template>
</mat-tab>
<mat-tab label="3.四周毗邻">
@ -43,15 +42,10 @@
<app-uploading-cad></app-uploading-cad>
</ng-template>
</mat-tab>
<mat-tab label="9.六熟悉记录">
<ng-template matTabContent>
<app-six-familiar-list></app-six-familiar-list>
</ng-template>
</mat-tab>
<mat-tab label="10.实战演练记录">
<ng-template matTabContent>
功能开发中~~
</ng-template>
</mat-tab>
<!-- <mat-tab label="9.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>
</mat-tab> -->
</mat-tab-group>

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

@ -41,20 +41,14 @@
<app-uploading-cad></app-uploading-cad>
</ng-template>
</mat-tab>
<mat-tab label="8.六熟悉记录">
<mat-tab label="8.作战部署">
<ng-template matTabContent>
功能开发中~~
</ng-template>
</mat-tab>
<mat-tab label="9.实战演练记录">
<ng-template matTabContent>
功能开发中~~
</ng-template>
</mat-tab>
<mat-tab label="10.作战部署">
<ng-template matTabContent>
<!-- <iframe id="main" src="/unityApp2/index.html" name="unityApp" frameborder="0" width="100%" height="98%"></iframe> -->
<app-collection-tools></app-collection-tools>
</ng-template>
</mat-tab>
</mat-tab>
<!-- <mat-tab label="9.unity作战部署">
<ng-template matTabContent>
<iframe id="main" src="/unityApp2/index.html" name="unityApp" frameborder="0" width="100%" height="98%"></iframe>
</ng-template>
</mat-tab> -->
</mat-tab-group>

94
src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html

@ -1,99 +1,5 @@
<div class="content">
<mat-tab-group>
<mat-tab label="单位消防设施">
<div class="contentBox">
<p style="width: 100%; margin: 30px auto; text-align: center;" *ngIf="!companyBuiltInGrouping.length">暂无数据,请完善单位基本信息</p>
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of companyBuiltInGrouping;let key = index">
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<div style="margin-bottom: 10px;">
<!-- <mat-icon title="创建" (click)='addCompanyGrouping(item)'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editCompanyGrouping(item)'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='deleteCompanyGrouping(item)'>delete</mat-icon> -->
</div>
<div>
<mat-accordion multi>
<mat-expansion-panel disabled>
<mat-expansion-panel-header>
<label class="firstContent"></label>
<label class="textContent">项目</label>
<label class="textContent">照片</label>
<label class="totalContent">总数</label>
<label class="lastTextContent">主要情况</label>
</mat-expansion-panel-header>
</mat-expansion-panel>
<mat-expansion-panel *ngFor="let items of item.facilityItems" disabled [expanded]=items.expanded>
<mat-expansion-panel-header>
<label class="firstContent">
<mat-checkbox (change)='checkedCompany($event,item,items)' [disabled]='items.isBuiltin'></mat-checkbox>
</label>
<label class="textContent">{{items.name}}</label>
<label class="textContent"><a href="javascript:void(0)" (click)='previewImg(items)'>查看图片</a></label>
<label class="totalContent">{{items.total ? items.total : '总数: 0'}}</label>
<label class="lastTextContent">
<textarea readonly maxlength="250" [(ngModel)]="items.details" style="width: 80%;"></textarea>
</label>
<label><mat-icon (click)='SwitchBoard(items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label>
</mat-expansion-panel-header>
<div class="overflowTable">
<div class="detailsTable">
<table>
<tr>
<th *ngFor="let header of items.header">{{header}}</th>
</tr>
<tr *ngFor="let body of items.body">
<td *ngFor="let header of items.header">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
<div *ngFor="let tableMsg of items.loopTable" class="detailsTable">
<p style="text-align: center; font-size: 16px; margin: 5px 0;">楼层/区域名称: {{tableMsg.name? tableMsg.name: '暂无名称'}}</p>
<table>
<tr>
<th *ngFor="let header of tableMsg.header">{{header}}</th>
</tr>
<tr *ngFor="let body of tableMsg.body">
<td *ngFor="let header of tableMsg.header">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of companyOptionalGrouping;let key = index">
<mat-accordion multi>
<mat-expansion-panel>
<mat-expansion-panel-header>
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<!-- <mat-icon title="保存" style="margin-left: 25px;" (click)='editCompanyOptional($event,item)'>description</mat-icon> -->
</mat-expansion-panel-header>
<div *ngFor="let items of item.propertyInfos" class="InputField">
<label>{{items.propertyName}}:</label>
<input readonly type="text" *ngIf="items.propertyType!=1&&items.propertyType!=2&&items.propertyType!=4&&items.propertyType!=6"
[(ngModel)]="items.propertyValue" name="propertyValue">
<textarea readonly maxlength="250" *ngIf="items.propertyType==1" [(ngModel)]="items.propertyValue" name="propertyValue"></textarea>
<input readonly type="number" *ngIf="items.propertyType==2 ||items.propertyType==4" [(ngModel)]="items.propertyValue" name="propertyValue">
<mat-radio-group *ngIf="items.propertyType==6" [(ngModel)]="items.propertyValue" name="propertyValue">
<mat-radio-button style="margin-left: 5px;" [value]='radio.value' *ngFor="let radio of singleElection">{{radio.name}}</mat-radio-button>
</mat-radio-group>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</mat-tab>
<mat-tab label="{{newItem.name}}" *ngFor="let newItem of allBuildingGrouping">
<div class="contentBox">

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

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 90%;
height: 100%;
padding: 10px;
overflow-y: auto;
.contentBox {

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

@ -21,7 +21,6 @@ export class FireFightingDeviceLookComponent implements OnInit {
constructor(private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
this.getAllBuilding()
}
@ -234,7 +233,14 @@ export class FireFightingDeviceLookComponent implements OnInit {
companyId:companyId
}}).subscribe((data:any)=>{
this.allBuildingGrouping = data
if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() }
if (this.allBuildingGrouping.length) {
this.getAllBuildingFacilities()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

94
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html

@ -1,99 +1,5 @@
<div class="content">
<mat-tab-group>
<mat-tab label="单位消防设施">
<div class="contentBox">
<p style="width: 100%; margin: 30px auto; text-align: center;" *ngIf="!companyBuiltInGrouping.length">暂无数据,请完善单位基本信息</p>
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of companyBuiltInGrouping;let key = index">
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<div style="margin-bottom: 10px;">
<mat-icon title="创建" (click)='addCompanyGrouping(item)'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editCompanyGrouping(item)'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='deleteCompanyGrouping(item)'>delete</mat-icon>
</div>
<div>
<mat-accordion multi>
<mat-expansion-panel disabled>
<mat-expansion-panel-header>
<label class="firstContent"></label>
<label class="textContent">项目</label>
<label class="textContent">照片</label>
<label class="totalContent">总数</label>
<label class="lastTextContent">主要情况</label>
</mat-expansion-panel-header>
</mat-expansion-panel>
<mat-expansion-panel *ngFor="let items of item.facilityItems" disabled [expanded]=items.expanded>
<mat-expansion-panel-header>
<label class="firstContent">
<mat-checkbox (change)='checkedCompany($event,item,items)' [disabled]='items.isBuiltin'></mat-checkbox>
</label>
<label class="textContent">{{items.name}}</label>
<label class="textContent"><a href="javascript:void(0)" (click)='previewImg(items)'>查看图片</a></label>
<label class="totalContent">{{items.total ? items.total : '总数: 0'}}</label>
<label class="lastTextContent">
<textarea maxlength="250" [(ngModel)]="items.details" style="width: 80%;"></textarea>
</label>
<label><mat-icon (click)='SwitchBoard(items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label>
</mat-expansion-panel-header>
<div class="overflowTable">
<div class="detailsTable">
<table>
<tr>
<th *ngFor="let header of items.header">{{header}}</th>
</tr>
<tr *ngFor="let body of items.body">
<td *ngFor="let header of items.header">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
<div *ngFor="let tableMsg of items.loopTable" class="detailsTable">
<p style="text-align: center; font-size: 16px; margin: 5px 0;">楼层/区域名称: {{tableMsg.name? tableMsg.name: '暂无名称'}}</p>
<table>
<tr>
<th *ngFor="let header of tableMsg.header">{{header}}</th>
</tr>
<tr *ngFor="let body of tableMsg.body">
<td *ngFor="let header of tableMsg.header">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of companyOptionalGrouping;let key = index">
<mat-accordion multi>
<mat-expansion-panel>
<mat-expansion-panel-header>
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editCompanyOptional($event,item)'>description</mat-icon>
</mat-expansion-panel-header>
<div *ngFor="let items of item.propertyInfos" class="InputField">
<label>{{items.propertyName}}:</label>
<input type="text" *ngIf="items.propertyType!=1&&items.propertyType!=2&&items.propertyType!=4&&items.propertyType!=6"
[(ngModel)]="items.propertyValue" name="propertyValue">
<textarea maxlength="250" *ngIf="items.propertyType==1" [(ngModel)]="items.propertyValue" name="propertyValue"></textarea>
<input type="number" *ngIf="items.propertyType==2 ||items.propertyType==4" [(ngModel)]="items.propertyValue" name="propertyValue">
<mat-radio-group *ngIf="items.propertyType==6" [(ngModel)]="items.propertyValue" name="propertyValue">
<mat-radio-button style="margin-left: 5px;" [value]='radio.value' *ngFor="let radio of singleElection">{{radio.name}}</mat-radio-button>
</mat-radio-group>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</mat-tab>
<mat-tab label="{{newItem.name}}" *ngFor="let newItem of allBuildingGrouping">
<div class="contentBox">

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

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 90%;
height: 100%;
padding: 10px;
overflow-y: auto;
.contentBox {

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

@ -22,7 +22,6 @@ export class FireFightingDeviceComponent implements OnInit {
constructor(private tabbarService: TabbarAndScoreService,private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
this.getAllBuilding()
}
@ -233,7 +232,14 @@ export class FireFightingDeviceComponent implements OnInit {
companyId:companyId
}}).subscribe((data:any)=>{
this.allBuildingGrouping = data
if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() }
if (this.allBuildingGrouping.length) {
this.getAllBuildingFacilities()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

53
src/app/key-unit/function-division-look/function-division.component.html

@ -1,59 +1,6 @@
<div class="content">
<div style="margin-top:16px">
<!-- <mat-icon title="创建" (click)='addPartition()'>add_circle_outline</mat-icon> -->
</div>
<mat-tab-group class="tableContent">
<mat-tab label="单位功能分区">
<div style="overflow: auto; height: 100%;">
<div style="margin: 30px 0 25px 5%;">
<!-- <mat-icon title="创建" (click)='addCompany()'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='preservation()'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='delete()'>delete</mat-icon> -->
</div>
<table mat-table [dataSource]="companyFunctionalZoning">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox disabled (change)='changeCompany(element,$event)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="region">
<th mat-header-cell *matHeaderCellDef>区域</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input readonly matInput [(ngModel)]="element.region" type="text" maxlength="20">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="measure">
<th mat-header-cell *matHeaderCellDef>面积</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input readonly matInput type="number" [(ngModel)]="element.area" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" placeholder="请输入数字">
</mat-form-field>
<label style="margin-left: 5px;"></label>
</td>
</ng-container>
<ng-container matColumnDef="situation">
<th mat-header-cell *matHeaderCellDef>基本情况</th>
<td mat-cell *matCellDef="let element">
<textarea readonly [(ngModel)]="element.details" maxlength="250"></textarea>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100%; margin-top: 30px; text-align: center;" *ngIf="!companyFunctionalZoning.length">暂无数据</p>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuildingFunctionalZoning;let key = index">
<div style="overflow: auto; height: 100%;">
<div style="margin: 30px 0 25px 5%;">

2
src/app/key-unit/function-division-look/function-division.component.scss

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 90%;
height: 100%;
overflow-y: auto;
padding: 10px 0 0 10px;
display: flex;

6
src/app/key-unit/function-division-look/function-division.component.ts

@ -16,7 +16,6 @@ export class FunctionDivisionLookComponent implements OnInit {
ngOnInit(): void {
this.companyId = this.route.snapshot.queryParams.id
this.getAllCompany()
this.getAllBuilding()
}
@ -121,6 +120,11 @@ export class FunctionDivisionLookComponent implements OnInit {
element.functionalZoning = null
});
this.getAllBuildingFunctionalZoning()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

51
src/app/key-unit/function-division/function-division.component.html

@ -1,59 +1,10 @@
<div class="content">
<div style="margin-top:16px">
<div style="margin-top:16px" *ngIf="allBuilding.length">
<mat-icon title="创建" (click)='addPartition()'>add_circle_outline</mat-icon>
</div>
<mat-tab-group class="tableContent">
<mat-tab label="单位功能分区">
<div style="overflow: auto; height: 100%;">
<div style="margin: 30px 0 25px 5%;">
<mat-icon title="创建" (click)='addCompany()'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='preservation()'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='delete()'>delete</mat-icon>
</div>
<table mat-table [dataSource]="companyFunctionalZoning">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox (change)='changeCompany(element,$event)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="region">
<th mat-header-cell *matHeaderCellDef>区域</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput [(ngModel)]="element.region" type="text" maxlength="20">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="measure">
<th mat-header-cell *matHeaderCellDef>面积</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="element.area" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" placeholder="请输入数字">
</mat-form-field>
<label style="margin-left: 5px;"></label>
</td>
</ng-container>
<ng-container matColumnDef="situation">
<th mat-header-cell *matHeaderCellDef>基本情况</th>
<td mat-cell *matCellDef="let element">
<textarea [(ngModel)]="element.details" maxlength="250"></textarea>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100%; margin-top: 30px; text-align: center;" *ngIf="!companyFunctionalZoning.length">暂无数据</p>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuildingFunctionalZoning;let key = index">
<div style="overflow: auto; height: 100%;">
<div style="margin: 30px 0 25px 5%;">

2
src/app/key-unit/function-division/function-division.component.scss

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 90%;
height: 100%;
overflow-y: auto;
padding: 10px 0 0 10px;
display: flex;

7
src/app/key-unit/function-division/function-division.component.ts

@ -17,7 +17,6 @@ export class FunctionDivisionComponent implements OnInit {
ngOnInit(): void {
this.companyId = this.route.snapshot.queryParams.id
this.getAllCompany()
this.getAllBuilding()
}
@ -49,7 +48,6 @@ export class FunctionDivisionComponent implements OnInit {
//保存单位功能分区属性
preservation () {
let companyId = this.route.snapshot.queryParams.id
// console.log(123,companyId)
if (this.companyFunctionalZoning.length) {
this.http.post('/api/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning,{params:{
companyId:companyId
@ -124,6 +122,11 @@ export class FunctionDivisionComponent implements OnInit {
element.functionalZoning = null
});
this.getAllBuildingFunctionalZoning()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

57
src/app/key-unit/key-site-look/key-site.component.html

@ -1,62 +1,5 @@
<div class="content">
<mat-tab-group style="height: 100%;">
<mat-tab label="单位重点部位">
<div class="contentBox">
<div style="margin-top: 25px;">
<h3 style="text-align: center;font-weight: 550;">重点部位情况</h3>
<table mat-table [dataSource]="allCompanyPosition">
<ng-container matColumnDef="mainname">
<th mat-header-cell *matHeaderCellDef>重点部位名称</th>
<td mat-cell *matCellDef="let element">
{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef>重点部位所在位置</th>
<td mat-cell *matCellDef="let element">
{{element.position}}
</td>
</ng-container>
<ng-container matColumnDef="construction">
<th mat-header-cell *matHeaderCellDef>建筑结构</th>
<td mat-cell *matCellDef="let element">
{{element.structure}}
</td>
</ng-container>
<ng-container matColumnDef="nature">
<th mat-header-cell *matHeaderCellDef>使用性质</th>
<td mat-cell *matCellDef="let element">
{{element.nature}}
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>主要危险性</th>
<td mat-cell *matCellDef="let element">
{{element.hazards}}
</td>
</ng-container>
<ng-container matColumnDef="img">
<th mat-header-cell *matHeaderCellDef>图片</th>
<td mat-cell *matCellDef="let element">
<a href="javascript:void(0);" (click)='seeImg(element.imageUrls)' style="color: blue;">查看图片</a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="text-align: center;" *ngIf="!allCompanyPosition.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
<div style="margin-top: 25px; text-align: left;">
<h3 style="text-align: center;font-weight: 550;">重点提示</h3>
<!-- <mat-icon title="保存" style="margin-left: 11%; cursor: pointer;" (click)='Preservation()'>description</mat-icon> -->
<p class="tips">
<textarea readonly [(ngModel)]="companyInput" maxlength="500"></textarea>
</p>
</div>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuilding">
<div class="contentBox">

2
src/app/key-unit/key-site-look/key-site.component.scss

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 90%;
height: 100%;
padding: 10px;
overflow-y: auto;
.contentBox{

7
src/app/key-unit/key-site-look/key-site.component.ts

@ -19,8 +19,6 @@ export class KeySiteLookComponent implements OnInit {
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
ngOnInit(): void {
this.getCompanyPostion()
this.getCompanyTips()
this.getAllBuilding()
}
@ -59,6 +57,11 @@ export class KeySiteLookComponent implements OnInit {
element.companyInput = null }) //建筑重点提示数据
this.getAllBuildingPositon()
this.getAllBuildingTips()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

57
src/app/key-unit/key-site/key-site.component.html

@ -1,62 +1,5 @@
<div class="content">
<mat-tab-group style="height: 100%;">
<mat-tab label="单位重点部位">
<div class="contentBox">
<div style="margin-top: 25px;">
<h3 style="text-align: center;font-weight: 550;">重点部位情况</h3>
<table mat-table [dataSource]="allCompanyPosition">
<ng-container matColumnDef="mainname">
<th mat-header-cell *matHeaderCellDef>重点部位名称</th>
<td mat-cell *matCellDef="let element">
{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef>重点部位所在位置</th>
<td mat-cell *matCellDef="let element">
{{element.position}}
</td>
</ng-container>
<ng-container matColumnDef="construction">
<th mat-header-cell *matHeaderCellDef>建筑结构</th>
<td mat-cell *matCellDef="let element">
{{element.structure}}
</td>
</ng-container>
<ng-container matColumnDef="nature">
<th mat-header-cell *matHeaderCellDef>使用性质</th>
<td mat-cell *matCellDef="let element">
{{element.nature}}
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>主要危险性</th>
<td mat-cell *matCellDef="let element">
{{element.hazards}}
</td>
</ng-container>
<ng-container matColumnDef="img">
<th mat-header-cell *matHeaderCellDef>图片</th>
<td mat-cell *matCellDef="let element">
<a href="javascript:void(0);" (click)='seeImg(element.imageUrls)' style="color: blue;">查看图片</a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="text-align: center;" *ngIf="!allCompanyPosition.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
<div style="margin-top: 25px; text-align: left;">
<h3 style="text-align: center;font-weight: 550;">重点提示</h3>
<mat-icon title="保存" style="margin-left: 11%; cursor: pointer;" (click)='Preservation()'>description</mat-icon>
<p class="tips">
<textarea [(ngModel)]="companyInput" maxlength="5000"></textarea>
</p>
</div>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuilding">
<div class="contentBox">

2
src/app/key-unit/key-site/key-site.component.scss

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 90%;
height: 100%;
padding: 10px;
overflow-y: auto;
.contentBox{

7
src/app/key-unit/key-site/key-site.component.ts

@ -20,8 +20,6 @@ export class KeySiteComponent implements OnInit {
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
ngOnInit(): void {
this.getCompanyPostion()
this.getCompanyTips()
this.getAllBuilding()
}
@ -60,6 +58,11 @@ export class KeySiteComponent implements OnInit {
element.companyInput = null }) //建筑重点提示数据
this.getAllBuildingPositon()
this.getAllBuildingTips()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

2
src/app/key-unit/realistic-picture-look/realistic-picture.component.scss

@ -1,7 +1,7 @@
.content {
margin: 0 0 0 10px;
width: 100%;
height: 90%;
height: 100%;
overflow-y: auto;
display: flex;
.leftBox {

2
src/app/key-unit/realistic-picture/realistic-picture.component.scss

@ -1,7 +1,7 @@
.content {
margin: 0 0 0 10px;
width: 100%;
height: 90%;
height: 100%;
overflow-y: auto;
display: flex;
.leftBox {

122
src/app/key-unit/uploading-cad-look/uploading-cad.component.html

@ -1,64 +1,62 @@
<div class="header">
<!-- <button mat-raised-button color="primary" (click)="openReadFile()" *ngIf="!uploadisLoading">上传</button>
<button mat-raised-button color="primary" (click)='readFile()' *ngIf="!downloadisLoading">下载</button>
<button mat-raised-button color="primary" (click)='editFile()'>编辑</button>
<button mat-raised-button color="primary" (click)='deleteCAD()' style="margin-right: 25px;">删除</button> -->
<div class="progressBox" *ngIf="uploadisLoading">
<button mat-raised-button style="margin-right: 5px;" (click)="cancel()">取消上传</button>
<span style="font-size: 12px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress"></mat-progress-bar>
<div style="height: 100%; overflow-y: auto;">
<div class="header">
<div class="progressBox" *ngIf="uploadisLoading">
<button mat-raised-button style="margin-right: 5px;" (click)="cancel()">取消上传</button>
<span style="font-size: 12px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress"></mat-progress-bar>
</div>
<div class="progressBox" *ngIf="downloadisLoading">
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> -->
<span style="font-size: 12px;">下载中...</span>
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress" style="left: 52px;top: 13px;"></mat-progress-bar>
</div>
</div>
<div class="progressBox" *ngIf="downloadisLoading">
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> -->
<span style="font-size: 12px;">下载中...</span>
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress" style="left: 52px;top: 13px;"></mat-progress-bar>
<div style="padding: 10px;">
<table mat-table [dataSource]="CADList">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox disabled (change)='checkedCAD($event,element)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>名称</th>
<td mat-cell *matCellDef="let element">
<mat-icon style="color: #FFC122;">insert_drive_file</mat-icon>{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="!element.loading" ><mat-icon style="color: #00FF00;">check_circle</mat-icon></label>
<label *ngIf="element.loading" >正在下载...</label>
</td>
</ng-container>
<ng-container matColumnDef="size">
<th mat-header-cell *matHeaderCellDef>大小</th>
<td mat-cell *matCellDef="let element">
{{element.fileLength}}MB
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100px; margin: 30px auto; text-align: center;" *ngIf="!CADList.length">暂无数据</p>
</div>
</div>
<div style="overflow-y: auto;height: 90%; padding: 10px; box-sizing: border-box;overflow-x: hidden;">
<table mat-table [dataSource]="CADList">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox disabled (change)='checkedCAD($event,element)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>名称</th>
<td mat-cell *matCellDef="let element">
<mat-icon style="color: #FFC122;">insert_drive_file</mat-icon>{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="!element.loading" ><mat-icon style="color: #00FF00;">check_circle</mat-icon></label>
<label *ngIf="element.loading" >正在下载...</label>
</td>
</ng-container>
<ng-container matColumnDef="size">
<th mat-header-cell *matHeaderCellDef>大小</th>
<td mat-cell *matCellDef="let element">
{{element.fileLength}}MB
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100px; margin: 30px auto; text-align: center;" *ngIf="!CADList.length">暂无数据</p>
</div>
</div>

125
src/app/key-unit/uploading-cad/uploading-cad.component.html

@ -1,64 +1,67 @@
<div class="header">
<button mat-raised-button color="primary" (click)="openReadFile()" *ngIf="!uploadisLoading">上传</button>
<button mat-raised-button color="primary" (click)='readFile()' *ngIf="!downloadisLoading">下载</button>
<button mat-raised-button color="primary" (click)='editFile()'>编辑</button>
<button mat-raised-button color="primary" (click)='deleteCAD()' style="margin-right: 25px;">删除</button>
<div class="progressBox" *ngIf="uploadisLoading">
<button mat-raised-button style="margin-right: 5px;" (click)="cancel()">取消上传</button>
<span style="font-size: 12px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress"></mat-progress-bar>
<div style="height: 100%; overflow-y: auto;">
<div class="header">
<button mat-raised-button color="primary" (click)="openReadFile()" *ngIf="!uploadisLoading">上传</button>
<button mat-raised-button color="primary" (click)='readFile()' *ngIf="!downloadisLoading">下载</button>
<button mat-raised-button color="primary" (click)='editFile()'>编辑</button>
<button mat-raised-button color="primary" (click)='deleteCAD()' style="margin-right: 25px;">删除</button>
<div class="progressBox" *ngIf="uploadisLoading">
<button mat-raised-button style="margin-right: 5px;" (click)="cancel()">取消上传</button>
<span style="font-size: 12px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress"></mat-progress-bar>
</div>
<div class="progressBox" *ngIf="downloadisLoading">
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> -->
<span style="font-size: 12px;">下载中...</span>
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress" style="left: 52px;top: 13px;"></mat-progress-bar>
</div>
</div>
<div class="progressBox" *ngIf="downloadisLoading">
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> -->
<span style="font-size: 12px;">下载中...</span>
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress" style="left: 52px;top: 13px;"></mat-progress-bar>
<div style="padding: 10px;">
<table mat-table [dataSource]="CADList">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox (change)='checkedCAD($event,element)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>名称</th>
<td mat-cell *matCellDef="let element">
<mat-icon style="color: #FFC122;">insert_drive_file</mat-icon>{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="!element.loading" ><mat-icon style="color: #00FF00;">check_circle</mat-icon></label>
<label *ngIf="element.loading" >正在下载...</label>
</td>
</ng-container>
<ng-container matColumnDef="size">
<th mat-header-cell *matHeaderCellDef>大小</th>
<td mat-cell *matCellDef="let element">
{{element.fileLength}}MB
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100px; margin: 30px auto; text-align: center;" *ngIf="!CADList.length">暂无数据</p>
</div>
</div>
<div style="overflow-y: auto;height: 90%; padding: 10px; box-sizing: border-box;overflow-x: hidden;">
<table mat-table [dataSource]="CADList">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox (change)='checkedCAD($event,element)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>名称</th>
<td mat-cell *matCellDef="let element">
<mat-icon style="color: #FFC122;">insert_drive_file</mat-icon>{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="!element.loading" ><mat-icon style="color: #00FF00;">check_circle</mat-icon></label>
<label *ngIf="element.loading" >正在下载...</label>
</td>
</ng-container>
<ng-container matColumnDef="size">
<th mat-header-cell *matHeaderCellDef>大小</th>
<td mat-cell *matCellDef="let element">
{{element.fileLength}}MB
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100px; margin: 30px auto; text-align: center;" *ngIf="!CADList.length">暂无数据</p>
</div>
</div>

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

@ -1,4 +1,4 @@
<mat-tab-group selectedIndex="9" style="height: 94%;" >
<mat-tab-group selectedIndex="9" style="height: 99%;" >
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>
@ -34,21 +34,16 @@
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<mat-tab label="8.六熟悉记录">
<ng-template matTabContent>
功能开发中~~
</ng-template>
</mat-tab>
<mat-tab label="9.实战演练记录">
<ng-template matTabContent>
功能开发中~~
</ng-template>
</mat-tab>
<mat-tab label="10.作战部署">
<mat-tab label="8.作战部署">
<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> -->
</ng-template>
</mat-tab>
</mat-tab>
<!-- <mat-tab label="9.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>
</ng-template>
</mat-tab> -->
</mat-tab-group>

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

@ -1,4 +1,4 @@
<mat-tab-group selectedIndex="0" style="height:97%;" (selectedTabChange)="selectedtab($event)">
<mat-tab-group selectedIndex="0" style="height:99%;" (selectedTabChange)="selectedtab($event)">
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>
@ -6,7 +6,6 @@
</mat-tab>
<mat-tab label="2.平面图">
<ng-template matTabContent>
<!-- <iframe id="main" src="/unityApp2Basic/index.html" name="unityApp" frameborder="0" width="96%" height="100%" style="margin-left:2%;"></iframe> -->
<app-collection-tools-plan></app-collection-tools-plan>
</ng-template>
</mat-tab>
@ -40,15 +39,10 @@
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<mat-tab label="9.六熟悉记录">
<ng-template matTabContent>
<app-six-familiar-list></app-six-familiar-list>
</ng-template>
</mat-tab>
<mat-tab label="10.实战演练记录">
<ng-template matTabContent>
功能开发中~~
</ng-template>
</mat-tab>
<!-- <mat-tab label="9.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>
</mat-tab> -->
</mat-tab-group>

5
src/app/navigation/navigation.component.ts

@ -51,10 +51,7 @@ export class NavigationComponent implements OnInit {
redtheme(){
this.darktheme = true
}
toGis(){
// console.log(123)
window.open(`http://39.106.78.171:8000`);
}
}

312
src/app/plan-audit/detachment-level/detachment-level.component.html

@ -1,161 +1,163 @@
<div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field>
<input matInput placeholder="请输入单位名称" name="CompanyName" [(ngModel)]="CompanyName">
</mat-form-field>
</div>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field>
<input readonly matInput placeholder="请选择消防救援站" [(ngModel)]="selectOrganizationIName" name="selectOrganizationIName" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 5px;" [(ngModel)]="HasChildrenOrganization" name="HasChildrenOrganization">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
<div style="height: 100%; overflow-y: auto;">
<div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field>
<input matInput placeholder="请输入单位名称" name="CompanyName" [(ngModel)]="CompanyName">
</mat-form-field>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="BuildingTypeId" name="BuildingTypeId">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择预案类型' [(ngModel)]="PlanType" name="PlanType">
<mat-option *ngFor="let plan of planpatterns" [value]="plan.value">
{{plan.name}}
</mat-option>
</mat-select>
</mat-form-field>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field>
<input readonly matInput placeholder="请选择消防救援站" [(ngModel)]="selectOrganizationIName" name="selectOrganizationIName" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 5px;" [(ngModel)]="HasChildrenOrganization" name="HasChildrenOrganization">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="BuildingTypeId" name="BuildingTypeId">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择预案类型' [(ngModel)]="PlanType" name="PlanType">
<mat-option *ngFor="let plan of planpatterns" [value]="plan.value">
{{plan.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择审核状态' [(ngModel)]="AuditStatus" name="AuditStatus">
<mat-option *ngFor="let state of passstates" [value]="state.value">
{{state.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择审核状态' [(ngModel)]="AuditStatus" name="AuditStatus">
<mat-option *ngFor="let state of passstates" [value]="state.value">
{{state.name}}
</mat-option>
</mat-select>
</mat-form-field>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</form>
</div>
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.companyName}}</td>
</ng-container>
<ng-container matColumnDef="planname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="addpeople">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planType==8">卡片预案</label>
<label *ngIf="element.planType==1">二维预案</label>
<label *ngIf="element.planType==2">三维预案</label>
<label *ngIf="element.planType==4">其他预案</label>
</td>
</ng-container>
<ng-container matColumnDef="auditstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.auditStatus==0">预案未审核</label>
<label *ngIf="element.auditStatus==1">审核中</label>
<label *ngIf="element.auditStatus==2">审核通过</label>
<label *ngIf="element.auditStatus==4">审核退回</label>
</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="preparethelevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planLevel==1">总队</label>
<label *ngIf="element.planLevel==2">支队</label>
<label *ngIf="element.planLevel==4">大队</label>
<label *ngIf="element.planLevel==8">中队</label>
</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<label style="color: #0000FF;cursor: pointer;" (click)='toExamine(element)' *ngIf="element.auditStatus!=4">预案审核</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)' *ngIf="element.auditStatus==2">预案公开</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)' *ngIf="element.auditStatus==2">预案取消公开</label>
<label style="color: #999;"*ngIf="element.auditStatus==4">预案已驳回</label>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.companyName}}</td>
</ng-container>
<ng-container matColumnDef="planname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="addpeople">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planType==8">卡片预案</label>
<label *ngIf="element.planType==1">二维预案</label>
<label *ngIf="element.planType==2">三维预案</label>
<label *ngIf="element.planType==4">其他预案</label>
</td>
</ng-container>
<ng-container matColumnDef="auditstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.auditStatus==0">预案未审核</label>
<label *ngIf="element.auditStatus==1">审核中</label>
<label *ngIf="element.auditStatus==2">审核通过</label>
<label *ngIf="element.auditStatus==4">审核退回</label>
</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="preparethelevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planLevel==1">总队</label>
<label *ngIf="element.planLevel==2">支队</label>
<label *ngIf="element.planLevel==4">大队</label>
<label *ngIf="element.planLevel==8">中队</label>
</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<label style="color: #0000FF;cursor: pointer;" (click)='toExamine(element)' *ngIf="element.auditStatus!=4">预案审核</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)' *ngIf="element.auditStatus==2">预案公开</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)' *ngIf="element.auditStatus==2">预案取消公开</label>
<label style="color: #999;"*ngIf="element.auditStatus==4">预案已驳回</label>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>

2
src/app/plan-audit/detachment-level/detachment-level.component.ts

@ -199,7 +199,7 @@ export class DetachmentLevelComponent implements OnInit {
//预案审核
toExamine (e) {
window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}`);
window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}&planType=1`);
}
//预案公开

336
src/app/plan-audit/plan-audit/plan-audit.component.html

@ -1,173 +1,175 @@
<div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field>
<input matInput placeholder="请输入单位名称" name="CompanyName" [(ngModel)]="CompanyName">
</mat-form-field>
</div>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field>
<input readonly matInput placeholder="请选择消防救援站" [(ngModel)]="selectOrganizationIName" name="selectOrganizationIName" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 5px;" [(ngModel)]="HasChildrenOrganization" name="HasChildrenOrganization">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
<div style="height: 100%; overflow-y: auto;">
<div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field>
<input matInput placeholder="请输入单位名称" name="CompanyName" [(ngModel)]="CompanyName">
</mat-form-field>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="BuildingTypeId" name="BuildingTypeId">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择预案类型' [(ngModel)]="PlanType" name="PlanType">
<mat-option *ngFor="let plan of planpatterns" [value]="plan.value">
{{plan.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择审核状态' [(ngModel)]="AuditStatus" name="AuditStatus">
<mat-option *ngFor="let state of passstates" [value]="state.value">
{{state.name}}
</mat-option>
</mat-select>
</mat-form-field>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field>
<input readonly matInput placeholder="请选择消防救援站" [(ngModel)]="selectOrganizationIName" name="selectOrganizationIName" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 5px;" [(ngModel)]="HasChildrenOrganization" name="HasChildrenOrganization">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' [(ngModel)]="BuildingTypeId" name="BuildingTypeId">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择预案类型' [(ngModel)]="PlanType" name="PlanType">
<mat-option *ngFor="let plan of planpatterns" [value]="plan.value">
{{plan.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择审核状态' [(ngModel)]="AuditStatus" name="AuditStatus">
<mat-option *ngFor="let state of passstates" [value]="state.value">
{{state.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择编制级别' [(ngModel)]="PlanLevel" name="PlanLevel">
<mat-option *ngFor="let level of preparelevels" [value]="level.value">
{{level.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 5px;" [(ngModel)]="HasChildrenPlanLevel" name="HasChildrenPlanLevel">包含下级</mat-checkbox>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field class="maginleft">
<mat-select placeholder='请选择编制级别' [(ngModel)]="PlanLevel" name="PlanLevel">
<mat-option *ngFor="let level of preparelevels" [value]="level.value">
{{level.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 5px;" [(ngModel)]="HasChildrenPlanLevel" name="HasChildrenPlanLevel">包含下级</mat-checkbox>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</form>
</div>
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.companyName}}</td>
</ng-container>
<ng-container matColumnDef="planname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="addpeople">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planType==8">卡片预案</label>
<label *ngIf="element.planType==1">二维预案</label>
<label *ngIf="element.planType==2">三维预案</label>
<label *ngIf="element.planType==4">其他预案</label>
</td>
</ng-container>
<ng-container matColumnDef="auditstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.auditStatus==0">预案未审核</label>
<label *ngIf="element.auditStatus==1">审核中</label>
<label *ngIf="element.auditStatus==2">审核通过</label>
<label *ngIf="element.auditStatus==4">审核退回</label>
</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="preparethelevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planLevel==1">总队</label>
<label *ngIf="element.planLevel==2">支队</label>
<label *ngIf="element.planLevel==4">大队</label>
<label *ngIf="element.planLevel==8">中队</label>
</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<label style="color: #0000FF;cursor: pointer;" (click)='toExamine(element)' *ngIf="element.auditStatus!=4">预案审核</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)' *ngIf="element.auditStatus==2">预案公开</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)' *ngIf="element.auditStatus==2">预案取消公开</label>
<label style="color: #999;"*ngIf="element.auditStatus==4">预案已驳回</label>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.companyName}}</td>
</ng-container>
<ng-container matColumnDef="planname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="addpeople">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planType==8">卡片预案</label>
<label *ngIf="element.planType==1">二维预案</label>
<label *ngIf="element.planType==2">三维预案</label>
<label *ngIf="element.planType==4">其他预案</label>
</td>
</ng-container>
<ng-container matColumnDef="auditstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.auditStatus==0">预案未审核</label>
<label *ngIf="element.auditStatus==1">审核中</label>
<label *ngIf="element.auditStatus==2">审核通过</label>
<label *ngIf="element.auditStatus==4">审核退回</label>
</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="preparethelevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">
<label *ngIf="element.planLevel==1">总队</label>
<label *ngIf="element.planLevel==2">支队</label>
<label *ngIf="element.planLevel==4">大队</label>
<label *ngIf="element.planLevel==8">中队</label>
</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<label style="color: #0000FF;cursor: pointer;" (click)='toExamine(element)' *ngIf="element.auditStatus!=4">预案审核</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='openReserve(element)' *ngIf="element.auditStatus==2">预案公开</label>
<label style="color: #0000FF;margin-left: 10px;cursor: pointer;" (click)='closeReserve(element)' *ngIf="element.auditStatus==2">预案取消公开</label>
<label style="color: #999;"*ngIf="element.auditStatus==4">预案已驳回</label>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>

2
src/app/plan-audit/plan-audit/plan-audit.component.ts

@ -224,7 +224,7 @@ export class PlanAuditComponent implements OnInit {
//预案审核
toExamine (e) {
window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}`);
window.open(`/planAudit/planpass?id=${e.companyId}&companyName=${e.companyName}&auditPlanId=${e.id}&auditStatus=${e.auditStatus}&planType=1`);
}
//预案公开

117
src/app/plan-audit/plan-pass/plan-pass.component.html

@ -1,65 +1,68 @@
<div style="height: 100%; overflow: hidden; display: flex; flex-direction: column;">
<mat-accordion>
<mat-expansion-panel disabled>
<mat-expansion-panel-header>
<div class="planHeader">
<mat-accordion>
<mat-expansion-panel disabled>
<mat-expansion-panel-header>
<div class="planHeader">
<div class="planBox">
<span>单位名称: </span>
<span>{{compantData.name?compantData.name : '暂无数据'}}</span>
</div>
<div class="planBox">
<span>消防救援站: </span>
<span>{{compantData.organizationName?compantData.organizationName : '暂无数据'}}</span>
</div>
<div class="planBox">
<span>单位类型: </span>
<span>{{compantData.buildingTypes.length?compantData.buildingTypes[0].name : '暂无数据'}}</span>
</div>
<div class="planBox">
<span>单位地址: </span>
<span>{{compantData.address?compantData.address : '暂无数据'}}</span>
<div class="planBox">
<span>单位名称: </span>
<span>{{compantData.name?compantData.name : '暂无数据'}}</span>
</div>
<div class="planBox">
<span>消防救援站: </span>
<span>{{organizationName}}</span>
</div>
<div class="planBox">
<span>单位类型: </span>
<span>{{compantData.buildingTypes.length?compantData.buildingTypes[0].name : '暂无数据'}}</span>
</div>
<div class="planBox">
<span>单位地址: </span>
<span>{{compantData.address?compantData.address : '暂无数据'}}</span>
</div>
<div>
<button mat-raised-button color="primary" (click)='toExamine()' *ngIf="type != 6">审核</button>
</div>
</div>
<div>
<button mat-raised-button color="primary" (click)='toExamine()' *ngIf="type != 6">审核</button>
</div>
</div>
</mat-expansion-panel-header>
</mat-expansion-panel>
</mat-accordion>
</mat-expansion-panel-header>
</mat-expansion-panel>
</mat-accordion>
<div class="planBody" style="width: 100%;height: 100%;padding: 10px;box-sizing: border-box;overflow-y: auto;">
<div class="planBody" style="flex: 1; overflow: hidden;">
<div class="table" style="width: 100%;" *ngIf="planType==0">
<table mat-table [dataSource]="allFile">
<div class="table" style="width: 100%;" *ngIf="planType==0">
<table mat-table [dataSource]="allFile">
<ng-container matColumnDef="filename">
<th mat-header-cell *matHeaderCellDef>文件名称</th>
<td mat-cell *matCellDef="let element">{{element.fileName?element.fileName : compantData.name}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>上传时间</th>
<td mat-cell *matCellDef="let element">{{element.lastModified | date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<label style="color: #0000FF;cursor: pointer;" (click)='download(element)' *ngIf="!element.isLoading">下载</label>
<label *ngIf="element.isLoading">正在下载... {{element.progress}}</label>
<label></label>
</td>
</ng-container>
<ng-container matColumnDef="filename">
<th mat-header-cell *matHeaderCellDef>文件名称</th>
<td mat-cell *matCellDef="let element">{{element.fileName?element.fileName : compantData.name}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>上传时间</th>
<td mat-cell *matCellDef="let element">{{element.lastModified | date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<label style="color: #0000FF;cursor: pointer;" (click)='download(element)' *ngIf="!element.isLoading">下载</label>
<label *ngIf="element.isLoading">正在下载... {{element.progress}}</label>
<label></label>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<div style="width: 100%; height: 100%;" *ngIf="planType==2">
<app-view-unit-details-plan></app-view-unit-details-plan>
</div>
<div style="width: 100%; height: 100%;" *ngIf="planType==3">
<iframe [src]='thirdPartyURL' frameborder="0" width="100%" height="100%" id="iframe"></iframe>
</div>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<div style="width: 100%; height: 100%;" *ngIf="planType==2">
<app-view-unit-details-plan></app-view-unit-details-plan>
</div>
<div style="width: 100%; height: 100%;" *ngIf="planType==3">
<iframe [src]='thirdPartyURL' frameborder="0" width="100%" height="100%" id="iframe"></iframe>
</div>
</div>
</div>

27
src/app/plan-audit/plan-pass/plan-pass.component.ts

@ -30,28 +30,22 @@ export class PlanPassComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,
public snackBar: MatSnackBar,private sanitizer: DomSanitizer) { }
type:any //审核按钮是否出现
ngOnInit(): void {
this.type = this.route.snapshot.queryParams.type
this.type = this.route.snapshot.queryParams.type
this.getCompanyData()
this.getPlanData()
}
type:any //审核按钮是否出现
displayedColumns: string[] = ['filename','addtime','operation']; //表头
compantData:any = {name:'',organizationName: '', buildingTypes:[{name:''}], address:''}; //当前单位信息
organizationName:any = ''; //组织机构名称
planData:any; //审核预案信息
//获取当前单位信息
getCompanyData () {
let header = {
CompanyName: this.route.snapshot.queryParams.companyName || '',
PageSize: '100'}
this.http.get('/api/Plans',{params:header}).subscribe((data:any)=>{
data.items.forEach(element => {
if (element.companyId===this.route.snapshot.queryParams.id) {
this.compantData = element.company
return } });
this.http.get(`/api/Plans/${this.route.snapshot.queryParams.id}`).subscribe((data:any)=>{
data && data.company? this.compantData = data.company : null
})
}
@ -62,19 +56,24 @@ export class PlanPassComponent implements OnInit {
AuditStatus: this.route.snapshot.queryParams.auditStatus || '',
PageSize: '100',
}
this.http.get('/api/PlanAudits',{params:header}).subscribe((data:any)=>{
let api
this.route.snapshot.queryParams.planType == 1? api = '/api/PlanAudits' : api = '/api/PublicPlans' //1=预案审核 2=公开预案
this.http.get(api,{params:header}).subscribe((data:any)=>{
data.items.forEach(element => {
if (element.id===this.route.snapshot.queryParams.auditPlanId) {
this.planData = element
this.organizationName = element.committerOrganizationName
this.handleData()
return } });
return
}
});
})
}
planType:any; //展示预案类型
allFile:any = []; //类型=0时所有文件
thirdPartyURL:any; //类型=3时网址
handleData () {
this.planType = this.planData.planMode
let data = this.planData

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

@ -1,6 +1,6 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form >
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
@ -14,32 +14,37 @@
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-option value="1"></mat-option>
<mat-option value="2"></mat-option>
<mat-select placeholder='请选择预案级别' name="level" [(ngModel)]="level">
<mat-option value="6">国家</mat-option>
<mat-option value="7"></mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加人:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入添加人" name="companyName" autocomplete="off" [(ngModel)]="addname">
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="companyName" autocomplete="off" [(ngModel)]="addtime">
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput autocomplete="off" >
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案类型" name="companyName" autocomplete="off" [(ngModel)]="unittype">
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-option value="8">卡片预案</mat-option>
<mat-option value="1">二维预案</mat-option>
<mat-option value="2">三维预案</mat-option>
<mat-option value="4">其他预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
@ -82,42 +87,44 @@
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.unitname}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>预案级别</th>
<td mat-cell *matCellDef="let element">{{url=='2'?'Ⅱ级':'Ⅰ级'}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案级别</th>
<td mat-cell *matCellDef="let element">{{element.planCategory=='6'?'国家级':'市级'}}</td>
</ng-container>
<ng-container matColumnDef="addname">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.addname}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">{{element.addtime}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加时间</th>
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.plantype}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType=='1'?'二维预案':element.planType=='2'?'三维预案':element.planType=='4'?'其他预案':'卡片预案'}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.passstate}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">审核状态</th>
<td mat-cell *matCellDef="let element">{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':'审核退回'}}</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.isopen}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.projectlevel}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">编制级别</th>
<td mat-cell *matCellDef="let element">{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span style="color: blue;">查看预案</span>
<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)='readFile(element)'>下载</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

3
src/app/plan-management/meet-plan/meet-plan.component.scss

@ -114,5 +114,8 @@
.mat-column-jurisdictionsquadron{
width: 10%;
}
span:hover{
text-decoration:underline
}
}
}

357
src/app/plan-management/meet-plan/meet-plan.component.ts

@ -47,10 +47,9 @@ export class MeetPlanComponent implements OnInit {
{name:"中队",value:"8"}
]
}
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
this.getAlltabledate()
}
url
preparelevels:any
plcheck:boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
@ -59,6 +58,8 @@ export class MeetPlanComponent implements OnInit {
level//预案级别
addname//添加人
addtime//添加时间
endtime
reservePlanType//预案类型
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
@ -71,21 +72,162 @@ export class MeetPlanComponent implements OnInit {
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
//获得所有预案信息
getAllPlanInfo(){
//获取表格数据
getAlltabledate(){
let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = ''
if(this.reservePlanType && this.reservePlanType.length != 0){
reservePlanType = eval(this.reservePlanType.join("|"))
}
let paramsdata:any = {
HasChildrenPlanLevel: this.plcheck || '',
Name:this.unitname||'',
planCategories:this.level||[6,7],
PlanType:reservePlanType||'',
CreatorName:this.addname||'',
AuditStatus:this.unitstate|| '',
QueryStartTime:this.addtime||'',
QueryEndTime:this.endtime||'',
PlanLevel:this.projectlevel||'',
HasChildrenPlanLevel:this.plcheck||'',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
}
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{
this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount
//this.allPlanInfo = data
//this.tabledataSource = new MatTableDataSource(data.items)
console.log(this.tabledataSource)
this.tabledataSource = data.items
})
}
//查询
onSubmit (value) {
if(this.endtime!=undefined&&this.addtime>this.endtime){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('开始时间不能大于结束时间!','确定',config);
}else{
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAlltabledate();
}
}
//删除预案
deletePlan(id){
let isTrue = confirm('您确定要删除吗')
if(isTrue){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{
this.snackBar.open('删除成功!','确定',config);
this.getAlltabledate()
},err => {
this.snackBar.open(err,'确定',config);
})
}
}
//下载↓
selectDownloadFile:any; //选择下载的文件
download:any; //下载文件元数据
downloadisLoading:boolean = false; //进度条loading加载
downloadProgress:number=0; //进度条进度
downloadFileName:any
fileUrls:any //当前预案附件地址
fileDatas:any = []
selectedFileIndex : any = 0
selectedFileData : any
uploadFileLonging:any
//读取下载文件信息
readFile (element) {
this.uploadFileLonging = element
element.attachmentUrls.forEach(item=>{
this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{
data.filePige = (data.fileLength / (1024*1024)).toFixed(2)
this.download = data
this.downloadFile()
})
})
}
//初始化下载
downloadFile () {
this.downloadProgress = 0
let file = this.download
let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载
this.downloadisLoading = true
// this.setFileLoading()
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ;
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link);
link.click();
this.downloadisLoading = false
// this.setFileLoading()
})
} else if (file && fileSize > shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载
this.downloadisLoading = true
// this.setFileLoading()
}
}
//分段下载并合并
async blockingDownload () {
let file = this.download
let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段
let allFile:any = [] //所有的file分段
for (let i=0;i<allSlice;i++) {
let start = i * shardSize //每次下载文件开始位置
let end = Math.min(fileSize, start + shardSize-1); //每次下载文件结束为止
let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{
result(data) })
})
allFile.push(result)
this.downloadProgress = Number((i/allSlice).toFixed(2))*100
if (allFile.length === allSlice) { //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ;
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link);
link.click();
// this.downloadProgress = 0
this.downloadisLoading = false
// this.setFileLoading()
}
} //for循环
}
//取消分块下载
cancelDowload () {
}
//重置
@ -94,17 +236,24 @@ export class MeetPlanComponent implements OnInit {
this.level=''
this.addname=''
this.addtime=''
this.unittype=''
this.endtime=''
this.reservePlanType=''
this.unitstate=''
this.projectlevel=''
this.plcheck=false
this.getAlltabledate()
}
//新增预案弹窗
addunit(){
const dialogRef = this.dialog.open(newunitMeet, {
width: '340px',
height:'430px'
height:'505px'
//data: paperDataInfo
});
dialogRef.afterClosed().subscribe(result => {
this.getAlltabledate()
}
);
}
}
@ -119,9 +268,189 @@ export class newunitMeet{
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
reservePlanType//预案类型
unitstate//审核状态
projectlevel//编制级别
//上传文件↓
file:any; //上传的文件
fileName:any; //上传文件name
uploadisLoading:boolean = false; //进度条loading加载
uploadProgress:number=0; //进度条进度
objectName:any; //上传对象名
uploadId:any; //上传分块上传事件编号
uploadover:any = false //上传完成之后提示
selectedPLanType:any//所选预案类型
selectedPLanName:any//所选预案名称
localup:boolean = false //本地上传
defaultisshow = '0' //默认显示上传input框
//上传
upload(){
document.getElementById('up').click()
}
//上传文件input
filechange(e){
this.file = e.target.files[0] || null //上传的文件
//console.log(this.file)
}
//上传文件
startUploading (planType) {
let file = this.file || 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)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.http.post('/api/Objects/PlanPlatform/meetClass',formData).subscribe((data:any)=>{
this.objectName = data.objectName
//this.snackBar.open('上传成功!','确定',config);
let body:any = {
Name:this.unitname||'',
PlanCategory:Number(this.level)||'',
PlanType: Number(this.reservePlanType),
PlanLevel:1,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
}
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
//console.log(data)
this.dialogRef.close();
},err=>{
this.snackBar.open('创建失败!','确定',config);
})
},err=>{
this.snackBar.open('上传失败!','确定',config);
})
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
let data = {filename: file.name}
this.uploadisLoading = true
this.http.post('/api/NewMultipartUpload/PlanPlatform/meetClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading(planType)
})
}
}
PartNumberETag:any=[]; //每次返回需要保存的信息
//开始分段上传
async subsectionUploading (planType) {
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
for (let i = 0;i < allSlice;i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
let formData = new FormData()
formData.append("file",file.slice(start, end))
//同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{
let msg = {
"partNumber":data.partNumber || null,
"eTag": data.eTag || null}
resolve(msg) // 调用 promise 内置方法处理成功
})
});
this.PartNumberETag.push(result)
this.uploadProgress = Number((i/allSlice).toFixed(2))*100
if (this.PartNumberETag.length === allSlice) {
this.uploadProgress = 100
this.endUploading(planType)}
}//for循环
}
//完成分块上传
endUploading (planType) {
let data = this.PartNumberETag
let paramsData = {uploadId:this.uploadId}
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
//this.snackBar.open('上传成功!','确定',config);
this.uploadProgress = 0;
this.uploadisLoading = false
this.PartNumberETag =[] //清空保存返回的信息
this.uploadover = true
let body:any = {
Name:this.unitname||'',
PlanCategory:Number(this.level)||'',
PlanType: Number(this.reservePlanType),
PlanLevel:1,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
}
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
this.dialogRef.close();
},err=>{
this.snackBar.open('创建失败!','确定',config);
})
})
}
//取消分块上传
cancel () {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000;
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{
this.uploadProgress = 0;
this.uploadisLoading= false;
(<HTMLInputElement>document.getElementById('up')).value = null
this.PartNumberETag =[] //清空保存返回的信息
this.snackBar.open('取消上传成功!','确定',config);
this.uploadover = false
this.file = null
})
}
//创建预案
newplan(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.unitname==undefined||this.unitname==''){
this.snackBar.open('请输入预案名称!','确定',config);
}
else if(this.reservePlanType==undefined||this.reservePlanType==''){
this.snackBar.open('请输入预案类型!','确定',config);
}
else if(this.level==undefined||this.level==''){
this.snackBar.open('请输入预案级别!','确定',config);
}
else if(this.file==undefined){
this.snackBar.open('请先上传文件!','确定',config);
}
else{
if(this.reservePlanType!='1'){
this.startUploading("非二维")
}
else{this.startUploading("二维")}
}
}
//取消
close(){
this.dialogRef.close();
}

32
src/app/plan-management/meet-plan/newunit.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 09:34:26
* @LastEditTime: 2021-01-11 13:56:29
-->
<div class="box">
<div class="top">
@ -13,30 +13,42 @@
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
<input matInput placeholder="请输入预案名称" name="companyName" autocomplete="off" [(ngModel)]="unitname" required>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案类型" name="companyName" autocomplete="off" [(ngModel)]="unittype">
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" autocomplete="off" placeholder='请选择预案类型' required>
<mat-option value='8'>卡片预案</mat-option>
<mat-option value='1'>二维预案</mat-option>
<mat-option value='2'>三维预案</mat-option>
<mat-option value='4'>其他预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-option value="1">国家级</mat-option>
<mat-option value="2">市级</mat-option>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level" required>
<mat-option value="6">国家级</mat-option>
<mat-option value="7">市级</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" ><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" (click)='upload()'><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
<input type="file" style="display: none;" id="up" (change)='filechange($event)' accept=".doc,.txt,.docx,.pdf">
<div *ngIf="file!=undefined"><label style="font-size: 10px;">{{file.name}}</label></div>
<div *ngIf="uploadisLoading">
<span style="font-size: 10px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress" style="width: 250px;"></mat-progress-bar>
<button mat-raised-button (click)="cancel()" style="width: 80px;font-size: 10px;margin-top: 3px;">取消上传</button>
</div>
</div>
<div class="bottom">
<button mat-raised-button color="primary">确定</button>
<button mat-raised-button color="primary" (click)='newplan()'>确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
</div>

2
src/app/plan-management/meet-plan/newunit.scss

@ -7,7 +7,7 @@
.queryField {
margin: 3px 5px;
input {
width: 50px;
width: 100%;
height: 18px;
line-height: 18px;
border-radius: 3px;}

34
src/app/plan-management/onetwo-entry-plan/newunit.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-28 11:47:01
* @LastEditTime: 2021-01-11 13:55:40
-->
<div class="box">
<div class="top">
@ -13,30 +13,34 @@
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname" required>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案类型" name="companyName" autocomplete="off" [(ngModel)]="unittype">
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" autocomplete="off" placeholder='请选择预案类型' required>
<mat-option value='8'>卡片预案</mat-option>
<mat-option value='1'>二维预案</mat-option>
<mat-option value='2'>三维预案</mat-option>
<mat-option value='4'>其他预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-option value="1">Ⅰ级</mat-option>
<mat-option value="2">Ⅱ级</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" ><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
<button mat-raised-button color="primary" (click)='upload()'><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
<input type="file" style="display: none;" id="up" (change)='filechange($event)' accept=".doc,.txt,.docx,.pdf">
<div *ngIf="file!=undefined"><label style="font-size: 10px;">{{file.name}}</label></div>
<div *ngIf="uploadisLoading">
<span style="font-size: 10px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress" style="width: 250px;"></mat-progress-bar>
<button mat-raised-button (click)="cancel()" style="width: 80px;font-size: 10px;margin-top: 3px;">取消上传</button>
</div>
</div>
<div class="bottom">
<button mat-raised-button color="primary">确定</button>
<button mat-raised-button color="primary" (click)='newplan()'>确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
</div>

2
src/app/plan-management/onetwo-entry-plan/newunit.scss

@ -7,7 +7,7 @@
.queryField {
margin: 3px 5px;
input {
width: 50px;
width: 100%;
height: 18px;
line-height: 18px;
border-radius: 3px;}

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

@ -4,11 +4,11 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 10:37:08
* @LastEditTime: 2021-01-09 10:37:36
-->
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form >
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
@ -19,35 +19,32 @@
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案级别:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="level">
<mat-option value="1">Ⅰ级</mat-option>
<mat-option value="2">Ⅱ级</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加人:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入添加人" name="companyName" autocomplete="off" [(ngModel)]="addname">
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="companyName" autocomplete="off" [(ngModel)]="addtime">
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput autocomplete="off" >
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入预案类型" name="companyName" autocomplete="off" [(ngModel)]="unittype">
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-option value="8">卡片预案</mat-option>
<mat-option value="1">二维预案</mat-option>
<mat-option value="2">三维预案</mat-option>
<mat-option value="4">其他预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
@ -86,46 +83,49 @@
<div class="newadd">
<button mat-raised-button color="primary" (click)="addunit()"><img style="margin-bottom: 3px;" src="../../../assets/images/newadd.png"> 新增</button>
</div>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.unitname}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="level">
<th mat-header-cell *matHeaderCellDef>预案级别</th>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案级别</th>
<td mat-cell *matCellDef="let element">{{url=='2'?'Ⅱ级':'Ⅰ级'}}</td>
</ng-container>
<ng-container matColumnDef="addname">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.addname}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">{{element.addtime}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加时间</th>
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.plantype}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType=='1'?'二维预案':element.planType=='2'?'三维预案':element.planType=='4'?'其他预案':'卡片预案'}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.passstate}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">审核状态</th>
<td mat-cell *matCellDef="let element">{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':'审核退回'}}</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.isopen}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.projectlevel}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">编制级别</th>
<td mat-cell *matCellDef="let element">{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)='routerTo(element)' style="color: blue;">查看预案</span>
<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)='readFile(element)'>下载</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

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

@ -114,5 +114,8 @@
.mat-column-jurisdictionsquadron{
width: 10%;
}
span:hover{
text-decoration:underline
}
}
}

374
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-06 10:39:07
* @LastEditTime: 2021-01-11 14:04:49
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -19,20 +19,7 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { ConstantPool } from '@angular/compiler';
import { MatTableDataSource } from '@angular/material/table';
export interface PeriodicElement {
unitname: string;
level: string;
addname: string;
addtime: string;
unittype: string;
unitstate: string;
isopen: string;
projectlevel: string;
}
const ELEMENT_DATA=[
{unitname:"抗洪抢险救援应急救援预案",level:"Ⅰ级",addname:"张三",addtime:"2020-12-16",plantype:"洪涝",passstate:"审核通过",isopen:"未公开",projectlevel:"总队"},
{unitname:"泥石流应急救援预案",level:"Ⅰ级",addname:"韩信",addtime:"2020-12-16",plantype:"泥石流",passstate:"审核中",isopen:"未公开",projectlevel:"支队"}
]
@Component({
selector: 'app-onetwo-entry-plan',
@ -72,18 +59,20 @@ export class OnetwoEntryPlanComponent implements OnInit {
]
}
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
this.getAlltabledate()
}
url
preparelevels:any
plcheck:boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
tabledataSource=ELEMENT_DATA
tabledataSource
unitname//预案名称
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
endtime//结束时间
reservePlanType//预案类型
unitstate//审核状态
projectlevel//编制级别
//分页
@ -95,20 +84,30 @@ export class OnetwoEntryPlanComponent implements OnInit {
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
//获得所有预案信息
getAllPlanInfo(){
//获取表格数据
getAlltabledate(){
let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = ''
if(this.reservePlanType && this.reservePlanType.length != 0){
reservePlanType = eval(this.reservePlanType.join("|"))
}
let paramsdata:any = {
HasChildrenPlanLevel: this.plcheck || '',
Name:this.unitname||'',
planCategories:this.url=='2'?2:1,
PlanType:reservePlanType||'',
CreatorName:this.addname||'',
AuditStatus:this.unitstate|| '',
QueryStartTime:this.addtime||'',
QueryEndTime:this.endtime||'',
PlanLevel:this.projectlevel||'',
HasChildrenPlanLevel:this.plcheck||'',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
}
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{
this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount
//this.allPlanInfo = data
//this.tabledataSource = new MatTableDataSource(data.items)
console.log(this.tabledataSource)
this.tabledataSource = data.items
})
}
@ -118,22 +117,160 @@ export class OnetwoEntryPlanComponent implements OnInit {
this.level=''
this.addname=''
this.addtime=''
this.unittype=''
this.endtime=''
this.reservePlanType=''
this.unitstate=''
this.projectlevel=''
this.plcheck=false
this.getAlltabledate()
}
//查询
onSubmit (value) {
//console.log(value)
if(this.endtime!=undefined&&this.addtime>this.endtime){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('开始时间不能大于结束时间!','确定',config);
}else{
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAlltabledate();
}
}
//删除预案
deletePlan(id){
let isTrue = confirm('您确定要删除吗')
if(isTrue){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{
this.snackBar.open('删除成功!','确定',config);
this.getAlltabledate()
},err => {
this.snackBar.open(err,'确定',config);
})
}
}
//新增预案弹窗
addunit(){
const dialogRef = this.dialog.open(newunitComponent, {
width: '340px',
height:'430px'
height:'440px'
//data: paperDataInfo
});
dialogRef.afterClosed().subscribe(result => {
this.getAlltabledate()
}
);
}
//下载↓
selectDownloadFile:any; //选择下载的文件
download:any; //下载文件元数据
downloadisLoading:boolean = false; //进度条loading加载
downloadProgress:number=0; //进度条进度
downloadFileName:any
fileUrls:any //当前预案附件地址
fileDatas:any = []
selectedFileIndex : any = 0
selectedFileData : any
uploadFileLonging:any
//读取下载文件信息
readFile (element) {
this.uploadFileLonging = element
element.attachmentUrls.forEach(item=>{
this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{
data.filePige = (data.fileLength / (1024*1024)).toFixed(2)
//console.log(data)
this.download = data
this.downloadFile()
})
})
}
//初始化下载
downloadFile () {
this.downloadProgress = 0
let file = this.download
let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载
this.downloadisLoading = true
// this.setFileLoading()
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ;
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link);
link.click();
this.downloadisLoading = false
// this.setFileLoading()
})
} else if (file && fileSize > shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载
this.downloadisLoading = true
// this.setFileLoading()
}
}
//分段下载并合并
async blockingDownload () {
let file = this.download
let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段
let allFile:any = [] //所有的file分段
for (let i=0;i<allSlice;i++) {
let start = i * shardSize //每次下载文件开始位置
let end = Math.min(fileSize, start + shardSize-1); //每次下载文件结束为止
let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{
result(data) })
})
allFile.push(result)
this.downloadProgress = Number((i/allSlice).toFixed(2))*100
if (allFile.length === allSlice) { //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ;
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link);
link.click();
// this.downloadProgress = 0
this.downloadisLoading = false
// this.setFileLoading()
}
} //for循环
}
//取消分块下载
cancelDowload () {
}
//查看预案按钮跳转
routerTo(element){
console.log(element)
sessionStorage.setItem("companyName",element.unitname)
window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`);
}
@ -147,13 +284,190 @@ export class OnetwoEntryPlanComponent implements OnInit {
})
export class newunitComponent{
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitComponent>,@Inject(MAT_DIALOG_DATA) public data: any) {}
ngOnInit(): void {
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
}
url
unitname//预案名称
level//预案级别
addname//添加人
addtime//添加时间
unittype//预案类型
reservePlanType//预案类型
unitstate//审核状态
projectlevel//编制级别
//上传文件↓
file:any; //上传的文件
fileName:any; //上传文件name
uploadisLoading:boolean = false; //进度条loading加载
uploadProgress:number=0; //进度条进度
objectName:any; //上传对象名
uploadId:any; //上传分块上传事件编号
uploadover:any = false //上传完成之后提示
selectedPLanType:any//所选预案类型
selectedPLanName:any//所选预案名称
localup:boolean = false //本地上传
defaultisshow = '0' //默认显示上传input框
//上传
upload(){
document.getElementById('up').click()
}
//上传文件input
filechange(e){
this.file = e.target.files[0] || null //上传的文件
}
//上传文件
startUploading (planType) {
let file = this.file || 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)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.http.post(this.url=='2'?`/api/Objects/PlanPlatform/twoClass`:'/api/Objects/PlanPlatform/oneClass',formData).subscribe((data:any)=>{
this.objectName = data.objectName
//this.snackBar.open('上传成功!','确定',config);
let body:any = {
Name:this.unitname||'',
PlanCategory:this.url=='2'?2:1,
PlanType: Number(this.reservePlanType),
PlanLevel:1,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
}
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
this.dialogRef.close();
},err=>{
this.snackBar.open('创建失败!','确定',config);
})
},err=>{
this.snackBar.open('上传失败!','确定',config);
})
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
let data = {filename: file.name}
this.uploadisLoading = true
this.http.post(this.url=='2'?`/api/NewMultipartUpload/PlanPlatform/twoClass`:'/api/NewMultipartUpload/PlanPlatform/oneClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading(planType)
})
}
}
PartNumberETag:any=[]; //每次返回需要保存的信息
//开始分段上传
async subsectionUploading (planType) {
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
for (let i = 0;i < allSlice;i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
let formData = new FormData()
formData.append("file",file.slice(start, end))
//同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{
let msg = {
"partNumber":data.partNumber || null,
"eTag": data.eTag || null}
resolve(msg) // 调用 promise 内置方法处理成功
})
});
this.PartNumberETag.push(result)
this.uploadProgress = Number((i/allSlice).toFixed(2))*100
if (this.PartNumberETag.length === allSlice) {
this.uploadProgress = 100
this.endUploading(planType)}
}//for循环
}
//完成分块上传
endUploading (planType) {
let data = this.PartNumberETag
let paramsData = {uploadId:this.uploadId}
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
//this.snackBar.open('上传成功!','确定',config);
this.uploadProgress = 0;
this.uploadisLoading = false
this.PartNumberETag =[] //清空保存返回的信息
this.uploadover = true
let body:any = {
Name:this.unitname||'',
PlanCategory:this.url=='2'?2:1,
PlanType: Number(this.reservePlanType),
PlanLevel:1,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
}
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
this.dialogRef.close();
},err=>{
this.snackBar.open('创建失败!','确定',config);
})
})
}
//取消分块上传
cancel () {
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{
this.uploadProgress = 0;
this.uploadisLoading= false;
(<HTMLInputElement>document.getElementById('up')).value = null
this.PartNumberETag =[] //清空保存返回的信息
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('取消上传成功!','确定',config);
this.uploadover = false
this.file = null
})
}
//创建预案
newplan(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.unitname==undefined||this.reservePlanType==undefined){
this.snackBar.open('请输入预案名称或类型!','确定',config);
}
else if(this.file==undefined){
this.snackBar.open('请先上传文件!','确定',config);
}
else{
if(this.reservePlanType!='1'){
this.startUploading("非二维")
}
else{this.startUploading("二维")}
}
}
//取消按钮
close(){
this.dialogRef.close();
}

6
src/app/plan-management/open-plan/open-plan.component.ts

@ -160,12 +160,10 @@ export class OpenPlanComponent implements OnInit {
}
)
}
//跳转查看预案页面
//跳转查看预案页面 公开预案
routerTo(element){
sessionStorage.setItem("companyName",element.companyName)
// window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=false&pagetype=openplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`);
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6`);
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`);
}
//分页事件
chagePage(e){

6
src/app/plan-management/pass-plan/pass-plan.component.ts

@ -169,12 +169,10 @@ export class PassPlanComponent implements OnInit {
}
)
}
//跳转查看预案页面
//跳转查看预案页面 审核通过预案
routerTo(element){
sessionStorage.setItem("companyName",element.companyName)
// window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=false&pagetype=passplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`);
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6`);
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=1`);
}
//分页事件
chagePage(e){

37
src/app/plan-management/type-plan/newunit.html

@ -4,24 +4,33 @@
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 10:15:18
* @LastEditTime: 2021-01-11 13:57:06
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">新增预案</span>
<div class="top">
<span style="font-size: 20px;">新增预案</span>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname" required>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" autocomplete="off" [(ngModel)]="unitname">
</mat-form-field>
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" (click)='upload()'><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
<input type="file" style="display: none;" id="up" (change)='filechange($event)' accept=".doc,.txt,.docx,.pdf">
<div *ngIf="file!=undefined"><label style="font-size: 10px;">{{file.name}}</label></div>
<div *ngIf="uploadisLoading">
<span style="font-size: 10px;">上传中...</span>
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress" style="width: 250px;"></mat-progress-bar>
<button mat-raised-button (click)="cancel()" style="width: 80px;font-size: 10px;margin-top: 3px;">取消上传</button>
</div>
<div class="queryField">
<label style="margin-right: 10px;">上传本地文件:</label>
<button mat-raised-button color="primary" ><img style="margin-bottom: 2px;" src="../../../assets/images/bendi.png"> 本地文件</button>
</div>
<div class="bottom">
<button mat-raised-button color="primary">确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
<div class="bottom">
<button mat-raised-button color="primary" (click)='newplan()'>确定</button>
<button mat-raised-button style="margin-left: 50px;" (click)="close()">取消</button>
</div>
</div>

25
src/app/plan-management/type-plan/newunit.scss

@ -7,7 +7,7 @@
.queryField {
margin: 3px 5px;
input {
width: 50px;
width: 100%;
height: 18px;
line-height: 18px;
border-radius: 3px;}
@ -26,10 +26,29 @@
}
}
.bottom{
margin: 30px 30px;
margin: 10% 30px;
button{
width: 80px;
height: 36px;
font-size: 16px;
}
}
}
.fileinput-button {
width: 148px;
height: 36px;
top: 10px;
position: relative;
display: inline-block;
overflow: hidden;
background-color: #2196F3;
color: #FFFFFF;
font-size: 16px;
}
.fileinput-button input{
position: absolute;
right: 0px;
top: 0px;
opacity: 0;
-ms-filter: 'alpha(opacity=0)';
}

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

@ -1,6 +1,6 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form >
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
@ -13,17 +13,17 @@
<div class="queryField">
<label style="margin-right: 10px;">添加人:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入添加人" name="companyName" autocomplete="off" [(ngModel)]="addname">
<input matInput placeholder="请输入添加人" name="addname" autocomplete="off" [(ngModel)]="addname">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="companyName" autocomplete="off" [(ngModel)]="addtime">
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput autocomplete="off" >
<input type="date" matInput autocomplete="off" name="endtime" [(ngModel)]="endtime">
</mat-form-field>
</div>
@ -63,43 +63,46 @@
<div class="newadd">
<button mat-raised-button color="primary" (click)='addunit()'><img style="margin-bottom: 3px;" src="../../../assets/images/newadd.png"> 新增</button>
</div>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.unitname}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 20%;">预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="addname">
<th mat-header-cell *matHeaderCellDef>添加人</th>
<td mat-cell *matCellDef="let element">{{element.addname}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加人</th>
<td mat-cell *matCellDef="let element">{{element.creatorName}}</td>
</ng-container>
<ng-container matColumnDef="addtime">
<th mat-header-cell *matHeaderCellDef>添加时间</th>
<td mat-cell *matCellDef="let element">{{element.addtime}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">添加时间</th>
<td mat-cell *matCellDef="let element">{{element.creationTime|date:'yyyy-MM-dd'}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th>
<td mat-cell *matCellDef="let element">类型预案</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.passstate}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">审核状态</th>
<td mat-cell *matCellDef="let element">{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':'审核退回'}}</td>
</ng-container>
<ng-container matColumnDef="isopen">
<th mat-header-cell *matHeaderCellDef>是否公开</th>
<td mat-cell *matCellDef="let element">{{element.isopen}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">是否公开</th>
<td mat-cell *matCellDef="let element">{{element.openRange}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.projectlevel}}</td>
<th mat-header-cell *matHeaderCellDef style="width: 10%;">编制级别</th>
<td mat-cell *matCellDef="let element">{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span style="color: blue;">查看预案</span>
<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)='readFile(element)'>下载</span>
<span style="color: red;margin-left: 4px" (click)='deletePlan(element.id)'> 删除</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

3
src/app/plan-management/type-plan/type-plan.component.scss

@ -114,5 +114,8 @@
.mat-column-jurisdictionsquadron{
width: 10%;
}
span:hover{
text-decoration:underline
}
}
}

338
src/app/plan-management/type-plan/type-plan.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-01-06 09:47:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 10:27:09
* @LastEditTime: 2021-01-11 14:01:30
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -55,6 +55,7 @@ export class TypePlanComponent implements OnInit {
{name:"中队",value:"8"}
]
}
this.getAlltabledate()
}
preparelevels:any
@ -65,6 +66,7 @@ export class TypePlanComponent implements OnInit {
level//预案级别
addname//添加人
addtime//添加时间
endtime
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
@ -77,23 +79,183 @@ export class TypePlanComponent implements OnInit {
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
//获取表格数据
getAlltabledate(){
let paramsdata:any = {
Name:this.unitname||'',
planCategories:8,
CreatorName:this.addname||'',
AuditStatus:this.unitstate|| '',
QueryStartTime:this.addtime||'',
QueryEndTime:this.endtime||'',
PlanLevel:this.projectlevel||'',
HasChildrenPlanLevel:this.plcheck||'',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
}
this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount
this.tabledataSource = data.items
})
}
//重置
reset(){
this.unitname=''
this.level=''
this.addname=''
this.addtime=''
this.unittype=''
this.endtime=''
this.unitstate=''
this.projectlevel=''
this.plcheck=false
this.getAlltabledate()
}
//查询
onSubmit (value) {
if(this.endtime!=undefined&&this.addtime>this.endtime){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('开始时间不能大于结束时间!','确定',config);
}else{
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAlltabledate();
}
}
//删除预案
deletePlan(id){
let isTrue = confirm('您确定要删除吗')
if(isTrue){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{
this.snackBar.open('删除成功!','确定',config);
this.getAlltabledate()
},err => {
this.snackBar.open(err,'确定',config);
})
}
}
//新增预案弹窗
addunit(){
const dialogRef = this.dialog.open(newunitType, {
width: '340px',
height:'300px'
height:'370px'
//data: paperDataInfo
});
dialogRef.afterClosed().subscribe(result => {
this.getAlltabledate()
}
);
}
//下载↓
selectDownloadFile:any; //选择下载的文件
download:any; //下载文件元数据
downloadisLoading:boolean = false; //进度条loading加载
downloadProgress:number=0; //进度条进度
downloadFileName:any
fileUrls:any //当前预案附件地址
fileDatas:any = []
selectedFileIndex : any = 0
selectedFileData : any
uploadFileLonging:any
//读取下载文件信息
readFile (element) {
this.uploadFileLonging = element
element.attachmentUrls.forEach(item=>{
this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{
data.filePige = (data.fileLength / (1024*1024)).toFixed(2)
//console.log(data)
this.download = data
this.downloadFile()
})
})
}
//初始化下载
downloadFile () {
this.downloadProgress = 0
let file = this.download
let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载
this.downloadisLoading = true
// this.setFileLoading()
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ;
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link);
link.click();
this.downloadisLoading = false
// this.setFileLoading()
})
} else if (file && fileSize > shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载
this.downloadisLoading = true
// this.setFileLoading()
}
}
//分段下载并合并
async blockingDownload () {
let file = this.download
let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段
let allFile:any = [] //所有的file分段
for (let i=0;i<allSlice;i++) {
let start = i * shardSize //每次下载文件开始位置
let end = Math.min(fileSize, start + shardSize-1); //每次下载文件结束为止
let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{
result(data) })
})
allFile.push(result)
this.downloadProgress = Number((i/allSlice).toFixed(2))*100
if (allFile.length === allSlice) { //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ;
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link);
link.click();
// this.downloadProgress = 0
this.downloadisLoading = false
// this.setFileLoading()
}
} //for循环
}
//取消分块下载
cancelDowload () {
}
}
@ -112,6 +274,176 @@ export class newunitType{
unittype//预案类型
unitstate//审核状态
projectlevel//编制级别
reservePlanType//预案类型
//上传
upload(){
document.getElementById('up').click()
}
//上传文件↓
file:any; //上传的文件
fileName:any; //上传文件name
uploadisLoading:boolean = false; //进度条loading加载
uploadProgress:number=0; //进度条进度
objectName:any; //上传对象名
uploadId:any; //上传分块上传事件编号
uploadover:any = false //上传完成之后提示
selectedPLanType:any//所选预案类型
selectedPLanName:any//所选预案名称
localup:boolean = false //本地上传
defaultisshow = '0' //默认显示上传input框
//上传文件input
filechange(e){
this.file = e.target.files[0] || null //上传的文件
}
//上传文件
startUploading (planType) {
let file = this.file || 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)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.http.post(`/api/Objects/PlanPlatform/typeClass`,formData).subscribe((data:any)=>{
this.objectName = data.objectName
//console.log('上传成功')
let body:any = {
Name:this.unitname||'',
PlanCategory:8,
PlanLevel:1,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
}
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
this.dialogRef.close();
},err=>{
this.snackBar.open('创建失败!','确定',config);
})
},err=>{
this.snackBar.open('上传失败!','确定',config);
})
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
let data = {filename: file.name}
this.uploadisLoading = true
this.http.post(`/api/NewMultipartUpload/PlanPlatform/typeClass`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading(planType)
})
}
}
PartNumberETag:any=[]; //每次返回需要保存的信息
//开始分段上传
async subsectionUploading (planType) {
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
for (let i = 0;i < allSlice;i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
let formData = new FormData()
formData.append("file",file.slice(start, end))
//同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{
let msg = {
"partNumber":data.partNumber || null,
"eTag": data.eTag || null}
resolve(msg) // 调用 promise 内置方法处理成功
})
});
this.PartNumberETag.push(result)
this.uploadProgress = Number((i/allSlice).toFixed(2))*100
if (this.PartNumberETag.length === allSlice) {
this.uploadProgress = 100
this.endUploading(planType)}
}//for循环
}
//完成分块上传
endUploading (planType) {
let data = this.PartNumberETag
let paramsData = {uploadId:this.uploadId}
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
//console.log('创建成功')
this.uploadProgress = 0;
this.uploadisLoading = false
this.PartNumberETag =[] //清空保存返回的信息
this.uploadover = true
let body:any = {
Name:this.unitname||'',
PlanCategory:8,
PlanLevel:1,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
}
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{
this.snackBar.open('创建成功!','确定',config);
this.dialogRef.close();
},err=>{
this.snackBar.open('创建失败!','确定',config);
})
})
}
//取消分块上传
cancel () {
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{
this.uploadProgress = 0;
this.uploadisLoading= false;
(<HTMLInputElement>document.getElementById('up')).value = null
this.PartNumberETag =[] //清空保存返回的信息
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('取消上传成功!','确定',config);
this.uploadover = false
this.file = null
})
}
//创建预案
newplan(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
if(this.unitname==undefined||this.unitname==''){
this.snackBar.open('请输入预案名称!','确定',config);
}
else if(this.file==undefined){
this.snackBar.open('请先上传文件!','确定',config);
}
else{
if(this.reservePlanType!='1'){
this.startUploading("非二维")
}
else{this.startUploading("二维")}
}
}
//取消按钮
close(){
this.dialogRef.close();
}

2
src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.scss

@ -8,7 +8,7 @@
}
#indexBzt{
width: 100%;
height: 93%;
height: 100%;
padding-top: 3%;
display: flex;
flex-direction: row;

2
src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html

@ -1,4 +1,4 @@
<body>
<!--饼状图 -->
<div id="indexBzt" style="width: 100%;height: 93%;"></div>
<div id="indexBzt" style="width: 100%;height: 100%;"></div>
</body>

2
src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/buildingType/building-type-two-forward/building-type-two-forward.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/deleteUnit/delete-one/delete-one.component.html

@ -6,4 +6,4 @@
* @LastEditors: sueRimn
* @LastEditTime: 2020-09-05 11:28:26
-->
<div id="indexBzt" style="width: 100%;height: 93%;"></div>
<div id="indexBzt" style="width: 100%;height: 100%;"></div>

2
src/app/statistic-analysis/deleteUnit/delete-there-line-details/delete-there-line-details.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/deleteUnit/delete-there/delete-there.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/deleteUnit/delete-two-newadd/delete-two-newadd.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/deleteUnit/delete-two/delete-two.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/scheduled-updates/scheduled-updates.component.scss

@ -27,7 +27,7 @@
}
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/state/page-one/page-one.component.html

@ -9,7 +9,7 @@
<body>
<!--饼状图 -->
<div id="indexBzt" style="width: 100%;height: 93%;"></div>
<div id="indexBzt" style="width: 100%;height: 100%;"></div>
</body>

2
src/app/statistic-analysis/state/page-there-year/page-there-year.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/state/page-there/page-there.component.scss

@ -1,6 +1,6 @@
.box{
width: 100%;
height: 92%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss

@ -1,6 +1,6 @@
.content {
width: 100%;
height: 93%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;

2
src/app/ui/authority/authority.component.html

@ -1,4 +1,4 @@
<div style="height: 90%; overflow-y: auto;">
<div style="height: 100%; overflow-y: auto;">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
<button mat-icon-button disabled ></button>

2
src/app/ui/fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component.scss

@ -1,7 +1,7 @@
.content {
margin: 0 0 0 10px;
width: 100%;
height: 90%;
height: 100%;
overflow-y: auto;
display: flex;
.leftBox {

2
src/app/ui/fire-protection-elements/fire-protection-elements.component.scss

@ -6,7 +6,7 @@
.Box {
width: 100%;
height: 90%;
height: 100%;
overflow-y: auto;
display: flex;
padding-left: 10px;

2
src/app/ui/material-bank/material-bank.component.scss

@ -1,7 +1,7 @@
.content {
padding: 0 0 0 10px;
width: 100%;
height: 90%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
display: flex;

2
src/app/ui/navmenus/navmenus.component.html

@ -1,4 +1,4 @@
<div style="height: 90%; overflow-y: auto;">
<div style="height: 100%; overflow-y: auto;">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
<button mat-icon-button disabled ></button>

2
src/app/ui/role/role.component.html

@ -1,4 +1,4 @@
<div style="height: 90%; overflow-y: auto;">
<div style="height: 100%; overflow-y: auto;">
<button mat-raised-button color="primary" (click)="createuser()" style=" margin: 10px">创建角色</button>
<table mat-table [dataSource]="dataSource">

2
src/app/ui/unit-information/unit-information.component.scss

@ -1,7 +1,7 @@
.content {
margin: 0 0 0 10px;
width: 100%;
height: 90%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
display: flex;

41
src/app/working-area/model/arrows.ts

@ -1,41 +0,0 @@
import { WorkingAreaComponent } from '../working-area.component';
import * as PIXI from 'pixi.js';
/**
*
* 2
*/
export class Arrows extends PIXI.Container {
public line: PIXI.Graphics = new PIXI.Graphics();
public ready = false;
constructor(public assetData: any, private workingArea: WorkingAreaComponent) {
super();
this.workingArea.backgroundImage.addChild(this);
this.name = this.assetData.Id;
this.addChild(this.line);
this.refresh();
this.interactive = true;
this.on('mousedown', event => {
if (!this.ready) { return; }
event.stopPropagation();
this.workingArea.selection.selectOne(this);
});
}
/**
*
*/
public refresh() {
this.line.clear();
this.line.lineStyle(5, 0xff0000, 1);
this.line.moveTo(this.assetData.pointA.x, this.assetData.pointA.y);
this.line.lineTo(this.assetData.pointB.x, this.assetData.pointB.y);
const angle = Math.atan2((this.assetData.pointB.y - this.assetData.pointA.y), (this.assetData.pointB.x - this.assetData.pointA.x))
* (180 / Math.PI) + 90;
this.line.beginFill(0xff0000);
console.log(Math.PI / 180 / 1.6);
this.line.drawStar(this.assetData.pointB.x, this.assetData.pointB.y, 3, 10, 0, (Math.PI / 180 * angle));
this.line.endFill();
}
}

50
src/app/working-area/model/axArrowConnector.ts

@ -2,13 +2,12 @@ import { WorkingAreaComponent } from '../working-area.component';
import * as PIXI from 'pixi.js';
import { AxShape } from './axShape';
import { Sprite } from 'pixi.js';
import { GameMode } from './gameMode';
/**
*
*/
export class AxArrowConnector extends AxShape {
pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png')
pointSprites: Array<Sprite> = new Array<Sprite>();
line: PIXI.Graphics;
text: PIXI.Text;
@ -51,6 +50,8 @@ export class AxArrowConnector extends AxShape {
this.drawPoints();
this.sortableChildren = true;
this.text.zIndex = this.children.length;
this.text.visible = this.showName;
this.text.angle = -this.workingArea.backgroundImage.angle;
}
public drawPoints() {
@ -63,29 +64,30 @@ export class AxArrowConnector extends AxShape {
});
this.pointSprites.forEach((value, index, array) => {
value.interactive = true;
value.on('mousedown', event => {
event.stopPropagation();
if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
event.currentTarget.data = event.data;
event.currentTarget.alpha = 0.5;
event.currentTarget.dragging = true;
}
})
.on('mouseup', event => {
value
.on('pointerdown', event => {
event.stopPropagation();
if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
event.currentTarget.data = event.data;
event.currentTarget.alpha = 0.5;
event.currentTarget.dragging = true;
}
})
.on('pointerup', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mouseupoutside', event => {
.on('pointerupoutside', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mousemove', event => {
.on('pointermove', event => {
if (event.currentTarget.dragging) {
const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent);
event.currentTarget.x = newPosition.x;
@ -95,22 +97,35 @@ export class AxArrowConnector extends AxShape {
this.assetData.MultiPoint[index].y = newPosition.y;
this.workingArea.canvasData.isChange = true;
this.refresh();
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
}
})
.on('rightclick', event => {
});
})
this.setPointsVisible(false);
this.setPointVisiable(false);
}
/**
*
* @param b true/false
*/
public setPointsVisible(b:boolean) {
public setPointVisiable(b:boolean) {
this.pointSprites.forEach(item => {
item.visible = b;
})
}
// 设置缩放
public setItemScale(scale: number) {
// this.text.scale.set(scale);
this.pointSprites.forEach(point => {
point.scale.set(scale);
});
}
public setNameVisible(value: boolean, mode: GameMode) {
if (this.assetData.GameMode === mode) {
this.text.visible = value;
}
}
/**
*
@ -121,8 +136,8 @@ export class AxArrowConnector extends AxShape {
if (pts.length < 2) {
return;
}
this.text.position = pts[0];
this.text.anchor.set(0.5, 1);
this.text.position = this.getLineCenter(pts[0], pts[1]);
this.text.anchor.set(0.5);
this.text.text = this.assetData.Name
+ '\r\n'
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
@ -351,6 +366,7 @@ export class AxArrowConnector extends AxShape {
// c.end();
// }
// }
this.text.angle = -this.workingArea.backgroundImage.angle;
}
paintMarker(c: PIXI.Graphics, ptX: number, ptY: number, nx: number, ny: number,
size: number, arrowWidth: number, edgeWidth: number, spacing: number, initialMove: boolean) {

368
src/app/working-area/model/axImageShape.ts

@ -13,6 +13,7 @@ import { AxArrowConnector } from './axArrowConnector';
* AxImageShape
*/
export class AxImageShape extends AxShape {
connectPointTexture = PIXI.Texture.from('assets/images/handle-secondary.png');
style = new PIXI.TextStyle({
fontFamily: 'Arial',
fontSize: 18,
@ -34,28 +35,22 @@ export class AxImageShape extends AxShape {
+ '\r\n'
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style);
/**
*
*/
image: PIXI.Sprite;
selectionBox = new PIXI.Graphics();
connectPointTexture = PIXI.Texture.from('assets/images/handle-secondary.png');
connectPoint: Sprite;
// 可移动的
// 可选中的
connectPoint: Sprite;
// up: PIXI.Sprite;
// down: PIXI.Sprite;
// left: PIXI.Sprite;
// right: PIXI.Sprite;
// upLeft: PIXI.Sprite;
// upRight: PIXI.Sprite;
// downLeft: PIXI.Sprite;
// downRight: PIXI.Sprite;
up: PIXI.Sprite;
down: PIXI.Sprite;
left: PIXI.Sprite;
right: PIXI.Sprite;
upLeft: PIXI.Sprite;
upRight: PIXI.Sprite;
downLeft: PIXI.Sprite;
downRight: PIXI.Sprite;
constructor(assetData: any, workingArea: WorkingAreaComponent) {
super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle;
this.x = this.assetData.Point.x;
this.y = this.assetData.Point.y;
this.name = this.assetData.Id;
@ -68,85 +63,43 @@ export class AxImageShape extends AxShape {
this.image.height = this.assetData.Height;
this.image.alpha = 1;
this.image.anchor.set(0.5);
// this.image.interactive = true;
// this.image.buttonMode = true;
// this.image
// .on('mousedown', event => {
// event.stopPropagation();
// this.workingArea.selection.selectOne(this);
// // this.paintingPipeline(this.x, this.y);
// // 如果链接对象不为空,禁止移动
// if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
// event.currentTarget.parent.data = event.data;
// event.currentTarget.parent.alpha = 0.5;
// event.currentTarget.parent.dragging = true;
// }
// })
// .on('mouseup', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mouseupoutside', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mousemove', event => {
// if (event.currentTarget.parent.dragging) {
// // // 如果拖动过程中发现父对象不是背景图
// // if (this.parent !== this.workingArea.backgroundImage) {
// // this.setParent(this.workingArea.backgroundImage);
// // if (this.assetData.FixedSize) {
// // const scale = 1 / this.workingArea.backgroundImage.scale.x;
// // this.scale.set(scale);
// // }
// // }
// const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent);
// event.currentTarget.parent.x = newPosition.x;
// event.currentTarget.parent.y = newPosition.y;
// this.assetData.Point = new PIXI.Point(this.x, this.y);
// this.workingArea.canvasData.isChange = true;
// }
// })
// .on('rightclick', event => {
// })
// .on('mouseover', event => {
// event.stopPropagation();
// if (this.workingArea.previewImage !== null
// && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
// this.workingArea.previewImage.visible = false;
// }
// // if (this.assetData.CanConnect) {
// // this.setSelectionBox(true, this.image);
// // }
// })
// .on('mouseout', event => {
// event.stopPropagation();
// if (this.workingArea.previewImage !== null
// && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
// this.workingArea.previewImage.visible = true;
// }
// // if (this.assetData.CanConnect) {
// // this.setSelectionBox(false);
// // }
// });
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height / 2;
this.text.anchor.set(0.5, 1);
if (this.assetData.GameMode === 2) {
this.text.visible = false;
}
this.text.visible = this.showName;
this.addChild(this.text);
this.addChild(this.image);
this.addChild(this.selectionBox);
////
// up-left
this.upLeft = new PIXI.Sprite(this.pointTexture);
this.upLeft.anchor.set(0.5);
this.addChild(this.upLeft);
this.upLeft.interactive = true;
this.upLeft.visible = false;
// up-right
this.upRight = new PIXI.Sprite(this.pointTexture);
this.upRight.anchor.set(0.5);
this.addChild(this.upRight);
this.upRight.interactive = true;
this.upRight.visible = false;
// down-left
this.downLeft = new PIXI.Sprite(this.pointTexture);
this.downLeft.anchor.set(0.5);
this.addChild(this.downLeft);
this.downLeft.interactive = true;
this.downLeft.visible = false;
// down-right
this.downRight = new PIXI.Sprite(this.pointTexture);
this.downRight.anchor.set(0.5);
this.addChild(this.downRight);
this.downRight.interactive = true;
this.downRight.visible = false;
////
if (this.assetData.CanConnect) {
// connectPoint
this.connectPoint = new PIXI.Sprite(this.connectPointTexture);
@ -156,180 +109,19 @@ export class AxImageShape extends AxShape {
this.addChild(this.connectPoint);
this.connectPoint.interactive = true;
this.connectPoint
.on('mousedown', event => {
.on('pointerdown', event => {
event.stopPropagation();
this.paintingPipeline(this.x, this.y);
})
.on('mouseover', event => {
.on('pointerover', event => {
this.setSelectionBox(true, this.connectPoint);
})
.on('mouseout', event => {
.on('pointerout', event => {
this.setSelectionBox(false);
});
// // up
// this.up = new PIXI.Sprite(this.selectedPointTexture);
// this.up.anchor.set(0.5);
// this.up.x = this.image.x;
// this.up.y = this.image.y - (this.image.height / 2);
// this.addChild(this.up);
// this.up.interactive = true;
// this.up
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.up.x, this.up.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.up);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // down
// this.down = new PIXI.Sprite(this.selectedPointTexture);
// this.down.anchor.set(0.5);
// this.down.x = this.image.x;
// this.down.y = this.image.y + (this.image.height / 2);
// this.addChild(this.down);
// this.down.interactive = true;
// this.down
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.down.x, this.down.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.down);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // left
// this.left = new PIXI.Sprite(this.selectedPointTexture);
// this.left.anchor.set(0.5);
// this.left.x = this.image.x - (this.image.width / 2);
// this.left.y = this.image.y;
// this.addChild(this.left);
// this.left.interactive = true;
// this.left
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.left.x, this.left.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.left);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // right
// this.right = new PIXI.Sprite(this.selectedPointTexture);
// this.right.anchor.set(0.5);
// this.right.x = this.image.x + (this.image.width / 2);
// this.right.y = this.image.y;
// this.addChild(this.right);
// this.right.interactive = true;
// this.right
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.right.x, this.right.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.right);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // up-left
// this.upLeft = new PIXI.Sprite(this.selectedPointTexture);
// this.upLeft.anchor.set(0.5);
// this.upLeft.x = this.image.x - (this.image.width / 2);
// this.upLeft.y = this.image.y - (this.image.height / 2);
// this.addChild(this.upLeft);
// this.upLeft.interactive = true;
// this.upLeft
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.upLeft.x, this.upLeft.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.upLeft);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // up-right
// this.upRight = new PIXI.Sprite(this.selectedPointTexture);
// this.upRight.anchor.set(0.5);
// this.upRight.x = this.image.x + (this.image.width / 2);
// this.upRight.y = this.image.y - (this.image.height / 2);
// this.addChild(this.upRight);
// this.upRight.interactive = true;
// this.upRight
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.upRight.x, this.upRight.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.upRight);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // down-left
// this.downLeft = new PIXI.Sprite(this.selectedPointTexture);
// this.downLeft.anchor.set(0.5);
// this.downLeft.x = this.image.x - (this.image.width / 2);
// this.downLeft.y = this.image.y + (this.image.height / 2);
// this.addChild(this.downLeft);
// this.downLeft.interactive = true;
// this.downLeft
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.downLeft.x, this.downLeft.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.downLeft);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
// // down-right
// this.downRight = new PIXI.Sprite(this.selectedPointTexture);
// this.downRight.anchor.set(0.5);
// this.downRight.x = this.image.x + (this.image.width / 2);
// this.downRight.y = this.image.y + (this.image.height / 2);
// this.addChild(this.downRight);
// this.downRight.interactive = true;
// this.downRight
// .on('mousedown', event => {
// event.stopPropagation();
// const pt = this.toGlobal(new PIXI.Point(this.downRight.x, this.downRight.y));
// const pt2 = this.workingArea.backgroundImage.toLocal(pt);
// this.paintingPipeline(pt2.x, pt2.y);
// })
// .on('mouseover', event => {
// this.setSelectionBox(true, this.downRight);
// })
// .on('mouseout', event => {
// this.setSelectionBox(false);
// });
});
this.showConnectionPoint(false);
}
this.setItemScale(1 / this.workingArea.backgroundImage.scale.x);
}
// 设置选择框
public setSelectionBox(b: boolean, sprite?: PIXI.Sprite) {
@ -337,14 +129,6 @@ export class AxImageShape extends AxShape {
this.selectionBox.lineStyle(2, 0x00EB00, 1);
this.selectionBox.position = sprite.position;
this.selectionBox.drawRect(- sprite.width / 2, - sprite.height / 2, sprite.width, sprite.height);
// const p0 = new PIXI.Point(- sprite.width / 2, - sprite.height / 2);
// const pe = new PIXI.Point(sprite.width / 2, sprite.height / 2);
// const pw = new PIXI.Point(p0.x + sprite.width, p0.y);
// const ph = new PIXI.Point(p0.x, p0.y + sprite.height);
// this.drawDashedLine(this.selectionBox, p0, pw, 0x1234ff);
// this.drawDashedLine(this.selectionBox, p0, ph, 0x1234ff);
// this.drawDashedLine(this.selectionBox, pe, pw, 0x1234ff);
// this.drawDashedLine(this.selectionBox, pe, ph, 0x1234ff);
} else {
this.selectionBox.clear();
}
@ -358,14 +142,56 @@ export class AxImageShape extends AxShape {
// 显示连接点
public showConnectionPoint(b: boolean) {
this.connectPoint.visible = b;
// this.up.visible = b;
// this.down.visible = b;
// this.left.visible = b;
// this.right.visible = b;
// this.upLeft.visible = b;
// this.downLeft.visible = b;
// this.upRight.visible = b;
// this.downRight.visible = b;
}
/**
*
* @param value
*/
public setPointVisiable(value: boolean) {
let rect = this.getLocalBounds();
this.upLeft.x = rect.left;
this.upLeft.y = rect.top;
this.upRight.x = rect.right;
this.upRight.y = rect.top;
this.downLeft.x = rect.left;
this.downLeft.y = rect.bottom;
this.downRight.x = rect.right;
this.downRight.y = rect.bottom;
this.upLeft.visible = value;
this.upRight.visible = value;
this.downLeft.visible = value;
this.downRight.visible = value;
}
/**
*
* @param scale
*/
public drawBorder(scale: number) {
let visible = this.upLeft.visible;
this.setPointVisiable(false);
super.drawBorder(scale);
let rect = this.getLocalBounds();
this.upLeft.x = rect.left;
this.upLeft.y = rect.top;
this.upRight.x = rect.right;
this.upRight.y = rect.top;
this.downLeft.x = rect.left;
this.downLeft.y = rect.bottom;
this.downRight.x = rect.right;
this.downRight.y = rect.bottom;
this.setPointVisiable(visible);
}
public setItemScale(scale: number) {
if (this.assetData.FixedSize) {
this.scale.set(scale);
} else {
// this.text.scale.set(scale);
this.upLeft.scale.set(scale);
this.upRight.scale.set(scale);
this.downLeft.scale.set(scale);
this.downRight.scale.set(scale);
}
}
paintingPipeline(x: number, y: number) {
if (this.assetData.CanConnect) {
@ -407,6 +233,7 @@ export class AxImageShape extends AxShape {
IsFromBuilding : this.workingArea.canvasData.selectTemplateData.isFromBuilding,
GameMode: this.workingArea.canvasData.gameMode,
LinkedObjects: new Array(this.assetData.Id),
Tag: this.workingArea.canvasData.selectTemplateData.tag
};
this.workingArea.paintingShape = new AxArrowConnector(tempData, this.workingArea,false,true);
this.assetData.Pipelines.push(this.workingArea.paintingShape.assetData.Id);
@ -439,5 +266,6 @@ export class AxImageShape extends AxShape {
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height / 2;
this.angle = -this.workingArea.backgroundImage.angle;
}
}

120
src/app/working-area/model/axLegend.ts

@ -0,0 +1,120 @@
import { Constructor } from '@angular/material/core/common-behaviors/constructor';
import { Sprite, Texture,Text, Graphics, Point } from 'pixi.js';
import { WorkingAreaComponent } from '../working-area.component';
import { AxShape } from './axShape';
/**
*
*/
export class AxLegend extends AxShape {
// 数据
public shapeMap: Map<string,Legend> = new Map<string,Legend>();
pen: Graphics = new Graphics();
/**
*
*/
constructor(assetData: any, workingArea: WorkingAreaComponent,shapeMap:Map<string,Legend>) {
super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle;
this.name = this.assetData.Id;
this.shapeMap = shapeMap;
this.refresh();
}
// 添加数据
public addItem(item:Legend) {
if (this.shapeMap.has(item.Name)) {
this.shapeMap.get(item.Name).Count++;
} else {
this.shapeMap.set(item.Name, item);
}
this.refresh();
}
// 删除数据
public deleteItem(item: Legend) {
if (this.shapeMap.has(item.Name)) {
this.shapeMap.get(item.Name).Count--;
if (this.shapeMap.get(item.Name).Count === 0) {
this.shapeMap.delete(item.Name);
}
}
this.refresh();
}
// 刷新
refresh() {
this.removeChildren();
let index = 1;
let offset = 25;
let number = this.assetData.PropertyInfos[0].PropertyValue;
let width = 300;
let height = 50;
for (let i = 0; i < number; i++){
if (i >= this.shapeMap.size) break;
let x = width * i;
var textImage = new Text('图例',{
fontSize: 20,
fill: ['#0000ff'],
});
textImage.anchor.set(0.5)
textImage.x = x;
textImage.y = 0;
this.addChild(textImage);
var textName = new Text("名称"+' 【数量】',{
fontSize: 20,
fill: ['#0000ff'],
});
textName.anchor.set(0,0.5);
textName.x = x + 32 + offset;
textName.y = 0;
this.addChild(textName);
}
for (let item of this.shapeMap.values()) {
let x = index % number === 0 ? (number -1) * width : (index % number - 1) * width;
let y = Math.ceil(index / number) * height;
let image: Sprite = Sprite.from(item.ImageUrl);
image.width = 32;
image.height = 32;
image.anchor.set(0.5);
image.x = x;
image.y = y;
this.addChild(image);
var textName = new Text(item.Name+' 【'+item.Count.toString()+'】',{
fontSize: 20,
});
textName.anchor.set(0,0.5);
textName.x = x + image.width/2 + offset;
textName.y = y;
this.addChild(textName);
index++;
}
if (this.shapeMap.size > 0) {
let rect = this.getLocalBounds();
this.pen.clear();
this.pen.beginFill(0xffffff,0.01);
this.pen.lineStyle(3, 0x000000);
this.pen.moveTo(rect.left-offset, rect.top-offset);
this.pen.lineTo(rect.right+offset, rect.top-offset);
this.pen.lineTo(rect.right+offset, rect.bottom+offset);
this.pen.lineTo(rect.left - offset, rect.bottom + offset);
this.pen.closePath();
this.pen.endFill();
}
this.addChild(this.pen);
this.angle = -this.workingArea.backgroundImage.angle;
}
}
export class Legend{
public Name: string;
public ImageUrl: string;
public Count: number;
/**
*
*/
constructor(name:string,imageUrl:string,count:number) {
this.Name = name;
this.ImageUrl = imageUrl;
this.Count = count;
}
}

12
src/app/working-area/model/axPreviewImageShape.ts

@ -24,4 +24,16 @@ export class AxPreviewImageShape extends AxShape {
setImageUrl(url: string) {
this.image.texture = Texture.from(url);
}
public setItemScale(scale: number) {
this.scale.set(scale);
}
/**
*
* @param rect
*/
public drawBorder(scale: number) {
}
public refresh() {
this.angle = -this.workingArea.backgroundImage.angle;
}
}

159
src/app/working-area/model/axShape.ts

@ -8,21 +8,31 @@ import { WorkingAreaComponent } from '../working-area.component';
*/
export class AxShape extends Container {
assetData: any;
pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png')
workingArea: WorkingAreaComponent;
// 可以被移动的
moveable = true;
// 可以被选中的
selectable = true;
// 允许编辑
allowEdit = true;
// 是否显示名称
showName = true;
// 边框
border: PIXI.Graphics = new PIXI.Graphics();
constructor(assetData: any, workingArea: WorkingAreaComponent) {
super();
this.border.visible = false;
this.addChild(this.border);
this.assetData = assetData;
this.workingArea = workingArea;
this.workingArea.backgroundImage.addChild(this);
this.zIndex = 200;
this.interactive = true;
this.buttonMode = true;
this.on('mousedown', event => {
console.log(this.assetData);
this
.on('pointerdown', event => {
event.stopPropagation();
if (this.selectable) {
this.workingArea.selection.selectOne(this);
@ -37,23 +47,34 @@ export class AxShape extends Container {
event.currentTarget.dragPoint.y -= event.currentTarget.y;
}
})
.on('mouseup', event => {
.on('pointerup', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mouseupoutside', event => {
.on('pointerupoutside', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mousemove', event => {
.on('pointermove', event => {
if (event.currentTarget.dragging) {
const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent);
// const offsetX = newPosition.x - event.currentTarget.dragPoint.x;
// const offsetY = newPosition.y - event.currentTarget.dragPoint.y;
// const offset = this.workingArea.backgroundImage.toLocal(new Point(offsetX, offsetY));
// event.currentTarget.position += offset;
// // this.workingArea.selection.objects.forEach(shpae => {
// // shpae.x = newPosition.x - event.currentTarget.dragPoint.x;
// // shpae.y = newPosition.y - event.currentTarget.dragPoint.y;
// // shpae.assetData.Point = new PIXI.Point(this.x, this.y);
// // this.workingArea.canvasData.isChange = true;
// // })
event.currentTarget.x = newPosition.x - event.currentTarget.dragPoint.x;
event.currentTarget.y = newPosition.y - event.currentTarget.dragPoint.y;
this.assetData.Point = new PIXI.Point(this.x, this.y);
@ -61,12 +82,12 @@ export class AxShape extends Container {
}
})
.on('rightclick', event => {
this.border.visible = false;
})
.on('mouseover', event => {
.on('pointerover', event => {
event.stopPropagation();
})
.on('mouseout', event => {
.on('pointerout', event => {
event.stopPropagation();
});
}
@ -77,4 +98,124 @@ export class AxShape extends Container {
refresh(): void{
}
public setItemScale(scale: number) {
}
/**
*
*/
public showBorder() {
if (this.assetData.FixedSize) {
this.drawBorder(1);
}
else {
this.drawBorder(1/this.workingArea.backgroundImage.scale.x);
}
this.border.visible = true;
}
/**
*
*/
public hideBorder() {
this.border.clear();
this.border.visible = false;
}
/**
*
* @param value
*/
public setPointVisiable(value: boolean) {
}
/**
*
* @param rect
*/
public drawBorder(scale: number) {
scale = this.assetData.FixedSize ? 1 : scale;
this.border.clear();
const rect = this.getLocalBounds();
const p1 = new PIXI.Point(rect.left, rect.top);
const p2 = new PIXI.Point(rect.right, rect.top);
const p3 = new PIXI.Point(rect.right, rect.bottom);
const p4 = new PIXI.Point(rect.left, rect.bottom);
this.border.lineStyle(scale * 1, 0x00a8ff);
var spaceLength = scale * 1;
var lineLenght = rect.width + 0.5 + 0.5;
var dashLength = scale*( lineLenght +spaceLength - Math.floor((rect.width + rect.height)/2 / 4.1))/Math.floor((rect.width + rect.height)/2 / 4.1);
this.drawDash(this.border, p1.x -0.5*scale, p1.y, p2.x + 0.5*scale, p2.y,dashLength,spaceLength);
this.drawDash(this.border, p2.x, p2.y -0.5*scale, p3.x, p3.y + 0.5*scale, dashLength, spaceLength);
this.drawDash(this.border, p3.x+0.5*scale, p3.y, p4.x - 0.5*scale, p4.y, dashLength, spaceLength);
this.drawDash(this.border, p4.x, p4.y + 0.5*scale, p1.x, p1.y - 0.5*scale, dashLength, spaceLength);
this.border.lineStyle(0, 0x0000ff);
this.border.beginFill(0x00ff00,0.1);
this.border.moveTo(p1.x, p1.y);
this.border.lineTo(p2.x, p2.y);
this.border.lineTo(p3.x, p4.y);
this.border.lineTo(p4.x, p4.y);
this.border.closePath();
this.border.endFill();
}
// 画虚线
drawDash(target, x1, y1, x2, y2,dashLength = 5, spaceLength = 1) {
let x = x2 - x1;
let y = y2 - y1;
let hyp = Math.sqrt((x) * (x) + (y) * (y));
let units = hyp / (dashLength + spaceLength);
let dashSpaceRatio = dashLength / (dashLength + spaceLength);
let dashX = (x / units) * dashSpaceRatio;
let spaceX = (x / units) - dashX;
let dashY = (y / units) * dashSpaceRatio;
let spaceY = (y / units) - dashY;
target.moveTo(x1, y1);
while (hyp > 0) {
x1 += dashX;
y1 += dashY;
hyp -= dashLength;
if (hyp < 0) {
x1 = x2;
y1 = y2;
}
target.lineTo(x1, y1);
x1 += spaceX;
y1 += spaceY;
target.moveTo(x1, y1);
hyp -= spaceLength;
}
target.moveTo(x2, y2);
}
// 计算多边形重心
public calculatePolygonGravityCenter(points: PIXI.Point[]) {
let area = 0.0; // 多边形面积
let gravityLat = 0.0; // 重心点 latitude
let gravityLng = 0.0; // 重心点 longitude
points.forEach((item, index) => {
// 1
const lat = item.x;
const lng = item.y;
const nextLat = points[(index + 1) % points.length].x;
const nextLng = points[(index + 1) % points.length].y;
// 2
const tempArea = (nextLat * lng - nextLng * lat) / 2.0;
// 3
area += tempArea;
// 4
gravityLat += tempArea * (lat + nextLat) / 3;
gravityLng += tempArea * (lng + nextLng) / 3;
});
// 5
gravityLat = gravityLat / area;
gravityLng = gravityLng / area;
return new PIXI.Point(gravityLat, gravityLng);
}
// 计算线段中点坐标
public getLineCenter(point1:PIXI.Point,point2:PIXI.Point) {
return new PIXI.Point((point1.x+point2.x)/2,(point1.y+point2.y)/2)
}
}

3
src/app/working-area/model/gameMode.ts

@ -3,5 +3,6 @@
*/
export enum GameMode {
BasicInformation,
Assignment
Assignment,
Examinee
}

68
src/app/working-area/model/legend.ts

@ -1,68 +0,0 @@
import { Graphics, Sprite, Text } from "pixi.js";
import { WorkingAreaComponent } from "../working-area.component";
import { AxArrowConnector } from "./axArrowConnector";
import { AxImageShape } from "./axImageShape";
import { AxShape } from "./axShape";
import { MultipointIcon } from "./multipointIcon";
import { PolygonIcon } from "./polygonIcon";
export class Legend extends AxShape{
background: Graphics = null;
data:Map<string,string> = new Map<string,string>()
/**
*
*/
constructor(workingArea: WorkingAreaComponent) {
super(null, workingArea);
this.draw();
}
getData() {
this.workingArea.backgroundImage.children.forEach(item => {
if (item instanceof AxImageShape|| item instanceof AxArrowConnector || item instanceof PolygonIcon || item instanceof MultipointIcon) {
if (!this.data.has(item.assetData.Name)) {
this.data[item.assetData.Name] = item.assetData.ImageUrl;
}
}
})
}
draw() {
this.getData();
this.background = new Graphics();
this.background.lineStyle(1, 0xff0000);
this.background.beginFill(0xffffff);
this.background.drawRect(0, 0, 200, 300);
this.background.endFill();
this.background.x = -(this.parent.width/2/ this.parent.scale.x);
this.background.y = -(this.parent.height/2/ this.parent.scale.x);
this.addChild(this.background);
var showName: Text = new Text('图例');
showName.x = 0;
showName.y = 0;
this.background.addChild(showName);
var showDescrption: Text = new Text('说明')
showDescrption.x = 100;
showDescrption.y = 0;
this.background.addChild(showDescrption);
let index = 1;
this.data.forEach((value, key) => {
var image: Sprite = Sprite.from(value);
image.width = 32;
image.height = 32;
image.x = 0;
image.y = index * 32;
this.background.addChild(image);
var description = new Text(key);
description.x = 100;
description.y = index * 32;
this.background.addChild(description);
index++;
})
}
redraw() {
this.background.destroy();
this.draw();
}
}

97
src/app/working-area/model/multipointIcon.ts

@ -8,7 +8,7 @@ import { AxShape } from './axShape';
*/
export class MultipointIcon extends AxShape {
public pointsData: PIXI.Point[];
public pointsGraphics: PIXI.Graphics[] = [];
public pointsGraphics: PIXI.Sprite[] = [];
public iconsTilingSprite: PIXI.TilingSprite[] = [];
style = new PIXI.TextStyle({
fontFamily: 'Arial',
@ -36,12 +36,18 @@ export class MultipointIcon extends AxShape {
* @param points
*/
constructor(assetData: any,workingArea: WorkingAreaComponent) {
super(assetData,workingArea);
super(assetData, workingArea);
this.name = this.assetData.Id;
this.pointsData = this.assetData.MultiPoint;
this.x = this.assetData.Point.x;
this.y = this.assetData.Point.y;
this.workingArea.backgroundImage.addChild(this);
this.text.anchor.set(0.5,0.5);
// this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]);
this.text.visible = this.showName;
this.text.angle = -this.workingArea.backgroundImage.angle;
this.addChild(this.text);
// 画线图标
for (let i = 0, count = this.pointsData.length - 1; i < count; i++) {
const pointA = this.pointsData[i];
@ -60,22 +66,16 @@ export class MultipointIcon extends AxShape {
// icon.height = this.assetData.Thickness === 0 ? 32 : this.assetData.Thickness;
this.iconsTilingSprite.push(icon);
this.addChild(icon);
if (i === 0) {
this.text.anchor.set(0.5);
this.text.position = icon.position;
this.text.y -= this.assetData.Height;
this.addChild(this.text);
}
this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]);
}
this.sortableChildren = true;
this.text.zIndex = this.pointsData.length;
// 画点
this.pointsData.forEach((item, index, array) => {
const iconPoint = new PIXI.Graphics();
iconPoint.lineStyle(1, 0xFFBD01, 1);
iconPoint.beginFill(0xFFFFFF, 1);
iconPoint.drawCircle(0, 0, 15);
const iconPoint = PIXI.Sprite.from(this.pointTexture);
iconPoint.anchor.set(0.5);
iconPoint.x = item.x;
iconPoint.y = item.y;
iconPoint.endFill();
iconPoint.visible = false;
this.pointsGraphics.push(iconPoint);
this.addChild(iconPoint);
@ -83,7 +83,7 @@ export class MultipointIcon extends AxShape {
// 添加圆点事件
this.pointsGraphics.forEach((item, index, array) => {
item.interactive = true;
item.on('mousedown', event => {
item.on('pointerdown', event => {
event.stopPropagation();
if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
event.currentTarget.data = event.data;
@ -91,21 +91,21 @@ export class MultipointIcon extends AxShape {
event.currentTarget.dragging = true;
}
})
.on('mouseup', event => {
.on('pointerup', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mouseupoutside', event => {
.on('pointerupoutside', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mousemove', event => {
.on('pointermove', event => {
if (event.currentTarget.dragging) {
const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent);
event.currentTarget.x = newPosition.x;
@ -128,9 +128,6 @@ export class MultipointIcon extends AxShape {
const distance = Math.sqrt(a * a + b * b);
this.iconsTilingSprite[index].angle = angle;
this.iconsTilingSprite[index].width = distance;
this.text.position = this.iconsTilingSprite[index].position;
this.text.y -= this.assetData.Height;
} else if (index < array.length - 1) {// 不是第一个点,也不是最后一个点
this.iconsTilingSprite[index].x = newPosition.x;
this.iconsTilingSprite[index].y = newPosition.y;
@ -163,61 +160,13 @@ export class MultipointIcon extends AxShape {
this.iconsTilingSprite[index - 1].angle = angleC;
this.iconsTilingSprite[index - 1].width = distanceC;
}
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]);
}
})
.on('rightclick', event => {
});
});
// // 缩放
// this.workingArea.on('backgroundScale', data => {
// const scale = 1 / data;
// this.text.scale.set(scale);
// });
// 添加选中事件
// this.iconsTilingSprite.forEach((item, index, array) => {
// item.interactive = true;
// item.buttonMode = true;
// item.on('mousedown', event => {
// event.stopPropagation();
// this.workingArea.selection.selectOne(this);
// if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
// event.currentTarget.parent.data = event.data;
// event.currentTarget.parent.alpha = 0.5;
// event.currentTarget.parent.dragging = true;
// event.currentTarget.parent.dragPoint = event.data.getLocalPosition(event.currentTarget.parent.parent);
// event.currentTarget.parent.dragPoint.x -= event.currentTarget.parent.x;
// event.currentTarget.parent.dragPoint.y -= event.currentTarget.parent.y;
// }
// })
// .on('mouseup', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mouseupoutside', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mousemove', event => {
// if (event.currentTarget.parent.dragging) {
// const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent);
// event.currentTarget.parent.x = newPosition.x - event.currentTarget.parent.dragPoint.x;
// event.currentTarget.parent.y = newPosition.y - event.currentTarget.parent.dragPoint.y;
// this.assetData.Point = new PIXI.Point(this.x, this.y);
// this.workingArea.canvasData.isChange = true;
// }
// })
// .on('rightclick', event => {
// });
// });
}
/**
*
@ -234,6 +183,13 @@ export class MultipointIcon extends AxShape {
this.text.visible = value;
}
}
// 设置缩放
public setItemScale(scale: number) {
// this.text.scale.set(scale);
this.pointsGraphics.forEach((item, index, array) => {
item.scale.set(scale);
});
}
// 刷新数据
public refresh() {
// console.log(this.assetData);
@ -243,5 +199,6 @@ export class MultipointIcon extends AxShape {
this.text.text = this.assetData.Name
+ '\r\n'
+ this.assetData.PropertyInfos.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
this.text.angle = -this.workingArea.backgroundImage.angle;
}
}

134
src/app/working-area/model/polygonIcon.ts

@ -9,9 +9,9 @@ import { AxShape } from './axShape';
*/
export class PolygonIcon extends AxShape {
public pointsData: PIXI.Point[];
public pointsGraphics: PIXI.Graphics[] = [];
public pointsGraphics: PIXI.Sprite[] = [];
public polygonGraphics: PIXI.Graphics = new PIXI.Graphics();
public polygonLineGraphics: PIXI.Graphics = new PIXI.Graphics();
// public polygonLineGraphics: PIXI.Graphics = new PIXI.Graphics();
style = new PIXI.TextStyle({
fontFamily: 'Arial',
fontSize: 18,
@ -46,13 +46,14 @@ export class PolygonIcon extends AxShape {
this.sortableChildren = true;
// 画点
this.pointsData.forEach((item, index, array) => {
const iconPoint = new PIXI.Graphics();
iconPoint.lineStyle(1, 0xFFBD01, 1);
iconPoint.beginFill(0xFFFFFF, 1);
iconPoint.drawCircle(0, 0, 15);
const iconPoint = PIXI.Sprite.from(this.pointTexture);
// iconPoint.lineStyle(1, 0xFFBD01, 1);
// iconPoint.beginFill(0xFFFFFF, 1);
// iconPoint.drawCircle(0, 0, 15);
iconPoint.anchor.set(0.5);
iconPoint.x = item.x;
iconPoint.y = item.y;
iconPoint.endFill();
// iconPoint.endFill();
iconPoint.visible = false;
this.pointsGraphics.push(iconPoint);
this.addChild(iconPoint);
@ -66,13 +67,15 @@ export class PolygonIcon extends AxShape {
this.polygonGraphics.endFill();
this.addChild(this.polygonGraphics);
// 画多边形
this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1);
this.polygonLineGraphics.drawPolygon(this.getPoints());
this.polygonLineGraphics.closePath();
this.addChild(this.polygonLineGraphics);
// this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1);
// this.polygonLineGraphics.drawPolygon(this.getPoints());
// this.polygonLineGraphics.closePath();
// this.addChild(this.polygonLineGraphics);
this.text.anchor.set(0.5);
this.text.position = this.calculatePolygonGravityCenter(this.pointsData);
this.text.visible = this.showName;
this.text.angle = -this.workingArea.backgroundImage.angle;
// console.log(this.calculatePolygonGravityCenter(this.pointsData));
this.polygonGraphics.addChild(this.text);
// 添加圆点事件
@ -80,7 +83,7 @@ export class PolygonIcon extends AxShape {
item.interactive = true;
item.buttonMode = true;
item.zIndex = 1;
item.on('mousedown', event => {
item.on('pointerdown', event => {
event.stopPropagation();
if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
event.currentTarget.data = event.data;
@ -88,21 +91,21 @@ export class PolygonIcon extends AxShape {
event.currentTarget.dragging = true;
}
})
.on('mouseup', event => {
.on('pointerup', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mouseupoutside', event => {
.on('pointerupoutside', event => {
if (event.currentTarget.dragging) {
event.currentTarget.alpha = 1;
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mousemove', event => {
.on('pointermove', event => {
if (event.currentTarget.dragging) {
const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent);
event.currentTarget.x = newPosition.x;
@ -116,13 +119,14 @@ export class PolygonIcon extends AxShape {
this.polygonGraphics.beginFill(color, angle);
this.polygonGraphics.drawPolygon(this.getPoints());
this.polygonGraphics.endFill();
// 画多边形
this.polygonLineGraphics.clear();
this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1);
this.polygonLineGraphics.drawPolygon(this.getPoints());
this.polygonLineGraphics.closePath();
// // 画多边形
// this.polygonLineGraphics.clear();
// this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1);
// this.polygonLineGraphics.drawPolygon(this.getPoints());
// this.polygonLineGraphics.closePath();
this.text.position = this.calculatePolygonGravityCenter(this.pointsData);
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
}
})
.on('rightclick', event => {
@ -133,7 +137,7 @@ export class PolygonIcon extends AxShape {
this.workingArea.previewImage.visible = false;
}
})
.on('mouseout', event => {
.on('pointerout', event => {
event.stopPropagation();
if (this.workingArea.previewImage !== null
&& this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
@ -141,64 +145,6 @@ export class PolygonIcon extends AxShape {
}
});
});
// // 添加选中事件
// this.polygonGraphics.interactive = true;
// this.polygonGraphics.buttonMode = true;
// this.polygonGraphics
// .on('mousedown', event => {
// event.stopPropagation();
// this.workingArea.selection.selectOne(this);
// if (this.workingArea.allowEdit && this.assetData.GameMode === this.workingArea.canvasData.gameMode) {
// event.currentTarget.parent.data = event.data;
// event.currentTarget.parent.alpha = 0.5;
// event.currentTarget.parent.dragging = true;
// event.currentTarget.parent.dragPoint = event.data.getLocalPosition(event.currentTarget.parent.parent);
// event.currentTarget.parent.dragPoint.x -= event.currentTarget.parent.x;
// event.currentTarget.parent.dragPoint.y -= event.currentTarget.parent.y;
// }
// })
// .on('mouseup', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mouseupoutside', event => {
// if (event.currentTarget.parent.dragging) {
// event.currentTarget.parent.alpha = 1;
// event.currentTarget.parent.dragging = false;
// event.currentTarget.parent.data = null;
// }
// })
// .on('mousemove', event => {
// if (event.currentTarget.parent.dragging) {
// const newPosition = event.currentTarget.parent.data.getLocalPosition(event.currentTarget.parent.parent);
// event.currentTarget.parent.x = newPosition.x - event.currentTarget.parent.dragPoint.x;
// event.currentTarget.parent.y = newPosition.y - event.currentTarget.parent.dragPoint.y;
// this.assetData.Point = new PIXI.Point(this.x, this.y);
// this.workingArea.canvasData.isChange = true;
// }
// })
// .on('rightclick', event => {
// // this.workingArea.selection.deselectAll();
// })
// .on('mouseover', event => {
// event.stopPropagation();
// if (this.workingArea.previewImage !== null
// && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
// this.workingArea.previewImage.visible = false;
// }
// })
// .on('mouseout', event => {
// event.stopPropagation();
// if (this.workingArea.previewImage !== null
// && this.workingArea.getPaintMode() === PaintMode.singlePointIcon) {
// this.workingArea.previewImage.visible = true;
// }
// });
}
/**
*
@ -209,31 +155,14 @@ export class PolygonIcon extends AxShape {
item.visible = value;
});
}
public calculatePolygonGravityCenter(points: PIXI.Point[]) {
let area = 0.0; // 多边形面积
let gravityLat = 0.0; // 重心点 latitude
let gravityLng = 0.0; // 重心点 longitude
points.forEach((item, index) => {
// 1
const lat = item.x;
const lng = item.y;
const nextLat = points[(index + 1) % points.length].x;
const nextLng = points[(index + 1) % points.length].y;
// 2
const tempArea = (nextLat * lng - nextLng * lat) / 2.0;
// 3
area += tempArea;
// 4
gravityLat += tempArea * (lat + nextLat) / 3;
gravityLng += tempArea * (lng + nextLng) / 3;
// 设置缩放
public setItemScale(scale: number) {
// this.text.scale.set(scale);
this.pointsGraphics.forEach(point => {
point.scale.set(scale);
});
// 5
gravityLat = gravityLat / area;
gravityLng = gravityLng / area;
return new PIXI.Point(gravityLat, gravityLng);
}
/**
*
*/
@ -266,5 +195,6 @@ export class PolygonIcon extends AxShape {
this.polygonGraphics.beginFill(color, angle);
this.polygonGraphics.drawPolygon(this.getPoints());
this.polygonGraphics.endFill();
this.text.angle = -this.workingArea.backgroundImage.angle;
}
}

665
src/app/working-area/working-area.component.ts

@ -2,7 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild, AfterViewInit, Input } from '
import * as PIXI from 'pixi.js';
import { EventEmitter } from 'events';
import { EventManager } from '@angular/platform-browser';
import { OutlineFilter } from 'pixi-filters';
// import { OutlineFilter } from 'pixi-filters';
import { AssetData, CanvasShareDataService, DisposalNodeData, FloorNodeData } from '../canvas-share-data.service';
import * as ObjectID from 'bson-objectid';
import { Charm } from './charm';
@ -15,7 +15,8 @@ import { AxShape } from './model/axShape';
import { PropertyInfo } from './model/PropertyInfo';
import { AxPreviewImageShape } from './model/axPreviewImageShape';
import { AxArrowConnector } from './model/axArrowConnector';
import { Legend } from './model/legend';
import { AxLegend, Legend } from './model/axLegend';
import { NullTemplateVisitor } from '@angular/compiler';
@Component({
@ -97,7 +98,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
/**
* 绿
*/
public outlineFilterGreen = new OutlineFilter(2, 0x00ff00);
// public outlineFilterGreen = new OutlineFilter(2, 0x00ff00);
/**
*
*/
@ -135,10 +136,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
public carData: Map<string, any> = new Map<string, any>();
// 当前选择的车辆id
public selectCar: any = null;
// 本软件版本号由四部分组成:<主版本号><次版本号><修订版本号><日期加希腊字母版本号> 例如:1.0.0.20210105_beta
// Alpha版: 此版本表示该软件在此阶段主要是以实现软件功能为主,通常只在软件开发者内部交流,一般而言,该版本软件的Bug较多,需要继续修改。
// Beta版: 该版本相对于α版已有了很大的改进,消除了严重的错误,但还是存在着一些缺陷,需要经过多次测试来进一步消除,此版本主要的修改对像是软件的UI。
// RC版: 该版本已经相当成熟了,基本上不存在导致错误的BUG,与即将发行的正式版相差无几。
// Release版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。
public VERSION = '1.0.4.20210109_beta';
/**
*
*/
ngOnInit(): void {
PIXI.utils.skipHello()
this.sayHello();
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => {
if (event.keyCode === 17) {
this.selection.isMultiselection = true;
@ -152,40 +161,51 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}
// 按Del键删除选中的图标
if (event.keyCode === 46) {
this.selection.objects.forEach(item => {
if (this.allowEdit
&& this.canvasData.gameMode === item.assetData.GameMode) {
switch (this.canvasData.gameMode) {
case 0:
// 删除楼层数据
delete this.canvasData.originaleveryStoreyData.data[item.assetData.Id];
// 删除建筑数据
delete this.canvasData.originalcompanyBuildingData.data[item.assetData.Id];
// 取消渲染
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id));
// 数据更改
this.canvasData.isChange = true;
break;
case 1:
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[item.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Increment[item.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Stock[item.assetData.Id];
this.backgroundImage.removeChild(this.backgroundImage.getChildByName(item.assetData.Id));
this.canvasData.isChange = true;
break;
}
}
});
this.selection.deselectAll();
this.emit('deleteIcon');
this.deleteSelectedShape();
}
});
}
/**
*
*/
public deleteSelectedShape() {
this.selection.objects.forEach(item => {
this.deleteShape(item);
});
this.selection.deselectAll();
}
/**
*
* @param obj
*/
public deleteShape(shape) {
if (this.allowEdit && this.canvasData.gameMode === shape.assetData.GameMode) {
this.emit('deleteIcon',shape);
}
}
/**
*
*/
sayHello() {
var _a;
if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
var args = [
"\n %c 版本号 - " + this.VERSION + "\n",
'color: #ff66a5; background: #000000; padding:5px 0;',
];
(_a = window.console).log.apply(_a, args);
}
else if (window.console) {
window.console.log("\n %c 版本号 - " + this.VERSION + "\n");
}
}
/**
*
*/
ngAfterViewInit(): void {
this.createCanvas();
setTimeout(() => {
this.createCanvas();
});
window.onresize = () => {
this.resetCanvas();
};
@ -203,7 +223,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.backgroundImage.scale.x >= 32) {
this.backgroundImage.scale.x = 32;
this.backgroundImage.scale.y = 32;
this.emit('backgroundScale', this.backgroundImage.scale.x);
this.resizeItem(1/this.backgroundImage.scale.x)
return;
}
this.backgroundImage.pivot.set(pivot.x, pivot.y);
@ -217,7 +237,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.backgroundImage.scale.x <= 0.1) {
this.backgroundImage.scale.x = 0.1;
this.backgroundImage.scale.y = 0.1;
this.emit('backgroundScale', this.backgroundImage.scale.x);
this.resizeItem(1/this.backgroundImage.scale.x)
return;
}
this.backgroundImage.pivot.set(pivot.x, pivot.y);
@ -228,7 +248,16 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.backgroundImage.position.x += delX;
this.backgroundImage.position.y += delY;
}
this.emit('backgroundScale', this.backgroundImage.scale.x);
this.resizeItem(1/this.backgroundImage.scale.x)
}
// 重置图形缩放
public resizeItem(size:number) {
this.backgroundImage.children.forEach(item => {
if (item instanceof AxShape) {
item.setItemScale(size);
item.drawBorder(size);
}
});
}
/**
*
@ -268,19 +297,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
backgroundColor: 0xE9FAFF
});
this.content.nativeElement.appendChild(this.app.view);
this.app.view.style.border = '1px dashed blue';
this.animator = new Charm(PIXI);
this.createBackgroundImage();
this.app.ticker.add((delta) => {
this.animator.update();
this.mousePosition = this.app.renderer.plugins.interaction.mouse.global;
// 预览图片
if (this.previewImage !== null) {
if (this.previewImage !== undefined && this.previewImage !== null) {
this.previewImage.position = this.backgroundImage.toLocal(this.mousePosition);
}
if (this.backgroundImage !== null) {
if (this.circleShadow !== undefined && this.circleShadow !== null) {
this.circleShadow.position = this.backgroundImage.toLocal(this.mousePosition);
this.refreshPreviewLineSegment(this.currentClickPoint.position, this.circleShadow.position);
this.refreshPreviewPoint();
}
/**
*
@ -308,101 +339,90 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
/**
*
*/
this.on('select', obj => {
if (this.allowEdit) {
if (obj instanceof AxArrowConnector) {
obj.setPointsVisible(true);
}
else if (obj instanceof MultipointIcon) {
if (obj.assetData.GameMode === this.canvasData.gameMode) {
obj.setPointVisiable(true);
} else {
obj.filters = [this.outlineFilterGreen];
}
} else if (obj instanceof PolygonIcon) {
if (obj.assetData.GameMode === this.canvasData.gameMode) {
obj.setPointVisiable(true);
} else {
obj.filters = [this.outlineFilterGreen];
}
} else {
obj.filters = [this.outlineFilterGreen];
}
} else {
obj.filters = [this.outlineFilterGreen];
}
this.on('select', (axShape:AxShape)=> {
axShape.showBorder();
axShape.setPointVisiable(this.allowEdit);
});
/**
*
*/
this.on('deselect', obj => {
if (this.allowEdit) {
if (obj instanceof AxArrowConnector) {
obj.setPointsVisible(false);
}
else if (obj instanceof MultipointIcon) {
obj.setPointVisiable(false);
} else if (obj instanceof PolygonIcon) {
obj.filters = [];
obj.setPointVisiable(false);
} else {
obj.filters = [];
}
} else {
obj.filters = [];
}
this.on('deselect', (axShape:AxShape)=> {
axShape.hideBorder();
axShape.setPointVisiable(false);
});
/**
*
*
*/
this.on('backgroundScale', scale => {
this.backgroundImage?.children.forEach(item => {
if (item instanceof AxImageShape) {
if (item.assetData.FixedSize) {
const data = 1 / scale;
item.scale.set(data);
} else {
const data = 1 / scale;
item.text.scale.set(data);
}
} else if (item instanceof MultipointIcon) {
const data = 1 / scale;
item.text.scale.set(data);
} else if (item instanceof PolygonIcon) {
const data = 1 / scale;
item.text.scale.set(data);
item.pointsGraphics.forEach(point => {
point.scale.set(data);
});
} else if (item instanceof AxPreviewImageShape) {
const data = 1 / scale;
item.scale.set(data);
}else if (item instanceof AxArrowConnector) {
const data = 1 / scale;
item.text.scale.set(data);
item.pointSprites.forEach(point => {
point.scale.set(data);
});
}
});
});
/**
*
*/
this.on('createIcon', obj => {
if (obj.assetData.GameMode === GameMode.BasicInformation) {
this.on('createIcon', (axShape: AxShape) => {
console.log("新增图标:"+axShape.assetData.Name);
if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
// 添加楼层数据
this.canvasData.originaleveryStoreyData.data[obj.assetData.Id] = obj.assetData;
this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id] = axShape.assetData;
// 添加建筑数据
this.canvasData.originalcompanyBuildingData.data[obj.assetData.Id] = obj.assetData;
} else {
this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id] = axShape.assetData;
} else if (axShape.assetData.GameMode === GameMode.Assignment) { // 处置预案
if (this.canvasData.selectPanelPoint.Data === undefined
|| this.canvasData.selectPanelPoint.Data === null) {
|| this.canvasData.selectPanelPoint.Data === null) {
this.canvasData.selectPanelPoint.Data = new FloorNodeData();
}
this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData;
this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id] = axShape.assetData;
}
// else if (obj.assetData.GameMode === GameMode.Examinee) { // 考生考试
// if (obj.assetData.Tag === 1) {
// this.canvasData.examOriginaleveryStoreyData.data[obj.assetData.Id] = obj.assetData;
// } else {
// if (this.canvasData.selectPanelPoint.Data === undefined
// || this.canvasData.selectPanelPoint.Data === null) {
// this.canvasData.selectPanelPoint.Data = new FloorNodeData();
// }
// this.canvasData.selectPanelPoint.Data.Stock[obj.assetData.Id] = obj.assetData;
// }
// }
var temp = this.backgroundImage.getChildByName("图例") as AxLegend;
if ( temp !== undefined
&& temp !== null) {
var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1);
temp.addItem(itemLegend);
}
this.emit('canvasDataChanged');
this.canvasData.isChange = true;
});
/**
* ()
*/
this.on('deleteIcon', (axShape:AxShape)=>{
// 删除图例对象
var temp = this.backgroundImage.getChildByName("图例") as AxLegend;
if ( temp !== undefined
&& temp !== null) {
var itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1);
temp.deleteItem(itemLegend);
}
if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 基本信息
// 删除楼层数据
delete this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id];
// 删除建筑数据
delete this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id];
} else if (axShape.assetData.GameMode === GameMode.Assignment) { // 处置预案
delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id];
delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id];
}
// else if (assetData.GameMode === GameMode.Examinee) { // 考生考试
// if (assetData.Tag === 1) {
// // 删除楼层数据
// delete this.canvasData.examOriginaleveryStoreyData.data[assetData.Id];
// } else {
// delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[assetData.Id];
// delete this.canvasData.selectPanelPoint.Data.Increment[assetData.Id];
// delete this.canvasData.selectPanelPoint.Data.Stock[assetData.Id];
// }
// }
this.backgroundImage.removeChild(axShape);
this.emit('canvasDataChanged');
this.canvasData.isChange = true;
});
}
@ -425,6 +445,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
item.setNameVisible(value, mode);
} else if (item instanceof PolygonIcon) {
item.setNameVisible(value, mode);
} else if (item instanceof AxArrowConnector) {
item.setNameVisible(value, mode);
}
});
}
@ -443,6 +465,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
icon.refresh();
} else if (icon instanceof AxArrowConnector) {
icon.redraw();
} else if (icon instanceof AxLegend) {
icon.refresh();
}
}
/**
@ -474,29 +498,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.selection.select(obj);
});
}
/**
*
*/
public async refresh() {
this.setPaintMode(PaintMode.endPaint);
this.resetCanvas();
this.destroyBackgroundImage();
if (!this.canvasData.selectStorey.imageUrl) {
return;
}
await this.createBackgroundImage(this.canvasData.selectStorey.imageUrl);
this.createFloorShape();
if (this.canvasData.gameMode === GameMode.Assignment) {
this.createWorkNode();
}
this.emit('backgroundScale', this.backgroundImage.scale.x);
}
/**
*
*/
private createFloorShape() {
const floorData = this.canvasData.originaleveryStoreyData.data;
public createFloorShape(floorData: any) {
if (floorData === undefined || floorData === null) return;
Object.keys(floorData).forEach((key) => {
switch (floorData[key].InteractiveMode) {
case 0:
@ -511,22 +517,24 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
break;
case 3:
if (floorData[key].Name === '水带') {
const distance = new AxArrowConnector(floorData[key], this,false,true);
const distance = new AxArrowConnector(floorData[key], this, false, true);
} else if(floorData[key].Name === '距离'){
const distance = new AxArrowConnector(floorData[key], this,true,true);
const distance = new AxArrowConnector(floorData[key], this, true, true);
}else if(floorData[key].Name === '普通墙' || floorData[key].Name === '承重墙'){
const wall = new AxArrowConnector(floorData[key], this,false,false);
const wall = new AxArrowConnector(floorData[key], this, false, false);
}
break;
}
});
// this.emit('backgroundScale', this.backgroundImage.scale.x);
}
private createWorkNode() {
// 加载处置节点数据
const nodeData = this.canvasData.selectPanelPoint.Data;
/**
*
*/
public createNodeShape(nodeData: any) {
if (nodeData !== undefined && nodeData !== null) {
Object.keys(nodeData).forEach((key) => {
if (nodeData[key] === undefined || nodeData[key] === null) { return;}
Object.keys(nodeData[key]).forEach((tempKey) => {
switch (nodeData[key][tempKey].InteractiveMode) {
case 0:
@ -546,55 +554,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
});
});
}
// this.emit('backgroundScale', this.backgroundImage.scale.x);
}
/**
*
* @param id ID
* @param b /
*/
public setIconVisible(ids: string[], b: boolean) {
ids.forEach(item => {
this.backgroundImage.getChildByName(item).visible = b;
});
}
// /**
// * 版本检查
// */
// public versionChecking(): void {
// const floorData = this.canvasData.originaleveryStoreyData;
// const buildingData = this.canvasData.originalcompanyBuildingData;
// const nodeData = this.canvasData.selectPanelPoint;
// if (floorData.version && floorData.version === '1.0') {
// floorData.version = '2.0';
// Object.keys(floorData.data).forEach(item => {
// floorData.data[item].Point.y *= -1;
// floorData.data[item].MultiPoint?.forEach(element => {
// element.y *= -1;
// });
// });
// }
// if (buildingData.version && buildingData.version === '1.0') {
// buildingData.version = '2.0';
// Object.keys(buildingData.data).forEach(item => {
// buildingData.data[item].Point.y *= -1;
// buildingData.data[item].MultiPoint?.forEach(element => {
// element.y *= -1;
// });
// });
// }
// if (nodeData.Version && nodeData.Version === '1.0') {
// nodeData.Version = '2.0';
// console.log(this.canvasData.selectPanelPoint.Version);
// Object.keys(nodeData.Data).forEach((key) => {
// Object.keys(nodeData.Data[key]).forEach((tempKey) => {
// nodeData.Data[key][tempKey].Point.y *= -1;
// nodeData.Data[key][tempKey].MultiPoint?.forEach(element => {
// element.y *= -1;
// });
// });
// });
// }
// }
/**
*
*/
@ -606,7 +567,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaintEndButton.interactive = true;
this.enterPaintEndButton.buttonMode = true;
this.enterPaintEndButton
.on('mousedown', event => {
.on('pointerdown', event => {
event.stopPropagation();
this.enterPaint();
});
@ -617,33 +578,32 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
/**
*
*/
private async createBackgroundImage(imageUrl: string): Promise<void> {
const image = await PIXI.Texture.fromURL(imageUrl);
this.backgroundImage = new PIXI.Sprite(image);
public createBackgroundImage(){
this.backgroundImage = PIXI.Sprite.from('assets/images/noImg.png')
this.backgroundImage.anchor.set(0.5);
this.backgroundImage.x = this.app.view.width / 2;
this.backgroundImage.y = this.app.view.height / 2;
// this.backgroundImage.x = this.app.view.width / 2;
// this.backgroundImage.y = this.app.view.height / 2;
this.backgroundImage.interactive = true;
this.backgroundImage.name = 'background';
this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle;
// const left = this.init.element.nativeElement.querySelector('.functionalDomainLeft').clientWidth;
// const right = this.init.element.nativeElement.querySelector('.functionalDomainRight').clientWidth;
const imageWidth = this.backgroundImage.texture.width;
const imageHeight = this.backgroundImage.texture.height;
const appWidth = this.app.view.width - 470;
const appHeight = this.app.view.height;
// this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle;
// const imageWidth = 665;
// const imageHeight = 530;
// const appWidth = this.app.view.width - 470;
// const appHeight = this.app.view.height;
const wScale = appWidth / imageWidth;
const hScale = appHeight / imageHeight;
// const wScale = appWidth / imageWidth;
// const hScale = appHeight / imageHeight;
const scale = wScale < hScale
? wScale
: hScale;
this.backgroundImage.scale.set(scale);
// const scale = wScale < hScale
// ? wScale
// : hScale;
// this.backgroundImage.scale.set(scale);
this.backgroundImage.sortableChildren = true;
this.backgroundImage
.on('mousedown', event => {
.on('pointerdown', event => {
if (event.data.button !== 0) return;
if (!event.currentTarget.dragging && this.selection.isMultiselection === false) {
this.selection.deselectAll();
event.currentTarget.data = event.data;
event.currentTarget.dragging = true;
event.currentTarget.dragPoint = event.data.getLocalPosition(event.currentTarget.parent);
@ -651,7 +611,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
event.currentTarget.dragPoint.y -= event.currentTarget.y;
switch (this.paintMode) {
case PaintMode.endPaint:
console.log(this.backgroundImage.toLocal(this.mousePosition));
break;
case PaintMode.singlePointIcon:
const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos));
@ -685,11 +644,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
DrawMode : this.canvasData.selectTemplateData.drawMode,
Thickness : this.canvasData.selectTemplateData.thickness,
IsFromBuilding : this.canvasData.selectTemplateData.isFromBuilding,
GameMode : this.canvasData.gameMode
GameMode: this.canvasData.gameMode,
Tag: this.canvasData.selectTemplateData.tag
};
const singleIcon = new AxImageShape(assetData, this);
this.emit('createIcon', singleIcon);
this.emit('backgroundScale', this.backgroundImage.scale.x);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
break;
case PaintMode.lineIcon:
this.previewLineSegment.visible = true;
@ -699,6 +659,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.paintPoints.length >= 2) {
this.enterPaintEndButton.position = this.circleShadow.position;
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
}
if (this.paintingIcon !== null) {
@ -732,7 +693,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
DrawMode: this.canvasData.selectTemplateData.drawMode,
Thickness: this.canvasData.selectTemplateData.thickness,
IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding,
GameMode: this.canvasData.gameMode
GameMode: this.canvasData.gameMode,
Tag: this.canvasData.selectTemplateData.tag
};
// const assetData1 = {
// ImageUrl: this.canvasData.selectTemplateData.imageUrl,
@ -745,7 +707,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.paintingIcon = new MultipointIcon(assetData1, this);
// this.paintingIcon = new MultipointIcon(this.previewSinglePointIcon.texture, new PIXI.Point(0, 0), this.paintPoints, this,
// this.canvasData.selectTemplateData.name);
this.emit('backgroundScale', this.backgroundImage.scale.x);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
break;
case PaintMode.polygonIcon:
this.previewLineSegment.visible = true;
@ -755,6 +717,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaintEndButton.position = this.circleShadow.position;
} else if (this.paintPoints.length >= 3) {
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
}
this.paintPoints.forEach((value, index, array) => {
if (index === 0) {
@ -783,6 +746,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.previewLineSegment.visible = true;
this.enterPaintEndButton.position = this.circleShadow.position;
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y);
this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y));
if (this.paintPoints.length < 2) {
@ -817,7 +781,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
DrawMode: this.canvasData.selectTemplateData.drawMode,
Thickness: this.canvasData.selectTemplateData.thickness,
IsFromBuilding: this.canvasData.selectTemplateData.isFromBuilding,
GameMode: this.canvasData.gameMode
GameMode: this.canvasData.gameMode,
Tag: this.canvasData.selectTemplateData.tag
};
if (this.canvasData.selectTemplateData.name === '距离') {
this.paintingShape = new AxArrowConnector(assetData2, this,true,true);
@ -829,7 +794,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.paintingShape.redraw();
}
}
this.emit('backgroundScale', this.backgroundImage.scale.x);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
break;
}
} else if (!event.currentTarget.dragging && this.selection.isMultiselection === true) {
@ -839,7 +804,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.finalScreenMousePos = this.backgroundImage.toLocal(this.mousePosition);
}
})
.on('mouseup', event => {
.on('pointerup', event => {
if (event.currentTarget.dragging) {
event.currentTarget.dragging = false;
event.currentTarget.data = null;
@ -862,13 +827,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.rectToolGraphics.visible = false;
}
})
.on('mouseupoutside', event => {
.on('pointerupoutside', event => {
if (event.currentTarget.dragging) {
event.currentTarget.dragging = false;
event.currentTarget.data = null;
}
})
.on('mousemove', event => {
.on('pointermove', event => {
if (event.currentTarget.dragging && this.selection.isMultiselection === false) {
const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent);
event.currentTarget.x = newPosition.x - event.currentTarget.dragPoint.x;
@ -921,37 +886,127 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
/**
*
*/
public refreshBackgroundImage(): void {
if (!this.canvasData.selectStorey.imageUrl) {
public async refreshBackgroundImage(imageUrl:string = this.canvasData.selectStorey.imageUrl,imageAngle:number = this.canvasData.selectStorey.imageAngle): Promise<void> {
if (imageUrl === undefined || imageUrl === null || imageUrl === "") {
this.backgroundImage.visible = false;
} else {
// this.backgroundImage.texture = PIXI.Texture.from(this.canvasData.selectStorey.imageUrl);
// this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle;
// this.backgroundImage.visible = true;
this.refresh();
this.backgroundImage.visible = false;
this.backgroundImage.scale.set(1);
this.backgroundImage.pivot.set(0);
this.backgroundImage.x = this.app.view.width / 2;
this.backgroundImage.y = this.app.view.height / 2;
this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl);
this.backgroundImage.angle = imageAngle;
// 等待图片加载完成
let imageWidth = this.backgroundImage.texture.width;
let imageHeight = this.backgroundImage.texture.height;
let appWidth = this.app.view.width - 470;
let appHeight = this.app.view.height;
let wScale = appWidth / imageWidth;
let hScale = appHeight / imageHeight;
let scale = wScale < hScale ? wScale : hScale;
// 设置图片缩放
this.backgroundImage.scale.set(scale);
this.backgroundImage.visible = true;
this.backgroundImage.children.forEach((item) => {
if (item instanceof AxShape) {
item.refresh();
}
})
}
}
/**
*
*
* @param imageUrl
* @param imageAngle
*/
public destroyBackgroundImage(): void {
this.app.stage.removeChild(this.backgroundImage);
public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise<void> {
await this.refreshBackgroundImage();
// 清空所有图形
this.selection.deselectAll();
let itemList = [];
this.backgroundImage.children.forEach(item => {
if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) {
itemList.push(item.name);
}
});
itemList.forEach(item => {
this.backgroundImage.getChildByName(item).destroy();
// let child = this.backgroundImage.getChildByName(item);
// this.backgroundImage.removeChild(child);
})
//加载当前数据
this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// 创建处置预案图形
this.createNodeShape(this.canvasData.selectPanelPoint.Data);
this.createAxLegend();
}
/**
*
* @param scale
*
*/
public setBackgroundScale(scale: number): void {
this.backgroundImage?.scale.set(scale);
this.emit('backgroundScale', this.backgroundImage?.scale.x);
public createAxLegend() {
const tempAssetData = {
Id: "图例",//ObjectID.default.generate()
Color: "#066EED80",
PropertyInfos: [
{
Tag : '',
Order : 0,
Enabled : true,
Visible : true,
Required : false,
RuleName : "",
RuleValue : "",
PhysicalUnit : "",
PropertyName : "列",
PropertyType : 2,
PropertyValue : 2,
},
]
};
let shapeMap: Map<string,Legend> = new Map<string,Legend>();
for (let item in this.canvasData.originaleveryStoreyData.data) {
if (shapeMap.has(this.canvasData.originaleveryStoreyData.data[item].Name)) {
shapeMap.get(this.canvasData.originaleveryStoreyData.data[item].Name).Count++;
} else {
shapeMap.set(this.canvasData.originaleveryStoreyData.data[item].Name, new Legend(
this.canvasData.originaleveryStoreyData.data[item].Name,
this.canvasData.originaleveryStoreyData.data[item].ImageUrl,
1
));
}
}
var axLegend = new AxLegend(tempAssetData, this, shapeMap);
var rect = this.backgroundImage.getLocalBounds();
var itemRect = axLegend.getLocalBounds();
axLegend.x = rect.right - itemRect.right;
axLegend.y = rect.bottom - itemRect.bottom;
}
// /**
// * 清空画布
// */
// public destroyBackgroundImage(): void {
// this.app.stage.removeChild(this.backgroundImage);
// this.backgroundImage = null;
// }
/**
*
* @param imageAngle
*/
public setBackgroundAngle(imageAngle: number) {
this.backgroundImage.angle = imageAngle;
}
// // * 设置背景图缩放
// // * @param scale 缩放系数
// // */
// public setBackgroundScale(scale: number): void {
// this.backgroundImage?.scale.set(scale);
// this.emit('backgroundScale', this.backgroundImage?.scale.x);
// }
// /**
// * 设置背景图角度
// * @param imageAngle 角度值
// */
// public setBackgroundAngle(imageAngle: number) {
// this.backgroundImage.angle = imageAngle;
// }
/**
*
*/
@ -986,7 +1041,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*/
private refreshPreviewLineSegment(pointA: PIXI.Point, pointB: PIXI.Point) {
this.previewLineSegment.clear();
this.previewLineSegment.lineStyle(5, 0x00ff00, 1);
this.previewLineSegment.lineStyle(1/this.backgroundImage.scale.x, 0x00ff00, 1);
this.previewLineSegment.moveTo(pointA.x, pointA.y);
this.previewLineSegment.lineTo(pointB.x, pointB.y );
}
@ -995,12 +1050,21 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* @param x
*/
private createCircleShadow(): void {
this.circleShadow.beginFill(0xFFCC5A);
this.circleShadow.drawCircle(0, 0, 10);
this.circleShadow.endFill();
// this.circleShadow.beginFill(0xFFCC5A);
// this.circleShadow.drawCircle(0, 0, 10);
// this.circleShadow.endFill();
this.circleShadow.visible = false;
this.backgroundImage.addChild(this.circleShadow);
}
/**
*
*/
private refreshPreviewPoint() {
this.circleShadow.clear();
this.circleShadow.beginFill(0x00ff00);
this.circleShadow.drawCircle(0, 0, 5/this.backgroundImage.scale.x);
this.circleShadow.endFill();
}
showConnectionPoint(b: boolean) {
this.backgroundImage?.children.forEach(item => {
if (item instanceof AxImageShape) {
@ -1014,6 +1078,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*
*/
public beginPaint() {
console.log(this.canvasData.selectTemplateData);
this.selection.deselectAll();
this.setPaintMode(PaintMode.endPaint);
this.setPaintMode(this.canvasData.selectTemplateData.interactiveMode);
@ -1170,7 +1235,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
break;
}
this.paintPoints.splice(0, this.paintPoints.length);
this.emit('backgroundScale', this.backgroundImage.scale.x);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
}
/**
*
@ -1219,9 +1284,111 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}
this.selection.select(this.backgroundImage.getChildByName(newData.Id));
});
this.emit('backgroundScale', this.backgroundImage.scale.x);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
}
////////////////////////////////////////////////////////////////////////通用/////////////////////////////////////////////////////////////////////////////
/**
*
* @param id ID
* @param b /
*/
public setIconVisible(ids: string[], b: boolean) {
ids.forEach(item => {
this.backgroundImage.getChildByName(item).visible = b;
});
}
////////////////////////////////////////////////////////////////////////采集平台加载逻辑///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////编制平台加载逻辑///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////考试系统加载逻辑///////////////////////////////////////////////////////////////////////
/**
*
*/
public async onExamineeClickFloor() {
// this.backgroundImage.visible = false;
// this.backgroundImage.scale.set(1);
// this.backgroundImage.pivot.set(0);
// this.backgroundImage.x = this.app.view.width / 2;
// this.backgroundImage.y = this.app.view.height / 2;
// this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl);
// this.backgroundImage.angle = imageAngle;
// // 等待图片加载完成
// let imageWidth = this.backgroundImage.texture.width;
// let imageHeight = this.backgroundImage.texture.height;
// let appWidth = this.app.view.width - 470;
// let appHeight = this.app.view.height;
// let wScale = appWidth / imageWidth;
// let hScale = appHeight / imageHeight;
// let scale = wScale < hScale ? wScale : hScale;
// // 设置图片缩放
// this.backgroundImage.scale.set(scale);
// // 清空所有图形
// this.selection.deselectAll();
// let itemList = [];
// this.backgroundImage.children.forEach(item => {
// if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) {
// itemList.push(item.name);
// }
// });
// itemList.forEach(item => {
// this.backgroundImage.getChildByName(item).destroy();
// })
// // 创建楼层图形
// this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
// // 创建楼层图形
// this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// // 创建处置预案图形
// this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// // 隐藏图标
// this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
// this.backgroundImage.visible = true;
}
/**
*
*/
public async onExaminerClickFloor() {
// this.backgroundImage.visible = false;
// this.backgroundImage.scale.set(1);
// this.backgroundImage.pivot.set(0);
// this.backgroundImage.x = this.app.view.width / 2;
// this.backgroundImage.y = this.app.view.height / 2;
// this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl);
// this.backgroundImage.angle = imageAngle;
// // 等待图片加载完成
// let imageWidth = this.backgroundImage.texture.width;
// let imageHeight = this.backgroundImage.texture.height;
// let appWidth = this.app.view.width - 470;
// let appHeight = this.app.view.height;
// let wScale = appWidth / imageWidth;
// let hScale = appHeight / imageHeight;
// let scale = wScale < hScale ? wScale : hScale;
// // 设置图片缩放
// this.backgroundImage.scale.set(scale);
// // 清空所有图形
// this.selection.deselectAll();
// let itemList = [];
// this.backgroundImage.children.forEach(item => {
// if (item instanceof AxShape && item instanceof AxPreviewImageShape===false) {
// itemList.push(item.name);
// }
// });
// itemList.forEach(item => {
// this.backgroundImage.getChildByName(item).destroy();
// })
// // 创建楼层图形
// this.createFloorShape(this.canvasData.examOriginaleveryStoreyData.data);
// // 创建楼层图形
// this.createFloorShape(this.canvasData.originaleveryStoreyData.data);
// // 创建处置预案图形
// this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// // 隐藏图标
// this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
// this.backgroundImage.visible = true;
}
}
/**

2
src/assets/css/newStyle.css

@ -367,7 +367,7 @@ iframe { display: block; }
.num-item .num-text { color: #93FCFF; font-weight: 500; font-family: 'digiface'; font-size: 50px; line-height: 62px; letter-spacing: 0.1em; }
.num-item .num-text .unit { font-size: 34px; margin-left: 10px; }
.main { display: flex; flex-direction: column; padding: 0 30px 10px; height: 93%; }
.main { display: flex; flex-direction: column; padding: 0 30px 10px; height: 100%; }
.main-top { flex: 2; display: flex; padding: 30px 0 0; max-height: 699px; }

2
src/styles.scss

@ -165,7 +165,7 @@ table td.mat-footer-cell:last-of-type{
cursor: pointer;
}
}
.custom-content-marker .close-btn:hover{
background: #666;
}

Loading…
Cancel
Save