Compare commits

..

30 Commits

Author SHA1 Message Date
邵佳豪 294eccdda7 [完善]npm报错信息 11 months ago
陈鹏飞 411722d6a8 修正bug 3 years ago
陈鹏飞 4dbeaf2b36 修正BUG 3 years ago
陈鹏飞 bc75ce7993 测试BUG修改 3 years ago
陈鹏飞 bc1e6d3997 可编辑预案重新上传文件 3 years ago
陈鹏飞 720098a068 平面图溢出显示不全BUG修正 3 years ago
陈鹏飞 1c35191071 修正正确加载当前月份数据 3 years ago
陈鹏飞 2f8548211a 合并 3 years ago
陈鹏飞 3ac88e8a1a 新增查看图片视频word文档 3 years ago
邵佳豪 f676d9e2d8 Merge branch 'zhuzhou' of http://39.106.78.171:3000/shaojiahao/ShangHaiYuan-AnXin into zhuzhou 3 years ago
邵佳豪 8f09a38a1b [完善]查看word预案完善 3 years ago
陈鹏飞 2ebf5df542 修正echarts BUG以及样式 3 years ago
陈鹏飞 8d8098bb60 特定单位跳转三维场景 3 years ago
邵佳豪 689e5c1573 [修改]修改input名称 3 years ago
邵佳豪 aa43b3c2d7 [修改]实景图去掉默认的重点部位文件夹 3 years ago
邵佳豪 495f73bf6f [完善]完善bug 3 years ago
邵佳豪 6ba3be89d9 Merge branch 'zhuzhou' of http://39.106.78.171:3000/shaojiahao/ShangHaiYuan-AnXin into zhuzhou 3 years ago
邵佳豪 8dc468c261 [完善]统计信息增加消防控制室 3 years ago
陈敬瑜 4b6ec4c9a2 [修改]编辑用户时取消限制 3 years ago
邵佳豪 58db1fc807 [修改]修改获取单位信息接口 3 years ago
陈敬瑜 209ab9a802 [修改]创建用户时放开对用户名的限制 3 years ago
陈敬瑜 fe46ca80b7 [修改]实时进展监管日期格式修改 3 years ago
陈敬瑜 036c9834a6 [修改]首页预案数量修改 3 years ago
陈敬瑜 f58e91a420 [修改]放开二维预案编辑功能 3 years ago
陈敬瑜 44a72a93ec [修改]首页统计分析本年改成本月 4 years ago
陈敬瑜 e6b3652c36 [修改]株洲统计分析弹窗大小修改 4 years ago
邵佳豪 a35b485add [新增]三维预案网址 4 years ago
邵佳豪 d76ab10342 [完善]地图默认显示株洲 4 years ago
邵佳豪 1bc637f97c [完善]地图相关修改为株洲市中心点 4 years ago
chenjingyu b8d8b7ab9a [新增]合并分支 4 years ago
  1. 2
      README.md
  2. 26
      angular.json
  3. 22670
      package-lock.json
  4. 3
      package.json
  5. 15
      proxy.config.json
  6. 77
      reset.css
  7. 10
      src/app/app-routing.module.ts
  8. 86
      src/app/app.component.ts
  9. 76
      src/app/app.module.ts
  10. 75
      src/app/auth.guard.ts
  11. 29
      src/app/canvas-share-data.service.ts
  12. 187
      src/app/data-collection/data-collection.module.ts
  13. 2
      src/app/data-collection/fire-force/addFireForce.html
  14. 20
      src/app/data-collection/fire-force/addFireForceCar.html
  15. 491
      src/app/data-collection/fire-force/fire-force.component.html
  16. 708
      src/app/data-collection/fire-force/fire-force.component.scss
  17. 1033
      src/app/data-collection/fire-force/fire-force.component.ts
  18. 147
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  19. 133
      src/app/data-collection/water-collection/water-collection.component.ts
  20. 3
      src/app/export-excel/export-excel.component.html
  21. 7
      src/app/export-excel/export-excel.component.scss
  22. 25
      src/app/export-excel/export-excel.component.spec.ts
  23. 31
      src/app/export-excel/export-excel.component.ts
  24. 84
      src/app/external-links-plan/external-links-plan.component.html
  25. 301
      src/app/external-links-plan/external-links-plan.component.ts
  26. 6
      src/app/gis-management/allaround/allaround.component.scss
  27. 6
      src/app/gis-management/basic-info/basic-info.component.scss
  28. 6
      src/app/gis-management/cad-draw/cad-draw.component.scss
  29. 110
      src/app/gis-management/fire-facilities/fire-facilities.component.html
  30. 6
      src/app/gis-management/fire-facilities/fire-facilities.component.scss
  31. 6
      src/app/gis-management/function-partition/function-partition.component.scss
  32. 416
      src/app/gis-management/gis-labeling/gis-labeling.component.html
  33. 7
      src/app/gis-management/gis-labeling/gis-labeling.component.scss
  34. 3198
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  35. 2
      src/app/gis-management/gis-labeling/lookPlan.html
  36. 10
      src/app/gis-management/gis-labeling/lookPlan.scss
  37. 267
      src/app/gis-management/gis-management.module.ts
  38. 6
      src/app/gis-management/key-site-look/key-site.component.scss
  39. 4
      src/app/gis-management/plan-list/plan-list.component.html
  40. 6
      src/app/gis-management/plan-list/plan-list.component.scss
  41. 36
      src/app/gis-management/realistic-picture-look/realistic-picture.component.html
  42. 6
      src/app/gis-management/realistic-picture-look/realistic-picture.component.scss
  43. 2
      src/app/home/home.component.ts
  44. 22
      src/app/http-interceptors/base-interceptor.ts
  45. 50
      src/app/http-interceptors/cache-token.service.ts
  46. 149
      src/app/interface.ts
  47. 42
      src/app/key-unit/basicinfo-look/basicinfo.component.ts
  48. 6
      src/app/key-unit/basicinfo/addhouseinfo.component.html
  49. 14
      src/app/key-unit/basicinfo/basicinfo.component.html
  50. 138
      src/app/key-unit/basicinfo/basicinfo.component.ts
  51. 4
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  52. 9
      src/app/key-unit/edit-unit-info/edit-unit-info.component.html
  53. 259
      src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.html
  54. 708
      src/app/key-unit/fire-fighting-device-look/fire-fighting-device.component.ts
  55. 302
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html
  56. 861
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  57. 14
      src/app/key-unit/function-division-look/function-division.component.ts
  58. 67
      src/app/key-unit/function-division/function-division.component.ts
  59. 58
      src/app/key-unit/key-unit-management/key-unit-management.component.html
  60. 28
      src/app/key-unit/key-unit-management/key-unit-management.component.scss
  61. 1496
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  62. 2
      src/app/key-unit/key-unit-management/resultcompanyPlan.html
  63. 119
      src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html
  64. 120
      src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.scss
  65. 25
      src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.spec.ts
  66. 203
      src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts
  67. 2
      src/app/key-unit/key-unit-management/upname.html
  68. 294
      src/app/key-unit/key-unit.module.ts
  69. 640
      src/app/key-unit/realistic-picture-look/realistic-picture.component.ts
  70. 6
      src/app/key-unit/realistic-picture/realistic-picture.component.html
  71. 942
      src/app/key-unit/realistic-picture/realistic-picture.component.ts
  72. 78
      src/app/key-unit/router-gis/router-gis.component.ts
  73. 19
      src/app/key-unit/six-familiarity/six-familiarity.component.ts
  74. 4
      src/app/key-unit/special-warning/special-warning.component.html
  75. 9
      src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html
  76. 4
      src/app/key-unit/view-unit-details/view-unit-details.component.html
  77. 8
      src/app/key-unit/water-road/water-road.component.html
  78. 6
      src/app/key-unit/water-road/water-road.component.scss
  79. 303
      src/app/key-unit/water-road/water-road.component.ts
  80. 2
      src/app/navigation/navigation.component.html
  81. 54
      src/app/navigation/navigation.component.ts
  82. 12
      src/app/pages/login/login.component.spec.ts
  83. 293
      src/app/pages/login/login.component.ts
  84. 7
      src/app/pages/login/lookUpdateData.html
  85. 6
      src/app/pages/pages-routing.module.ts
  86. 2
      src/app/pages/pages.component.html
  87. 6
      src/app/pages/pages.module.ts
  88. 122
      src/app/pipes/boolean.pipe.ts
  89. 6
      src/app/plan-audit/allaround/allaround.component.scss
  90. 6
      src/app/plan-audit/basic-info/basic-info.component.scss
  91. 6
      src/app/plan-audit/cad-draw/cad-draw.component.scss
  92. 161
      src/app/plan-audit/fire-facilities/fire-facilities.component.html
  93. 6
      src/app/plan-audit/fire-facilities/fire-facilities.component.scss
  94. 837
      src/app/plan-audit/fire-facilities/fire-facilities.component.ts
  95. 47
      src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts
  96. 71
      src/app/plan-audit/function-partition/function-partition.component.html
  97. 6
      src/app/plan-audit/function-partition/function-partition.component.scss
  98. 146
      src/app/plan-audit/function-partition/function-partition.component.ts
  99. 6
      src/app/plan-audit/key-site-look/key-site.component.scss
  100. 47
      src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts
  101. Some files were not shown because too many files have changed in this diff Show More

2
README.md

@ -9,5 +9,3 @@
项目初始化:npm install
项目启动:npm start
新git

26
angular.json

@ -18,13 +18,15 @@
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/anxin119",
"sourceMap": false,
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": ["src/favicon.ico", "src/assets"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss",
"./node_modules/swiper/css/swiper.min.css",
@ -33,7 +35,6 @@
"scripts": [
"node_modules/echarts/dist/echarts.js",
"src/assets/mTokenK1/mToken_K1.js",
"src/assets/kmap/kmap-service-main-kd.js",
"./node_modules/swiper/js/swiper.min.js",
"src/assets/chartstheme/westeros.js",
"src/assets/chartstheme/walden.js",
@ -61,8 +62,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "18mb",
"maximumError": "18mb"
"maximumWarning": "8mb",
"maximumError": "8mb"
},
{
"type": "anyComponentStyle",
@ -98,8 +99,13 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
@ -111,7 +117,9 @@
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
@ -133,4 +141,4 @@
"cli": {
"analytics": "6210f5d0-2cd7-43dc-b245-2140372d1b89"
}
}
}

22670
package-lock.json generated

File diff suppressed because it is too large Load Diff

3
package.json

@ -5,7 +5,6 @@
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json --open",
"build": "ng build",
"build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod",
"publish": "ng build --prod --verbose",
"test": "ng test",
"lint": "ng lint",
@ -27,10 +26,10 @@
"@types/cesium": "^1.59.5",
"@types/swiper": "^5.3.0",
"angular-calendar": "^0.28.2",
"angular2-tree-diagramm": "^1.0.7",
"bson-objectid": "^1.3.1",
"cesium": "^1.64.0",
"crypto-js": "^4.0.0",
"date-fns": "^2.9.0",
"e-ngx-cesium": "^6.3.2",
"echarts": "^4.6.0",
"firebase": "^7.6.2",

15
proxy.config.json

@ -1,10 +1,7 @@
{
"/api": {
"target": "http://121.36.37.70:8201/",
"生产": "http://10.81.73.39:8000/",
"测试": "http://121.36.37.70:8201/",
"生产2": "http://183.194.244.232:8088/",
"secure": false,
"changeOrigin": true
}
}
"/api": {
"target": "http://218.75.214.31:28085/",
"secure": false,
"changeOrigin": true
}
}

77
reset.css

@ -1,66 +1,27 @@
@charset "utf-8";
html,
body,
ul,
ol,
dl,
li,
dt,
dd,
p,
form,
input,
h1,
h2,
h3,
h4,
h5,
h6,
section,
article,
aside,
header,
footer,
nav,
figure,
time,
mark,
main,
canvas {
margin: 0;
padding: 0;
font-size: 16px;
html,body,ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas{
margin:0;
padding:0;
font-size:16px;
}
b,
strong,
i,
em,
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 500;
font-style: normal;
b,strong,i,em,h1,h2,h3,h4,h5,h6{
font-weight:500;
font-style:normal;
}
img {
border: none;
img{
border:none;
}
a {
a{
text-decoration: none;
color: #000;
ul,
ol,
li {
list-style: none;
}
color:#000;
ul,ol,li{
list-style:none;
}
.clearfn:after {
content: "";
clear: both;
.clearfn:after{
content:"";
clear:both;
display: block;
overflow: hidden;
height: 0;
overflow:hidden;
height:0;
visibility: hidden;
}
}

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-01-11 14:48:03
* @LastEditors: sueRimn
* @LastEditTime: 2021-07-29 10:26:58
* @LastEditTime: 2021-03-26 15:18:46
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
@ -19,8 +19,7 @@ import {MTokenK1Component} from './m-token-k1/m-token-k1.component' //K1秘钥
import {ViewUnitDetailsPlanComponent} from './key-unit/view-unit-details-plan/view-unit-details-plan.component'
import { TestComponent } from './test/test.component';
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component';
import { CreatePlanOnlineFiveComponent } from './plan-management/create-plan-online-five/create-plan-online-five.component'
import { ExportExcelComponent } from './export-excel/export-excel.component'
const routes: Routes = [
{path:'',redirectTo:'login',pathMatch:'full'},
@ -31,6 +30,7 @@ const routes: Routes = [
{path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)},
{path:'planManagement',loadChildren:() => import('./plan-management/plan-management.module').then(m => m.PlanManagementModule)},
{path:'planAudit',loadChildren:() => import('./plan-audit/plan-audit.module').then(m => m.PlanAuditModule)},
{path:'home',loadChildren:() => import('./pages/pages.module').then(m => m.PagesModule)},
{path:'visualization',component: HomeComponent},
{path:'gis',loadChildren:() => import('./gis-management/gis-management.module').then(m => m.GISManagementModule)},
{path:'statisticanalysis',loadChildren:() => import('./statistic-analysis/statistic-analysis.module').then(m => m.StatisticAnalysisModule)},
@ -41,10 +41,8 @@ const routes: Routes = [
{path:'keyUnit/viewunitinfoplans', component:ViewUnitDetailsPlanComponent,canActivate: [AuthGuard],},
{path:'getNoMToken',component:MTokenK1Component, canActivate: [AuthGuard],}, //K1秘钥验证失败是跳转页面
{path:'planAudit/planpass', component: PlanPassComponent , canActivate: [AuthGuard]},
// {path:'test', component: TestComponent },
{path:'test', component: TestComponent },
{path:'linksPlan', component: ExternalLinksPlanComponent },
{path:'CreatePlanOnlineFive',component:CreatePlanOnlineFiveComponent},
{path:'exportExcel',component:ExportExcelComponent, canActivate: [AuthGuard]},
];
@NgModule({

86
src/app/app.component.ts

@ -1,58 +1,56 @@
import { Component, Inject, Injector } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Data } from "./interface";
import { Router, ActivatedRoute } from "@angular/router";
import { CacheTokenService } from "./http-interceptors/cache-token.service"; //引入服务
import { MaskLayerService } from "./mask-layer.service";
import * as global from "globals";
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Data } from './interface'
import { Router,ActivatedRoute } from '@angular/router'
import {CacheTokenService} from './http-interceptors/cache-token.service'//引入服务
import { MaskLayerService } from './mask-layer.service';
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"],
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
constructor(
private maskLayerService: MaskLayerService,
private http: HttpClient,
private router: Router,
public token: CacheTokenService,
private injector: Injector
) {
global.injector = injector;
}
isMaskLayerShow: boolean = false;
constructor(private maskLayerService:MaskLayerService,private http:HttpClient,private router:Router,public token:CacheTokenService) { }
isMaskLayerShow:boolean = false
ngOnInit(): void {
console.log("更新日期2025.01.07");
//监听遮罩层
this.maskLayerService.getMessage().subscribe((message: any) => {
this.isMaskLayerShow = message;
this.maskLayerService.getMessage().subscribe((message: any)=>{
this.isMaskLayerShow = message
});
var token = sessionStorage.getItem("token");
var refreshToken = sessionStorage.getItem("refreshToken");
if(token && refreshToken) {
this.http.post('/api/Account/RefreshToken', {
token: token,
refreshToken: refreshToken
}).subscribe((data: Data) => {
sessionStorage.setItem("level",data.level);
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
this.token.startUp()
})
}
// console.log(1234,document.documentElement.clientWidth)
function addMeta(name, content) {
//手动添加mate标签
let meta = document.createElement("meta");
meta.content = content;
meta.name = name;
document.getElementsByTagName("head")[0].appendChild(meta);
function addMeta(name,content){//手动添加mate标签
let meta = document.createElement('meta');
    meta.content=content;
    meta.name=name;
    document.getElementsByTagName('head')[0].appendChild(meta);
}
if (document.documentElement.clientWidth < 800) {
addMeta(
"viewport",
"initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no,uc-fitscreen=yes,viewport-fit=cover"
);
}
if (sessionStorage.getItem("token") && !this.token.timer) {
//调用服务中的function刷新token
this.token.startUp();
if(document.documentElement.clientWidth < 800){
addMeta('viewport','initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no,uc-fitscreen=yes,viewport-fit=cover')
}
}

76
src/app/app.module.ts

@ -1,46 +1,37 @@
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { MatButtonModule } from "@angular/material/button";
import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatIconModule } from "@angular/material/icon";
import { MatSidenavModule } from "@angular/material/sidenav";
import { NavigationModule } from "./navigation/navigation.module";
import { HomeComponent } from "./home/home.component";
import { TabbarComponent } from "./tabbar/tabbar.component";
import { PagesModule } from "./pages/pages.module";
import { FormsModule } from "@angular/forms";
import { UiModule } from "./ui/ui.module";
import { HttpClientModule } from "@angular/common/http";
import { httpInterceptorProviders } from "./http-interceptors/index";
import { CacheTokenService } from "./http-interceptors/cache-token.service";
import { TreeService } from "./http-interceptors/tree.service";
import { MTokenK1Component } from "./m-token-k1/m-token-k1.component"; //K1秘钥
import { CountdownModule } from "ngx-countdown"; //倒计时插件
import { GISManagementModule } from "./gis-management/gis-management.module";
import { DataCollectionModule } from "./data-collection/data-collection.module";
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { TestComponent } from "./test/test.component";
import { ExternalLinksPlanComponent } from "./external-links-plan/external-links-plan.component";
import { SearchDownList } from "../modules/map/declare/component/SearchDownListPlugins/SearchDownList";
import { ExportExcelComponent } from "./export-excel/export-excel.component";
import { registerLocaleData } from "@angular/common";
import zh from "@angular/common/locales/zh";
import { KeyUnitModule } from "./key-unit/key-unit.module";
import { MatTabsModule } from "@angular/material/tabs";
import { PlanManagementModule } from "./plan-management/plan-management.module";
registerLocaleData(zh);
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { MatButtonModule } from '@angular/material/button';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { NavigationModule } from './navigation/navigation.module';
import { HomeComponent } from './home/home.component';
import { TabbarComponent } from './tabbar/tabbar.component';
import { PagesModule } from './pages/pages.module';
import { FormsModule } from '@angular/forms';
import { UiModule } from './ui/ui.module';
import { HttpClientModule } from '@angular/common/http';
import { httpInterceptorProviders } from './http-interceptors/index'
import {CacheTokenService} from './http-interceptors/cache-token.service'
import { TreeService } from'./http-interceptors/tree.service';
import { MTokenK1Component } from './m-token-k1/m-token-k1.component' //K1秘钥
import { CountdownModule } from 'ngx-countdown'; //倒计时插件
import { GISManagementModule } from './gis-management/gis-management.module';
import { DataCollectionModule } from './data-collection/data-collection.module';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { TestComponent } from './test/test.component';
import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
MTokenK1Component,
TestComponent,
ExternalLinksPlanComponent,
SearchDownList,
ExportExcelComponent,
ExternalLinksPlanComponent
],
imports: [
BrowserModule,
@ -58,12 +49,9 @@ registerLocaleData(zh);
GISManagementModule,
DataCollectionModule,
MatProgressSpinnerModule,
UiModule,
KeyUnitModule,
MatTabsModule,
PlanManagementModule,
UiModule
],
providers: [httpInterceptorProviders, CacheTokenService, TreeService],
bootstrap: [AppComponent],
providers: [httpInterceptorProviders, CacheTokenService,TreeService],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule { }

75
src/app/auth.guard.ts

@ -1,70 +1,31 @@
import { HttpClient } from "@angular/common/http";
import { Injectable } from "@angular/core";
import {
CanActivate,
ActivatedRouteSnapshot,
RouterStateSnapshot,
Router,
} from "@angular/router";
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
@Injectable({
providedIn: "root",
providedIn: 'root'
})
export class AuthGuard implements CanActivate {
constructor(private http: HttpClient, private router: Router) {}
// 路由守卫
async canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Promise<boolean> {
console.log("next", next);
console.log("state", state);
constructor(private router: Router) {
if (
next.queryParams.singleSignOn &&
next.queryParams.singleSignOn === "true"
) {
//执行自动登录逻辑
await this.onSubmit();
}
return this.checkLogin();
}
checkLogin(): boolean {
// 判断本地有没有token
const token = sessionStorage.getItem("token");
// 路由守卫
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
// 如果有token,允许访问
if (token) {
return true;
return this.checkLogin();
}
//如果没有token,跳转登录页
this.router.navigate(["/login"]);
return false;
}
checkLogin(): boolean {
onSubmit() {
return new Promise<void>((resolve, reject) => {
this.http
.post("/api/Account/SignIn", {
name: "superadmin",
password: "SHya119!@",
})
.subscribe(
(data: any) => {
sessionStorage.setItem("level", data.level);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
sessionStorage.setItem("isDefaultPassword", data.isDefaultPassword); //是否需要修改默认密码
sessionStorage.setItem("singleSignOn", "true"); //是否需要修改默认密码
resolve();
},
(err) => {
reject();
}
);
});
}
// 判断本地有没有token
const token = sessionStorage.getItem('token');
// 如果有token,允许访问
if (token) { return true; }
//如果没有token,跳转登录页
this.router.navigate(['/login']);
return false;
}
}

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

@ -18,7 +18,6 @@ export class CanvasShareDataService {
isInheritSky: any; //缓存 节点 天气
isChange: boolean = false; // 数据 是否改动
selectTemplateData: any; // 选择当前 模板数据
@ -29,11 +28,17 @@ export class CanvasShareDataService {
originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据
// 总平面图/建筑 楼层
// 处置 节点
allDisposalNode: any = []; // 所有 处置节点
allNodeMarkers: any = { highlightMarkers: {}, markers: {} }; // 灾情 标签信息
selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 当前数据节点
selectPanelPointBaseData: any = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' }; // 当前 数据节点 对应 父级节点
isInheritSky:any; //缓存 节点 天气
customizeDisposalNode: any; // 新建 自定义数据节点 底图+名称
// 处置 节点
@ -52,6 +57,7 @@ export class CanvasShareDataService {
['地下消火栓', '室外消火栓'],
['室内消火栓', '室内消火栓'],
['供水管网', '供水管网'],
['湿式自动喷淋系统', '湿式自动喷淋系统'],
['水幕系统', '水幕系统'],
['消防泵房', '消防泵房'],
['水泵接合器(地上)', '水泵接合器'],
@ -74,26 +80,7 @@ export class CanvasShareDataService {
['消防管网', '消防管网'],
['泡沫管网', '消防管网'],
['DCS控制室', 'DCS控制室'],
['消防控制室', '消防控制室'],
['水喷淋系统', '自动喷水灭火系统'],
['湿式自动喷淋系统', '自动喷水灭火系统'],
['干式自动喷淋系统', '自动喷水灭火系统'],
['消防电话', '消防通信'],
['扶梯', '自动扶梯'],
['风机房', '风机房'],
['风亭', '风亭'],
['防火卷帘', '防火卷帘'],
['手提式BC类干粉灭火器', '灭火器'],
['推车式ABC干粉灭火器', '灭火器'],
['手提式泡沫灭火器', '灭火器'],
['推车式BC干粉灭火器', '灭火器'],
['推车式灭火器', '灭火器'],
['手提式二氧化碳灭火器', '灭火器'],
['手提式ABC类干粉灭火器', '灭火器'],
['手提式清水灭火器', '灭火器'],
['手推式泡沫灭火器', '灭火器'],
['推车式泡沫灭火器', '灭火器'],
['灭火器', '灭火器']
['消防控制室', '消防控制室']
]);
/** * *

187
src/app/data-collection/data-collection.module.ts

@ -1,104 +1,103 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { A11yModule } from '@angular/cdk/a11y';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { PortalModule } from '@angular/cdk/portal';
import { ScrollingModule } from '@angular/cdk/scrolling';
import { CdkStepperModule } from '@angular/cdk/stepper';
import { CdkTableModule } from '@angular/cdk/table';
import { CdkTreeModule } from '@angular/cdk/tree';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatBadgeModule } from '@angular/material/badge';
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
import { MatButtonModule } from '@angular/material/button';
import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { MatCardModule } from '@angular/material/card';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatChipsModule } from '@angular/material/chips';
import { MatStepperModule } from '@angular/material/stepper';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatDialogModule } from '@angular/material/dialog';
import { MatDividerModule } from '@angular/material/divider';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatListModule } from '@angular/material/list';
import { MatMenuModule } from '@angular/material/menu';
import { MatNativeDateModule, MatRippleModule, MatOption } from '@angular/material/core';
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatRadioModule } from '@angular/material/radio';
import { MatSelectModule } from '@angular/material/select';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatSliderModule } from '@angular/material/slider';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatTreeModule } from '@angular/material/tree';
import {A11yModule} from '@angular/cdk/a11y';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {PortalModule} from '@angular/cdk/portal';
import {ScrollingModule} from '@angular/cdk/scrolling';
import {CdkStepperModule} from '@angular/cdk/stepper';
import {CdkTableModule} from '@angular/cdk/table';
import {CdkTreeModule} from '@angular/cdk/tree';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatBadgeModule} from '@angular/material/badge';
import {MatBottomSheetModule} from '@angular/material/bottom-sheet';
import {MatButtonModule} from '@angular/material/button';
import {MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatCardModule} from '@angular/material/card';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatChipsModule} from '@angular/material/chips';
import {MatStepperModule} from '@angular/material/stepper';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatDialogModule} from '@angular/material/dialog';
import {MatDividerModule} from '@angular/material/divider';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatGridListModule} from '@angular/material/grid-list';
import {MatIconModule} from '@angular/material/icon';
import {MatInputModule} from '@angular/material/input';
import {MatListModule} from '@angular/material/list';
import {MatMenuModule} from '@angular/material/menu';
import {MatNativeDateModule, MatRippleModule, MatOption} from '@angular/material/core';
import {MatPaginatorModule} from '@angular/material/paginator';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatRadioModule} from '@angular/material/radio';
import {MatSelectModule} from '@angular/material/select';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import {MatSortModule} from '@angular/material/sort';
import {MatTableModule} from '@angular/material/table';
import {MatTabsModule} from '@angular/material/tabs';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatTooltipModule} from '@angular/material/tooltip';
import {MatTreeModule} from '@angular/material/tree';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DataCollectionRoutingModule } from './data-collection.routing';
import { AddWater, WaterCollectionComponent } from './water-collection/water-collection.component';
import { AddFireForce, AddFireForceCar, FireForceComponent, ViewDetails } from './fire-force/fire-force.component';
import { AddFireForce, FireForceComponent, ViewDetails } from './fire-force/fire-force.component';
import { AddLinkageForce, LinkageForcesComponent, ViewDetails2 } from './linkage-forces/linkage-forces.component';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
@NgModule({
declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent, AddWater, AddFireForce, ViewDetails, AddLinkageForce, ViewDetails2,AddFireForceCar],
imports: [
CommonModule,
A11yModule,
CdkStepperModule,
CdkTableModule,
CdkTreeModule,
DragDropModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatStepperModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
PortalModule,
ScrollingModule,
FormsModule,
ReactiveFormsModule,
DataCollectionRoutingModule,
NzTreeModule,
NzTreeSelectModule
]
declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails,AddLinkageForce,ViewDetails2],
imports: [
CommonModule,
A11yModule,
CdkStepperModule,
CdkTableModule,
CdkTreeModule,
DragDropModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatStepperModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
PortalModule,
ScrollingModule,
FormsModule,
ReactiveFormsModule,
DataCollectionRoutingModule,
NzTreeModule
]
})
export class DataCollectionModule { }

2
src/app/data-collection/fire-force/addFireForce.html

@ -2,7 +2,7 @@
<div class="topbox">
<span>新增消防力量</span>
</div>
<div class="content">
<div class="contant">
<div (click)="selecteAddType(item,key)" *ngFor="let item of addList;let key = index" [ngClass]="{selectedDiv: item.id == selectedFireForceTypeIndex}">
<!-- <img [src]="item.src" alt=""> -->
{{item.name}}

20
src/app/data-collection/fire-force/addFireForceCar.html

@ -1,20 +0,0 @@
<div class="addCarBox">
<div class="topbox">
<span>新增消防车辆</span>
</div>
<div class="content">
<!-- <div (click)="selecteAddType(item,key)" *ngFor="let item of addList;let key = index" [ngClass]="{selectedDiv: item.id == selectedFireForceTypeIndex}">
{{item.name}}
</div> -->
<form class="example-form" (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<mat-form-field class="example-full-width">
<mat-label>车辆名称</mat-label>
<input name="carName" matInput [(ngModel)]="carName" required>
</mat-form-field>
</form>
</div>
<div class="btnbox">
<button type="submit" mat-flat-button color="primary" [disabled]='form.invalid' (click)="onSubmit(form.value)">确定</button>
<button type="button" mat-flat-button style="background-color: #F2F4F6;" mat-dialog-close>取消</button>
</div>
</div>

491
src/app/data-collection/fire-force/fire-force.component.html

@ -3,72 +3,62 @@
<div class="topbox">
<div class="add">
<div>
<mat-slide-toggle color="primary" (change)='slideChange($event)' checked labelPosition='before'>列表过滤
</mat-slide-toggle>
<mat-slide-toggle color="primary" (change)='slideChange($event)' checked labelPosition='before'>列表过滤</mat-slide-toggle>
</div>
<div>
<button (click)="reset()" style="width: 68px;margin-right: 12px;" mat-flat-button
color="primary">重置</button>
<button (click)="reset()" style="width: 68px;margin-right: 12px;" mat-flat-button color="primary">重置</button>
<button (click)="addFireForce()" style="width: 68px;" mat-flat-button color="primary">新增</button>
</div>
</div>
<div class="searchbox" *ngIf="isCheckedOfSearchDiv">
<div class="inputbox">
<span>
关键字:
关键字:
</span>
<input type="text" placeholder="请输入名称/类别" [(ngModel)]="searchForm.name" />
<input type="text" placeholder="请输入名称/类别" [(ngModel)]="searchForm.name"/>
</div>
<div class="inputbox">
<span>
完整度:
完整度:
</span>
<select [(ngModel)]="searchForm.integrityNum" [ngClass]="{'gray': searchForm.integrityNum == ''}">
<option value='' selected disabled style='display:none;'>请选择</option>
<option value='' selected disabled style='display:none;'>请选择</option>
<option *ngFor="let item of listIntegrityNum" [value]="item.id">{{item.name}}</option>
</select>
</div>
<div class="searchbtn">
<button (click)="searchList()" style="width: 100%;" mat-flat-button color="primary">
<mat-icon style="width: 20px;height: 20px;font-size: 20px;">search</mat-icon>搜索
</button>
<button (click)="searchList()" style="width: 100%;" mat-flat-button color="primary"><mat-icon style="width: 20px;height: 20px;font-size: 20px;">search</mat-icon>搜索</button>
</div>
</div>
</div>
<div style="height: 1px;width: 100%;background-color: #F2F4F6;"></div>
<div class="contentbox">
<div class="contantbox">
<div class="title">
<span>消防队</span>
<span>完整度</span>
</div>
<div class="fireForceTree" id="fireForceTree" *ngIf="isTreeView">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node (click)="selectTreeNode(node)"
[ngClass]="{'selectedTreeNode': node.id == selectedFireForceId}" *matTreeNodeDef="let node;"
matTreeNodePadding matTreeNodePaddingIndent='10px'>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node (click)="selectTreeNode(node)" [ngClass]="{'selectedTreeNode': node.id == selectedFireForceId}" *matTreeNodeDef="let node;" matTreeNodePadding matTreeNodePaddingIndent='10px'>
<button mat-icon-button disabled></button>
<button mat-icon-button disabled ></button>
<span class="nodename">{{node.name}}</span>
<div class="integrity">
<span class="integrityNum">
{{node.fireForceDetailInfo ?
accMul(node.fireForceDetailInfo.integrityScore.toFixed(3),100,1) : 0}}%
{{node.fireForceDetailInfo ? accMul(node.fireForceDetailInfo.integrityScore.toFixed(3),100,1) : 0}}%
</span>
<div class="integrityColorDiv"
[style]="integrity(node.fireForceDetailInfo ? (node.fireForceDetailInfo.integrityScore.toFixed(2) * 100).toFixed(): 0)">
<div class="integrityColorDiv" [style]="integrity(node.fireForceDetailInfo ? (node.fireForceDetailInfo.integrityScore.toFixed(2) * 100).toFixed(): 0)">
</div>
</div>
<div class="deletebtn" (click)="deleteFireForce(node,$event)">
<mat-icon>highlight_off</mat-icon>
</div>
<div class="deletebtn" (click)="deleteFireForce(node,$event)"><mat-icon>highlight_off</mat-icon></div>
</mat-tree-node>
<mat-tree-node (click)="selectTreeNode(node)" [ngClass]="{'selectedTreeNode': node.id == selectedFireForceId}" *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding matTreeNodePaddingIndent='10px'>
<mat-tree-node (click)="selectTreeNode(node)"
[ngClass]="{'selectedTreeNode': node.id == selectedFireForceId}"
*matTreeNodeDef="let node;when: hasChild" matTreeNodePadding matTreeNodePaddingIndent='10px'>
<button mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
<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>
@ -76,36 +66,27 @@
<span class="nodename">{{node.name}}</span>
<div class="integrity">
<span class="integrityNum">
{{node.fireForceDetailInfo ?
accMul(node.fireForceDetailInfo.integrityScore.toFixed(3),100,1) : 0}}%
{{node.fireForceDetailInfo ? accMul(node.fireForceDetailInfo.integrityScore.toFixed(3),100,1) : 0}}%
</span>
<div class="integrityColorDiv"
[style]="integrity(node.fireForceDetailInfo ? (node.fireForceDetailInfo.integrityScore.toFixed(2) * 100).toFixed(): 0)">
<div class="integrityColorDiv" [style]="integrity(node.fireForceDetailInfo ? (node.fireForceDetailInfo.integrityScore.toFixed(2) * 100).toFixed(): 0)">
</div>
</div>
<div class="deletebtn" (click)="deleteFireForce(node,$event)">
<mat-icon>highlight_off</mat-icon>
</div>
</mat-tree-node>
<div class="deletebtn" (click)="deleteFireForce(node,$event)"><mat-icon>highlight_off</mat-icon></div>
</mat-tree-node>
</mat-tree>
</div>
<div class="fireForceList" *ngIf="!isTreeView">
<ul>
<li [ngClass]="{'selectedLi': item.id == selectedFireForceId}"
*ngFor="let item of allFireForceList;let key = index" (click)="selectTreeNode(item)">
<li [ngClass]="{'selectedLi': item.id == selectedFireForceId}" *ngFor="let item of allFireForceList;let key = index" (click)="selectTreeNode(item)">
<div class="name" [title]="item.name">{{item.name}}</div>
<div class="integrity">
<span class="integrityNum">
{{item.fireForceDetailInfo ?
accMul(item.fireForceDetailInfo.integrityScore.toFixed(3),100,1) : 0}}%
{{item.fireForceDetailInfo ? accMul(item.fireForceDetailInfo.integrityScore.toFixed(3),100,1) : 0}}%
</span>
<div class="integrityColorDiv"
[style]="integrity(item.fireForceDetailInfo ? (item.fireForceDetailInfo.integrityScore.toFixed(2) * 100).toFixed(): 0)">
<div class="integrityColorDiv" [style]="integrity(item.fireForceDetailInfo ? (item.fireForceDetailInfo.integrityScore.toFixed(2) * 100).toFixed(): 0)">
</div>
</div>
<div class="deletebtn" (click)="deleteFireForce(item,$event)">
<mat-icon>highlight_off</mat-icon>
</div>
<div class="deletebtn" (click)="deleteFireForce(item,$event)"><mat-icon>highlight_off</mat-icon></div>
</li>
</ul>
</div>
@ -113,17 +94,14 @@
</div>
<div class="mapbox">
<div class="mapcheckbox">
<mat-checkbox (change)="checkBoxChange()" [(ngModel)]="item.isChecked" color="primary"
*ngFor="let item of checkBoxList">{{item.name}}
</mat-checkbox>
<mat-checkbox (change)="checkBoxChange()" [(ngModel)]="item.isChecked" color="primary" *ngFor="let item of checkBoxList">{{item.name}}</mat-checkbox>
</div>
<div id="map" class="map" style="overflow: hidden;">
<div id="container"></div>
<div class="gistopbox hidden" [ngClass]="{'show': isGisTopBox}">
<div class="inputBox">
<span>搜索: </span>
<input name="position" [(ngModel)]="searchTitle" id="tipinput" class="positionInput" type="text"
autocomplete="off">
<input name="position" [(ngModel)]="searchTitle" id="tipinput" class="positionInput" type="text" autocomplete="off">
</div>
</div>
</div>
@ -151,17 +129,13 @@
</div>
<!-- <div (click)="selectedTab(2)" [ngClass]="{'selectedBtn': tabIndex == 2}">
<span>车辆装备</span>
</div>
<div (click)="selectedTab(3)" [ngClass]="{'selectedBtn': tabIndex == 3}">
</div> -->
<!-- <div (click)="selectedTab(3)" [ngClass]="{'selectedBtn': tabIndex == 3}">
<span>相关资料</span>
</div> -->
</div>
<div class="btnbox">
<!-- <div class="goback" (click)="goback()" *ngIf="carPageIndex == 1 && tabIndex == 2"><img
src="/assets/images/goback.png" alt=""> 返回
</div> -->
<!-- <span *ngIf="tabIndex == 2" type="submit" (click)="saveCarData(form.value)">保存车辆</span> -->
<!-- <div class="uploadAttachment" *ngIf="tabIndex == 3">
<div class="uploadAttachment" *ngIf="tabIndex == 3">
<button mat-flat-button color="primary">
<mat-icon>attach_file</mat-icon>
上传附件
@ -169,7 +143,8 @@
<a href="javascript:;" class="a-upload">
<input type="file" (change)='uploadAttachment($event)'>
</a>
</div> -->
</div>
<!-- <span class="state" *ngIf="selectedFireForce.contentVerify && selectedFireForce.contentVerify.verifyState == 3">(
<span *ngIf="selectedFireForce.contentVerify.operation == 2" style="color: red;">删除</span>
<span *ngIf="selectedFireForce.contentVerify.operation == 0" >新增</span>
@ -181,23 +156,21 @@
<span class="submitAudit" *ngIf="!selectedFireForce.contentVerify || selectedFireForce.contentVerify.verifyState == 5 || selectedFireForce.contentVerify.verifyState == 4" (click)="submitAudit()"><mat-icon>open_in_browser</mat-icon>提交审核</span>
<span class="state" *ngIf="selectedFireForce.contentVerify && selectedFireForce.contentVerify.verifyState == 3" (click)="cancelAudit()">撤销审核</span>
<span class="save state" *ngIf="!selectedFireForce.contentVerify || selectedFireForce.contentVerify.verifyState == 5 || selectedFireForce.contentVerify.verifyState == 4" (click)="save()"><mat-icon>save</mat-icon>保存</span> -->
<span class="close" (click)="close()">
<mat-icon>close</mat-icon>关闭
</span>
<span class="close" (click)="close()"><mat-icon>close</mat-icon>关闭</span>
</div>
</div>
<!-- 详情 -->
<div class="content" *ngIf="tabIndex == 1">
<div class="contant" *ngIf="tabIndex == 1">
<!-- 总队 支队 联系方式不同-->
<div *ngIf="selectedFireForceLevel == 0 || selectedFireForceLevel == 1">
<p>基本信息</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='6' rowspan='1'>
<span>
<span style="color: red;">*</span>
<span style="color: red;">*</span>
队站名称:
</span>
<input [(ngModel)]="FireForceDetailInfo.stationName" type="text" style="width:88%;">
<input [(ngModel)]="FireForceDetailInfo.stationName" type="text" style="width:88%;">
</mat-grid-tile>
<mat-grid-tile colspan='2' rowspan='1'>
<span>
@ -221,8 +194,7 @@
<span>
备注:
</span>
<textarea [(ngModel)]="FireForceDetailInfo.remark" style="height: 80%;width: 84%;" cols="30"
rows="10"></textarea>
<textarea [(ngModel)]="FireForceDetailInfo.remark" style="height: 80%;width: 84%;" name="" id="" cols="30" rows="10"></textarea>
</mat-grid-tile>
</mat-grid-list>
<p>位置信息</p>
@ -237,18 +209,16 @@
<span>
经度:
</span>
<input [(ngModel)]="positionLngLat.x" disabled type="text"
style="width: 26%;margin-right: 6%;">
<input [(ngModel)]="positionLngLat.x" disabled type="text" style="width: 26%;margin-right: 6%;">
<span>
纬度:
</span>
<input [(ngModel)]="positionLngLat.y" disabled type="text"
style="width: 26%;margin-right: 6%;">
<input [(ngModel)]="positionLngLat.y" disabled type="text" style="width: 26%;margin-right: 6%;">
<!-- <button (click)="setPosition()" style="width:85px;text-align: center;" mat-flat-button color="primary">
<mat-icon style="width: 20px;height: 20px;font-size: 20px;">place</mat-icon>位置
</button> -->
</mat-grid-tile>
</mat-grid-list>
<p>人员数量</p>
<mat-grid-list cols="6" rowHeight="40px">
@ -331,10 +301,10 @@
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='6' rowspan='1'>
<span>
<span style="color: red;">*</span>
<span style="color: red;">*</span>
队站名称:
</span>
<input type="text" style="width:81%;" [(ngModel)]="FireForceDetailInfo.stationName">
<input type="text" style="width:81%;" [(ngModel)]="FireForceDetailInfo.stationName">
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
@ -352,8 +322,7 @@
<span>
备注:
</span>
<textarea [(ngModel)]="FireForceDetailInfo.remark" style="height: 80%;width: 84%;" cols="30"
rows="10"></textarea>
<textarea [(ngModel)]="FireForceDetailInfo.remark" style="height: 80%;width: 84%;" name="" id="" cols="30" rows="10"></textarea>
</mat-grid-tile>
</mat-grid-list>
<p>位置信息</p>
@ -368,18 +337,16 @@
<span>
经度:
</span>
<input [(ngModel)]="positionLngLat.x" disabled type="text"
style="width: 26%;margin-right: 6%;">
<input [(ngModel)]="positionLngLat.x" disabled type="text" style="width: 26%;margin-right: 6%;">
<span>
纬度:
</span>
<input [(ngModel)]="positionLngLat.y" disabled type="text"
style="width: 26%;margin-right: 6%;">
<input [(ngModel)]="positionLngLat.y" disabled type="text" style="width: 26%;margin-right: 6%;">
<!-- <button (click)="setPosition()" style="width:85px;text-align: center;" mat-flat-button color="primary">
<mat-icon style="width: 20px;height: 20px;font-size: 20px;">place</mat-icon>位置
</button> -->
</mat-grid-tile>
</mat-grid-list>
<p>人员数量</p>
<mat-grid-list cols="6" rowHeight="40px">
@ -403,7 +370,7 @@
</mat-grid-tile>
</mat-grid-list>
<p>联系方式</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-list cols="6" rowHeight="40px" >
<mat-grid-tile colspan='3' rowspan='1'>
<span>
站长姓名:
@ -482,9 +449,9 @@
<div *ngIf="selectedFireForceLevel == 4 || selectedFireForceLevel == 5 || selectedFireForceLevel == 6">
<p>基本信息</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='3' rowspan='1'>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
<span style="color: red;">*</span>
<span style="color: red;">*</span>
队伍类型:
</span>
<select disabled [(ngModel)]="selectedFireForceLevel">
@ -496,7 +463,7 @@
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
<span style="color: red;">*</span>
<span style="color: red;">*</span>
队伍名称:
</span>
<input type="text" [(ngModel)]="FireForceDetailInfo.stationName">
@ -512,10 +479,8 @@
<span>
站长:
</span>
<input [(ngModel)]="othercontactData[2].PropertyValue" class="smallwidth" type="text"
placeholder="姓名">
<input [(ngModel)]="othercontactData[3].PropertyValue" class="smallwidth" type="text"
placeholder="联系方式">
<input [(ngModel)]="othercontactData[2].PropertyValue" class="smallwidth" type="text" placeholder="姓名">
<input [(ngModel)]="othercontactData[3].PropertyValue" class="smallwidth" type="text" placeholder="联系方式">
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
@ -527,10 +492,8 @@
<span>
负责人:
</span>
<input [(ngModel)]="othercontactData[4].PropertyValue" class="smallwidth" type="text"
placeholder="姓名">
<input [(ngModel)]="othercontactData[5].PropertyValue" class="smallwidth" type="text"
placeholder="联系方式">
<input [(ngModel)]="othercontactData[4].PropertyValue" class="smallwidth" type="text" placeholder="姓名">
<input [(ngModel)]="othercontactData[5].PropertyValue" class="smallwidth" type="text" placeholder="联系方式">
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
@ -542,8 +505,7 @@
<span>
备注:
</span>
<textarea [(ngModel)]="FireForceDetailInfo.remark" style="height: 80%;width: 82%;" cols="30"
rows="10"></textarea>
<textarea [(ngModel)]="FireForceDetailInfo.remark" style="height: 80%;width: 82%;" name="" id="" cols="30" rows="10"></textarea>
</mat-grid-tile>
</mat-grid-list>
<p>位置信息</p>
@ -558,18 +520,16 @@
<span>
经度:
</span>
<input [(ngModel)]="positionLngLat.x" disabled type="text"
style="width: 26%;margin-right: 6%;">
<input [(ngModel)]="positionLngLat.x" disabled type="text" style="width: 26%;margin-right: 6%;">
<span>
纬度:
</span>
<input [(ngModel)]="positionLngLat.y" disabled type="text"
style="width: 26%;margin-right: 6%;">
<input [(ngModel)]="positionLngLat.y" disabled type="text" style="width: 26%;margin-right: 6%;">
<!-- <button (click)="setPosition()" style="width:85px;text-align: center;" mat-flat-button color="primary">
<mat-icon style="width: 20px;height: 20px;font-size: 20px;">place</mat-icon>位置
</button> -->
</mat-grid-tile>
</mat-grid-list>
<p>人员数量</p>
<!-- 其他消防力量 -->
@ -593,7 +553,7 @@
<div class="unitDiv">
<input type="text" [(ngModel)]="otherpersonCountData[2].PropertyValue">
<span class="unit"></span>
</div>
</div>
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
@ -602,336 +562,39 @@
<div class="unitDiv">
<input type="text" [(ngModel)]="otherpersonCountData[3].PropertyValue">
<span class="unit"></span>
</div>
</div>
</mat-grid-tile>
</mat-grid-list>
</div>
</div>
<!-- 车辆 -->
<!-- <div class="content" id="carcontent" *ngIf="tabIndex == 2">
<div class="carOne" *ngIf="carPageIndex == 0">
<div class="cartopbox">
<div class="add">
<div>
<mat-slide-toggle color="primary" (change)='carslideChange($event)' checked
labelPosition='before'>列表过滤</mat-slide-toggle>
</div>
<div>
<button (click)="resetCarList()" style="width: 68px;margin-right: 12px;" mat-flat-button
color="primary">重置</button>
<button (click)="addFireForceCar()" style="width: 68px;" mat-flat-button
color="primary">新增</button>
</div>
</div>
<div class="searchbox" *ngIf="isCarCheckedOfSearchDiv">
<div class="inputbox">
<span>
关键字:
</span>
<input type="text" placeholder="请输入名称/车牌号" [(ngModel)]="carSearchForm.name" />
</div>
<div class="inputbox">
<span>
所属队站:
</span>
<nz-tree-select [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandOrKeys" [nzNodes]="selectOrganizationTree" nzShowSearch
nzPlaceHolder="请选择" [(ngModel)]="carSearchForm.organization"
(ngModelChange)="onChange($event)"></nz-tree-select>
</div>
<div class="inputbox">
<span>
车辆类别:
</span>
<nz-tree-select #treeCarTypeSelected [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandCarTypeKeys" [nzNodes]="carTypeList" nzShowSearch
nzPlaceHolder="请选择" [(ngModel)]="carSearchForm.carType"
(ngModelChange)="onChangeCarType($event)"></nz-tree-select>
</div>
<div class="inputbox">
<span>
完整度:
</span>
<select class="shortselect" [(ngModel)]="carSearchForm.integrityNum"
[ngClass]="{'gray': carSearchForm.integrityNum == ''}">
<option value='' selected disabled style='display:none;'>请选择</option>
<option *ngFor="let item of listIntegrityNum" [value]="item.id">{{item.name}}
</option>
</select>
<div class="searchbtn">
<button (click)="searchCarList()" style="width: 100%;" mat-flat-button
color="primary">
<mat-icon style="width: 20px;height: 20px;font-size: 20px;">search</mat-icon>搜索
</button>
</div>
</div>
</div>
</div>
<div class="carList">
<table>
<tr>
<td>车辆名称</td>
<td>所属队站</td>
<td>完整度</td>
<td></td>
</tr>
<tr *ngFor="let item of carsList" class="caritem" (click)="openCarDetails(item)">
<td class="td1">{{item.name}}</td>
<td class="td2">{{item.organizationName}}</td>
<td>
<div class="integrity">
<span class="integrityNum">
{{item.integrityScore ? accMul(item.integrityScore.toFixed(3),100,1) : 0}}%
</span>
<div class="integrityColorDiv"
[style]="integrity(item.integrityScore ? (item.integrityScore.toFixed(2) * 100).toFixed(): 0)">
</div>
</div>
</td>
<td>
<mat-icon (click)="deleteCar(item,$event)" class="deleteFile">highlight_off
</mat-icon>
</td>
</tr>
</table>
</div>
<div class="pagingDevice">
<mat-paginator [length]="carDataLength" [pageSize]="16" (page)="carListChagePage($event)">
</mat-paginator>
</div>
</div>
<form class="example-form" (ngSubmit)="saveCarData(form.invalid)" #form="ngForm">
<div class="carTwo" *ngIf="carPageIndex == 1">
<p class="expandP">基本信息 <button type="submit" matRipple>保存车辆信息</button></p>
<div class="carTwoItemBox">
<div>
<span><span style="color: red;">*</span>车辆类别:</span>
<nz-tree-select #carDetailsTypeSelected [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandCarTypeKeys" [nzNodes]="carTypeList" nzShowSearch
nzPlaceHolder="请选择" [(ngModel)]="carData.basicInfo.carType"
(ngModelChange)="carDetailsTypeChange($event)" required name="carType"></nz-tree-select>
</div>
<div>
<span><span style="color: red;">*</span>车辆名称:</span>
<input type="text" name="carName" required [(ngModel)]="carData.basicInfo.carName">
</div>
<div>
<span><span style="color: red;">*</span>车牌号:</span>
<input type="text" name="carNumber" required [(ngModel)]="carData.basicInfo.carNumber">
</div>
<div>
<span><span style="color: red;">*</span>所属队站:</span>
<nz-tree-select required [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandOrKeys" [nzNodes]="selectOrganizationTree" nzShowSearch
nzPlaceHolder="请选择" [(ngModel)]="carData.basicInfo.carOrganization"
(ngModelChange)="onChange($event)" name="carOrganization">
</nz-tree-select>
</div>
</div>
<p>作战用信息</p>
<div class="carTwoItemBox">
<div>
<span>水泵流量:</span>
<div class="unitDiv">
<input type="text" name="pumpFlow" [(ngModel)]="carData.fightInfo.pumpFlow">
<span class="unit">L/s</span>
</div>
</div>
<div>
<span>消防炮流量:</span>
<div class="unitDiv">
<input type="text" name="fireGunFlow" [(ngModel)]="carData.fightInfo.fireGunFlow">
<span class="unit">L/s</span>
</div>
</div>
<div>
<span>水泵额定压力:</span>
<div class="unitDiv">
<input type="text" name="pumpPressure" [(ngModel)]="carData.fightInfo.pumpPressure">
<span class="unit">Mpa</span>
</div>
</div>
<div>
<span>载水量:</span>
<div class="unitDiv">
<input type="text" name="waterCapacity"
[(ngModel)]="carData.fightInfo.waterCapacity">
<span class="unit"></span>
</div>
</div>
<div>
<span>举高类车辆高度:</span>
<div class="unitDiv">
<input type="text" name="carHeight" [(ngModel)]="carData.fightInfo.carHeight">
<span class="unit"></span>
</div>
</div>
<div>
<span>车辆状态:</span>
<input type="text" name="carState" [(ngModel)]="carData.fightInfo.carState">
</div>
<div>
<span>备注:</span>
<textarea name="remark" [(ngModel)]="carData.fightInfo.remark" cols="30"
rows="10"></textarea>
</div>
<div>
<span>车辆照片:</span>
<div class="uploadbox">
<img class="img"
[src]="carData.fightInfo.carPhoto[0] ? carData.fightInfo.carPhoto[0] : '/assets/images/noImg.png'"
alt="">
<input name="uploadinput" class="uploadinput" type="file"
(change)='uploadCarImg($event)'>
<div class="uploadbtn"><img src="/assets/images/uploadbtn.png" alt=""> 上传照片</div>
</div>
</div>
</div>
<p class="expandP">
<span>
<span style="margin-right: 8px;">车载灭火剂</span>
<mat-slide-toggle color="primary" name="expand1"
[(ngModel)]="carData.carExtinguishant.isExpand">
</mat-slide-toggle>
</span>
<span *ngIf="carData.carExtinguishant.isExpand" class="add"
(click)="addCarDetailsItem('carExtinguishant')">
<img src="/assets/images/add2.png" alt=""> 新增
</span>
</p>
<div class="carTwoItemBox2" *ngIf="carData.carExtinguishant.isExpand">
<div class="item" *ngFor="let item of carData.carExtinguishant.data;let key = index">
<div>
<span><span style="color: red;">*</span>灭火剂类型:</span>
<nz-tree-select required [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandOrKeys" [nzNodes]="extinguishantTypeList" nzShowSearch
nzPlaceHolder="请选择" (ngModelChange)="onChange($event)"
[name]="'exextinguishantType' + key" [(ngModel)]="item.extinguishantType">
</nz-tree-select>
</div>
<div>
<span><span style="color: red;">*</span>灭火剂名称:</span>
<input [name]="'exextinguishantName' + key" type="text"
[(ngModel)]="item.extinguishantName">
</div>
<div>
<span><span style="color: red;">*</span>所属队站:</span>
<nz-tree-select required [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandOrKeys" [nzNodes]="selectOrganizationTree" nzShowSearch
nzPlaceHolder="请选择" (ngModelChange)="onChange($event)"
[name]="'exextinguishantOr' + key" [(ngModel)]="item.extinguishantOr">
</nz-tree-select>
</div>
<div>
<span>混合比:</span>
<div class="unitDiv">
<input type="text" [name]="'exmixingRatio' + key"
[(ngModel)]="item.mixingRatio">
<span class="unit">%</span>
</div>
</div>
<div>
<span>车载量:</span>
<div class="unitDiv">
<input type="text" [name]="'excapacity' + key" [(ngModel)]="item.capacity">
<span class="unit"></span>
</div>
</div>
<div>
<span>生产厂家:</span>
<input type="text" [name]="'exmanufacturer' + key" [(ngModel)]="item.manufacturer">
</div>
<div class="remark">
<span>备注:</span>
<textarea cols="30" rows="10" [name]="'exremark' + key"
[(ngModel)]="item.remark"></textarea>
<span style="color: red;margin-left: 8px;cursor: pointer;"
(click)="deleteCarDetailsItem(carData.carExtinguishant.data,key)">删除</span>
</div>
</div>
</div>
<p class="expandP">
<span>
<span style="margin-right: 8px;">消防器材</span>
<mat-slide-toggle color="primary" name="expand2"
[(ngModel)]="carData.fireEquipment.isExpand">
</mat-slide-toggle>
</span>
<span *ngIf="carData.fireEquipment.isExpand" class="add"
(click)="addCarDetailsItem('fireEquipment')">
<img src="/assets/images/add2.png" alt=""> 新增
</span>
</p>
<div class="carTwoItemBox3" *ngIf="carData.fireEquipment.isExpand">
<div class="item" *ngFor="let item of carData.fireEquipment.data;let key = index">
<div>
<span><span style="color: red;">*</span>器材类型:</span>
<nz-tree-select required [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandOrKeys" [nzNodes]="fireEquipmentTypeList" nzShowSearch
nzPlaceHolder="请选择" (ngModelChange)="onChange($event)"
[name]="'eqequipmentType' + key" [(ngModel)]="item.equipmentType">
</nz-tree-select>
</div>
<div>
<span><span style="color: red;">*</span>器材名称:</span>
<input type="text" [name]="'eqequipmentName' + key"
[(ngModel)]="item.equipmentName">
</div>
<div>
<span><span style="color: red;">*</span>所属队站:</span>
<nz-tree-select required [nzDropdownClassName]="'carTreeDropdown'"
[nzExpandedKeys]="expandOrKeys" [nzNodes]="selectOrganizationTree" nzShowSearch
nzPlaceHolder="请选择" (ngModelChange)="onChange($event)"
[name]="'eqequipmentOr' + key" [(ngModel)]="item.equipmentOr">
</nz-tree-select>
</div>
<div class="width50">
<span>车辆装载数:</span>
<div class="unitDiv">
<input type="text" [name]="'eqcapacity' + key" [(ngModel)]="item.capacity">
<span class="unit"></span>
</div>
</div>
<div class="width50">
<span>生产厂家:</span>
<input type="text" [name]="'eqmanufacturer' + key" [(ngModel)]="item.manufacturer">
</div>
<div class="remark">
<span>备注:</span>
<textarea cols="30" rows="10" [name]="'eqremark' + key"
[(ngModel)]="item.remark"></textarea>
<span style="color: red;margin-left: 8px;cursor: pointer;"
(click)="deleteCarDetailsItem(carData.fireEquipment.data,key)">删除</span>
</div>
</div>
</div>
</div>
</form>
<!-- <div class="contant" *ngIf="tabIndex == 2">
车辆
</div> -->
<!-- 相关资料 -->
<!-- <div class="content" *ngIf="tabIndex == 3">
<div class="fileDivBox" *ngFor="let item of AttachmentArr">
<div class="contant" *ngIf="tabIndex == 3">
<div class="fileDivBox" *ngFor="let item of AttachmentArr" >
<mat-icon class="deleteFile" (click)="deleteFile(item,$event)">highlight_off</mat-icon>
<div class="imgbox">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'png'
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'jpg'
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'JPG'" class="thumbnailImg"
src="/api/Objects/PlanPlatform/{{item.objectName}}" alt="">
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'JPG'"
class="thumbnailImg" src="/api/Objects/PlanPlatform/{{item.objectName}}" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'docx'
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'doc'" class="thumbnailImg"
src="/assets/images/word.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'pdf'"
class="thumbnailImg" src="/assets/images/pdf.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'txt'"
class="thumbnailImg" src="/assets/images/txt.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'mp4'"
class="thumbnailImg" src="/assets/images/vedio.jpg" alt="">
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'doc'"
class="thumbnailImg" src="/assets/images/word.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'pdf'"
class="thumbnailImg" src="/assets/images/pdf.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'txt'"
class="thumbnailImg" src="/assets/images/txt.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'mp4'"
class="thumbnailImg" src="/assets/images/vedio.jpg" alt="">
</div>
<span [title]="item.fileName">{{item.fileName}}</span>
<button (click)="clickFile(item)" class="btn btn1" mat-flat-button color="primary">查看</button>
<button (click)="download (item)" class="btn btn2" mat-flat-button color="primary">下载</button>
</div>
</div> -->
</div>
</div>
</div>
</div>

708
src/app/data-collection/fire-force/fire-force.component.scss

File diff suppressed because it is too large Load Diff

1033
src/app/data-collection/fire-force/fire-force.component.ts

File diff suppressed because it is too large Load Diff

147
src/app/data-collection/linkage-forces/linkage-forces.component.ts

@ -10,10 +10,8 @@ import { NzTreeNode } from 'ng-zorro-antd/tree';
import { TreeService } from 'src/app/http-interceptors/tree.service';
import Viewer from 'viewerjs'
import Swiper from 'swiper';
import { MapFactory } from '@src/modules/map/declare/factory';
import { IMap, IMarker } from '@src/modules/map/declare/map';
declare var CryptoJS
declare var AMap: any;
@Component({
selector: 'app-linkage-forces',
templateUrl: './linkage-forces.component.html',
@ -126,13 +124,11 @@ export class LinkageForcesComponent implements OnInit {
})
}
})
var gridSize = 60
var count = markerArrcluster.length;
let render = MapFactory.RenderClusterMarkerInstance();
render.contentRender = (contextCount) => {
var factor = Math.pow(contextCount / count, 1 / 18);
this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60
var count = markerArrcluster.length;
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)';
@ -140,45 +136,40 @@ export class LinkageForcesComponent implements OnInit {
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,90%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20);
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = contextCount;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
return div;
};
render.pixelRender = (contextCount) => {
var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20);
return MapFactory.PixelInstance(-size / 2, -size / 2);
};
render.contentNonRender = (src) => {
return `<img class='clusterImgCollection' src="${src}" alt="">`;
};
render.pixelNonRender = () => {
return MapFactory.PixelInstance(-15, -15);
}
this.cluster = MapFactory.MarkerClusterInstance(this.map, markerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
maxZoom :15,
render: render //自定义聚合点样式, 自定义非聚合点样式
});
this.cluster.on('click',(e)=>{
if(e.clusterData.length == 1){
let item = e.clusterData[0].data
this.clearData()
this.LinkageForceDetailInfo = item
item.location?this.positionLngLat = item.location:null
this.AttachmentArr = JSON.parse(item.relevantInfomationData)
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
var _renderMarker = (context)=> {
var content = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`;
var offset = new AMap.Pixel(-15, -15);
context.marker.setContent(content)
context.marker.setOffset(offset)
}
},this)
this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式
});
this.cluster.on('click',(e)=>{
if(e.clusterData.length == 1){
let item = e.clusterData[0].data
this.clearData()
this.LinkageForceDetailInfo = item
item.location?this.positionLngLat = item.location:null
this.AttachmentArr = JSON.parse(item.relevantInfomationData)
}
})
});
}
ngOnInit(): void {
@ -260,10 +251,10 @@ export class LinkageForcesComponent implements OnInit {
}
if(item.location && item.location.x){//如果已经标注单位坐标
this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
})
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
@ -423,7 +414,7 @@ export class LinkageForcesComponent implements OnInit {
this.clearData()
this.LinkageForceDetailInfo.linkageForceType = data
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.map.setCity('上海市');
this.map.setCity('株洲市');
this.LinkageForceDetailInfo.contentVerify = null
}
}
@ -521,7 +512,7 @@ export class LinkageForcesComponent implements OnInit {
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.isGisTopBox = false
}
map:IMap
map:any
placeSearch:any//构造地点查询类
isMapLabel:boolean = false //是否已经标记坐标
newPositionMarkerContent:any =
@ -534,24 +525,26 @@ export class LinkageForcesComponent implements OnInit {
' <div class="btnbox"><img id="setPositionOk" src="/assets/images/ok.png"><span>|</span><img id="setPositionClose" src="/assets/images/close.png"></div>' +
'</div>'
//创建地图
newPositionMarker:IMarker//坐标实例
newPositionMarker:any//坐标实例
createMap(){
this.map = MapFactory.MapInstance('container', {
this.map = new AMap.Map('container', {
zoom:12
})
this.map.setCity('上海市');
this.map.setCity('株洲市');
//输入提示
var autoOptions = {
input: "tipinput"
};
let auto = MapFactory.AutocompleteInstance(autoOptions,this);
this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类
auto.on("select", (e)=>{
this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat])
this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat}
this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点
});//注册监听,当选中某条记录时会触发
AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{
let auto = new AMap.AutoComplete(autoOptions);
this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
auto.on("select", (e)=>{
this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat])
this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat}
this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点
});//注册监听,当选中某条记录时会触发
});
}
//点击位置
isGisTopBox:boolean = false //
@ -571,26 +564,26 @@ export class LinkageForcesComponent implements OnInit {
}else{
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
draggable: true,
position: center,
content: this.newPositionMarkerContentBtn,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.positionLngLat = {x: center.lng || center[0], y: center.lat || center[1]}
this.map.add(this.newPositionMarker);
this.isMapLabel = true
this.newPositionMarker.on('dragend', (e)=>{
this.positionLngLat = {x: e.lnglat.lng, y: e.lnglat.lat}
},this)
})
//点击确定
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{
this.isGisTopBox = false
this.map.remove(this.newPositionMarker)
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.positionLngLat.x,this.positionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat))
this.map.add(this.newPositionMarker);
@ -604,10 +597,10 @@ export class LinkageForcesComponent implements OnInit {
this.positionLngLat = {}
this.atLastPositionLngLat = {}
}else{
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -618,10 +611,10 @@ export class LinkageForcesComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{
this.isGisTopBox = false
this.map.remove(this.newPositionMarker)
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.positionLngLat.x,this.positionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat))
this.map.add(this.newPositionMarker);
@ -635,10 +628,10 @@ export class LinkageForcesComponent implements OnInit {
this.positionLngLat = {}
this.atLastPositionLngLat = {}
}else{
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -874,13 +867,25 @@ export class LinkageForcesComponent implements OnInit {
}
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName
if (suffix == 'docx' || suffix == 'doc') {
let arr = fetchUrl.split('.')
arr[arr.length - 1] = 'pdf'
window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
}else if (suffix == 'pdf') {
window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let json={
doc: {
docId: new Date(),
title: item.fileName,
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`)
}
if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetails2, {//调用open方法打开对话框并且携带参数过去

133
src/app/data-collection/water-collection/water-collection.component.ts

@ -4,8 +4,7 @@ import { ElementRef } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { MapFactory } from '@src/modules/map/declare/factory';
import { IMap, IMarker } from '@src/modules/map/declare/map';
declare var AMap: any;
@Component({
selector: 'app-water-collection',
@ -81,13 +80,11 @@ export class WaterCollectionComponent implements OnInit {
})
}
})
var gridSize = 60
var count = markerArrcluster.length;
let render = MapFactory.RenderClusterMarkerInstance();
render.contentRender = (contextCount) => {
var factor = Math.pow(contextCount / count, 1 / 18);
this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60
var count = markerArrcluster.length;
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)';
@ -95,50 +92,46 @@ export class WaterCollectionComponent implements OnInit {
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,90%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20);
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = contextCount;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
return div;
};
render.pixelRender = (contextCount) => {
var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20);
return MapFactory.PixelInstance(-size / 2, -size / 2);
};
render.contentNonRender = (src) => {
return `<img class='clusterImgCollection' src="${src}" alt="">`;
};
render.pixelNonRender = () => {
return MapFactory.PixelInstance(-15, -15);
}
this.cluster = MapFactory.MarkerClusterInstance(this.map, markerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
maxZoom :15,
render: render //自定义聚合点样式, 自定义非聚合点样式
});
this.cluster.on('click',(e)=>{
if(e.clusterData.length == 1){
let item = e.clusterData[0].data
// console.log(item)
this.selectedLiIndex = null
this.clearData()
this.selectedWaterTypeIndex = item.waterSourceType//点击的水源类型
this.waterData = item
item.waterSourceType == 0 && item.detailData ? this.fireCockData = JSON.parse(item.detailData) : null
item.waterSourceType == 1 && item.detailData ? this.poolData = JSON.parse(item.detailData) : null
item.waterSourceType == 2 && item.detailData ? this.naturalWaterData = JSON.parse(item.detailData) : null
this.positionLngLat = item.location
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
var _renderMarker = (context)=> {
var content = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`;
context.marker.setContent(content)
var offset = new AMap.Pixel(-15, -15);
context.marker.setOffset(offset)
}
},this)
this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式
});
this.cluster.on('click',(e)=>{
if(e.clusterData.length == 1){
let item = e.clusterData[0].data
// console.log(item)
this.selectedLiIndex = null
this.clearData()
this.selectedWaterTypeIndex = item.waterSourceType//点击的水源类型
this.waterData = item
item.waterSourceType == 0 && item.detailData ? this.fireCockData = JSON.parse(item.detailData) : null
item.waterSourceType == 1 && item.detailData ? this.poolData = JSON.parse(item.detailData) : null
item.waterSourceType == 2 && item.detailData ? this.naturalWaterData = JSON.parse(item.detailData) : null
this.positionLngLat = item.location
}
})
});
}
ngOnInit(): void {
// console.log(88888,navigator.userAgent)
@ -233,10 +226,10 @@ export class WaterCollectionComponent implements OnInit {
if(item.location.x){//如果已经标注单位坐标
// console.log(item)
this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
})
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
@ -430,7 +423,7 @@ export class WaterCollectionComponent implements OnInit {
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.positionLngLat.x = 0
this.positionLngLat.y = 0
this.map.setCity('上海市');
this.map.setCity('株洲市');
this.clearData()
this.waterData.contentVerify = null
}
@ -525,7 +518,7 @@ export class WaterCollectionComponent implements OnInit {
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.isGisTopBox = false
}
map:IMap
map:any
placeSearch:any//构造地点查询类
isMapLabel:boolean = false //是否已经标记坐标
newPositionMarkerContent:any =
@ -538,24 +531,26 @@ export class WaterCollectionComponent implements OnInit {
' <div class="btnbox"><img id="setPositionOk" src="/assets/images/ok.png"><span>|</span><img id="setPositionClose" src="/assets/images/close.png"></div>' +
'</div>'
//创建地图
newPositionMarker:IMarker//坐标实例
newPositionMarker:any//坐标实例
createMap(){
this.map = MapFactory.MapInstance('container', {
this.map = new AMap.Map('container', {
zoom:12
})
this.map.setCity('上海市');
this.map.setCity('株洲市');
//输入提示
var autoOptions = {
input: "tipinput"
};
let auto = MapFactory.AutocompleteInstance(autoOptions,this);
this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类
auto.on("select", (e)=>{
this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat])
this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat}
this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点
});//注册监听,当选中某条记录时会触发
AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{
let auto = new AMap.AutoComplete(autoOptions);
this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
auto.on("select", (e)=>{
this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat])
this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat}
this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点
});//注册监听,当选中某条记录时会触发
});
}
//点击位置
isGisTopBox:boolean = false //
@ -578,26 +573,26 @@ export class WaterCollectionComponent implements OnInit {
// console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
draggable: true,
position: center,
content: this.newPositionMarkerContentBtn,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.positionLngLat = {x: center.lng || center[0], y: center.lat || center[1]}
this.map.add(this.newPositionMarker);
this.isMapLabel = true
this.newPositionMarker.on('dragend', (e)=>{
this.positionLngLat = {x: e.lnglat.lng, y: e.lnglat.lat}
},this)
})
//点击确定
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{
this.isGisTopBox = false
this.map.remove(this.newPositionMarker)
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.positionLngLat.x,this.positionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat))
this.map.add(this.newPositionMarker);
@ -611,10 +606,10 @@ export class WaterCollectionComponent implements OnInit {
this.positionLngLat = {}
this.atLastPositionLngLat = {}
}else{
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -625,10 +620,10 @@ export class WaterCollectionComponent implements OnInit {
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{
this.isGisTopBox = false
this.map.remove(this.newPositionMarker)
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.positionLngLat.x,this.positionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat))
this.map.add(this.newPositionMarker);
@ -642,10 +637,10 @@ export class WaterCollectionComponent implements OnInit {
this.positionLngLat = {}
this.atLastPositionLngLat = {}
}else{
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-15, -18)
offset: new AMap.Pixel(-15, -18)
});
this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点
this.map.add(this.newPositionMarker);

3
src/app/export-excel/export-excel.component.html

@ -1,3 +0,0 @@
<div class="box">
<button mat-raised-button color="primary" (click)="export()">导出excel表格</button>
</div>

7
src/app/export-excel/export-excel.component.scss

@ -1,7 +0,0 @@
.box{
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}

25
src/app/export-excel/export-excel.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ExportExcelComponent } from './export-excel.component';
describe('ExportExcelComponent', () => {
let component: ExportExcelComponent;
let fixture: ComponentFixture<ExportExcelComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ExportExcelComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ExportExcelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

31
src/app/export-excel/export-excel.component.ts

@ -1,31 +0,0 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-export-excel',
templateUrl: './export-excel.component.html',
styleUrls: ['./export-excel.component.scss']
})
export class ExportExcelComponent implements OnInit {
constructor(public http:HttpClient) { }
ngOnInit(): void {
}
export(){
const httpOptions = {
responseType: 'blob' as 'json'
};
this.http.get('/api/StatisticsAnalysis/ExportToExcel',httpOptions).subscribe((data:any) => {
// 文件名中有中文 则对文件名进行转码
const link = document.createElement('a');
const blob = new Blob([data], {type: 'application/vnd.ms-excel'});
link.setAttribute('href', window.URL.createObjectURL(blob));
link.setAttribute('download', '统计信息'+'.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})
}
}

84
src/app/external-links-plan/external-links-plan.component.html

@ -1,73 +1,11 @@
<mat-tab-group *ngIf="planId" selectedIndex="10" style="height: 99%;">
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>
</ng-template>
</mat-tab>
<mat-tab label="2.四周毗邻">
<ng-template matTabContent>
<app-allaround></app-allaround>
</ng-template>
</mat-tab>
<mat-tab label="3.消防设施">
<ng-template matTabContent>
<app-fire-fighting-device-look></app-fire-fighting-device-look>
</ng-template>
</mat-tab>
<mat-tab label="4.重点部位">
<ng-template matTabContent>
<app-key-site-look></app-key-site-look>
</ng-template>
</mat-tab>
<mat-tab label="5.功能分区">
<ng-template matTabContent>
<app-function-division-look></app-function-division-look>
</ng-template>
</mat-tab>
<mat-tab label="6.行车路线">
<ng-template matTabContent>
<app-router-gis></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="7.周边水源及力量">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="8.实景图">
<ng-template matTabContent>
<app-realistic-picture-look></app-realistic-picture-look>
</ng-template>
</mat-tab>
<mat-tab label="9.上传CAD">
<ng-template matTabContent>
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<mat-tab label="10.特别警示">
<ng-template matTabContent>
<app-special-warning></app-special-warning>
</ng-template>
</mat-tab>
<mat-tab label="11.作战部署">
<ng-template matTabContent>
<div *ngIf="showType == 0">
<iframe id="inneriframe" [src]='iframeSrc' frameborder="0" style="width: 100%;height: 100%;"></iframe>
</div>
<div *ngIf="showType == 1" id="viewer"></div>
<div *ngIf="showType == 3">
<app-collection-tools></app-collection-tools>
</div>
<!-- 在线编制预案 -->
<div *ngIf="showType == 2">
<app-create-plan-online-five></app-create-plan-online-five>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
<div *ngIf="unitId">
<app-basicinfo-look></app-basicinfo-look>
</div>
<!-- 株洲项目:传入预案id显示相应预案 -->
<div *ngIf="showType == 0">
<iframe id="inneriframe" [src]='iframeSrc' frameborder="0" style="width: 100%;height: 100%;"></iframe>
</div>
<div *ngIf="showType == 1" id="viewer"></div>
<div *ngIf="showType == 2">
<iframe id="inneriframe2" [src]='threedUrl' frameborder="0" style="width: 100%;height: 100%;"></iframe>
</div>
<div *ngIf="showType == 3">
<app-collection-tools></app-collection-tools>
</div>

301
src/app/external-links-plan/external-links-plan.component.ts

@ -1,198 +1,139 @@
import { HttpClient } from "@angular/common/http";
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { CacheTokenService } from "../http-interceptors/cache-token.service";
import { Viewer } from "photo-sphere-viewer";
import { DomSanitizer } from "@angular/platform-browser";
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { CacheTokenService } from '../http-interceptors/cache-token.service';
import { Viewer } from 'photo-sphere-viewer';
import { DomSanitizer } from '@angular/platform-browser';
declare var CryptoJS
@Component({
selector: "app-external-links-plan",
templateUrl: "./external-links-plan.component.html",
styleUrls: ["./external-links-plan.component.scss"],
selector: 'app-external-links-plan',
templateUrl: './external-links-plan.component.html',
styleUrls: ['./external-links-plan.component.scss']
})
export class ExternalLinksPlanComponent implements OnInit {
constructor(
private http: HttpClient,
private token: CacheTokenService,
public route: ActivatedRoute,
private sanitizer: DomSanitizer,
private router: Router
) {}
planId: any; //预案id
viewer; //全景图对象
fetchUrl; //预案文件地址
showType; //预案类型 1:全景图
planData; //预案信息
unitId;
constructor(private http: HttpClient, private token: CacheTokenService, public route: ActivatedRoute, private sanitizer: DomSanitizer) { }
planId: any//预案id
viewer//全景图对象
fetchUrl//预案文件地址
showType//预案类型 1:全景图
planData//预案信息
async ngOnInit(): Promise<void> {
await this.login(); //登录存储token
this.route.queryParams.subscribe((paramsData) => {
console.log(paramsData.planId)
if (paramsData.planId) {
this.planId = paramsData.planId;
this.http
.get(`/api/PlanComponents/${this.planId}`)
.subscribe((data: any) => {
console.log("单个预案详细信息", data);
sessionStorage.setItem("planId", data.id);
sessionStorage.setItem("companyId", data.companyId);
sessionStorage.setItem(
"buildingTypeId",
data.company.buildingTypes[0].id
);
sessionStorage.setItem("editable", "0");
sessionStorage.setItem("planName", data.name);
let queryParams = {};
if (data.webTextData && data.planType === 16) {
queryParams = {
id: data.companyId,
planId: data.id,
orName: data.company.organizationName,
orId: data.company.organizationId,
companyId: data.companyId,
planName: data.name,
unitName: data.companyName,
planCategory: data.planCategory,
unitTypeId: data.company.buildingTypes[0].id,
pattern: "false",
};
} else {
queryParams = {
id: data.companyId,
planId: data.id,
orName: data.company.organizationName,
orId: data.company.organizationId,
};
await this.login()//登录存储token
this.route.queryParams.subscribe(paramsData => {
this.planId = paramsData.planId
let planId = paramsData.planId
this.http.get(`/api/PlanComponents/${planId}`).subscribe((data: any) => {
console.log('单个预案详细信息', data)
this.planData = data
if (data.planType != 1 && data.planType != 2) {
this.fetchUrl = data.attachmentUrls[0]
var index = this.fetchUrl.indexOf("\/")
if (this.fetchUrl.substr(0, index) == 'psw') {
this.showType = 1
var obj = document.getElementById('viewer')
if (obj != null) {
obj.innerHTML = ''
}
this.router.navigate([`/linksPlan`], {
queryParams: queryParams,
});
this.planData = data;
//如果是查看文件类型
console.log("data.planType", data.planType);
if (data.planType != 1 && data.planType != 2) {
this.fetchUrl = data.attachmentUrls ? data.attachmentUrls[0] : "";
var index = this.fetchUrl.indexOf("/");
// 在线编制预案
if (data.webTextData && data.planType === 16) {
this.showType = 2;
return;
}
//全景图图片
if (this.fetchUrl.substr(0, index) == "psw") {
this.showType = 1;
var obj = document.getElementById("viewer");
if (obj != null) {
obj.innerHTML = "";
}
window.setTimeout(() => {
this.viewer = new Viewer({
container: document.querySelector("#viewer"),
panorama: "/api/Objects/PlanPlatform/" + this.fetchUrl,
});
});
} else {
//word文档
this.lookWord();
}
} else {
// 如果是二三维预案
this.handleData();
}
});
} else if (paramsData.unitId) {
this.http
.get(`/api/Companies/${paramsData.unitId}`)
.subscribe((data: any) => {
console.log("单位信息", data);
sessionStorage.setItem("editable", "0");
sessionStorage.setItem("companyName", data.name);
sessionStorage.setItem("companyId", data.id);
sessionStorage.setItem(
data.id,
JSON.stringify(data.companyIntegrityScore)
);
let queryParams = {
id: data.id,
usci: data.usci,
};
this.unitId = paramsData.unitId;
this.router.navigate([`/linksPlan`], {
queryParams: queryParams,
});
});
}
});
window.setTimeout(() => {
this.viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl,
});
})
} else {
//毕生
this.lookWord()
}
} else {
// 二维三维预案
this.handleData(data.url)
}
})
})
}
async login() {
await new Promise((resolve, reject) => {
let { appKey, signature, timestamp } = this.route.snapshot.queryParams;
if (!appKey || !signature || !timestamp) {
alert("url参数不完整");
return;
}
this.http
.get("/api/Account/VerifyAppInfo", {
params: {
appKey: appKey,
signature: signature,
timestamp: timestamp,
},
})
.subscribe((data: any) => {
sessionStorage.setItem("level", data.level);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
console.log("登录成功", data);
resolve(data);
this.token.startUp();
});
});
this.http.post('/api/Account/SignIn', {
name: 'zhuzhouyuanchakan',
password: '12345678'
}).subscribe((data: any) => {
sessionStorage.setItem("level", data.level);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
console.log('登录成功', data)
resolve(data)
this.token.startUp()
})
})
}
iframeSrc; //word服务器链接
iframeSrc//毕生服务器链接
src//文件存储地址
lookWord() {
this.showType = 0;
let src;
let suffix = this.fetchUrl
.split(".")
[this.fetchUrl.split(".").length - 1].toLowerCase();
if (suffix == "docx" || suffix == "doc") {
let arr = this.fetchUrl.split(".");
arr[arr.length - 1] = "pdf";
src = `/api/Objects/PlanPlatform/` + arr.join(".");
} else if (suffix == "pdf") {
src = `/api/Objects/PlanPlatform/` + this.fetchUrl;
}
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src);
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl);
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray);
let jwt = sessionStorage.getItem("token");
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]);
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt);
let identityJsonparse = JSON.parse(identityJson)
let filename: string
this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data: any) => {
filename = data.fileName
let json = {
doc: {
docId: docId,
title: filename,
//title: filename,
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/` + this.fetchUrl
},
user: {
uid: identityJsonparse.sub,
nickName: identityJsonparse.name,
avatar: "",
privilege: [
'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson = JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
this.src = `http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
this.showType = 0
})
}
companyData; //当前公司信息
thirdPartyURL;
threedUrl: any;
handleData() {
let data = this.planData;
if (this.planData.planMode == 1 || this.planData.planMode == 2) {
//预案planMode=2时, 跳查看页面组件
this.showType = 3;
} else if (this.planData.planMode == 3) {
//网页地址
let localhostPath = window.document.location.href.substring(
0,
window.document.location.href.indexOf(window.document.location.pathname)
);
let url = data.url;
if (url.indexOf(localhostPath) != -1) {
window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`;
} else {
window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`;
}
companyData//当前公司信息
thirdPartyURL
threedUrl: any
handleData(url?:string) {
let data = this.planData
// console.log('ddddd',data)
if (this.planData.planMode == 2) { //预案planMode=2时, 跳查看页面组件
this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
console.log(data)
data && data.company ? this.companyData = data.company : null
sessionStorage.setItem("buildingTypeId", this.companyData.buildingTypes.length ? this.companyData.buildingTypes[0].id : undefined);
sessionStorage.setItem("companyId", data.companyId);
sessionStorage.setItem("planId", this.planId);
sessionStorage.setItem("editable", '0');
sessionStorage.setItem("planName", this.planData.name)
this.showType = 3
// this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${data.companyId}`)
})
} else if (this.planData.planMode == 3) { //预案planMode=3时, 第三方网址'
// this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
// console.log('xxxx',data)
// data && data.company ? this.companyData = data.company : null
// this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url)
// this.showType = 2
// })
window.location.href = `${url}?unitId=${data.company.id}&unitName=${data.company.name}&editMode=false`
}
}
}

6
src/app/gis-management/allaround/allaround.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

6
src/app/gis-management/basic-info/basic-info.component.scss

@ -2,6 +2,12 @@
table,table tr th, table tr td { border: 1px solid #EEF1F5; }
table { text-align: center; border-collapse: collapse; padding:2px;}
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

6
src/app/gis-management/cad-draw/cad-draw.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

110
src/app/gis-management/fire-facilities/fire-facilities.component.html

@ -8,61 +8,57 @@
-->
<div class="content">
<div id="firefacilities" *ngFor="let item of companyBuiltInGrouping;let key = index" style="margin-top: 10px;">
<mat-accordion class="tableContent">
<mat-expansion-panel style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title style="font-size: 14px;">
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="column" *ngFor="let items of item.facilityItems">
<div class="up">
<div class="left">
<span style="margin-left: 25px;margin-top: 3%;white-space: nowrap;">项目:{{items.name}}</span>
</div>
<div class="centernum">
<span style="margin-left: 35px;">{{items.total ? items.total : '总数: 0'}}</span>
</div>
</div>
<div class="down">
<span style="margin-left: 25px;margin-top: 3%;">主要情况:{{items.details}}</span>
</div>
<div class="imgdown">
<span style="margin-left: 25px;color: #0080FF;"><a style="color: #0080FF;" href="javascript:void(0)"
(click)='previewImg(items)'>查看图片</a></span>
<label style="float: right;margin-right: 10%;cursor:pointer" (click)='SwitchBoard(items)'><input
style="margin-right: 5px;cursor:pointer" [(ngModel)]="items.expanded?down:open" readonly><img
[src]="items.expanded?imgsrcdown:imgsrcopen" (click)='SwitchBoard(items)'></label>
</div>
<div class="overflowTable" *ngIf="items.expanded">
<div class="detailsTable">
<table>
<tr *ngFor="let header of items.header">
<th>{{header}}</th>
<td *ngFor="let body of items.body">{{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 *ngFor="let header of tableMsg.header">
<th>{{header}}</th>
<td *ngFor="let body of tableMsg.body">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</div>
</mat-expansion-panel>
<div id="firefacilities" *ngFor="let item of companyBuiltInGrouping;let key = index" style="margin-top: 10px;">
<mat-accordion class="tableContent" >
<mat-expansion-panel style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title style="font-size: 14px;" >
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header >
<div class="column" *ngFor="let items of item.facilityItems">
<div class="up">
<div class="left">
<span style="margin-left: 25px;margin-top: 3%;white-space: nowrap;">项目:{{items.name}}</span>
</div>
<div class="centernum">
<span style="margin-left: 35px;">{{items.total ? items.total : '总数: 0'}}</span>
</div>
</div>
<div class="down">
<span style="margin-left: 25px;margin-top: 3%;">主要情况:{{items.details}}</span>
</div>
<div class="imgdown">
<span style="margin-left: 25px;color: #0080FF;"><a style="color: #0080FF;" href="javascript:void(0)" (click)='previewImg(items)'>查看图片</a></span>
<label style="float: right;margin-right: 10%;cursor:pointer" (click)='SwitchBoard(items)'><input style="margin-right: 5px;cursor:pointer" [(ngModel)]="items.expanded?down:open" readonly><img [src]="items.expanded?imgsrcdown:imgsrcopen" (click)='SwitchBoard(items)' ></label>
</div>
<div class="overflowTable" *ngIf="items.expanded">
<div class="detailsTable">
<table>
<tr *ngFor="let header of items.header">
<th >{{header}}</th>
<td *ngFor="let body of items.body">{{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 *ngFor="let header of tableMsg.header">
<th >{{header}}</th>
<td *ngFor="let body of tableMsg.body">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
</div>

6
src/app/gis-management/fire-facilities/fire-facilities.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

6
src/app/gis-management/function-partition/function-partition.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

416
src/app/gis-management/gis-labeling/gis-labeling.component.html

@ -1,15 +1,13 @@
<div class="content">
<!-- <button mat-button style="position: absolute;left: 50%;top: 0;z-index: 999;" (click)="createimg()">生成图片</button> -->
<div id="map"></div>
<div id="container" style="height: 100%;"></div>
<!-- 左上搜索框 -->
<div class="searchInput">
<div style="height: 36px; overflow: hidden; position: relative;">
<input type="text" [(ngModel)]="searchText" placeholder="请输入地址">
<input type="text" [(ngModel)]="searchText" placeholder="请输入单位名称">
<!-- *ngIf="searchText || allCompany.length" -->
<label class="clearIcon" title="清除" (click)='clear()'>
<img src="../../../assets/images/close2.png" alt="">
</label>
<label class="clearIcon" title="清除" (click)='clear()'>×</label>
<button (click)='search()'><mat-icon>search</mat-icon></button>
</div>
<div class="searchDataDiv">
@ -26,43 +24,35 @@
<div class="routeHeader">
<label style="bottom: 13px; left: 38px;" class="routeGISPublicIcon" (click)='clearGISRoute()'>清除路线</label>
<label style="bottom: 13px; left: 275px;" class="routeGISPublicIcon" (click)='queryGISRoute()'>查询</label>
<label style="top: 0px; right: 5px; font-size: 19px;" class="routeGISPublicIcon" (click)='closeRouteGIS()'
title="关闭">×</label>
<label style="top: 0px; right: 5px; font-size: 19px;" class="routeGISPublicIcon" (click)='closeRouteGIS()' title="关闭">×</label>
<div class="routeLeft" (click)='exchangeGISRoute()'><mat-icon>import_export</mat-icon></div>
<div class="routeContent" style="margin-top: -14px;">
<div class="routeEveryRow">
<label class="routeText"></label>
<input nz-input [(ngModel)]="routeStart" (ngModelChange)="routeChange(0)" [nzAutocomplete]="auto" />
<nz-autocomplete nzBackfill #auto>
<nz-auto-option *ngFor="let item of routeStartList" [nzValue]="item.district +' ' +item.name">
{{item.district}} {{item.name}}
</nz-auto-option>
</nz-autocomplete>
<label class="routeClear" *ngIf="routeStart"
(click)='deleteSearchGIS(0)'><mat-icon>highlight_off</mat-icon></label>
<input type="text" list="start" [(ngModel)]="routeStart" (ngModelChange)="routeChange(0)">
<datalist id="start">
<option *ngFor="let item of routeStartList" value="{{item.district}} {{item.name}}">
</datalist>
<label class="routeClear" *ngIf="routeStart" (click)='deleteSearchGIS(0)'><mat-icon>highlight_off</mat-icon></label>
</div>
<div class="routeEveryRow">
<label class="routeText"></label>
<input nz-input [(ngModel)]="routeEnd" (ngModelChange)="routeChange(1)" [nzAutocomplete]="auto2" />
<nz-autocomplete nzBackfill #auto2>
<nz-auto-option *ngFor="let item of routeEndList" [nzValue]="item.district +' ' +item.name">
{{item.district}} {{item.name}}
</nz-auto-option>
</nz-autocomplete>
<label class="routeClear" *ngIf="routeEnd"
(click)='deleteSearchGIS(1)'><mat-icon>highlight_off</mat-icon></label>
<input type="text" list="end" [(ngModel)]="routeEnd" (ngModelChange)="routeChange(1)">
<datalist id="end">
<option *ngFor="let item of routeEndList" value="{{item.district}} {{item.name}}">
</datalist>
<label class="routeClear" *ngIf="routeEnd" (click)='deleteSearchGIS(1)'><mat-icon>highlight_off</mat-icon></label>
</div>
</div>
</div>
<div class="routeCenter" *ngIf="routes.steps.length">
<div style="text-align: center;">
<button class="routeType" [ngClass]="{'selectRouteType': selectType}" (click)='toggleRoute(true)'>推荐方案</button>
<button class="routeType" [ngClass]="{'selectRouteType': !selectType}"
(click)='toggleRoute(false)'>躲避拥堵</button>
<button class="routeType" [ngClass]="{'selectRouteType': !selectType}" (click)='toggleRoute(false)'>躲避拥堵</button>
</div>
<div class="routeTypeExplain" style="text-align: center; font-weight: 550;">
<label>约{{ routes.time / 60 | number:'0.0-0' }}分钟</label>
<label>{{ routes.distance / 1000 | number:'0.1-1' }}公里</label>
<label>约{{ routes.time / 60 | number:'0.0-0' }}分钟</label>
<label>{{ routes.distance / 1000 | number:'0.1-1' }}公里</label>
</div>
<div class="routeTypeExplain" style="color: rgb(176, 180, 184); margin-top: -10px;">
<label>途径</label>
@ -71,8 +61,7 @@
<div class="routeCenterTB" title="{{routeStart}}">
<p style="background-color: #0080FF;"></p><label style="font-weight: 550;">{{routeStart}}</label>
</div>
<div class="routeCenterTB" *ngFor="let item of routes.steps" style="border-bottom: 1px solid rgb(223, 212, 212);"
title="{{item.instruction}}">
<div class="routeCenterTB" *ngFor="let item of routes.steps" style="border-bottom: 1px solid rgb(223, 212, 212);" title="{{item.instruction}}">
<p class="orientation" *ngIf="item.orientation == '西'"></p>
<p class="orientation" *ngIf="item.orientation == '北'"></p>
<p class="orientation" *ngIf="item.orientation == '东'"></p>
@ -89,218 +78,205 @@
</div>
</div>
<!-- 导航路线 -->
<!-- 左侧 -->
<div class="leftDiv" [ngClass]="{'leftDivShow': leftDivState,'leftDivHide': !leftDivState}">
<app-left-working style="width: 100%;height: 100%;" (onCustomEvent)="closeDiv()" #appLeft></app-left-working>
</div>
<img *ngIf="showLeftDiv" id="leftHide" class="leftHide publicButton" title="隐藏"
[ngClass]="{'leftDivShow': leftDivState,'leftDivHide': !leftDivState}" (click)='toggleLeft(false)'
src="../../../assets//images/showhide.png" alt="">
<img class="leftShow publicButton" title="显示" *ngIf="!leftDivState && showLeftDiv" (click)='toggleLeft(true)'
src="../../../assets//images/showhide.png" alt="">
<img *ngIf="showLeftDiv" id="leftHide" class="leftHide publicButton" title="隐藏" [ngClass]="{'leftDivShow': leftDivState,'leftDivHide': !leftDivState}" (click)='toggleLeft(false)' src="../../../assets//images/showhide.png" alt="">
<img class="leftShow publicButton" title="显示" *ngIf="!leftDivState && showLeftDiv" (click)='toggleLeft(true)' src="../../../assets//images/showhide.png" alt="">
<!-- 左侧 -->
<!-- 右上角 -->
<div class="rightTopBox">
<!-- <button (click)="setMaxZoom()">设置聚合范围</button> -->
<div class="topbox">
<div (click)="clickTitle(key)" *ngFor="let item of titleList;let key = index" class="titleItem"
[ngClass]="{'selectedItem': key == selectedTitle}">
<img [src]="item.iconImg" alt="">
<span>{{item.name}}</span>
<div class="topbox">
<div (click)="clickTitle(key)" *ngFor="let item of titleList;let key = index" class="titleItem" [ngClass]="{'selectedItem': key == selectedTitle}">
<img [src]="item.iconImg" alt="">
<span>{{item.name}}</span>
</div>
</div>
</div>
<div class="contantbox">
<div *ngIf="selectedTitle == 0" class="keyUnitBox">
<form [formGroup]="keyUnitForm" class="inputList" (submit)='ketUnitSubmit(keyUnitForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedUnit"
(change)="selectedAllUnit($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let unit of units.controls;let i = index" color="primary" [formControl]="unit">
{{keyUnitList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaUnit" [(ngModel)]="unitAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
<div class="contantbox">
<div *ngIf="selectedTitle == 0" class="keyUnitBox">
<form [formGroup]="keyUnitForm" class="inputList" (submit)='ketUnitSubmit(keyUnitForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedUnit" (change)="selectedAllUnit($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<button class="submit" id="submit">确定</button>
<button class="cancel" type="button" (click)="resetUnit()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 1" class="waterBox">
<form [formGroup]="watertForm" class="inputList" (submit)='waterSubmit(watertForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedWater"
(change)="selectedAllWater($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let water of waters.controls;let i = index" color="primary" [formControl]="water">
{{waterList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaWater" [(ngModel)]="waterAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
<div class="inputItem">
<mat-checkbox *ngFor="let unit of units.controls;let i = index" color="primary" [formControl]="unit">
{{keyUnitList[i].name}}
</mat-checkbox>
</div>
<button class="submit" id="submit2">确定</button>
<button class="cancel" type="button" (click)="resetWater()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 2" class="fireForceBox">
<form [formGroup]="fireForceForm" class="inputList" (submit)='fireForceSubmit(fireForceForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedFireForce"
(change)="selectedAllFireForce($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let fire of fireForce.controls;let i = index" color="primary" [formControl]="fire">
{{fireForceList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaFireForce" [(ngModel)]="fireForceAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaUnit" [(ngModel)]="unitAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit">确定</button>
<button class="cancel" type="button" (click)="resetUnit()">取消显示</button>
</div>
<button class="submit" id="submit3">确定</button>
<button class="cancel" type="button" (click)="resetFireForce()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 3" class="linkageForcesBox">
<form [formGroup]="linkageForcesForm" class="inputList" (submit)='linkageForcesSubmit(linkageForcesForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedLinkageForces"
(change)="selectedAllLinkageForces($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let linkage of linkageForces.controls;let i = index" color="primary"
[formControl]="linkage">
{{linkageForcesList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaLinkageForces" [(ngModel)]="linkageForcesAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</form>
</div>
<div *ngIf="selectedTitle == 1" class="waterBox">
<form [formGroup]="watertForm" class="inputList" (submit)='waterSubmit(watertForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedWater" (change)="selectedAllWater($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<button class="submit" id="submit4">确定</button>
<button class="cancel" type="button" (click)="resetLinkageForces()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 4" class="distanceBox">
<div>
<input type="radio" name='func' [(ngModel)]="checkRadio" value='rule' (click)="measure('rule')" checked><span
class="input-text" style="margin-right: 15px;">&nbsp;距离测量</span>
<input type="radio" name='func' [(ngModel)]="checkRadio" value='measureArea'
(click)="measure('measureArea')"><span class="input-text"> &nbsp;面积测量</span>
<div class="inputItem">
<mat-checkbox *ngFor="let water of waters.controls;let i = index" color="primary" [formControl]="water">
{{waterList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaWater" [(ngModel)]="waterAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit2">确定</button>
<button class="cancel" type="button" (click)="resetWater()">取消显示</button>
</div>
</form>
</div>
<button class="clearbutton" (click)="clearnAll()">清除</button>
</div>
<div *ngIf="selectedTitle == 5" class="coverageBox">
<div class="topbox">
<span>图层</span>
<div style="display: flex;align-items: center;">
<mat-slide-toggle [(ngModel)]="satelliteModel" (change)='satelliteChange($event)' color="primary"
labelPosition='before' style="margin-right: 25px;">卫星图层</mat-slide-toggle>
<mat-slide-toggle [(ngModel)]="loadModel" (change)='loadChange($event)' color="primary"
labelPosition='before'>路网图层</mat-slide-toggle>
<mat-icon (click)="closertdiv()" style="margin-left: 10px;">clear</mat-icon>
<div *ngIf="selectedTitle == 2" class="fireForceBox">
<form [formGroup]="fireForceForm" class="inputList" (submit)='fireForceSubmit(fireForceForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedFireForce" (change)="selectedAllFireForce($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let fire of fireForce.controls;let i = index" color="primary" [formControl]="fire">
{{fireForceList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaFireForce" [(ngModel)]="fireForceAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit3">确定</button>
<button class="cancel" type="button" (click)="resetFireForce()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 3" class="linkageForcesBox">
<form [formGroup]="linkageForcesForm" class="inputList" (submit)='linkageForcesSubmit(linkageForcesForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedLinkageForces" (change)="selectedAllLinkageForces($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let linkage of linkageForces.controls;let i = index" color="primary" [formControl]="linkage">
{{linkageForcesList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaLinkageForces" [(ngModel)]="linkageForcesAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit4">确定</button>
<button class="cancel" type="button" (click)="resetLinkageForces()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 4" class="distanceBox">
<div>
<input type="radio" name='func' [(ngModel)]="checkRadio" value='rule' (click)="measure('rule')" checked><span class="input-text" style="margin-right: 15px;">&nbsp;距离测量</span>
<input type="radio" name='func' [(ngModel)]="checkRadio" value='measureArea' (click)="measure('measureArea')"><span class="input-text"> &nbsp;面积测量</span>
</div>
<button class="clearbutton" (click)="clearnAll()">清除</button>
</div>
<div class="contantbox">
<div [ngClass]="{'selectedPattern': mapPattern}">
<img src="../../../assets/images/2D.jpg" alt="" (click)="mapPatternChange('2D')">
<span> 2D </span>
<div *ngIf="selectedTitle == 5" class="coverageBox">
<div class="topbox">
<span>图层</span>
<div style="display: flex;align-items: center;">
<mat-slide-toggle [(ngModel)]="satelliteModel" (change)='satelliteChange($event)' color="primary" labelPosition='before' style="margin-right: 25px;">卫星图层</mat-slide-toggle>
<mat-slide-toggle [(ngModel)]="loadModel" (change)='loadChange($event)' color="primary" labelPosition='before'>路网图层</mat-slide-toggle>
<mat-icon (click)="closertdiv()" style="margin-left: 10px;">clear</mat-icon>
</div>
</div>
<div [ngClass]="{'selectedPattern': !mapPattern}">
<img src="../../../assets/images/3D.jpg" alt="" (click)="mapPatternChange('3D')">
<span> 3D </span>
<div class="contantbox">
<div [ngClass]="{'selectedPattern': mapPattern}">
<img src="../../../assets/images/2D.jpg" alt="" (click)="mapPatternChange('2D')">
<span> 2D </span>
</div>
<div [ngClass]="{'selectedPattern': !mapPattern}">
<img src="../../../assets/images/3D.jpg" alt="" (click)="mapPatternChange('3D')">
<span> 3D </span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 右上角 -->
</div>
</div>

7
src/app/gis-management/gis-labeling/gis-labeling.component.scss

@ -76,8 +76,8 @@
right: 40px;
width: 36px;
height: 36px;
line-height: 46px;
display: inline-block;
font-size: 24px;
text-align: center;
}
.searchDataDiv {
@ -227,11 +227,10 @@
//右上角div
.rightTopBox{
width: 590px;
width: 480px;
position: absolute;
right: 30px;
top: 15px;
.topbox{
width: 100%;
height: 40px;
@ -240,8 +239,6 @@
background: #FFFFFF;
border-radius: 6px;
align-items: center;
box-sizing: border-box;
padding: 0 12px;
.titleItem{
cursor: pointer;
display: flex;

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

File diff suppressed because it is too large Load Diff

2
src/app/gis-management/gis-labeling/lookPlan.html

@ -37,7 +37,7 @@
<td>{{item.planLevel | planlevel}}</td>
<td>
<span class="btn" (click)="lookPlan(item)">查看</span>
<span class="btn" (click)="readFile(item)" [ngClass]="{'grey': item.planMode != '1'}">下载</span>
<span class="btn" (click)="readFile(item)" [ngClass]="{'grey': item.planMode == '1' || item.planMode == '2' || item.planMode == '3'}">下载</span>
</td>
</tr>
</table>

10
src/app/gis-management/gis-labeling/lookPlan.scss

@ -1,4 +1,14 @@
// table,table tr th, table tr td { border: 1px solid #EEF1F5; }
table { text-align: center; border-collapse: collapse; padding:2px;}
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.box{
position: relative;
display: flex;

267
src/app/gis-management/gis-management.module.ts

@ -1,154 +1,121 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import {
DownloadFile,
GisLabelingComponent,
LookPlanDialog,
ShareUrlDialog,
} from "./gis-labeling/gis-labeling.component";
import { A11yModule } from "@angular/cdk/a11y";
import { DragDropModule } from "@angular/cdk/drag-drop";
import { PortalModule } from "@angular/cdk/portal";
import { ScrollingModule } from "@angular/cdk/scrolling";
import { CdkStepperModule } from "@angular/cdk/stepper";
import { CdkTableModule } from "@angular/cdk/table";
import { CdkTreeModule } from "@angular/cdk/tree";
import { MatAutocompleteModule } from "@angular/material/autocomplete";
import { MatBadgeModule } from "@angular/material/badge";
import { MatBottomSheetModule } from "@angular/material/bottom-sheet";
import { MatButtonModule } from "@angular/material/button";
import { MatButtonToggleModule } from "@angular/material/button-toggle";
import { MatCardModule } from "@angular/material/card";
import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatChipsModule } from "@angular/material/chips";
import { MatStepperModule } from "@angular/material/stepper";
import { MatDatepickerModule } from "@angular/material/datepicker";
import { MatDialogModule } from "@angular/material/dialog";
import { MatDividerModule } from "@angular/material/divider";
import { MatExpansionModule } from "@angular/material/expansion";
import { MatGridListModule } from "@angular/material/grid-list";
import { MatIconModule } from "@angular/material/icon";
import { MatInputModule } from "@angular/material/input";
import { MatListModule } from "@angular/material/list";
import { MatMenuModule } from "@angular/material/menu";
import {
MatNativeDateModule,
MatRippleModule,
MatOption,
} from "@angular/material/core";
import { MatPaginatorModule } from "@angular/material/paginator";
import { MatProgressBarModule } from "@angular/material/progress-bar";
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { MatRadioModule } from "@angular/material/radio";
import { MatSelectModule } from "@angular/material/select";
import { MatSidenavModule } from "@angular/material/sidenav";
import { MatSliderModule } from "@angular/material/slider";
import { MatSlideToggleModule } from "@angular/material/slide-toggle";
import { MatSnackBarModule } from "@angular/material/snack-bar";
import { MatSortModule } from "@angular/material/sort";
import { MatTableModule } from "@angular/material/table";
import { MatTabsModule } from "@angular/material/tabs";
import { MatToolbarModule } from "@angular/material/toolbar";
import { MatTooltipModule } from "@angular/material/tooltip";
import { MatTreeModule } from "@angular/material/tree";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { GisRoutingModule } from "./gis-management-routing.module";
import { LeftWorkingComponent } from "./left-working/left-working.component";
import { BasicInfoComponent } from "./basic-info/basic-info.component";
import { FunctionPartitionComponent } from "./function-partition/function-partition.component";
import { FireFacilitiesComponent } from "./fire-facilities/fire-facilities.component";
import { ImagesData2 } from "./fire-facilities/imagesdata.component";
import { AllaroundComponent } from "./allaround/allaround.component";
import { ImgDetails } from "./allaround/imgdetails.component";
import { KeySiteLookComponent } from "./key-site-look/key-site.component";
import { KeySiteImgs2 } from "./key-site-look/keysiteimgs.component";
import { RealisticPictureLookComponent } from "./realistic-picture-look/realistic-picture.component";
import { previewImg3 } from "./realistic-picture-look/realistic-picture.component";
import {
OpenPlanToolDialog,
PlanListComponent,
} from "./plan-list/plan-list.component";
import { PlanManagementModule } from "../plan-management/plan-management.module";
import { UiModule } from "../ui/ui.module";
import { CadDrawComponent } from "./cad-draw/cad-draw.component";
import { previewBigImg2 } from "./fire-facilities/imagesdata.component";
import { NzAutocompleteModule } from "ng-zorro-antd/auto-complete";
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DownloadFile, GisLabelingComponent, LookPlanDialog, ShareUrlDialog } from './gis-labeling/gis-labeling.component';
import {A11yModule} from '@angular/cdk/a11y';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {PortalModule} from '@angular/cdk/portal';
import {ScrollingModule} from '@angular/cdk/scrolling';
import {CdkStepperModule} from '@angular/cdk/stepper';
import {CdkTableModule} from '@angular/cdk/table';
import {CdkTreeModule} from '@angular/cdk/tree';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatBadgeModule} from '@angular/material/badge';
import {MatBottomSheetModule} from '@angular/material/bottom-sheet';
import {MatButtonModule} from '@angular/material/button';
import {MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatCardModule} from '@angular/material/card';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatChipsModule} from '@angular/material/chips';
import {MatStepperModule} from '@angular/material/stepper';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatDialogModule} from '@angular/material/dialog';
import {MatDividerModule} from '@angular/material/divider';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatGridListModule} from '@angular/material/grid-list';
import {MatIconModule} from '@angular/material/icon';
import {MatInputModule} from '@angular/material/input';
import {MatListModule} from '@angular/material/list';
import {MatMenuModule} from '@angular/material/menu';
import {MatNativeDateModule, MatRippleModule, MatOption} from '@angular/material/core';
import {MatPaginatorModule} from '@angular/material/paginator';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatRadioModule} from '@angular/material/radio';
import {MatSelectModule} from '@angular/material/select';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import {MatSortModule} from '@angular/material/sort';
import {MatTableModule} from '@angular/material/table';
import {MatTabsModule} from '@angular/material/tabs';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatTooltipModule} from '@angular/material/tooltip';
import {MatTreeModule} from '@angular/material/tree';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { GisRoutingModule } from './gis-management-routing.module';
import { LeftWorkingComponent } from './left-working/left-working.component';
import { BasicInfoComponent } from './basic-info/basic-info.component';
import { FunctionPartitionComponent } from './function-partition/function-partition.component';
import { FireFacilitiesComponent } from './fire-facilities/fire-facilities.component';
import {ImagesData2}from './fire-facilities/imagesdata.component'
import {AllaroundComponent} from './allaround/allaround.component'
import {ImgDetails}from './allaround/imgdetails.component';
import {KeySiteLookComponent} from './key-site-look/key-site.component'
import {KeySiteImgs2}from './key-site-look/keysiteimgs.component'
import {RealisticPictureLookComponent} from './realistic-picture-look/realistic-picture.component'
import {previewImg3} from './realistic-picture-look/realistic-picture.component'
import { OpenPlanToolDialog, PlanListComponent } from './plan-list/plan-list.component';
import { PlanManagementModule } from '../plan-management/plan-management.module';
import { UiModule } from '../ui/ui.module';
import { CadDrawComponent } from './cad-draw/cad-draw.component';
import {previewBigImg2} from './fire-facilities/imagesdata.component'
@NgModule({
declarations: [
GisLabelingComponent,
LeftWorkingComponent,
FunctionPartitionComponent,
RealisticPictureLookComponent,
previewImg3,
previewBigImg2,
FireFacilitiesComponent,
ImagesData2,
AllaroundComponent,
ImgDetails,
KeySiteLookComponent,
KeySiteImgs2,
BasicInfoComponent,
FunctionPartitionComponent,
ShareUrlDialog,
PlanListComponent,
LookPlanDialog,
DownloadFile,
OpenPlanToolDialog,
CadDrawComponent,
],
declarations: [GisLabelingComponent, LeftWorkingComponent, FunctionPartitionComponent, RealisticPictureLookComponent,previewImg3,previewBigImg2,
FireFacilitiesComponent,ImagesData2,AllaroundComponent,ImgDetails,KeySiteLookComponent,KeySiteImgs2,BasicInfoComponent,FunctionPartitionComponent,ShareUrlDialog, PlanListComponent,LookPlanDialog,DownloadFile,OpenPlanToolDialog, CadDrawComponent],
imports: [
CommonModule,
CommonModule,
GisRoutingModule,
A11yModule,
CdkStepperModule,
CdkTableModule,
CdkTreeModule,
DragDropModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatStepperModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
PortalModule,
ScrollingModule,
FormsModule,
ReactiveFormsModule,
PlanManagementModule,
UiModule,
NzAutocompleteModule,
],
imports: [
CommonModule,
CommonModule,
GisRoutingModule,
A11yModule,
CdkStepperModule,
CdkTableModule,
CdkTreeModule,
DragDropModule,
MatAutocompleteModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatStepperModule,
MatDatepickerModule,
MatDialogModule,
MatDividerModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule,
PortalModule,
ScrollingModule,
FormsModule,
ReactiveFormsModule,
PlanManagementModule,
UiModule
]
})
export class GISManagementModule {}
export class GISManagementModule { }

6
src/app/gis-management/key-site-look/key-site.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

4
src/app/gis-management/plan-list/plan-list.component.html

@ -10,7 +10,7 @@
<div class="contant">
<div class="contantitem" *ngFor="let item of sitePlanItems">
<div>
<img (click)="openPlan(item,-1)" [src]="item.imageUrl ? item.imageUrl+'?x-oss-process=image/resize,m_fill,h_110,w_110' : '/assets/images/noImg.png'" alt="">
<img (click)="openPlan(item,-1)" [src]="item.imageUrl ? item.imageUrl+'?x-oss-process=image/resize,m_fill,h_110,w_110' : '../../../assets/images/noImg.png'" alt="">
</div>
<p>{{item.name}}</p>
</div>
@ -31,7 +31,7 @@
<div class="contant">
<div class="contantitem" *ngFor="let i of item.plandata">
<div>
<img (click)="openPlan(i,key)" [src]="i.imageUrl ? i.imageUrl+'?x-oss-process=image/resize,m_fill,h_110,w_110' : '/assets/images/noImg.png'" alt="">
<img (click)="openPlan(i,key)" [src]="i.imageUrl ? i.imageUrl+'?x-oss-process=image/resize,m_fill,h_110,w_110' : '../../../assets/images/noImg.png'" alt="">
</div>
<p>{{i.name}}</p>
</div>

6
src/app/gis-management/plan-list/plan-list.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

36
src/app/gis-management/realistic-picture-look/realistic-picture.component.html

@ -7,28 +7,26 @@
* @LastEditTime: 2020-11-27 16:19:50
-->
<div class="content" id="realisticpicture">
<mat-accordion class="tableContent">
<mat-expansion-panel *ngFor="let item of allRealPicture,let key=index" (opened)="changeReal(item,key)">
<mat-expansion-panel-header class="panelhead" collapsedHeight='40px' expandedHeight='40px'>
<mat-panel-title style="font-size: 14px;">
<mat-accordion class="tableContent" >
<mat-expansion-panel *ngFor="let item of allRealPicture,let key=index" (opened)="changeReal(item,key)">
<mat-expansion-panel-header class="panelhead" collapsedHeight ='40px' expandedHeight='40px'>
<mat-panel-title style="font-size: 14px;" >
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="colum">
<div class="imghe" *ngFor="let items of allImages;let key = index">
<div *ngIf="allImages.length!=0"><img [src]="items.newImageUrl" (click)='operation(items,key)'
[ngClass]="{'selectImg': items.checked}"></div>
<label style="margin-left: 6%;"><input type="text" style="margin-left: 6px;" [(ngModel)]="items.nameStart"
readonly></label>
</mat-expansion-panel-header >
<div class="colum" >
<div class="imghe" *ngFor="let items of allImages;let key = index">
<div *ngIf="allImages.length!=0"><img [src]="items.newImageUrl" (click)='operation(items,key)' [ngClass]="{'selectImg': items.checked}"></div>
<label style="margin-left: 6%;"><input type="text" style="margin-left: 6px;" [(ngModel)]="items.nameStart" readonly></label>
</div>
<div class="zanwu" *ngIf="allImages.length==0">
<span>暂无数据</span>
</div>
<div class="zanwu" *ngIf="allImages.length==0">
<span>暂无数据</span>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>

6
src/app/gis-management/realistic-picture-look/realistic-picture.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

2
src/app/home/home.component.ts

@ -1,6 +1,8 @@
import { Component, OnInit, Renderer2, ElementRef } from '@angular/core';
import { HttpClient } from '@angular/common/http'
declare var echarts: any;
declare var AMap: any;
declare var AMapUI: any;

22
src/app/http-interceptors/base-interceptor.ts

@ -5,8 +5,8 @@ import {
} from '@angular/common/http';
import { throwError } from 'rxjs'
import { catchError, retry } from 'rxjs/operators';
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from './cache-token.service'
import { Router,ActivatedRoute } from '@angular/router'
import {CacheTokenService} from './cache-token.service'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
//baseurl
@ -15,19 +15,19 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@Injectable()
export class BaseInterceptor implements HttpInterceptor {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, public snackBar: MatSnackBar) { }
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar) {}
intercept(req, next: HttpHandler) {
let newReq = req.clone({
url: req.hadBaseurl ? `${req.url}` : `${req.url}`,
});
if (!req.cancelToken) {
if(!req.cancelToken) {
/*获取token*/
let token = sessionStorage.getItem("token")
/*此处设置额外请求头,token令牌*/
newReq.headers =
newReq.headers.set('Authorization', `Bearer ${token}`)
newReq.headers.set('Authorization', `Bearer ${token}`)
}
// 携带请求头发送下一次请求
@ -43,7 +43,7 @@ export class BaseInterceptor implements HttpInterceptor {
private handleError(error: HttpErrorResponse) {
// 用户认证失败返回登录页
if (error.status === 401 || error.status === 614) {
if (error.status === 401||error.status === 614) {
this.token.delete()
sessionStorage.clear()
window.localStorage.clear()
@ -51,19 +51,19 @@ export class BaseInterceptor implements HttpInterceptor {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('用户认证信息过期,请重新登录', '确定', config);
this.snackBar.open('用户认证信息过期,请重新登录','确定',config);
}
if (error.status === 403) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('对不起,您无此权限', '确定', config);
this.snackBar.open('对不起,您无此权限','确定',config);
}
if (error.status === 400) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请核对您的输入格式是否正确', '确定', config);
this.snackBar.open('请核对您的输入格式是否正确','确定',config);
}
if (error.error instanceof ErrorEvent) {
@ -72,7 +72,9 @@ export class BaseInterceptor implements HttpInterceptor {
} else {
// 服务端返回http状态码
// 服务端返回错误信息
console.error(error);
console.error(
`Backend returned code ${error.status}, ` +
`body was: ${error.error}`);
}
// 返回带有面向用户的错误信息
return throwError(

50
src/app/http-interceptors/cache-token.service.ts

@ -1,34 +1,40 @@
import { Injectable } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@Injectable({
providedIn: "root",
providedIn: 'root'
})
export class CacheTokenService {
constructor(private http: HttpClient) {}
constructor(private http:HttpClient) { }
public timer;
//刷新token令牌定时器
startUp = (): void => {
window.clearInterval(this.timer); //清一遍定时器
this.timer = window.setInterval(() => {
startUp = ():void=>{
window.clearInterval(this.timer) //清一遍定时器
this.timer = window.setInterval(()=>{
var token = sessionStorage.getItem("token");
var refreshToken = sessionStorage.getItem("refreshToken");
this.http
.post("/api/Account/RefreshToken", {
token: token,
refreshToken: refreshToken,
})
.subscribe((data: any) => {
sessionStorage.setItem("level", data.level);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
});
}, 5 * 60 * 1000);
};
this.http.post('/api/Account/RefreshToken', {
token: token,
refreshToken: refreshToken
}).subscribe((data:any) => {
sessionStorage.setItem("level",data.level);
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
})
},18*60*1000)
}
//删除定时器
delete = (): void => {
window.clearInterval(this.timer);
};
delete = ():void=> {
window.clearInterval(this.timer)
}
}

149
src/app/interface.ts

@ -1,102 +1,93 @@
/*
* @Descripttion:
* @version:
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2021-04-09 17:12:59
*/
export interface Data {
token: string;
refreshToken: string;
expires: number;
realName: string;
level: any;
isDefaultPassword: string;
token:string,
refreshToken:string,
expires: number,
realName:string,
level:any,
isDefaultPassword:string
}
export interface windows {
token: string;
token:string
}
export enum isno {
"是",
"否",
"是",
"否"
}
export enum PlanTypeEnum {
"zero",
"二维预案",
"三维预案",
"three",
"其他预案",
"five",
"six",
"seven",
"卡片预案",
"none",
"teen",
"shiyi",
"shier",
"shisan",
"shisi",
"shiwu",
"文本预案",
"zero",
"二维预案",
"三维预案",
"three",
"其他预案",
"five",
"six",
"seven",
"卡片预案",
"none",
"teen",
"shiyi",
"shier",
"shisan",
"shisi",
"shiwu",
"文本预案"
}
export enum AuditStatusEnum {
"zero",
"审核中",
"审核通过",
"two",
"终审退回",
"five",
"six",
"seven",
"未提交审核",
"nine",
"ten",
"eleven",
"twelve",
"thieteen",
"fourteen",
"fifteen",
"待终审",
"shiqi",
"shiba",
"shijiu",
"ershi",
"ershiyi",
"ershier",
"ershis",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
"t8",
"初审退回",
"zero",
"审核中",
"审核通过",
"two",
"终审退回",
"five",
"six",
"seven",
"未提交审核",
"nine",
"ten",
"eleven",
"twelve",
"thieteen",
"fourteen",
"fifteen",
"待终审",
"shiqi",
"shiba",
"shijiu",
"ershi",
"ershiyi",
"ershier",
"ershis",
"t1",
"t2",
"t3",
"t4",
"t5",
"t6",
"t7",
"t8",
"初审退回",
}
export enum PlanLevelEnum {
"编制级别0",
"总队",
"支队",
"编制级别3",
"大队",
"编制级别5",
"编制级别6",
"编制级别7",
"中队",
"编制级别0",
"总队",
"支队",
"编制级别3",
"大队",
"编制级别5",
"编制级别6",
"编制级别7",
"中队"
}
export enum PlanAuditStatusEnum {
"非审核状态" = 0,
"未提交审核" = 8,
"待审核" = 1,
"初审通过" = 16,
"初审退回" = 32,
"终审通过" = 2,
"终审退回" = 4,
}

42
src/app/key-unit/basicinfo-look/basicinfo.component.ts

@ -8,13 +8,17 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader, FileItem } from 'ng2-file-upload'
import { DomSanitizer } from '@angular/platform-browser'
import { Injectable } from "@angular/core"
import { filter } from 'rxjs/operators';
import { async } from '@angular/core/testing';
import { MatTableDataSource } from '@angular/material/table';
import { isNgTemplate } from '@angular/compiler';
import * as _ from 'lodash';
import Swiper from 'swiper';
import { ActivatedRoute } from '@angular/router';
import { StatisticsOfFireFightingFacilities } from '../basicinfo/basicinfo.component';
import Viewer from 'viewerjs';
import { IMap, IMarker } from '@src/modules/map/declare/map';
import { MapFactory } from '@src/modules/map/declare/factory';
declare var AMap: any;
@Component({
selector: 'app-basicinfo-look',
@ -126,11 +130,11 @@ export class BasicinfoLookComponent implements OnInit {
isMapLabel: boolean
//地图标注位置
markerPosition: any = { x: 0, y: 0 }//单位坐标
map: IMap //地图实例
map: any //地图实例
isGisTopBox: boolean = false//点击位置按钮
isGisTopBoxTwo: boolean = false//点击位置按钮
oldPositionMarker: IMarker //旧位置marker实例
newPositionMarker: IMarker //新位置marker实例
oldPositionMarker: any //旧位置marker实例
newPositionMarker: any //新位置marker实例
newPositionMarkerContent: any =
'<div class="custom-content-marker">' +
@ -140,7 +144,7 @@ export class BasicinfoLookComponent implements OnInit {
//初始化地图
labelGis() {
this.map = MapFactory.MapInstance('container', {
this.map = new AMap.Map('container', {
zoom: 12
})
this.map.on('complete', () => {
@ -148,13 +152,33 @@ export class BasicinfoLookComponent implements OnInit {
});
if (this.isMapLabel) {//如果已经标注单位坐标
if(this.isMapLabel){//如果已经标注单位坐标
// console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]);
this.oldPositionMarker = new AMap.Marker({
position: [this.unitinfo.location.x,this.unitinfo.location.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-15, -18)
})
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);
}else{
// console.log('未标注单位位置')
this.map.setCity('株洲市');
}
}
markerPosition2
//点击位置按钮
setPosition(){
this.isGisTopBox = false
this.isGisTopBoxTwo = true
if(this.isMapLabel){//如果已经标注单位坐标
// console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x, this.unitinfo.location.y]);
this.oldPositionMarker = MapFactory.MarkerInstance({
this.oldPositionMarker = new AMap.Marker({
position: [this.unitinfo.location.x, this.unitinfo.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
})
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);

6
src/app/key-unit/basicinfo/addhouseinfo.component.html

@ -1,14 +1,14 @@
<div mat-dialog-title>新增建筑</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field hintLabel="名字不多于30个字">
<mat-form-field hintLabel="名字不多于20个字">
<input matInput id="name" name="name"
required
maxlength="30"
maxlength="20"
ngModel #name="ngModel" placeholder="建筑名称"
#input
>
<mat-hint align="end">{{input.value?.length || 0}}/30</mat-hint>
<mat-hint align="end">{{input.value?.length || 0}}/20</mat-hint>
</mat-form-field>
<mat-form-field>

14
src/app/key-unit/basicinfo/basicinfo.component.html

@ -50,15 +50,17 @@
<span style="color: red;">*</span>
<span>联系电话:</span>
<mat-form-field>
<input type="number" matInput id="linkphone" name="linkphone" #linkphone="ngModel"
required [(ngModel)]="unitinfo.phone" (focus)="closeorganizationbox()">
<input matInput id="linkphone" name="linkphone" type='text' #linkphone="ngModel"
required
pattern="^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35-8]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0135-9]\d{2}|66\d{2})\d{6}$"
[(ngModel)]="unitinfo.phone" (focus)="closeorganizationbox()">
</mat-form-field>
<!-- <div *ngIf="linkphone.invalid && (linkphone.dirty || linkphone.touched)"
<div *ngIf="linkphone.invalid && (linkphone.dirty || linkphone.touched)"
class="alert-danger">
<div *ngIf="linkphone.errors.pattern" class="alert-danger">
电话号码格式不正确
</div>
</div> -->
</div>
</div>
<div class="inputbox longinputbox">
<span style="color: red;">*</span>
@ -262,7 +264,7 @@
(click)="removeline(element.propertyInfos)">
<mat-icon>remove_circle_outline</mat-icon>
</button>
{{item.propertyName}}{{item.physicalUnit? '('+item.physicalUnit+')' : ''}}
{{item.propertyName}}
<span style="color: red;" *ngIf="item.required">*</span>
</th>
</tr>
@ -368,7 +370,7 @@
(click)="removeline(element.propertyInfos)">
<mat-icon>remove_circle_outline</mat-icon>
</button>
{{item.propertyName}}{{item.physicalUnit? '('+item.physicalUnit+')' : ''}}
{{item.propertyName}}
<span style="color: red;" *ngIf="item.required">*</span>
</th>
</tr>

138
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -9,15 +9,18 @@ import { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader, FileItem } from 'ng2-file-upload'
import { AddHouseInfo } from './addhouseinfo.component'
import { DomSanitizer } from '@angular/platform-browser'
import { Injectable } from "@angular/core"
import { filter } from 'rxjs/operators';
import { async } from '@angular/core/testing';
import { MatTableDataSource } from '@angular/material/table';
import { isNgTemplate } from '@angular/compiler';
import * as _ from 'lodash';
import Swiper from 'swiper';
import { LookMaster } from './lookmaster.component'
import { ActivatedRoute } from '@angular/router';
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
declare var AMap: any;
import Viewer from 'viewerjs';
import { IMap, IMarker, IPlaceSearch } from '@src/modules/map/declare/map';
import { MapFactory } from '@src/modules/map/declare/factory';
@Component({
selector: 'app-basicinfo',
templateUrl: './basicinfo.component.html',
@ -26,17 +29,12 @@ import { MapFactory } from '@src/modules/map/declare/factory';
export class BasicinfoComponent implements OnInit {
//查看消防设施统计
dialogRef
seeFirfightingDevice(e) {
e.stopPropagation()
this.dialogRef = this.dialog.open(StatisticsOfFireFightingFacilities, { hasBackdrop: false, position: { right: '55px', top: '165px' } });
this.dialogRef.afterClosed().subscribe();
}
ngOnDestroy(){
this.dialogRef ? this.dialogRef.close() : null
let dialogRef = this.dialog.open(StatisticsOfFireFightingFacilities, { hasBackdrop: false, position: { right: '55px', top: '165px' } });
dialogRef.afterClosed().subscribe();
}
unitinfo: any = {
id: '',
name: '', //单位信息名字
@ -130,11 +128,11 @@ export class BasicinfoComponent implements OnInit {
isMapLabel: boolean
//地图标注位置
markerPosition: any = { x: 0, y: 0 }//单位坐标
map: IMap //地图实例
map: any //地图实例
isGisTopBox: boolean = false//点击位置按钮
isGisTopBoxTwo: boolean = false//点击位置按钮
oldPositionMarker: IMarker //旧位置marker实例
newPositionMarker: IMarker //新位置marker实例
oldPositionMarker: any //旧位置marker实例
newPositionMarker: any //新位置marker实例
newPositionMarkerContent: any =
'<div class="custom-content-marker">' +
@ -153,7 +151,7 @@ export class BasicinfoComponent implements OnInit {
'</div>'
//初始化地图
searchTitle: any//搜索内容
placeSearch: IPlaceSearch//地址搜索类
placeSearch: any//地址搜索类
search() {
this.placeSearch.search(this.searchTitle, (status, result) => {
// 搜索成功时,result即是对应的匹配数据
@ -170,7 +168,7 @@ export class BasicinfoComponent implements OnInit {
}
//初始化地图
labelGis() {
this.map = MapFactory.MapInstance('container', {
this.map = new AMap.Map('container', {
zoom: 12
})
this.map.on('complete', () => {
@ -180,28 +178,33 @@ export class BasicinfoComponent implements OnInit {
var autoOptions = {
input: "tipinput"
};
var auto = MapFactory.AutocompleteInstance(autoOptions,this);
this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类
auto.on("select", (e) => {
this.newPositionMarker.setPosition([e.poi.location.lng, e.poi.location.lat])
this.markerPosition2 = { x: e.poi.location.lng, y: e.poi.location.lat }
this.map.setCenter([e.poi.location.lng, e.poi.location.lat]); //设置地图中心点
});//注册监听,当选中某条记录时会触发
AMap.plugin(['AMap.PlaceSearch', 'AMap.AutoComplete'], () => {
var auto = new AMap.AutoComplete(autoOptions);
this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
auto.on("select", (e) => {
// console.log(e)
// console.log( this.newPositionMarker)
this.newPositionMarker.setPosition([e.poi.location.lng, e.poi.location.lat])
this.markerPosition2 = { x: e.poi.location.lng, y: e.poi.location.lat }
this.map.setCenter([e.poi.location.lng, e.poi.location.lat]); //设置地图中心点
});//注册监听,当选中某条记录时会触发
if (this.isMapLabel) {//如果已经标注单位坐标
// console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x, this.unitinfo.location.y]);
this.oldPositionMarker = MapFactory.MarkerInstance({
position: [this.unitinfo.location.x, this.unitinfo.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
})
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);
} else {
// console.log('未标注单位位置')
this.map.setCity('上海');
}
});
if(this.isMapLabel){//如果已经标注单位坐标
// console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]);
this.oldPositionMarker = new AMap.Marker({
position: [this.unitinfo.location.x,this.unitinfo.location.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-15, -18)
})
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);
}else{
// console.log('未标注单位位置')
this.map.setCity('株洲市');
}
}
markerPosition2
//点击位置按钮
@ -218,11 +221,11 @@ export class BasicinfoComponent implements OnInit {
this.newPositionMarker.setContent(this.oldPositionMarkerContent)
}
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
draggable: true,
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContentBtn,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.add(this.newPositionMarker);
@ -233,24 +236,24 @@ export class BasicinfoComponent implements OnInit {
this.markerPosition2 = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } //获取当前地图中心位置
}
this.newPositionMarker.on('dragend', (e) => {
let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e);
let lnglat = this.map.containerToLngLat(e.pixel)
this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT }
// console.log(`${lnglat.KL},${lnglat.kT}`);
},this)
})
this.newPositionMarker.on('dragging', (e) => {
//console.log('dragging',e)
let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e);
let lnglat = this.map.containerToLngLat(e.pixel)
this.newPositionMarker.setPosition(lnglat);
},this)
})
//点击确定
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'), 'click', (event) => {
this.map.clearMap();
this.isGisTopBox = true
this.isGisTopBoxTwo = false
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition2.x, this.markerPosition2.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.markerPosition = this.markerPosition2
this.map.add(this.newPositionMarker);
@ -260,10 +263,10 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBox = true
this.isGisTopBoxTwo = false
this.map.clearMap();
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -273,10 +276,10 @@ export class BasicinfoComponent implements OnInit {
this.map.clearMap();
this.isGisTopBox = true
this.isGisTopBoxTwo = false
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition2.x, this.markerPosition2.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.markerPosition = this.markerPosition2
this.map.add(this.newPositionMarker);
@ -286,10 +289,10 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBox = true
this.isGisTopBoxTwo = false
this.map.clearMap();
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -307,11 +310,11 @@ export class BasicinfoComponent implements OnInit {
this.map.setCenter(center);
}
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
draggable: true,
position: center,
content: this.newPositionMarkerContentBtn,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.add(this.newPositionMarker);
@ -322,25 +325,25 @@ export class BasicinfoComponent implements OnInit {
this.markerPosition2 = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } //获取当前地图中心位置
}
this.newPositionMarker.on('dragend', (e) => {
let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e)
let lnglat = this.map.containerToLngLat(e.pixel)
this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT }
// console.log(`${lnglat.KL},${lnglat.kT}`);
},this)
})
this.newPositionMarker.on('dragging', (e) => {
//console.log('dragging',e)
let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e)
let lnglat = this.map.containerToLngLat(e.pixel)
this.newPositionMarker.setPosition(lnglat);
},this)
})
//点击确定
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'), 'click', (event) => {
this.isGisTopBox = true
this.isGisTopBoxTwo = false
this.markerPosition = this.markerPosition2
this.map.clearMap();
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.add(this.newPositionMarker);
})
@ -349,10 +352,10 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBoxTwo = false
this.markerPosition = this.markerPosition2
this.map.clearMap();
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.add(this.newPositionMarker);
})
@ -361,10 +364,10 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBox = true
this.isGisTopBoxTwo = false
if (this.markerPosition.x && this.markerPosition.x != 0) {//说明之前标过点
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -375,10 +378,10 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBox = true
this.isGisTopBoxTwo = false
if (this.markerPosition.x && this.markerPosition.x != 0) {//说明之前标过点
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.markerPosition.x, this.markerPosition.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-34, -36)
offset: new AMap.Pixel(-34, -36)
});
this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点
this.map.add(this.newPositionMarker);
@ -591,7 +594,6 @@ export class BasicinfoComponent implements OnInit {
}
}
})
console.log('this.houses',this.houses)
})
}
//点击选项卡
@ -928,7 +930,7 @@ export class BasicinfoComponent implements OnInit {
name: this.unitinfo.name,
usci: value.creditcode,
contacts: value.linkman,
phone: String(value.linkphone),
phone: value.linkphone,
address: value.unitaddress,
imageUrl: this.imgsrc,
location: this.markerPosition,
@ -1045,6 +1047,10 @@ export class BasicinfoComponent implements OnInit {
//提交建筑信息
onSubmitBuildingInfo(value, item, key, invalid) {
// console.log(1,item)
// console.log(2,invalid)
// console.log(3,value)
// console.log(4,this.allunittype)
if (invalid) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';

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

@ -5,8 +5,8 @@
<label class="scorePrompt" *ngIf="selected.value == 3">*总平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 4 || selected.value == 5">*层平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 6">*填写2条以上可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 9">*重点部位、安全出口、外观各自不低于两张图片方可满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10">*保证至少有一个文件可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 9">*外观,室内,安全出口各上传2张图片可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10">*上传2张CAD图片可得满分</label>
</div>
<mat-tab-group style="height: 100%;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">

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

@ -5,7 +5,7 @@
</div>
</div>
<mat-tab-group selectedIndex="10" style="height: 100%;">
<mat-tab-group selectedIndex="9" style="height: 100%;">
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo></app-basicinfo>
@ -51,12 +51,7 @@
<app-uploading-cad></app-uploading-cad>
</ng-template>
</mat-tab>
<mat-tab label="10.特别警示">
<ng-template matTabContent>
<app-special-warning></app-special-warning>
</ng-template>
</mat-tab>
<mat-tab label="11.作战部署">
<mat-tab label="10.作战部署">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
</ng-template>

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

@ -1,5 +1,97 @@
<div class="content" id="firefightingdevicelook">
<mat-tab-group (selectedIndexChange)="selectedChange($event)">
<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;">
</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-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">
@ -25,153 +117,19 @@
<mat-expansion-panel *ngFor="let items of item.facilityItems" disabled [expanded]=items.expanded>
<mat-expansion-panel-header class="expansionheader">
<label class="firstContent">
<mat-checkbox (change)='checkedCompany($event,item,items)' [disabled]='items.isBuiltin'>
</mat-checkbox>
<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)='previewBuildingImg(newItem,items)'>查看图片</a></label>
<label class="totalContent">
<span *ngIf="item.name == '消防水系统' && items.name == '供水管网'">
{{fireProtectionWaterSystem.waterSupplyNetwork.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'">
{{fireProtectionWaterSystem.sprinklerSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'">
{{FireExtinguishingWaterSupplySystem.sprinklerSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'">
{{FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'">
{{FireExtinguishingWaterSupplySystem.firePumpRoom.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它' && items.name == '排烟系统'">
{{other.purgingSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它' && items.name == '灭火器'">
{{other.fireExtinguisher.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它' && items.name == '气体灭火'">
{{other.extinctionUsingGas.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它' && items.name == '消防通信'">
{{other.fireControlCommunication.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防设施' && items.name == '自动报警系统'">
{{fireFightingEquipment.automaticAlarmSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防设施' && items.name == '消防泵'">
{{fireFightingEquipment.firePump.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'">
{{hydrantSystem.fireExtinguishingAgent.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '报警设施'">
{{hydrantSystem.AlarmFacilities.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '消防管网'">
{{hydrantSystem.FireControlPipeNetwork.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它设施' && items.name == '优先广播'">
{{otherFacilities.givePriorityToBroadcast.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'">
{{otherFacilities.VIdetector.total || '总数:0'}}
</span>
<span *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'">
{{otherFacilities.foamWaterSpraySystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'">
{{automaticFireProtectionFacility.fireSprinklingSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'">
{{automaticFireProtectionFacility.automaticAlarmSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'">
{{automaticFireProtectionFacility.smokeControlAndExhaustSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'">
{{automaticFireProtectionFacility.waterCurtainSystem.total || '总数:0'}}
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '消防泵'">
{{automaticFireProtectionFacility.firePump.total || '总数:0'}}
</span>
<span *ngIf="item.name == '消防水源' && items.name == '消防水池'">
{{fireWaterSupply.firePool.total || '总数:0'}}
</span>
<span
*ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))">
{{items.total ? items.total : '总数: 0'}}
</span>
</label>
<label class="textContent"><a href="javascript:void(0)" (click)='previewBuildingImg(newItem,items)'>查看图片</a></label>
<label class="totalContent">{{items.total ? items.total : '总数: 0'}}</label>
<label class="lastTextContent">
<textarea *ngIf="item.name == '消防水系统' && items.name == '供水管网'" maxlength="250"
[(ngModel)]="fireProtectionWaterSystem.waterSupplyNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'" maxlength="250"
[(ngModel)]="fireProtectionWaterSystem.sprinklerSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'" maxlength="250"
[(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'" maxlength="250"
[(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'" maxlength="250"
[(ngModel)]="FireExtinguishingWaterSupplySystem.firePumpRoom.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '排烟系统'" maxlength="250"
[(ngModel)]="other.purgingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '灭火器'" maxlength="250"
[(ngModel)]="other.fireExtinguisher.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '气体灭火'" maxlength="250"
[(ngModel)]="other.extinctionUsingGas.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '消防通信'" maxlength="250"
[(ngModel)]="other.fireControlCommunication.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '自动报警系统'" maxlength="250"
[(ngModel)]="fireFightingEquipment.automaticAlarmSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '消防泵'" maxlength="250"
[(ngModel)]="fireFightingEquipment.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'" maxlength="250"
[(ngModel)]="hydrantSystem.fireExtinguishingAgent.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '报警设施'" maxlength="250"
[(ngModel)]="hydrantSystem.AlarmFacilities.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '消防管网'" maxlength="250"
[(ngModel)]="hydrantSystem.FireControlPipeNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '优先广播'" maxlength="250"
[(ngModel)]="otherFacilities.givePriorityToBroadcast.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'" maxlength="250"
[(ngModel)]="otherFacilities.VIdetector.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'" maxlength="250"
[(ngModel)]="otherFacilities.foamWaterSpraySystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '消防泵'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水源' && items.name == '消防水池'" maxlength="250"
[(ngModel)]="fireWaterSupply.firePool.details" style="width: 80%;"></textarea>
<textarea maxlength="250" [(ngModel)]="items.details" style="width: 80%;"
*ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))"></textarea>
<textarea readonly maxlength="250" [(ngModel)]="items.details" style="width:98%;"></textarea>
</label>
<!-- <label><mat-icon (click)='SwitchBuildingBoard(newItem,items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label> -->
</mat-expansion-panel-header>
<div class="overflowTable">
<div class="detailsTable">
<table>
@ -184,8 +142,7 @@
</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>
<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>
@ -197,7 +154,7 @@
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
@ -213,16 +170,12 @@
<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">
<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-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>
@ -234,4 +187,4 @@
</mat-tab>
</mat-tab-group>
</div>
</div>

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

@ -1,10 +1,10 @@
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'
import {HttpClient, HttpHeaders} from '@angular/common/http'
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ImgsDataDetail2 } from './addGrouping.component'
import { MatSnackBarConfig, MatSnackBar } from '@angular/material/snack-bar';
import { ImagesData2 } from './imagesdata.component'
import { Router, ActivatedRoute } from '@angular/router'
import { Router,ActivatedRoute } from '@angular/router'
export interface Food {
@ -18,7 +18,7 @@ export interface Food {
})
export class FireFightingDeviceLookComponent implements OnInit {
constructor(private router: Router, private route: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar) { }
constructor(private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
@ -26,42 +26,78 @@ export class FireFightingDeviceLookComponent implements OnInit {
}
//定义属性数据
singleElection: Food[] = [
{ value: 'true', name: '有' },
{ value: 'false', name: '无' }]
singleElection:Food[]=[
{value:'true', name: '有'},
{value:'false', name: '无'}]
companyBuiltInGrouping: any = []; //单位消防设施内置分组
companyDetails: any = []; //单位详情
companyEachDetails: any = [] //单位每层详情
companyOptionalGrouping: any = []; //单位消防设施可选分组
companyBuiltInGrouping:any = []; //单位消防设施内置分组
companyDetails:any = []; //单位详情
companyEachDetails:any = [] //单位每层详情
companyOptionalGrouping:any = []; //单位消防设施可选分组
//获得单位基本信息
getCompanyInformation() {
let companyId = this.route.snapshot.queryParams.id
this.http.get(`/api/Companies/${companyId}`).subscribe((data: any) => {
getCompanyInformation () {
let companyId = this.route.snapshot.queryParams.id
this.http.get(`/api/Companies/${companyId}`).subscribe((data:any)=>{
if (data.buildingTypes.length) {
let newData = { buildingType: data.buildingTypes[0].id, companyId: companyId }
this.http.get('/api/CompanyFacilities', { params: newData }).subscribe((data: any) => { //获得单位的消防设施
let newData = {buildingType: data.buildingTypes[0].id,companyId : companyId}
this.http.get('/api/CompanyFacilities',{params:newData}).subscribe((data:any)=>{ //获得单位的消防设施
this.companyBuiltInGrouping = data[0].summary.companyFacilityGroups
this.companyOptionalGrouping = data[0].summary.companyOptionalGroups
this.companyDetails = data[0].details
this.companyEachDetails = data[0].eachDetails
this.companyBuiltInGrouping.forEach(element => { //循环单位内置分组项
element.selectBuiltInGrouping = []
element.facilityItems.forEach((elements, index) => {
element.facilityItems.forEach((elements,index) => {
elements.total = element.facilityCount[index]
elements.expanded = false
});
elements.expanded = false});
});
if(sessionStorage.getItem("tabsindex") == "4"){
this.companyBuiltInGrouping = [this.companyBuiltInGrouping[1]]
this.companyOptionalGrouping = []
}
if(sessionStorage.getItem("tabsindex") == "5"){
this.companyBuiltInGrouping.splice(1,1)
}
}) //http
} //if
})
}
//创建单位消防设施内置分组项
addCompanyGrouping (e) {
let data = e
let dialogRef = this.dialog.open(ImagesData2,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data) { e.facilityItems.push(data) } });
}
//保存单位消防设施内置分组项
editCompanyGrouping(e) {
let header = {groupId:e.id}
let data = []
e.facilityItems.forEach((element,index) => {
let msg = {
isBuiltin: element.isBuiltin,
details: element.details,
name: element.name,
isEachFloor: element.isEachFloor,
order: element.order}
data.push(msg)
if (index==e.facilityItems.length-1) {
this.http.post('/api/CompanyFacilityItems/Batch',data,{params:header}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
}) }
}); //forEach
}
//checked单位消防设施内置分组项时
checkedCompany(e, item, items) {
checkedCompany (e,item,items) {
if (e.checked) {
item.selectBuiltInGrouping.push(items)
} else {
@ -69,9 +105,53 @@ export class FireFightingDeviceLookComponent implements OnInit {
}
}
//删除消防设施内置分组项
deleteCompanyGrouping (e) {
if (e.selectBuiltInGrouping.length) {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
let msg:any = `?groupId=${e.id}`
e.selectBuiltInGrouping.forEach((element,index) => {
let data = `&name=${element.name}`
msg = msg + data
if (index === e.selectBuiltInGrouping.length-1) {
this.http.delete('/api/CompanyFacilityItems/Batch' + msg).subscribe(data=>{
let deleteMsg = e.selectBuiltInGrouping
deleteMsg.forEach(deleteElement => {
e.facilityItems.splice(e.facilityItems.findIndex(item=>item.name==deleteElement.name),1)
});
e.selectBuiltInGrouping = []
}) //http
} //if
}); //forEach
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择内置分组项','确定',config);
}
}
//保存单位消防设施可选分组
editCompanyOptional (e,item) {
e.stopPropagation() //阻止冒泡
item.propertyInfos.forEach((element,index) => {
element.propertyValue = String(element.propertyValue)
if (index == item.propertyInfos.length-1 ) {
this.http.post('/api/CompanyOptionalGroups',item).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
} //if
});
}
//单位消防设施切换展开面板
SwitchBoard(e) {
SwitchBoard (e) {
e.expanded = !e.expanded
if (e.expanded) { //展开面板展开时
if (e.isEachFloor) { //逐层统计时
@ -79,30 +159,26 @@ export class FireFightingDeviceLookComponent implements OnInit {
if (data) {
e.loopTable = []
data.forEach(item => {
let tableMsg = { name: item.name, header: [], body: [] }
let tableMsg = {name:item.name, header:[], body:[]}
item.assets[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
tableMsg.header.push(element.propertyName + unit)
}
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
tableMsg.header.push(element.propertyName+unit)}
});
item.assets.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
}); //propertyInfos
tableMsg.body.push(everyBody)
@ -113,32 +189,28 @@ export class FireFightingDeviceLookComponent implements OnInit {
} //data有数据时
} else { //非逐层统计时
let data = this.companyDetails[e.name]
if (data) {
if (data) {
e.header = []
e.body = []
data[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
e.header.push(element.propertyName + unit)
}
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
e.header.push(element.propertyName+unit)}
});
data.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
});
e.body.push(everyBody)
@ -154,268 +226,138 @@ export class FireFightingDeviceLookComponent implements OnInit {
allBuildingGrouping: any; //所有建筑的消防设施 内置分组+可选分组
allBuildingGrouping:any; //所有建筑的消防设施 内置分组+可选分组
//获取所有建筑
getAllBuilding() {
let companyId = this.route.snapshot.queryParams.id
this.http.get('/api/Buildings', {
params: {
companyId: companyId
}
}).subscribe((data: any) => {
getAllBuilding () {
let companyId = this.route.snapshot.queryParams.id
this.http.get('/api/Buildings',{params:{
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);
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}
//获取所有建筑的消防设施
getAllBuildingFacilities () {
let companyId = this.route.snapshot.queryParams.id
this.allBuildingGrouping.forEach(element => {
let header = {buildingId: element.id, buildingType: element.buildingTypes[0].id,companyId:companyId}
this.http.get('/api/BuildingFacilities',{params:header}).subscribe(data=>{
element.buildingFacilityGroups = data[0].summary.buildingFacilityGroups
element.buildingOptionalGroups = data[0].summary.buildingOptionalGroups
element.buildingDetails = data[0].details
element.buildingEachDetails = data[0].eachDetails
element.buildingFacilityGroups.forEach((elements) => { //循环每个建筑内置分组项
elements.selectBuiltInGrouping = []
elements.facilityItems.forEach((newElement,index) => {
newElement.total = elements.facilityCount[index]
newElement.expanded = false });
});
//消防水系统
fireProtectionWaterSystem = {
waterSupplyNetwork: { name: '供水管网', total: '', details: '' },//供水管网
sprinklerSystem: { name: '自动喷水灭火系统', total: '', details: '' }//自动喷水灭火系统
}
//消防灭火给水系统
FireExtinguishingWaterSupplySystem = {
sprinklerSystem: { name: '自动喷水灭火系统', total: '', details: '' },//自动喷水灭火系统
AutomaticGasFireExtinguishingSystem: { name: '气体自动灭火系统', total: '', details: '' },//气体自动灭火系统
firePumpRoom: { name: '消防泵房', total: '', details: '' }//消防泵房
}
//其它
other = {
purgingSystem: { name: '排烟系统', total: '', details: '' },//排烟系统
fireExtinguisher: { name: '灭火器', total: '', details: '' },//灭火器
extinctionUsingGas: { name: '气体灭火', total: '', details: '' },//气体灭火
fireControlCommunication: { name: '消防通信', total: '', details: '' }//消防通信
}
//消防设施
fireFightingEquipment = {
automaticAlarmSystem: { name: '自动报警系统', total: '', details: '' },//自动报警系统
firePump: { name: '消防泵', total: '', details: '' }//消防泵
}
//消火栓系统
hydrantSystem = {
fireExtinguishingAgent: { name: '灭火剂', total: '', details: '' },//灭火剂
AlarmFacilities: { name: '报警设施', total: '', details: '' },//报警设施
FireControlPipeNetwork: { name: '消防管网', total: '', details: '' }//消防管网
}
//其它设施
otherFacilities = {
givePriorityToBroadcast: { name: '优先广播', total: '', details: '' },//优先广播
VIdetector: { name: 'VI检测仪', total: '', details: '' },//VI检测仪
foamWaterSpraySystem: { name: '泡沫水喷雾系统', total: '', details: '' },//泡沫水喷雾系统
}
//自动消防设施
automaticFireProtectionFacility = {
fireSprinklingSystem: { name: '喷水灭火系统', total: '', details: '' },//喷水灭火系统
automaticAlarmSystem: { name: '自动报警系统', total: '', details: '' },//自动报警系统
smokeControlAndExhaustSystem: { name: '防排烟系统', total: '', details: '' },//防排烟系统
waterCurtainSystem: { name: '水幕系统', total: '', details: '' },//水幕系统
firePump: { name: '消防泵', total: '', details: '' }//消防泵
}
//消防水源
fireWaterSupply = {
firePool: { name: '消防水池', total: '', details: '' }//消防水池
}
if(sessionStorage.getItem("tabsindex") == "4"){
element.buildingFacilityGroups = [element.buildingFacilityGroups[1]]
element.buildingOptionalGroups = []
}
if(sessionStorage.getItem("tabsindex") == "5"){
element.buildingFacilityGroups.splice(1,1)
}
})
});
//获得当前建筑的手动输入值
FacilityStat: any//存放当前建筑手动输入的值
selectedChange($event) {
//获得手动输入的值
this.http.get('/api/BuildingFacilities/FacilityStat', {
params: {
buildingId: this.allBuildingGrouping[$event].id
}
}).subscribe(data => {
this.FacilityStat = data
this.changeData()
})
}
//创建建筑消防设施内置分组项
addBuildingGrouping (e,item) {
let data = {buildingId: e.id, item}
let dialogRef = this.dialog.open(ImgsDataDetail2,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data) { item.facilityItems.push(data) }
});
}
//获取所有建筑的消防设施
async getAllBuildingFacilities() {
let companyId = this.route.snapshot.queryParams.id
let index = 0
for (let index = 0; index < this.allBuildingGrouping.length; index++) {
const element = this.allBuildingGrouping[index];
let header = { buildingId: element.id, buildingType: element.buildingTypes[0].id, companyId: companyId }
await new Promise<void>((resolve, reject) => {
this.http.get('/api/BuildingFacilities', { params: header }).subscribe(data => {
element.buildingFacilityGroups = data[0].summary.buildingFacilityGroups
element.buildingOptionalGroups = data[0].summary.buildingOptionalGroups
element.buildingDetails = data[0].details
element.buildingEachDetails = data[0].eachDetails
element.buildingFacilityGroups.forEach((elements) => { //循环每个建筑内置分组项
elements.selectBuiltInGrouping = []
elements.facilityItems.forEach((newElement, index) => {
newElement.total = elements.facilityCount[index]
newElement.expanded = false
});
});
// console.log(element.name, data)
resolve()
}, err => {
console.log(element.name + '消防设施网络获取失败', err)
})
})
}
//保存建筑消防设施内置分组项
editBuildingGrouping (e,item) {
let companyId = this.route.snapshot.queryParams.id
let header = {companyId:companyId,buildingId:e.id, groupId:item.id}
let data = []
item.facilityItems.forEach((element,index) => {
let msg = {
isBuiltin: element.isBuiltin,
details: element.details,
name: element.name,
isEachFloor: element.isEachFloor,
order: element.order}
data.push(msg)
if (index==item.facilityItems.length-1) {
this.http.post('/api/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
}) }
}); //forEach
}
//清空手动输入的值
emptyData() {
this.fireProtectionWaterSystem = {
waterSupplyNetwork: { name: '供水管网', total: '', details: '' },//供水管网
sprinklerSystem: { name: '自动喷水灭火系统', total: '', details: '' }//自动喷水灭火系统
}
this.FireExtinguishingWaterSupplySystem = {
sprinklerSystem: { name: '自动喷水灭火系统', total: '', details: '' },//自动喷水灭火系统
AutomaticGasFireExtinguishingSystem: { name: '气体自动灭火系统', total: '', details: '' },//气体自动灭火系统
firePumpRoom: { name: '消防泵房', total: '', details: '' }//消防泵房
}
this.other = {
purgingSystem: { name: '排烟系统', total: '', details: '' },//排烟系统
fireExtinguisher: { name: '灭火器', total: '', details: '' },//灭火器
extinctionUsingGas: { name: '气体灭火', total: '', details: '' },//气体灭火
fireControlCommunication: { name: '消防通信', total: '', details: '' }//消防通信
}
this.fireFightingEquipment = {
automaticAlarmSystem: { name: '自动报警系统', total: '', details: '' },//自动报警系统
firePump: { name: '消防泵', total: '', details: '' }//消防泵
}
this.hydrantSystem = {
fireExtinguishingAgent: { name: '灭火剂', total: '', details: '' },//灭火剂
AlarmFacilities: { name: '报警设施', total: '', details: '' },//报警设施
FireControlPipeNetwork: { name: '消防管网', total: '', details: '' }//消防管网
}
this.otherFacilities = {
givePriorityToBroadcast: { name: '优先广播', total: '', details: '' },//优先广播
VIdetector: { name: 'VI检测仪', total: '', details: '' },//VI检测仪
foamWaterSpraySystem: { name: '泡沫水喷雾系统', total: '', details: '' },//泡沫水喷雾系统
}
this.automaticFireProtectionFacility = {
fireSprinklingSystem: { name: '喷水灭火系统', total: '', details: '' },//喷水灭火系统
automaticAlarmSystem: { name: '自动报警系统', total: '', details: '' },//自动报警系统
smokeControlAndExhaustSystem: { name: '防排烟系统', total: '', details: '' },//防排烟系统
waterCurtainSystem: { name: '水幕系统', total: '', details: '' },//水幕系统
firePump: { name: '消防泵', total: '', details: '' }//消防泵
}
this.fireWaterSupply = {
firePool: { name: '消防水池', total: '', details: '' }//消防水池
//删除建筑消防设施内置分组项
deleteBuildingGrouping (e,item) {
if (item.selectBuiltInGrouping.length) {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
let msg:any = `?buildingId=${e.id}&groupId=${item.id}`
item.selectBuiltInGrouping.forEach((element,index) => {
let data = `&name=${element.name}`
msg = msg + data
if (index === item.selectBuiltInGrouping.length-1) {
this.http.delete('/api/BuildingFacilityItems/Batch'+msg).subscribe(data=>{
let deleteMsg = item.selectBuiltInGrouping
deleteMsg.forEach(deleteElement => {
item.facilityItems.splice(item.facilityItems.findIndex(items=>items.name==deleteElement.name),1)
});
item.selectBuiltInGrouping = []
}) //http
} //if
}) //forEach
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择内置分组项','确定',config);
}
}
//将数据库获取的手动输入的值变成指定形式
changeData() {
this.emptyData();
this.FacilityStat.length != 0 ?
this.FacilityStat.forEach(element => {
if (element.groupName == '消防水系统') {
if (element.facilityName == '供水管网') {
this.fireProtectionWaterSystem.waterSupplyNetwork.total = element.count
this.fireProtectionWaterSystem.waterSupplyNetwork.details = element.description
} else if (element.facilityName == '自动喷水灭火系统') {
this.fireProtectionWaterSystem.sprinklerSystem.total = element.count
this.fireProtectionWaterSystem.sprinklerSystem.details = element.description
}
} else if (element.groupName == '消防灭火给水系统') {
if (element.facilityName == '自动喷水灭火系统') {
this.FireExtinguishingWaterSupplySystem.sprinklerSystem.total = element.count
this.FireExtinguishingWaterSupplySystem.sprinklerSystem.details = element.description
} else if (element.facilityName == '气体自动灭火系统') {
this.FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.total = element.count
this.FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.details = element.description
} else if (element.facilityName == '消防泵房') {
this.FireExtinguishingWaterSupplySystem.firePumpRoom.total = element.count
this.FireExtinguishingWaterSupplySystem.firePumpRoom.details = element.description
}
} else if (element.groupName == '其它') {
if (element.facilityName == '排烟系统') {
this.other.purgingSystem.total = element.count
this.other.purgingSystem.details = element.description
} else if (element.facilityName == '灭火器') {
this.other.fireExtinguisher.total = element.count
this.other.fireExtinguisher.details = element.description
} else if (element.facilityName == '气体灭火') {
this.other.extinctionUsingGas.total = element.count
this.other.extinctionUsingGas.details = element.description
} else if (element.facilityName == '消防通信') {
this.other.fireControlCommunication.total = element.count
this.other.fireControlCommunication.details = element.description
}
} else if (element.groupName == '消防设施') {
if (element.facilityName == '自动报警系统') {
this.fireFightingEquipment.automaticAlarmSystem.total = element.count
this.fireFightingEquipment.automaticAlarmSystem.details = element.description
} else if (element.facilityName == '消防泵') {
this.fireFightingEquipment.firePump.total = element.count
this.fireFightingEquipment.firePump.details = element.description
}
} else if (element.groupName == '消火栓系统') {
if (element.facilityName == '灭火剂') {
this.hydrantSystem.fireExtinguishingAgent.total = element.count
this.hydrantSystem.fireExtinguishingAgent.details = element.description
} else if (element.facilityName == '报警设施') {
this.hydrantSystem.AlarmFacilities.total = element.count
this.hydrantSystem.AlarmFacilities.details = element.description
} else if (element.facilityName == '消防管网') {
this.hydrantSystem.FireControlPipeNetwork.total = element.count
this.hydrantSystem.FireControlPipeNetwork.details = element.description
}
} else if (element.groupName == '其它设施') {
if (element.facilityName == '优先广播') {
this.otherFacilities.givePriorityToBroadcast.total = element.count
this.otherFacilities.givePriorityToBroadcast.details = element.description
} else if (element.facilityName == 'VI检测仪') {
this.otherFacilities.VIdetector.total = element.count
this.otherFacilities.VIdetector.details = element.description
} else if (element.facilityName == '泡沫水喷雾系统') {
this.otherFacilities.foamWaterSpraySystem.total = element.count
this.otherFacilities.foamWaterSpraySystem.details = element.description
}
} else if (element.groupName == '自动消防设施') {
if (element.facilityName == '喷水灭火系统') {
this.automaticFireProtectionFacility.fireSprinklingSystem.total = element.count
this.automaticFireProtectionFacility.fireSprinklingSystem.details = element.description
} else if (element.facilityName == '自动报警系统') {
this.automaticFireProtectionFacility.automaticAlarmSystem.total = element.count
this.automaticFireProtectionFacility.automaticAlarmSystem.details = element.description
} else if (element.facilityName == '防排烟系统') {
this.automaticFireProtectionFacility.smokeControlAndExhaustSystem.total = element.count
this.automaticFireProtectionFacility.smokeControlAndExhaustSystem.details = element.description
} else if (element.facilityName == '水幕系统') {
this.automaticFireProtectionFacility.waterCurtainSystem.total = element.count
this.automaticFireProtectionFacility.waterCurtainSystem.details = element.description
} else if (element.facilityName == '消防泵') {
this.automaticFireProtectionFacility.firePump.total = element.count
this.automaticFireProtectionFacility.firePump.details = element.description
}
} else if (element.groupName == '消防水源') {
if (element.facilityName == '消防水池') {
this.fireWaterSupply.firePool.total = element.count
this.fireWaterSupply.firePool.details = element.description
}
}
}) : null
console.log(5888, this.FacilityStat)
//保存建筑消防设施可选分组
editBuildingOptional (e,item) {
let companyId = this.route.snapshot.queryParams.id
e.stopPropagation() //阻止冒泡
item.propertyInfos.forEach((element,index) => {
element.propertyValue = String(element.propertyValue)
if (index == item.propertyInfos.length-1 ) {
this.http.post('/api/BuildingOptionalGroups',item,{params:{
companyId :companyId
}}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
} //if
});
}
//建筑消防设施切换展开面板
SwitchBuildingBoard(item, e) {
SwitchBuildingBoard (item,e) {
e.expanded = !e.expanded
if (e.expanded) { //展开面板展开时
if (e.isEachFloor) { //逐层统计时
@ -423,66 +365,58 @@ export class FireFightingDeviceLookComponent implements OnInit {
if (data) {
e.loopTable = []
data.forEach(item => {
let tableMsg = { name: item.name, header: [], body: [] }
let tableMsg = {name:item.name, header:[], body:[]}
item.assets[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
tableMsg.header.push(element.propertyName + unit)
}
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
tableMsg.header.push(element.propertyName+unit)}
});
item.assets.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
}); //propertyInfos
tableMsg.body.push(everyBody)
}); //assets
e.loopTable.push(tableMsg)
});
} //data有数据时
} else { //非逐层统计时
let data = item.buildingDetails[e.name]
if (data) {
if (data) {
e.header = []
e.body = []
data[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
e.header.push(element.propertyName + unit)
}
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
e.header.push(element.propertyName+unit)}
});
data.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
});
e.body.push(everyBody)
@ -496,141 +430,131 @@ export class FireFightingDeviceLookComponent implements OnInit {
}
}
//单位消防设施预览图片
previewImg(e) {
previewImg (e) {
if (e.isEachFloor) { //逐层统计时
let newData = this.companyEachDetails[e.name]
if (newData) {
let data = { name: e.name, images: [] }
let imgName
let data = {name:e.name, images:[]}
let imgName
newData.forEach(item => {
item.assets.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
elements.propertyName = imgName
data.images.push(elements)
}
});
element.propertyInfos.forEach( elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)} });
});
}); //newDate
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { data }); //打开图片弹窗
let dialogRef = this.dialog.open(ImagesData2,{data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
this.snackBar.open('暂无图片数据','确定',config);
}
} else {
} else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
this.snackBar.open('暂无图片数据','确定',config); }
} else { //非逐层统计时
let newData = this.companyDetails[e.name]
let imgName
let imgName
if (newData) {
let data = { name: e.name, images: [] }
let data = {name:e.name, images:[]}
newData.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)
}
});
data.images.push(elements)} });
});
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { data }); //打开图片弹窗
let dialogRef = this.dialog.open(ImagesData2,{data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
this.snackBar.open('暂无图片数据','确定',config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
this.snackBar.open('暂无图片数据','确定',config); }
}
}
//建筑消防设施预览图片
previewBuildingImg(item, e) {
previewBuildingImg (item,e) {
if (e.isEachFloor) { //逐层统计时
let newData = item.buildingEachDetails[e.name]
if (newData) {
let data = { name: e.name, images: [] }
let data = {name:e.name, images:[]}
let imgName
newData.forEach(item => {
item.assets.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
elements.propertyName = imgName
data.images.push(elements)
}
});
element.propertyInfos.forEach( elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)} });
});
}); //newDate
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { data }); //打开图片弹窗
let dialogRef = this.dialog.open(ImagesData2,{data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
this.snackBar.open('暂无图片数据','确定',config);
}
} else {
} else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
this.snackBar.open('暂无图片数据','确定',config); }
} else { //非逐层统计时
let newData = item.buildingDetails[e.name]
let imgName
let imgName
if (newData) {
let data = { name: e.name, images: [] }
let data = {name:e.name, images:[]}
newData.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)
}
});
data.images.push(elements)}
});
});
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { data }); //打开图片弹窗
let dialogRef = this.dialog.open(ImagesData2,{data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
this.snackBar.open('暂无图片数据','确定',config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
this.snackBar.open('暂无图片数据','确定',config); }
}
}
}

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

@ -1,15 +1,110 @@
<div class="content" id="firefightingdevice">
<mat-tab-group (selectedIndexChange)="selectedChange($event)">
<mat-tab-group (selectedIndexChange)="selectedChange($event)">
<!-- <mat-tab style="display: none;" 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">
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of newItem.buildingFacilityGroups">
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<div style="margin-bottom: 10px;">
<mat-icon title="创建" (click)='addBuildingGrouping(newItem,item)'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editBuildingGrouping(newItem,item)'>description
</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='deleteBuildingGrouping(newItem,item)'>delete
</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editBuildingGrouping(newItem,item)'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='deleteBuildingGrouping(newItem,item)'>delete</mat-icon>
</div>
<div>
<mat-accordion multi>
@ -26,160 +121,124 @@
<mat-expansion-panel *ngFor="let items of item.facilityItems" disabled [expanded]=items.expanded>
<mat-expansion-panel-header class="expansionheader">
<label class="firstContent">
<mat-checkbox (change)='checkedCompany($event,item,items)' [disabled]='items.isBuiltin'>
</mat-checkbox>
<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)='previewBuildingImg(newItem,items)'>查看图片</a></label>
<label class="textContent"><a href="javascript:void(0)" (click)='previewBuildingImg(newItem,items)'>查看图片</a></label>
<label class="totalContent">
<span *ngIf="item.name == '消防水系统' && items.name == '供水管网'">
<span *ngIf="item.name == '消防水系统' && items.name == '供水管网'">
<input type="text" value="" [(ngModel)]="fireProtectionWaterSystem.waterSupplyNetwork.total">
</span>
<span *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'">
<span *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'">
<input type="text" value="" [(ngModel)]="fireProtectionWaterSystem.sprinklerSystem.total">
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'">
<input type="text" value=""
[(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.total">
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'">
<input type="text" value="" [(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.total">
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'">
<input type="text" value=""
[(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.total">
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'">
<input type="text" value="" [(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.total">
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'">
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'">
<input type="text" value="" [(ngModel)]="FireExtinguishingWaterSupplySystem.firePumpRoom.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '排烟系统'">
<span *ngIf="item.name == '其它' && items.name == '排烟系统'">
<input type="text" value="" [(ngModel)]="other.purgingSystem.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '灭火器'">
<span *ngIf="item.name == '其它' && items.name == '灭火器'">
<input type="text" value="" [(ngModel)]="other.fireExtinguisher.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '气体灭火'">
<span *ngIf="item.name == '其它' && items.name == '气体灭火'">
<input type="text" value="" [(ngModel)]="other.extinctionUsingGas.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '消防通信'">
<span *ngIf="item.name == '其它' && items.name == '消防通信'">
<input type="text" value="" [(ngModel)]="other.fireControlCommunication.total">
</span>
<span *ngIf="item.name == '消防设施' && items.name == '自动报警系统'">
<span *ngIf="item.name == '消防设施' && items.name == '自动报警系统'">
<input type="text" value="" [(ngModel)]="fireFightingEquipment.automaticAlarmSystem.total">
</span>
<span *ngIf="item.name == '消防设施' && items.name == '消防泵'">
<span *ngIf="item.name == '消防设施' && items.name == '消防泵'">
<input type="text" value="" [(ngModel)]="fireFightingEquipment.firePump.total">
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'">
<span *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'">
<input type="text" value="" [(ngModel)]="hydrantSystem.fireExtinguishingAgent.total">
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '报警设施'">
<span *ngIf="item.name == '消火栓系统' && items.name == '报警设施'">
<input type="text" value="" [(ngModel)]="hydrantSystem.AlarmFacilities.total">
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '消防管网'">
<span *ngIf="item.name == '消火栓系统' && items.name == '消防管网'">
<input type="text" value="" [(ngModel)]="hydrantSystem.FireControlPipeNetwork.total">
</span>
<span *ngIf="item.name == '其它设施' && items.name == '优先广播'">
<span *ngIf="item.name == '其它设施' && items.name == '优先广播'">
<input type="text" value="" [(ngModel)]="otherFacilities.givePriorityToBroadcast.total">
</span>
<span *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'">
<span *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'">
<input type="text" value="" [(ngModel)]="otherFacilities.VIdetector.total">
</span>
<span *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'">
<span *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'">
<input type="text" value="" [(ngModel)]="otherFacilities.foamWaterSpraySystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'">
<input type="text" value=""
[(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.total">
<span *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'">
<input type="text" value=""
[(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.total">
<span *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'">
<input type="text" value=""
[(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.total">
<span *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'">
<input type="text" value=""
[(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.total">
<span *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '消防泵'">
<span *ngIf="item.name == '自动消防设施' && items.name == '消防泵'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.firePump.total">
</span>
<span *ngIf="item.name == '消防水源' && items.name == '消防水池'">
<span *ngIf="item.name == '消防水源' && items.name == '消防水池'">
<input type="text" value="" [(ngModel)]="fireWaterSupply.firePool.total">
</span>
<span
*ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))">
<span *ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))">
{{items.total ? items.total : '总数: 0'}}
</span>
</label>
<label class="lastTextContent">
<textarea *ngIf="item.name == '消防水系统' && items.name == '供水管网'" maxlength="250"
[(ngModel)]="fireProtectionWaterSystem.waterSupplyNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'" maxlength="250"
[(ngModel)]="fireProtectionWaterSystem.sprinklerSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'" maxlength="250"
[(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'" maxlength="250"
[(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'" maxlength="250"
[(ngModel)]="FireExtinguishingWaterSupplySystem.firePumpRoom.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '排烟系统'" maxlength="250"
[(ngModel)]="other.purgingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '灭火器'" maxlength="250"
[(ngModel)]="other.fireExtinguisher.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '气体灭火'" maxlength="250"
[(ngModel)]="other.extinctionUsingGas.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '消防通信'" maxlength="250"
[(ngModel)]="other.fireControlCommunication.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '自动报警系统'" maxlength="250"
[(ngModel)]="fireFightingEquipment.automaticAlarmSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '消防泵'" maxlength="250"
[(ngModel)]="fireFightingEquipment.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'" maxlength="250"
[(ngModel)]="hydrantSystem.fireExtinguishingAgent.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '报警设施'" maxlength="250"
[(ngModel)]="hydrantSystem.AlarmFacilities.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '消防管网'" maxlength="250"
[(ngModel)]="hydrantSystem.FireControlPipeNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '优先广播'" maxlength="250"
[(ngModel)]="otherFacilities.givePriorityToBroadcast.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'" maxlength="250"
[(ngModel)]="otherFacilities.VIdetector.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'" maxlength="250"
[(ngModel)]="otherFacilities.foamWaterSpraySystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.details"
style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '消防泵'" maxlength="250"
[(ngModel)]="automaticFireProtectionFacility.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水源' && items.name == '消防水池'" maxlength="250"
[(ngModel)]="fireWaterSupply.firePool.details" style="width: 80%;"></textarea>
<textarea maxlength="250" [(ngModel)]="items.details" style="width: 80%;"
*ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))"></textarea>
<label class="lastTextContent">
<textarea *ngIf="item.name == '消防水系统' && items.name == '供水管网'" maxlength="250" [(ngModel)]="fireProtectionWaterSystem.waterSupplyNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'" maxlength="250" [(ngModel)]="fireProtectionWaterSystem.sprinklerSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'" maxlength="250" [(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'" maxlength="250" [(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'" maxlength="250" [(ngModel)]="FireExtinguishingWaterSupplySystem.firePumpRoom.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '排烟系统'" maxlength="250" [(ngModel)]="other.purgingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '灭火器'" maxlength="250" [(ngModel)]="other.fireExtinguisher.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '气体灭火'" maxlength="250" [(ngModel)]="other.extinctionUsingGas.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '消防通信'" maxlength="250" [(ngModel)]="other.fireControlCommunication.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '自动报警系统'" maxlength="250" [(ngModel)]="fireFightingEquipment.automaticAlarmSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '消防泵'" maxlength="250" [(ngModel)]="fireFightingEquipment.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'" maxlength="250" [(ngModel)]="hydrantSystem.fireExtinguishingAgent.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '报警设施'" maxlength="250" [(ngModel)]="hydrantSystem.AlarmFacilities.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '消防管网'" maxlength="250" [(ngModel)]="hydrantSystem.FireControlPipeNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '优先广播'" maxlength="250" [(ngModel)]="otherFacilities.givePriorityToBroadcast.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'" maxlength="250" [(ngModel)]="otherFacilities.VIdetector.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'" maxlength="250" [(ngModel)]="otherFacilities.foamWaterSpraySystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '消防泵'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水源' && items.name == '消防水池'" maxlength="250" [(ngModel)]="fireWaterSupply.firePool.details" style="width: 80%;"></textarea>
<textarea maxlength="250" [(ngModel)]="items.details" style="width: 80%;" *ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))"></textarea>
</label>
<!-- <label><mat-icon (click)='SwitchBuildingBoard(newItem,items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label> -->
</mat-expansion-panel-header>
<div class="overflowTable">
<div class="detailsTable">
<table>
@ -192,8 +251,7 @@
</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>
<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>
@ -205,7 +263,7 @@
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
@ -216,25 +274,17 @@
<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)='editBuildingOptional($event,item)'>description
</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editBuildingOptional($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) || items.propertyName == '固定值班电话'"
[(ngModel)]="items.propertyValue" name="propertyValue">
<input type="number"
*ngIf="(items.propertyType == 2 || items.propertyType == 4) && items.propertyName != '固定值班电话'"
[(ngModel)]="items.propertyValue" name="propertyValue">
<textarea maxlength="250" *ngIf="items.propertyType == 1" [(ngModel)]="items.propertyValue"
name="propertyValue"></textarea>
<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-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>

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

File diff suppressed because it is too large Load Diff

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

@ -153,7 +153,19 @@ export class FunctionDivisionLookComponent implements OnInit {
// 没有 创建 建筑功能分区时 自动创建
addVoluntarilyPartition () {
let isFalse = []
this.noDataList.forEach(item=> { item===false? isFalse.push(1) : null })
if (isFalse.length === this.allBuilding.length) { //没有 建筑功能分区时
let data = {
buildingId: this.allBuilding[0].id,
region: "",
area: 0,
details: ""
}
this.http.post('/api/BuildingFunctionalDivisions',data,{params:{companyId : this.route.snapshot.queryParams.id}}).subscribe(data=>{
this.getAllBuilding()
})
} //if
}
//封装函数刷新当前建筑功能分区

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

@ -133,58 +133,41 @@ export class FunctionDivisionComponent implements OnInit {
noDataList = [] //没有 创建功能分区 的建筑
//获得所有建筑的功能分区
async getAllBuildingFunctionalZoning () {
getAllBuildingFunctionalZoning () {
this.selectBuildingFunctionalZoning = []
this.allBuildingFunctionalZoning = []
this.noDataList = []
for (let index = 0; index < this.allBuilding.length; index++) {
const element = this.allBuilding[index];
this.allBuilding.forEach((element,index) => {
let data={buildingId: element.id}
await new Promise((resolve,reject)=>{
this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{
if (data.length) {
element.functionalZoning = data
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
this.allBuildingFunctionalZoning.push(element)
this.noDataList.push(true)
} else {
this.noDataList.push(false)
}
if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() }
resolve(data)
})
})
}
this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{
if (data.length) {
element.functionalZoning = data
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
this.allBuildingFunctionalZoning.push(element)
this.noDataList.push(true)
} else {
this.noDataList.push(false)
}
if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() }
})
});
}
// 没有 创建 建筑功能分区时 自动创建
addVoluntarilyPartition () {
let isNotHave:boolean = false
this.noDataList.forEach(item=> {
if (item === true) {
isNotHave = true
return
let isFalse = []
this.noDataList.forEach(item=> { item===false? isFalse.push(1) : null })
if (isFalse.length === this.allBuilding.length) { //没有 建筑功能分区时
let data = {
buildingId: this.allBuilding[0].id,
region: "",
area: 0,
details: ""
}
})
if (!isNotHave) { //所有建筑都没有 功能分区时
let bodyData = [{
buildingId: this.allBuilding[0].id,
region: "",
area: 0,
details: ""
}]
let params = {buildingId:this.allBuilding[0].id, companyId:this.companyId}
this.http.post('/api/BuildingFunctionalDivisions/Batch',bodyData,{params:params}).subscribe(datas=>{
let newParams = {buildingId: this.allBuilding[0].id}
this.http.get(`/api/BuildingFunctionalDivisions`,{params:newParams}).subscribe((data:any)=>{
this.allBuilding[0].functionalZoning = data
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
this.allBuildingFunctionalZoning.push(this.allBuilding[0])
})
this.http.post('/api/BuildingFunctionalDivisions',data,{params:{companyId : this.route.snapshot.queryParams.id}}).subscribe(data=>{
this.getAllBuilding()
})
}
} //if
}
//封装函数刷新当前建筑功能分区

58
src/app/key-unit/key-unit-management/key-unit-management.component.html

@ -16,8 +16,8 @@
</mat-form-field>
<span *ngIf="padMore" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>更多筛选条件<img
[src]='imgsrcopen'> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;width: 10px;height: 6px;"
(click)='padInfo()'>收起<img [src]='imgsrcdown'> </span>
<span *ngIf="padput" style="margin-left: 10px; color: #0080FF;" (click)='padInfo()'>收起<img
[src]='imgsrcdown'> </span>
</div>
<div class="queryField" *ngIf="!pcfind">
@ -25,11 +25,11 @@
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
<div class="queryField" *ngIf="!padMore">
<label style="margin-right: 10px;">重点单位:</label>
<label style="margin-right: 10px;">关注单位:</label>
<mat-form-field>
<mat-select placeholder='请选择单位是否为重点' [(ngModel)]="follow" name="follow">
<mat-option value="0">一般单位</mat-option>
<mat-option value="1">重点单位</mat-option>
<mat-select placeholder='请选择单位是否关注' [(ngModel)]="follow" name="follow">
<mat-option value="0">未关注</mat-option>
<mat-option value="1">已关注</mat-option>
</mat-select>
</mat-form-field>
@ -44,11 +44,9 @@
</mat-select>
</mat-form-field>
<span *ngIf="pcMore" style="margin-left: 10px; color: #0080FF; cursor: pointer;"
(click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
(click)='pcInfo()'>更多筛选条件<img [src]='imgsrcopen'> </span>
<span *ngIf="pcput" style="margin-left: 10px; color: #0080FF; cursor: pointer;"
(click)='pcInfo()'>收起<img [src]='imgsrcdown'
style="width: 10px;height: 6px;margin:0 0 3px 2px;"> </span>
(click)='pcInfo()'>收起<img [src]='imgsrcdown'> </span>
</div>
<div class="queryField" *ngIf="pcfind">
<button mat-raised-button color="primary">查询</button>
@ -113,20 +111,12 @@
autocomplete="off">
</mat-form-field>
</div>
<div class="queryField" *ngIf="!padMore&&!pcMore">
<input type="radio" [(ngModel)]="IsNewData"
style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='true'>
<label style="margin-right: 10px;margin-left: 2px;">新增</label>
<input type="radio" [(ngModel)]="IsNewData"
style="height: 16px;width: 16px;position: relative;top: 2px;" name="whgx" [value]='false'>
<label style="margin-right: 10px;margin-left: 2px;">维护更新</label>
</div>
</div>
</form>
</div>
<!-- <mat-divider></mat-divider> -->
<mat-divider></mat-divider>
<div class="body">
<div class="buttonbox">
<button type="button" mat-raised-button color="primary" (click)="createunit()">新增</button>
@ -150,19 +140,12 @@
</th>
<td mat-cell *matCellDef="let element">
<span title="重点单位" *ngIf="element.isFollowed">
<span title="已关注" *ngIf="element.isFollowed">
<mat-icon style="margin-top: 6px;color: red;">star</mat-icon>
</span>
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">单位状态</th>
<td mat-cell *matCellDef="let element">
<span class="add" *ngIf="element.isNewData">新增</span>
<span class="weihu" *ngIf="!element.isNewData">维护更新</span>
</td>
</ng-container>
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">
@ -336,34 +319,19 @@
{{element.modifiedTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="addstate">
<th mat-header-cell *matHeaderCellDef>新增审核</th>
<td mat-cell *matCellDef="let element">
{{element.newVerifyState}}
<!-- {{element.contentVerify==4?'审核通过':element.contentVerify==5?'审核退回':''}} -->
</td>
</ng-container>
<ng-container matColumnDef="weihustate">
<th mat-header-cell *matHeaderCellDef>维护审核</th>
<td mat-cell *matCellDef="let element">
{{element.maintenanceVerifyState}}
</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element" class="operation">
<!-- <span (click)="drill(element)">演练</span> -->
<span (click)="unitdetails(element)">查看详情</span>
<span style="color: blue;margin-left: 4px;"
*ngIf="(element.isNewData && (element.newVerifyState=='未提交审核'||element.newVerifyState=='审核通过'
||element.newVerifyState=='审核退回'))||(!element.isNewData&&(element.maintenanceVerifyState=='审核通过'||element.maintenanceVerifyState=='未提交审核'||element.maintenanceVerifyState=='审核退回'))"
*ngIf="element.contentVerify==null||element.contentVerify.verifyState==-1||element.contentVerify.verifyState==1||element.contentVerify.verifyState==2||element.contentVerify.verifyState==4||element.contentVerify.verifyState==5"
(click)='submitAudit(element)'>提交审核</span>
<span style="color: blue;margin-left: 4px;"
*ngIf="element.contentVerify!=null&&(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3) "
(click)="cancelAudit(element)">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span>
<span (click)="Follow(element)" *ngIf="!element.isFollowed">重点单位</span>
<span (click)="unFollow(element)" *ngIf="element.isFollowed">一般单位</span>
<span (click)="Follow(element)" *ngIf="!element.isFollowed">关注单位</span>
<span (click)="unFollow(element)" *ngIf="element.isFollowed">取消关注</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

28
src/app/key-unit/key-unit-management/key-unit-management.component.scss

@ -92,30 +92,6 @@
}
}
.tablebox{
.add{
cursor:auto;
text-decoration: none;
display: block;
width: 40px;
height: 20px;
background: #1AE2AC;
font-size: 12px;
line-height: 20px;
color: #FFFFFF;
margin-left: 60px;
}
.weihu{
cursor:auto;
text-decoration: none;
display: block;
width: 64px;
height: 20px;
background: #FFC94B;
font-size: 12px;
color: #FFFFFF;
line-height: 20px;
margin-left: 50px;
}
table{
width: 100%;
margin-top: 15px;
@ -177,7 +153,7 @@
//完整度
.integrityDiv{
width: 180px;
height: 18px;
height: 30px;
background-color: #e2e7ee;
margin: 0 auto;
position: relative;
@ -188,7 +164,7 @@
transform: translate(-50%, -50%);
color: black;
font-weight: 800;
font-size: 13px;
font-size: 15px;
cursor: default;
}
.integrityColorDiv{

1496
src/app/key-unit/key-unit-management/key-unit-management.component.ts

File diff suppressed because it is too large Load Diff

2
src/app/key-unit/key-unit-management/resultcompanyPlan.html

@ -11,7 +11,7 @@
</div>
<div class="auditDiv">
<p>单位名称:{{planName}}</p>
<p>预案名称:{{planName}}</p>
<p>提交时间:{{createTime| date:'yyyy-MM-dd HH:mm:ss'||''}}</p>
<p>发起申请:{{organizationName ||''}}</p>
<mat-divider></mat-divider>

119
src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.html

@ -1,119 +0,0 @@
<h2 mat-dialog-title>演练记录</h2>
<div class="box">
<div class="contentItem">
<div class="title">
单位信息
</div>
<div class="content">
<div class="textbox">
<span class="name">单位名称:</span>
<span>{{data.unitInfo.name}}</span>
</div>
<div class="textbox">
<span class="name">单位地址:</span>
<span>{{data.unitInfo.address}}</span>
</div>
<div class="textbox">
<span class="name">联系人:</span>
<span>{{data.unitInfo.contacts}}</span>
</div>
<div class="textbox">
<span class="name">联系电话:</span>
<span>{{data.unitInfo.phone}}</span>
</div>
</div>
</div>
<div class="contentItem">
<div class="title">
调研人员
</div>
<div class="content peoplecontent">
<div>
<span class="name">带队人员:</span>
<input [disabled]="!isEditMode" name="teamLeader" [(ngModel)]="teamLeader" nz-input
placeholder="带队人员" />
</div>
<div>
<span class="name">熟悉时间:</span>
<nz-range-picker [disabled]="!isEditMode" [nzShowTime]="{ nzFormat: 'HH:mm' }"
nzFormat="yyyy-MM-dd HH:mm" [nzPlaceHolder]="['开始时间', '结束时间']" name="time"
[(ngModel)]="time"></nz-range-picker>
</div>
<div>
<span class="name">调研照片:</span>
<div class="uploadbox">
<input *ngIf="isEditMode" type="file" (change)="upload($event,'调研')">
<button *ngIf="isEditMode" nz-button nzType="default">上传照片</button>
<ul class="imgbox">
<li *ngFor="let item of surveyPhoto;let key = index"><img [src]="item" alt=""
(click)="viewImg(item)">
<span *ngIf="isEditMode" class="close material-icons" (click)="deleteImg(surveyPhoto,key)">
cancel
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="contentItem">
<div class="title">
熟悉内容
</div>
<div class="content photocontent">
<div>
<span class="name">水源照片:</span>
<div class="uploadbox">
<input *ngIf="isEditMode" type="file" (change)="upload($event,'水源')">
<button *ngIf="isEditMode" nz-button nzType="default">上传照片</button>
<ul class="imgbox">
<li *ngFor="let item of waterPhoto;let key = index"><img [src]="item" alt=""
(click)="viewImg(item)">
<span *ngIf="isEditMode" class="close material-icons" (click)="deleteImg(waterPhoto,key)">
cancel
</span>
</li>
</ul>
</div>
</div>
<div>
<span class="name">疏散通道:</span>
<div class="uploadbox">
<input *ngIf="isEditMode" type="file" (change)="upload($event,'疏散通道')">
<button *ngIf="isEditMode" nz-button nzType="default">上传照片</button>
<ul class="imgbox">
<li *ngFor="let item of routePhoto;let key = index"><img [src]="item" alt=""
(click)="viewImg(item)">
<span *ngIf="isEditMode" class="close material-icons" (click)="deleteImg(routePhoto,key)">
cancel
</span>
</li>
</ul>
</div>
</div>
<div>
<span class="name">消控室:</span>
<div class="uploadbox">
<input *ngIf="isEditMode" type="file" (change)="upload($event,'消控室')">
<button *ngIf="isEditMode" nz-button nzType="default">上传照片</button>
<ul class="imgbox">
<li *ngFor="let item of fireControlPhoto;let key = index"><img [src]="item" alt=""
(click)="viewImg(item)">
<span *ngIf="isEditMode" class="close material-icons"
(click)="deleteImg(fireControlPhoto,key)">
cancel
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="mask" *ngIf="isLoading">
<mat-spinner [diameter]="30"></mat-spinner>
</div>
</div>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close [disabled]="isLoading || isLoadingSave">取消</button>
<button mat-button cdkFocusInitial (click)="save()" [disabled]="isLoading || isLoadingSave">确定</button>
</mat-dialog-actions>

120
src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.scss

@ -1,120 +0,0 @@
.box {
width: 100%;
position: relative;
.contentItem {
display: flex;
margin: 6px 0;
border-bottom: 1px dashed rgb(180, 178, 178);
.title {
width: 75px;
color: #1890ff;
display: flex;
align-items: center;
}
.content {
flex: 1;
display: flex;
flex-wrap: wrap;
div {
margin-bottom: 3px;
.name {
display: inline-block;
width: 70px;
margin-right: 3px;
text-align: right;
}
}
}
.peoplecontent,
.photocontent {
flex-direction: column;
div {
display: flex;
align-items: center;
input,
nz-range-picker {
flex: 1;
}
}
}
.textbox {
height: 32px;
line-height: 32px;
width: 50%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.uploadbox {
position: relative;
display: flex;
align-items: center;
input {
width: 88px;
height: 32px;
position: absolute;
left: 0;
top: 0;
opacity: 0;
z-index: 2;
cursor: pointer;
}
button {
z-index: 1;
cursor: pointer;
}
.imgbox {
height: 100%;
display: flex;
align-items: center;
li {
display: flex;
align-items: center;
position: relative;
}
img {
width: 50px;
height: 50px;
margin: 0 5px;
cursor: pointer;
}
.close{
position: absolute;
right: 0;
top: 0;
font-size: 15px;
cursor: pointer;
}
}
}
}
.mask {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.2);
display: flex;
justify-content: center;
align-items: center;
z-index: 3;
}
}

25
src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { UploadDrillComponent } from './upload-drill.component';
describe('UploadDrillComponent', () => {
let component: UploadDrillComponent;
let fixture: ComponentFixture<UploadDrillComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UploadDrillComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UploadDrillComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

203
src/app/key-unit/key-unit-management/upload-drill/upload-drill.component.ts

@ -1,203 +0,0 @@
import { HttpClient } from "@angular/common/http";
import { Component, OnInit, Inject } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { ObjectsService } from "@src/app/services/objects.service";
import { DatePipe } from "@angular/common";
import { MatSnackBar } from "@angular/material/snack-bar";
import Viewer from "viewerjs";
@Component({
selector: "app-upload-drill",
templateUrl: "./upload-drill.component.html",
styleUrls: ["./upload-drill.component.scss"],
providers: [DatePipe],
})
export class UploadDrillComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<UploadDrillComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private objectsSer: ObjectsService,
private http: HttpClient,
private datePipe: DatePipe,
public snackBar: MatSnackBar
) {}
isEditMode = true;
ngOnInit(): void {
console.log(this.data);
this.isEditMode = this.data.isEditMode;
this.getData();
}
isHttpPost;
getData() {
this.http
.get("/api/DrillRecords", {
params: {
CompanyId: this.data.unitInfo.id,
},
})
.subscribe((data: any) => {
console.log("演练记录数据", data);
if (data.totalCount === 0) {
this.isHttpPost = true;
} else {
this.isHttpPost = false;
let item = data.items[0];
this.drillId = item.id;
this.teamLeader = item.teamLeader;
this.time = [item.startTime, item.endTime];
this.surveyPhoto = JSON.parse(item.images);
this.waterPhoto = JSON.parse(item.waterSource);
this.routePhoto = JSON.parse(item.escapeRoute);
this.fireControlPhoto = JSON.parse(item.fireControlRoom);
}
});
}
surveyPhoto = [
// "../../../../assets/images/yiyuan.png",
// "../../../../assets/images/homeHeader.png",
// "../../../../assets/images/add.png",
]; //调研人员照片
waterPhoto = []; //水源照片
routePhoto = []; //疏散照片
fireControlPhoto = []; //消控室照片
//设置文件路径并上传
postFilePath;
isLoading = false;
async upload(e, type) {
this.isLoading = true;
let file = e.target.files[0] || null; //获取上传的文件
let fileSize = file.size || null; //上传文件的总大小
let shardSize = 5 * 1024 * 1024; //5MB 超过5MB要分块上传
this.postFilePath = "演练记录/" + this.data.unitInfo.id;
if (fileSize >= shardSize) {
await this.postFileByMul(file, type);
} else {
await this.postFile(file, type);
}
this.isLoading = false;
}
//直接上传
async postFile(file: File, type) {
await new Promise((resolve, reject) => {
this.objectsSer.postFile(this.postFilePath, file).subscribe((data) => {
let dataObj = data as any;
let filePath: string = ObjectsService.baseUrl + dataObj.objectName;
this.setFileUrl(type, filePath);
resolve("success");
});
});
}
//分块上传
async postFileByMul(file: File, type) {
await new Promise((resolve, reject) => {
this.objectsSer
.postFile_MultipartUpload(this.postFilePath, file)
.then((value) => {
console.log("分块上传成功", value);
let dataObj = value as any;
this.setFileUrl(type, dataObj.filePath + dataObj.fileName);
resolve("success");
});
});
}
setFileUrl(type, filePath) {
switch (type) {
case "调研":
this.surveyPhoto.push(filePath);
break;
case "水源":
this.waterPhoto.push(filePath);
break;
case "疏散通道":
this.routePhoto.push(filePath);
break;
case "消控室":
this.fireControlPhoto.push(filePath);
break;
}
}
deleteImg(arr, key) {
if (confirm("确认删除此照片吗")) {
arr.splice(key, 1);
}
}
teamLeader;
time;
drillId;
isLoadingSave = false;
save() {
if (!this.isEditMode) {
this.dialogRef.close();
return;
}
if (!this.teamLeader || !this.time) {
this.snackBar.open("请输入带队人员和熟悉时间", "确定", {
verticalPosition: "top",
duration: 3000,
});
return;
}
this.isLoadingSave = true;
let body: any = {
companyId: this.data.unitInfo.id,
teamLeader: this.teamLeader,
startTime: this.datePipe.transform(this.time[0], "yyyy-MM-ddTHH:mm:ss"),
endTime: this.datePipe.transform(this.time[1], "yyyy-MM-ddTHH:mm:ss"),
images: JSON.stringify(this.surveyPhoto),
waterSource: JSON.stringify(this.waterPhoto),
escapeRoute: JSON.stringify(this.routePhoto),
fireControlRoom: JSON.stringify(this.fireControlPhoto),
};
if (this.isHttpPost) {
this.http.post("/api/DrillRecords", body).subscribe((data: any) => {
this.drillId = data.id;
this.isHttpPost = false;
this.isLoadingSave = false;
this.snackBar.open("保存成功", "确定", {
verticalPosition: "top",
duration: 3000,
});
this.dialogRef.close();
});
} else {
body.id = this.drillId;
this.http
.put(`/api/DrillRecords/${this.drillId}`, body)
.subscribe((data: any) => {
this.isLoadingSave = false;
this.snackBar.open("保存成功", "确定", {
verticalPosition: "top",
duration: 3000,
});
this.dialogRef.close();
});
}
}
//查看图片
viewImg(url) {
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement("img");
node.style.display = "none";
node.src = url;
node.id = "img";
dom.appendChild(node);
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
},
});
node.click();
}, 0);
}
}

2
src/app/key-unit/key-unit-management/upname.html

@ -17,7 +17,7 @@
<div class="queryField">
<label style="margin-right: 10px;">新单位名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入新预案名称" required name="companyName" autocomplete="off" [(ngModel)]="unitname">
<input matInput placeholder="请输入新单位名称" required name="companyName" autocomplete="off" [(ngModel)]="unitname">
</mat-form-field>
</div>
<div class="bottom">

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

@ -1,203 +1,94 @@
import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { KeyUnitRoutingModule } from "./key-unit-routing.module";
import {
KeyUnitManagementComponent,
CreateUnit,
} from "./key-unit-management/key-unit-management.component";
import { A11yModule } from "@angular/cdk/a11y";
import { DragDropModule } from "@angular/cdk/drag-drop";
import { PortalModule } from "@angular/cdk/portal";
import { ScrollingModule } from "@angular/cdk/scrolling";
import { CdkStepperModule } from "@angular/cdk/stepper";
import { CdkTableModule } from "@angular/cdk/table";
import { CdkTreeModule } from "@angular/cdk/tree";
import { MatAutocompleteModule } from "@angular/material/autocomplete";
import { MatBadgeModule } from "@angular/material/badge";
import { MatBottomSheetModule } from "@angular/material/bottom-sheet";
import { MatButtonModule } from "@angular/material/button";
import { MatButtonToggleModule } from "@angular/material/button-toggle";
import { MatCardModule } from "@angular/material/card";
import { MatCheckboxModule } from "@angular/material/checkbox";
import { MatChipsModule } from "@angular/material/chips";
import { MatStepperModule } from "@angular/material/stepper";
import { MatDatepickerModule } from "@angular/material/datepicker";
import { MatDialogModule } from "@angular/material/dialog";
import { MatDividerModule } from "@angular/material/divider";
import { MatExpansionModule } from "@angular/material/expansion";
import { MatGridListModule } from "@angular/material/grid-list";
import { MatIconModule } from "@angular/material/icon";
import { MatInputModule } from "@angular/material/input";
import { MatListModule } from "@angular/material/list";
import { MatMenuModule } from "@angular/material/menu";
import {
MatNativeDateModule,
MatRippleModule,
MatOption,
} from "@angular/material/core";
import { MatPaginatorModule } from "@angular/material/paginator";
import { MatProgressBarModule } from "@angular/material/progress-bar";
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { MatRadioModule } from "@angular/material/radio";
import { MatSelectModule } from "@angular/material/select";
import { MatSidenavModule } from "@angular/material/sidenav";
import { MatSliderModule } from "@angular/material/slider";
import { MatSlideToggleModule } from "@angular/material/slide-toggle";
import { MatSnackBarModule } from "@angular/material/snack-bar";
import { MatSortModule } from "@angular/material/sort";
import { MatTableModule } from "@angular/material/table";
import { MatTabsModule } from "@angular/material/tabs";
import { MatToolbarModule } from "@angular/material/toolbar";
import { MatTooltipModule } from "@angular/material/tooltip";
import { MatTreeModule } from "@angular/material/tree";
import { EditUnitInfoComponent } from "./edit-unit-info/edit-unit-info.component";
import { ViewUnitDetailsComponent } from "./view-unit-details/view-unit-details.component";
import { ReactiveFormsModule, FormsModule } from "@angular/forms";
import { AddHouseInfo } from "./basicinfo/addhouseinfo.component";
import { LookMaster } from "./basicinfo/lookmaster.component";
import {
BasicinfoComponent,
StatisticsOfFireFightingFacilities,
} from "./basicinfo/basicinfo.component";
import { EditPlanInfoComponent } from "./edit-plan-info/edit-plan-info.component";
import { CountdownModule } from "ngx-countdown";
import { BasicinfoLookComponent } from "./basicinfo-look/basicinfo.component";
import { ViewUnitDetailsPlanComponent } from "./view-unit-details-plan/view-unit-details-plan.component";
import {
FunctionDivisionComponent,
addPartition,
addPartitionAttribute,
} from "./function-division/function-division.component";
import { AllaroundComponent } from "./allaround/allaround.component";
import { ImgDetails } from "./allaround/imgdetails.component";
import {
RealisticPictureComponent,
previewImg,
addRealPicture,
editRealPicture,
} from "./realistic-picture/realistic-picture.component";
import { FileUploadModule } from "ng2-file-upload";
import { KeySiteComponent } from "./key-site/key-site.component";
import { KeySiteImgs } from "./key-site/keysiteimgs.component";
import {
UploadingCADComponent,
readFile,
editFile,
} from "./uploading-cad/uploading-cad.component";
import { KeySiteLookComponent } from "./key-site-look/key-site.component";
import { KeySiteImgs2 } from "./key-site-look/keysiteimgs.component";
import {
FunctionDivisionLookComponent,
addPartitionAttribute2,
} from "./function-division-look/function-division.component";
import {
RealisticPictureLookComponent,
previewImg3,
} from "./realistic-picture-look/realistic-picture.component";
import { UploadingCADLookComponent } from "./uploading-cad-look/uploading-cad.component";
import { FireFightingDeviceComponent } from "./fire-fighting-device/fire-fighting-device.component";
import {
ImagesData,
previewBigImg,
} from "./fire-fighting-device/imagesdata.component";
import { ImgsDataDetail } from "./fire-fighting-device/addGrouping.component";
import { FireFightingDeviceLookComponent } from "./fire-fighting-device-look/fire-fighting-device.component";
import {
ImagesData2,
previewBigImg2,
} from "./fire-fighting-device-look/imagesdata.component";
import { ImgsDataDetail2 } from "./fire-fighting-device-look/addGrouping.component";
import { UiModule } from "../../app/ui/ui.module";
import {
SixFamiliarityComponent,
routerMapComponent,
} from "./six-familiarity/six-familiarity.component";
import { ActualCombatDrillComponent } from "./actual-combat-drill/actual-combat-drill.component";
import { SixFamiliarListComponent } from "./six-familiar-list/six-familiar-list.component";
import { TrainingRecordinfoComponent } from "./training-recordinfo/training-recordinfo.component";
import { RouterGISComponent } from "./router-gis/router-gis.component";
import { WaterRoadComponent } from "./water-road/water-road.component";
import { PhotoofthesceneComponent } from "./photoofthescene/photoofthescene.component";
import { KnowRouteComponent } from "./know-route/know-route.component";
import { FindProblemComponent } from "./find-problem/find-problem.component";
import { upname } from "./key-unit-management/key-unit-management.component";
import { companyAuditResult } from "./key-unit-management/key-unit-management.component";
import { SpecialWarningComponent } from "./special-warning/special-warning.component";
import { UploadDrillComponent } from "./key-unit-management/upload-drill/upload-drill.component";
import { NzDatePickerModule } from "ng-zorro-antd/date-picker";
import { NzInputModule } from "ng-zorro-antd/input";
import { NzButtonModule } from "ng-zorro-antd/button";
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { KeyUnitRoutingModule } from './key-unit-routing.module';
import { KeyUnitManagementComponent, CreateUnit } from './key-unit-management/key-unit-management.component';
import {A11yModule} from '@angular/cdk/a11y';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {PortalModule} from '@angular/cdk/portal';
import {ScrollingModule} from '@angular/cdk/scrolling';
import {CdkStepperModule} from '@angular/cdk/stepper';
import {CdkTableModule} from '@angular/cdk/table';
import {CdkTreeModule} from '@angular/cdk/tree';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatBadgeModule} from '@angular/material/badge';
import {MatBottomSheetModule} from '@angular/material/bottom-sheet';
import {MatButtonModule} from '@angular/material/button';
import {MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatCardModule} from '@angular/material/card';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatChipsModule} from '@angular/material/chips';
import {MatStepperModule} from '@angular/material/stepper';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatDialogModule} from '@angular/material/dialog';
import {MatDividerModule} from '@angular/material/divider';
import {MatExpansionModule} from '@angular/material/expansion';
import {MatGridListModule} from '@angular/material/grid-list';
import {MatIconModule} from '@angular/material/icon';
import {MatInputModule} from '@angular/material/input';
import {MatListModule} from '@angular/material/list';
import {MatMenuModule} from '@angular/material/menu';
import {MatNativeDateModule, MatRippleModule, MatOption} from '@angular/material/core';
import {MatPaginatorModule} from '@angular/material/paginator';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatRadioModule} from '@angular/material/radio';
import {MatSelectModule} from '@angular/material/select';
import {MatSidenavModule} from '@angular/material/sidenav';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import {MatSortModule} from '@angular/material/sort';
import {MatTableModule} from '@angular/material/table';
import {MatTabsModule} from '@angular/material/tabs';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatTooltipModule} from '@angular/material/tooltip';
import {MatTreeModule} from '@angular/material/tree';
import { EditUnitInfoComponent } from './edit-unit-info/edit-unit-info.component';
import { ViewUnitDetailsComponent } from './view-unit-details/view-unit-details.component';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { AddHouseInfo } from './basicinfo/addhouseinfo.component';
import { LookMaster } from './basicinfo/lookmaster.component';
import { BasicinfoComponent, StatisticsOfFireFightingFacilities } from './basicinfo/basicinfo.component';
import { EditPlanInfoComponent } from './edit-plan-info/edit-plan-info.component';
import { CountdownModule } from 'ngx-countdown';
import { BasicinfoLookComponent } from './basicinfo-look/basicinfo.component';
import { ViewUnitDetailsPlanComponent } from './view-unit-details-plan/view-unit-details-plan.component';
import { FunctionDivisionComponent, addPartition, addPartitionAttribute } from './function-division/function-division.component';
import {AllaroundComponent} from './allaround/allaround.component'
import {ImgDetails} from './allaround/imgdetails.component'
import { RealisticPictureComponent, previewImg, addRealPicture, editRealPicture } from './realistic-picture/realistic-picture.component';
import { FileUploadModule } from 'ng2-file-upload';
import {KeySiteComponent} from './key-site/key-site.component'
import {KeySiteImgs} from './key-site/keysiteimgs.component'
import {UploadingCADComponent,readFile,editFile} from './uploading-cad/uploading-cad.component'
import { KeySiteLookComponent } from './key-site-look/key-site.component';
import { KeySiteImgs2 } from './key-site-look/keysiteimgs.component';
import { FunctionDivisionLookComponent, addPartitionAttribute2 } from './function-division-look/function-division.component';
import { RealisticPictureLookComponent, previewImg3 } from './realistic-picture-look/realistic-picture.component';
import { UploadingCADLookComponent } from './uploading-cad-look/uploading-cad.component';
import { FireFightingDeviceComponent } from './fire-fighting-device/fire-fighting-device.component';
import { ImagesData, previewBigImg } from './fire-fighting-device/imagesdata.component';
import { ImgsDataDetail } from './fire-fighting-device/addGrouping.component';
import { FireFightingDeviceLookComponent } from './fire-fighting-device-look/fire-fighting-device.component';
import { ImagesData2, previewBigImg2 } from './fire-fighting-device-look/imagesdata.component';
import { ImgsDataDetail2 } from './fire-fighting-device-look/addGrouping.component';
import { UiModule } from '../../app/ui/ui.module';
import { SixFamiliarityComponent,routerMapComponent } from './six-familiarity/six-familiarity.component';
import { ActualCombatDrillComponent } from './actual-combat-drill/actual-combat-drill.component';
import { SixFamiliarListComponent } from './six-familiar-list/six-familiar-list.component'
import { TrainingRecordinfoComponent } from './training-recordinfo/training-recordinfo.component';
import { RouterGISComponent } from './router-gis/router-gis.component';
import { WaterRoadComponent } from './water-road/water-road.component';
import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component';
import { KnowRouteComponent } from './know-route/know-route.component';
import { FindProblemComponent } from './find-problem/find-problem.component';
import { upname } from './key-unit-management/key-unit-management.component';
import { companyAuditResult } from './key-unit-management/key-unit-management.component';
import { SpecialWarningComponent } from './special-warning/special-warning.component'
@NgModule({
declarations: [
KeyUnitManagementComponent,
EditUnitInfoComponent,
ViewUnitDetailsComponent,
CreateUnit,
BasicinfoComponent,
LookMaster,
AddHouseInfo,
EditPlanInfoComponent,
BasicinfoLookComponent,
ViewUnitDetailsPlanComponent,
FunctionDivisionComponent,
addPartition,
addPartitionAttribute,
AllaroundComponent,
ImgDetails,
RealisticPictureComponent,
previewImg,
addRealPicture,
editRealPicture,
KeySiteComponent,
KeySiteImgs,
UploadingCADComponent,
readFile,
editFile,
KeySiteLookComponent,
KeySiteImgs2,
FunctionDivisionLookComponent,
RealisticPictureLookComponent,
previewImg3,
UploadingCADLookComponent,
FireFightingDeviceComponent,
ImagesData,
previewBigImg,
ImgsDataDetail,
FireFightingDeviceLookComponent,
ImagesData2,
ImgsDataDetail2,
previewBigImg2,
addPartitionAttribute2,
SixFamiliarityComponent,
ActualCombatDrillComponent,
routerMapComponent,
SixFamiliarListComponent,
TrainingRecordinfoComponent,
RouterGISComponent,
WaterRoadComponent,
PhotoofthesceneComponent,
KnowRouteComponent,
FindProblemComponent,
upname,
companyAuditResult,
StatisticsOfFireFightingFacilities,
SpecialWarningComponent,
UploadDrillComponent,
],
exports: [
ViewUnitDetailsPlanComponent,
WaterRoadComponent,
BasicinfoLookComponent,
AllaroundComponent,
FireFightingDeviceLookComponent,
KeySiteLookComponent,
FunctionDivisionLookComponent,
RouterGISComponent,
RealisticPictureLookComponent,
UploadingCADLookComponent,
SpecialWarningComponent,
],
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult,StatisticsOfFireFightingFacilities, SpecialWarningComponent],
exports:[ViewUnitDetailsPlanComponent],
imports: [
CommonModule,
KeyUnitRoutingModule,
@ -248,9 +139,6 @@ import { NzButtonModule } from "ng-zorro-antd/button";
FileUploadModule,
UiModule,
ReactiveFormsModule,
NzDatePickerModule,
NzInputModule,
NzButtonModule,
],
]
})
export class KeyUnitModule {}
export class KeyUnitModule { }

640
src/app/key-unit/realistic-picture-look/realistic-picture.component.ts

@ -1,391 +1,435 @@
import { Component, OnInit, Inject, ViewChild } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { MatPaginator } from "@angular/material/paginator";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
import Swiper from "swiper";
import { Router, ActivatedRoute } from "@angular/router";
import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { FileUploader } from 'ng2-file-upload';
import { MatPaginator } from '@angular/material/paginator';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import Swiper from 'swiper';
import { Router,ActivatedRoute } from '@angular/router'
@Component({
selector: "app-realistic-picture-look",
templateUrl: "./realistic-picture.component.html",
styleUrls: ["./realistic-picture.component.scss"],
selector: 'app-realistic-picture-look',
templateUrl: './realistic-picture.component.html',
styleUrls: ['./realistic-picture.component.scss']
})
export class RealisticPictureLookComponent implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar
) {}
uploader:FileUploader = new FileUploader({ //初始化上传文件
url: `/api/Objects/PlanPlatform/${this.route.snapshot.queryParams.id}/RealImgs`,
method: "POST",
itemAlias: "uploadedfile",
autoUpload: false,
removeAfterUpload:true,
});
constructor(private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
let companyId = this.route.snapshot.queryParams.id;
this.http
.get("/api/RealityImageGroups", {
params: {
companyId: companyId,
},
})
.subscribe((data: any) => {
this.allRealPicture = data;
this.allRealPicture.unshift(
{
companyId: sessionStorage.getItem("companyId"),
id: "重点部位",
name: "重点部位",
realityImages: null,
},
{
companyId: sessionStorage.getItem("companyId"),
id: "安全出口",
name: "安全出口",
realityImages: null,
}
);
this.selectReal = data[0];
this.getAllRealPicture();
});
let companyId = this.route.snapshot.queryParams.id
this.http.get('/api/RealityImageGroups',{params:{
companyId : companyId
}}).subscribe((data:any)=>{
this.allRealPicture = data
// this.allRealPicture.unshift({
// companyId:sessionStorage.getItem('companyId'),
// id:'重点部位',
// name: "重点部位",
// realityImages:null
// })
this.selectReal = data[0]
this.getAllRealPicture()
})
}
companyId: any; //单位编号
allRealPicture: any = []; //所有实景图文件
selectReal: any; //选中的实景图文件
selectRealIndex: number = 0; //选中的实景图文件下标
allImages: any = []; //实景图文件对应所有的实景图
isDownload: boolean = false; //是否批量下载
downloadList: any = []; //选中需要下载的图片
companyId:any; //单位编号
allRealPicture:any=[]; //所有实景图文件
selectReal:any; //选中的实景图文件
selectRealIndex:number=0; //选中的实景图文件下标
allImages:any=[]; //实景图文件对应所有的实景图
isDownload:boolean = false; //是否批量下载
downloadList:any = []; //选中需要下载的图片
//分页
@ViewChild(MatPaginator, { static: true })
@ViewChild(MatPaginator, {static: true})
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any = "12"; //每页条数
pageSizeOptions: number[] = [12]; //设置每页条数
PageNumber: any; //第几页
length:any; //共多少条数据
pageSize:any = '12'; //每页条数
pageSizeOptions: number[] = [12] //设置每页条数
PageNumber:any; //第几页
//分页切换
chagePage(e) {
this.PageNumber = e.pageIndex + 1;
this.getAllRealPicture();
chagePage (e) {
this.PageNumber = e.pageIndex+1
this.getAllRealPicture()
}
//获取所有实景图分组
getAllGrouping() {
let companyId = this.route.snapshot.queryParams.id;
this.http
.get("/api/RealityImageGroups", {
params: {
companyId: companyId,
},
})
.subscribe((data: any) => {
this.allRealPicture = data;
this.allRealPicture.unshift(
{
companyId: sessionStorage.getItem("companyId"),
id: "重点部位",
name: "重点部位",
realityImages: null,
},
{
companyId: sessionStorage.getItem("companyId"),
id: "安全出口",
name: "安全出口",
realityImages: null,
}
);
console.log("文件夹列表", this.allRealPicture);
this.selectReal = data[this.selectRealIndex];
});
getAllGrouping () {
let companyId = this.route.snapshot.queryParams.id
this.http.get('/api/RealityImageGroups',{params:{
companyId : companyId
}}).subscribe((data:any)=>{
this.allRealPicture = data
this.selectReal = data[this.selectRealIndex]
})
}
//获取实景图分组对应实景图
getAllRealPicture() {
getAllRealPicture () {
if (this.selectReal) {
if (this.selectReal.id == "安全出口") {
let params = {
companyId: this.selectReal.companyId,
let data
if(this.selectReal.id == 'xxxxxxxxxxxxx'){
data = {
groupId: this.selectReal.id,
companyId : this.selectReal.companyId,
PageNumber: this.PageNumber || 1,
pageSize: this.pageSize,
}
}else{
data = {
groupId: this.selectReal.id,
PageNumber: this.PageNumber || 1,
pageSize: this.pageSize,
};
this.http
.get("/api/CompanySafetyExits/GetCompanySafetyExitImages", {
params: params,
})
.subscribe((data: any) => {
// console.log('当前单位安全出口', data)
this.allImages = data.items;
this.length = data.totalCount;
this.pageSize = this.pageSize;
this.downloadList = [];
this.allImages.forEach((element) => {
//每张图片设置选中状态为false
element.newImageUrl = `${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`; //处理图片URL地址
element.nameStart = element.name;
element.checked = false; //图片是否选中布尔值
});
});
} else {
let data;
if (this.selectReal.id == "重点部位") {
data = {
groupId: this.selectReal.id,
companyId: this.selectReal.companyId,
PageNumber: this.PageNumber || 1,
pageSize: this.pageSize,
};
} else {
data = {
groupId: this.selectReal.id,
PageNumber: this.PageNumber || 1,
pageSize: this.pageSize,
};
}
this.http
.get("/api/RealityImages", { params: data })
.subscribe((data: any) => {
this.allImages = data.items;
this.length = data.totalCount;
this.pageSize = data.pageSize;
this.downloadList = [];
this.allImages.forEach((element) => {
//每张图片设置选中状态为false
if (this.selectReal.id == "重点部位") {
element.newImageUrl = `${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`;
element.nameStart = element.name;
} else {
element.newImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`; //处理图片URL地址
element.nameStart = element.name.substring(
0,
element.name.lastIndexOf(".")
); //图片名称前缀
}
element.checked = false; //图片是否选中布尔值
element.nameEnd = element.name.substring(
element.name.lastIndexOf("."),
element.name.length
); //图片名称后缀
});
});
}
this.http.get('/api/RealityImages',{params:data}).subscribe((data:any)=>{
this.allImages = data.items
this.length = data.totalCount
this.pageSize = data.pageSize
this.downloadList = []
this.allImages.forEach(element => { //每张图片设置选中状态为false
if(this.selectReal.id == '重点部位'){
element.newImageUrl = `${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
element.nameStart = element.name
}else{
element.newImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` //处理图片URL地址
element.nameStart = element.name.substring(0,element.name.lastIndexOf(".")); //图片名称前缀
}
element.checked = false //图片是否选中布尔值
element.nameEnd = element.name.substring(element.name.lastIndexOf("."),element.name.length); //图片名称后缀
});
})
}
}
//切换左侧实景图文件
changeReal(e, index) {
changeReal (e,index) {
if (this.selectRealIndex != index) {
this.selectReal = e;
this.selectRealIndex = index;
this.isDownload = false;
this.downloadList = [];
this.getAllRealPicture();
this.selectReal = e
this.selectRealIndex = index
this.isDownload = false
this.downloadList = []
this.getAllRealPicture()
}
}
//选择批量下载
download() {
this.isDownload = !this.isDownload;
if (!this.isDownload) {
//取消批量下载时数组清空
this.allImages.forEach((element) => {
element.checked = false;
});
this.downloadList = [];
//选择批量下载
download () {
this.isDownload = !this.isDownload
if (!this.isDownload) { //取消批量下载时数组清空
this.allImages.forEach(element => {element.checked = false});
this.downloadList = []
}
}
// 预览图片---批量选择图片
operation(e, index) {
if (this.isDownload) {
//批量选择图片
e.checked = !e.checked;
if (e.checked == true) {
this.downloadList.push(e);
} else {
this.downloadList.splice(
this.downloadList.findIndex((item) => item.id === e.id),
1
);
}
} else {
//预览图片
operation (e,index) {
if (this.isDownload) { //批量选择图片
e.checked = !e.checked
if (e.checked==true) {this.downloadList.push(e)}
else {this.downloadList.splice(this.downloadList.findIndex(item => item.id === e.id), 1)}
} else { //预览图片
let data = {
selectReal: this.selectReal,
allImages: this.allImages,
imgIndex: index,
};
let dialogRef = this.dialog.open(previewImg3, { data });
dialogRef.afterClosed().subscribe();
selectReal:this.selectReal,
allImages:this.allImages,
imgIndex: index}
let dialogRef = this.dialog.open(previewImg3,
{data});
dialogRef.afterClosed().subscribe();
}
}
//新建实景图文件
addReal() {}
addReal () {
}
//编辑实景图文件
editReal() {}
editReal () {
}
//删除实景图文件
delete() {
let companyId = this.route.snapshot.queryParams.id;
delete () {
let companyId = this.route.snapshot.queryParams.id
if (this.selectReal) {
let isDelete = confirm("您确定要删除吗");
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
this.http
.delete(`/api/RealityImageGroups/${this.selectReal.id}`)
.subscribe((data) => {
this.http
.get("/api/RealityImageGroups", {
params: {
companyId: companyId,
},
})
.subscribe((data: any) => {
this.allRealPicture = data;
this.selectReal = data[this.selectRealIndex];
this.allImages = [];
this.getAllRealPicture();
});
});
this.http.delete(`/api/RealityImageGroups/${this.selectReal.id}`).subscribe(data=>{
this.http.get('/api/RealityImageGroups',{params:{
companyId : companyId
}}).subscribe((data:any)=>{
this.allRealPicture = data
this.selectReal = data[this.selectRealIndex]
this.allImages = []
this.getAllRealPicture()
})
})
}
}
}
//实景图修改
preservationImg(e) {
preservationImg (e) {
let data = {
id: e.id,
name: e.nameStart + e.nameEnd,
imageUrl: e.imageUrl,
realityImageGroupId: e.realityImageGroupId,
};
this.http.put(`/api/RealityImages/${e.id}`, data).subscribe((data) => {
this.getAllRealPicture();
id:e.id,
name:e.nameStart+e.nameEnd,
imageUrl:e.imageUrl,
realityImageGroupId:e.realityImageGroupId
}
this.http.put(`/api/RealityImages/${e.id}`,data).subscribe(data=>{
this.getAllRealPicture()
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("图片修改成功", "确定", config);
});
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片修改成功','确定',config);
})
}
//实景图删除
deleteImg(e) {
let isDelete = confirm("您确定要删除吗");
deleteImg (e) {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
this.http.delete(`/api/RealityImages/${e.id}`).subscribe((data) => {
this.getAllRealPicture();
this.http.delete(`/api/RealityImages/${e.id}`).subscribe(data=>{
this.getAllRealPicture()
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("图片删除成功", "确定", config);
});
this.http
.delete(`/api/Objects/PlanPlatform/${e.imageUrl}`)
.subscribe((data) => {});
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片删除成功','确定',config);
})
this.http.delete(`/api/Objects/PlanPlatform/${e.imageUrl}`).subscribe(data=>{})
}
}
isLoading: boolean = false; //loading加载
isLoading:boolean = false; //loading加载
//上传文件↓
file:any; //上传的文件
objectName:any; //上传对象名
uploadId:any; //上传分块上传事件编号
//change选择文件
uploadFile (e) {
if (this.selectReal) {
this.file = e.target.files[0] || null //上传的文件
let URL = window.URL.createObjectURL(this.file)
var img = new Image()
img.src = URL
let that = this
img.onload = function () {
if(img.width>=4096 || img.height>=5000 ){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
that.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config);
that.uploader.clearQueue(); //清空input控件文件
(<HTMLInputElement>document.getElementById('uploadFile')).value = null //清空input框缓存
}else{ that.startUploading() }
} //onload
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择或创建实景图文件夹','确定',config);
this.uploader.clearQueue(); //清空input控件文件
(<HTMLInputElement>document.getElementById('uploadFile')).value = null //清空input框缓存
}
}
//上传文件
startUploading () {
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let maxdSize = 20 * 1024 * 1024 //限制20MB
if (file && fileSize<=shardSize) { //上传文件<=5MB时
this.uploader.queue[0].upload();//开始上传
this.uploader.queue[0].onSuccess = (response, status, headers) => {
if (status == 201) { // 上传文件成功,上传文件后获取服务器返回的数据
let tempRes = JSON.parse(response);
this.objectName = tempRes.objectName
this.addRealImg()
}else { // 上传文件后获取服务器返回的数据错误
let tempRes = JSON.parse(response);
}};
} else if (file && fileSize>shardSize && fileSize<maxdSize) { //上传文件>5MB时,
let data = {filename: file.name}
this.isLoading = true
this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.companyId}/RealImgs`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
})
}
}
PartNumberETag:any=[]; //每次返回需要保存的信息
//开始分段上传
async subsectionUploading () {
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)
if (this.PartNumberETag.length === allSlice) {this.endUploading()}
}//for循环
}
//完成分块上传
endUploading () {
let data = this.PartNumberETag
let paramsData = {uploadId:this.uploadId}
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{
this.addRealImg() //上传完成后,发送请求创建实景图
this.isLoading = false
this.uploader.clearQueue(); //清空input控件文件
this.PartNumberETag =[] //清空保存返回的信息
})
}
//上传图片成功后获取url地址发送请求创建实景图
addRealImg () {
let data = {
name: this.file.name,
imageUrl:this.objectName,
realityImageGroupId: this.selectReal.id,
}
this.http.post('/api/RealityImages',data).subscribe(data=>{
(<HTMLInputElement>document.getElementById('uploadFile')).value = null //清空input框缓存
this.getAllRealPicture()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片上传成功','确定',config);
})
}
//批量下载↓
//开始下载
async batchDownload() {
if (this.downloadList.length) {
//开始批量循环下载
this.isLoading = true;
for (let i = 0; i < this.downloadList.length; i++) {
let result = await new Promise((result, reject) => {
this.http
.get(`/api/Objects/PlanPlatform/${this.downloadList[i].imageUrl}`, {
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;
link.setAttribute("download", this.downloadList[i].name);
document.body.appendChild(link);
link.click();
result("success");
});
});
if (i == this.downloadList.length - 1) {
//判断是否下载完毕
this.isLoading = false;
this.isDownload = false;
this.allImages.forEach((element) => {
element.checked = false;
});
this.downloadList = [];
}
async batchDownload () {
if (this.downloadList.length) { //开始批量循环下载
this.isLoading = true
for (let i=0;i<this.downloadList.length;i++) {
let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/PlanPlatform/${this.downloadList[i].imageUrl}`,{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;
link.setAttribute("download", this.downloadList[i].name);
document.body.appendChild(link);
link.click();
result('success')})
})
if(i == this.downloadList.length-1) { //判断是否下载完毕
this.isLoading = false
this.isDownload = false
this.allImages.forEach(element => {element.checked = false});
this.downloadList = []}
} //for循环
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("请选择图片", "确定", config);
}
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择图片','确定',config);}
}
}
//预览图片组件
@Component({
selector: "app-previewImg",
templateUrl: "./previewImg.html",
styleUrls: ["./realistic-picture.component.scss"],
selector: 'app-previewImg',
templateUrl: './previewImg.html',
styleUrls: ['./realistic-picture.component.scss']
})
export class previewImg3 {
constructor(
private http: HttpClient,
public dialog: MatDialog,
public dialogRef: MatDialogRef<previewImg3>,
@Inject(MAT_DIALOG_DATA) public data
) {}
testSwiper: Swiper;
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<previewImg3>,
@Inject(MAT_DIALOG_DATA) public data) { }
testSwiper: Swiper;
ngOnInit(): void {
this.allImages = this.data.allImages;
this.allImages.forEach((element) => {
if (
this.data.selectReal.id == "重点部位" ||
this.data.selectReal.id == "安全出口"
) {
element.previewImageUrl = `${element.imageUrl}`; //处理图片URL地址
} else {
element.previewImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/auto-orient,1`; //处理图片URL地址
this.allImages = this.data.allImages
this.allImages.forEach(element => {
if( this.data.selectReal.id == '重点部位'){
element.previewImageUrl = `${element.imageUrl}` //处理图片URL地址
}else{
element.previewImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/auto-orient,1` //处理图片URL地址
}
});
}
ngAfterViewInit() {
this.testSwiper = new Swiper(".swiper-container", {
this.testSwiper = new Swiper('.swiper-container', {
lazy: true,
initialSlide: this.data.imgIndex,
direction: "horizontal",
direction: 'horizontal',
loop: false,
// 如果需要前进后退按钮
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}
allImages: any; //展示所有的图片
rotationAngle: number = 0; //旋转角度
allImages:any; //展示所有的图片
rotationAngle:number=0; //旋转角度
//旋转图片
rotate() {
this.rotationAngle = this.rotationAngle + 90;
if (this.rotationAngle === 360) {
this.rotationAngle = 0;
}
rotate () {
this.rotationAngle = this.rotationAngle+90
if (this.rotationAngle === 360) {this.rotationAngle = 0}
}
}

6
src/app/key-unit/realistic-picture/realistic-picture.component.html

@ -23,7 +23,7 @@
<div class="topBox">
<div>
<span class="title" *ngIf="selectReal">{{selectReal.name}}</span>
<button mat-raised-button color="primary" class="uploadFileFixed" *ngIf="!isLoading && selectReal && selectReal.id != '重点部位'&& selectReal.id != '安全出口'">
<button mat-raised-button color="primary" class="uploadFileFixed" *ngIf="!isLoading && selectReal && selectReal.id != '重点部位'">
上传图片
<input type="file" id="uploadFile" class="uploadFile" (change)='uploadFile($event)' ng2FileSelect [uploader]="uploader" accept="image/*">
</button>
@ -42,8 +42,8 @@
<div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div>
<label style="margin-left: 5px;">图片名称:</label>
<input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart" maxlength="20">
<a *ngIf="selectReal.id != '重点部位'&& selectReal.id != '安全出口'" href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a *ngIf="selectReal.id != '重点部位'&& selectReal.id != '安全出口'" href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a>
<a *ngIf="selectReal.id != '重点部位'" href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a *ngIf="selectReal.id != '重点部位'" href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a>
</div>
<p style="width: 100px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p>

942
src/app/key-unit/realistic-picture/realistic-picture.component.ts

File diff suppressed because it is too large Load Diff

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

@ -2,8 +2,6 @@ import { HttpClient } from '@angular/common/http';
import { Component, EventEmitter, NgZone, OnInit, Output } from '@angular/core';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { MapFactory } from '@src/modules/map/declare/factory';
import { IDriving, IMap } from '@src/modules/map/declare/map';
declare var AMap: any;
@Component({
@ -33,14 +31,14 @@ export class RouterGISComponent implements OnInit {
this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe((data:any)=>{
if (data.driveRouteStartPoint && data.driveRouteStartPoint.x && data.driveRouteStartPoint.y && data.driveRouteStartName) { //开始坐标 名称
this.routeStart = data.driveRouteStartName
this.startCoordinate = MapFactory.LngLatInstance(data.driveRouteStartPoint.x, data.driveRouteStartPoint.y)
this.startCoordinate = [data.driveRouteStartPoint.x,data.driveRouteStartPoint.y]
}
if (data.driveRouteEndPoint && data.driveRouteEndPoint.x && data.driveRouteEndPoint.y && data.driveRouteEndName) { //结束坐标 名称
this.routeEnd = data.driveRouteEndName
this.endCoordinate = MapFactory.LngLatInstance(data.driveRouteEndPoint.x, data.driveRouteEndPoint.y)
this.endCoordinate = [data.driveRouteEndPoint.x,data.driveRouteEndPoint.y]
} else if (data.location && data.location.x && data.location.y) {
this.routeEnd = data.name
this.endCoordinate = MapFactory.LngLatInstance(data.location.x, data.location.y)
this.endCoordinate = [data.location.x,data.location.y]
}
resolve('success')
}) //http
@ -90,27 +88,29 @@ export class RouterGISComponent implements OnInit {
//地图初始化
mapInit () {
let that = this
var layer = MapFactory.LayerInstance({
var layer = new AMap.createDefaultLayer({
zooms:[3,20], //可见级别
visible:true, //是否可见
opacity:1, //透明度
zIndex:0, //叠加层级
resizeEnable: true //是否监控地图容器尺寸变化,
})
that.map = MapFactory.MapInstance('map',{
that.map = new AMap.Map('map',{
layers:[layer], //当只想显示标准图层时layers属性可缺省,
});
that.map.setCity('上海市');
that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null
that.map.setCity('株洲市');;
AMap.plugin('AMap.Driving', function() {
that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null
})
}
map:IMap; //地图实例
map:any; //地图实例
routeStart:any; //起点
routeStartList:any = [] //起点 搜索结果
routeEnd:any; //终点
routeEndList:any = [] //终点 搜索结果
timeout:any; //延时器
routeGIS:IDriving; //查询结果 规划路线
routeGIS:any; //查询结果 规划路线
selectType:boolean = true; //路线选择 推荐方案/躲避用拥堵
routes:any = { distance: 0, time: 0, steps: [], };//导航查询结果 路线规划
startCoordinate:any//开始坐标
@ -123,32 +123,34 @@ export class RouterGISComponent implements OnInit {
this.timeout = window.setTimeout(()=>{
that.map.getCity( function(info){ //获取当前 city
var autoOptions = {city: info.city}
let keywords
e == 0 ? keywords = that.routeStart : keywords = that.routeEnd
var autoComplete = MapFactory.AutocompleteInstance(autoOptions,that);
autoComplete.search(keywords, function(status, result) {
if (result && result.tips && result.tips.length) { //搜索到数据时
that._ngZone.run(()=>{
if(e == 0){
that.routeStartList = result.tips
if(result.tips.length != 0){
for (let index = 0; index < result.tips.length; index++) {
const element = result.tips[index];
if(element.location){
that.startCoordinate = MapFactory.LngLatInstance(element.location.lng, element.location.lat)
return
AMap.plugin(['AMap.AutoComplete'], () =>{
var autoOptions = {city: info.city}
let keywords
e == 0 ? keywords = that.routeStart : keywords = that.routeEnd
var autoComplete = new AMap.Autocomplete(autoOptions);
autoComplete.search(keywords, function(status, result) {
if (result && result.tips && result.tips.length) { //搜索到数据时
that._ngZone.run(()=>{
if(e == 0){
that.routeStartList = result.tips
if(result.tips.length != 0){
for (let index = 0; index < result.tips.length; index++) {
const element = result.tips[index];
if(element.location){
that.startCoordinate = new AMap.LngLat(element.location.lng, element.location.lat)
return
}
}
}
}else{
that.routeEndList = result.tips
that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
}
}else{
that.routeEndList = result.tips
that.endCoordinate = MapFactory.LngLatInstance(result.tips[0].location.lng, result.tips[0].location.lat)
}
});
} //if
});
} //if
})
})
}); //获取当前 city
},500)
@ -177,7 +179,7 @@ export class RouterGISComponent implements OnInit {
this.endCoordinate = null
this.routeGIS? this.routeGIS.clear() : null
this.routes = { distance: 0, time: 0, steps: [], }
this.map.setCity('上海市'); //设置地图中心点
this.map.setCity('株洲市'); //设置地图中心点
}
//交换起始点
@ -199,7 +201,7 @@ export class RouterGISComponent implements OnInit {
let that = this
this.selectType = true
this.routeGIS? this.routeGIS.clear() : null
this.routeGIS = MapFactory.DrivingInstance({
this.routeGIS = new AMap.Driving({
map: this.map,
});
if(!this.startCoordinate){
@ -215,7 +217,7 @@ export class RouterGISComponent implements OnInit {
this.snackBar.open('未查询到终点坐标信息,请输入有效地址','确定',config);
return
}else{
this.routeGIS.search(this,this.startCoordinate,this.endCoordinate,
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {
that.routes = result.routes[0]
@ -237,12 +239,12 @@ export class RouterGISComponent implements OnInit {
if (this.selectType != e) {
this.selectType = e
this.routeGIS? this.routeGIS.clear() : null
this.routeGIS = MapFactory.DrivingInstance({
this.routeGIS = new AMap.Driving({
map: this.map,
policy: e==true? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC
});
// 根据起终点名称规划驾车导航路线
this.routeGIS.search(this,this.startCoordinate,this.endCoordinate,
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {
that.routes = result.routes[0]

19
src/app/key-unit/six-familiarity/six-familiarity.component.ts

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { MapFactory } from '@src/modules/map/declare/factory';
declare var AMap: any;
@Component({
selector: 'app-six-familiarity',
@ -47,11 +47,26 @@ export class routerMapComponent implements OnInit {
//地图初始化
mapInit () {
//创建地图
let map = MapFactory.MapInstance('contentMap', {
let map = new AMap.Map('contentMap', {
resizeEnable: true,
cursor: 'default',
zooms:[6,18],
});
//构造路线导航类 实际路线
let driving = new AMap.Driving({
map: map,
showTraffic: true,
isOutline: true,
});
driving.search( [{keyword: '广西消防总队',city:'广西'},{keyword: '万科公园里',city:'广西'},{keyword: '南宁明安医院',city:'广西'}], );
//构造路线导航类 导航路线
let drivingTwo = new AMap.Driving({
map: map,
showTraffic: false,
});
drivingTwo.search( [{keyword: '广西消防总队',city:'广西'},{keyword: '南宁明安医院',city:'广西'}], );
//function (status,result) { console.log(status,result) } //地图路线 匹配起始点回调函数
//new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719) / [{keyword: '淄博站',city:'山东'},{keyword: '淄博北站',city:'山东'}], //路线可搜索, 可用坐标
}

4
src/app/key-unit/special-warning/special-warning.component.html

@ -1,13 +1,13 @@
<div class="bigbox">
<div class="itembox" *ngFor="let item of specialWarningData;let key = index">
<div class="title">
<input [disabled]="pattern == 'look'" [(ngModel)]="item.name" type="text" name="" id="" placeholder="请输入名称(可编辑)">
<input [(ngModel)]="item.name" type="text" name="" id="" placeholder="请输入名称(可编辑)">
<div class="deletebtn" *ngIf="key == specialWarningData.length - 1 && specialWarningData.length != 1 && pattern == 'edit'">
<mat-icon (click)="deleteItem()">delete</mat-icon>
</div>
</div>
<div class="contant">
<textarea [disabled]="pattern == 'look'" [(ngModel)]="item.content" name="" id="" cols="30" rows="10"></textarea>
<textarea [(ngModel)]="item.content" name="" id="" cols="30" rows="10"></textarea>
</div>
</div>
<div class="bottombox" *ngIf="pattern == 'edit'">

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

@ -1,4 +1,4 @@
<mat-tab-group selectedIndex="10" style="height: 99%;" >
<mat-tab-group selectedIndex="9" style="height: 99%;" >
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>
@ -44,12 +44,7 @@
<app-uploading-cad-look></app-uploading-cad-look>
</ng-template>
</mat-tab>
<mat-tab label="10.特别警示">
<ng-template matTabContent>
<app-special-warning></app-special-warning>
</ng-template>
</mat-tab>
<mat-tab label="11.作战部署">
<mat-tab label="10.作战部署">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
</ng-template>

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

@ -5,8 +5,8 @@
<label class="scorePrompt" *ngIf="selected.value == 3">*总平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 4 || selected.value == 5">*层平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 6">*填写2条以上可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 9">*重点部位、安全出口、外观各自不低于两张图片方可满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10">*保证至少有一个文件可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 9">*外观,室内,安全出口各上传2张图片可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10">*上传2张CAD图片可得满分</label>
</div>
<mat-tab-group style="height:100%;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="1.基本信息">

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

@ -1,7 +1,7 @@
<div class="content">
<div class="center" id="center"></div>
<!-- 上角 -->
<!-- 上角 -->
<div class="rightTopBox">
<div class="contantbox">
@ -39,11 +39,7 @@
</div>
</div>
<!-- 左上角 -->
<button mat-flat-button color="primary" class="createImg" (click)="takeScreenshotGis()">
生成图片
</button>
<!-- 右上角 -->
</div>

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

@ -135,10 +135,4 @@
}
}
}
}
.createImg{
position: absolute;
right: 30px;
top: 15px;
}

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

@ -4,10 +4,8 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { MapFactory } from '@src/modules/map/declare/factory';
import { ICircle, IMap, IMarker } from '@src/modules/map/declare/map';
declare var AMap: any;
declare var html2canvas: any;
@Component({
selector: 'app-water-road',
templateUrl: './water-road.component.html',
@ -15,23 +13,21 @@ declare var html2canvas: any;
})
export class WaterRoadComponent implements OnInit {
constructor(private http: HttpClient, public renderer2: Renderer2, public snackBar: MatSnackBar, public dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute) { }
constructor(private http: HttpClient,public renderer2: Renderer2,public snackBar: MatSnackBar,public dialog: MatDialog,private fb: FormBuilder,private route:ActivatedRoute) { }
//获得单位信息
unitData: any
async getUnitData() {
await new Promise((resolve, reject) => {
let id
this.route.snapshot.queryParams.id ? id = this.route.snapshot.queryParams.id : id = this.route.snapshot.queryParams.companyId
this.http.get(`/api/Companies/${id}`).subscribe(data => {
unitData:any
async getUnitData(){
await new Promise((resolve, reject) =>{
this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe(data => {
this.unitData = data
resolve(data)
})
})
})
}
map:IMap //地图
map:any //地图
watertForm:FormGroup //gis右上角水源表单
waterList = [
{id:'0',name:'消火栓',selected:true},
@ -44,19 +40,19 @@ export class WaterRoadComponent implements OnInit {
{id:'7',name:'其他消防队伍',selected:true}
]
fireForceList: any[] = [
fireForceList:any[] = [
]
waterAreaDefault: any = '5000' //默认水源范围
selectedWaterList: any = [] //选择提交的水源
waterAreaDefault:any = '5000' //默认水源范围
selectedWaterList:any = [] //选择提交的水源
//地图范围圆圈---水源
circleofwater:ICircle = MapFactory.CircleInstance({
circleofwater = new AMap.Circle({
center: null,
radius: 0, //半径
strokeOpacity: 1,
strokeOpacity: 1,
fillOpacity: 0.4,
strokeStyle: 'dashed',
strokeDasharray: [10, 10],
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#1791fc',
zIndex: 50,
@ -64,19 +60,19 @@ export class WaterRoadComponent implements OnInit {
async ngOnInit(): Promise<void> {
this.watertForm = this.fb.group({
waters: this.waterUnits(),
allSelectedWater: new FormControl(),
areaWater: new FormControl()
waters:this.waterUnits(),
allSelectedWater:new FormControl(),
areaWater:new FormControl()
})
this.waters.valueChanges.subscribe(values => {
let selects: string[] = []
values.forEach((selected: boolean, i: number) => {
let selects:string[] = []
values.forEach((selected:boolean,i:number) => {
selected === true && selects.push(this.waterList[i].id)
});
this.selectedWaterList = selects
})
this.waterList.forEach(item => {
if (item.selected) {
if(item.selected){
this.selectedWaterList.push(item.id)
}
})
@ -86,56 +82,56 @@ export class WaterRoadComponent implements OnInit {
}, 0);
}
get waters(): any {
get waters():any{
return this.watertForm.get('waters')
}
//全选水源
selectedAllWater(event) {
if (event.checked) {
this.waters.controls.forEach(item => { item.setValue(true) })
} else {
this.watertForm.reset()
selectedAllWater(event){
if(event.checked){
this.waters.controls.forEach(item => {item.setValue(true)})
}else{
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0')
}
}
//水源提交
waterSubmit(value) {
if (!this.unitMarker) {
waterSubmit(value){
if(!this.unitMarker){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请前往基本信息标注单位坐标', '确定', config);
} else {
this.snackBar.open('请前往基本信息标注单位坐标','确定',config);
}else{
this.circleofwater.setRadius(Number(this.waterAreaDefault))
this.circleofwater.setCenter(this.unitMarker._position)
this.circleofwater.setMap(this.map)
let Distance
let lnglat = MapFactory.LngLatInstance(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标
let lnglat = new AMap.LngLat(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标
//如果选择当前的视野范围算出查询半径
if (this.waterAreaDefault == '0') {
this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds()) / 2)
Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds()) / 2).lat - this.unitData.location.y)
} else {
Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.unitData.location.y)
if(this.waterAreaDefault == '0'){
this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds())/2)
Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.unitData.location.y)
}else{
Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.unitData.location.y)
}
this.getWaterData(Distance)
}
}
//获得水源列表
getWaterData(Distance) {
if (this.selectedWaterList.length == 0) {
getWaterData(Distance){
if(this.selectedWaterList.length == 0){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择要显示的类型', '确定', config);
} else {
// console.log('选中的内容', this.selectedWaterList)
this.snackBar.open('请选择要显示的类型','确定',config);
}else{
console.log('选中的内容',this.selectedWaterList)
function checkAdult(item) {
return item <= 2;
}
@ -144,95 +140,92 @@ export class WaterRoadComponent implements OnInit {
}
const water = this.selectedWaterList.filter(checkAdult);
const power = this.selectedWaterList.filter(checkAdult2);
// console.log('water', water)
// console.log('power', power)
let waterparamsdata: any = {
PageSize: 99999,
Lon: this.unitData.location.x,
Lat: this.unitData.location.y,
Distance: Distance,
WaterSourceTypes: water
console.log('water',water)
console.log('power',power)
let waterparamsdata:any = {
PageSize:99999,
Lon : this.unitData.location.x,
Lat : this.unitData.location.y,
Distance : Distance,
WaterSourceTypes :water
}
let powerparamsdata: any = {
PageSize: 99999,
Lon: this.unitData.location.x,
Lat: this.unitData.location.y,
Distance: Distance,
WaterSourceTypes: power
let powerparamsdata:any = {
PageSize:99999,
Lon : this.unitData.location.x,
Lat : this.unitData.location.y,
Distance : Distance,
WaterSourceTypes :power
}
if (water.length == 0) {
this.http.get("/api/CustomFireForce", { params: powerparamsdata }).subscribe((data2: any) => {
if( water.length == 0 ){
this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => {
this.createwaterMarker(data2)
})
} else if (power.length == 0) {
this.http.get("/api/WaterSources", { params: waterparamsdata }).subscribe((data: any) => {
}else if( power.length == 0 ){
this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => {
this.createwaterMarker(data.items)
})
} else {
this.http.get("/api/WaterSources", { params: waterparamsdata }).subscribe((data: any) => {
this.http.get("/api/CustomFireForce", { params: powerparamsdata }).subscribe((data2: any) => {
let allData = [...data.items, ...data2]
}else{
this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => {
this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => {
let allData = [...data.items,...data2]
this.createwaterMarker(allData)
})
})
}
}
}
//循环渲染出所有水源markers
waterCluster: any //水源聚合实例
createwaterMarker(list) {
waterCluster:any //水源聚合实例
createwaterMarker(list){
let waterMarkerArrcluster = []
this.waterCluster ? this.waterCluster.setData([]) : null
list.forEach((item) => {
let image
if (item.waterSourceType == 0 || item.waterSourceType == 1 || item.waterSourceType == 2) {
if (item.waterSourceType == 0) {//消火栓
if(item.waterSourceType == 0 || item.waterSourceType == 1 || item.waterSourceType == 2){
if(item.waterSourceType == 0){//消火栓
image = '/assets/waterMarkers/szxhs.png'
} else if (item.waterSourceType == 1) {//消防水池
}else if(item.waterSourceType == 1){//消防水池
image = '/assets/waterMarkers/fxcsc.png'
} else if (item.waterSourceType == 2) {//天然水源
}else if(item.waterSourceType == 2){//天然水源
image = '/assets/waterMarkers/trsy.png'
}
// 用于点集合的数组
item.location ? waterMarkerArrcluster.push({
lnglat: [item.location.x, item.location.y],
image: image,
data: item
lnglat : [item.location.x,item.location.y],
image : image,
data : item
}) : null
} else {
if (item.forceType == 2) {
}else{
if(item.forceType == 2){
image = '/assets/fireForcesMarkers/qita.png'
} else if (item.level == 0) {
}else if(item.level == 0){
image = '/assets/fireForcesMarkers/zongdui.png'
} else if (item.level == 1) {
}else if(item.level == 1){
image = '/assets/fireForcesMarkers/zhidui.png'
} else if (item.level == 2) {
}else if(item.level == 2){
image = '/assets/fireForcesMarkers/dadui.png'
} else if (item.level == 3) {
}else if(item.level == 3){
image = '/assets/fireForcesMarkers/zhongdui.png'
}else{
image = '/assets/fireForcesMarkers/qita.png'
}
// 用于点集合的数组
item.fireForceDetailInfo.location ?
waterMarkerArrcluster.push({
lnglat: [item.fireForceDetailInfo.location.x, item.fireForceDetailInfo.location.y],
image: image,
data: item
}) : null
item.fireForceDetailInfo.location ?
waterMarkerArrcluster.push({
lnglat : [item.fireForceDetailInfo.location.x,item.fireForceDetailInfo.location.y],
image : image,
data : item
}) : null
}
})
var gridSize = 60
var count = waterMarkerArrcluster.length;
let render = MapFactory.RenderClusterMarkerInstance();
render.contentRender = (contextCount) => {
var factor = Math.pow(contextCount / count, 1 / 18);
this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60
var count = waterMarkerArrcluster.length;
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)';
@ -240,56 +233,54 @@ export class WaterRoadComponent implements OnInit {
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,90%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20);
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = contextCount;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
return div;
};
render.pixelRender = (contextCount) => {
var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20);
return MapFactory.PixelInstance(-size / 2, -size / 2);
};
render.contentNonRender = (src) => {
return `<img class='clusterImgCollection' src="${src}" alt="">`;
};
render.pixelNonRender = () => {
return MapFactory.PixelInstance(-15, -15);
}
this.waterCluster = MapFactory.MarkerClusterInstance(this.map, waterMarkerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
maxZoom :15,
render: render //自定义聚合点样式, 自定义非聚合点样式
});
this.waterCluster.on('click',(e)=>{
if(e.clusterData.length == 1){
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
var _renderMarker = (context)=> {
var content = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`;
var offset = new AMap.Pixel(-12.5, -12.5);
context.marker.setContent(content)
context.marker.setOffset(offset)
}
},this)
this.waterCluster = new AMap.MarkerCluster(this.map, waterMarkerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式
});
this.waterCluster.on('click',(e)=>{
if(e.clusterData.length == 1){
}
})
});
}
//取消显示水源
resetWater() {
resetWater(){
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0')
this.map.remove(this.circleofwater)
this.waterCluster? this.waterCluster.setData([]) : null
this.waterCluster.setData([])
}
//计算两地距离
Calculationofdistance(bounds) {
Calculationofdistance(bounds){
let p1 = [bounds.northEast.lng, bounds.northEast.lat];
let p2 = [bounds.northEast.lng, bounds.southWest.lat];
// 返回 p1 到 p2 间的地面距离,单位:米
return this.map.distance(p1, p2);
let dis = AMap.GeometryUtil.distance(p1, p2);
return dis
}
//构造水源checkbox控制器
@ -301,67 +292,35 @@ export class WaterRoadComponent implements OnInit {
}
//地图初始化
unitMarker:IMarker//单位标点
unitMarker:any//单位标点
newPositionMarkerContent:any =
'<div class="custom-content-marker">' +
' <img style="width:20px;height:26px" src="/assets/images/dingwei.png">' +
'</div>'
creatMap(){
this.map = MapFactory.MapInstance('center',{
this.map = new AMap.Map('center',{
zoom: 13, //初始地图级别
WebGLParams: {
preserveDrawingBuffer: true
}
});
if(this.unitData.location && this.unitData.location.x){
this.map.setCenter([this.unitData.location.x,this.unitData.location.y]);
this.unitMarker = MapFactory.MarkerInstance({
this.unitMarker = new AMap.Marker({
position: [this.unitData.location.x,this.unitData.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-10, -13)
offset: new AMap.Pixel(-10, -13)
})
// 将 markers 添加到地图
this.map.add(this.unitMarker);
this.waterSubmit(1)
} else {
this.map.setCity('上海市');
}else{
this.map.setCity('株洲市');
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先前往基本信息标注单位位置', '确定', config);
this.snackBar.open('请先前往基本信息标注单位位置','确定',config);
}
}
canvasImg
takeScreenshotGis() {
// console.log(666666, this.selectingSitePlan)
// 使用html2canvas插件,将数据源中的数据转换成画布。
html2canvas(document.querySelector("#center"), {
useCORS: true, // 【重要】开启跨域配置,
allowTaint: true,//允许跨域图片
taintTest: false,//是否在渲染前测试图片
onrendered: function (canvas) {
var dataUrl = canvas.toDataURL("image/png");
}
}).then(canvas => {
// 修改生成的宽度
this.canvasImg = canvas.toDataURL("image/png");
// console.log(this.canvasImg)
}).then(() => {
this.downloadFile('水源图', this.canvasImg);
})
}
downloadFile(filename, content) {
var base64Img = content;
var oA = document.createElement('a');
oA.href = base64Img;
oA.download = filename;
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
oA.dispatchEvent(event);
}
}

2
src/app/navigation/navigation.component.html

@ -1,6 +1,6 @@
<!-- <app-tabbar></app-tabbar> -->
<mat-sidenav-container class="example-container" autosize [class.myapp-dark-theme]="darktheme">
<mat-sidenav #drawer class="example-sidenav" mode="side" [opened]="navIsOpen" color="primary" style="overflow-x: hidden;">
<mat-sidenav #drawer class="example-sidenav" mode="side" opened="true" color="primary" style="overflow-x: hidden;">
<div class="biglogobox">
<img src="../../assets/images/h130.png" alt="">
</div>

54
src/app/navigation/navigation.component.ts

@ -1,13 +1,15 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { FormControl } from '@angular/forms';
import { Component, OnInit,Inject } from '@angular/core';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from '../http-interceptors/tree.service'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { CacheTokenService } from '../http-interceptors/cache-token.service'//引入服务
import { Router, ActivatedRoute, ParamMap } from '@angular/router'
import {CacheTokenService} from '../http-interceptors/cache-token.service'//引入服务
import { Router,ActivatedRoute } from '@angular/router'
@Component({
selector: 'app-navigation',
@ -15,35 +17,25 @@ import { Router, ActivatedRoute, ParamMap } from '@angular/router'
styleUrls: ['./navigation.component.scss']
})
export class NavigationComponent implements OnInit {
constructor(public navmenus:CacheTokenService,private http: HttpClient,public dialog: MatDialog,private tree:TreeService,public snackBar: MatSnackBar,
private router:Router,private route:ActivatedRoute) { }
constructor(public navmenus: CacheTokenService, private http: HttpClient, public dialog: MatDialog, private tree: TreeService, public snackBar: MatSnackBar,
private router: Router, private route: ActivatedRoute) { }
treedata: any
isgrey: boolean
olddata: any
oldtreedata: any
treedata:any
isgrey:boolean
olddata:any
oldtreedata:any
navIsOpen: any
ngOnInit() {
this.route.queryParamMap.subscribe((params: ParamMap) => {
if (params.get('navIsOpen') == 'false') {
this.navIsOpen = 'false'
} else {
this.navIsOpen = 'true'
}
});
this.http.get('/api/Account/NavMenus').subscribe((data: any) => {
ngOnInit () {
this.http.get('/api/Account/NavMenus').subscribe((data:any)=>{
this.olddata = data
this.oldtreedata = data
let _data = this.tree.toTree(this.oldtreedata)
let _data = this.tree.toTree(this.oldtreedata)
this.treedata = _data
})
}
ngOnDestroy() {
ngOnDestroy () {
}
@ -52,11 +44,11 @@ export class NavigationComponent implements OnInit {
this.darktheme = dark;
}
defaulttheme() {
defaulttheme(){
this.darktheme = false
}
redtheme() {
redtheme(){
this.darktheme = true
}

12
src/app/ui/app-key/app-key.component.spec.ts → src/app/pages/login/login.component.spec.ts

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppKeyComponent } from './app-key.component';
import { LoginComponent } from './login.component';
describe('AppKeyComponent', () => {
let component: AppKeyComponent;
let fixture: ComponentFixture<AppKeyComponent>;
describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture<LoginComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AppKeyComponent ]
declarations: [ LoginComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AppKeyComponent);
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

293
src/app/pages/login/login.component.ts

@ -1,187 +1,148 @@
import { ApplicationRef, Component, ComponentFactoryResolver, Injector, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Data } from '../../interface'
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../http-interceptors/cache-token.service'//引入服务
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { Router,ActivatedRoute } from '@angular/router'
import {CacheTokenService} from '../../http-interceptors/cache-token.service'//引入服务
import { MatSnackBar,MatSnackBarConfig } from '@angular/material/snack-bar';
import { MatDialog,MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss'],
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss'],
})
export class LoginComponent implements OnInit {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, public snackBar: MatSnackBar, public dialog: MatDialog) {
}
ngOnInit() {
this.automaticLogin()
}
errmsg: string = ''
onSubmit(e) {
this.http.post('/api/Account/SignIn', {
name: e.name,
password: e.password
}).subscribe((data: Data) => {
sessionStorage.setItem("level", data.level);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
sessionStorage.setItem("isDefaultPassword", data.isDefaultPassword);//是否需要修改默认密码
this.http.get('/api/Account/NavMenus').subscribe((data: any) => {
let isHave = data.find(item => { return item.url == "/statisticanalysis/home" })
let isHaveGis = data.find(item => { return item.url == "/gis" })
if (isHave) {
this.router.navigate([`/statisticanalysis/home`])
this.dialogChangePassword()
return
} else if (isHaveGis) {
this.router.navigate([`/gis`])
this.dialogChangePassword()
return
} else if (data.length != 0) {
this.router.navigate([`/keyUnit`])
this.dialogChangePassword()
return
} else {
this.snackBar.open('该用户角色未分配任何菜单', '确定', {
duration: 3000
});
}
})
if (e.notlogin) { //7天免登录时
localStorage.setItem("isnologin", "true")
localStorage.setItem("token", data.token)
localStorage.setItem("refreshToken", data.refreshToken)
}
//调用服务中的function刷新token
this.token.startUp()
},
(err) => { this.errmsg = err }
)
}
dialogChangePassword() {
if (sessionStorage.getItem('isDefaultPassword') == 'true') {
let dialogRef = this.dialog.open(ChangepasswordComponent2,
{ width: '348px' });
dialogRef.afterClosed().subscribe((data) => {
sessionStorage.setItem('isDefaultPassword', 'false')
// this.lookUpdateData()
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar, public dialog: MatDialog) { }
ngOnInit() {
this.automaticLogin()
}
errmsg :string = ''
onSubmit(e){
this.http.post('/api/Account/SignIn',{
name: e.name,
password: e.password}).subscribe( (data: Data) => {
sessionStorage.setItem("level",data.level);
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
sessionStorage.setItem("isDefaultPassword",data.isDefaultPassword);//是否需要修改默认密码
this.http.get('/api/Account/NavMenus').subscribe((data:any)=>{
let isHave = data.find(item=>{ return item.url == "/statisticanalysis/home"})
let isHaveGis = data.find(item=>{ return item.url == "/gis"})
if (isHave) {
this.router.navigate([`/statisticanalysis/home`])
this.dialogChangePassword()
return
} else if(isHaveGis){
this.router.navigate([`/gis`])
this.dialogChangePassword()
return
} else if(data.length != 0){
this.router.navigate([`/keyUnit`])
this.dialogChangePassword()
return
data.forEach(item => {
if(item.url){
}
});
} else {
// this.lookUpdateData()
}
}
//查看更新内容
lookUpdateData() {
let dialogRef = this.dialog.open(lookUpdateDataComponent,
{ width: '668px' });
dialogRef.afterClosed().subscribe((data) => {
});
}
//7天免登录自动登录
automaticLogin() {
let isNoLogin = localStorage.getItem("isnologin")
if (isNoLogin) { //7天免登录时
let token = localStorage.getItem("token");
let refreshToken = localStorage.getItem("refreshToken");
this.http.post('/api/Account/RefreshToken', {
token: token,
refreshToken: refreshToken
}).subscribe((data: any) => {
sessionStorage.setItem("level", data.level);
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
this.token.startUp()
this.router.navigate(['/keyUnit'])
this.snackBar.open('已自动登录', '确定', { duration: 3000 });
})
} //if
}
//打开弹窗
open() {
this.snackBar.open('请联系管理员', '确定', {
duration: 3000
});
}else{
this.snackBar.open('该用户角色未分配任何菜单', '确定', {
duration: 3000
});
}
})
if(e.notlogin){ //7天免登录时
localStorage.setItem("isnologin","true")
localStorage.setItem("token",data.token)
localStorage.setItem("refreshToken",data.refreshToken) }
//调用服务中的function刷新token
this.token.startUp()
},
(err) => {this.errmsg = err}
)
}
dialogChangePassword(){
if(sessionStorage.getItem('isDefaultPassword') == 'true'){
let dialogRef = this.dialog.open(ChangepasswordComponent2,
{width:'348px'});
dialogRef.afterClosed().subscribe((data)=>{
sessionStorage.setItem('isDefaultPassword','false')
});
}
}
//7天免登录自动登录
automaticLogin () {
let isNoLogin = localStorage.getItem("isnologin")
if (isNoLogin) { //7天免登录时
let token = localStorage.getItem("token");
let refreshToken = localStorage.getItem("refreshToken");
this.http.post('/api/Account/RefreshToken', {
token: token,
refreshToken: refreshToken}).subscribe((data:any)=>{
sessionStorage.setItem("level",data.level);
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
this.token.startUp()
this.router.navigate(['/keyUnit'])
this.snackBar.open('已自动登录', '确定', {duration: 3000});
})
} //if
}
//打开弹窗
open () {
this.snackBar.open('请联系管理员', '确定', {
duration: 3000
});
}
}
@Component({
selector: 'app-changepassword',
templateUrl: './changePassword.html',
styleUrls: ['./changepassword.scss']
selector: 'app-changepassword',
templateUrl: './changePassword.html',
styleUrls: ['./changepassword.scss']
})
export class ChangepasswordComponent2 implements OnInit {
constructor(private http: HttpClient, public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<ChangepasswordComponent2>) { }
ngOnInit() {
}
errmsg: string = ''
onSubmit(e) {
this.http.put(
'/api/Account/Password',
{
newPassword: e.newPassword,
password: 'SHya119!@'
}
).subscribe(data => {
this.dialogRef.close(data);
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('密码修改成功', '确定', config);
}, (err) => { this.errmsg = err }
)
}
}
@Component({
selector: 'app-lookUpdateData',
templateUrl: './lookUpdateData.html',
styleUrls: ['./lookUpdateData.scss']
})
export class lookUpdateDataComponent implements OnInit {
constructor(private http: HttpClient, public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<lookUpdateDataComponent>) { }
ngOnInit() {
}
onSubmit(e) {
}
constructor(private http:HttpClient,public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<ChangepasswordComponent2>) { }
ngOnInit() {
}
errmsg :string = ''
onSubmit(e){
this.http.put(
'/api/Account/Password',
{
newPassword: e.newPassword,
password: 'SHya119!@'
}
).subscribe(data=> {
this.dialogRef.close(data);
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('密码修改成功','确定',config);
},(err) =>
{this.errmsg = err}
)
}

7
src/app/pages/login/lookUpdateData.html

@ -1,7 +0,0 @@
<p style="text-align: center;">更新公告</p>
<p>更新内容如下:</p>
<p>1.单位管理模块现在支持按照重点单位和一般单位进行查询。</p>
<p>2.在单位管理模块的列表中,我们将“关注/取消”改为了“重点单位/一般单位”,并且重点单位名称前面有红星标记,一般单位前面无标记,以便更好地区分。</p>
<p>3.在预案管理模块中,我们去掉了预案列表中的编制级别,并且增加了按照重点单位和一般单位进行查询的功能。在预案列表中的单位名称前面增加了一列显示栏,区分重点单位和一般单位。</p>
<p>4.预案列表页面中,预案的名称支持手动修改,同时转在线导入文档转成功后名称去掉 “转在线编制”。 </p>
<p>5.点击系统右上角的“?”下载重点单位设置说明,以便更好地了解如何设置重点单位。 </p>

6
src/app/pages/pages-routing.module.ts

@ -1,8 +1,10 @@
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { HomeComponent } from './home/home.component';
import { HomedetailComponent } from './homedetail/homedetail.component';
const routes: Routes = [
{ path: '', component: HomeComponent},
{ path: 'detail', component: HomedetailComponent},
];
@NgModule({

2
src/app/pages/pages.component.html

@ -1 +1 @@
<p>pages works!</p>

6
src/app/pages/pages.module.ts

@ -1,9 +1,11 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PagesComponent } from './pages.component';
import { ChangepasswordComponent2, LoginComponent, lookUpdateDataComponent } from './login/login.component';
import { ChangepasswordComponent2, LoginComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component';
import { PagesRoutingModule } from './pages-routing.module'
import {A11yModule} from '@angular/cdk/a11y';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {PortalModule} from '@angular/cdk/portal';
@ -52,7 +54,7 @@ import { HomeComponent } from './home/home.component';
import { HomedetailComponent } from './homedetail/homedetail.component';
import { UiModule } from '../ui/ui.module';
@NgModule({
declarations: [PagesComponent, LoginComponent, RegisterComponent, LockscreenComponent, HomeComponent, HomedetailComponent,ChangepasswordComponent2,lookUpdateDataComponent],
declarations: [PagesComponent, LoginComponent, RegisterComponent, LockscreenComponent, HomeComponent, HomedetailComponent,ChangepasswordComponent2],
imports: [
PagesRoutingModule,

122
src/app/pipes/boolean.pipe.ts

@ -1,95 +1,63 @@
import { Pipe, PipeTransform } from "@angular/core";
import {
isno,
PlanTypeEnum,
AuditStatusEnum,
PlanLevelEnum,
PlanAuditStatusEnum,
} from "../interface";
@Pipe({ name: "isno" })
import { Pipe, PipeTransform } from '@angular/core';
import { isno, PlanTypeEnum, AuditStatusEnum, PlanLevelEnum } from '../interface'
@Pipe({ name: 'isno' })
export class IsnoPipe implements PipeTransform {
transform(value: boolean): string {
if (value) {
var x = 0;
} else {
x = 1;
transform(value: boolean): string {
if (value) {
var x = 0
} else {
x = 1
}
return isno[x]
}
return isno[x];
}
}
@Pipe({ name: "plantype" })
@Pipe({ name: 'plantype' })
export class PlanType implements PipeTransform {
transform(value: number): string {
return PlanTypeEnum[value];
}
transform(value: number): string {
return PlanTypeEnum[value]
}
}
@Pipe({ name: "auditsatus" })
@Pipe({ name: 'auditsatus' })
export class AuditSatus implements PipeTransform {
transform(value: number): string {
return AuditStatusEnum[value];
}
transform(value: number): string {
return AuditStatusEnum[value]
}
}
@Pipe({ name: "planlevel" })
@Pipe({ name: 'planlevel' })
export class PlanLevel implements PipeTransform {
transform(value: number): string {
return PlanLevelEnum[value];
}
transform(value: number): string {
return PlanLevelEnum[value]
}
}
@Pipe({ name: "state" })
@Pipe({ name: 'state' })
export class state implements PipeTransform {
transform(value: number): string {
if (value == 3) {
return "维护中";
} else if (value == 4) {
return "维护通过审核";
} else if (value == 5) {
return "维护驳回审核";
} else {
return "未维护";
transform(value: number): string {
if (value == 3) {
return '维护中'
} else if (value == 4) {
return '维护通过审核'
} else if (value == 5) {
return '维护驳回审核'
} else {
return '未维护'
}
}
}
}
@Pipe({ name: "auditState" })
export class auditState implements PipeTransform {
transform(value: number): string {
return PlanAuditStatusEnum[value];
}
}
@Pipe({ name: "differentContentTitle" })
@Pipe({ name: 'differentContentTitle' })
export class differentContentTitle implements PipeTransform {
transform(value: string): string {
if (typeof value == "boolean" && value) {
return "是";
} else if (typeof value == "boolean" && !value) {
return "否";
} else if (JSON.stringify(value) == "{}") {
return "空";
} else if (!value) {
return "空";
} else {
return value;
}
}
}
@Pipe({ name: "yuan" })
export class yuan implements PipeTransform {
transform(value: string): string {
if (value == "LevelOne") {
return "一级预案";
} else if (value == "LevelTwo") {
return "二级预案";
} else if (value == "LevelThree") {
return "三级预案";
} else if (value == "LevelFour") {
return "四级预案";
} else if (value == "LevelFive") {
return "五级预案";
} else if (value == "PlanText") {
return "文本预案";
transform(value: string): string {
if (typeof (value) == 'boolean' && value) {
return '是'
} else if (typeof (value) == 'boolean' && !value) {
return '否'
} else if (!value) {
return '空'
} else {
return value
}
}
}
}

6
src/app/plan-audit/allaround/allaround.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

6
src/app/plan-audit/basic-info/basic-info.component.scss

@ -2,6 +2,12 @@
table,table tr th, table tr td { border: 1px solid #EEF1F5; }
table { text-align: center; border-collapse: collapse; padding:2px;}
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

6
src/app/plan-audit/cad-draw/cad-draw.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

161
src/app/plan-audit/fire-facilities/fire-facilities.component.html

@ -7,117 +7,58 @@
* @LastEditTime: 2021-03-15 16:32:59
-->
<div class="content">
<p>单位消防设施</p>
<div id="firefacilities" *ngFor="let item of companyBuiltInGrouping;let key = index" style="margin-top: 10px;">
<mat-accordion class="tableContent">
<mat-expansion-panel style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title style="font-size: 14px;">
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="column" *ngFor="let items of item.facilityItems">
<div class="up">
<div class="left">
<span style="margin-left: 25px;margin-top: 3%;white-space: nowrap;">项目:{{items.name}}</span>
</div>
<div class="centernum">
<span style="margin-left: 35px;">{{items.total ? items.total : '总数: 0'}}</span>
</div>
</div>
<div class="down">
<span style="margin-left: 25px;margin-top: 3%;">主要情况:{{items.details}}</span>
</div>
<div class="imgdown">
<span style="margin-left: 25px;color: #0080FF;"><a style="color: #0080FF;" href="javascript:void(0)"
(click)='previewImg(items)'>查看图片</a></span>
<label style="float: right;margin-right: 10%;cursor:pointer" (click)='SwitchBoard(items)'><input
style="margin-right: 5px;cursor:pointer" [(ngModel)]="items.expanded?down:open" readonly><img
[src]="items.expanded?imgsrcdown:imgsrcopen" (click)='SwitchBoard(items)'></label>
</div>
<div class="overflowTable" *ngIf="items.expanded">
<div class="detailsTable">
<table>
<tr *ngFor="let header of items.header">
<th>{{header}}</th>
<td *ngFor="let body of items.body">{{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 *ngFor="let header of tableMsg.header">
<th>{{header}}</th>
<td *ngFor="let body of tableMsg.body">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
<p>建筑消防设施</p>
<div *ngFor="let element of allBuildingGrouping">
<p>建筑名:{{element.name}}</p>
<div id="firefacilities" *ngFor="let item of element.buildingFacilityGroups;let key = index"
style="margin-top: 10px;">
<mat-accordion class="tableContent">
<div id="firefacilities" *ngFor="let item of companyBuiltInGrouping;let key = index" style="margin-top: 10px;">
<mat-accordion class="tableContent" >
<mat-expansion-panel style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title style="font-size: 14px;">
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="column" *ngFor="let items of item.facilityItems">
<div class="up">
<div class="left">
<span style="margin-left: 25px;margin-top: 3%;white-space: nowrap;">项目:{{items.name}}</span>
</div>
<div class="centernum">
<span style="margin-left: 35px;">{{items.total ? items.total : '总数: 0'}}</span>
</div>
</div>
<div class="down">
<span style="margin-left: 25px;margin-top: 3%;">主要情况:{{items.details}}</span>
</div>
<div class="imgdown">
<span style="margin-left: 25px;color: #0080FF;"><a style="color: #0080FF;" href="javascript:void(0)"
(click)='previewImg(items)'>查看图片</a></span>
<label style="float: right;margin-right: 10%;cursor:pointer" (click)='SwitchBoard(items)'><input
style="margin-right: 5px;cursor:pointer" [(ngModel)]="items.expanded?down:open" readonly><img
[src]="items.expanded?imgsrcdown:imgsrcopen" (click)='SwitchBoard(items)'></label>
</div>
<div class="overflowTable" *ngIf="items.expanded">
<div class="detailsTable">
<table>
<tr *ngFor="let header of items.header">
<th>{{header}}</th>
<td *ngFor="let body of items.body">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title style="font-size: 14px;" >
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header >
<div class="column" *ngFor="let items of item.facilityItems">
<div class="up">
<div class="left">
<span style="margin-left: 25px;margin-top: 3%;white-space: nowrap;">项目:{{items.name}}</span>
</div>
<div class="centernum">
<span style="margin-left: 35px;">{{items.total ? items.total : '总数: 0'}}</span>
</div>
</div>
<div class="down">
<span style="margin-left: 25px;margin-top: 3%;">主要情况:{{items.details}}</span>
</div>
<div class="imgdown">
<span style="margin-left: 25px;color: #0080FF;"><a style="color: #0080FF;" href="javascript:void(0)" (click)='previewImg(items)'>查看图片</a></span>
<label style="float: right;margin-right: 10%;cursor:pointer" (click)='SwitchBoard(items)'><input style="margin-right: 5px;cursor:pointer" [(ngModel)]="items.expanded?down:open" readonly><img [src]="items.expanded?imgsrcdown:imgsrcopen" (click)='SwitchBoard(items)' ></label>
</div>
<div class="overflowTable" *ngIf="items.expanded">
<div class="detailsTable">
<table>
<tr *ngFor="let header of items.header">
<th >{{header}}</th>
<td *ngFor="let body of items.body">{{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 *ngFor="let header of tableMsg.header">
<th >{{header}}</th>
<td *ngFor="let body of tableMsg.body">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</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 *ngFor="let header of tableMsg.header">
<th>{{header}}</th>
<td *ngFor="let body of tableMsg.body">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
</div>

6
src/app/plan-audit/fire-facilities/fire-facilities.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

837
src/app/plan-audit/fire-facilities/fire-facilities.component.ts

@ -7,13 +7,12 @@
* @LastEditTime: 2021-03-02 09:32:21
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'
import {HttpClient, HttpHeaders} from '@angular/common/http'
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
//import { ImgsDataDetail2 } from './addGrouping.component'
import { MatSnackBarConfig, MatSnackBar } from '@angular/material/snack-bar';
import { ImagesData2 } from './imagesdata.component'
import { Router, ActivatedRoute } from '@angular/router'
import { concatMap } from 'rxjs/operators';
import { Router,ActivatedRoute } from '@angular/router'
export interface Food {
value: string;
name: string;
@ -26,415 +25,505 @@ export interface Food {
})
export class FireFacilitiesComponent implements OnInit {
constructor(private router: Router, private route: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar) { }
constructor(private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
this.getAllBuilding()
}
unitId: any = sessionStorage.getItem('companyId')
//定义属性数据
singleElection: Food[] = [
{ value: 'true', name: '有' },
{ value: 'false', name: '无' }]
companyBuiltInGrouping: any = []; //单位消防设施内置分组
companyDetails: any = []; //单位详情
companyEachDetails: any = [] //单位每层详情
companyOptionalGrouping: any = []; //单位消防设施可选分组
open = "详情"
down = "收起"
imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown = "../../../assets/images/routup2.png"
tableshow = true
//获得单位基本信息
getCompanyInformation() {
//let companyId = this.route.snapshot.queryParams.id
let companyId = this.unitId
this.http.get(`/api/Companies/${companyId}`).subscribe((data: any) => {
if (data.buildingTypes.length) {
let newData = { buildingType: data.buildingTypes[0].id, companyId: companyId }
this.http.get('/api/CompanyFacilities', { params: newData }).subscribe((data: any) => { //获得单位的消防设施
console.log('公司消防设施', data)
this.companyBuiltInGrouping = data[0].summary.companyFacilityGroups
this.companyOptionalGrouping = data[0].summary.companyOptionalGroups
this.companyDetails = data[0].details
this.companyEachDetails = data[0].eachDetails
this.companyBuiltInGrouping.forEach(element => { //循环单位内置分组项
element.selectBuiltInGrouping = []
element.facilityItems.forEach((elements, index) => {
elements.total = element.facilityCount[index]
elements.expanded = false
unitId:any = sessionStorage.getItem('companyId')
//定义属性数据
singleElection:Food[]=[
{value:'true', name: '有'},
{value:'false', name: '无'}]
companyBuiltInGrouping:any = []; //单位消防设施内置分组
companyDetails:any = []; //单位详情
companyEachDetails:any = [] //单位每层详情
companyOptionalGrouping:any = []; //单位消防设施可选分组
open="详情"
down="收起"
imgsrcopen="../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png"
tableshow=true
//获得单位基本信息
getCompanyInformation () {
//let companyId = this.route.snapshot.queryParams.id
let companyId = this.unitId
this.http.get(`/api/Companies/${companyId}`).subscribe((data:any)=>{
if (data.buildingTypes.length) {
let newData = {buildingType: data.buildingTypes[0].id,companyId : companyId}
this.http.get('/api/CompanyFacilities',{params:newData}).subscribe((data:any)=>{ //获得单位的消防设施
this.companyBuiltInGrouping = data[0].summary.companyFacilityGroups
this.companyOptionalGrouping = data[0].summary.companyOptionalGroups
this.companyDetails = data[0].details
this.companyEachDetails = data[0].eachDetails
this.companyBuiltInGrouping.forEach(element => { //循环单位内置分组项
element.selectBuiltInGrouping = []
element.facilityItems.forEach((elements,index) => {
elements.total = element.facilityCount[index]
elements.expanded = false});
});
});
if (sessionStorage.getItem("tabsindex") == "4") {
this.companyBuiltInGrouping = [this.companyBuiltInGrouping[1]]
this.companyOptionalGrouping = []
}
if (sessionStorage.getItem("tabsindex") == "5") {
this.companyBuiltInGrouping.splice(1, 1)
}
}) //http
} //if
})
}
//单位消防设施切换展开面板
SwitchBoard(e) {
e.expanded = !e.expanded
if (e.expanded) { //展开面板展开时
if (e.isEachFloor) { //逐层统计时
let data = this.companyEachDetails[e.name]
if (data) {
e.loopTable = []
data.forEach(item => {
let tableMsg = { name: item.name, header: [], body: [] }
item.assets[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
tableMsg.header.push(element.propertyName + unit)
}
if(sessionStorage.getItem("tabsindex") == "4"){
this.companyBuiltInGrouping = [this.companyBuiltInGrouping[1]]
this.companyOptionalGrouping = []
}
if(sessionStorage.getItem("tabsindex") == "5"){
this.companyBuiltInGrouping.splice(1,1)
}
}) //http
} //if
})
}
//创建单位消防设施内置分组项
addCompanyGrouping (e) {
let data = e
let dialogRef = this.dialog.open(ImagesData2,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data) { e.facilityItems.push(data) } });
}
//保存单位消防设施内置分组项
editCompanyGrouping(e) {
let header = {groupId:e.id}
let data = []
e.facilityItems.forEach((element,index) => {
let msg = {
isBuiltin: element.isBuiltin,
details: element.details,
name: element.name,
isEachFloor: element.isEachFloor,
order: element.order}
data.push(msg)
if (index==e.facilityItems.length-1) {
this.http.post('/api/CompanyFacilityItems/Batch',data,{params:header}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
}) }
}); //forEach
}
//checked单位消防设施内置分组项时
checkedCompany (e,item,items) {
if (e.checked) {
item.selectBuiltInGrouping.push(items)
} else {
item.selectBuiltInGrouping.splice(item.selectBuiltInGrouping.findIndex(oldItem => oldItem == items), 1)
}
}
//删除消防设施内置分组项
deleteCompanyGrouping (e) {
if (e.selectBuiltInGrouping.length) {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
let msg:any = `?groupId=${e.id}`
e.selectBuiltInGrouping.forEach((element,index) => {
let data = `&name=${element.name}`
msg = msg + data
if (index === e.selectBuiltInGrouping.length-1) {
this.http.delete('/api/CompanyFacilityItems/Batch' + msg).subscribe(data=>{
let deleteMsg = e.selectBuiltInGrouping
deleteMsg.forEach(deleteElement => {
e.facilityItems.splice(e.facilityItems.findIndex(item=>item.name==deleteElement.name),1)
});
e.selectBuiltInGrouping = []
}) //http
} //if
}); //forEach
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择内置分组项','确定',config);
}
}
//保存单位消防设施可选分组
editCompanyOptional (e,item) {
e.stopPropagation() //阻止冒泡
item.propertyInfos.forEach((element,index) => {
element.propertyValue = String(element.propertyValue)
if (index == item.propertyInfos.length-1 ) {
this.http.post('/api/CompanyOptionalGroups',item).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
} //if
});
}
//单位消防设施切换展开面板
SwitchBoard (e) {
e.expanded = !e.expanded
if (e.expanded) { //展开面板展开时
if (e.isEachFloor) { //逐层统计时
let data = this.companyEachDetails[e.name]
if (data) {
e.loopTable = []
data.forEach(item => {
let tableMsg = {name:item.name, header:[], body:[]}
item.assets[0].propertyInfos.forEach(element => { //表头
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
tableMsg.header.push(element.propertyName+unit)}
});
item.assets.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
}); //propertyInfos
tableMsg.body.push(everyBody)
}); //assets
e.loopTable.push(tableMsg)
});
} //data有数据时
} else { //非逐层统计时
let data = this.companyDetails[e.name]
if (data) {
e.header = []
e.body = []
data[0].propertyInfos.forEach(element => { //表头
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
e.header.push(element.propertyName+unit)}
});
item.assets.forEach(element => { //表格内容
data.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
}); //propertyInfos
tableMsg.body.push(everyBody)
}); //assets
e.loopTable.push(tableMsg)
});
} //data有数据时
} else { //非逐层统计时
let data = this.companyDetails[e.name]
if (data) {
e.header = []
e.body = []
data[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
e.header.push(element.propertyName + unit)
}
});
data.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
});
e.body.push(everyBody)
});
e.body.push(everyBody)
});
}
} //非逐层统计时
}
}
allBuildingGrouping: any; //所有建筑的消防设施 内置分组+可选分组
//获取所有建筑
getAllBuilding() {
let companyId = this.unitId
this.http.get('/api/Buildings', {
params: {
companyId: companyId
}
} //非逐层统计时
}
}).subscribe((data: any) => {
this.allBuildingGrouping = data
if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() }
})
}
//获取所有建筑的消防设施
getAllBuildingFacilities() {
let companyId = this.unitId
this.allBuildingGrouping.forEach(element => {
let header = { buildingId: element.id, buildingType: element.buildingTypes[0].id, companyId: companyId }
this.http.get('/api/BuildingFacilities', { params: header }).subscribe(data => {
element.buildingFacilityGroups = data[0].summary.buildingFacilityGroups
element.buildingOptionalGroups = data[0].summary.buildingOptionalGroups
element.buildingDetails = data[0].details
element.buildingEachDetails = data[0].eachDetails
element.buildingFacilityGroups.forEach((elements) => { //循环每个建筑内置分组项
elements.selectBuiltInGrouping = []
elements.facilityItems.forEach((newElement, index) => {
newElement.total = elements.facilityCount[index]
newElement.expanded = false
});
});
// if (sessionStorage.getItem("tabsindex") == "4") {
// element.buildingFacilityGroups = [element.buildingFacilityGroups[1]]
// element.buildingOptionalGroups = []
// }
// if (sessionStorage.getItem("tabsindex") == "5") {
// element.buildingFacilityGroups.splice(1, 1)
// }
}
allBuildingGrouping:any; //所有建筑的消防设施 内置分组+可选分组
//获取所有建筑
getAllBuilding () {
let companyId = this.unitId
this.http.get('/api/Buildings',{params:{
companyId:companyId
}}).subscribe((data:any)=>{
this.allBuildingGrouping = data
if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() }
})
});
console.log('建筑消防设施', this.allBuildingGrouping)
}
//建筑消防设施切换展开面板
SwitchBuildingBoard(item, e) {
e.expanded = !e.expanded
if (e.expanded) { //展开面板展开时
if (e.isEachFloor) { //逐层统计时
let data = item.buildingEachDetails[e.name]
if (data) {
e.loopTable = []
data.forEach(item => {
let tableMsg = { name: item.name, header: [], body: [] }
item.assets[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
tableMsg.header.push(element.propertyName + unit)
}
}
//获取所有建筑的消防设施
getAllBuildingFacilities () {
let companyId = this.unitId
this.allBuildingGrouping.forEach(element => {
let header = {buildingId: element.id, buildingType: element.buildingTypes[0].id,companyId:companyId}
this.http.get('/api/BuildingFacilities',{params:header}).subscribe(data=>{
element.buildingFacilityGroups = data[0].summary.buildingFacilityGroups
element.buildingOptionalGroups = data[0].summary.buildingOptionalGroups
element.buildingDetails = data[0].details
element.buildingEachDetails = data[0].eachDetails
element.buildingFacilityGroups.forEach((elements) => { //循环每个建筑内置分组项
elements.selectBuiltInGrouping = []
elements.facilityItems.forEach((newElement,index) => {
newElement.total = elements.facilityCount[index]
newElement.expanded = false });
});
if(sessionStorage.getItem("tabsindex") == "4"){
element.buildingFacilityGroups = [element.buildingFacilityGroups[1]]
element.buildingOptionalGroups = []
}
if(sessionStorage.getItem("tabsindex") == "5"){
element.buildingFacilityGroups.splice(1,1)
}
})
});
}
//保存建筑消防设施内置分组项
editBuildingGrouping (e,item) {
let companyId = this.unitId
let header = {companyId:companyId,buildingId:e.id, groupId:item.id}
let data = []
item.facilityItems.forEach((element,index) => {
let msg = {
isBuiltin: element.isBuiltin,
details: element.details,
name: element.name,
isEachFloor: element.isEachFloor,
order: element.order}
data.push(msg)
if (index==item.facilityItems.length-1) {
this.http.post('/api/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
}) }
}); //forEach
}
//保存建筑消防设施可选分组
editBuildingOptional (e,item) {
let companyId = this.unitId
e.stopPropagation() //阻止冒泡
item.propertyInfos.forEach((element,index) => {
element.propertyValue = String(element.propertyValue)
if (index == item.propertyInfos.length-1 ) {
this.http.post('/api/BuildingOptionalGroups',item,{params:{
companyId :companyId
}}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
} //if
});
}
//建筑消防设施切换展开面板
SwitchBuildingBoard (item,e) {
e.expanded = !e.expanded
if (e.expanded) { //展开面板展开时
if (e.isEachFloor) { //逐层统计时
let data = item.buildingEachDetails[e.name]
if (data) {
e.loopTable = []
data.forEach(item => {
let tableMsg = {name:item.name, header:[], body:[]}
item.assets[0].propertyInfos.forEach(element => { //表头
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
tableMsg.header.push(element.propertyName+unit)}
});
item.assets.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
}); //propertyInfos
tableMsg.body.push(everyBody)
}); //assets
e.loopTable.push(tableMsg)
});
} //data有数据时
} else { //非逐层统计时
let data = item.buildingDetails[e.name]
if (data) {
e.header = []
e.body = []
data[0].propertyInfos.forEach(element => { //表头
if (element.propertyType!=3) {
let unit = element.physicalUnit? '('+ element.physicalUnit +')' : '' //单位
e.header.push(element.propertyName+unit)}
});
item.assets.forEach(element => { //表格内容
data.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
element.propertyInfos.forEach((elements,index) => {
if (elements.propertyType!=3 && elements.propertyName!='图片' && elements.propertyType!=6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue }
if (elements.propertyType==6) {
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = elements.propertyValue=='1'?'是':'否' }
if (elements.propertyType!=3 && elements.propertyName=='图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
}); //propertyInfos
tableMsg.body.push(everyBody)
}); //assets
e.loopTable.push(tableMsg)
});
} //data有数据时
} else { //非逐层统计时
let data = item.buildingDetails[e.name]
if (data) {
e.header = []
e.body = []
data[0].propertyInfos.forEach(element => { //表头
if (element.propertyType != 3) {
let unit = element.physicalUnit ? '(' + element.physicalUnit + ')' : '' //单位
e.header.push(element.propertyName + unit)
}
});
data.forEach(element => { //表格内容
let everyBody = {}
element.propertyInfos.forEach((elements, index) => {
if (elements.propertyType != 3 && elements.propertyName != '图片' && elements.propertyType != 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue
}
if (elements.propertyType == 6) {
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = elements.propertyValue == '1' ? '是' : '否'
}
if (elements.propertyType != 3 && elements.propertyName == '图片') {
let imgLength = []
element.propertyInfos.find(item => { if (item.propertyType == 3) { imgLength.push(item) } })
let unit = elements.physicalUnit ? '(' + elements.physicalUnit + ')' : '' //单位
everyBody[elements.propertyName + unit] = String(imgLength.length)
}
element.propertyInfos.find(item=>{ if(item.propertyType==3){imgLength.push(item)} })
let unit = elements.physicalUnit? '('+ elements.physicalUnit +')' : '' //单位
everyBody[elements.propertyName+unit] = String(imgLength.length) }
});
e.body.push(everyBody)
});
e.body.push(everyBody)
});
}
} //非逐层统计时
}
} //非逐层统计时
}
}
}
//单位消防设施预览图片
previewImg(e) {
console.log(e)
if (e.isEachFloor) { //逐层统计时
let newData = this.companyEachDetails[e.name]
if (newData) {
let data = { name: e.name, images: [] }
let imgName
newData.forEach(item => {
item.assets.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
elements.propertyName = imgName
data.images.push(elements)
}
//单位消防设施预览图片
previewImg (e) {
if (e.isEachFloor) { //逐层统计时
let newData = this.companyEachDetails[e.name]
if (newData) {
let data = {name:e.name, images:[]}
let imgName
newData.forEach(item => {
item.assets.forEach(element => {
element.propertyInfos.forEach( elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)} });
});
});
}); //newDate
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { width: '1350px', height: '700px', data }); //打开图片弹窗
} else {
}); //newDate
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2,{width:'1350px',height:'700px',data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据','确定',config);
}
} else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
} else { //非逐层统计时
let newData = this.companyDetails[e.name]
let imgName
if (newData) {
let data = { name: e.name, images: [] }
newData.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
elements.propertyName = imgName
data.images.push(elements)
}
this.snackBar.open('暂无图片数据','确定',config); }
} else { //非逐层统计时
let newData = this.companyDetails[e.name]
let imgName
if (newData) {
let data = {name:e.name, images:[]}
newData.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)} });
});
});
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { width: '1350px', height: '700px', data }); //打开图片弹窗
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2,{width:'1350px',height:'700px',data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据','确定',config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
this.snackBar.open('暂无图片数据','确定',config); }
}
}
}
//建筑消防设施预览图片
previewBuildingImg(item, e) {
if (e.isEachFloor) { //逐层统计时
let newData = item.buildingEachDetails[e.name]
if (newData) {
let data = { name: e.name, images: [] }
let imgName
newData.forEach(item => {
item.assets.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
elements.propertyName = imgName
data.images.push(elements)
}
//建筑消防设施预览图片
previewBuildingImg (item,e) {
if (e.isEachFloor) { //逐层统计时
let newData = item.buildingEachDetails[e.name]
if (newData) {
let data = {name:e.name, images:[]}
let imgName
newData.forEach(item => {
item.assets.forEach(element => {
element.propertyInfos.forEach( elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)} });
});
});
}); //newDate
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { width: '1350px', height: '700px', data }); //打开图片弹窗
} else {
}); //newDate
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2,{width:'1350px',height:'700px',data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据','确定',config);
}
} else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
} else { //非逐层统计时
let newData = item.buildingDetails[e.name]
let imgName
if (newData) {
let data = { name: e.name, images: [] }
newData.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) { imgName = elements.propertyValue }
if (elements.propertyType === 3) {
elements.propertyName = imgName
data.images.push(elements)
}
this.snackBar.open('暂无图片数据','确定',config); }
} else { //非逐层统计时
let newData = item.buildingDetails[e.name]
let imgName
if (newData) {
let data = {name:e.name, images:[]}
newData.forEach(element => {
element.propertyInfos.forEach(elements => {
if (elements.propertyName.includes('名称')) {imgName = elements.propertyValue}
if (elements.propertyType===3) {
elements.propertyName = imgName
data.images.push(elements)}
});
});
});
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2, { width: '1350px', height: '700px', data }); //打开图片弹窗
if (data.images.length) {
let dialogRef = this.dialog.open(ImagesData2,{width:'1350px',height:'700px',data}); //打开图片弹窗
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据','确定',config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据', '确定', config);
this.snackBar.open('暂无图片数据','确定',config); }
}
}
}
}

47
src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts

@ -2,12 +2,10 @@ import { HttpClient } from '@angular/common/http';
import { Component, Input, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MapFactory } from '@src/modules/map/declare/factory';
import { IMap, IMarker } from '@src/modules/map/declare/map';
import Viewer from 'viewerjs'
import { ViewDetailsComponent } from '../view-details/view-details.component';
declare var CryptoJS
declare var AMap: any;
@Component({
selector: 'app-fireforce-audit',
templateUrl: './fireforce-audit.component.html',
@ -39,27 +37,27 @@ export class FireforceAuditComponent implements OnInit {
this.FireForceDetailInfo.RelevantInfomationData ? this.AttachmentArr = JSON.parse(this.FireForceDetailInfo.RelevantInfomationData) : null
console.log(789,this.ZongcontactData)
setTimeout(() => {
this.map = MapFactory.MapInstance('container', {
this.map = new AMap.Map('container', {
zoom:18
})
if(this.FireForceDetailInfo.location && this.FireForceDetailInfo.location.x){
this.map.setCenter([this.FireForceDetailInfo.location.x,this.FireForceDetailInfo.location.y]);
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.FireForceDetailInfo.location.x,this.FireForceDetailInfo.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-10, -12)
offset: new AMap.Pixel(-10, -12)
})
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
}else{
this.map.setCity('上海市');
this.map.setCity('株洲市');
}
}, 0);
}
map:IMap
newPositionMarker:IMarker
map:any
newPositionMarker:any
newPositionMarkerContent:any =
'<div class="custom-content-marker">' +
' <img style="width:20px;height:24px" src="/assets/images/dingwei.png">' +
@ -163,13 +161,32 @@ export class FireforceAuditComponent implements OnInit {
}
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName
if (suffix == 'docx' || suffix == 'doc') {
let arr = fetchUrl.split('.')
arr[arr.length - 1] = 'pdf'
window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
}else if (suffix == 'pdf') {
window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl);
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray);
let jwt = sessionStorage.getItem("token");
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]);
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt);
let identityJsonparse=JSON.parse(identityJson)
let json={
doc: {
docId: docId,
title: item.fileName,
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl
},
user: {
uid: identityJsonparse.sub,
nickName: identityJsonparse.name,
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`)
}
if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去

71
src/app/plan-audit/function-partition/function-partition.component.html

@ -7,18 +7,18 @@
* @LastEditTime: 2020-11-25 18:41:18
-->
<div class="content">
<div class="center" id="functionpartition">
<div style="margin: 10px 0;">
<mat-accordion class="tableContent">
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='40px' expandedHeight='40px' class="panelhead">
<div class="center" id="functionpartition">
<div style="margin: 10px 0;">
<mat-accordion class="tableContent">
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' class="panelhead">
<mat-panel-title style="font-size: 14px;">
单位功能分区
</mat-panel-title>
</mat-expansion-panel-header>
<div class="column" *ngFor="let item of companyFunctionalZoning">
<div class="up">
<span style="color: #0080FF;">区域:{{item.region}}</span>
@ -31,33 +31,34 @@
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
<div style="margin-bottom: 10px;" *ngFor="let item of allBuilding;let key = index">
<mat-accordion class="tableContent">
<mat-expansion-panel expanded>
<mat-expansion-panel-header class="panelhead">
<mat-panel-title style="font-size: 14px;">
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="column" *ngFor="let i of item.functionalZoning">
<div class="up">
<span style="color: #0080FF;">区域:{{i.region}}</span>
</div>
<div class="areacenter">
<span>面积:{{i.area}}</span>
</div>
<div class="down">
<span style="display: inline-block;">基本情况:{{i.details}}</span>
</div>
</mat-accordion>
</div>
<div style="margin-bottom: 10px;" *ngFor="let item of allBuildingFunctionalZoning;let key = index">
<mat-accordion class="tableContent">
<mat-expansion-panel >
<mat-expansion-panel-header class="panelhead">
<mat-panel-title style="font-size: 14px;">
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="column" *ngFor="let item of companyFunctionalZoning">
<div class="up">
<span style="color: #0080FF;">区域:{{item.region}}</span>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
<div class="areacenter">
<span>面积:{{item.area}}</span>
</div>
<div class="down">
<span style="display: inline-block;">基本情况:{{item.details}}</span>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
</div>
</div>

6
src/app/plan-audit/function-partition/function-partition.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

146
src/app/plan-audit/function-partition/function-partition.component.ts

@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { Router, ActivatedRoute } from '@angular/router'
import { Router,ActivatedRoute } from '@angular/router'
@Component({
selector: 'app-function-partition',
@ -11,7 +11,7 @@ import { Router, ActivatedRoute } from '@angular/router'
})
export class FunctionPartitionComponent implements OnInit {
constructor(private router: Router, private route: ActivatedRoute, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar) { }
constructor(private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.companyId = this.unitId
@ -20,54 +20,49 @@ export class FunctionPartitionComponent implements OnInit {
}
displayedColumns: string[] = ['checked', 'region', 'measure', 'situation'];
unitId: any = sessionStorage.getItem('companyId')
unitId:any = sessionStorage.getItem('companyId')
companyId: any; //单位编号
companyFunctionalZoning: any = []; //所有单位功能分区属性
selectFunctionalZoning: any = []; //选中的单位功能分区属性
companyId:any; //单位编号
companyFunctionalZoning:any=[]; //所有单位功能分区属性
selectFunctionalZoning:any=[]; //选中的单位功能分区属性
//获得所有单位功能分区属性
getAllCompany() {
getAllCompany () {
let companyId = this.unitId
this.http.get('/api/CompanyFunctionalDivisions', {
params: {
companyId: companyId
}
}).subscribe((data: any) => {
this.http.get('/api/CompanyFunctionalDivisions',{params:{
companyId:companyId
}}).subscribe((data:any)=>{
this.companyFunctionalZoning = data
console.log(this.companyFunctionalZoning)
this.selectFunctionalZoning = []
})
}
//新建单位功能分区属性
addCompany() {
addCompany () {
let companyId = this.route.snapshot.queryParams.id
let data = { companyId: companyId, region: '', area: 0, details: '' }
let data = {companyId:companyId, region:'', area:0, details:''}
this.companyFunctionalZoning.push(data)
this.preservation()
}
//保存单位功能分区属性
preservation() {
preservation () {
let companyId = this.unitId
if (this.companyFunctionalZoning.length) {
this.http.post('/api/CompanyFunctionalDivisions/Batch', this.companyFunctionalZoning, {
params: {
companyId: companyId
}
}).subscribe(data => {
this.http.post('/api/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning,{params:{
companyId:companyId
}}).subscribe(data=>{
this.getAllCompany()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功', '确定', config);
this.snackBar.open('数据更新成功','确定',config);
})
}
}
//单位功能分区checked选择
changeCompany(ele, e) {
changeCompany (ele,e) {
if (e.checked) {
this.selectFunctionalZoning.push(ele.id)
} else {
@ -76,26 +71,23 @@ export class FunctionPartitionComponent implements OnInit {
}
//删除单位功能分区属性
delete() {
delete () {
let companyId = this.unitId
if (this.selectFunctionalZoning.length) {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
this.http.post('/api/CompanyFunctionalDivisions/Batch', this.companyFunctionalZoning, {
params: {
companyId: companyId
}
}).subscribe(data => {
this.http.post('/api/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning,{params:{
companyId:companyId
}}).subscribe(data=>{
const options = {
headers: new HttpHeaders({ 'Content-Type': 'application/json', }),
body: this.selectFunctionalZoning
}
this.http.delete(`/api/CompanyFunctionalDivisions/Batch`, options).subscribe(data => {
headers: new HttpHeaders({'Content-Type': 'application/json',}),
body:this.selectFunctionalZoning}
this.http.delete(`/api/CompanyFunctionalDivisions/Batch`,options).subscribe(data=>{
this.getAllCompany()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功', '确定', config);
this.snackBar.open('数据更新成功','确定',config);
})
})
}
@ -103,7 +95,7 @@ export class FunctionPartitionComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择单位功能分区', '确定', config);
this.snackBar.open('请选择单位功能分区','确定',config);
}
}
@ -112,18 +104,16 @@ export class FunctionPartitionComponent implements OnInit {
//建筑功能分区↓
allBuilding: any = []; //所有建筑
allBuildingFunctionalZoning: any = []; //所有建筑的功能分区
selectBuildingFunctionalZoning: any = []; //选中的建筑的功能分区
allBuilding:any = []; //所有建筑
allBuildingFunctionalZoning:any = []; //所有建筑的功能分区
selectBuildingFunctionalZoning:any = []; //选中的建筑的功能分区
//获得所有建筑
getAllBuilding() {
getAllBuilding () {
let companyId = this.unitId
this.http.get(`/api/Buildings`, {
params: {
companyId: companyId
}
}).subscribe((data: any) => {
this.http.get(`/api/Buildings`,{params:{
companyId:companyId
}}).subscribe((data:any)=>{
if (data.length) {
this.allBuilding = data
this.allBuilding.forEach(element => { //为每个建筑添加一个 功能分区对象
@ -135,57 +125,55 @@ export class FunctionPartitionComponent implements OnInit {
}
//获得所有建筑的功能分区
getAllBuildingFunctionalZoning() {
getAllBuildingFunctionalZoning () {
this.selectBuildingFunctionalZoning = []
this.allBuildingFunctionalZoning = []
this.allBuilding.forEach(element => {
let data = { buildingId: element.id }
this.http.get(`/api/BuildingFunctionalDivisions`, { params: data }).subscribe((data: any) => {
let data={buildingId: element.id}
this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{
if (data.length) {
element.functionalZoning = data
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
this.allBuildingFunctionalZoning.push(element)
}
this.allBuildingFunctionalZoning.push(element) }
})
});
console.log(this.allBuilding)
}
//封装函数刷新当前建筑功能分区
updateCurrent(e, index) {
let data = { buildingId: e.id }
this.http.get(`/api/BuildingFunctionalDivisions`, { params: data }).subscribe((data: any) => {
updateCurrent (e,index) {
let data= {buildingId: e.id}
this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{
this.selectBuildingFunctionalZoning[index] = []
this.allBuildingFunctionalZoning[index].functionalZoning = data
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功', '确定', config);
this.snackBar.open('数据更新成功','确定',config);
})
}
//创建建筑功能分区
addPartition() {
addPartition () {
}
//创建建筑功能分区属性
addBuilding(e, index) {
let data = { buildingId: e.id, region: '', area: 0, details: '' }
this.http.post('/api/BuildingFunctionalDivisions', data).subscribe(data => {
this.preservationBuilding(e, index)
addBuilding (e,index) {
let data = {buildingId:e.id, region:'', area:0, details:''}
this.http.post('/api/BuildingFunctionalDivisions',data).subscribe(data=>{
this.preservationBuilding(e,index)
})
}
//保存建筑功能分区属性
preservationBuilding(e, index) {
let data = { buildingId: e.id }
this.http.post(`/api/BuildingFunctionalDivisions/Batch`, this.allBuildingFunctionalZoning[index].functionalZoning, { params: data }).subscribe(data => {
this.updateCurrent(e, index)
preservationBuilding (e,index) {
let data ={buildingId:e.id}
this.http.post(`/api/BuildingFunctionalDivisions/Batch`,this.allBuildingFunctionalZoning[index].functionalZoning,{params:data}).subscribe(data=>{
this.updateCurrent(e,index)
})
}
//建筑功能分区checked选择
changeBuilding(ele, e, index) {
changeBuilding (ele,e,index) {
if (e.checked) {
this.selectBuildingFunctionalZoning[index].push(ele.id)
} else {
@ -194,27 +182,25 @@ export class FunctionPartitionComponent implements OnInit {
}
//删除建筑功能分区
deleteBuilding(e, index) {
deleteBuilding (e,index) {
if (this.selectBuildingFunctionalZoning[index].length) {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
let data = { buildingId: e.id }
this.http.post(`/api/BuildingFunctionalDivisions/Batch`, this.allBuildingFunctionalZoning[index].functionalZoning, { params: data }).subscribe(data => {
let data ={buildingId:e.id}
this.http.post(`/api/BuildingFunctionalDivisions/Batch`,this.allBuildingFunctionalZoning[index].functionalZoning,{params:data}).subscribe(data=>{
const options = {
headers: new HttpHeaders({ 'Content-Type': 'application/json', }),
body: this.selectBuildingFunctionalZoning[index],
params: { buildingId: e.id }
}
this.http.delete(`/api/BuildingFunctionalDivisions/Batch`, options).subscribe(data => {
this.selectBuildingFunctionalZoning[index].forEach((element, newIndex) => {
this.allBuildingFunctionalZoning[index].functionalZoning.splice(this.allBuildingFunctionalZoning[index].functionalZoning.findIndex(item => item.id == element), 1)
if (newIndex == this.selectBuildingFunctionalZoning[index].length - 1) {
headers: new HttpHeaders({'Content-Type': 'application/json',}),
body:this.selectBuildingFunctionalZoning[index],
params:{buildingId:e.id}}
this.http.delete(`/api/BuildingFunctionalDivisions/Batch`,options).subscribe(data=>{
this.selectBuildingFunctionalZoning[index].forEach((element,newIndex) => {
this.allBuildingFunctionalZoning[index].functionalZoning.splice(this.allBuildingFunctionalZoning[index].functionalZoning.findIndex(item=>item.id==element),1)
if (newIndex==this.selectBuildingFunctionalZoning[index].length-1) {
if (this.allBuildingFunctionalZoning[index].functionalZoning.length) {
this.updateCurrent(e, index)
this.updateCurrent(e,index)
} else {
this.selectBuildingFunctionalZoning.splice(index, 1)
this.allBuildingFunctionalZoning.splice(index, 1)
}
this.selectBuildingFunctionalZoning.splice(index,1)
this.allBuildingFunctionalZoning.splice(index,1)}
}
});
@ -226,7 +212,7 @@ export class FunctionPartitionComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择建筑功能分区', '确定', config);
this.snackBar.open('请选择建筑功能分区','确定',config);
}
}

6
src/app/plan-audit/key-site-look/key-site.component.scss

@ -1,4 +1,10 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {

47
src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts

@ -4,10 +4,8 @@ import { ViewDetailsComponent } from '../view-details/view-details.component';
import Viewer from 'viewerjs'
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatDialog } from '@angular/material/dialog';
import { MapFactory } from '@src/modules/map/declare/factory';
import { IMap, IMarker } from '@src/modules/map/declare/map';
declare var CryptoJS
declare var AMap: any;
@Component({
selector: 'app-linkageforces-audit',
templateUrl: './linkageforces-audit.component.html',
@ -35,8 +33,8 @@ export class LinkageforcesAuditComponent implements OnInit {
{id:14,name:'住建',imgUrl:'/assets/linkageForces/zhujian.png',isChecked:false}
]
AttachmentArr:any//附件
map:IMap
newPositionMarker:IMarker
map:any
newPositionMarker:any
newPositionMarkerContent:any =
'<div class="custom-content-marker">' +
' <img style="width:20px;height:24px" src="/assets/images/dingwei.png">' +
@ -45,21 +43,21 @@ export class LinkageforcesAuditComponent implements OnInit {
this.AttachmentArr = JSON.parse(this.LinkageForceDetailInfo.relevantInfomationData)
this.LinkageForceDetailInfo.location ? null : this.LinkageForceDetailInfo.location={x:null,y:null}
setTimeout(() => {
this.map = MapFactory.MapInstance('container', {
this.map = new AMap.Map('container', {
zoom:18
})
if(this.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){
this.map.setCenter([this.LinkageForceDetailInfo.location.x,this.LinkageForceDetailInfo.location.y]);
this.newPositionMarker = MapFactory.MarkerInstance({
this.newPositionMarker = new AMap.Marker({
position: [this.LinkageForceDetailInfo.location.x,this.LinkageForceDetailInfo.location.y],
content: this.newPositionMarkerContent,
offset: MapFactory.PixelInstance(-10, -12)
offset: new AMap.Pixel(-10, -12)
})
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
}else{
this.map.setCity('上海市');
this.map.setCity('株洲市');
}
}, 0);
@ -173,13 +171,32 @@ export class LinkageforcesAuditComponent implements OnInit {
}
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName
if (suffix == 'docx' || suffix == 'doc') {
let arr = fetchUrl.split('.')
arr[arr.length - 1] = 'pdf'
window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
}else if (suffix == 'pdf') {
window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl);
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray);
let jwt = sessionStorage.getItem("token");
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]);
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt);
let identityJsonparse=JSON.parse(identityJson)
let json={
doc: {
docId: docId,
title: item.fileName,
fetchUrl: `http://39.106.78.171:8000/api/Objects/PlanPlatform/`+fetchUrl
},
user: {
uid: identityJsonparse.sub,
nickName: identityJsonparse.name,
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`)
}
if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save