陈鹏飞 4 years ago
parent
commit
65f7a399fb
  1. 4
      angular.json
  2. 22
      package-lock.json
  3. 5
      package.json
  4. 1
      src/app/data-collection/fire-force/fire-force.component.html
  5. 8
      src/app/data-collection/fire-force/fire-force.component.scss
  6. 76
      src/app/data-collection/fire-force/fire-force.component.ts
  7. 1
      src/app/data-collection/linkage-forces/linkage-forces.component.html
  8. 8
      src/app/data-collection/linkage-forces/linkage-forces.component.scss
  9. 75
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  10. 1
      src/app/data-collection/water-collection/water-collection.component.html
  11. 7
      src/app/data-collection/water-collection/water-collection.component.scss
  12. 36
      src/app/data-collection/water-collection/water-collection.component.ts
  13. 6
      src/app/gis-management/basic-info/basic-info.component.scss
  14. 31
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  15. 4
      src/app/gis-management/gis-labeling/shareUrl.scss
  16. 4
      src/app/key-unit/key-unit.module.ts
  17. 24
      src/app/key-unit/router-gis/router-gis.component.ts
  18. 14
      src/app/key-unit/water-road/edittext.html
  19. 239
      src/app/key-unit/water-road/water-road.component.ts
  20. 16
      src/app/pages/login/login.component.ts
  21. 9
      src/app/plan-audit/plan-record/plan-record.component.html
  22. 17
      src/app/plan-audit/plan-record/plan-record.component.scss
  23. 46
      src/app/plan-audit/plan-record/plan-record.component.ts
  24. 11
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  25. 16
      src/app/plan-audit/wait-examineer/wait-examineer.component.scss
  26. 46
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  27. 36
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  28. 2
      src/app/plan-management/entry-plan/entry-plan.component.html
  29. 10
      src/app/plan-management/entry-plan/entry-plan.component.scss
  30. 153
      src/app/plan-management/maintain-up/maintain-up.component.html
  31. 256
      src/app/plan-management/maintain-up/maintain-up.component.scss
  32. 25
      src/app/plan-management/maintain-up/maintain-up.component.spec.ts
  33. 184
      src/app/plan-management/maintain-up/maintain-up.component.ts
  34. 11
      src/app/plan-management/meet-plan/meet-plan.component.html
  35. 12
      src/app/plan-management/meet-plan/meet-plan.component.scss
  36. 44
      src/app/plan-management/meet-plan/meet-plan.component.ts
  37. 9
      src/app/plan-management/meet-plan/newunit.html
  38. 9
      src/app/plan-management/onetwo-entry-plan/newunit.html
  39. 13
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html
  40. 14
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss
  41. 48
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
  42. 2
      src/app/plan-management/pass-plan/pass-plan.component.html
  43. 10
      src/app/plan-management/pass-plan/pass-plan.component.scss
  44. 36
      src/app/plan-management/pass-plan/pass-plan.component.ts
  45. 5
      src/app/plan-management/plan-management-routing.module.ts
  46. 5
      src/app/plan-management/plan-management.module.ts
  47. 4
      src/app/plan-management/type-plan/type-plan.component.html
  48. 12
      src/app/plan-management/type-plan/type-plan.component.scss
  49. 37
      src/app/plan-management/type-plan/type-plan.component.ts
  50. 9
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  51. 7
      src/app/ui/collection-tools/collection-tools.component.ts
  52. 100
      src/app/working-area/model/axGrid.ts
  53. 13
      src/app/working-area/model/axSelection.ts
  54. 10
      src/app/working-area/model/axShape.ts
  55. 15
      src/app/working-area/working-area.component.ts
  56. BIN
      src/assets/font/SourceHanSansCN-Regular.otf
  57. 2
      src/main.ts
  58. 12
      src/styles.scss

4
angular.json

@ -64,8 +64,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "6mb",
"maximumError": "6mb"
"maximumWarning": "8mb",
"maximumError": "8mb"
},
{
"type": "anyComponentStyle",

22
package-lock.json generated

@ -4701,6 +4701,12 @@
"resolved": "https://registry.npm.taobao.org/@types/cesium/download/@types/cesium-1.65.3.tgz",
"integrity": "sha1-vG0xrx67i8IAIsKtXHqnDIaNp5I="
},
"@types/crypto-js": {
"version": "4.0.1",
"resolved": "https://registry.npm.taobao.org/@types/crypto-js/download/@types/crypto-js-4.0.1.tgz?cache=0&sync_timestamp=1605055060715&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fcrypto-js%2Fdownload%2F%40types%2Fcrypto-js-4.0.1.tgz",
"integrity": "sha1-OkvSRRiw5sWUDaTiZZ7rLvCAaWM=",
"dev": true
},
"@types/estree": {
"version": "0.0.42",
"resolved": "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.42.tgz",
@ -4751,9 +4757,9 @@
"dev": true
},
"@types/node": {
"version": "12.12.26",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-12.12.26.tgz?cache=0&sync_timestamp=1580843161457&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-12.12.26.tgz",
"integrity": "sha1-IT4VO6usDtFp1EptkZUB5o9Z3qk="
"version": "12.19.15",
"resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-12.19.15.tgz?cache=0&sync_timestamp=1611167664149&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-12.19.15.tgz",
"integrity": "sha1-DefpePtD22LaNp2xjqCIpjZzwYI="
},
"@types/q": {
"version": "0.0.32",
@ -6797,6 +6803,11 @@
"randomfill": "^1.0.3"
}
},
"crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/crypto-js/download/crypto-js-4.0.0.tgz",
"integrity": "sha1-KQSrJnep0EKFai6i74DekuSjbcw="
},
"css": {
"version": "2.2.4",
"resolved": "https://registry.npm.taobao.org/css/download/css-2.2.4.tgz",
@ -7141,6 +7152,11 @@
"ip-regex": "^2.1.0"
}
},
"default-passive-events": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/default-passive-events/download/default-passive-events-2.0.0.tgz",
"integrity": "sha1-ebGqZ77LqrOLcYRptUgP75Ltpkk="
},
"default-require-extensions": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/default-require-extensions/download/default-require-extensions-2.0.0.tgz",

5
package.json

@ -27,7 +27,9 @@
"angular-calendar": "^0.28.2",
"bson-objectid": "^1.3.1",
"cesium": "^1.64.0",
"crypto-js": "^4.0.0",
"date-fns": "^2.9.0",
"default-passive-events": "^2.0.0",
"e-ngx-cesium": "^6.3.2",
"echarts": "^4.6.0",
"firebase": "^7.6.2",
@ -50,9 +52,10 @@
"@angular/cli": "~9.0.1",
"@angular/compiler-cli": "~9.0.0",
"@angular/language-service": "~9.0.0",
"@types/crypto-js": "^4.0.1",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"@types/node": "^12.19.15",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",

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

@ -144,6 +144,7 @@
<span class="save" (click)="save()"><mat-icon>save</mat-icon>保存</span>
<span class="submitAudit"><mat-icon>open_in_browser</mat-icon>提交审核</span>
<span class="close" (click)="close()"><mat-icon>close</mat-icon>关闭</span>
</div>
</div>
<!-- 详情 -->

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

@ -6,7 +6,7 @@
box-sizing: border-box;
padding: 10px;
font-size: 16px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
}
@ -339,7 +339,7 @@
cursor: pointer;
color: #2196F3;
mat-icon{
vertical-align: text-top;
vertical-align: sub;
font-size: 20px;
width: 20px;
height: 20px;
@ -351,7 +351,9 @@
.submitAudit{
margin: 0 30px;
}
.close{
margin-right: 30px;
}
}
}
.contant{

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

@ -9,6 +9,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { NzTreeNode } from 'ng-zorro-antd/tree';
import { TreeService } from 'src/app/http-interceptors/tree.service';
import Viewer from 'viewerjs'
import CryptoJS from 'crypto-js/crypto-js'
declare var AMap: any;
@Component({
@ -56,10 +57,8 @@ export class FireForceComponent implements OnInit {
PageSize : 999999,
Levels:Levels
}
console.log('4444',Levels)
if(Levels.length != 0){//如果勾选了checkbox
this.http.get('/api/CustomFireForce',{params:params}).subscribe((data:any) => {
console.log('所有力量',data)
this.createMarker(data)
})
}else{
@ -176,7 +175,6 @@ export class FireForceComponent implements OnInit {
MaxIntegrity : MaxIntegrity
}
this.http.get('/api/CustomFireForce',{params:params}).subscribe((data:any) => {
console.log('所有消防力量列表',data)
this.allFireForceList = data
   this.dataSource.data = this.tree.toTree(data)
this.treeControl.expand(this.treeControl.dataNodes[0]);
@ -197,11 +195,9 @@ export class FireForceComponent implements OnInit {
newNodes = newNodes.filter(n => {
return expandNodes.indexOf(n.id) >= 0;
});
console.log(newNodes)
newNodes.forEach(item => {
this.treeControl.expand(item);
});
console.log('所有消防力量',data)
})
}
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
@ -234,7 +230,6 @@ export class FireForceComponent implements OnInit {
code:''
}
selectTreeNode(node){
console.log(node)
this.isGisTopBox = false
if(this.selectedFireForceId != node.id){
this.clearData()
@ -263,7 +258,6 @@ export class FireForceComponent implements OnInit {
this.isMasklayer = false
this.FireForceDetailInfo = data
if(data.location && data.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.positionLngLat = data.location
this.map.setCenter([data.location.x,data.location.y]);
this.newPositionMarker = new AMap.Marker({
@ -277,7 +271,6 @@ export class FireForceComponent implements OnInit {
this.map.setCity('上海市');
}
//相关资料
console.log('详情',data)
data.relevantInfomationData ? this.AttachmentArr = JSON.parse(data.relevantInfomationData) : null
if(node.forceType == 0 && node.level == 0){
@ -314,7 +307,6 @@ export class FireForceComponent implements OnInit {
//搜索
isTreeView:boolean = true//决定显示树还是列表
searchList(){
console.log(this.searchForm)
if(!this.searchForm.name && !this.searchForm.integrityNum){
this.isTreeView = true
}else{
@ -572,11 +564,8 @@ export class FireForceComponent implements OnInit {
//删除一下数据库的文件
if(this.deletedFile.length != 0){
this.deletedFile.forEach(item => {
// this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}?x-oss-process=image/resize,m_fixed,h_100,w_100`).subscribe(data=>{
// console.log('删除缩略图成功')
// })
this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}`).subscribe(data=>{
console.log('删除原文件成功')
// console.log('删除原文件成功')
})
});
@ -636,7 +625,6 @@ export class FireForceComponent implements OnInit {
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.upDateAllFireForce()
// console.log(123,data)
})
}else{
let forceType
@ -653,7 +641,6 @@ export class FireForceComponent implements OnInit {
organizationId : this.selectedFireForce.id
}
this.http.post('/api/CustomFireForce',body,{params:params}).subscribe((data:any) => {
console.log('创建其他消防力量成功',data)
this.newselectedFireForceId = data.id
this.selectedFireForce = data
let body = this.FireForceDetailInfo
@ -668,7 +655,6 @@ export class FireForceComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
console.log(123,data2)
})
})
}
@ -678,7 +664,11 @@ export class FireForceComponent implements OnInit {
}
close(){
this.selectedFireForceLevel = null
this.selectedFireForceId = null
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
}
map:any
placeSearch:any//构造地点查询类
isMapLabel:boolean = false //是否已经标记坐标
@ -712,21 +702,6 @@ export class FireForceComponent 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(-15, -18)
// })
// // 将 markers 添加到地图
// this.map.add(this.oldPositionMarker);
}else{
console.log('未标注单位位置')
// this.map.setCity('上海市');
}
}
//点击位置
isGisTopBox:boolean = false //
@ -739,15 +714,11 @@ export class FireForceComponent implements OnInit {
this.isGisTopBox = true
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
let center
console.log(789,this.atLastPositionLngLat)
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
console.log(1)
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y]
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.FireForceDetailInfo.location && this.FireForceDetailInfo.location.x){
console.log(2)
center = [this.FireForceDetailInfo.location.x, this.FireForceDetailInfo.location.y]
}else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = new AMap.Marker({
@ -810,7 +781,6 @@ export class FireForceComponent implements OnInit {
isMasklayerUploading:boolean = false//上传进度条遮罩层是否打开
isMasklayerDownload:boolean = false//下载进度条遮罩层是否打开
uploadAttachment(e){
console.log('选择的文件',e)
this.file = e.target.files[0] || null //上传的文件
let file = e.target.files[0] || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
@ -818,12 +788,9 @@ export class FireForceComponent implements OnInit {
if (file && fileSize<=shardSize) { //上传文件<=5MB时
this.isMasklayer = true
console.log('file',this.file)
let formData = new FormData()
formData.append("file",file)
//this.selectedFireForce.id 选择的组织机构的id
this.http.post(`/api/Objects/PlanPlatform/FireForce/${this.selectedFireForce.id}`,formData).subscribe((data:any)=>{
// this.objectName = data.objectName
let obj = {
objectName:data.objectName,
fileName:data.fileName,
@ -831,7 +798,6 @@ export class FireForceComponent implements OnInit {
}
this.AttachmentArr.push(obj)
this.isMasklayer = false
console.log('上传成功',data)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -841,7 +807,6 @@ export class FireForceComponent implements OnInit {
this.isMasklayerUploading = true
let data = {filename: file.name}
this.http.post(`/api/NewMultipartUpload/PlanPlatform/FireForce/${this.selectedFireForce.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
console.log('初始化分块上传成功',data)
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
@ -981,7 +946,6 @@ export class FireForceComponent implements OnInit {
//删除图片
deletedFile:any = []
deleteFile(item,e){
console.log(this.AttachmentArr)
e.stopPropagation()
let isTrue = window.confirm('确定要删除该文件吗?')
if(isTrue){
@ -1002,10 +966,8 @@ export class FireForceComponent implements OnInit {
//点击文件
clickFile(item){
console.log(item)
let suffix = item.fileName.split('.')[item.fileName.split('.').length-1]
if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){
console.log('这是图片')
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
@ -1024,10 +986,26 @@ export class FireForceComponent implements OnInit {
}, 0);
}
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂不支持查看','确定',config);
let fetchUrl = item.objectName
let json={
doc: {
docId: new Date(),
title: item.fileName,
fetchUrl: `http://${location.host}/api/Objects/PlanPlatform/`+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
}
if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去

1
src/app/data-collection/linkage-forces/linkage-forces.component.html

@ -119,6 +119,7 @@
<span class="save" (click)="save()"><mat-icon>save</mat-icon>保存</span>
<span class="submitAudit"><mat-icon>open_in_browser</mat-icon>提交审核</span>
<span class="close" (click)="close()"><mat-icon>close</mat-icon>关闭</span>
</div>
</div>
<!-- 详情 -->

8
src/app/data-collection/linkage-forces/linkage-forces.component.scss

@ -6,7 +6,7 @@
box-sizing: border-box;
padding: 10px;
font-size: 16px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
}
@ -302,7 +302,7 @@
cursor: pointer;
color: #2196F3;
mat-icon{
vertical-align: text-top;
vertical-align: sub;
font-size: 20px;
width: 20px;
height: 20px;
@ -314,7 +314,9 @@
.submitAudit{
margin: 0 30px;
}
.close{
margin-right: 30px;
}
}
}
.contant{

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

@ -10,6 +10,7 @@ import { NzTreeNode } from 'ng-zorro-antd/tree';
import { TreeService } from 'src/app/http-interceptors/tree.service';
import Viewer from 'viewerjs'
import Swiper from 'swiper';
import CryptoJS from 'crypto-js/crypto-js'
declare var AMap: any;
@Component({
selector: 'app-linkage-forces',
@ -67,10 +68,8 @@ export class LinkageForcesComponent implements OnInit {
PageSize : 999999,
LinkageForceTypes:LinkageForceTypes
}
console.log('4444',LinkageForceTypes)
if(LinkageForceTypes.length != 0){//如果勾选了checkbox
this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => {
console.log('所有力量',data)
this.createMarker(data.items)
})
}else{
@ -168,7 +167,7 @@ export class LinkageForcesComponent implements OnInit {
}
ngOnInit(): void {
this.getAllFireForce()
window.onload = () => {
setTimeout(() => {
var mySwiper = new Swiper('.swiper-container', {
slidesPerView: 10,//每页显示的个数
slidesPerGroup: 3,//点击一次需要跳多少次
@ -178,9 +177,6 @@ export class LinkageForcesComponent implements OnInit {
prevEl: '.swiper-button-prev',
},
})
}
setTimeout(() => {
this.createMap()
}, 0);
}
@ -221,7 +217,6 @@ export class LinkageForcesComponent implements OnInit {
PageNumber : this.PageNumber,
}
this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => {
console.log('所有消防力量列表',data)
this.dataLength = data.totalCount
this.allLinkageForceObj = data
})
@ -239,10 +234,7 @@ export class LinkageForcesComponent implements OnInit {
if(this.newPositionMarker){
this.map.remove(this.newPositionMarker);
}
console.log('当前点击的li',item)
if(item.location && item.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y],
@ -387,7 +379,6 @@ export class LinkageForcesComponent implements OnInit {
data=>{
if(typeof data === 'number' && !isNaN(data)){
this.clearData()
console.log('清空了',this.LinkageForceDetailInfo)
this.LinkageForceDetailInfo.linkageForceType = data
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.map.setCity('上海市');
@ -407,7 +398,7 @@ export class LinkageForcesComponent implements OnInit {
if(this.deletedFile.length != 0){
this.deletedFile.forEach(item => {
this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}`).subscribe(data=>{
console.log('删除原文件成功')
// console.log('删除原文件成功')
})
});
}
@ -424,19 +415,15 @@ export class LinkageForcesComponent implements OnInit {
let body = this.LinkageForceDetailInfo
if(this.LinkageForceDetailInfo.id){
this.http.put(`/api/LinkageForces/${this.LinkageForceDetailInfo.id}`,body).subscribe((data:any) =>{
console.log('修改成功',data)
this.isMasklayer = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功','确定',config);
// this.LinkageForceDetailInfo.id = data.id
this.getAllFireForce()
})
}else{
this.http.post('/api/LinkageForces',body).subscribe((data:any) =>{
console.log('创建成功',data)
this.isMasklayer = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -449,7 +436,11 @@ export class LinkageForcesComponent implements OnInit {
}
//关闭
close(){
this.LinkageForceDetailInfo={}
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
}
map:any
placeSearch:any//构造地点查询类
isMapLabel:boolean = false //是否已经标记坐标
@ -483,21 +474,6 @@ export class LinkageForcesComponent 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(-15, -18)
// })
// // 将 markers 添加到地图
// this.map.add(this.oldPositionMarker);
}else{
console.log('未标注单位位置')
// this.map.setCity('上海市');
}
}
//点击位置
isGisTopBox:boolean = false //
@ -510,15 +486,11 @@ export class LinkageForcesComponent implements OnInit {
this.isGisTopBox = true
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
let center
console.log(789,this.atLastPositionLngLat)
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
console.log(1)
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y]
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){
console.log(2)
center = [this.LinkageForceDetailInfo.location.x, this.LinkageForceDetailInfo.location.y]
}else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = new AMap.Marker({
@ -581,7 +553,6 @@ export class LinkageForcesComponent implements OnInit {
isMasklayerUploading:boolean = false//上传进度条遮罩层是否打开
isMasklayerDownload:boolean = false//下载进度条遮罩层是否打开
uploadAttachment(e){
console.log('选择的文件',e)
this.file = e.target.files[0] || null //上传的文件
let file = e.target.files[0] || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
@ -589,7 +560,6 @@ export class LinkageForcesComponent implements OnInit {
if (file && fileSize<=shardSize) { //上传文件<=5MB时
this.isMasklayer = true
console.log('file',this.file)
let formData = new FormData()
formData.append("file",file)
//this.selectedFireForce.id 选择的组织机构的id
@ -602,7 +572,6 @@ export class LinkageForcesComponent implements OnInit {
}
this.AttachmentArr.push(obj)
this.isMasklayer = false
console.log('上传成功',data)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -612,7 +581,6 @@ export class LinkageForcesComponent implements OnInit {
this.isMasklayerUploading = true
let data = {filename: file.name}
this.http.post(`/api/NewMultipartUpload/PlanPlatform/LinkageForce/${this.LinkageForceDetailInfo.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
console.log('初始化分块上传成功',data)
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
@ -752,7 +720,6 @@ export class LinkageForcesComponent implements OnInit {
//删除图片
deletedFile:any = []
deleteFile(item,e){
console.log(this.AttachmentArr)
e.stopPropagation()
let isTrue = window.confirm('确定要删除该文件吗?')
if(isTrue){
@ -773,10 +740,8 @@ export class LinkageForcesComponent implements OnInit {
//点击文件
clickFile(item){
console.log(item)
let suffix = item.fileName.split('.')[item.fileName.split('.').length-1]
if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){
console.log('这是图片')
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
@ -795,10 +760,26 @@ export class LinkageForcesComponent implements OnInit {
}, 0);
}
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂不支持查看','确定',config);
let fetchUrl = item.objectName
let json={
doc: {
docId: new Date(),
title: item.fileName,
fetchUrl: `http://${location.host}/api/Objects/PlanPlatform/`+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
}
if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetails2, {//调用open方法打开对话框并且携带参数过去

1
src/app/data-collection/water-collection/water-collection.component.html

@ -81,6 +81,7 @@
<div class="btnbox">
<span class="save" (click)="save()"><mat-icon>save</mat-icon>保存</span>
<span class="submitAudit"><mat-icon>open_in_browser</mat-icon>提交审核</span>
<span class="close" (click)="close()"><mat-icon>close</mat-icon>关闭</span>
</div>
</div>
<div class="contant" >

7
src/app/data-collection/water-collection/water-collection.component.scss

@ -6,7 +6,7 @@
box-sizing: border-box;
padding: 10px;
font-size: 16px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
}
@ -246,7 +246,7 @@
cursor: pointer;
color: #2196F3;
mat-icon{
vertical-align: text-top;
vertical-align: sub;
font-size: 20px;
width: 20px;
height: 20px;
@ -258,6 +258,9 @@
.submitAudit{
margin: 0 30px;
}
.close{
margin-right: 30px;
}
}
}
.contant{

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

@ -167,12 +167,10 @@ export class WaterCollectionComponent implements OnInit {
this.http.get('/api/WaterSources',{params:params}).subscribe((data:any) => {
this.addWaterListData = data
this.dataLength = data.totalCount
console.log('所有水源',data)
})
}
//搜索
searchList(){
console.log(this.searchForm)
this.getAllWaterData()
}
//分页事件
@ -200,7 +198,7 @@ export class WaterCollectionComponent implements OnInit {
//点击水源列表
selectedLiIndex:any
clickWaterLi(item,index){
console.log(item)
// console.log(item)
if(this.selectedLiIndex != index){
this.selectedLiIndex = index
this.clearData()
@ -214,8 +212,6 @@ export class WaterCollectionComponent implements OnInit {
this.map.remove(this.newPositionMarker);
}
if(item.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y],
@ -434,7 +430,12 @@ export class WaterCollectionComponent implements OnInit {
}
}
//关闭
close(){
this.selectedWaterTypeIndex = null
this.selectedLiIndex = null
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
}
map:any
placeSearch:any//构造地点查询类
isMapLabel:boolean = false //是否已经标记坐标
@ -468,21 +469,6 @@ export class WaterCollectionComponent 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(-15, -18)
// })
// // 将 markers 添加到地图
// this.map.add(this.oldPositionMarker);
}else{
console.log('未标注单位位置')
// this.map.setCity('上海市');
}
}
//点击位置
isGisTopBox:boolean = false //
@ -496,13 +482,10 @@ export class WaterCollectionComponent implements OnInit {
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
let center
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
console.log(1)
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y]
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.waterData.location.x){
console.log(2)
center = [this.waterData.location.x, this.waterData.location.y]
}else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = new AMap.Marker({
@ -574,12 +557,7 @@ export class AddWater {
selecteAddType(item,key){
this.selectedWaterTypeIndex = key
}
ngOnInit(): void {
}
confirm(){
console.log(this.selectedWaterTypeIndex)
this.dialogRef.close(this.selectedWaterTypeIndex)
}

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

@ -18,7 +18,7 @@ table { text-align: center; border-collapse: collapse; padding:2px;}
width: 100%;
height: 100%;
overflow-y: auto;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
color: #333333;
padding: 10px;
box-sizing: border-box;
@ -31,7 +31,7 @@ table { text-align: center; border-collapse: collapse; padding:2px;}
p{
height: 14px;
font-size: 14px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
line-height: 14px;
color: #333333;
@ -54,7 +54,7 @@ table { text-align: center; border-collapse: collapse; padding:2px;}
p{
height: 14px;
font-size: 14px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
line-height: 14px;
color: #333333;

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

@ -915,12 +915,19 @@ export class GisLabelingComponent implements OnInit {
var autoComplete = new AMap.Autocomplete(autoOptions);
autoComplete.search(keywords, function(status, result) {
if (result && result.tips && result.tips.length) { //搜索到数据时
that._ngZone.run(()=>{
if(e == 0){
if(e == 0){//起点
that.routeStartList = result.tips
that.startCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
}else{
if(result.tips.length != 0){
for (let index = 0; index < result.tips.length; index++) {
const element = result.tips[index];
if(element.location){
that.startCoordinate = new AMap.LngLat(element.location.lng, element.location.lat)
return
}
}
}
}else{//终点
that.routeEndList = result.tips
that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
}
@ -986,6 +993,19 @@ export class GisLabelingComponent implements OnInit {
this.routeGIS = new AMap.Driving({
map: this.map,
});
if(!this.startCoordinate){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('未查询到起点坐标信息,请输入有效地址','确定',config);
return
}else if(!this.startCoordinate){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('未查询到终点坐标信息,请输入有效地址','确定',config);
return
}else{
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {
@ -995,6 +1015,8 @@ export class GisLabelingComponent implements OnInit {
);
}
}
//切换 导航模式 推荐方案/躲避拥堵
toggleRoute (e) {
let that = this
@ -1006,6 +1028,7 @@ export class GisLabelingComponent implements OnInit {
policy: e==true? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC
});
// 根据起终点名称规划驾车导航路线
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {

4
src/app/gis-management/gis-labeling/shareUrl.scss

@ -8,7 +8,7 @@
position: relative;
.name{
font-size: 20px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
color: #FFFFFF;
}
@ -37,7 +37,7 @@
line-height: 36px;
background: #EEF1F5;
font-size: 16px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
color: #333333;
opacity: 0.4;

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

@ -80,14 +80,14 @@ import { ActualCombatDrillComponent } from './actual-combat-drill/actual-combat-
import { SixFamiliarListComponent } from './six-familiar-list/six-familiar-list.component'
import { TrainingRecordinfoComponent } from './training-recordinfo/training-recordinfo.component';
import { RouterGISComponent } from './router-gis/router-gis.component';
import { EditText, WaterRoadComponent } from './water-road/water-road.component';
import { WaterRoadComponent } from './water-road/water-road.component';
import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component';
import { KnowRouteComponent } from './know-route/know-route.component';
import { FindProblemComponent } from './find-problem/find-problem.component';
import { upname } from './key-unit-management/key-unit-management.component'
@NgModule({
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,EditText,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname],
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname],
exports:[ViewUnitDetailsPlanComponent],
imports: [
CommonModule,

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

@ -128,7 +128,15 @@ export class RouterGISComponent implements OnInit {
that._ngZone.run(()=>{
if(e == 0){
that.routeStartList = result.tips
that.startCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
if(result.tips.length != 0){
for (let index = 0; index < result.tips.length; index++) {
const element = result.tips[index];
if(element.location){
that.startCoordinate = new AMap.LngLat(element.location.lng, element.location.lat)
return
}
}
}
}else{
that.routeEndList = result.tips
that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat)
@ -191,6 +199,19 @@ export class RouterGISComponent implements OnInit {
this.routeGIS = new AMap.Driving({
map: this.map,
});
if(!this.startCoordinate){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('未查询到起点坐标信息,请输入有效地址','确定',config);
return
}else if(!this.startCoordinate){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('未查询到终点坐标信息,请输入有效地址','确定',config);
return
}else{
this.routeGIS.search(this.startCoordinate,this.endCoordinate,
function(status, result) {
if (status === 'complete') {
@ -198,6 +219,7 @@ export class RouterGISComponent implements OnInit {
} else { alert('获取驾驶规划路线失败') }
}
);
}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';

14
src/app/key-unit/water-road/edittext.html

@ -1,14 +0,0 @@
<div class="dialogbox">
<div class="title">
<span style="color: #FC7045;">说明:</span>
<span>水源情况主要包括消火栓位置、管径、外观完好情况、停车取水位置试水情况,消防水池位置、容量、停车取水位置、取水测试情况,取消码头位置、水位、停车取水位置等;道路情况主要包括道路长度、宽度、起始点、沿线重点单位、立交、桥梁、涵洞及其通车能力。</span>
<span style="color: #FC7045;">【该项主要在道路水源熟悉时填写】</span>
</div>
<div class="text">
<textarea [disabled]="!iseditsix" name="" id="" cols="30" rows="10" placeholder="请输入水源情况" [(ngModel)]="textcontant"></textarea>
</div>
<div class="btnbox">
<div *ngIf="iseditsix" (click)="ok()">确认</div>
<div (click)="cancel()">取消</div>
</div>
</div>

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

@ -1,7 +1,9 @@
import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, Inject, OnInit, Renderer2 } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
declare var AMap: any;
@Component({
@ -11,17 +13,28 @@ declare var AMap: any;
})
export class WaterRoadComponent implements OnInit {
constructor(public renderer2: Renderer2,public snackBar: MatSnackBar,public dialog: MatDialog,private fb: FormBuilder) { }
constructor(private http: HttpClient,public renderer2: Renderer2,public snackBar: MatSnackBar,public dialog: MatDialog,private fb: FormBuilder,private route:ActivatedRoute) { }
//获得单位信息
unitData:any
async getUnitData(){
await new Promise((resolve, reject) =>{
this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe(data => {
this.unitData = data
resolve(data)
})
})
}
map:any //地图
markers:any = [{_position: [121.472644,31.231706]}] //当前单位坐标
watertForm:FormGroup //gis右上角水源表单
waterList = [
{id:'0',name:'消火栓',selected:false},
{id:'1',name:'消防水池',selected:false},
{id:'2',name:'天然水源',selected:false},
{id:'0',name:'消火栓',selected:true},
{id:'1',name:'消防水池',selected:true},
{id:'2',name:'天然水源',selected:true},
]
waterAreaDefault:any = '0' //默认水源范围
waterAreaDefault:any = '5000' //默认水源范围
selectedWaterList:any = [] //选择提交的水源
//地图范围圆圈---水源
circleofwater = new AMap.Circle({
@ -32,11 +45,11 @@ export class WaterRoadComponent implements OnInit {
strokeStyle: 'dashed',
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#ee2200',
fillColor: '#1791fc',
zIndex: 50,
})
ngOnInit(): void {
async ngOnInit(): Promise<void> {
this.watertForm = this.fb.group({
waters:this.waterUnits(),
allSelectedWater:new FormControl(),
@ -51,9 +64,10 @@ export class WaterRoadComponent implements OnInit {
})
this.waterList.forEach(item => {
if(item.selected){
this.selectedWaterList.push(item.name)
this.selectedWaterList.push(item.id)
}
})
await this.getUnitData()
setTimeout(() => {
this.creatMap()
}, 0);
@ -75,69 +89,127 @@ export class WaterRoadComponent implements OnInit {
//水源提交
waterSubmit(value){
if(this.markers.length == 0){
const config = new MatSnackBarConfig();
if(!this.unitMarker){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先选择一个单位','确定',config);
this.snackBar.open('请前往基本信息标注单位坐标','确定',config);
}else{
this.createwaterMarker()
this.circleofwater.setRadius(Number(this.waterAreaDefault))
this.circleofwater.setCenter(this.markers[0]._position)
this.circleofwater.setCenter(this.unitMarker._position)
this.circleofwater.setMap(this.map)
let Distance
let lnglat = new AMap.LngLat(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标
//如果选择当前的视野范围算出查询半径
if(this.waterAreaDefault == '0'){
this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds())/2)
Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.unitData.location.y)
}else{
Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.unitData.location.y)
}
this.getWaterData(Distance)
}
}
waterIconList = []; //展示的水源图标
//获得水源列表
getWaterData(Distance){
if(this.selectedWaterList.length == 0){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择水源类型','确定',config);
}else{
let paramsdata:any = {
PageSize:99999,
Lon : this.unitData.location.x,
Lat : this.unitData.location.y,
Distance : Distance,
WaterSourceTypes :this.selectedWaterList
}
console.log('paramsdata',paramsdata)
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => {
console.log('所有水源',data)
this.createwaterMarker(data.items)
})
}
}
//循环渲染出所有水源markers
createwaterMarker(){
this.waterIconList.forEach((element,index) => { this.map.remove(element) }); //先删除所有标点
this.waterIconList = []
let waterType = this.selectedWaterList //筛选出展示的 水源类型
if (waterType.length) {
let x = JSON.parse( JSON.stringify(this.markers[0]._position[0]) ) //中心标注的 坐标
let y = JSON.parse( JSON.stringify(this.markers[0]._position[1]) ) //中心标注的 坐标
let positonList = [0.015, -0.035, 0.045, 0.061, -0.013, 0.029]
// 创建一个 Icon
let startIcon = new AMap.Icon({
image: '../../../assets/images/fireHydrant.png',
imageSize: new AMap.Size(20, 20),
});
positonList.forEach((item,index)=>{
let marker = new AMap.Marker({
map: this.map,
position: index%2==0? JSON.parse( JSON.stringify([x+item,y-item]) ) : JSON.parse( JSON.stringify([x-item,y+item]) ),
icon: startIcon,
});
this.waterIconList.push(marker)
waterCluster:any //水源聚合实例
createwaterMarker(list){
let waterMarkerArrcluster = []
this.waterCluster ? this.waterCluster.setData([]) : null
list.forEach((item) => {
let image
if(item.waterSourceType == 0){//消火栓
image = '/assets/waterMarkers/市政消火栓.png'
}else if(item.waterSourceType == 1){//消防水池
image = '/assets/waterMarkers/方形储水池.png'
}else if(item.waterSourceType == 2){//天然水源
image = '/assets/waterMarkers/天然水源.png'
}
// 用于点集合的数组
waterMarkerArrcluster.push({
lnglat : [item.location.x,item.location.y],
image : image,
data : item
})
positonList.forEach((item,index)=>{
let marker = new AMap.Marker({
map: this.map,
position: index%2==0? JSON.parse( JSON.stringify([x+item,y+item]) ) : JSON.parse( JSON.stringify([x-item,y-item]) ),
icon: startIcon,
});
this.waterIconList.push(marker)
})
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择水源类型','确定',config);
this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60
var count = waterMarkerArrcluster.length;
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)';
var fontColor = 'hsla(' + Hue + ',100%,90%,1)';
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,90%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
var _renderMarker = (context)=> {
var content = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`;
var offset = new AMap.Pixel(-12.5, -12.5);
context.marker.setContent(content)
context.marker.setOffset(offset)
}
this.waterCluster = new AMap.MarkerCluster(this.map, waterMarkerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式
});
this.waterCluster.on('click',(e)=>{
if(e.clusterData.length == 1){
}
})
});
}
//取消显示水源
resetWater(){
this.waterIconList.forEach((element,index) => { this.map.remove(element) }); //先删除所有标点
this.waterIconList = []
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0')
this.map.remove(this.circleofwater)
this.waterCluster.setData([])
}
//计算两地距离
@ -158,56 +230,35 @@ export class WaterRoadComponent implements OnInit {
}
//地图初始化
unitMarker:any//单位标点
newPositionMarkerContent:any =
'<div class="custom-content-marker">' +
' <img style="width:20px;height:26px" src="/assets/images/定位.png">' +
'</div>'
creatMap(){
let that = this
var layer = new AMap.createDefaultLayer({
zooms:[3,20], //可见级别
visible:true, //是否可见
opacity:1, //透明度
zIndex:0, //叠加层级
resizeEnable: true //是否监控地图容器尺寸变化,
})
that.map = new AMap.Map('center',{
layers:[layer], //当只想显示标准图层时layers属性可缺省,
this.map = new AMap.Map('center',{
zoom: 13, //初始地图级别
});
that.map.setCity('上海市');
if(this.unitData.location && this.unitData.location.x){
this.map.setCenter([this.unitData.location.x,this.unitData.location.y]);
this.unitMarker = new AMap.Marker({
position: [this.unitData.location.x,this.unitData.location.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-10, -13)
})
// 将 markers 添加到地图
this.map.add(this.unitMarker);
this.waterSubmit(1)
}else{
this.map.setCity('上海市');
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先前往基本信息标注单位位置','确定',config);
}
}
//编辑水源道路情况
@Component({
selector: 'app-editBuilding',
templateUrl: './edittext.html',
styleUrls: ['./water-road.component.scss']
})
export class EditText {
constructor(public snackBar: MatSnackBar,public dialog: MatDialog,public dialogRef: MatDialogRef<EditText>,@Inject(MAT_DIALOG_DATA) public data) { }
textcontant:any = localStorage.getItem(sessionStorage.getItem("companyId") + "waterroad") || ""//输入内容
iseditsix = true
ngOnInit(): void {
if(sessionStorage.getItem("six") == "look"){
this.iseditsix = false
}else if(sessionStorage.getItem("six") == "edit"){
this.iseditsix = true
}
}
//确定
ok(){
localStorage.setItem(sessionStorage.getItem("companyId") + "waterroad",this.textcontant)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.dialogRef.close();
}
//取消
cancel(){
this.dialogRef.close();
}
}

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

@ -32,17 +32,23 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("refreshToken",data.refreshToken);
this.http.get('/api/Account/NavMenus').subscribe((data:any)=>{
let isHave = data.find(item=>{ return item.url == "/home"})
let isHave = data.find(item=>{ return item.url == "/statisticanalysis/home"})
let isHaveGis = data.find(item=>{ return item.url == "/gis"})
if (isHave) {
this.router.navigate([`/home`])
} else {
this.router.navigate([`/statisticanalysis/home`])
} else if(isHaveGis){
this.router.navigate([`/gis`])
} else if(data.length != 0){
data.forEach(item => {
if(item.url){
this.router.navigate([`/keyUnit`])
return
}
});
}else{
this.snackBar.open('该用户角色未分配任何菜单', '确定', {
duration: 3000
});
}
})
@ -70,7 +76,7 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("token",data.token);
sessionStorage.setItem("refreshToken",data.refreshToken);
this.token.startUp()
this.router.navigate(['/ui/userdata'])
this.router.navigate(['/keyUnit'])
this.snackBar.open('已自动登录', '确定', {duration: 3000});
})
} //if

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-25 10:19:31
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-21 10:12:20
* @LastEditTime: 2021-01-28 13:41:39
-->
<div class="box">
<div class="boxleft">
@ -97,7 +97,7 @@
</table>
<div class="tbodycss" id="tbodydiv" >
<table cellspacing="0" cellpadding="0" id="table" >
<tr *ngFor="let item of tableDate;let key = index" >
<tr *ngFor="let item of tableDate;let key = index" (click)='tableClick($event,item)'>
<td style="width: 15%;">
<!-- <input type="radio" name="yuan" value={{item.id}} [(ngModel)]="checked" (click)='radioClick(item)'> -->
{{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'?
@ -118,7 +118,7 @@
</div>
<div class="boxright">
<mat-tab-group style="flex: 1;overflow-y: auto;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab-group *ngIf="!wordShow" style="flex: 1;overflow-y: auto;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="基本信息">
<ng-template matTabContent>
@ -172,5 +172,8 @@
</mat-tab> -->
</mat-tab-group>
<div class="word" *ngIf="wordShow">
<iframe [src]='iframeSrc'></iframe>
</div>
</div>
</div>

17
src/app/plan-audit/plan-record/plan-record.component.scss

@ -41,8 +41,9 @@
}
table{
//margin: 20px 20px;
margin-left: 20px;
width: 97%;
margin-left: 10px;
margin-right: 10px;
width: 97.5%;
//border: 1px solid #2196F3;
thead{
@ -64,6 +65,17 @@
width: 55%;
background-color: #FFFFFF;
margin-left: 10px;
.word{
width: 100%;
height: 100%;
//margin: 10px 10px 0 10px;
iframe{
height: 94%;
width: 97%;
margin: 30px 10px 10px 10px;
overflow-y: auto;
}
}
}
}
th,td{
@ -77,6 +89,7 @@ th,td{
//滚动条样式
::-webkit-scrollbar{
margin-right: 3px;
width: 6px;
background-color: white;
}

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

@ -4,12 +4,14 @@
* @Author: sueRimn
* @Date: 2020-12-25 10:19:31
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-21 10:15:50
* @LastEditTime: 2021-01-28 13:40:31
*/
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { HttpClient } from '@angular/common/http'
import { DomSanitizer } from '@angular/platform-browser';
import CryptoJS from 'crypto-js/crypto-js'
@Component({
selector: 'app-plan-record',
@ -18,7 +20,7 @@ import { HttpClient } from '@angular/common/http'
})
export class PlanRecordComponent implements OnInit {
constructor(private http:HttpClient,public snackBar: MatSnackBar) { }
constructor(private http:HttpClient,public snackBar: MatSnackBar,private sanitizer: DomSanitizer) { }
ngOnInit(): void {
let level = sessionStorage.getItem("level");
@ -52,8 +54,13 @@ export class PlanRecordComponent implements OnInit {
]
this.PlanLevel=3
}
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
this.getAlltabledate()
}
wordShow=true
iframeSrc
src=''
selected = new FormControl(0); //选项卡 实例
preparelevels:any
level=''//类型
@ -109,5 +116,40 @@ export class PlanRecordComponent implements OnInit {
}
this.getAlltabledate()
}
//表格点击事件
tableClick(e,item){
//e.target.parentElement.bgColor='#2196F3'
//console.log(e,item)
let filename:string
let fetchUrl
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{
fetchUrl=data.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: item.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
this.src=`http://121.5.10.84/apps/editor/openPreview?data=${base64}`
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
})
}
}

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

@ -54,7 +54,7 @@
</table>
<div class="tbodycss" id="tbodydiv" >
<table cellspacing="0" cellpadding="0" id="table" >
<tr *ngFor="let item of tableDate;let key = index" >
<tr *ngFor="let item of tableDate;let key = index" (click)='radioClick($event,item)'>
<td style="width: 15%;">
<mat-checkbox color="primary" (change)='radioClick($event,item)'></mat-checkbox>
<!-- <input type="checkbox" name="yuan" value={{item.id}} (click)='radioClick($event,item)'> -->
@ -78,7 +78,7 @@
<div class="boxright">
<div class="righthead">
<div class="rightheadone">
<button mat-raised-button color="primary" (click)="buttonChange()"><img src="../../../assets/images/preview.png" style="margin-right: 3px;margin-bottom: 3px;">{{isallDate?'显示变更数据':'显示完整数据'}} </button>
<button mat-raised-button color="primary" (click)="buttonChange()" *ngIf="!wordShow"><img src="../../../assets/images/preview.png" style="margin-right: 3px;margin-bottom: 3px;">{{isallDate?'显示变更数据':'显示完整数据'}} </button>
<button mat-raised-button *ngIf="isallDate" style="background-color: #FFCC00; color: #FFFFFF;" (click)="preview()"><img src="../../../assets/images/change.png" style="margin-bottom: 2px;" > 预览得分</button>
</div>
<div class="rightheadtwo">
@ -87,7 +87,7 @@
</div>
</div>
<mat-tab-group *ngIf="isallDate" style="flex: 1;overflow-y: auto;margin-top: 10px;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab-group *ngIf="isallDate&&wordShow==false" style="flex: 1;overflow-y: auto;margin-top: 10px;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="基本信息">
<ng-template matTabContent>
@ -141,7 +141,7 @@
</mat-tab> -->
</mat-tab-group>
<div id="firefacilities" *ngIf="!isallDate" style="margin: 10px;">
<div id="firefacilities" *ngIf="!isallDate&&wordShow==false" style="margin: 10px;">
<mat-accordion class="tableContent" >
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' class="panelhead" style="background-color: #2196F3;">
@ -240,6 +240,9 @@
</mat-expansion-panel>
</mat-accordion>
</div>
<div class="word">
<iframe [src]='iframeSrc'></iframe>
</div>
</div>
</div>

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

@ -53,8 +53,9 @@
}
table{
//margin: 20px 20px;
margin-left: 20px;
width: 97%;
margin-left:10px;
margin-right: 10px;
width: 97.5%;
//border: 1px solid #2196F3;
thead{
@ -93,6 +94,17 @@
margin-left: 6%;
}
}
.word{
width: 100%;
height: 100%;
//margin: 10px 10px 0 10px;
iframe{
height: 91%;
width: 97%;
margin: 10px 10px 10px 10px;
overflow-y: auto;
}
}
}
}
th,td{

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

@ -4,12 +4,14 @@
* @Author: sueRimn
* @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-23 14:16:10
* @LastEditTime: 2021-01-28 11:30:48
*/
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { HttpClient } from '@angular/common/http'
import CryptoJS from 'crypto-js/crypto-js'
import { DomSanitizer } from '@angular/platform-browser';
declare var echarts: any;
@Component({
@ -19,7 +21,9 @@ declare var echarts: any;
})
export class WaitExamineerComponent implements OnInit {
constructor(private http:HttpClient,public snackBar: MatSnackBar) { }
constructor(private http:HttpClient,public snackBar: MatSnackBar,private sanitizer: DomSanitizer) {
}
ngOnInit(): void {
let level = sessionStorage.getItem("level");
@ -68,12 +72,17 @@ export class WaitExamineerComponent implements OnInit {
}) */
this.getAlltabledate()
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
}
ngOnDestroy () {
/* this.indexbar.clear()
this.indexbar.dispose() */
}
wordShow=true
iframeSrc
src=''
preparelevels:any
selected = new FormControl(0); //选项卡 实例
level=''//操作类型
@ -135,7 +144,38 @@ export class WaitExamineerComponent implements OnInit {
//radio点击事件
radioClick(e,item){
//e.target.parentElement.bgColor='#2196F3'
//console.log(e,item)
console.log(e,item)
let filename:string
let fetchUrl
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{
fetchUrl=data.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: item.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
this.src=`http://121.5.10.84/apps/editor/openPreview?data=${base64}`
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
})
if(e.checked){
this.shenheTable.push(item)
}

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

@ -13,6 +13,7 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import { async } from '@angular/core/testing';
import { Viewer } from 'photo-sphere-viewer';
import {STEPPER_GLOBAL_OPTIONS} from '@angular/cdk/stepper';
import CryptoJS from 'crypto-js/crypto-js'
@Component({
selector: 'app-entry-plan-look',
templateUrl: './entry-plan-look.component.html',
@ -101,7 +102,7 @@ export class EntryPlanLookComponent implements OnInit {
//查看预案
lookPlan(e){
if(e.planMode == 0){
console.log()
console.log(e.attachmentUrls)
if(e.attachmentUrls[0].substr(0,3)=='psw'){
const dialogRef = this.dialog.open(PsViewer, {
width: '1500px',
@ -109,6 +110,39 @@ export class EntryPlanLookComponent implements OnInit {
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'){
let filename:string
let fetchUrl=e.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: e.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
//let base64Date=this.BASE64.encode(stringjson)
//let filedata= CryptoJS.enc.Base64.stringify(json)
console.log(base64)
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
}
}
if(e.planMode == 1){
const config = new MatSnackBarConfig();

2
src/app/plan-management/entry-plan/entry-plan.component.html

@ -104,7 +104,7 @@
</mat-form-field>
</div>
</div>
<div style="width: 100%;text-align: center;">
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>

10
src/app/plan-management/entry-plan/entry-plan.component.scss

@ -6,14 +6,14 @@
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
padding: 5px 25px 0 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
margin: 3px 40px;
margin: 0 40px;
input {
width: 180px;
height: 22px;
@ -22,6 +22,12 @@
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;

153
src/app/plan-management/maintain-up/maintain-up.component.html

@ -0,0 +1,153 @@
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off">
</mat-form-field>
</div>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="unittype">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">统一社会信用代码:</label>
<mat-form-field>
<input matInput placeholder="请输入统一社会信用代码" name="reservePlanType" [(ngModel)]="reservePlanType" autocomplete="off">
<!-- <mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-option value=8>卡片预案</mat-option>
<mat-option value=1>二维预案</mat-option>
<mat-option value=2>三维预案</mat-option>
<mat-option value=4>其他预案</mat-option>
</mat-select> -->
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">维护状态:</label>
<mat-form-field>
<mat-select name="toExamine" [(ngModel)]="toExamine" placeholder='请选择审核状态'>
<mat-option value="8">未提交审核</mat-option>
<mat-option value="1">审核中</mat-option>
<mat-option value="2">审核通过</mat-option>
<mat-option value="4">审核退回</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">添加时间:</label>
<mat-form-field class="example-full-width">
<input type="date" matInput name="addtime" autocomplete="off" [(ngModel)]="addtime">
</mat-form-field>
🠊
<mat-form-field class="example-full-width">
<input type="date" matInput name="endtime" autocomplete="off" [(ngModel)]="endtime">
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">信息完整度排序:</label>
<mat-form-field>
<mat-select placeholder='请选择排序方式' [(ngModel)]="integritySort" name="integritySort">
<mat-option value="desc">从高到低</mat-option>
<mat-option value="asc">从低到高</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" >重置</button>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="newadd">
<div>
<button mat-raised-button color="primary" color="warn">删除</button>
</div>
</div>
<div class="body">
<div class="tablebox">
<table mat-table class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.company.name}}</td>
</ng-container>
<ng-container matColumnDef="integrity">
<th mat-header-cell *matHeaderCellDef style="text-align: center;">信息完整度</th>
</ng-container>
<ng-container matColumnDef="jurisdictionsquadron">
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
</ng-container>
<ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>统一社会信用代码</th>
</ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>录入时间</th>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
>
</mat-paginator>
</div>
</div>
</div>

256
src/app/plan-management/maintain-up/maintain-up.component.scss

@ -0,0 +1,256 @@
.header {
width: 100%;
padding: 12px 10px;
// margin-bottom: 10px;
box-sizing: border-box;
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px 0 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
margin: 0 40px;
input {
width: 180px;
height: 22px;
line-height: 22px;
border-radius: 3px;}
}
} //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;
background-color: #fafafa;
li{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: #fafafa;
}
mat-tree-node{
cursor: pointer;
white-space:pre;
background-color: #fafafa;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
li{
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);
}
}
}
}
.newadd{
margin-top: 12px;
margin-left: 70px;
display: flex;
button{
font-size: 16px;
width: 100px;
height: 36px;
}
}
.body{
.buttonbox{
padding-left: 50px;
button{
margin:0 10px
}
}
.tablebox{
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
}
mat-paginator{
width: 100%;
margin-left: 0%;
}
.mat-column-unitname{
width: 15%;
}
.mat-column-integrity{
width: 13%;
}
.mat-column-operation{
width: 5%;
}
.mat-column-jurisdictionsquadron{
width: 10%;
}
}
}
.mat-header-cell{
text-align: center;
}
.mat-cell{
text-align: center;
span{
// color:red;
// margin: 0 3px;
cursor: pointer;
}
span:hover{
text-decoration:underline
}
.grey{
color: grey;
pointer-events: none;
}
}
//完整度
.integrityDiv{
width: 70%;
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;
}
.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;
}
}
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;
}
.topposition{
top: -252px;
left: 188px;
}
}
.integrityDiv:hover{
.integrityDetails{
display: block;
}
}

25
src/app/plan-management/maintain-up/maintain-up.component.spec.ts

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

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

@ -0,0 +1,184 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-01-28 14:13:20
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-28 14:53:18
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
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 { 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 { ConstantPool } from '@angular/compiler';
@Component({
selector: 'app-maintain-up',
templateUrl: './maintain-up.component.html',
styleUrls: ['./maintain-up.component.scss']
})
export class MaintainUpComponent implements OnInit {
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getunitdata();
this.getOrganizations();
this.getUnittype();
let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队
this.preparelevels = [
{name:"总队",value:"1"},
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "1"){//如果是支队
this.preparelevels = [
{name:"支队",value:"2"},
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "2"){//如果是大队
this.preparelevels = [
{name:"大队",value:"4"},
{name:"中队",value:"8"}
]
}
if(level == "3"){//如果是中队
this.preparelevels = [
{name:"中队",value:"8"}
]
}
}
private _transformer = (node, level: number) => { //初始化tree
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
id: node.id,
parentId: node.parentId,
children: node.children
};
}
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页
organizationName:any //当前单位组织机构名称
preparelevels:any
integritySort:any //完整度排序
haveyuan//有无预案
companyName:any //单位名称
js:any //所选组织机构
jsId:any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框
unittype:any //单位类型
reservePlanType:any //预案类型
toExamine:any //审核状态
preparelevel:any //编制级别
plcheck:boolean //编制级别勾选框
//得到当前单位信息
getunitdata(){
this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{
this.organizationName = data.organizationName
}
)
}
treedata:any //组织机构树型数据
newArr:any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据
getpresentOrganization(){
this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => {
item.children = []
this.newallorganizations.forEach(element => {
if(element.parentId == item.id){
item.children.push(element)
}
});
});
this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{
this.organizationName = data.organizationName
if(this.organizationName){
this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){
this.dataSource.data = [item]
}
});
}else{
this.dataSource.data = this.tree.toTree(this.treedata);
}
}
)
}
//获得所有组织机构
getOrganizations(){
this.http.get('/api/Organizations').subscribe(
(data:any)=>{
this.allorganizations = data
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
}
)
}
//获得所有单位类型
getUnittype(){
this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{
this.allunittype = data
}
)
}
//辖区中队div是否显示
isorganizationbox:boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量
add(node) {
this.isorganizationbox = false
this.js = node.name
this.jsId = node.id
}
//打开辖区中队隐藏框
openorganizationbox() {
this.isorganizationbox = true
}
//关闭出现的组织机构div
closediv(){
this.isorganizationbox = false
}
displayedColumns: string[] = ['unitname','integrity','jurisdictionsquadron', 'unittype','plantype', 'time','passstate','operation'];
allunittype:any //所有单位类型
allorganizations:any //所有组织机构
addtime
endtime
}

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

@ -39,12 +39,13 @@
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<!-- <mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-option value="8">卡片预案</mat-option>
<mat-option value="1">二维预案</mat-option>
<mat-option value="2">三维预案</mat-option>
<mat-option value="4">其他预案</mat-option>
</mat-select>
</mat-select> -->
<input matInput placeholder="请输入预案类型" name="reservePlanType" autocomplete="off" [(ngModel)]="typePlan">
</mat-form-field>
</div>
<div class="queryField">
@ -73,7 +74,7 @@
</div>
</div>
<div style="width: 100%;text-align: center;">
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
@ -115,7 +116,7 @@
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType=='1'?'二维预案':element.planType=='2'?'三维预案':element.planType=='4'?'其他预案':'卡片预案'}}</td>
<td mat-cell *matCellDef="let element">{{element.disasterType}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">审核状态</th>
@ -133,7 +134,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;">查看预案</span>
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 || element.auditStatus == 4" >提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span>

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

@ -6,7 +6,7 @@
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
padding: 5px 25px 0 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
@ -22,6 +22,12 @@
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;
@ -72,7 +78,7 @@
}
}
.newadd{
margin-top: 10px;
margin-top: 12px;
margin-left: 70px;
display: flex;
button{
@ -92,7 +98,7 @@
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
margin-top:12px;
th,td{
text-align: center;
font-size: 15px;

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

@ -9,6 +9,10 @@ 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 CryptoJS from 'crypto-js/crypto-js'
//import Base64 from 'crypto-js/enc-base64';
@Component({
selector: 'app-meet-plan',
@ -54,6 +58,7 @@ export class MeetPlanComponent implements OnInit {
plcheck:boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
tabledataSource
typePlan//新预案类型
unitname//预案名称
level//预案级别
addname//添加人
@ -84,7 +89,8 @@ export class MeetPlanComponent implements OnInit {
let paramsdata:any = {
Name:this.unitname||'',
planCategories:this.level||[6,7],
PlanType:reservePlanType||'',
//PlanType:reservePlanType||'',
DisasterType:this.typePlan||'',
CreatorName:this.addname||'',
AuditStatus:this.unitstate|| '',
CreationTimeRangeStart:this.addtime||'',
@ -159,6 +165,37 @@ export class MeetPlanComponent implements OnInit {
})
}
//查看预案
openPlan(element){
let filename:string
let fetchUrl = element.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: element.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
}
//下载↓
selectDownloadFile:any; //选择下载的文件
download:any; //下载文件元数据
@ -259,6 +296,7 @@ export class MeetPlanComponent implements OnInit {
//重置
reset(){
this.typePlan=''
this.unitname=''
this.level=''
this.addname=''
@ -369,7 +407,7 @@ export class newunitMeet{
let body:any = {
Name:this.unitname||'',
PlanCategory:Number(this.level)||'',
PlanType: Number(this.reservePlanType),
disasterType: this.reservePlanType,
PlanLevel:PlanLevel,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
@ -461,7 +499,7 @@ export class newunitMeet{
let body:any = {
Name:this.unitname||'',
PlanCategory:Number(this.level)||'',
PlanType: Number(this.reservePlanType),
disasterType: this.reservePlanType,
PlanLevel:PlanLevel,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-13 15:43:05
* @LastEditTime: 2021-01-27 15:00:57
-->
<div class="box">
<div class="top">
@ -19,12 +19,7 @@
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" autocomplete="off" placeholder='请选择预案类型' required>
<mat-option value='8'>卡片预案</mat-option>
<mat-option value='1'>二维预案</mat-option>
<mat-option value='2'>三维预案</mat-option>
<mat-option value='4'>其他预案</mat-option>
</mat-select>
<input matInput placeholder="请输入预案类型" name="companyType" autocomplete="off" [(ngModel)]="reservePlanType" required>
</mat-form-field>
</div>
<div class="queryField">

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 16:26:16
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-13 15:17:47
* @LastEditTime: 2021-01-27 15:17:26
-->
<div class="box">
<div class="top">
@ -19,12 +19,7 @@
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" autocomplete="off" placeholder='请选择预案类型' required>
<mat-option value='8'>卡片预案</mat-option>
<mat-option value='1'>二维预案</mat-option>
<mat-option value='2'>三维预案</mat-option>
<mat-option value='4'>其他预案</mat-option>
</mat-select>
<input matInput placeholder="请输入预案类型" name="companyType" autocomplete="off" [(ngModel)]="reservePlanType" required>
</mat-form-field>
</div>

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-21 15:02:25
* @LastEditTime: 2021-01-27 16:55:08
-->
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
@ -39,12 +39,13 @@
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<!-- <mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型' [multiple]="true">
<mat-option value="8">卡片预案</mat-option>
<mat-option value="1">二维预案</mat-option>
<mat-option value="2">三维预案</mat-option>
<mat-option value="4">其他预案</mat-option>
</mat-select>
</mat-select> -->
<input matInput placeholder="请输入预案类型" name="reservePlanType" autocomplete="off" [(ngModel)]="typePlan">
</mat-form-field>
</div>
<div class="queryField">
@ -73,7 +74,7 @@
</div>
</div>
<div style="width: 100%;text-align: center;">
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
@ -115,7 +116,7 @@
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType=='1'?'二维预案':element.planType=='2'?'三维预案':element.planType=='4'?'其他预案':'卡片预案'}}</td>
<td mat-cell *matCellDef="let element">{{element.disasterType}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef style="width: 10%;">审核状态</th>
@ -133,7 +134,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;">查看预案</span>
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 " >提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span>

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

@ -6,14 +6,14 @@
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
padding: 5px 25px 0 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items:center;
// justify-content:center;
.queryField {
margin: 3px 40px;
margin: 0 40px;
input {
width: 180px;
height: 22px;
@ -22,6 +22,12 @@
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;
@ -72,7 +78,7 @@
}
}
.newadd{
margin-top: 10px;
margin-top: 12px;
margin-left: 70px;
display: flex;
button{
@ -92,7 +98,7 @@
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
margin-top:12px;
th,td{
text-align: center;
font-size: 15px;

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 14:15:10
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-22 09:17:40
* @LastEditTime: 2021-01-28 14:07:24
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -20,6 +20,7 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { ConstantPool } from '@angular/compiler';
import { MatTableDataSource } from '@angular/material/table';
import CryptoJS from 'crypto-js/crypto-js'
@Component({
@ -76,6 +77,7 @@ export class OnetwoEntryPlanComponent implements OnInit {
reservePlanType//预案类型
unitstate//审核状态
projectlevel//编制级别
typePlan//新预案类型
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
@ -95,7 +97,8 @@ export class OnetwoEntryPlanComponent implements OnInit {
let paramsdata:any = {
Name:this.unitname||'',
planCategories:this.url=='2'?2:1,
PlanType:reservePlanType||'',
//PlanType:reservePlanType||'',
DisasterType:this.typePlan||'',
CreatorName:this.addname||'',
AuditStatus:this.unitstate|| '',
CreationTimeRangeStart:this.addtime||'',
@ -119,6 +122,7 @@ export class OnetwoEntryPlanComponent implements OnInit {
//重置
reset(){
this.typePlan=''
this.unitname=''
this.level=''
this.addname=''
@ -184,12 +188,46 @@ export class OnetwoEntryPlanComponent implements OnInit {
this.getAlltabledate()
})
}
//查看预案
openPlan(element){
let filename:string
let fetchUrl=element.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: element.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
//let base64Date=this.BASE64.encode(stringjson)
//let filedata= CryptoJS.enc.Base64.stringify(json)
console.log(base64)
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
}
//新增预案弹窗
addunit(){
const dialogRef = this.dialog.open(newunitComponent, {
width: '340px',
height:'400px',
height:'410px',
disableClose:true
//data: paperDataInfo
});
@ -393,7 +431,7 @@ export class newunitComponent{
let body:any = {
Name:this.unitname||'',
PlanCategory:this.url=='2'?2:1,
PlanType: Number(this.reservePlanType),
disasterType: this.reservePlanType,
PlanLevel:PlanLevel,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]
@ -484,7 +522,7 @@ export class newunitComponent{
let body:any = {
Name:this.unitname||'',
PlanCategory:this.url=='2'?2:1,
PlanType: Number(this.reservePlanType),
disasterType: this.reservePlanType,
PlanLevel:PlanLevel,
PlanMode:1,
attachmentUrls:[`${this.objectName}`]

2
src/app/plan-management/pass-plan/pass-plan.component.html

@ -85,7 +85,7 @@
</div>
</div>
<div style="width: 100%;text-align: center;">
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>

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

@ -4,7 +4,7 @@
box-sizing: border-box;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
padding: 5px 25px 0 25px;
// margin-left: 50px;
display: flex;
flex-direction: row;
@ -12,7 +12,7 @@
align-items:center;
// justify-content:center;
.queryField {
margin: 3px 40px;
margin: 0 40px;
input {
width: 180px;
height: 22px;
@ -21,6 +21,12 @@
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;
.organizationbox{

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

@ -9,6 +9,7 @@ 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 CryptoJS from 'crypto-js/crypto-js'
@Component({
selector: 'app-pass-plan',
templateUrl: './pass-plan.component.html',
@ -292,9 +293,44 @@ export class PassPlanComponent implements OnInit {
}
//跳转查看预案页面 审核通过预案
routerTo(element){
if(element.attachmentUrls[0].substr(element.attachmentUrls[0].length-4,element.attachmentUrls[0].length-1)=='docx'||element.attachmentUrls[0].substr(element.attachmentUrls[0].length-3,element.attachmentUrls[0].length)=='pdf'
||element.attachmentUrls[0].substr(element.attachmentUrls[0].length-3,element.attachmentUrls[0].length)=='doc'||element.attachmentUrls[0].substr(element.attachmentUrls[0].length-3,element.attachmentUrls[0].length)=='DOC'
||element.attachmentUrls[0].substr(element.attachmentUrls[0].length-3,element.attachmentUrls[0].length)=='txt'){
let filename:string
let fetchUrl=element.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: element.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
//let base64Date=this.BASE64.encode(stringjson)
//let filedata= CryptoJS.enc.Base64.stringify(json)
console.log(base64)
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
}else{
sessionStorage.setItem("companyName",element.companyName)
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=1`);
}
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1

5
src/app/plan-management/plan-management-routing.module.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-06 09:57:07
* @LastEditTime: 2021-01-28 14:17:50
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
@ -16,6 +16,8 @@ import { WebLookComponent } from './web-look/web-look.component';
import {OnetwoEntryPlanComponent} from './onetwo-entry-plan/onetwo-entry-plan.component';
import { MeetPlanComponent } from './meet-plan/meet-plan.component';
import { TypePlanComponent } from './type-plan/type-plan.component'
import { MaintainUpComponent } from './maintain-up/maintain-up.component'
import { from } from 'rxjs';
const routes: Routes = [
{ path: 'entryPlan', component: EntryPlanComponent},
@ -28,6 +30,7 @@ const routes: Routes = [
{ path: 'OnetwoEntryPlan2', component: OnetwoEntryPlanComponent},//二级预案录入
{ path: 'MeetPlan',component:MeetPlanComponent},//应急预案
{ path: 'typePlan',component:TypePlanComponent},//类型预案
{ path: 'maintainup',component:MaintainUpComponent},//维护更新
];
@NgModule({

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

@ -59,13 +59,14 @@ import { newunitType }from './type-plan/type-plan.component';
import { PsViewer } from './entry-plan-look/entry-plan-look.component'
import { onetwoAuditResult } from './onetwo-entry-plan/onetwo-entry-plan.component';
import { meetAuditResult }from './meet-plan/meet-plan.component';
import { typeAuditResult } from './type-plan/type-plan.component'
import { typeAuditResult } from './type-plan/type-plan.component';
import { MaintainUpComponent } from './maintain-up/maintain-up.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],
WebLookComponent, OnetwoEntryPlanComponent,newunitComponent, MeetPlanComponent,newunitMeet, TypePlanComponent,newunitType,PsViewer,onetwoAuditResult,meetAuditResult,typeAuditResult, MaintainUpComponent],
imports: [
CommonModule,
PlanManagementRoutingModule,

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

@ -53,7 +53,7 @@
</div>
</div>
<div style="width: 100%;text-align: center;">
<div class="butclass" style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
@ -111,7 +111,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef style="width: 20%;">操作</th>
<td mat-cell *matCellDef="let element" style="white-space: nowrap;cursor: pointer;">
<span style="color: blue;">查看预案</span>
<span style="color: blue;" (click)='openPlan(element)'>查看预案</span>
<span style="color: blue;margin-left: 4px;" (click)="submitAudit(element)" *ngIf="element.auditStatus == 8 " >提交审核</span>
<span style="color: blue;margin-left: 4px;" (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span>

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

@ -6,7 +6,7 @@
// border-bottom: 1px solid black;
.queryBox {
box-sizing: border-box;
padding: 5px 25px;
padding: 5px 25px 0 25px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
@ -22,6 +22,12 @@
}
} //queryBox
.butclass{
button{
width: 80px;height: 36px;
font-size: 16px;
}
}
.ordiv{
position: relative;
@ -72,7 +78,7 @@
}
}
.newadd{
margin-top: 10px;
margin-top: 12px;
margin-left: 70px;
display: flex;
button{
@ -92,7 +98,7 @@
table{
width: 100%;
margin-left: 0%;
margin-top:15px;
margin-top:12px;
th,td{
text-align: center;
font-size: 15px;

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

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-01-06 09:47:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-01-23 09:45:17
* @LastEditTime: 2021-01-27 15:49:53
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'
@ -17,6 +17,7 @@ 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 CryptoJS from 'crypto-js/crypto-js'
@Component({
selector: 'app-type-plan',
@ -170,6 +171,40 @@ export class TypePlanComponent implements OnInit {
this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`,"").subscribe(data=>{
this.getAlltabledate()
})
}
//查看预案
openPlan(element){
let filename:string
let fetchUrl=element.attachmentUrls[0]
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
filename=data.fileName
let json={
doc: {
docId: element.id,
title: filename,
//title: filename,
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
},
user: {
uid: "test",
nickName: "test",
avatar: "",
privilege: [
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
],
},
}
var stringjson=JSON.stringify(json)
var wordArray = CryptoJS.enc.Utf8.parse(stringjson);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
//let base64Date=this.BASE64.encode(stringjson)
//let filedata= CryptoJS.enc.Base64.stringify(json)
console.log(base64)
window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
})
}
//新增预案弹窗
addunit(){

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

@ -1,4 +1,4 @@
import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContainerRef } from '@angular/core';
import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContainerRef, NgZone } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -27,7 +27,7 @@ export class CollectionToolsPlanComponent implements OnInit {
@ViewChild('canvas',{static: true}) canvas:WorkingAreaComponent; //父组件中获得子组件的引用
constructor(private maskLayerService:MaskLayerService,private tabbarService: TabbarAndScoreService,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { }
constructor(public _ngZone:NgZone,private maskLayerService:MaskLayerService,private tabbarService: TabbarAndScoreService,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { }
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
// tree配置
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
@ -627,7 +627,6 @@ export class CollectionToolsPlanComponent implements OnInit {
firstMultipleAssetData:any//当前多选的第一个素材
ngOnInit(): void {
let _this = this
AxMessageSystem.addListener('selectionChanged', ()=>{
if(this.canvas.selection.size() == 1){//如果是单选
this.isMultipleAsset = false
@ -771,8 +770,8 @@ export class CollectionToolsPlanComponent implements OnInit {
//多选状态动态属性素材input框值改变
multipleAssetInputChange(i,e){
e.stopPropagation()
setTimeout(() => {
this.multipleAssetData.forEach(item=>{
// console.log(item)
item.assetData.PropertyInfos.forEach(element => {
if(element.PropertyName == i.PropertyName){
element.PropertyValue = i.PropertyValue
@ -781,6 +780,7 @@ export class CollectionToolsPlanComponent implements OnInit {
}
})
})
}, 0);
}
//多选状态动态属性素材radio框值改变
multipleAssetRadioChange(i,value){
@ -800,7 +800,6 @@ export class CollectionToolsPlanComponent implements OnInit {
multipleSupplyArea(i,e){
e.stopPropagation()
this.multipleAssetData.forEach(item=>{
// console.log(item)
item.assetData.PropertyInfos.forEach(element => {
if(element.PropertyName == i.PropertyName){
element.PropertyValue = i.PropertyValue

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

@ -822,7 +822,14 @@ export class CollectionToolsComponent implements OnInit {
copyAssetData:any //存储用于复制的素材
//复制素材
copyAsset(){
if(this.canvas.selection.allowEdit()){//如果当前选中素材可以编辑
this.canvas.copy()
}else{
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('当前选中素材不可复制','确定',config);
}
}
//粘贴素材
pasteAsset(){

100
src/app/working-area/model/axGrid.ts

@ -8,10 +8,6 @@ const DEFAULT_LINE_STYLE = {
native: true,
};
/**
* @description
* @extends PIXI.Graphics
*/
export class AxGrid extends PIXI.Graphics {
private _cellSize: number;
private _correctedWidth: number;
@ -19,47 +15,31 @@ export class AxGrid extends PIXI.Graphics {
private _useCorrectedWidth: boolean;
private _drawBoundaries: any;
private _amtLines: any;
/**
* @param {number} cellSize 默认值:网格边长的平方根
*/
set cellSize(cellSize) {
this._cellSize = cellSize || Math.sqrt(this._correctedWidth);
}
get cellSize() {
return this._cellSize;
}
/**
* 线
*/
get amtLines() {
return Math.floor(this.gridWidth / this.cellSize);
}
/**
* ' width '
*/
get originalWidth() {
return this._gridWidth;
}
/**
*
*
*
*/
get correctedWidth() {
return this._correctedWidth;
}
get useCorrectedWidth() {
return this._useCorrectedWidth;
}
/**
*
* @returns {{ x1: number, y1: number, x2: number, y2: number}}
* (**x1**)(**y1**)(**x2**)(**y2**)
*/
get bounds() {
return {
@ -78,50 +58,11 @@ export class AxGrid extends PIXI.Graphics {
return this._drawBoundaries;
}
/**
*
* ' cellSize '
* ' width '
*/
get gridWidth() {
if (!this.useCorrectedWidth) { return this._gridWidth; }
return Math.abs(this.cellSize - Math.sqrt(this._correctedWidth)) <= 1e-6 ? this._correctedWidth : this._gridWidth;
}
/**
*
* @param {number} width number. Required.
*
* The target sidelength of the grid. It is best for `width` to be a perfect square (i.e., 2, 4, 9, 16, 25, etc.). If
* not and the parameter `useCorrectedWidth` is set to **false**, then the grid will use a corrected width,
* which is the smallest perfect square greater than `width`.
*
* @param {number} cellSize number, null. Optional, default: square root of corrected width
*
* The size of each cell in the grid.
* If the value is **null**, the grid will use the default value.
*
* @param {{ width: number, color: number, alpha: number, alignment: number, native: boolean }}. Object. Optional.
*
* default:
* **{
* width: 1,
* color: 0xffffff,
* alpha: 1,
* alignment: 0.5,
* native: true
* }**
*
* Configuration for the line style on the object. See documentation on `PIXI.Graphics` for more on the `LineStyle` class.
*
* @param {boolean} useCorrectedWidth boolean. Optional. default: **true**
* If **true**, the grid will use the smallest perfect square greater than `width`.
* Otherwise, the grid will use the exact value given by `width`.
*
* @param {boolean} drawBoundaries boolean. Optional. default: **true**
* If **true**, the grid will draw its boundaries.
* Otherwise, the grid will not draw its boundaries. Mouse pointer detection is not affected.
*/
constructor(
width,
cellSize= null,
@ -151,12 +92,9 @@ export class AxGrid extends PIXI.Graphics {
lConfig.alignment,
lConfig.native
);
// handle mouse move
this.interactive = true;
this.on('mousemove', (evt) => {
const mouseCoords = evt.data.getLocalPosition(evt.currentTarget.parent);
// 检查鼠标是否在此网格的范围内。如果不是,那就什么都不做。
if (
mouseCoords.x >= this.bounds.x1 &&
mouseCoords.x <= this.bounds.x2 &&
@ -192,11 +130,6 @@ export class AxGrid extends PIXI.Graphics {
/**
*
*
* @param {boolean} retainLineStyle true
*
* **true**线
* ' PIXI '
*/
clearGrid(retainLineStyle = true) {
const { width, alignment, color, alpha, native } = this.line;
@ -207,14 +140,10 @@ export class AxGrid extends PIXI.Graphics {
return this;
}
/**
* Transforms global coordinates to grid coordinates.
* @param {number} x
* The global X coordinate.
*
* @param {number} y
* The global Y coordinate.
*
* @param x x
* @param y y
*/
getCellCoordinates(x, y) {
return {
@ -222,22 +151,15 @@ export class AxGrid extends PIXI.Graphics {
y: Math.floor((y - this.bounds.y1) / this.cellSize),
};
}
/**
* mousemove事件后触发的回调
*
* @param {PIXI.InteractionData} evt
* 'PIXI.InteractionData '
*
* @param {{x: number, y: number}} gridCoords
*
*
* @param evt
* @param gridCoords
*/
onMousemove(evt, gridCoords) {
}
// 计算修正后的宽度。如果`useCorrectedWidth`构造函数参数设置为**false**,
// 然后,它简单地保持“width”的给定值作为修正后的宽度。
// 默认宽度
_correctWidth() {
if (!this._useCorrectedWidth) {
this._correctedWidth = this._gridWidth;
@ -245,9 +167,7 @@ export class AxGrid extends PIXI.Graphics {
this._correctedWidth = Math.ceil(Math.sqrt(this._gridWidth)) ** 2;
}
// 计算修正后的宽度。如果`useCorrectedWidth`构造函数参数设置为**false**,
// 然后,它简单地保持“width”的给定值作为修正后的宽度。
// 自定义宽度
correctWidth(width: number) {
if (!this._useCorrectedWidth) {
this._correctedWidth = width;

13
src/app/working-area/model/axSelection.ts

@ -1,3 +1,5 @@
import { allowedNodeEnvironmentFlags } from "process";
/**
*
*/
@ -17,6 +19,17 @@ export class AxSelection {
public has(obj: any): boolean {
return this.objects.has(obj);
}
// 是否所有选择对象都允许编辑
public allowEdit(): boolean {
let allowEdit = true;
for (const item of this.objects) {
if (!item.allowEdit) {
allowEdit = false;
break;
}
}
return allowEdit;
}
// 获得所有对象
public all() {
return [...this.objects];

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

@ -10,10 +10,8 @@ export class AxShape extends Graphics {
assetData: any;
pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png');
workingArea: WorkingAreaComponent;
// 可以被移动的
moveable = true;
// 可以被选中的
selectable = true;
// 允许选择
allowSelect = true;
// 允许编辑
allowEdit = true;
// 是否显示名称
@ -38,10 +36,10 @@ export class AxShape extends Graphics {
this
.on('pointerdown', event => {
event.stopPropagation();
if (this.selectable) {
if (this.allowSelect) {
this.workingArea.select(this);
}
if (this.moveable) {
if (this.allowEdit) {
this.mouseDragging = true;
this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y);
}

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

@ -490,21 +490,26 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
switch (floorData[key].InteractiveMode) {
case 0:
const singleIcon = new AxImageShape(floorData[key], this);
singleIcon.moveable = this.allowEdit && this.canvasData.gameMode === singleIcon.assetData.GameMode;
singleIcon.allowEdit = this.allowEdit && this.canvasData.gameMode === singleIcon.assetData.GameMode;
break;
case 1:
const icon = new MultipointIcon(floorData[key], this);
icon.allowEdit = this.allowEdit && this.canvasData.gameMode === icon.assetData.GameMode;
break;
case 2:
const polygonIcon = new PolygonIcon(floorData[key], this);
polygonIcon.allowEdit = this.allowEdit && this.canvasData.gameMode === polygonIcon.assetData.GameMode;
break;
case 3:
if (floorData[key].Name === '水带') {
const distance = new AxArrowConnector(floorData[key], this, false, true);
const waterLine = new AxArrowConnector(floorData[key], this, false, true);
waterLine.allowEdit = this.allowEdit && this.canvasData.gameMode === waterLine.assetData.GameMode;
} else if (floorData[key].Name === '距离') {
const distance = new AxArrowConnector(floorData[key], this, true, true);
distance.allowEdit = this.allowEdit && this.canvasData.gameMode === distance.assetData.GameMode;
} else if (floorData[key].Name === '普通墙' || floorData[key].Name === '承重墙') {
const wall = new AxArrowConnector(floorData[key], this, false, false);
wall.allowEdit = this.allowEdit && this.canvasData.gameMode === wall.assetData.GameMode;
}
break;
}
@ -522,22 +527,24 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
switch (nodeData[key][tempKey].InteractiveMode) {
case 0:
const singleIcon = new AxImageShape(nodeData[key][tempKey], this);
singleIcon.moveable = this.allowEdit && this.canvasData.gameMode === singleIcon.assetData.GameMode;
singleIcon.allowEdit = this.allowEdit && this.canvasData.gameMode === singleIcon.assetData.GameMode;
break;
case 1:
const icon = new MultipointIcon(nodeData[key][tempKey], this);
icon.allowEdit = this.allowEdit && this.canvasData.gameMode === icon.assetData.GameMode;
break;
case 2:
const polygonIcon = new PolygonIcon(nodeData[key][tempKey], this);
polygonIcon.allowEdit = this.allowEdit && this.canvasData.gameMode === polygonIcon.assetData.GameMode;
break;
case 3:
const pipeline = new AxArrowConnector(nodeData[key][tempKey], this, false, true);
pipeline.allowEdit = this.allowEdit && this.canvasData.gameMode === pipeline.assetData.GameMode;
break;
}
});
});
}
// this.emit('backgroundScale', this.backgroundImage.scale.x);
}
/**
*

BIN
src/assets/font/SourceHanSansCN-Regular.otf

Binary file not shown.

2
src/main.ts

@ -3,7 +3,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
import 'default-passive-events'
if (environment.production) {
enableProdMode();
}

12
src/styles.scss

@ -1,12 +1,22 @@
@import './app/theme.scss';
@import "./app/ngZorroTree.css"; /* 引入组件样式 */
@font-face
{
font-family: Regular;
src: url('./assets/font/SourceHanSansCN-Regular.otf'),
}
html,body{
width: 100%;
height:100%;
margin:0 auto;
padding:0;
overflow: hidden;
font-family: Regular;
textarea{
font-family: Regular
}
}
ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas{
margin:0;
@ -112,7 +122,7 @@ table td.mat-footer-cell:last-of-type{
border-radius: 4px;
margin: 0 5px;
font-size: 14px;
font-family: Source Han Sans CN;
// font-family: Source Han Sans CN;
font-weight: 400;
line-height: 36px;
color: #0080FF;

Loading…
Cancel
Save