Compare commits

...

30 Commits

Author SHA1 Message Date
邵佳豪 294eccdda7 [完善]npm报错信息 9 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 [修改]首页统计分析本年改成本月 3 years ago
陈敬瑜 e6b3652c36 [修改]株洲统计分析弹窗大小修改 3 years ago
邵佳豪 a35b485add [新增]三维预案网址 4 years ago
邵佳豪 d76ab10342 [完善]地图默认显示株洲 4 years ago
邵佳豪 1bc637f97c [完善]地图相关修改为株洲市中心点 4 years ago
chenjingyu b8d8b7ab9a [新增]合并分支 4 years ago
  1. 6
      package-lock.json
  2. 4
      proxy.config.json
  3. 3
      src/app/canvas-share-data.service.ts
  4. 988
      src/app/data-collection/fire-force/fire-force.component.ts
  5. 4
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  6. 4
      src/app/data-collection/water-collection/water-collection.component.ts
  7. 18
      src/app/external-links-plan/external-links-plan.component.ts
  8. 2
      src/app/gis-management/gis-labeling/gis-labeling.component.html
  9. 86
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  10. 1
      src/app/gis-management/left-working/left-working.component.ts
  11. 23
      src/app/key-unit/basicinfo-look/basicinfo.component.ts
  12. 29
      src/app/key-unit/basicinfo/basicinfo.component.ts
  13. 2
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  14. 2
      src/app/key-unit/key-unit-management/upname.html
  15. 14
      src/app/key-unit/realistic-picture-look/realistic-picture.component.ts
  16. 14
      src/app/key-unit/realistic-picture/realistic-picture.component.ts
  17. 4
      src/app/key-unit/router-gis/router-gis.component.ts
  18. 2
      src/app/key-unit/water-road/water-road.component.ts
  19. 2
      src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts
  20. 2
      src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts
  21. 13
      src/app/plan-audit/plan-record/plan-record.component.html
  22. 85
      src/app/plan-audit/plan-record/plan-record.component.ts
  23. 13
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  24. 261
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  25. 2
      src/app/plan-audit/water-audit/water-audit.component.ts
  26. 5
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  27. 25
      src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts
  28. 1207
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  29. 2
      src/app/plan-management/maintain-up/maintain-up.component.ts
  30. 255
      src/app/plan-management/open-plan/open-plan.component.scss
  31. 25
      src/app/plan-management/open-plan/open-plan.component.spec.ts
  32. 350
      src/app/plan-management/open-plan/open-plan.component.ts
  33. 29
      src/app/plan-management/open-plan/previewImg.html
  34. 496
      src/app/plan-management/pass-plan/pass-plan.component.scss
  35. 25
      src/app/plan-management/pass-plan/pass-plan.component.spec.ts
  36. 526
      src/app/plan-management/pass-plan/pass-plan.component.ts
  37. 29
      src/app/plan-management/pass-plan/previewImg.html
  38. 9
      src/app/plan-management/plan-management.module.ts
  39. 5
      src/app/plan-management/see-video/see-video.component.html
  40. 0
      src/app/plan-management/see-video/see-video.component.scss
  41. 19
      src/app/plan-management/see-video/see-video.component.ts
  42. 2
      src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts
  43. 39
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts
  44. 37
      src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts
  45. 4
      src/app/statistic-analysis/all-plan/all-plan.component.html
  46. 47
      src/app/statistic-analysis/all-plan/all-plan.component.scss
  47. 62
      src/app/statistic-analysis/all-plan/all-plan.component.ts
  48. 29
      src/app/statistic-analysis/all-plan/previewImg.html
  49. 12
      src/app/statistic-analysis/echarts-data.service.ts
  50. 2
      src/app/statistic-analysis/home/home.component.html
  51. 26
      src/app/statistic-analysis/home/home.component.ts
  52. 34
      src/app/statistic-analysis/real-monitoring/real-monitoring.component.ts
  53. 10
      src/app/statistic-analysis/state/page-one/page-one.component.ts
  54. 3
      src/app/statistic-analysis/statistic-analysis.module.ts
  55. 243
      src/app/tabbar/tabbar.component.ts
  56. 4
      src/app/ui/collection-tools-building/collection-tools.component.html
  57. 19
      src/app/ui/collection-tools-building/collection-tools.component.ts
  58. 2
      src/app/ui/collection-tools-building/panel.scss
  59. 4
      src/app/ui/collection-tools-plan/collection-tools.component.html
  60. 19
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  61. 2
      src/app/ui/collection-tools-plan/panel.scss
  62. 3
      src/app/ui/collection-tools/collection-tools.component.scss
  63. 2
      src/app/ui/collection-tools/panel.scss
  64. 14
      src/app/ui/material-bank/addmatlibrary.component.ts
  65. 1
      src/app/ui/material-bank/addoriginalcopy.component.ts
  66. 99
      src/app/ui/material-bank/editmatlibrary.component.ts
  67. 1
      src/app/ui/material-bank/editoriginalcopy.component.ts
  68. 824
      src/app/ui/material-bank/material-bank.component.ts
  69. 1
      src/app/ui/material-bank/selectoriginalcopy.component.ts
  70. 61
      src/app/ui/role/role.component.ts
  71. 2
      src/app/ui/unit-information/addgroups.component.ts
  72. 1
      src/app/ui/unit-information/addunitinfo.component.ts
  73. 2
      src/app/ui/unit-information/editgroup.component.ts
  74. 1
      src/app/ui/unit-information/editunitinfo.component.ts
  75. 1
      src/app/ui/userdata/userdata.component.ts
  76. 6
      src/app/ui/usermanagement/createUser.html
  77. 9
      src/app/ui/usermanagement/editUser.html
  78. 2
      src/app/working-area/working-area.component.ts

6
package-lock.json generated

@ -465,7 +465,7 @@
},
"@ant-design/colors": {
"version": "3.2.2",
"resolved": "https://registry.npm.taobao.org/@ant-design/colors/download/@ant-design/colors-3.2.2.tgz?cache=0&sync_timestamp=1596611396536&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design%2Fcolors%2Fdownload%2F%40ant-design%2Fcolors-3.2.2.tgz",
"resolved": "https://registry.npm.taobao.org/@ant-design/colors/download/@ant-design/colors-3.2.2.tgz",
"integrity": "sha1-WtQ9YZ6RHzSI66wwPWBuZqhCOQM=",
"requires": {
"tinycolor2": "^1.4.1"
@ -473,7 +473,7 @@
},
"@ant-design/icons-angular": {
"version": "9.0.1",
"resolved": "https://registry.npm.taobao.org/@ant-design/icons-angular/download/@ant-design/icons-angular-9.0.1.tgz?cache=0&sync_timestamp=1601000889997&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40ant-design%2Ficons-angular%2Fdownload%2F%40ant-design%2Ficons-angular-9.0.1.tgz",
"resolved": "https://registry.nlark.com/@ant-design/icons-angular/download/@ant-design/icons-angular-9.0.1.tgz",
"integrity": "sha1-Wsi+xbw00jEgggyT+FEbWaoRe8U=",
"requires": {
"@ant-design/colors": "^3.1.0"
@ -11981,7 +11981,7 @@
},
"ng-zorro-antd": {
"version": "9.3.0",
"resolved": "https://registry.npm.taobao.org/ng-zorro-antd/download/ng-zorro-antd-9.3.0.tgz",
"resolved": "https://registry.nlark.com/ng-zorro-antd/download/ng-zorro-antd-9.3.0.tgz",
"integrity": "sha1-+A2+JxXleMR1codzRJRC8AmfFSw=",
"requires": {
"@angular/cdk": "^9.0.0",

4
proxy.config.json

@ -1,7 +1,7 @@
{
"/api": {
"target": "http://39.106.78.171:8000",
"target": "http://218.75.214.31:28085/",
"secure": false,
"changeOrigin": true
}
}
}

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

@ -79,7 +79,8 @@ export class CanvasShareDataService {
['泡沫发生器', '泡沫发生器'],
['消防管网', '消防管网'],
['泡沫管网', '消防管网'],
['DCS控制室', 'DCS控制室']
['DCS控制室', 'DCS控制室'],
['消防控制室', '消防控制室']
]);
/** * *

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

File diff suppressed because it is too large Load Diff

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

@ -414,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
}
}
@ -530,7 +530,7 @@ export class LinkageForcesComponent implements OnInit {
this.map = new AMap.Map('container', {
zoom:12
})
this.map.setCity('上海市');
this.map.setCity('株洲市');
//输入提示
var autoOptions = {
input: "tipinput"

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

@ -423,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
}
@ -536,7 +536,7 @@ export class WaterCollectionComponent implements OnInit {
this.map = new AMap.Map('container', {
zoom:12
})
this.map.setCity('上海市');
this.map.setCity('株洲市');
//输入提示
var autoOptions = {
input: "tipinput"

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

@ -48,7 +48,7 @@ export class ExternalLinksPlanComponent implements OnInit {
}
} else {
// 二维三维预案
this.handleData()
this.handleData(data.url)
}
})
})
@ -110,8 +110,9 @@ export class ExternalLinksPlanComponent implements OnInit {
companyData//当前公司信息
thirdPartyURL
threedUrl: any
handleData() {
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) => {
@ -126,12 +127,13 @@ export class ExternalLinksPlanComponent implements OnInit {
// 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) => {
data && data.company ? this.companyData = data.company : null
this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(data.url)
this.showType = 2
})
// 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`
}
}
}

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

@ -5,7 +5,7 @@
<!-- 左上搜索框 -->
<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()'>×</label>
<button (click)='search()'><mat-icon>search</mat-icon></button>

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

@ -3,6 +3,8 @@ import { Component, OnInit ,Renderer2,ElementRef, Inject, NgZone, ViewChild } fr
import { FormBuilder,FormGroup, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ImgDetails, PsViewer } from 'src/app/plan-management/entry-plan-look/entry-plan-look.component';
import { SeeVideoComponent } from 'src/app/plan-management/see-video/see-video.component';
declare var AMap: any;
declare var QRCode: any;
@ -429,7 +431,6 @@ export class GisLabelingComponent implements OnInit {
<div style="display: flex; align-items: center; justify-content: center; margin-top: 10px;">
<div class="btn" id="baseInformation"><img src="../../../assets/images/basicinfoicon.png" alt=""></div>
<div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div>
<div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div>
<div class="btn" id="threeeScene"><img src="../../../assets/images/3dicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div>
@ -444,7 +445,7 @@ export class GisLabelingComponent implements OnInit {
this.infoWindow.open(this.map);
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(item) })//基本信息点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//全景漫游点击事件
//this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//分享点击事件
@ -976,7 +977,7 @@ export class GisLabelingComponent implements OnInit {
features: ['bg', 'road', 'point','building'],
mapStyle: 'amap://styles/light',
});
this.map.setCity('上海市');
this.map.setCity('株洲市');
}
this.satelliteModel = false
this.loadModel = false
@ -996,7 +997,7 @@ export class GisLabelingComponent implements OnInit {
layers:[layer], //当只想显示标准图层时layers属性可缺省,
});
that.map.setCity('上海市');
that.map.setCity('株洲市');;
AMap.plugin(["AMap.RangingTool", "AMap.MouseTool"],function () {
that.mouseTool=new AMap.MouseTool(that.map);
});
@ -1169,7 +1170,6 @@ export class GisLabelingComponent implements OnInit {
<div style="display: flex; align-items: center; justify-content: center; margin-top: 10px;">
<div class="btn" id="baseInformation"><img src="../../../assets/images/basicinfoicon.png" alt=""></div>
<div class="btn" id="route"><img src="../../../assets/images/navicon.png" alt=""></div>
<div class="btn" id="fullViewNavigation"><img src="../../../assets/images/panoramaicon.png" alt=""></div>
<div class="btn" id="threeeScene"><img src="../../../assets/images/3dicon.png" alt=""></div>
<div class="btn" id="seePlan"><img src="../../../assets/images/planicon.png" alt=""></div>
<div class="btn" id="share"><img src="../../../assets/images/shareicon.png" alt=""></div>
@ -1184,7 +1184,7 @@ export class GisLabelingComponent implements OnInit {
this.infoWindow.open(this.map);
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//基本信息点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件
//this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//分享点击事件
@ -1197,7 +1197,7 @@ export class GisLabelingComponent implements OnInit {
this.infoWindow.open(this.map);
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//基本信息点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//导航点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件
//this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//三维场景点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件
this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//分享点击事件
@ -1235,7 +1235,9 @@ export class GisLabelingComponent implements OnInit {
//三维场景
threeeScene (e) {
window.open('http://39.106.78.171:8088/%E6%BC%94%E7%A4%BA%E6%A1%88%E4%BE%8B/--SHGJHYZX/')
if (e.name && e.name == "株洲铭逸酒店") {
window.open('http://39.106.78.171:8088/%E6%BC%94%E7%A4%BA%E6%A1%88%E4%BE%8B/--SHGJHYZX/')
}
}
//查看预案
@ -1551,28 +1553,60 @@ export class LookPlanDialog {
}
//查看预案
lookPlan(e){
if(e.planMode == 0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('本地文件,请下载查看','确定',config);
}
if(e.planMode == 1){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('查看导入word文件','确定',config);
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
var index = e.attachmentUrls[0].indexOf("\/")
if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(PsViewer, {
width: '1500px',
height: '800px',
data: e.attachmentUrls[0]
});
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'peg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') {
let data = e
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
data: data.attachmentUrls,
});
dialogRef.afterClosed().subscribe();
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'mp4' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'MP4') {
let fetchUrl = e.attachmentUrls[0]
let data = `/api/Objects/PlanPlatform/` + fetchUrl
const dialogRef = this.dialog.open(SeeVideoComponent, {//调用open方法打开对话框并且携带参数过去
data: data,
});
dialogRef.afterClosed().subscribe();
} else {
let fetchUrl = e.attachmentUrls[0]
if (fetchUrl) {
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
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)
} else {
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
}
}
}
}
if(e.planMode == 2){ //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId",id)
sessionStorage.setItem("companyId",this.data.id)
sessionStorage.setItem("buildingTypeId",this.data.buildingTypes[0].id)
sessionStorage.setItem("editable","0")
sessionStorage.setItem("planName",e.name)
if (e.planType == 1) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", this.data.id)
sessionStorage.setItem("buildingTypeId", this.data.buildingTypes[0].id)
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
}
if (e.planType == 2) { //如果是跳转网页
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
}
if(e.planMode == 3){ //如果是跳转网页
sessionStorage.setItem("url",e.url)
window.open(`/planManagement/webLook`)

1
src/app/gis-management/left-working/left-working.component.ts

@ -1,6 +1,5 @@
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { id } from 'date-fns/locale';
@Component({
selector: 'app-left-working',

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

@ -5,7 +5,6 @@ import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { AbstractControl, FormControl, NG_VALIDATORS, Validator } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import format from 'date-fns/format';
import { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader, FileItem } from 'ng2-file-upload'
import { DomSanitizer } from '@angular/platform-browser'
@ -153,7 +152,27 @@ 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 = new AMap.Marker({

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

@ -5,7 +5,6 @@ import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { AbstractControl, FormControl, NG_VALIDATORS, Validator } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import format from 'date-fns/format';
import { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader, FileItem } from 'ng2-file-upload'
import { AddHouseInfo } from './addhouseinfo.component'
@ -192,20 +191,20 @@ export class BasicinfoComponent implements OnInit {
});
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(-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
//点击位置按钮

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

@ -378,7 +378,7 @@ export class KeyUnitManagementComponent implements OnInit {
PageSize: this.pageSizeOptions[0],
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
IsNewData:true,
// IsNewData:true,
IntegrityScoreMin:this.integrityScoreMin/100||0,
IntegrityScoreMax:this.integrityScoreMax/100||1
}

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">

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

@ -29,12 +29,12 @@ export class RealisticPictureLookComponent implements OnInit {
companyId : companyId
}}).subscribe((data:any)=>{
this.allRealPicture = data
this.allRealPicture.unshift({
companyId:sessionStorage.getItem('companyId'),
id:'重点部位',
name: "重点部位",
realityImages:null
})
// this.allRealPicture.unshift({
// companyId:sessionStorage.getItem('companyId'),
// id:'重点部位',
// name: "重点部位",
// realityImages:null
// })
this.selectReal = data[0]
this.getAllRealPicture()
})
@ -77,7 +77,7 @@ export class RealisticPictureLookComponent implements OnInit {
getAllRealPicture () {
if (this.selectReal) {
let data
if(this.selectReal.id == '重点部位'){
if(this.selectReal.id == 'xxxxxxxxxxxxx'){
data = {
groupId: this.selectReal.id,
companyId : this.selectReal.companyId,

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

@ -30,12 +30,12 @@ export class RealisticPictureComponent implements OnInit {
companyId : companyId
}}).subscribe((data:any)=>{
this.allRealPicture = data
this.allRealPicture.unshift({
companyId:sessionStorage.getItem('companyId'),
id:'重点部位',
name: "重点部位",
realityImages:null
})
// this.allRealPicture.unshift({
// companyId:sessionStorage.getItem('companyId'),
// id:'重点部位',
// name: "重点部位",
// realityImages:null
// })
this.selectReal = data[0]
this.getAllRealPicture()
})
@ -78,7 +78,7 @@ export class RealisticPictureComponent implements OnInit {
getAllRealPicture () {
if (this.selectReal) {
let data
if(this.selectReal.id == '重点部位'){
if(this.selectReal.id == 'xxxxxxxxxxx'){
data = {
groupId: this.selectReal.id,
companyId : this.selectReal.companyId,

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

@ -98,7 +98,7 @@ export class RouterGISComponent implements OnInit {
that.map = new AMap.Map('map',{
layers:[layer], //当只想显示标准图层时layers属性可缺省,
});
that.map.setCity('上海市');
that.map.setCity('株洲市');;
AMap.plugin('AMap.Driving', function() {
that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null
})
@ -179,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('株洲市'); //设置地图中心点
}
//交换起始点

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

@ -312,7 +312,7 @@ export class WaterRoadComponent implements OnInit {
this.map.add(this.unitMarker);
this.waterSubmit(1)
}else{
this.map.setCity('上海市');
this.map.setCity('株洲市');
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000

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

@ -51,7 +51,7 @@ export class FireforceAuditComponent implements OnInit {
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
}else{
this.map.setCity('上海市');
this.map.setCity('株洲市');
}
}, 0);

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

@ -57,7 +57,7 @@ export class LinkageforcesAuditComponent implements OnInit {
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
}else{
this.map.setCity('上海市');
this.map.setCity('株洲市');
}
}, 0);

13
src/app/plan-audit/plan-record/plan-record.component.html

@ -176,6 +176,16 @@
<button mat-raised-button color="primary" style="float: right;margin-top: 10px;margin-right: 15px;" (click)='lookNew()'>查看详情</button>
<iframe [src]='iframeSrc'></iframe>
</div>
<!-- 图片 -->
<div class="imgBox" *ngIf="showtype==1024" style="text-align: center; overflow: hidden; height: 100%;">
<img [src]="src" (click)="lookImg(fetchUrl)" style="width: auto; height: auto; max-width: 100%; max-height: 100%;">
</div>
<!-- 图片 -->
<!-- 视频 -->
<div class="video" *ngIf="showtype == 1080" style="text-align: center; overflow: hidden; height: 100%;">
<video [src]="src" controls="controls" width="auto" height="100%"></video>
</div>
<!-- 视频 -->
<div id="viewer" *ngIf="showtype==1"></div>
<div class="twoD" *ngIf="showtype==2">
<div class="planBox">
@ -212,3 +222,6 @@
</div>
</div>
</div>
<div id="viewerjs">
</div>

85
src/app/plan-audit/plan-record/plan-record.component.ts

@ -12,7 +12,8 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import { HttpClient } from '@angular/common/http'
import { DomSanitizer } from '@angular/platform-browser';
import { Viewer } from 'photo-sphere-viewer';
import { Viewer as photoViewer } from 'photo-sphere-viewer';
import Viewer from 'viewerjs';
declare var CryptoJS
@Component({
@ -187,7 +188,7 @@ export class PlanRecordComponent implements OnInit {
obj.innerHTML=''
}
window.setTimeout(()=>{
this.viewer = new Viewer({
this.viewer = new photoViewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl,
@ -231,43 +232,55 @@ export class PlanRecordComponent implements OnInit {
//毕升
lookWord(){
this.showtype=0
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);
//window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`)
})
console.log('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'
this.src = `/api/Objects/PlanPlatform/` + arr.join('.')
} else if (suffix == 'pdf') {
this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl
} else if (suffix == 'jpeg' || suffix == 'jpg' || suffix == 'png') {
this.showtype = 1024 //图片
this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl
return
} else if (suffix == 'mp4' || suffix == 'MP4') {
this.showtype = 1080 //视频
this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl
}
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
}
//查看按钮跳转
lookNew(){
window.open(this.src)
if (this.src) {
window.open(this.src)
}
}
lookImg(imgUrl,type?:boolean) {
// console.log(imgUrl)
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
node.style.display = "none";
if(type){
let src = imgUrl.split("?")[0]
node.src = src
}else{
node.src = "/api/Objects/PlanPlatform/" + imgUrl;
}
node.id = 'imgxxx'
dom.appendChild(node)
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
}
});
node.click();
}, 0);
}
//查看二维三维预案

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

@ -59,8 +59,7 @@
<tr [ngClass]="{'selectedTr': item.id == id}" *ngFor="let item of tableDate;let key = index"
(click)='radioClick($event,item)'>
<td style="width: 15%;">
<mat-checkbox color="primary" (change)='radioClick($event,item)' style="float: left;margin-top:'2px'">
</mat-checkbox>
<input type="checkbox" (change)='checkChange($event,item)' (click)='stopClick($event)' style="float: left;margin-top:'2px'" class="check{{item.id}}">
{{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'?
'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}}
</td>
@ -282,6 +281,16 @@
<div class="word" *ngIf="showtype == 0">
<iframe [src]='iframeSrc'></iframe>
</div>
<!-- 图片 -->
<div class="imgBox" *ngIf="showtype==1024" style="text-align: center; overflow: hidden; height: 100%;">
<img [src]="src" (click)="lookImg(fetchUrl)" style="width: auto; height: auto; max-width: 100%; max-height: 100%;">
</div>
<!-- 图片 -->
<!-- 视频 -->
<div class="video" *ngIf="showtype == 1080" style="text-align: center; overflow: hidden; height: 100%;">
<video [src]="src" controls="controls" width="auto" height="100%"></video>
</div>
<!-- 视频 -->
<!-- 全景图 -->
<div id="viewer" *ngIf="showtype == 1"></div>
<div class="twoD" *ngIf="showtype == 2">

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

@ -4,9 +4,9 @@
* @Author: sueRimn
* @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-04 10:14:51
* @LastEditTime: 2021-08-16 11:12:52
*/
import { Component, Inject, OnInit } from '@angular/core';
import { Component, ElementRef, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@ -14,7 +14,7 @@ import { HttpClient } from '@angular/common/http'
declare var CryptoJS
import { DomSanitizer } from '@angular/platform-browser';
import { Viewer as photoViewer } from 'photo-sphere-viewer';
import Viewer from 'viewerjs';
import Viewer from 'viewerjs';
declare var echarts: any;
@ -26,7 +26,7 @@ declare var echarts: any;
})
export class WaitExamineerComponent implements OnInit {
constructor(private http: HttpClient, public snackBar: MatSnackBar, private sanitizer: DomSanitizer, public dialog: MatDialog) {
constructor(private http: HttpClient, public snackBar: MatSnackBar, private sanitizer: DomSanitizer, public dialog: MatDialog,private elementRef: ElementRef) {
}
preparelevels: any//编制级别下拉框
@ -61,7 +61,10 @@ export class WaitExamineerComponent implements OnInit {
]
}
this.getAlltabledate()
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
}
planTypeIndex //平面图类型 选择是总平面图还是层平面图
@ -106,6 +109,8 @@ export class WaitExamineerComponent implements OnInit {
companyId
fetchUrl
companyName
plantypes
IsNewData=[true,false]
//获取表格数据
getAlltabledate() {
@ -113,7 +118,9 @@ export class WaitExamineerComponent implements OnInit {
Operation: this.level || [],
ContentType: Number(this.projectlevel) || [],
Level: this.PlanLevel || [],
verifyState: [0, 3]
verifyState: [0, 3],
PlanType:this.plantypes||[],
IsNewData:this.IsNewData
}
this.http.get("/api/ContentVerifies", { params: paramsdata }).subscribe((data: any) => {
this.tableDate = data.items
@ -129,22 +136,28 @@ export class WaitExamineerComponent implements OnInit {
this.level = ''
this.projectlevel = ''
this.PlanLevel = ''
this.plantypes=[]
let level = sessionStorage.getItem("level");
this.getAlltabledate()
}
lookImg(imgUrl){
console.log(imgUrl)
let dom = document.getElementById(`viewerjs`)
lookImg(imgUrl,type?:boolean) {
// console.log(imgUrl)
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
node.style.display = "none";
node.src = "/api/Objects/PlanPlatform/" + imgUrl;
if(type){
let src = imgUrl.split("?")[0]
node.src = src
}else{
node.src = "/api/Objects/PlanPlatform/" + imgUrl;
}
node.id = 'imgxxx'
dom.appendChild(node)
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden:()=>{
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
}
@ -165,38 +178,63 @@ export class WaitExamineerComponent implements OnInit {
differentContentOfBuildingsInfo: any//当前单位变更数据 之 建筑信息
differentContentOfFunction: any = []//当前单位变更数据 之 功能分区
differentContentOfPicture: any//当前单位变更数据 之 实景图
bianzhi = false
radioClick(e, item) {
e.stopPropagation();
this.selectedItem = item
console.log(item)
// console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) )
if(item.contentType == 11 && this.selectedItem.differentContent){
if (item.contentType == 11 && this.selectedItem.differentContent) {
let differentContent = JSON.parse(this.selectedItem.differentContent)
// 单位信息
this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo')
// 实景图
this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups')
//建筑信息
this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfBuildingsInfo.childrens.forEach(element => {
element.childrens = element.childrens.filter(item => item.isObj == false)
});
//功能分区
let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfFunction = []
differentContentOfFunction.childrens.forEach(item => {
item.childrens.forEach(i => {
if (i.propertyName == "buildingFunctionalDivisions") {
i.propertyName = item.propertyName
this.differentContentOfFunction.push(i)
if (differentContent.filter(item => item.propertyName == 'buildings').length != 0) {
//建筑信息
this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
function resolveDiff(list: Array<DiffItem>, path?: Array<string>): Array<Result> {
let resultList: Array<Result> = [];
for (let i = 0; i < list.length; i++) {
if (path == null) path = [];
let item = list[i];
//递归最底层
if (!item.childrens.length) {
let res = new Result();
res.path = path.concat([item.displayName]);
res.oldValue = item.oldValue;
res.newValue = item.newValue;
resultList.push(res);
} else {
!!item.displayName && path.push(item.displayName);
let deepList = resolveDiff(item.childrens, path)
resultList = resultList.concat(deepList);
}
}
return resultList;
}
this.differentContentOfBuildingsInfo.childrens.forEach(element => {
element.difData = resolveDiff(element.childrens)
});
});
//console.log('建筑信息', this.differentContentOfBuildingsInfo)
//功能分区
let differentContentOfFunction = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfFunction = []
differentContentOfFunction.childrens.forEach(item => {
item.childrens.forEach(i => {
if (i.propertyName == "buildingFunctionalDivisions") {
i.propertyName = item.propertyName
this.differentContentOfFunction.push(i)
}
});
});
}
}
// console.log('功能分区', this.differentContentOfFunction)
@ -209,18 +247,22 @@ export class WaitExamineerComponent implements OnInit {
this.id = item.id
this.fetchUrl = ''
this.viewer = {}
if (item.contentType == 11) {
this.bianzhi = false
window.setTimeout(() => {
this.showtype = 3
sessionStorage.setItem('companyId', item.itemId)
}, 0)
} else if (item.contentType == 12) {
this.bianzhi = false
//水源
this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data) => {
this.waterData = data
this.showtype = 12
})
} else if (item.contentType == 13) {
this.bianzhi = false
//消防力量
this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data: any) => {
if (data.forceType != 0) {//如果是其他消防力量
@ -242,6 +284,7 @@ export class WaitExamineerComponent implements OnInit {
})
} else if (item.contentType == 14) {
this.bianzhi = false
//联动力量
this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data: any) => {
@ -251,94 +294,111 @@ export class WaitExamineerComponent implements OnInit {
})
} else {
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => {
//console.log('预案信息',data)
this.companyId = data.companyId
this.companyName = data.companyName
if (data.planType != 2 && data.planType != 1) {
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 = ''
}
window.setTimeout(() => {
this.viewer = new photoViewer({
container: document.querySelector('#viewer'),
panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl,
});
})
if (data.planMode == 2 ||data.planMode==4) {
this.showtype = 0
this.bianzhi = true
this.src = `/CreatePlanOnlineFive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false`
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}`
} else {
this.lookWord()
this.bianzhi = false
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 = ''
}
window.setTimeout(() => {
this.viewer = new photoViewer({
container: document.querySelector('#viewer'),
panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl,
});
})
} else {
this.lookWord()
}
}
} else {
this.bianzhi = false
this.organizationName = item.organizationName
this.planData = data
this.handleData()
return
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`)
}
})
}
if (e.checked) {
let div = this.elementRef.nativeElement.querySelector(`.check${item.id}`)
div.checked = true
let isTrue = this.shenheTable.find(element=>{ return element.id == item.id })
if (!isTrue) {
this.shenheTable.push(item)
}
this.radioid = item.itemId
}
// check change
checkChange(e, item) {
if (e.target.checked) {
let isTrue = this.shenheTable.find(element=>{ return element.id == item.id })
if (!isTrue) {
this.shenheTable.push(item)
}
}
else {
for (var i = 0; i < this.shenheTable.length; i++) {
if (this.shenheTable[i].id == item.id) {
this.shenheTable.splice(i, 1)
}
}
if (!this.shenheTable.length) {
this.showtype = -1
}
}
this.radioid = item.itemId
}
stopClick(e) {
e.stopPropagation();
}
//毕升
lookWord() {
console.log('lookWord')
this.showtype = 0
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);
//window.open(`http://121.5.10.84:80/apps/editor/openPreview?data=${base64}`)
})
//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'
this.src = `/api/Objects/PlanPlatform/` + arr.join('.')
} else if (suffix == 'pdf') {
this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl
} else if (suffix == 'jpeg' || suffix == 'jpg' || suffix == 'png') {
this.showtype = 1024 //图片
this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl
return
} else if (suffix == 'mp4' || suffix == 'MP4') {
this.showtype = 1080 //视频
this.src = `/api/Objects/PlanPlatform/` + this.fetchUrl
}
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
}
//查看按钮跳转
lookNew() {
window.open(this.src)
if (this.src) {
window.open(this.src)
}
}
//查看二维三维预案
@ -573,6 +633,14 @@ export class WaitExamineerComponent implements OnInit {
}, 0)
}
}
//判断iframe是否加载完成
iftrue=true
ifranmeLoad(){
var iframe = document.getElementById("myiframe");
iframe.onload = function(){
}
this.iftrue=!this.iftrue
}
}
@ -803,4 +871,19 @@ export class remark {
}
}
}
}
class DiffItem {
newValue: any
oldValue: any
childrens: Array<DiffItem>
operation: number
displayName: string
propertyName: string
}
class Result {
path: string[]
oldValue: any
newValue: any
}

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

@ -36,7 +36,7 @@ export class WaterAuditComponent implements OnInit {
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
}else{
this.map.setCity('上海市');
this.map.setCity('株洲市');
}
}, 0);

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-25 14:48:39
* @LastEditTime: 2021-05-31 09:40:59
-->
<!-- <p>录入预案</p> -->
<div style="overflow: auto;height: 100%;">
@ -76,7 +76,7 @@
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span>
<span (click)="editPlan(element)" [ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span>
<span (click)="editPlan(element)" [ngClass]="{'grey': [!(element.auditStatus!='16' && element.auditStatus != '1')]&&element.planType!=1&&element.planType!=4&&element.planType!=16}">编辑</span>
<span (click)="lookPlan(element)">查看</span>
<span (click)="readFile(element)" [ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
@ -102,3 +102,4 @@
</mat-paginator>
</div>
</div></div>
<input type="file" id="uploadFile" (change)="filechange($event)" style="display: none;">

25
src/app/plan-management/entry-plan-look/entry-plan-look.component.spec.ts

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

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

File diff suppressed because it is too large Load Diff

2
src/app/plan-management/maintain-up/maintain-up.component.ts

@ -376,7 +376,7 @@ export class MaintainUpComponent implements OnInit {
PageSize: this.pageSizeOptions[0],
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
IsNewData : false,
// IsNewData : false,
IntegrityScoreMin:this.integrityScoreMin/100||0,
IntegrityScoreMax:this.integrityScoreMax/100||1
}

255
src/app/plan-management/open-plan/open-plan.component.scss

@ -1,103 +1,174 @@
.header {
width: 100%;
padding: 12px 5px;
width: 100%;
padding: 12px 5px;
// margin-bottom: 10px;
box-sizing: border-box;
box-sizing: border-box;
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 0 0 15px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
//margin: 3px 10px;
input {
.queryBox {
box-sizing: border-box;
padding: 5px 0 0 15px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
// justify-content:center;
.queryField {
//margin: 3px 10px;
input {
width: 180px;
height: 22px;
line-height: 22px;
border-radius: 3px;
}
@media screen and (min-device-width:1400px) {
margin: 3px 20px;
}
@media screen and (max-device-width:1400px)and (min-device-width:1200px) {
margin: 3px 10px;
mat-form-field {
width: 180px;
height: 22px;
line-height: 22px;
border-radius: 3px;
}
@media screen and (min-device-width:1400px){
margin: 3px 20px;
}
@media screen and (max-device-width:1400px)and (min-device-width:1200px){
margin: 3px 10px;
mat-form-field{
width: 180px;
}
}
@media screen and (max-device-width:1200px){
margin: 3px 0 3px 10px;
mat-form-field{
width: 130px;
}
}
}
} //queryBox
.ordiv{
position: relative;
.organizationbox{
width:450px;
height: 200px;
background: white;
position: absolute;
top: 48px;
left: 77px;
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
li{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
mat-tree-node{
cursor: pointer;
white-space:pre;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
}
.closediv{
z-index: 100;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
cursor: pointer;
line-height: 30px;
text-align: center;
}
.closediv:hover{
background:rgba(225, 225, 225, 0.8);
}
@media screen and (max-device-width:1200px) {
margin: 3px 0 3px 10px;
mat-form-field {
width: 130px;
}
}
}
}
.body{
.buttonbox{
padding-left: 50px;
button{
margin:0 10px
}
//queryBox
.ordiv {
position: relative;
.organizationbox {
width: 450px;
height: 200px;
background: white;
position: absolute;
top: 48px;
left: 77px;
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
li {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
mat-tree-node {
cursor: pointer;
white-space: pre;
}
mat-tree-node:hover {
background: rgba(225, 225, 225, 0.8);
}
.tablebox{
table{
width: 100%;
margin-top: 15px;
}
th,td{
text-align: center;
}
mat-paginator{
width: 100%;
}
.closediv {
z-index: 100;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
cursor: pointer;
line-height: 30px;
text-align: center;
}
}
.closediv:hover {
background: rgba(225, 225, 225, 0.8);
}
}
}
}
.body {
.buttonbox {
padding-left: 50px;
button {
margin: 0 10px
}
}
.tablebox {
table {
width: 100%;
margin-top: 15px;
}
th,
td {
text-align: center;
}
mat-paginator {
width: 100%;
}
}
}
@media screen and (max-width:1200px) {
.bigimgbox {
width: 880px;
height: 580px;
//预览图片
.previewImgBox {
width: 800px;
height: 475px;
text-align: center;
}
}
}
@media screen and (min-width:1200px) and (max-width:1400px) {
.bigimgbox {
width: 880px;
height: 610px;
//预览图片
.previewImgBox {
width: 800px;
height: 500px;
text-align: center;
}
}
}
@media screen and (min-width:1400px) {
.bigimgbox {
width: 1110px;
height: 860px;
//预览图片
.previewImgBox {
width: 900px;
height: 100%;
text-align: center;
}
.previewImgBottom {
text-align: center;
height: 30px;
margin: 20px auto;
}
}
}

25
src/app/plan-management/open-plan/open-plan.component.spec.ts

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

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

@ -4,13 +4,14 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router'
import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { Viewer } from 'photo-sphere-viewer';
declare var CryptoJS
import Swiper from 'swiper';
@Component({
selector: 'app-open-plan',
templateUrl: './open-plan.component.html',
@ -18,8 +19,8 @@ declare var CryptoJS
})
export class OpenPlanComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { }
private _transformer = (node, level: number) => { //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
@ -35,145 +36,145 @@ export class OpenPlanComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
//分页
@ViewChild(MatPaginator, {static: true})
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
PageNumber: any; //第几页
displayedColumns: string[] = ['unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'];
displayedColumns: string[] = ['unitname', 'planname', 'addpeople','addtime','plantype','auditStatus','openRange','projectlevel','operation'];
allorganizations:any //所有组织机构
allunittype:any //所有单位类型
tabledataSource:any //表格数据
preparelevels:any //编制级别
allorganizations: any //所有组织机构
allunittype: any //所有单位类型
tabledataSource: any //表格数据
preparelevels: any //编制级别
ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){
this.pcMore=false
this.padMore=true
this.pcfind=false
this.padjt=true
}else{
this.pcfind=true
this.pcMore=true
this.padMore=false
this.padjt=false
if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore = false
this.padMore = true
this.pcfind = false
this.padjt = true
} else {
this.pcfind = true
this.pcMore = true
this.padMore = false
this.padjt = false
}
this.getunitdata();
this.getOrganizations();
this.getUnittype();
this.getAllPlanInfo(); //得到所有单位
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
if (level == "0") {//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "总队", value: "1" },
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(level == "1"){//如果是支队
if (level == "1") {//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(level == "2"){//如果是大队
if (level == "2") {//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(level == "3"){//如果是中队
if (level == "3") {//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
{ name: "中队", value: "8" }
]
}
}
pcMore//pc更多
pcput=false//pc收起
pcput = false//pc收起
pcfind//pc查询
padjt=false
padMore=true//pad收缩控制
padput=false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png"
pcInfo(){
this.pcMore=!this.pcMore
this.pcput=!this.pcput
padjt = false
padMore = true//pad收缩控制
padput = false//pad收起按钮
imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown = "../../../assets/images/routup2.png"
pcInfo() {
this.pcMore = !this.pcMore
this.pcput = !this.pcput
}
padInfo(){
this.padMore=!this.padMore
this.padput=!this.padput
padInfo() {
this.padMore = !this.padMore
this.padput = !this.padput
}
allPlanInfo:any //存储所有预案信息
allPlanInfo: any //存储所有预案信息
//获得所有预案信息
getAllPlanInfo(){
let paramsdata:any = {
getAllPlanInfo() {
let paramsdata: any = {
CompanyName: this.companyName || '',
OrganizationId: '',
HasChildrenOrganization:'',
BuildingTypeId: this.unittype || '',
OrganizationId: '',
HasChildrenOrganization: '',
BuildingTypeId: this.unittype || '',
PlanType: this.reservePlanType || '',
AuditStatus:'', //审核状态
PlanLevel: this.preparelevel || '',
AuditStatus: '', //审核状态
PlanLevel: this.preparelevel || '',
HasChildrenPlanLevel: this.plcheck || '',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
PageSize: this.pageSizeOptions[0],
Sort: ''
}
this.http.get("/api/PublicPlans",{params:paramsdata}).subscribe((data:any)=>{
this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => {
// console.log(111,data)
this.length = data.totalCount
this.allPlanInfo = data
this.tabledataSource = data.items
this.tabledataSource = data.items
})
}
//得到当前单位信息
getunitdata(){
getunitdata() {
this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{
this.organizationName = data.organizationName
(data: any) => {
this.organizationName = data.organizationName
}
)
}
organizationName:any //当前单位组织机构名称
treedata:any //组织机构树型数据
newArr:any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
organizationName: any //当前单位组织机构名称
treedata: any //组织机构树型数据
newArr: any = []
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据
getpresentOrganization(){
getpresentOrganization() {
this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => {
item.children = []
this.newallorganizations.forEach(element => {
if(element.parentId == item.id){
if (element.parentId == item.id) {
item.children.push(element)
}
});
});
// console.log(666,this.organizationName)
if(this.organizationName){
if (this.organizationName) {
this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){
if (item.name == this.organizationName) {
this.dataSource.data = [item]
}
});
}else{
} else {
this.dataSource.data = this.tree.toTree(this.treedata);
}
}
//获得所有组织机构
getOrganizations(){
getOrganizations() {
this.http.get('/api/Organizations').subscribe(
(data:any)=>{
(data: any) => {
this.allorganizations = data
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
@ -182,87 +183,72 @@ export class OpenPlanComponent implements OnInit {
}
//获得所有单位类型
getUnittype(){
getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{
data => {
this.allunittype = data
}
)
}
//跳转查看预案页面 公开预案
routerTo(e){
/* sessionStorage.setItem("companyName",element.companyName)
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */
// console.log(e)
if(e.planMode == 0||e.planMode == 1){
//console.log(e.attachmentUrls)
var index=e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){
const dialogRef = this.dialog.open(GkhtmlPsViewer, {
width: '1500px',
height:'800px',
data: e.attachmentUrls[0]
});
routerTo(e) {
console.log(e)
if (e.planMode == 0 || e.planMode == 1) {
var index = e.attachmentUrls[0].indexOf("\/")
if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkhtmlPsViewer, {
width: '1500px',
height: '800px',
data: e.attachmentUrls[0]
});
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'peg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') {
let data = e
const dialogRef = this.dialog.open(OpenImgDetails, {//调用open方法打开对话框并且携带参数过去
data: data.attachmentUrls,
});
dialogRef.afterClosed().subscribe();
} else {
let fetchUrl = e.attachmentUrls[0]
if (fetchUrl) {
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
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)
} else {
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
}
}
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{
let filename:string
let fetchUrl = e.attachmentUrls[0]
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)
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: docId,
title: 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(e.planMode == 2){ //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId",id)
sessionStorage.setItem("companyId",e.companyId)
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
sessionStorage.setItem("editable","0")
sessionStorage.setItem("planName",e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
}
if(e.planMode == 3){ //如果是跳转网页
sessionStorage.setItem("url",e.url)
window.open(`/planManagement/webLook`)
}
}
if (e.planMode == 2) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", e.companyId)
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
}
if (e.planMode == 3) { //如果是跳转网页
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
}
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
chagePage(e) {
this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo();
}
}
//辖区中队div是否显示
isorganizationbox:boolean = false
isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量
add(node) {
this.isorganizationbox = false
@ -278,23 +264,23 @@ export class OpenPlanComponent implements OnInit {
this.isorganizationbox = true
}
//关闭出现的组织机构div
closediv(){
closediv() {
this.isorganizationbox = false
}
//查询
onSubmit (e) {
onSubmit(e) {
this.getAllPlanInfo()
}
companyName:any //单位名称
js:any //所选组织机构
jsId:any //所选组织机构的id
companyName: any //单位名称
js: any //所选组织机构
jsId: any //所选组织机构的id
// jscheck:boolean //所选组织机构勾选框
unittype:any //单位类型
reservePlanType:any //预案类型
preparelevel:any //编制级别
plcheck:boolean //编制级别勾选框
unittype: any //单位类型
reservePlanType: any //预案类型
preparelevel: any //编制级别
plcheck: boolean //编制级别勾选框
//重置
reset(){
reset() {
this.companyName = ''
// this.js = ''
// this.jsId = ''
@ -307,7 +293,7 @@ export class OpenPlanComponent implements OnInit {
this.pageEvent.pageIndex = 0
this.PageNumber = 1
this.getAllPlanInfo();
}
}
@ -316,14 +302,58 @@ export class OpenPlanComponent implements OnInit {
templateUrl: './PsvShow.html',
styleUrls: ['./open-plan.component.scss']
})
export class GkhtmlPsViewer{
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<GkhtmlPsViewer>,@Inject(MAT_DIALOG_DATA) public data: any) {}
export class GkhtmlPsViewer {
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<GkhtmlPsViewer>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void {
// console.log(this.data)
const viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.data,
panorama: '/api/Objects/PlanPlatform/' + this.data,
});
}
}
//普通图片弹窗
@Component({
selector: 'imgdetails',
templateUrl: './previewImg.html',
styleUrls: ['./open-plan.component.scss']
})
export class OpenImgDetails {
constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef<OpenImgDetails>,
@Inject(MAT_DIALOG_DATA) public data) { }
testSwiper: Swiper;
ngOnInit(): void {
this.allImages = []
this.data.forEach(element => {
element = `/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1`
this.allImages.push(element)
});
}
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', {
lazy: true,
direction: 'horizontal',
loop: false,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}
allImages: any; //展示所有的图片
rotationAngle: number = 0; //旋转角度
//旋转图片
rotate() {
this.rotationAngle = this.rotationAngle + 90
if (this.rotationAngle === 360) { this.rotationAngle = 0 }
}
}

29
src/app/plan-management/open-plan/previewImg.html

@ -0,0 +1,29 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-18 15:09:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-18 15:25:35
-->
<div class="bigimgbox">
<!-- <div mat-dialog-title>图片详情</div> -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270}" class="swiper-lazy"
[attr.data-src]="item">
<div class="swiper-lazy-preloader"></div>
</div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div>
</div>

496
src/app/plan-management/pass-plan/pass-plan.component.scss

@ -1,233 +1,327 @@
.header {
width: 100%;
padding: 12px 10px;
width: 100%;
padding: 12px 10px;
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
padding: 5px 0 0 5px;
// margin-left: 50px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
padding: 5px 0 0 5px;
// margin-left: 50px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
// justify-content:center;
.queryField {
//margin: 0 10px;
input {
width: 180px;
height: 22px;
line-height: 22px;
border-radius: 3px;
}
@media screen and (min-device-width:1400px){
margin: 3px 20px;
}
@media screen and (max-device-width:1400px)and (min-device-width:1200px){
margin: 3px 10px;
mat-form-field{
width: 180px;
}
}
@media screen and (min-device-width:1400px) {
margin: 3px 20px;
}
@media screen and (max-device-width:1400px)and (min-device-width:1200px) {
margin: 3px 10px;
mat-form-field {
width: 180px;
}
@media screen and (max-device-width:1200px){
margin: 3px 0 3px 10px;
mat-form-field{
width: 120px;
}
}
@media screen and (max-device-width:1200px) {
margin: 3px 0 3px 10px;
mat-form-field {
width: 120px;
}
}
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;
.organizationbox{
width:450px;
height: 200px;
background: white;
position: absolute;
top: 48px;
left: 77px;
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
li{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
mat-tree-node{
cursor: pointer;
white-space:pre;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
}
.closediv{
z-index: 100;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
cursor: pointer;
line-height: 30px;
text-align: center;
}
.closediv:hover{
background:rgba(225, 225, 225, 0.8);
}
}
}
//queryBox
.butclass {
button {
width: 80px;
height: 36px;
font-size: 16px;
}
}
.body{
.buttonbox{
padding-left: 50px;
button{
margin:0 10px
}
.ordiv {
position: relative;
.organizationbox {
width: 450px;
height: 200px;
background: white;
position: absolute;
top: 48px;
left: 77px;
z-index: 999;
border: 1px solid grey;
overflow-y: auto;
li {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tablebox{
table{
width: 100%;
// margin-left: 2%;
margin-top: 15px;
}
mat-paginator{
width:100%;
// margin-left: 2%;
// margin-top: 30px;
}
mat-tree-node {
cursor: pointer;
white-space: pre;
}
mat-tree-node:hover {
background: rgba(225, 225, 225, 0.8);
}
.closediv {
z-index: 100;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
cursor: pointer;
line-height: 30px;
text-align: center;
}
.closediv:hover {
background: rgba(225, 225, 225, 0.8);
}
}
}
.mat-header-cell{
text-align: center;
}
.mat-cell{
text-align: center;
.body {
.buttonbox {
padding-left: 50px;
button {
margin: 0 10px
}
}
.tablebox {
table {
width: 100%;
// margin-left: 2%;
margin-top: 15px;
}
mat-paginator {
width: 100%;
// margin-left: 2%;
// margin-top: 30px;
}
}
}
.mat-header-cell {
text-align: center;
}
.mat-cell {
text-align: center;
}
//完整度
.integrityDiv{
width: 180px;
height: 30px;
background-color: #e2e7ee;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
margin: 0 auto;
position: relative;
.integrityNum{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: black;
.integrityDiv {
width: 180px;
height: 30px;
background-color: #e2e7ee;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
margin: 0 auto;
position: relative;
.integrityNum {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: black;
font-weight: 800;
font-size: 15px;
cursor: default;
}
.integrityColorDiv {
height: 100%;
}
.integrityDetails {
position: absolute;
display: none;
width: 350px;
height: 280px;
border: 1px solid rgba(0, 0, 0, 0.22);
background-color: white;
.integrityDetailsTop {
width: 100%;
height: 23px;
line-height: 23px;
border-bottom: 1px solid rgba(0, 0, 0, 0.22);
margin-bottom: 1px;
font-size: 14px;
span {
display: inline-block;
text-align: center;
font-weight: 800;
font-size: 15px;
cursor: default;
}
.integrityColorDiv{
height: 100%;
}
.span1 {
width: 25%;
}
.span2 {
width: 60%;
}
.span3 {
width: 15%;
}
}
.integrityDetails{
position: absolute;
display: none;
width: 350px;
height:280px;
border: 1px solid rgba(0, 0, 0, 0.22);
background-color: white;
.integrityDetailsTop{
width: 100%;
height: 23px;
line-height:23px;
border-bottom: 1px solid rgba(0, 0, 0, 0.22);
margin-bottom: 1px;
font-size: 14px;
span{
display: inline-block;
text-align: center;
font-weight: 800;
}
.span1{
width: 25%;
}
.span2{
width: 60%;
}
.span3{
width: 15%;
.integrityDetailsBody {
ul {
li {
width: 100%;
height: 23px;
line-height: 23px;
margin: 3px 0;
div {
float: left;
font-size: 13px;
}
.name {
width: 25%;
height: 100%;
}
.colorDiv {
width: 60%;
height: 100%;
position: relative;
.colorDivBac {
width: 90%;
height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: #dfe5ec;
border-radius: 5px;
.colorDivCon {
border-radius: 5px;
height: 100%;
background-color: #2398f1;
}
}
}
.integrityDetailsBody{
ul{
li{
width: 100%;
height: 23px;
line-height: 23px;
margin: 3px 0;
div{
float: left;
font-size: 13px;
}
.name{
width: 25%;
height: 100%;
}
.colorDiv{
width: 60%;
height: 100%;
position: relative;
.colorDivBac{
width: 90%;
height: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
background-color: #dfe5ec;
border-radius: 5px;
.colorDivCon{
border-radius: 5px;
height: 100%;
background-color: #2398f1;
}
}
span{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
// color: white;
font-weight: 600;
}
}
.number{
width: 15%;
height: 100%;
}
}
span {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
// color: white;
font-weight: 600;
}
}
.number {
width: 15%;
height: 100%;
}
}
}
}
.bottomposition{
top: 2px;
left: 188px;
}
.bottomposition {
top: 2px;
left: 188px;
}
.topposition {
top: -252px;
left: 188px;
}
}
.integrityDiv:hover {
.integrityDetails {
display: block;
}
}
@media screen and (max-width:1200px) {
.bigimgbox {
width: 880px;
height: 580px;
//预览图片
.previewImgBox {
width: 800px;
height: 475px;
text-align: center;
}
.topposition{
top: -252px;
left: 188px;
}
}
@media screen and (min-width:1200px) and (max-width:1400px) {
.bigimgbox {
width: 880px;
height: 610px;
//预览图片
.previewImgBox {
width: 800px;
height: 500px;
text-align: center;
}
}
}
.integrityDiv:hover{
.integrityDetails{
display: block;
@media screen and (min-width:1400px) {
.bigimgbox {
width: 1110px;
height: 860px;
//预览图片
.previewImgBox {
width: 900px;
height: 100%;
text-align: center;
}
.previewImgBottom {
text-align: center;
height: 30px;
margin: 20px auto;
}
}
}
}

25
src/app/plan-management/pass-plan/pass-plan.component.spec.ts

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

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

@ -4,13 +4,14 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router'
import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { Viewer } from 'photo-sphere-viewer';
declare var CryptoJS
import Swiper from 'swiper';
@Component({
selector: 'app-pass-plan',
templateUrl: './pass-plan.component.html',
@ -18,8 +19,8 @@ declare var CryptoJS
})
export class PassPlanComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { }
private _transformer = (node, level: number) => { //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
@ -35,239 +36,239 @@ export class PassPlanComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
//分页
@ViewChild(MatPaginator, {static: true})
//分页
@ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
PageNumber: any; //第几页
displayedColumns: string[] = ['planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation'];
allorganizations:any //所有组织机构
allunittype:any //所有单位类型
tabledataSource:any //表格数据
displayedColumns: string[] = ['planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'];
allorganizations: any //所有组织机构
allunittype: any //所有单位类型
tabledataSource: any //表格数据
url
preparelevels:any
preparelevels: any
ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){
this.pcMore=false
this.padMore=true
this.pcfind=false
this.padjt=true
}else{
this.pcfind=true
this.pcMore=true
this.padMore=false
this.padjt=false
if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore = false
this.padMore = true
this.pcfind = false
this.padjt = true
} else {
this.pcfind = true
this.pcMore = true
this.padMore = false
this.padjt = false
}
this.getunitdata();
this.getOrganizations();
this.getUnittype();
this.getAllPlanInfo();
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
if (level == "0") {//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "总队", value: "1" },
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(level == "1"){//如果是支队
if (level == "1") {//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "支队", value: "2" },
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(level == "2"){//如果是大队
if (level == "2") {//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
{ name: "大队", value: "4" },
{ name: "中队", value: "8" }
]
}
if(level == "3"){//如果是中队
if (level == "3") {//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
{ name: "中队", value: "8" }
]
}
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length)
//console.log(this.url)
}
pcMore//pc更多
pcput=false//pc收起
pcput = false//pc收起
pcfind//pc查询
padjt=false
padMore=true//pad收缩控制
padput=false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png"
pcInfo(){
this.pcMore=!this.pcMore
this.pcput=!this.pcput
padjt = false
padMore = true//pad收缩控制
padput = false//pad收起按钮
imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown = "../../../assets/images/routup2.png"
pcInfo() {
this.pcMore = !this.pcMore
this.pcput = !this.pcput
}
padInfo(){
this.padMore=!this.padMore
this.padput=!this.padput
padInfo() {
this.padMore = !this.padMore
this.padput = !this.padput
}
allPlanInfo:any //存储所有预案信息
allPlanInfo: any //存储所有预案信息
//获得所有预案信息
getAllPlanInfo(){
getAllPlanInfo() {
let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = ''
if(this.reservePlanType && this.reservePlanType.length != 0){
if (this.reservePlanType && this.reservePlanType.length != 0) {
reservePlanType = eval(this.reservePlanType.join("|"))
}
let paramsdata:any = {
}
let paramsdata: any = {
CompanyName: this.companyName || '',
OrganizationId: this.jsId || '',
HasChildrenOrganization:this.jscheck || '',
BuildingTypeId: this.unittype || '',
HasChildrenOrganization: this.jscheck || '',
BuildingTypeId: this.unittype || '',
PlanType: this.reservePlanType || '',
AuditStatus:'', //审核状态
PlanLevel: this.preparelevel || '',
AuditStatus: '', //审核状态
PlanLevel: this.preparelevel || '',
HasChildrenPlanLevel: this.plcheck || '',
CreationTimeRangeStart:this.addtime||'',
CreationTimeRangeEnd:this.endtime||'',
CreationTimeRangeStart: this.addtime || '',
CreationTimeRangeEnd: this.endtime || '',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
PageSize: this.pageSizeOptions[0],
Sort: '',
PlanCategories:this.planCategory
PlanCategories: this.planCategory
}
this.http.get("/api/ApprovedPlans",{params:paramsdata}).subscribe((data:any)=>{
this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => {
this.length = data.totalCount
this.allPlanInfo = data
this.tabledataSource = data.items
this.tabledataSource = data.items
})
}
colorRgb(sColor){
colorRgb(sColor) {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = "#";
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
}
//处理六位的颜色值
var sColorChange = [];
for (var i = 1; i < 7; i += 2) {
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
if (sColor.length === 4) {
var sColorNew = "#";
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
return sColorChange;
sColor = sColorNew;
}
//处理六位的颜色值
var sColorChange = [];
for (var i = 1; i < 7; i += 2) {
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
}
return sColorChange;
} else {
return sColor;
return sColor;
}
}
colorHex(rgb){
colorHex(rgb) {
var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex:any = Number(aColor[i]).toString(16);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex: any = Number(aColor[i]).toString(16);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") {
hex += hex;
}
return strHex;
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
} else if (reg.test(_this)) {
var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) {
return _this;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]);
}
return numHex;
var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) {
return _this;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]);
}
return numHex;
}
} else {
return _this;
return _this;
}
}
gradientColor(startColor, endColor, step) {
let _this = this
let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式
let startR = startRGB[0];
let startG = startRGB[1];
let startB = startRGB[2];
let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式
let startR = startRGB[0];
let startG = startRGB[1];
let startB = startRGB[2];
let endRGB = _this.colorRgb(endColor);
let endR = endRGB[0];
let endG = endRGB[1];
let endB = endRGB[2];
let endRGB = _this.colorRgb(endColor);
let endR = endRGB[0];
let endG = endRGB[1];
let endB = endRGB[2];
let sR = (endR - startR) / step;//总差值
let sG = (endG - startG) / step;
let sB = (endB - startB) / step;
let sR = (endR - startR) / step;//总差值
let sG = (endG - startG) / step;
let sB = (endB - startB) / step;
var colorArr = [];
for (var i = 0; i < step; i++) {
//计算每一步的hex值
var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')');
colorArr.push(hex);
//计算每一步的hex值
var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')');
colorArr.push(hex);
}
return colorArr;
}
integrity(width){
}
integrity(width) {
let _this = this
let style:any = {}
style.width = width +'%';
if(width < 30){
let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for(let i = 0; i < 30; i++){
if( i == width){
let style: any = {}
style.width = width + '%';
if (width < 30) {
let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for (let i = 0; i < 30; i++) {
if (i == width) {
style.background = colorArr[i]
}
}
}
if(width >= 30 && width < 60){
let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for(let i = 30; i < 60; i++){
if( i == width){
style.background = colorArr[i-30]
if (width >= 30 && width < 60) {
let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for (let i = 30; i < 60; i++) {
if (i == width) {
style.background = colorArr[i - 30]
}
}
}
if(width >= 60){
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for(let i = 60; i <= 100; i++){
if( i == width){
style.background = colorArr[i-60]
if (width >= 60) {
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for (let i = 60; i <= 100; i++) {
if (i == width) {
style.background = colorArr[i - 60]
}
}
}
return style
}
integrityDetails(width,zong){
let style:any = {}
style.width = (width/zong)*100 +'%';
integrityDetails(width, zong) {
let style: any = {}
style.width = (width / zong) * 100 + '%';
return style
}
//得到当前单位信息
getunitdata(){
getunitdata() {
this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{
this.organizationName = data.organizationName
(data: any) => {
this.organizationName = data.organizationName
}
)
}
@ -275,41 +276,41 @@ export class PassPlanComponent implements OnInit {
endtime//结束时间
integrityScoreMin//完整度最小值
integrityScoreMax//完整度最大值
organizationName:any //当前单位组织机构名称
treedata:any //组织机构树型数据
newArr:any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
organizationName: any //当前单位组织机构名称
treedata: any //组织机构树型数据
newArr: any = []
newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据
getpresentOrganization(){
getpresentOrganization() {
this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => {
item.children = []
this.newallorganizations.forEach(element => {
if(element.parentId == item.id){
if (element.parentId == item.id) {
item.children.push(element)
}
});
});
this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{
(data: any) => {
this.organizationName = data.organizationName
if(this.organizationName){
if (this.organizationName) {
this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){
if (item.name == this.organizationName) {
this.dataSource.data = [item]
}
});
}else{
} else {
this.dataSource.data = this.tree.toTree(this.treedata);
}
}
)
}
//获得所有组织机构
getOrganizations(){
getOrganizations() {
this.http.get('/api/Organizations').subscribe(
(data:any)=>{
(data: any) => {
this.allorganizations = data
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
@ -318,120 +319,103 @@ export class PassPlanComponent implements OnInit {
}
//获得所有单位类型
getUnittype(){
getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{
data => {
this.allunittype = data
}
)
}
//查看单位信息
lookUnitInfo(element){
// console.log(element)
// const dialogRef = this.dialog.open(UnitInfo, {
// width: '1500px',
// height:'800px'
// });
sessionStorage.setItem("editable","0")
sessionStorage.setItem("companyName",element.company.name)
sessionStorage.setItem("companyId",element.company.id)
sessionStorage.setItem(element.company.id,JSON.stringify(element.company.companyIntegrityScore))
window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`,'_blank');
lookUnitInfo(element) {
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("companyName", element.company.name)
sessionStorage.setItem("companyId", element.company.id)
sessionStorage.setItem(element.company.id, JSON.stringify(element.company.companyIntegrityScore))
window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`, '_blank');
}
//跳转查看预案页面 审核通过预案
routerTo(e){
// console.log(e)
if(e.planMode == 0||e.planMode == 1){
//console.log(e.attachmentUrls)
var index=e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){
routerTo(e) {
console.log(e)
if (e.planMode == 0 || e.planMode == 1) {
var index = e.attachmentUrls[0].indexOf("\/")
if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkPsViewer, {
width: '1500px',
height:'800px',
height: '800px',
data: e.attachmentUrls[0]
});
}
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{
let filename:string
let fetchUrl = e.attachmentUrls[0]
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)
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: docId,
title: 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}`)
})
} else if (e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'JPG' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'png' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'peg' || e.attachmentUrls[0].substr(e.attachmentUrls[0].length - 3, e.attachmentUrls[0].length) == 'jpg') {
let data = e
const dialogRef = this.dialog.open(PassImgDetails, {//调用open方法打开对话框并且携带参数过去
data: data.attachmentUrls,
});
dialogRef.afterClosed().subscribe();
} else {
let fetchUrl = e.attachmentUrls[0]
if (fetchUrl) {
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
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)
} else {
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
}
}
}
if(e.planMode == 2){ //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId",id)
sessionStorage.setItem("companyId",e.companyId)
}
if (e.planMode == 2) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", e.companyId)
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
sessionStorage.setItem("editable","0")
sessionStorage.setItem("planName",e.name)
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
}
if(e.planMode == 3){ //如果是跳转网页
sessionStorage.setItem("url",e.url)
if (e.planMode == 3) { //如果是跳转网页
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
}
}
//预案公开
openReserve (e) {
this.http.put(`/api/PlanAudits/${e.id}/Public`,[]).subscribe(data=>{
openReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('预案已公开','确定',config);
this.snackBar.open('预案已公开', '确定', config);
})
}
//预案取消公开
closeReserve (e) {
this.http.put(`/api/PlanAudits/${e.id}/Unpublic`,[]).subscribe(data=>{
closeReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Unpublic`, []).subscribe(data => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('预案已取消公开','确定',config);
this.snackBar.open('预案已取消公开', '确定', config);
})
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
chagePage(e) {
this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo();
}
//辖区中队div是否显示
isorganizationbox:boolean = false
isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量
add(node) {
this.isorganizationbox = false
@ -447,26 +431,26 @@ export class PassPlanComponent implements OnInit {
this.isorganizationbox = true
}
//关闭出现的组织机构div
closediv(){
closediv() {
this.isorganizationbox = false
}
//查询
onSubmit (e) {
onSubmit(e) {
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAllPlanInfo();
}
companyName:any //单位名称
js:any //所选组织机构
jsId:any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框
unittype:any //单位类型
reservePlanType:any //预案类型
preparelevel:any //编制级别
plcheck:boolean //编制级别勾选框
planCategory=[]//预案级别
companyName: any //单位名称
js: any //所选组织机构
jsId: any //所选组织机构的id
jscheck: boolean //所选组织机构勾选框
unittype: any //单位类型
reservePlanType: any //预案类型
preparelevel: any //编制级别
plcheck: boolean //编制级别勾选框
planCategory = []//预案级别
//重置
reset(){
reset() {
this.companyName = ''
this.js = ''
this.jsId = ''
@ -474,13 +458,13 @@ export class PassPlanComponent implements OnInit {
this.unittype = ''
this.reservePlanType = ''
this.preparelevel = ''
this.addtime=''
this.endtime=''
this.addtime = ''
this.endtime = ''
this.plcheck = false
//重新获取初始化列表
this.pageEvent.pageIndex = 0
this.PageNumber = 1
this.planCategory=[]
this.planCategory = []
this.getAllPlanInfo();
}
}
@ -490,14 +474,14 @@ export class PassPlanComponent implements OnInit {
templateUrl: './PsvShow.html',
styleUrls: ['./pass-plan.component.scss']
})
export class GkPsViewer{
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<GkPsViewer>,@Inject(MAT_DIALOG_DATA) public data: any) {}
export class GkPsViewer {
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<GkPsViewer>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void {
// console.log(this.data)
const viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.data,
panorama: '/api/Objects/PlanPlatform/' + this.data,
});
}
}
@ -508,9 +492,53 @@ export class GkPsViewer{
templateUrl: './unitInfo.html',
styleUrls: ['./pass-plan.component.scss']
})
export class UnitInfo{
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<UnitInfo>,@Inject(MAT_DIALOG_DATA) public data: any) {}
export class UnitInfo {
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<UnitInfo>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void {
// console.log(this.data)
}
}
//普通图片弹窗
@Component({
selector: 'imgdetails',
templateUrl: './previewImg.html',
styleUrls: ['./pass-plan.component.scss']
})
export class PassImgDetails {
constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef<PassImgDetails>,
@Inject(MAT_DIALOG_DATA) public data) { }
testSwiper: Swiper;
ngOnInit(): void {
this.allImages = []
this.data.forEach(element => {
element = `/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1`
this.allImages.push(element)
});
}
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', {
lazy: true,
direction: 'horizontal',
loop: false,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}
allImages: any; //展示所有的图片
rotationAngle: number = 0; //旋转角度
//旋转图片
rotate() {
this.rotationAngle = this.rotationAngle + 90
if (this.rotationAngle === 360) { this.rotationAngle = 0 }
}
}

29
src/app/plan-management/pass-plan/previewImg.html

@ -0,0 +1,29 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-18 15:09:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-18 15:25:35
-->
<div class="bigimgbox">
<!-- <div mat-dialog-title>图片详情</div> -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270}" class="swiper-lazy"
[attr.data-src]="item">
<div class="swiper-lazy-preloader"></div>
</div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div>
</div>

9
src/app/plan-management/plan-management.module.ts

@ -45,8 +45,8 @@ import { MatTooltipModule } from '@angular/material/tooltip';
import { MatTreeModule } from '@angular/material/tree';
import { EntryPlanComponent } from './entry-plan/entry-plan.component';
import { PassPlanComponent, UnitInfo } from './pass-plan/pass-plan.component';
import { OpenPlanComponent } from './open-plan/open-plan.component';
import { PassPlanComponent, UnitInfo, PassImgDetails } from './pass-plan/pass-plan.component';
import { OpenPlanComponent,OpenImgDetails } from './open-plan/open-plan.component';
import { EntryPlanLookComponent, AddPlanone, DownloadFile, AuditResult, ChangeName, ImgDetails } from './entry-plan-look/entry-plan-look.component';
import { PlanType, AuditSatus, PlanLevel, state } from '../pipes/boolean.pipe';
import { WebLookComponent } from './web-look/web-look.component';
@ -63,14 +63,15 @@ import { typeAuditResult } from './type-plan/type-plan.component';
import { MaintainUpComponent } from './maintain-up/maintain-up.component'
import { GkPsViewer } from './pass-plan/pass-plan.component'
import { GkhtmlPsViewer } from './open-plan/open-plan.component';
import { ReinforcePlanComponent } from './reinforce-plan/reinforce-plan.component'
import { ReinforcePlanComponent } from './reinforce-plan/reinforce-plan.component';
import { SeeVideoComponent } from './see-video/see-video.component'
@NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails],
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails,PassImgDetails,OpenImgDetails, SeeVideoComponent],
imports: [
CommonModule,
PlanManagementRoutingModule,

5
src/app/plan-management/see-video/see-video.component.html

@ -0,0 +1,5 @@
<!-- 视频 -->
<div class="video" style="text-align: center; overflow: hidden; height: 768px;">
<video [src]="data" controls="controls" width="auto" height="100%"></video>
</div>
<!-- 视频 -->

0
src/app/plan-management/see-video/see-video.component.scss

19
src/app/plan-management/see-video/see-video.component.ts

@ -0,0 +1,19 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ImgDetails } from '../entry-plan-look/entry-plan-look.component';
@Component({
selector: 'app-see-video',
templateUrl: './see-video.component.html',
styleUrls: ['./see-video.component.scss']
})
export class SeeVideoComponent implements OnInit {
constructor(public dialog: MatDialog, public dialogRef: MatDialogRef<ImgDetails>,
@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit(): void {
}
}

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

@ -205,7 +205,7 @@ export class AddUnitOneComponent implements OnInit {
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:350px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'

39
src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts

@ -114,6 +114,36 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
//return tishiPao
}
axisLabel = {
interval: 0,
//rotate:-30,
textStyle:{
fontSize :18,
color:'#000000'
},
formatter:function(value)
{
var ret = "";//拼接加\n返回的类目项
var maxLength = 2;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1)//如果类目项的文字大于3,
{
for (var i = 0; i < rowN; i++) {
var temp = "";//每次截取的字符串
var start = i * maxLength;//开始截取的位置
var end = start + maxLength;//结束截取的位置
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
temp = value.substring(start, end) + "\n";
ret += temp; //凭借最终的字符串
}
return ret;
}
else {
return value;
}
}
}//echarts两个字换行
detailPlanEchart
option
detailEcharts(){
@ -134,14 +164,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
id:this.organizationId,
type: 'category',
data:this.zhiNameData,
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :18,
color:'#000000'
}
}
axisLabel:this.axisLabel
},
yAxis: {
type: 'value',

37
src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts

@ -106,6 +106,36 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
//return tishiPao
}
axisLabel = {
interval: 0,
//rotate:-30,
textStyle:{
fontSize :18,
color:'#000000'
},
formatter:function(value)
{
var ret = "";//拼接加\n返回的类目项
var maxLength = 2;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1)//如果类目项的文字大于3,
{
for (var i = 0; i < rowN; i++) {
var temp = "";//每次截取的字符串
var start = i * maxLength;//开始截取的位置
var end = start + maxLength;//结束截取的位置
//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧
temp = value.substring(start, end) + "\n";
ret += temp; //凭借最终的字符串
}
return ret;
}
else {
return value;
}
}
}//echarts两个字换行
detailPlanEchart//echarts实例
detailEcharts(){
@ -127,14 +157,15 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
id:this.thisorId,
type: 'category',
data: this.zhongNameData,
axisLabel:{
//this.axisLabel,
axisLabel: this.axisLabel
/* axisLabel:{
this.axisLabel,
textStyle:{
fontSize :18,
color:'#000000'
}
}
} */
},
yAxis: {
type: 'value',

4
src/app/statistic-analysis/all-plan/all-plan.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-03-05 15:57:08
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-24 14:19:05
* @LastEditTime: 2021-05-31 10:18:47
-->
<div class="body">
<div class="topbox">
@ -38,7 +38,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;" (click)='lookPlan(element)'>详情</span>
<span style="color: blue;" (click)='lookPlan(element)'>详情</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

47
src/app/statistic-analysis/all-plan/all-plan.component.scss

@ -73,4 +73,51 @@
text-decoration:underline
}
}
}
//预览图片旋转角度
.rotateA {transform: rotate(90deg) scale(0.75);}
.rotateB {transform: rotate(180deg)}
.rotateC {transform: rotate(270deg) scale(0.75);}
@media screen and (max-width:1200px){
.bigimgbox{
width: 880px;
height: 580px;
//预览图片
.previewImgBox {
width: 800px;
height: 475px;
text-align: center;
}
}
}
@media screen and (min-width:1200px) and (max-width:1400px){
.bigimgbox{
width:880px;
height: 610px;
//预览图片
.previewImgBox {
width: 800px;
height: 500px;
text-align: center;
}
}
}
@media screen and (min-width:1400px){
.bigimgbox{
width:1110px;
height: 860px;
//预览图片
.previewImgBox {
width: 900px;
height: 100%;
text-align: center;
}
.previewImgBottom {
text-align: center;
height: 30px;
margin: 20px auto;
}
}
}

62
src/app/statistic-analysis/all-plan/all-plan.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-03-15 11:32:30
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-17 17:19:25
* @LastEditTime: 2021-05-31 10:07:51
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -20,7 +20,7 @@ import { TreeService } from '../../http-interceptors/tree.service'
import { MatTableDataSource } from '@angular/material/table';
import { Viewer } from 'photo-sphere-viewer';
declare var CryptoJS
import Swiper from 'swiper';
@Component({
selector: 'app-all-plan',
templateUrl: './all-plan.component.html',
@ -91,6 +91,13 @@ export class AllPlanComponent implements OnInit {
data: e.attachmentUrls[0]
});
}
else if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='png'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='jpeg'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='jpg'){
let data = e
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
data:data.attachmentUrls,
});
dialogRef.afterClosed().subscribe();
}
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{
@ -122,7 +129,11 @@ export class AllPlanComponent implements OnInit {
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}`)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该预案无法查看!','确定',config);
//window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
})
}
}
@ -169,4 +180,49 @@ export class PsViewer{
});
}
}
//普通图片弹窗
@Component({
selector: 'imgdetails',
templateUrl: './previewImg.html',
styleUrls: ['./all-plan.component.scss']
})
export class ImgDetails{
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<ImgDetails>,
@Inject(MAT_DIALOG_DATA) public data) { }
testSwiper: Swiper;
ngOnInit(): void {
//console.log(this.data)
this.allImages = []
this.data.forEach(element => {
element = `/api/Objects/PlanPlatform/${element}?x-oss-process=image/auto-orient,1`
this.allImages.push(element)
});
//this.allImages.push(`${this.data.attachmentUrls[0]}?x-oss-process=image/auto-orient,1`)
}
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', {
lazy: true,
direction: 'horizontal',
loop: false,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}
allImages:any; //展示所有的图片
rotationAngle:number=0; //旋转角度
//旋转图片
rotate () {
this.rotationAngle = this.rotationAngle+90
if (this.rotationAngle === 360) {this.rotationAngle = 0}
}
}

29
src/app/statistic-analysis/all-plan/previewImg.html

@ -0,0 +1,29 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-05-18 15:09:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-18 15:25:35
-->
<div class="bigimgbox">
<!-- <div mat-dialog-title>图片详情</div> -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270}" class="swiper-lazy"
[attr.data-src]="item">
<div class="swiper-lazy-preloader"></div>
</div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div>
</div>

12
src/app/statistic-analysis/echarts-data.service.ts

@ -423,7 +423,7 @@ export class EchartsDataService {
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:400px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'
@ -462,7 +462,7 @@ export class EchartsDataService {
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:400px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'
@ -516,7 +516,7 @@ export class EchartsDataService {
}
//console.log(this.tishiData)
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='</br><div style="width:400px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>'
@ -574,7 +574,7 @@ export class EchartsDataService {
obdata
orid
async getData(paramsdata,api){
let jwt = sessionStorage.getItem("token");
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)
@ -584,6 +584,10 @@ export class EchartsDataService {
let result = await new Promise((resolve, reject)=>{
this.http.get(api,{params:paramsdata}).subscribe((data:any)=>{
resolve(data)
},err=>{
// console.log('产生错误了',api)
// console.log('产生错误了',paramsdata)
console.log('产生错误了',err)
})
})
this.allDate.push(result)

2
src/app/statistic-analysis/home/home.component.html

@ -17,7 +17,7 @@
<div class="panel-bd" style="padding-top: 3px;">
<div class="progress-list">
<div class="progress-item">
<div class="progress-name">时间进度</div>
<div class="progress-name">时间进度</div>
<div class="progress">
<div class="progress-num">0%</div>
<div class="progress-bar">

26
src/app/statistic-analysis/home/home.component.ts

@ -130,9 +130,9 @@ export class HomeComponent implements OnInit {
// let adcode = this.adcode; //行政编码
let adcode
if(sessionStorage.getItem("realName") == "上海总队"){
adcode = 310000
adcode = 430200
}else{
adcode = 310000
adcode = 430200
}
districtExplorer.loadAreaNode(adcode, (error, areaNode)=> {
@ -263,9 +263,9 @@ export class HomeComponent implements OnInit {
// console.log('区域外点击');
let adcode
if(sessionStorage.getItem("realName") == "上海总队"){
adcode = 310000
adcode = 430200
}else{
adcode = 310000
adcode = 430200
}
districtExplorer.loadAreaNode(adcode, (error, areaNode)=> {
//更新地图视野
@ -332,17 +332,17 @@ export class HomeComponent implements OnInit {
keyUnitNum
dataGetNum = 6578
threePlanNum = "4374"
twoPlanNum = "9693"
cardPlanNum = "6403"
otherPlanNum = "2208"
threePlanNum = "0"
twoPlanNum = "0"
cardPlanNum = "0"
otherPlanNum = "0"
aPlan = '328'
bPlan = '219'
cPlan = '168'
dPlan = '254'
ePlan = '116'
aPlan = '0'
bPlan = '0'
cPlan = '0'
dPlan = '0'
ePlan = '0'
ngAfterViewInit(): void {
}

34
src/app/statistic-analysis/real-monitoring/real-monitoring.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-08 09:42:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-05-19 14:46:30
* @LastEditTime: 2021-05-31 09:47:55
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
@ -26,11 +26,12 @@ export class RealMonitoringComponent implements OnInit {
campaignTwo: FormGroup; */
constructor(private router: Router, public EchartsData: EchartsDataService, private route: ActivatedRoute, public snackBar: MatSnackBar) { }
addtime = String(new Date().getFullYear()) + '-01'//添加时间
endtime = String(new Date().getFullYear()) + '-0' + String(new Date().getMonth() + 1)
addtime = String(new Date().getFullYear()) + '-' + String(("0" + (new Date().getMonth() + 1)).slice(-2))//添加时间
endtime = String(new Date().getFullYear()) + '-' + String(("0" + (new Date().getMonth() + 1)).slice(-2))
/* addtime=String(new Date().getFullYear()+new Date().getMonth())
endtime=String(new Date().getFullYear()+new Date().getMonth()) */
ngOnInit(): void {
console.log(this.addtime,this.endtime,7899)
window.setTimeout(() => {
this.getechartsdata(true)
}, 0)
@ -87,17 +88,18 @@ export class RealMonitoringComponent implements OnInit {
//获取底端柱状图数据
let paramBottom = {
TimeIntervalStart: this.addtime == '0' ? '' : this.endtime,
TimeIntervalStart: this.addtime == '0' ? '' : this.addtime,
TimeIntervalEnd: this.endtime == '0' ? '' : this.endtime
}
if (chushi) {
await this.EchartsData.getData(paramBottom, '/api/StatisticsAnalysis/Plans/AuditApproved/Organizations')
this.bottomTable = JSON.parse(JSON.stringify(this.EchartsData.allDate))
this.addNum = this.bottomTable[0].totalCount
this.addyuan = []
this.bottomTable[0].organizations.forEach((value, index, array) => {
this.zhiNameData.push(array[index].organizationName)
this.zhiNumData.push(array[index].count)
if (index > 0 && index < 4) {
if (index >= 0 && index < 3) {
this.addyuan.push(array[index].organizationName)
}
@ -148,6 +150,7 @@ export class RealMonitoringComponent implements OnInit {
this.leftzhutu.dispose()
this.dateyue = []
this.dateNum = []
this.indexData = []
//this.zhiNameData = []
//this.zhiNumData = []
//this.addyuan = []
@ -238,6 +241,11 @@ export class RealMonitoringComponent implements OnInit {
symbolSize: [65, 65],
data: this.EchartsData.qipao(this.tiaoshiPao, this.dateNum, this.dateyue)
},
itemStyle: {
normal:{
color: "#3E91F9"
}
},
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
@ -290,6 +298,9 @@ export class RealMonitoringComponent implements OnInit {
lengthdata = ['二维预案', '三维预案', '文本预案', '其他预案']
rightbingtu() {
this.rightbing = echarts.init(document.getElementById('rightecharts'), 'walden');
if (!this.indexData.length) {
return
}
this.optionRightbing = {
/* title: {
text: `建筑类型统计(${this.count}家)`,
@ -325,6 +336,7 @@ export class RealMonitoringComponent implements OnInit {
},
data: this.lengthdata
},
color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
series: [
{
top: '0',
@ -390,10 +402,10 @@ export class RealMonitoringComponent implements OnInit {
color:'#000000'
},
interval: 0,
//rotate:38
rotate: this.zhiNumData.length >= 10? 60 : 0,
formatter:function(value){
var ret = "";//拼接加\n返回的类目项
var maxLength = 3;//每项显示文字个数
var maxLength = 9;//每项显示文字个数
var valLength = value.length;//X轴类目项的文字个数
var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数
if (rowN > 1) { //如果类目项的文字大于3,
@ -444,8 +456,12 @@ export class RealMonitoringComponent implements OnInit {
symbolSize: [65, 65],
data: this.EchartsData.qipao(this.tiaoshiPao, this.zhiNumData, this.zhiNameData)
},
barWidth :'38',
itemStyle: {
normal:{
color: "#3E91F9"
}
},
barWidth :'38',
//label: this.topTextlabel
}]
};

10
src/app/statistic-analysis/state/page-one/page-one.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-09-01 15:24:39
* @LastEditors: sueRimn
* @LastEditTime: 2021-04-29 09:11:46
* @LastEditTime: 2021-05-31 09:59:49
*/
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@ -116,11 +116,9 @@ export class PageOneComponent implements OnInit {
},
data:tid=='pieone'?[
{value:this.tabledata[0].planCategoryStatistics.planCategories[0]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[0].count:0, name: 'Ⅰ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[0]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[0].planCategoryName:'',type:1},
{value:this.tabledata[0].planCategoryStatistics.planCategories[1]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[1].count:0, name: 'Ⅱ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[1]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[1].planCategoryName:'',type:2},
{value:this.tabledata[0].planCategoryStatistics.planCategories[2]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[2].count:0, name: 'Ⅲ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[2]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[2].planCategoryName:'',type:3},
{value:this.tabledata[0].planCategoryStatistics.planCategories[3]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[3].count:0, name: 'Ⅳ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[3]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[3].planCategoryName:'',type:4},
{value:this.tabledata[0].planCategoryStatistics.planCategories[4]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[4].count:0, name: 'Ⅴ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[4]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[4].planCategoryName:'',type:5},
{value:this.tabledata[0].planCategoryStatistics.planCategories[0]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[0].count:0, name: 'Ⅲ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[0]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[0].planCategoryName:'',type:3},
{value:this.tabledata[0].planCategoryStatistics.planCategories[1]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[1].count:0, name: 'Ⅳ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[1]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[1].planCategoryName:'',type:4},
{value:this.tabledata[0].planCategoryStatistics.planCategories[2]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[2].count:0, name: 'Ⅴ级预案', planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[2]!=undefined? this.tabledata[0].planCategoryStatistics.planCategories[2].planCategoryName:'',type:5},
]: [
{value:this.tabledata[0].planStatusStatistics.planStatuses[0]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[0].count:0, name: '预案新增',type:1,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[0]!=undefined?this.tabledata[0].planStatusStatistics.planStatuses[0].planStatusName:''},
{value:this.tabledata[0].planStatusStatistics.planStatuses[2]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[2].count:0, name: '预案审核通过',type:3,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[2]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[2].planStatusName:''},

3
src/app/statistic-analysis/statistic-analysis.module.ts

@ -74,9 +74,10 @@ import { PsViewer }from './all-plan/all-plan.component';
import { GkPsViewer2, PlanAnalysisBySynthesisComponent } from './plan-analysis-by-synthesis/plan-analysis-by-synthesis.component'
import { PlanManagementModule } from '../plan-management/plan-management.module';
import { RealMonitoringComponent } from './real-monitoring/real-monitoring.component'
import { ImgDetails } from './all-plan/all-plan.component'
@NgModule({
declarations: [GkPsViewer2,PageOneComponent, PageTwoTimeComponent, PageTwoNameComponent, PageZhongDuiDetailsComponent,echartsComponent, DeleteOneComponent, DeleteTwoComponent, DeleteThereComponent, DeleteFourComponent, BuildingTypeOneComponent, ScheduledUpdatesComponent,publicEchartsComponent,verifiedComponent,notVerifiedComponent,detailedInformationComponent,moreTableComponent,yueDateComponent,yuebuildingDateComponent,indexConditionComponent, BuildingTypeTwoForwardComponent, BuildingTypeTwoReverseComponent, BuildingTypeThreeDetailsComponent, AddUnitOneComponent, AddUnitTwoTypeStatisticsComponent, AddUnitTwoTypeDetailsComponent, AddUnitTwoTimeComponent,AddUnitThreeLineDetailsComponent,AddUnitThreeBarDetailsComponent, HomeComponent, DeleteThereLineDetailsComponent, PageThereComponent, PageThereYearComponent, DeleteTwoNewaddComponent, CompangInfoComponent, AllPlanComponent,PsViewer, RealMonitoringComponent,PlanAnalysisBySynthesisComponent],
declarations: [GkPsViewer2,PageOneComponent, PageTwoTimeComponent, PageTwoNameComponent, PageZhongDuiDetailsComponent,echartsComponent, DeleteOneComponent, DeleteTwoComponent, DeleteThereComponent, DeleteFourComponent, BuildingTypeOneComponent, ScheduledUpdatesComponent,publicEchartsComponent,verifiedComponent,notVerifiedComponent,detailedInformationComponent,moreTableComponent,yueDateComponent,yuebuildingDateComponent,indexConditionComponent, BuildingTypeTwoForwardComponent, BuildingTypeTwoReverseComponent, BuildingTypeThreeDetailsComponent, AddUnitOneComponent, AddUnitTwoTypeStatisticsComponent, AddUnitTwoTypeDetailsComponent, AddUnitTwoTimeComponent,AddUnitThreeLineDetailsComponent,AddUnitThreeBarDetailsComponent, HomeComponent, DeleteThereLineDetailsComponent, PageThereComponent, PageThereYearComponent, DeleteTwoNewaddComponent, CompangInfoComponent, AllPlanComponent,PsViewer, RealMonitoringComponent,PlanAnalysisBySynthesisComponent,ImgDetails],
imports: [
CommonModule,
StatisticAnalysisRoutingModule,

243
src/app/tabbar/tabbar.component.ts

@ -1,9 +1,9 @@
import { Component, OnInit,Output,EventEmitter } from '@angular/core';
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router,ActivatedRoute,NavigationEnd } from '@angular/router'
import {CacheTokenService} from '../http-interceptors/cache-token.service'//引入服务
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router'
import { CacheTokenService } from '../http-interceptors/cache-token.service'//引入服务
import { MatDialog } from '@angular/material/dialog';
import {ChangepasswordComponent} from '../ui/changepassword/changepassword.component'
import { ChangepasswordComponent } from '../ui/changepassword/changepassword.component'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { filter } from 'rxjs/operators';
import { TabbarAndScoreService } from '../http-interceptors/tabbar-and-score.service';
@ -23,127 +23,131 @@ export class TabbarComponent implements OnInit {
defaulttheme = new EventEmitter<boolean>();
@Output()
redtheme = new EventEmitter<boolean>();
onChange(eventValue: boolean){
onChange(eventValue: boolean) {
this.toggleDarkTheme.emit(eventValue);
}
constructor(private tabbarService: TabbarAndScoreService,private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private tabbarService: TabbarAndScoreService, private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, public dialog: MatDialog, public snackBar: MatSnackBar) { }
grade = null //单位完整度得分
title:any = "数字化预案编制管理平台"
planName:any = null
title: any = "数字化预案编制管理平台"
planName: any = null
routerEventsListener //监测路由变化
integrityData:any
companyIntegrityScore:any//是否显示单位分数
isUpdates:any //是否显示单位提交审核 撤销审核等按钮
contentVerify:any//当前单位的审核状态信息
ngOnInit() {
integrityData: any
companyIntegrityScore: any//是否显示单位分数
isUpdates: any //是否显示单位提交审核 撤销审核等按钮
contentVerify: any//当前单位的审核状态信息
ngOnInit() {
this.routerEventsListener = this.router.events.pipe(
filter(event => event instanceof NavigationEnd)
).subscribe((e) => {
this.title = "数字化预案编制管理平台"
this.planName = null
this.grade = null
this.isUpdates = null
if(this.router.url.indexOf("editunitinfo") == -1 || this.router.url.indexOf("viewunitinfoplan") == -1){//如果url地址是从录入预案跳转
this.companyIntegrityScore = ''
}
this.title = "数字化预案编制管理平台"
this.planName = null
this.grade = null
this.isUpdates = null
if (this.router.url.indexOf("editunitinfo") == -1 || this.router.url.indexOf("viewunitinfoplan") == -1) {//如果url地址是从录入预案跳转
this.companyIntegrityScore = ''
}
})
if(this.router.url.indexOf("editunitinfo") != -1 || this.router.url.indexOf("viewunitinfoplan") != -1){//如果url地址是从录入预案跳转
if (this.router.url.indexOf("editunitinfo") != -1 || this.router.url.indexOf("viewunitinfoplan") != -1) {//如果url地址是从录入预案跳转
this.title = sessionStorage.getItem("companyName")
this.planName = sessionStorage.getItem("planName")
}
if(this.router.url.indexOf("editplaninfo") != -1 || (this.router.url.indexOf("viewunitinfo") != -1 && this.router.url.indexOf("viewunitinfoplan") == -1)){//如果url地址是从重点单位跳转
if (this.router.url.indexOf("editplaninfo") != -1 || (this.router.url.indexOf("viewunitinfo") != -1 && this.router.url.indexOf("viewunitinfoplan") == -1)) {//如果url地址是从重点单位跳转
this.title = sessionStorage.getItem("companyName")
this.getIntegrityScore()
//从维护更新页面进入需要显示提交审核按钮
if(this.route.snapshot.queryParams["isUpdates"] == '1'){
if (this.route.snapshot.queryParams["isUpdates"] == '1') {
this.contentVerify = JSON.parse(sessionStorage.getItem('contentVerify'))
// console.log(6666,JSON.parse(sessionStorage.getItem('contentVerify')))
this.isUpdates = true
}
this.tabbarService.getMessage().subscribe((message: any)=>{
this.tabbarService.getMessage().subscribe((message: any) => {
this.getIntegrityScore()
});
}
this.getUserInfo()
}
//根据usci获取当前单位的分数信息
getIntegrityScore(){
let params:any = {
USCI : this.route.snapshot.queryParams.usci
}
this.http.get('/api/Companies',{params:params}).subscribe((data:any) => {
this.companyIntegrityScore = data.items[0].companyIntegrityScore
getIntegrityScore() {
// let params:any = {
// USCI : this.route.snapshot.queryParams.usci
// }
// this.http.get('/api/Companies',{params:params}).subscribe((data:any) => {
// this.companyIntegrityScore = data.items[0].companyIntegrityScore
// })
let unitId = sessionStorage.getItem('companyId')
this.http.get(`/api/Companies/${unitId}`).subscribe((data: any) => {
this.companyIntegrityScore = data.companyIntegrityScore
})
}
isSpinner:boolean = false//下载帮助文档进度
isSpinner: boolean = false//下载帮助文档进度
//下载帮助文档
downloadHelpFile () {
downloadHelpFile() {
this.getFileMSG()
}
helpFile:any = 'api/ObjectMetadata/help/数字化预案编制管理平台手册.pdf'; //下载文件的url地址
download:any; //下载的文件
helpFile: any = 'api/ObjectMetadata/help/数字化预案编制管理平台手册.pdf'; //下载文件的url地址
download: any; //下载的文件
//获取下载文件信息
getFileMSG () {
getFileMSG() {
this.isSpinner = true
this.http.get(`${this.helpFile}`).subscribe(data=>{
this.http.get(`${this.helpFile}`).subscribe(data => {
this.download = data
this.downloadFile()
},err=>{
}, err => {
let config = new MatSnackBarConfig();
config.verticalPosition = 'bottom';
config.duration = 3000
this.snackBar.open('下载失败','确定',config);
this.snackBar.open('下载失败', '确定', config);
})
}
//提交单位审核
submitAudit(){
let body:any = {
title : sessionStorage.getItem('companyName'),
Operation : sessionStorage.getItem('contentVerify') ? 1 : 0,
itemId : sessionStorage.getItem('companyId'),
verifyState : 3,
contentType : 11
submitAudit() {
let body: any = {
title: sessionStorage.getItem('companyName'),
Operation: sessionStorage.getItem('contentVerify') ? 1 : 0,
itemId: sessionStorage.getItem('companyId'),
verifyState: 3,
contentType: 11
}
this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{
this.http.post(`/api/ContentVerifies`, body).subscribe(data => {
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
},err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
sessionStorage.setItem('contentVerify', JSON.stringify(data))
}, err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err, '确定', config);
})
}
//撤销单位审核
cancelAudit(){
this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data=>{
cancelAudit() {
this.http.delete(`/api/ContentVerifies/${this.contentVerify.id}`).subscribe(data => {
this.contentVerify = data
sessionStorage.setItem('contentVerify',JSON.stringify(data))
sessionStorage.setItem('contentVerify', JSON.stringify(data))
},
err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
})
err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err, '确定', config);
})
}
//初始化下载
downloadFile () {
downloadFile() {
let file = this.download
let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载
this.http.get(`/api/Objects/help/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{
if (file && fileSize <= shardSize) { //<=10MB时直接下载
this.http.get(`/api/Objects/help/${file.objectName}`, { responseType: 'blob' },).subscribe(data => {
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
@ -152,33 +156,34 @@ export class TabbarComponent implements OnInit {
document.body.appendChild(link);
link.click();
this.isSpinner = false
},err=>{
}, err => {
let config = new MatSnackBarConfig();
config.verticalPosition = 'bottom';
config.duration = 3000
this.snackBar.open('下载失败','确定',config);
this.snackBar.open('下载失败', '确定', config);
})
} else if (file && fileSize>shardSize) { //>10MB时分块下载
} else if (file && fileSize > shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载
}
}
//分段下载并合并
async blockingDownload () {
async blockingDownload() {
let file = this.download
let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段
let allFile:any = [] //所有的file分段
let allFile: any = [] //所有的file分段
for (let i=0;i<allSlice;i++) {
for (let i = 0; i < allSlice; i++) {
let start = i * shardSize //每次下载文件开始位置
let end = Math.min(fileSize, start + shardSize-1); //每次下载文件结束为止
let end = Math.min(fileSize, start + shardSize - 1); //每次下载文件结束为止
let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/help/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{
result(data) })
let result = await new Promise((result, reject) => {
this.http.get(`/api/Objects/help/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => {
result(data)
})
})
allFile.push(result)
@ -196,44 +201,44 @@ export class TabbarComponent implements OnInit {
} //for循环
}
ngOnDestroy(){
ngOnDestroy() {
this.routerEventsListener.unsubscribe()
}
integrityDetails(width,zong){
let style:any = {}
style.width = (width/zong)*100 +'%';
integrityDetails(width, zong) {
let style: any = {}
style.width = (width / zong) * 100 + '%';
return style
}
//计分规则
scoringRuleImg:boolean = false
scoringRule(){
scoringRuleImg: boolean = false
scoringRule() {
this.scoringRuleImg = !this.scoringRuleImg
}
closebtn(){
closebtn() {
this.scoringRuleImg = false
}
boxed(css){
boxed(css) {
const Element = document.body;
Element.style.width = '1200px'
}
standard(){
standard() {
const Element = document.body;
Element.style.width = '100%'
}
isfullscreen:boolean = false;
fullscreenToggle(){
isfullscreen: boolean = false;
fullscreenToggle() {
const docElmWithBrowsersFullScreenFunctions = document.documentElement as HTMLElement & {
mozRequestFullScreen(): Promise<void>;
webkitRequestFullscreen(): Promise<void>;
msRequestFullscreen(): Promise<void>;
};
if (docElmWithBrowsersFullScreenFunctions.requestFullscreen) {
docElmWithBrowsersFullScreenFunctions.requestFullscreen();
} else if (docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen) { /* Firefox */
@ -243,32 +248,32 @@ export class TabbarComponent implements OnInit {
} else if (docElmWithBrowsersFullScreenFunctions.msRequestFullscreen) { /* IE/Edge */
docElmWithBrowsersFullScreenFunctions.msRequestFullscreen();
}
this.isfullscreen = true;
}
closefullscreen(){
const docWithBrowsersExitFunctions = document as Document & {
mozCancelFullScreen(): Promise<void>;
webkitExitFullscreen(): Promise<void>;
msExitFullscreen(): Promise<void>;
};
if (docWithBrowsersExitFunctions.exitFullscreen) {
docWithBrowsersExitFunctions.exitFullscreen();
} else if (docWithBrowsersExitFunctions.mozCancelFullScreen) { /* Firefox */
docWithBrowsersExitFunctions.mozCancelFullScreen();
} else if (docWithBrowsersExitFunctions.webkitExitFullscreen) { /* Chrome, Safari and Opera */
docWithBrowsersExitFunctions.webkitExitFullscreen();
} else if (docWithBrowsersExitFunctions.msExitFullscreen) { /* IE/Edge */
docWithBrowsersExitFunctions.msExitFullscreen();
this.isfullscreen = true;
}
this.isfullscreen = false;
closefullscreen() {
const docWithBrowsersExitFunctions = document as Document & {
mozCancelFullScreen(): Promise<void>;
webkitExitFullscreen(): Promise<void>;
msExitFullscreen(): Promise<void>;
};
if (docWithBrowsersExitFunctions.exitFullscreen) {
docWithBrowsersExitFunctions.exitFullscreen();
} else if (docWithBrowsersExitFunctions.mozCancelFullScreen) { /* Firefox */
docWithBrowsersExitFunctions.mozCancelFullScreen();
} else if (docWithBrowsersExitFunctions.webkitExitFullscreen) { /* Chrome, Safari and Opera */
docWithBrowsersExitFunctions.webkitExitFullscreen();
} else if (docWithBrowsersExitFunctions.msExitFullscreen) { /* IE/Edge */
docWithBrowsersExitFunctions.msExitFullscreen();
}
this.isfullscreen = false;
}
realName:any; //登录用户信息
realName: any; //登录用户信息
//获取用户信息
getUserInfo () {
this.http.get("/api/Account/Profiles").subscribe((data:any)=>{
getUserInfo() {
this.http.get("/api/Account/Profiles").subscribe((data: any) => {
this.realName = data.realName
})
}
@ -276,9 +281,9 @@ export class TabbarComponent implements OnInit {
//退出系统
signOut = () => {
let out = confirm("您确定要退出吗")
if(out) {
this.http.post('/api/Account/SignOut',{}).subscribe(
data=> {
if (out) {
this.http.post('/api/Account/SignOut', {}).subscribe(
data => {
this.token.delete()
sessionStorage.clear()
window.localStorage.clear()
@ -286,7 +291,7 @@ export class TabbarComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'bottom';
config.duration = 3000
this.snackBar.open('成功退出','确定',config);
this.snackBar.open('成功退出', '确定', config);
}
)
}
@ -294,10 +299,10 @@ export class TabbarComponent implements OnInit {
//修改密码
changpsw() {
let dialogRef = this.dialog.open(ChangepasswordComponent,
{width:'348px'});
let dialogRef = this.dialog.open(ChangepasswordComponent,
{ width: '348px' });
dialogRef.afterClosed().subscribe();
dialogRef.afterClosed().subscribe();
}
}

4
src/app/ui/collection-tools-building/collection-tools.component.html

@ -83,8 +83,8 @@
<mat-icon >add</mat-icon>
</label>
</div>
<div [hidden]="!togglePlane" style="flex: 1;">
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index" [ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
<div [hidden]="!togglePlane" style="flex: 1;max-height: 700px;overflow-y: auto;overflow-x: hidden;" class="sitePlanContentBox">
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index" [ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)' (mouseenter)="hoverSitePlan(item,key)">
<label class="overflowText" style="display:inline-block; max-width: 160px;"><mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}</label>
<a href="javascript:;" class="fireForce" *ngIf="isEditPattern && !pattern">
<img src="../../../assets/images/fire.png" *ngIf="item.fire && item.fire==2">

19
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -1728,6 +1728,25 @@ export class CollectionToolsBuildingComponent implements OnInit {
} //if
}
if (this.element.nativeElement.querySelector('#rightOperate')) {
setTimeout(() => {
this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed'
this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px'
this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px'
}, 0);
}
}
hoverSitePlan(item, key) {
if (key == this.selectSitePlanIndex) {
if (this.element.nativeElement.querySelector('#rightOperate')) {
setTimeout(() => {
this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed'
this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px'
this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px'
}, 0);
}
}
}
//新增平面图 楼层/区域

2
src/app/ui/collection-tools-building/panel.scss

@ -43,7 +43,7 @@
height: 35px;
line-height: 35px;
box-sizing: border-box;
padding: 0 10px 0 25px;
padding: 0 10px;
.mat-icon {
font-size: 20px;
}

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

@ -71,10 +71,10 @@
<mat-icon>add</mat-icon>
</label>
</div>
<div [hidden]="!togglePlane" style="flex: 1;">
<div [hidden]="!togglePlane" style="flex: 1;max-height: 700px;overflow-y: auto;overflow-x: hidden;" class="sitePlanContentBox">
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index"
[ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}"
(click)='selectSitePlan(item,key)'>
(click)='selectSitePlan(item,key)' (mouseenter)="hoverSitePlan(item,key)">
<label class="overflowText" style="display:inline-block; max-width: 160px;">
<mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}
</label>

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

@ -1684,6 +1684,25 @@ export class CollectionToolsPlanComponent implements OnInit {
} //if
}
if (this.element.nativeElement.querySelector('#rightOperate')) {
setTimeout(() => {
this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed'
this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px'
this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px'
}, 0);
}
}
hoverSitePlan(item, key) {
if (key == this.selectSitePlanIndex) {
if (this.element.nativeElement.querySelector('#rightOperate')) {
setTimeout(() => {
this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed'
this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px'
this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px'
}, 0);
}
}
}
//新增平面图 楼层/区域

2
src/app/ui/collection-tools-plan/panel.scss

@ -44,7 +44,7 @@
height: 35px;
line-height: 35px;
box-sizing: border-box;
padding: 0 10px 0 25px;
padding: 0 10px;
.mat-icon {
font-size: 20px;
}

3
src/app/ui/collection-tools/collection-tools.component.scss

@ -326,6 +326,9 @@
border-radius: 5px;
box-sizing: border-box;
padding: 5px 0;
max-height: 600px;
overflow-x: hidden;
overflow-y: auto;
.centerTotalHeader {
height: 30px;
line-height: 30px;

2
src/app/ui/collection-tools/panel.scss

@ -53,7 +53,7 @@
height: 35px;
line-height: 35px;
box-sizing: border-box;
padding: 0 10px 0 25px;
padding: 0 10px;
.mat-icon {
font-size: 20px;
}

14
src/app/ui/material-bank/addmatlibrary.component.ts

@ -5,8 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
@Component({
@ -34,7 +32,17 @@ import format from 'date-fns/format';
onSubmit(value){
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
function getDate(date){
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year= time.getFullYear() //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate
}
let time = getDate(newdate)
this.http.post("/api/AssetLibraries",{
id: "",
name: value.name,

1
src/app/ui/material-bank/addoriginalcopy.component.ts

@ -4,7 +4,6 @@ import {FlatTreeControl} from '@angular/cdk/tree';
import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import format from 'date-fns/format';
import { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader } from 'ng2-file-upload'
import { MatSnackBar,MatSnackBarConfig } from '@angular/material/snack-bar';

99
src/app/ui/material-bank/editmatlibrary.component.ts

@ -1,41 +1,62 @@
import { Component, OnInit, Inject } from '@angular/core';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
import { Component, OnInit, Inject } from "@angular/core";
import {
MatTreeFlatDataSource,
MatTreeFlattener,
} from "@angular/material/tree";
import { FlatTreeControl } from "@angular/cdk/tree";
import { HttpClient } from "@angular/common/http";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { FormControl } from "@angular/forms";
import { MatSnackBar } from "@angular/material/snack-bar";
@Component({
selector: 'editmatlibrary',
templateUrl: './editmatlibrary.component.html',
styleUrls: ['./material-bank.component.scss']
})
export class EditMatLibrary {
myControl = new FormControl();
constructor(private http: HttpClient,public dialogRef: MatDialogRef<EditMatLibrary>,@Inject(MAT_DIALOG_DATA) public data) {}
name:any
input:any
ngOnInit(): void {
this.name = this.data.material.name
this.input = this.data.material.tag
selector: "editmatlibrary",
templateUrl: "./editmatlibrary.component.html",
styleUrls: ["./material-bank.component.scss"],
})
export class EditMatLibrary {
myControl = new FormControl();
constructor(
private http: HttpClient,
public dialogRef: MatDialogRef<EditMatLibrary>,
@Inject(MAT_DIALOG_DATA) public data
) {}
name: any;
input: any;
ngOnInit(): void {
this.name = this.data.material.name;
this.input = this.data.material.tag;
}
onNoClick(): void {
this.dialogRef.close();
}
onSubmit(value) {
let newdate = new Date();
function getDate(date) {
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year = time.getFullYear(); //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate;
}
onNoClick(): void {
this.dialogRef.close();
}
onSubmit(value){
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
this.http.put(`/api/AssetLibraries/${this.data.material.id}`,{
id: this.data.material.id,
name: value.name,
order: this.data.material.order,
tag: value.tag,
enabled: true,
modifiedTime: time
}).subscribe(data=>{
this.dialogRef.close();
})
}
}
let time = getDate(newdate);
this.http
.put(`/api/AssetLibraries/${this.data.material.id}`, {
id: this.data.material.id,
name: value.name,
order: this.data.material.order,
tag: value.tag,
enabled: true,
modifiedTime: time,
})
.subscribe((data) => {
this.dialogRef.close();
});
}
}

1
src/app/ui/material-bank/editoriginalcopy.component.ts

@ -5,7 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar,MatSnackBarConfig } from '@angular/material/snack-bar';
import format from 'date-fns/format';
import { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader } from 'ng2-file-upload'
import { DomSanitizer } from '@angular/platform-browser'

824
src/app/ui/material-bank/material-bank.component.ts

@ -1,572 +1,596 @@
import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { AddMatLibrary } from './addmatlibrary.component'
import { EditMatLibrary } from './editmatlibrary.component'
import { AddOriginalCopy } from './addoriginalcopy.component'
import { MatTableDataSource } from '@angular/material/table';
import { EditOriginalCopy } from './editoriginalcopy.component'
import { SelectOriginalCopy } from './selectoriginalcopy.component'
import { MatSnackBar,MatSnackBarConfig } from '@angular/material/snack-bar';
import format from 'date-fns/format';
import { Component, OnInit, Inject } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA,
} from "@angular/material/dialog";
import { AddMatLibrary } from "./addmatlibrary.component";
import { EditMatLibrary } from "./editmatlibrary.component";
import { AddOriginalCopy } from "./addoriginalcopy.component";
import { MatTableDataSource } from "@angular/material/table";
import { EditOriginalCopy } from "./editoriginalcopy.component";
import { SelectOriginalCopy } from "./selectoriginalcopy.component";
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar";
@Component({
selector: 'app-material-bank',
templateUrl: './material-bank.component.html',
styleUrls: ['./material-bank.component.scss']
selector: "app-material-bank",
templateUrl: "./material-bank.component.html",
styleUrls: ["./material-bank.component.scss"],
})
export class MaterialBankComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(
private http: HttpClient,
public dialog: MatDialog,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
this.http.get('/api/AssetLibraries').subscribe(data=>{
this.material = data[0]
this.allMaterialBank = data
this.getSourceMaterial()
})
this.http.get("/api/AssetLibraries").subscribe((data) => {
this.material = data[0];
this.allMaterialBank = data;
this.getSourceMaterial();
});
}
allMaterialBank:any = []; //所有素材库
material:any={name:''}; //选中的素材库
materialIndex:any=0; //选中的素材库index
allMaterialBank: any = []; //所有素材库
material: any = { name: "" }; //选中的素材库
materialIndex: any = 0; //选中的素材库index
sourceMaterial:any; //素材库对应所有原件
Original:any; //选中的原件
OriginalIndex:any=null; //选中的原件index
isshow = true//左侧列表的显示隐藏
sourceMaterial: any; //素材库对应所有原件
Original: any; //选中的原件
OriginalIndex: any = null; //选中的原件index
isshow = true; //左侧列表的显示隐藏
//收起左侧列表
showlist(){
this.isshow = !this.isshow
//收起左侧列表
showlist() {
this.isshow = !this.isshow;
}
//获取所有素材库
getMaterialBank () {
this.http.get('/api/AssetLibraries').subscribe(data=>{
this.allMaterialBank = data
this.material = data[this.materialIndex]
})
getMaterialBank() {
this.http.get("/api/AssetLibraries").subscribe((data) => {
this.allMaterialBank = data;
this.material = data[this.materialIndex];
});
}
//获得指定素材库所有原件
getSourceMaterial () {
this.sourceMaterial = null
getSourceMaterial() {
this.sourceMaterial = null;
if (this.material) {
let data = {
libraryId:this.material.id
}
this.http.get('/api/Assets',{
params:data
}).subscribe(data=>{
this.sourceMaterial = data
this.Original = data[this.OriginalIndex]
})
libraryId: this.material.id,
};
this.http
.get("/api/Assets", {
params: data,
})
.subscribe((data) => {
this.sourceMaterial = data;
this.Original = data[this.OriginalIndex];
});
}
}
//选中素材库
add (e,index) {
this.Original = null
this.OriginalIndex = null
add(e, index) {
this.Original = null;
this.OriginalIndex = null;
if (this.materialIndex != index) {
this.material = e
this.materialIndex = index
this.getSourceMaterial()
this.material = e;
this.materialIndex = index;
this.getSourceMaterial();
}
}
//选中原件
addOriginal (e,index) {
this.Original = e
this.OriginalIndex = index
addOriginal(e, index) {
this.Original = e;
this.OriginalIndex = index;
}
//打开查看属性弹窗
viewProperties () {
if(this.Original){
let data = this.Original
const dialogRef = this.dialog.open(attributeComponent,
{width: '1000px',data});
dialogRef.afterClosed().subscribe(
(data)=>{if(data){this.getSourceMaterial()}}
)
}else {
viewProperties() {
if (this.Original) {
let data = this.Original;
const dialogRef = this.dialog.open(attributeComponent, {
width: "1000px",
data,
});
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.getSourceMaterial();
}
});
} 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);
}
}
//新增素材库
addmatlibrary(){
let data = this.allMaterialBank || []
const dialogRef = this.dialog.open(AddMatLibrary, {//调用open方法打开对话框并且携带参数过去
width: '260px',
data
addmatlibrary() {
let data = this.allMaterialBank || [];
const dialogRef = this.dialog.open(AddMatLibrary, {
//调用open方法打开对话框并且携带参数过去
width: "260px",
data,
});
dialogRef.afterClosed().subscribe((data) => {
this.getMaterialBank();
});
dialogRef.afterClosed().subscribe(
data=>{
this.getMaterialBank ()
}
);
}
//编辑素材库
editmatlibrary(){
const dialogRef = this.dialog.open(EditMatLibrary, {//调用open方法打开对话框并且携带参数过去
width: '260px',
data: {allMaterialBank:this.allMaterialBank,material:this.material}
editmatlibrary() {
const dialogRef = this.dialog.open(EditMatLibrary, {
//调用open方法打开对话框并且携带参数过去
width: "260px",
data: { allMaterialBank: this.allMaterialBank, material: this.material },
});
dialogRef.afterClosed().subscribe((data) => {
this.getMaterialBank();
});
dialogRef.afterClosed().subscribe(
data=>{
this.getMaterialBank ()
}
);
}
//删除素材库
delete(){
var isdeleted = confirm(`确定要删除${this.material.name}素材库吗?`)
if(isdeleted){
delete() {
var isdeleted = confirm(`确定要删除${this.material.name}素材库吗?`);
if (isdeleted) {
//请求删除接口
this.http.delete(`/api/AssetLibraries/${this.material.id}`).subscribe( data=>{
this.materialIndex -= 1//删除之后焦点前移
this.getMaterialBank ()
})
this.http
.delete(`/api/AssetLibraries/${this.material.id}`)
.subscribe((data) => {
this.materialIndex -= 1; //删除之后焦点前移
this.getMaterialBank();
});
}
}
//禁启用素材库
disabled(){
disabled() {
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
if(this.material.enabled){
this.http.put(`/api/AssetLibraries/${this.material.id}`,{
id: this.material.id,
name: this.material.name,
order: this.material.order,
tag: this.material.tag,
enabled: false,
modifiedTime: time
}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('禁用成功','确定',config);
this.getMaterialBank ()
})
}else{
this.http.put(`/api/AssetLibraries/${this.material.id}`,{
id: this.material.id,
name: this.material.name,
order: this.material.order,
tag: this.material.tag,
enabled: true,
modifiedTime: time
}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('启用成功','确定',config);
this.getMaterialBank ()
})
function getDate(date) {
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year = time.getFullYear(); //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate;
}
let time = getDate(newdate);
if (this.material.enabled) {
this.http
.put(`/api/AssetLibraries/${this.material.id}`, {
id: this.material.id,
name: this.material.name,
order: this.material.order,
tag: this.material.tag,
enabled: false,
modifiedTime: time,
})
.subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("禁用成功", "确定", config);
this.getMaterialBank();
});
} else {
this.http
.put(`/api/AssetLibraries/${this.material.id}`, {
id: this.material.id,
name: this.material.name,
order: this.material.order,
tag: this.material.tag,
enabled: true,
modifiedTime: time,
})
.subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("启用成功", "确定", config);
this.getMaterialBank();
});
}
}
//新增素材原件
addoriginalcopy(node){
const dialogRef = this.dialog.open(AddOriginalCopy, {//调用open方法打开对话框并且携带参数过去
addoriginalcopy(node) {
const dialogRef = this.dialog.open(AddOriginalCopy, {
//调用open方法打开对话框并且携带参数过去
// height:"715px",
width:"640px",
data: {allMaterialBank:this.allMaterialBank,node:node,sourceMaterial:this.sourceMaterial}
width: "640px",
data: {
allMaterialBank: this.allMaterialBank,
node: node,
sourceMaterial: this.sourceMaterial,
},
});
dialogRef.afterClosed().subscribe(
data=>{
if(data){
this.getSourceMaterial ()
}
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.getSourceMaterial();
}
);
});
}
//修改素材原件
editoriginalcopy(node){
if(this.Original){
const dialogRef = this.dialog.open(EditOriginalCopy, {//调用open方法打开对话框并且携带参数过去
editoriginalcopy(node) {
if (this.Original) {
const dialogRef = this.dialog.open(EditOriginalCopy, {
//调用open方法打开对话框并且携带参数过去
// height:"590px",
width:"640px",
data: {allMaterialBank:this.allMaterialBank,node:node,Original:this.Original}
width: "640px",
data: {
allMaterialBank: this.allMaterialBank,
node: node,
Original: this.Original,
},
});
dialogRef.afterClosed().subscribe(
data=>{
if(data){
this.getSourceMaterial ()
}
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.getSourceMaterial();
}
);
}else{
});
} 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);
}
}
//禁启用原件
disableoriginal(material){
if(this.Original){
this.http.put(`/api/Assets/${this.Original.id}`,{
id:this.Original.id,
name:this.Original.name,
width: this.Original.width,
height: this.Original.height,
angle: this.Original.angle,
interactiveMode:this.Original.interactiveMode,//交互方式
fixedSize: this.Original.fixedSize,
fillMode: this.Original.fillMode,//填充方式
color: this.Original.color,
imageUrl:this.Original.imageUrl,
order: this.Original.order,
enabled: !this.Original.enabled,
propertyInfos: this.Original.propertyInfos,
fireElementId:this.Original.fireElementId
}).subscribe((data)=>{
this.getSourceMaterial ()
})
}else{
disableoriginal(material) {
if (this.Original) {
this.http
.put(`/api/Assets/${this.Original.id}`, {
id: this.Original.id,
name: this.Original.name,
width: this.Original.width,
height: this.Original.height,
angle: this.Original.angle,
interactiveMode: this.Original.interactiveMode, //交互方式
fixedSize: this.Original.fixedSize,
fillMode: this.Original.fillMode, //填充方式
color: this.Original.color,
imageUrl: this.Original.imageUrl,
order: this.Original.order,
enabled: !this.Original.enabled,
propertyInfos: this.Original.propertyInfos,
fireElementId: this.Original.fireElementId,
})
.subscribe((data) => {
this.getSourceMaterial();
});
} 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);
}
}
//删除原件
deleteoriginal(material){
if(this.Original){
var isdeleted = confirm(`确定要删除当前原件吗?`)
if(isdeleted){
deleteoriginal(material) {
if (this.Original) {
var isdeleted = confirm(`确定要删除当前原件吗?`);
if (isdeleted) {
//请求删除接口
this.http.delete(`/api/Assets`,{
params:{
libraryId:material.id,
id:this.Original.id
}
}).subscribe( data=>{
this.getSourceMaterial ()
})
this.http
.delete(`/api/Assets`, {
params: {
libraryId: material.id,
id: this.Original.id,
},
})
.subscribe((data) => {
this.getSourceMaterial();
});
}
}else{
} 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);
}
}
//选择原件素材 material为当前素材库的信息
selectoriginal(material){
const dialogRef = this.dialog.open(SelectOriginalCopy, {//调用open方法打开对话框并且携带参数过去
selectoriginal(material) {
const dialogRef = this.dialog.open(SelectOriginalCopy, {
//调用open方法打开对话框并且携带参数过去
// height:"525px",
data: {allMaterialBank:this.allMaterialBank,material:material}
data: { allMaterialBank: this.allMaterialBank, material: material },
});
dialogRef.afterClosed().subscribe(
data=>{
if(data){
this.getSourceMaterial ()
}
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.getSourceMaterial();
}
);
});
}
}
//原件对应所有属性弹窗
@Component({
selector: 'app-attribute',
templateUrl: './attribute.html',
styleUrls: ['./material-bank.component.scss']
selector: "app-attribute",
templateUrl: "./attribute.html",
styleUrls: ["./material-bank.component.scss"],
})
export class attributeComponent {
constructor(private http:HttpClient,public dialog: MatDialog,
public dialogRef: MatDialogRef<attributeComponent >,
@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) { }
constructor(
private http: HttpClient,
public dialog: MatDialog,
public dialogRef: MatDialogRef<attributeComponent>,
@Inject(MAT_DIALOG_DATA) public data,
public snackBar: MatSnackBar
) {}
ngOnInit(): void {
if (this.data.propertyInfos == null) {
this.data.propertyInfos = []
this.data.propertyInfos = [];
}
this.setIndex()
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)
}
displayedColumns = ['checked', 'name', 'type', 'default','required','physicalUnit','operation'];
dataSource:any=[]; //当前原件属性渲染table
dataSourceIndex:any=[]; //选中属性的index
this.setIndex();
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos);
}
displayedColumns = [
"checked",
"name",
"type",
"default",
"required",
"physicalUnit",
"operation",
];
dataSource: any = []; //当前原件属性渲染table
dataSourceIndex: any = []; //选中属性的index
//封装函数每次更改,重新获取下标
setIndex () {
setIndex() {
if (this.data.propertyInfos) {
this.data.propertyInfos.forEach((item,index)=>{
item.index = index
})
this.data.propertyInfos.forEach((item, index) => {
item.index = index;
});
}
}
//点击checked框获取当前属性index
checkedChange (e,index) {
checkedChange(e, index) {
if (e.checked) {
this.dataSourceIndex.push(index)
this.dataSourceIndex.push(index);
} else {
this.dataSourceIndex.splice(this.dataSourceIndex.findIndex(item=>item==index),1)
this.dataSourceIndex.splice(
this.dataSourceIndex.findIndex((item) => item == index),
1
);
}
}
//上移
toTop () {
if(this.dataSourceIndex.length) {
let index = this.dataSourceIndex[this.dataSourceIndex.length-1]
toTop() {
if (this.dataSourceIndex.length) {
let index = this.dataSourceIndex[this.dataSourceIndex.length - 1];
if (index != 0) {
let data = this.data.propertyInfos[index]
this.data.propertyInfos[index]=this.data.propertyInfos[index-1]
this.data.propertyInfos[index-1] = data
this.dataSourceIndex[this.dataSourceIndex.length-1] = index-1
this.setIndex()
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)
let data = this.data.propertyInfos[index];
this.data.propertyInfos[index] = this.data.propertyInfos[index - 1];
this.data.propertyInfos[index - 1] = data;
this.dataSourceIndex[this.dataSourceIndex.length - 1] = index - 1;
this.setIndex();
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos);
}
}
}
//下移
toBottom () {
if(this.dataSourceIndex.length) {
let index = this.dataSourceIndex[this.dataSourceIndex.length-1]
if (index != this.data.propertyInfos.length-1) {
let data = this.data.propertyInfos[index]
this.data.propertyInfos[index]=this.data.propertyInfos[index+1]
this.data.propertyInfos[index+1] = data
this.dataSourceIndex[this.dataSourceIndex.length-1] = index+1
this.setIndex()
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)
toBottom() {
if (this.dataSourceIndex.length) {
let index = this.dataSourceIndex[this.dataSourceIndex.length - 1];
if (index != this.data.propertyInfos.length - 1) {
let data = this.data.propertyInfos[index];
this.data.propertyInfos[index] = this.data.propertyInfos[index + 1];
this.data.propertyInfos[index + 1] = data;
this.dataSourceIndex[this.dataSourceIndex.length - 1] = index + 1;
this.setIndex();
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos);
}
}
}
//新增属性弹窗
add () {
add() {
const dialogRef = this.dialog.open(addAttributeComponent);
dialogRef.afterClosed().subscribe(
(data)=>{
if (data) {
this.data.propertyInfos.push(data)
this.setIndex()
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)}
})
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.data.propertyInfos.push(data);
this.setIndex();
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos);
}
});
}
//编辑属性弹窗
edit (e) {
let data = this.data.propertyInfos[e]
const dialogRef = this.dialog.open(editAttribute,{data});
dialogRef.afterClosed().subscribe(
data=>{
if (data) {
this.data.propertyInfos[data.index] = data
this.setIndex()
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)}
})
edit(e) {
let data = this.data.propertyInfos[e];
const dialogRef = this.dialog.open(editAttribute, { data });
dialogRef.afterClosed().subscribe((data) => {
if (data) {
this.data.propertyInfos[data.index] = data;
this.setIndex();
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos);
}
});
}
//显示
visible (e) {
this.data.propertyInfos[e].visible = true
visible(e) {
this.data.propertyInfos[e].visible = true;
}
//隐藏
noVisible (e) {
this.data.propertyInfos[e].visible = false
noVisible(e) {
this.data.propertyInfos[e].visible = false;
}
//启用
enabled (e) {
this.data.propertyInfos[e].enabled = true
enabled(e) {
this.data.propertyInfos[e].enabled = true;
}
//禁用
noEnabled (e) {
this.data.propertyInfos[e].enabled = false
noEnabled(e) {
this.data.propertyInfos[e].enabled = false;
}
//删除
delete (e) {
let isTrue = confirm('您确定要删除吗')
delete(e) {
let isTrue = confirm("您确定要删除吗");
if (isTrue) {
this.data.propertyInfos.splice(e,1)
this.setIndex()
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)
this.data.propertyInfos.splice(e, 1);
this.setIndex();
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos);
}
}
//原件属性保存
preservation () {
preservation() {
if (this.data.propertyInfos.length) {
this.data.propertyInfos.forEach(item => {
delete item.index
this.data.propertyInfos.forEach((item) => {
delete item.index;
});
this.submit()
this.submit();
} else {
this.submit()
this.submit();
}
}
//提交保存
submit () {
this.http.put(`/api/Assets/${this.data.id}`,{
id:this.data.id,
name:this.data.name,
width:this.data.width,
height:this.data.height,
angle:this.data.angle,
interactiveMode:this.data.interactiveMode,
isFromBuilding: this.data.isFromBuilding,
canConnect:this.data.canConnect,
holeMaxCount:this.data.holeMaxCount,
fixedSize:this.data.fixedSize,
fillMode:this.data.fillMode,
color:this.data.color,
imageUrl:this.data.imageUrl,
drawMode:this.data.drawMode,
border:this.data.border,
order:this.data.order,
enabled:this.data.enabled,
propertyInfos:this.data.propertyInfos,
fireElementId:this.data.fireElementId
}).subscribe(data=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.dialogRef.close('success')
})
submit() {
this.http
.put(`/api/Assets/${this.data.id}`, {
id: this.data.id,
name: this.data.name,
width: this.data.width,
height: this.data.height,
angle: this.data.angle,
interactiveMode: this.data.interactiveMode,
isFromBuilding: this.data.isFromBuilding,
canConnect: this.data.canConnect,
holeMaxCount: this.data.holeMaxCount,
fixedSize: this.data.fixedSize,
fillMode: this.data.fillMode,
color: this.data.color,
imageUrl: this.data.imageUrl,
drawMode: this.data.drawMode,
border: this.data.border,
order: this.data.order,
enabled: this.data.enabled,
propertyInfos: this.data.propertyInfos,
fireElementId: this.data.fireElementId,
})
.subscribe((data) => {
const config = new MatSnackBarConfig();
config.verticalPosition = "top";
config.duration = 3000;
this.snackBar.open("保存成功", "确定", config);
this.dialogRef.close("success");
});
}
}
//新增属性弹窗
export interface Food {
value: number;
viewValue: string;
}
@Component({
selector: 'app-addAttribute',
templateUrl: './addAttribute.html',
styleUrls: ['./material-bank.component.scss']
selector: "app-addAttribute",
templateUrl: "./addAttribute.html",
styleUrls: ["./material-bank.component.scss"],
})
export class addAttributeComponent {
constructor(private http:HttpClient,public dialog: MatDialog,
public dialogRef: MatDialogRef<addAttributeComponent>,) { }
constructor(
private http: HttpClient,
public dialog: MatDialog,
public dialogRef: MatDialogRef<addAttributeComponent>
) {}
ngOnInit(): void {}
//定义属性数据
propertyType:Food[]=[
{value:0, viewValue: '单行文本'},
{value:1, viewValue: '多行文本'},
{value:2, viewValue: '数值'},
{value:3, viewValue: '图片'},
{value:4, viewValue: '图片数量'},
{value:5, viewValue: '方向'},
{value:6, viewValue: '布尔值'},
{value:7, viewValue: '供给区域'},
{value:8, viewValue: '供给类型'}]
propertyType: Food[] = [
{ value: 0, viewValue: "单行文本" },
{ value: 1, viewValue: "多行文本" },
{ value: 2, viewValue: "数值" },
{ value: 3, viewValue: "图片" },
{ value: 4, viewValue: "图片数量" },
{ value: 5, viewValue: "方向" },
{ value: 6, viewValue: "布尔值" },
{ value: 7, viewValue: "供给区域" },
{ value: 8, viewValue: "供给类型" },
];
//提交表单
onSubmit (e) {
e.order = 0
e.enabled = true
e.visible = true
e.required = e.required=='true'? true: false,
this.dialogRef.close(e)
}
onSubmit(e) {
e.order = 0;
e.enabled = true;
e.visible = true;
(e.required = e.required == "true" ? true : false), this.dialogRef.close(e);
}
}
//编辑属性弹窗
@Component({
selector: 'app-editAttribute',
templateUrl: './editAttribute.html',
styleUrls: ['./material-bank.component.scss']
selector: "app-editAttribute",
templateUrl: "./editAttribute.html",
styleUrls: ["./material-bank.component.scss"],
})
export class editAttribute {
constructor(private http:HttpClient,public dialog: MatDialog,
constructor(
private http: HttpClient,
public dialog: MatDialog,
public dialogRef: MatDialogRef<editAttribute>,
@Inject(MAT_DIALOG_DATA) public data,) { }
@Inject(MAT_DIALOG_DATA) public data
) {}
ngOnInit(): void {
this.propertyName = this.data.propertyName
this.propertyValue = this.data.propertyValue
this.propertyType = this.data.propertyType
this.required = String(this.data.required)
this.ruleName = this.data.ruleName
this.ruleValue = this.data.ruleValue
this.physicalUnit = this.data.physicalUnit
this.tag = this.data.tag}
propertyName:any
propertyValue:any;
propertyType:number;
required:any;
ruleName:any;
ruleValue:any;
physicalUnit:any;
tag:any;
this.propertyName = this.data.propertyName;
this.propertyValue = this.data.propertyValue;
this.propertyType = this.data.propertyType;
this.required = String(this.data.required);
this.ruleName = this.data.ruleName;
this.ruleValue = this.data.ruleValue;
this.physicalUnit = this.data.physicalUnit;
this.tag = this.data.tag;
}
propertyName: any;
propertyValue: any;
propertyType: number;
required: any;
ruleName: any;
ruleValue: any;
physicalUnit: any;
tag: any;
//定义属性数据
type:Food[]=[
{value:0, viewValue: '单行文本'},
{value:1, viewValue: '多行文本'},
{value:2, viewValue: '数值'},
{value:3, viewValue: '图片'},
{value:4, viewValue: '图片数量'},
{value:5, viewValue: '方向'},
{value:6, viewValue: '布尔值'},
{value:7, viewValue: '供给区域'},
{value:8, viewValue: '供给类型'}]
type: Food[] = [
{ value: 0, viewValue: "单行文本" },
{ value: 1, viewValue: "多行文本" },
{ value: 2, viewValue: "数值" },
{ value: 3, viewValue: "图片" },
{ value: 4, viewValue: "图片数量" },
{ value: 5, viewValue: "方向" },
{ value: 6, viewValue: "布尔值" },
{ value: 7, viewValue: "供给区域" },
{ value: 8, viewValue: "供给类型" },
];
//提交表单
onSubmit (e) {
e.order = 0
e.enabled = this.data.enabled
e.visible = this.data.visible
e.index = this.data.index
e.required = e.required=='true'? true: false,
this.dialogRef.close(e)
onSubmit(e) {
e.order = 0;
e.enabled = this.data.enabled;
e.visible = this.data.visible;
e.index = this.data.index;
(e.required = e.required == "true" ? true : false), this.dialogRef.close(e);
}
}
}

1
src/app/ui/material-bank/selectoriginalcopy.component.ts

@ -5,7 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
@Component({
selector: 'selectoriginalcopy',
templateUrl: './selectoriginalcopy.component.html',

61
src/app/ui/role/role.component.ts

@ -3,7 +3,6 @@ import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog
import {FormControl} from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { CacheTokenService } from '../../http-interceptors/cache-token.service'
import format from 'date-fns/format';
import {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
@ -52,7 +51,17 @@ export class RoleComponent implements OnInit {
//向上按钮
up(node){
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
function getDate(date){
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year= time.getFullYear() //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate
}
let time = getDate(newdate)
this.http.put(//把上一节点order换成点击的节点
`/api/Roles/${this.dataSource[node.order -1].id}`,
{
@ -83,7 +92,17 @@ export class RoleComponent implements OnInit {
//向下按钮
down(node){
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
function getDate(date){
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year= time.getFullYear() //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate
}
let time = getDate(newdate)
this.http.put(//把下一节点order换成点击的节点
`/api/Roles/${this.dataSource[node.order + 1].id}`,
{
@ -152,7 +171,17 @@ export class RoleComponent implements OnInit {
//启用或禁用按钮
open(roledata){
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
function getDate(date){
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year= time.getFullYear() //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate
}
let time = getDate(newdate)
this.http.put(
`/api/Roles/${roledata['id']}`,
{
@ -308,7 +337,17 @@ export class CreateRole {
//提交
onSubmit(value){
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
function getDate(date){
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year= time.getFullYear() //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate
}
let time = getDate(newdate)
this.http.post(
'/api/Roles',
{
@ -549,7 +588,17 @@ export class EditRole {
}
}
let newdate = new Date();
let time = format(newdate, 'yyyy-MM-dd')
function getDate(date){
//date是传过来的时间戳,注意需为13位,10位需*1000
//也可以不传,获取的就是当前时间
var time = new Date(date);
var year= time.getFullYear() //年
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
var day = ("0" + time.getDate()).slice(-2); //日
var mydate = year + "-" + month + "-" + day;
return mydate
}
let time = getDate(newdate)
if(this.data['id'] != "0" && this.data['id'] != "1"){
this.http.put(
`/api/Roles/${this.data['id']}`,

2
src/app/ui/unit-information/addgroups.component.ts

@ -5,8 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
@Component({

1
src/app/ui/unit-information/addunitinfo.component.ts

@ -5,7 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
@Component({
selector: 'addunitinfo',
templateUrl: './addunitinfo.component.html',

2
src/app/ui/unit-information/editgroup.component.ts

@ -5,8 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
@Component({

1
src/app/ui/unit-information/editunitinfo.component.ts

@ -5,7 +5,6 @@ import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import format from 'date-fns/format';
@Component({
selector: 'editunitinfo',
templateUrl: './editunitinfo.component.html',

1
src/app/ui/userdata/userdata.component.ts

@ -4,7 +4,6 @@ import {MatTableDataSource} from '@angular/material/table';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { HttpClient,HttpHeaders } from '@angular/common/http';
import format from 'date-fns/format';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';

6
src/app/ui/usermanagement/createUser.html

@ -4,12 +4,12 @@
<div mat-dialog-content>
<mat-form-field>
<input type="text" id="name" matInput pattern="^[a-zA-Z][a-zA-Z0-9_]{4,19}$"
<input type="text" id="name" matInput
required ngModel name="name" #name="ngModel" placeholder="登录账号">
</mat-form-field>
<div *ngIf="name.invalid && (name.dirty || name.touched)" class="alert-danger">
<!-- <div *ngIf="name.invalid && (name.dirty || name.touched)" class="alert-danger">
<div *ngIf="name.errors.pattern">登录名格式为字母开头,5-18位</div>
</div>
</div> -->
</div>
<div mat-dialog-content>

9
src/app/ui/usermanagement/editUser.html

@ -11,13 +11,14 @@
<div mat-dialog-content>
<mat-form-field>
<input type="text" pattern="^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$" matInput required [(ngModel)]="identityCard" name="identityCard" placeholder="身份证号码">
<!-- pattern="^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$" -->
<input type="text" matInput [(ngModel)]="identityCard" name="identityCard" placeholder="身份证号码">
</mat-form-field>
</div>
<div mat-dialog-content>
<mat-form-field>
<input type="text" matInput required [(ngModel)]="realName" name="user" placeholder="真实姓名">
<input type="text" matInput [(ngModel)]="realName" name="user" placeholder="真实姓名">
</mat-form-field>
</div>
@ -29,8 +30,8 @@
<div mat-dialog-content>
<mat-form-field>
<input type="tel" matInput pattern="^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4(?:[14]0\d{3}|[68]\d{4}|[579]\d{2}))\d{6}$"
[(ngModel)]="phone" name="phone" placeholder="联系电话">
<!-- pattern="^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[0-35-9]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|6[2567]\d{2}|4(?:[14]0\d{3}|[68]\d{4}|[579]\d{2}))\d{6}$" -->
<input type="tel" matInput [(ngModel)]="phone" name="phone" placeholder="联系电话">
</mat-form-field>
</div>

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

@ -24,8 +24,6 @@ import { Viewport } from 'pixi-viewport';
import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events';
import { Dimensioning } from './model/dimensioning';
import { Configuration, viewBounds } from './model/configuration';
import { id } from 'date-fns/locale';
@Component({
selector: 'app-working-area',

Loading…
Cancel
Save