diff --git a/.gitignore b/.gitignore index 86d943a..a80a6b3 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ testem.log # System Files .DS_Store Thumbs.db +debug.log diff --git a/debug.log b/debug.log deleted file mode 100644 index c4638ef..0000000 --- a/debug.log +++ /dev/null @@ -1,3 +0,0 @@ -[1229/141605.754:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) -[0104/100053.968:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) -[0122/085819.900:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index 753ce9a..56daf18 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import {ReplaySubject} from 'rxjs'; import { Observable } from 'rxjs'; import { GameMode } from './working-area/model/gameMode'; + @Injectable({ providedIn: 'root' }) @@ -10,33 +11,30 @@ export class CanvasShareDataService { private _sendMessage: ReplaySubject = new ReplaySubject(1); examDisposalNodesData; // 鑰冪敓杩涘叆鏃惰幏鍙栧綋鍓嶈瘯鍗风殑澶勭疆鑺傜偣 - examFacilityAssetsData; // 鑰冪敓杩涘叆鏃惰幏鍙栧綋鍓嶈瘯鍗疯鑰冨療鐨勬秷闃茶鏂 + examFacilityAssetsData; // 鑰冪敓杩涘叆鏃惰幏鍙栧綋鍓嶈瘯鍗疯鑰冨療鐨勬秷闃茶鏂 + examOriginaleveryStoreyData: any; // 鑰冪敓绛斿嵎 鎬诲钩闈㈠浘/妤煎眰/鍖哄煙 妤煎眰鏁版嵁 + hiddenBasicInfoFacilities: any = []; // 鑰冪敓绛斿嵎 褰撳墠妤煎眰闇瑕侀殣钘忕殑鍩烘湰淇℃伅绱犳潗 + - isChange = false; // 鏁版嵁 鏄惁鏀瑰姩 - selectTemplateData: any; // 閫夋嫨褰撳墠 妯℃澘鏁版嵁 + isChange:boolean = false; // 鏁版嵁 鏄惁鏀瑰姩 + + selectTemplateData:any; // 閫夋嫨褰撳墠 妯℃澘鏁版嵁 // 鎬诲钩闈㈠浘/寤虹瓚 妤煎眰 selectStorey: any = {area: '', details: ''}; // 閫夋嫨褰撳墠 妤煎眰 鏁版嵁 - originalcompanyBuildingData: any; // 鍗曚綅/寤虹瓚 鏁版嵁 - originaleveryStoreyData: any; // 鎬诲钩闈㈠浘/妤煎眰/鍖哄煙 妤煎眰鏁版嵁 - - - examOriginaleveryStoreyData: any; // 鑰冪敓绛斿嵎 鎬诲钩闈㈠浘/妤煎眰/鍖哄煙 妤煎眰鏁版嵁 - - hiddenBasicInfoFacilities: any = []; // 鑰冪敓绛斿嵎 褰撳墠妤煎眰闇瑕侀殣钘忕殑鍩烘湰淇℃伅绱犳潗 // 鎬诲钩闈㈠浘/寤虹瓚 妤煎眰 // 澶勭疆 鑺傜偣 allDisposalNode: any = []; // 鎵鏈 澶勭疆鑺傜偣 allNodeMarkers: any; // 鐏炬儏 鏍囩淇℃伅 - - selectPanelPoint: DisposalNodeData = new DisposalNodeData(); - - selectPanelPointBaseData: any = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}; // 褰撳墠 鏁版嵁鑺傜偣 鎵瀵瑰簲鐨 澶╂皵,璇︽儏 鏁版嵁鑺傜偣 + selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 褰撳墠鏁版嵁鑺傜偣 + selectPanelPointBaseData: any = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}; // 褰撳墠 鏁版嵁鑺傜偣 瀵瑰簲 鐖剁骇鑺傜偣 + customizeDisposalNode:any; // 鏂板缓 鑷畾涔夋暟鎹妭鐐 搴曞浘+鍚嶇О // 澶勭疆 鑺傜偣 + /** * 娓告垙妯″紡 */ diff --git a/src/app/data-collection/data-collection.module.ts b/src/app/data-collection/data-collection.module.ts index ad38bdf..50060c8 100644 --- a/src/app/data-collection/data-collection.module.ts +++ b/src/app/data-collection/data-collection.module.ts @@ -45,11 +45,11 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { DataCollectionRoutingModule } from './data-collection.routing'; import { AddWater, WaterCollectionComponent } from './water-collection/water-collection.component'; import { AddFireForce, FireForceComponent, ViewDetails } from './fire-force/fire-force.component'; -import { LinkageForcesComponent } from './linkage-forces/linkage-forces.component'; +import { AddLinkageForce, LinkageForcesComponent, ViewDetails2 } from './linkage-forces/linkage-forces.component'; import { NzTreeModule } from 'ng-zorro-antd/tree'; @NgModule({ - declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails], + declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails,AddLinkageForce,ViewDetails2], imports: [ CommonModule, A11yModule, diff --git a/src/app/data-collection/fire-force/fire-force.component.html b/src/app/data-collection/fire-force/fire-force.component.html index 94191c0..90520a6 100644 --- a/src/app/data-collection/fire-force/fire-force.component.html +++ b/src/app/data-collection/fire-force/fire-force.component.html @@ -94,7 +94,7 @@
- {{item.name}} + {{item.name}}
diff --git a/src/app/data-collection/fire-force/fire-force.component.ts b/src/app/data-collection/fire-force/fire-force.component.ts index 5784fa2..9764080 100644 --- a/src/app/data-collection/fire-force/fire-force.component.ts +++ b/src/app/data-collection/fire-force/fire-force.component.ts @@ -38,12 +38,104 @@ export class FireForceComponent implements OnInit { {id:5,name:'90%-100%'} ] checkBoxList:any[] = [ - {id:0,name:'鎬婚槦'}, - {id:1,name:'鏀槦'}, - {id:2,name:'澶ч槦'}, - {id:3,name:'涓槦(娑堥槻绔)'}, - {id:4,name:'鍏朵粬娑堥槻闃熶紞'} + {id:0,name:'鎬婚槦',isChecked:false}, + {id:1,name:'鏀槦',isChecked:false}, + {id:2,name:'澶ч槦',isChecked:false}, + {id:3,name:'涓槦(娑堥槻绔)',isChecked:false}, + {id:4,name:'鍏朵粬娑堥槻闃熶紞',isChecked:false} ] + //鍕鹃夊姏閲忕被鍨媍heckbox鍦ㄥ湴鍥句笂鏄剧ずmarker + checkBoxChange(){ + let Levels = [] + this.checkBoxList.forEach(item =>{ + if(item.isChecked){ + Levels.push(item.id) + } + }) + let params:any = { + 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{ + this.cluster.setData([]) + } + } + //寰幆娓叉煋鍑烘墍鏈夊姏閲弇arkers + cluster:any //鍔涢噺鑱氬悎瀹炰緥 + createMarker(list){ + let markerArrcluster = [] + this.cluster ? this.cluster.setData([]) : null + list.forEach((item) => { + let image + if(item.forceType == 2){ + image = '/assets/fireForcesMarkers/鍏朵粬.png' + }else if(item.level == 0){ + image = '/assets/fireForcesMarkers/鎬婚槦.png' + }else if(item.level == 1){ + image = '/assets/fireForcesMarkers/鏀槦.png' + }else if(item.level == 2){ + image = '/assets/fireForcesMarkers/澶ч槦.png' + }else if(item.level == 3){ + image = '/assets/fireForcesMarkers/涓槦.png' + } + // 鐢ㄤ簬鐐归泦鍚堢殑鏁扮粍 + item.fireForceDetailInfo.location ? + markerArrcluster.push({ + lnglat : [item.fireForceDetailInfo.location.x,item.fireForceDetailInfo.location.y], + image : image, + data : item + }) : null + }) + this.map.plugin(["AMap.MarkerClusterer"],() => { + var gridSize = 60 + var count = markerArrcluster.length; + var _renderClusterMarker = function (context) { + var factor = Math.pow(context.count / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + 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 = ``; + var offset = new AMap.Pixel(-12.5, -12.5); + context.marker.setContent(content) + context.marker.setOffset(offset) + } + this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, { + gridSize: gridSize, // 璁剧疆缃戞牸鍍忕礌澶у皬 + renderClusterMarker: _renderClusterMarker, // 鑷畾涔夎仛鍚堢偣鏍峰紡 + renderMarker: _renderMarker, // 鑷畾涔夐潪鑱氬悎鐐规牱寮 + }); + this.cluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + + } + }) + }); + + } ngOnInit(): void { this.getAllFireForce() setTimeout(() => { diff --git a/src/app/data-collection/linkage-forces/addLinkageForce.html b/src/app/data-collection/linkage-forces/addLinkageForce.html new file mode 100644 index 0000000..4ba38db --- /dev/null +++ b/src/app/data-collection/linkage-forces/addLinkageForce.html @@ -0,0 +1,15 @@ +
+
+ 鏂板鑱斿姩鍔涢噺 +
+
+
+ + {{item.name}} +
+
+
+ + +
+
\ No newline at end of file diff --git a/src/app/data-collection/linkage-forces/linkage-forces.component.html b/src/app/data-collection/linkage-forces/linkage-forces.component.html index 413184e..632b6a9 100644 --- a/src/app/data-collection/linkage-forces/linkage-forces.component.html +++ b/src/app/data-collection/linkage-forces/linkage-forces.component.html @@ -1,8 +1,260 @@ -
+
+
+
+
+ 鍒楄〃杩囨护 +
+
+ + +
+
+ +
+
+
+
+ 娑堥槻闃 + 瀹屾暣搴 +
+
+
    +
  • +
    {{item.name}}
    +
    + + {{accMul(item.integrityScore.toFixed(3),100,1)}}% + +
    +
    +
    +
    highlight_off
    +
  • +
+
+
+ +
+
-
- +
+
+ +
+ + + + {{item.name}} + + +
+ +
+
+ +
+
+
+ +
+
+
+ + 璇风瓑寰... +
+
+ + 涓婁紶涓...({{progressBarValue}}%) + +
+
+ + 涓嬭浇涓...({{progressBarValue}}%) +
+
+
+
+ 璇︽儏 +
+
+ 鐩稿叧璧勬枡 +
+
+
+
+ + + + +
+ + save淇濆瓨 + open_in_browser鎻愪氦瀹℃牳 +
+
+ +
+
+

鍩烘湰淇℃伅

+ + + + * + 绫诲瀷: + + + + + + * + 鍚嶇О: + + + + + + 鍗曚綅鑱旂郴鐢佃瘽: + + + + + + 鍗曚綅浼犵湡: + + + + + + 澶囨敞: + + + + +

浣嶇疆淇℃伅

+ + + + 琛屾斂鍖: + + + + 鍦板潃: + + + + + + 缁忓害: + + + + 绾害: + + + + + + +

鑱旂郴浜

+ + + + 鑱旂郴浜: + + + + + + 鑱屽姟: + + + + + + 鐢佃瘽: + + + + +

搴旀ヤ俊鎭

+ + + + 鏈嶅姟鍐呭: + + + + + + 璧勬簮璇存槑: + + + + + +
+
+ +
+
+ highlight_off +
+ + + + + +
+ {{item.fileName}} + + +
+
+
+
+ + \ No newline at end of file diff --git a/src/app/data-collection/linkage-forces/linkage-forces.component.scss b/src/app/data-collection/linkage-forces/linkage-forces.component.scss index ef03c8d..9fbcf0f 100644 --- a/src/app/data-collection/linkage-forces/linkage-forces.component.scss +++ b/src/app/data-collection/linkage-forces/linkage-forces.component.scss @@ -5,14 +5,532 @@ display: flex; box-sizing: border-box; padding: 10px; + font-size: 16px; + font-family: Source Han Sans CN; + font-weight: 400; + color: #000000; } .listbox{ width: 400px; height: 100%; background-color: #fff; + display: flex; + flex-direction: column; + .topbox{ + max-height: 200px; + box-sizing: border-box; + padding: 10px 22px 22px; + .add{ + height: 36px; + line-height: 36px; + display: flex; + justify-content: space-between; + } + .searchbox{ + .inputbox{ + width: 100%; + height: 36px; + font-size: 14px; + line-height: 36px; + margin: 10px 0; + display: flex; + span{ + margin-right: 5px; + } + select,input{ + flex: 1; + background-color: #F2F4F6; + border: 0; + border-radius: 5px; + box-sizing: border-box; + padding:0 8px; + + } + .gray{ + color: gray; + } + // input::-moz-placeholder { + // color: rgba(90, 83, 83, 0.89); + // opacity: 1; + // } + // input:-ms-input-placeholder { + // color: rgba(90, 83, 83, 0.89);; + // } + // input::-webkit-input-placeholder { + // color: rgba(90, 83, 83, 0.89);; + // } + } + } + } + .contantbox{ + flex: 1; + overflow-y: auto; + display: flex; + flex-direction: column; + .title{ + display: flex; + justify-content: space-between; + width: 100%; + box-sizing: border-box; + padding: 0 33px 0 22px; + height: 36px; + line-height: 36px; + span{ + font-size: 14px; + font-weight: 500; + } + } + .linkageForceList{ + flex: 1; + overflow-y: auto; + li{ + cursor: pointer; + width: 100%; + height: 36px; + line-height: 36px; + display: flex; + align-items: center; + font-size: 14px; + div{ + float: left; + box-sizing: border-box; + } + .name{ + text-align: left; + width: 60%; + padding-left: 22px; + white-space:nowrap; + overflow:hidden; + text-overflow:ellipsis; + } + .integrity{ + height: 58%; + width: 32%; + position: relative; + background-color: #F2F4F6; + .integrityNum{ + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + color: black; + font-size: 13px; + cursor: default; + } + .integrityColorDiv{ + height: 100%; + } + } + .deletebtn{ + flex: 1; + text-align: center; + mat-icon{ + width: 20px; + height: 20px; + cursor: pointer; + font-size: 20px; + vertical-align: text-top; + color: rgba(49, 46, 46, 0.144); + } + mat-icon:hover{ + color: #000; + } + } + } + li:hover{ + background-color: #b3d3ee; + } + .selectedLi{ + background-color: #b3d3ee; + } + } + .paginator{ + height: 56px; + width: 100%; + } + } } .mapbox{ flex: 1; margin-left: 10px; background-color: #fff; + display: flex; + overflow: hidden; + flex-direction: column; + .mapcheckbox,.swiper-container{ + width: 100%; + height: 50px; + .swiper-wrapper{ + flex: 1; + display: flex; + height: 50px; + line-height: 50px; + } + mat-checkbox{ + font-size: 15px; + span{ + display: flex; + justify-content: center; + align-items: center; + img{ + margin-right: 3px; + } + } + + } + mat-checkbox:nth-child(1){ + margin-left: 20px; + } + + } + #map{ + flex: 1; + position: relative; + #container{ + width: 100%; + height: 100%; + } + .gistopbox{ + position: absolute; + box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); + border-radius: 5px; + top: 3px; + width: 30%; + height:40px; + background: #FFFFFF; + display: flex; + align-items: center; + cursor: default;; + .inputBox{ + width: 100%; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + font-size: 14px; + .positionInput{ + border: 0; + border-radius: 6px; + width: 80%; + height: 28px; + background: #F2F2F2; + margin-left: 8px; + box-sizing: border-box; + padding-left: 10px; + } + } + + } + .hidden{ + opacity: 0; + z-index: -1; + } + .show{ + opacity: 1; + z-index: 1; + } + } + .detailsbox{ + width: 100%; + height:500px; + position: relative; + .tabsbox{ + width: 100%; + height: 40px; + overflow: hidden; + overflow-x: auto; + line-height: 40px; + display: flex; + justify-content: space-between; + font-size: 15px; + .tabs{ + div{ + float: left; + width: 120px; + text-align: center; + cursor: pointer; + color: #000000; + opacity: 0.4; + border-right: 1px solid #F2F4F6; + } + .selectedBtn{ + background-color: #2196F3; + color: #fff; + opacity: 1; + } + } + .btnbox{ + display: flex; + align-items: center; + .uploadAttachment{ + display: inline-block; + margin-right: 20px; + width: 120px; + text-align: center; + height: 28px; + line-height: 28px; + position: relative; + button{ + width: 100%; + height: 28px; + line-height: 28px; + mat-icon{ + transform: rotate(25deg); + font-size: 20px; + width: 20px; + height: 20px; + } + } + .a-upload{ + display: inline-block; + position: absolute; + left: 0; + top: 0; + display: inline-block; + width: 100%; + height: 100%; + opacity: 0; + input{ + width: 100%; + height: 100%; + cursor: pointer; + } + } + } + span{ + display: inline-block; + cursor: pointer; + color: #2196F3; + mat-icon{ + vertical-align: text-top; + font-size: 20px; + width: 20px; + height: 20px; + } + } + span:hover{ + text-decoration: underline; + } + .submitAudit{ + margin: 0 30px; + } + + } + } + .contant{ + width: 100%; + height:460px; + overflow-y: auto; + p{ + color: #2196F3; + background-color: #F2F4F6; + height: 33px; + line-height: 33px; + box-sizing: border-box; + padding-left: 20px; + font-size: 15px; + } + span{ + font-size: 15px; + } + input,select{ + height: 30px; + line-height: 30px; + box-sizing: border-box; + padding: 0 12px; + width: 60%; + margin-left: 5px; + border: 1px solid #EBEBEB; + border-radius: 5px; + } + textarea{ + width: 89%; + margin-left: 5px; + height: 85%; + border: 1px solid #EBEBEB; + border-radius: 5px; + } + .longinput{ + width: 74%; + } + .unitDiv{ + width: 60%; + position: relative; + input,select{ + width: 100%; + box-sizing: border-box; + padding-right: 50px; + } + .unit{ + position: absolute; + right: 13px; + top: 4px; + color: #000000; + opacity: 0.4; + } + } + .smallwidth{ + width: 30%; + } + // 鐩稿叧璧勬枡 + .fileDivBox{ + position: relative; + float: left; + border: 1px solid #EBEBEB; + width: 160px; + height: 162px; + box-sizing: border-box; + padding: 16px 16px 0; + display: flex; + flex-direction: column; + margin: 12px; + align-items: center; + cursor: pointer; + .imgbox{ + width: 134px; + height: 110px; + display: flex; + justify-content: center; + align-items: center; + .thumbnailImg{ + width: 134px; + height: 110px; + } + } + + span{ + width: 100%; + text-align: center; + margin-top: 5px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + color: gray; + font-size: 14px; + } + .deleteFile{ + position: absolute; + right: 0; + top: 0; + width: 18px; + height: 18px; + font-size: 18px; + display: none; + } + .btn{ + position: absolute; + height: 30px; + line-height: 30px; + font-size: 14px; + display: none; + } + .btn1{ + top: 37px; + } + .btn2{ + top: 78px; + } + } + .fileDivBox:hover{ + border: 1px solid #000; + .deleteFile{ + display: block; + + } + .deleteFile:hover{ + color: red; + } + .btn{ + display: block; + } + } + } + .masklayer{ + position: absolute; + left: 0; + top: 0; + z-index: 2000; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.2); + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + span{ + font-size: 14px; + margin-top: 5px; + } + .progressbar{ + width: 15%; + } + .cancelbtn{ + height: 32px; + line-height: 32px; + font-size: 14px; + margin-top: 12px; + } + } + } +} + + +.addLinkageForceBox{ + width: 530px; + height: 262px; + display: flex; + flex-direction: column; + .topbox{ + width: 100%; + height: 40px; + line-height: 40px; + background-color: #2196F3; + text-align: center; + color: #FFFFFF; + font-size: 15px; + } + .contant{ + flex: 1; + box-sizing: border-box; + padding:20px 30px; + + div{ + width:86px; + margin: 3px; + height: 36px; + float: left; + line-height: 36px; + text-align: center; + background-color: #F2F4F6; + font-size: 14px; + cursor: pointer; + border: 1px solid #fff; + border-radius: 4px; + display: flex; + justify-content: center; + align-items: center; + img{ + margin-right: 3px; + } + } + .selectedDiv{ + background-color: #fff; + border: 1px solid #2196F3; + } + } + .btnbox{ + width: 100%; + height: 50px; + box-sizing: border-box; + padding: 0px 30px; + display: flex; + align-items: flex-start;; + justify-content: center; + button{ + width: 80px; + height: 36px; + line-height: 36px; + margin: 0 20px; + } + } } \ No newline at end of file diff --git a/src/app/data-collection/linkage-forces/linkage-forces.component.ts b/src/app/data-collection/linkage-forces/linkage-forces.component.ts index cbddc20..21ef260 100644 --- a/src/app/data-collection/linkage-forces/linkage-forces.component.ts +++ b/src/app/data-collection/linkage-forces/linkage-forces.component.ts @@ -1,5 +1,16 @@ +import { FlatTreeControl } from '@angular/cdk/tree'; +import { HttpClient } from '@angular/common/http'; +import { Inject, Renderer2 } from '@angular/core'; +import { ElementRef } from '@angular/core'; import { Component, OnInit } from '@angular/core'; - +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { 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 Swiper from 'swiper'; +declare var AMap: any; @Component({ selector: 'app-linkage-forces', templateUrl: './linkage-forces.component.html', @@ -7,9 +18,865 @@ import { Component, OnInit } from '@angular/core'; }) export class LinkageForcesComponent implements OnInit { - constructor() { } + constructor(private tree: TreeService,public snackBar: MatSnackBar,private http:HttpClient,private elementRef: ElementRef,public renderer2: Renderer2,public dialog: MatDialog) { } + + isCheckedOfSearchDiv:boolean = true//鍒楄〃杩囨护婊戝潡 + slideChange(e){ + this.isCheckedOfSearchDiv = e.checked + } + //鎼滅储琛ㄥ崟 + searchForm:any = { + name:'', + integrityNum:'' + } + listIntegrityNum:any[] = [ + {id:-1,name:'鍏ㄩ儴'}, + {id:0,name:'<=50%'}, + {id:1,name:'50%-60%'}, + {id:2,name:'60%-70%'}, + {id:3,name:'70%-80%'}, + {id:4,name:'80%-90%'}, + {id:5,name:'90%-100%'} + ] + checkBoxList:any[] = [ + {id:0,name:'瀹夌洃',imgUrl:'/assets/linkageForces/瀹夌洃.png',isChecked:false}, + {id:1,name:'鐢靛姏灞',imgUrl:'/assets/linkageForces/鐢靛姏灞.png',isChecked:false}, + {id:2,name:'鍏畨',imgUrl:'/assets/linkageForces/鍏畨.png',isChecked:false}, + {id:3,name:'娴蜂簨',imgUrl:'/assets/linkageForces/娴蜂簨.png',isChecked:false}, + {id:4,name:'鐜繚灞',imgUrl:'/assets/linkageForces/鐜繚灞.png',isChecked:false}, + {id:5,name:'浜ら',imgUrl:'/assets/linkageForces/浜ら.png',isChecked:false}, + {id:6,name:'姘戞斂',imgUrl:'/assets/linkageForces/姘戞斂.png',isChecked:false}, + {id:7,name:'姘旇薄灞',imgUrl:'/assets/linkageForces/姘旇薄灞.png',isChecked:false}, + {id:8,name:'鐕冩皵灞',imgUrl:'/assets/linkageForces/鐕冩皵灞.png',isChecked:false}, + {id:9,name:'甯傛斂',imgUrl:'/assets/linkageForces/甯傛斂.png',isChecked:false}, + {id:10,name:'姘村埄',imgUrl:'/assets/linkageForces/姘村埄.png',isChecked:false}, + {id:11,name:'閫氫俊',imgUrl:'/assets/linkageForces/閫氫俊.png',isChecked:false}, + {id:12,name:'鍖荤枟',imgUrl:'/assets/linkageForces/鍖荤枟.png',isChecked:false}, + {id:13,name:'搴旀ョ鐞',imgUrl:'/assets/linkageForces/搴旀ョ鐞.png',isChecked:false}, + {id:14,name:'浣忓缓',imgUrl:'/assets/linkageForces/浣忓缓.png',isChecked:false} + ] + //鍕鹃夊姏閲忕被鍨媍heckbox鍦ㄥ湴鍥句笂鏄剧ずmarker + checkBoxChange(){ + let LinkageForceTypes = [] + this.checkBoxList.forEach(item =>{ + if(item.isChecked){ + LinkageForceTypes.push(item.id) + } + }) + let params:any = { + 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{ + this.cluster.setData([]) + } + } + //寰幆娓叉煋鍑烘墍鏈夊姏閲弇arkers + cluster:any //鍔涢噺鑱氬悎瀹炰緥 + createMarker(list){ + let markerArrcluster = [] + this.cluster ? this.cluster.setData([]) : null + list.forEach((item) => { + let image + if(item.linkageForceType == 0){//娑堢伀鏍 + image = '/assets/linkageForcesMarkers/瀹夌洃.png' + }else if(item.linkageForceType == 1){//娑堥槻姘存睜 + image = '/assets/linkageForcesMarkers/鐢靛姏灞.png' + }else if(item.linkageForceType == 2){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/鍏畨.png' + }else if(item.linkageForceType == 3){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/娴蜂簨.png' + }else if(item.linkageForceType == 4){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/鐜繚灞.png' + }else if(item.linkageForceType == 5){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/浜ら.png' + }else if(item.linkageForceType == 6){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/姘戞斂.png' + }else if(item.linkageForceType == 7){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/姘旇薄灞.png' + }else if(item.linkageForceType == 8){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/鐕冩皵灞.png' + }else if(item.linkageForceType == 9){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/甯傛斂.png' + }else if(item.linkageForceType == 10){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/姘村埄.png' + }else if(item.linkageForceType == 11){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/閫氫俊.png' + }else if(item.linkageForceType == 12){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/鍖荤枟.png' + }else if(item.linkageForceType == 13){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/搴旀ョ鐞.png' + }else if(item.linkageForceType == 14){//澶╃劧姘存簮 + image = '/assets/linkageForcesMarkers/浣忓缓.png' + } + // 鐢ㄤ簬鐐归泦鍚堢殑鏁扮粍 + markerArrcluster.push({ + lnglat : [item.location.x,item.location.y], + image : image, + data : item + }) + }) + this.map.plugin(["AMap.MarkerClusterer"],() => { + var gridSize = 60 + var count = markerArrcluster.length; + var _renderClusterMarker = function (context) { + var factor = Math.pow(context.count / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + 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 = ``; + var offset = new AMap.Pixel(-12.5, -12.5); + context.marker.setContent(content) + context.marker.setOffset(offset) + } + this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, { + gridSize: gridSize, // 璁剧疆缃戞牸鍍忕礌澶у皬 + renderClusterMarker: _renderClusterMarker, // 鑷畾涔夎仛鍚堢偣鏍峰紡 + renderMarker: _renderMarker, // 鑷畾涔夐潪鑱氬悎鐐规牱寮 + }); + this.cluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + + } + }) + }); + + } + ngOnInit(): void { + this.getAllFireForce() + window.onload = () => { + var mySwiper = new Swiper('.swiper-container', { + slidesPerView: 10,//姣忛〉鏄剧ず鐨勪釜鏁 + slidesPerGroup: 3,//鐐瑰嚮涓娆¢渶瑕佽烦澶氬皯娆 + // 濡傛灉闇瑕佸墠杩涘悗閫鎸夐挳 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + }) + } + setTimeout(() => { + + this.createMap() + }, 0); + } + //鑾峰緱鎵鏈夎仈鍔ㄥ姏閲 + allLinkageForceObj:any//鑾峰緱鐨勬墍鏈夎仈鍔ㄥ姏閲 + dataLength:any //鑾峰彇鐨勬暟鎹竴鍏卞灏戞潯 + PageNumber:any = 1 //褰撳墠绗嚑椤 + getAllFireForce(){ + let MinIntegrity = 0 + let MaxIntegrity = 1.1 + if(this.searchForm.integrityNum == '0'){ + MinIntegrity = 0 + MaxIntegrity = 0.5 + }else if(this.searchForm.integrityNum == '1'){ + MinIntegrity = 0.5 + MaxIntegrity = 0.6 + }else if(this.searchForm.integrityNum == '2'){ + MinIntegrity = 0.6 + MaxIntegrity = 0.7 + }else if(this.searchForm.integrityNum == '3'){ + MinIntegrity = 0.7 + MaxIntegrity = 0.8 + }else if(this.searchForm.integrityNum == '4'){ + MinIntegrity = 0.8 + MaxIntegrity = 0.9 + }else if(this.searchForm.integrityNum == '5'){ + MinIntegrity = 0.9 + MaxIntegrity = 1.1 + }else if(this.searchForm.integrityNum == '-1'){ + MinIntegrity = 0 + MaxIntegrity = 1.1 + } + let params:any = { + Keyword : this.searchForm.name ? this.searchForm.name : '', + MinIntegrity : MinIntegrity, + MaxIntegrity : MaxIntegrity, + PageSize : 15, + PageNumber : this.PageNumber, + } + this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => { + console.log('鎵鏈夋秷闃插姏閲忓垪琛',data) + this.dataLength = data.totalCount + this.allLinkageForceObj = data + }) + } + + //閫夋嫨瑕佹樉绀虹殑鑱斿姩鍔涢噺 + selectedLinkageForce(item){ + this.isGisTopBox = false + if(this.LinkageForceDetailInfo.id != item.id){ + this.clearData() + this.LinkageForceDetailInfo = item + item.location?this.positionLngLat = item.location:null + this.AttachmentArr = JSON.parse(item.relevantInfomationData) + if(this.newPositionMarker){ + this.map.remove(this.newPositionMarker); + } + console.log('褰撳墠鐐瑰嚮鐨刲i',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], + content: this.newPositionMarkerContent, + offset: new AMap.Pixel(-15, -18) + }) + // 灏 markers 娣诲姞鍒板湴鍥 + this.map.add(this.newPositionMarker); + } + } + } + //鎼滅储 + searchList(){ + this.getAllFireForce() + } + //閲嶇疆鎼滅储 + reset(){ + this.searchForm = { + name:'', + integrityNum:'' + } + this.getAllFireForce() + } + //鍒嗛〉浜嬩欢 + chagePage(e){ + this.PageNumber = e.pageIndex+1 + this.getAllFireForce() + } + //js涔樻硶 + accMul(arg1,arg2,fix) { + if(!parseInt(fix)==fix) + { + return; + } + var m=0,s1=arg1.toString(),s2=arg2.toString(); + try{m+=s1.split(".")[1].length}catch(e){} + try{m+=s2.split(".")[1].length}catch(e){} + if(m>fix){ + return (Math.round(Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m-fix))/Math.pow(10,fix)); + }else if(m<=fix){ + return (Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)).toFixed(fix); + }else{ + return (arg1*arg2).toFixed(fix).toString(); + } + } + //瀹屾暣搴﹂鑹 + integrity(width){ + let _this = this + let style:any = {} + style.width = width +'%'; + if(width < 30){ + style.background = '#FF5D4A' + } + if(width >= 30 && width < 60){ + style.background = '#FFDD00' + } + if(width >= 60){ + style.background = '#5CD64E' + } + return style + } + //鍒犻櫎鏌愭潯鑱斿姩鍔涢噺 + deleteLinkageForc(item,e){ + e.stopPropagation() + let isDelete = window.confirm(`纭畾瑕佸垹闄${item.name}鍚梎) + if(isDelete){ + this.http.delete(`/api/LinkageForces/${item.id}`).subscribe(data => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍒犻櫎鎴愬姛','纭畾',config); + if(item.id == this.LinkageForceDetailInfo.id){ + this.LinkageForceDetailInfo.linkageForceType = null + } + this.getAllFireForce() + }) + } + } + //褰撳墠鐐瑰嚮tab椤甸潰绗嚑涓 + tabIndex:any = 1 + selectedTab(index){ + this.tabIndex = index + } + + //鑱斿姩鍔涢噺璇︽儏鎻愪氦淇℃伅 + LinkageForceDetailInfo:any = { + // id:'',//缂栧彿 + linkageForceType:'', + name:'',//鍚嶇О + phoneNumber:'',//鑱旂郴鐢佃瘽 + faxNumber:'',//浼犵湡 + remark:'',//澶囨敞 + administrativeRegion:'',//琛屾斂鍖 + address:'',//鍦板潃 + location:{ + x:'', + y:'' + }, + contactName:'',//鑱旂郴浜哄鍚 + contactTitle:'',//鑱旂郴浜鸿亴鍔 + contactPhone:'',//鑱旂郴浜虹數璇 + serviceContent:'',//鏈嶅姟鍐呭 + resourceRemark:'',//璧勬簮璇存槑 + relevantInfomationData:[]//鐩稿叧璧勬枡 + } + + //娓呯┖琛ㄥ崟鏁版嵁 + clearData(){ + this.deletedFile = []//娓呯┖鐩稿叧璧勬枡宸插垹闄ょ紦瀛 + this.AttachmentArr = []//娓呯┖鐩稿叧璧勬枡 + this.positionLngLat = {x:'',y:''} + this.atLastPositionLngLat = {x:'',y:''} + this.LinkageForceDetailInfo = { + // id:'',//缂栧彿 + linkageForceType:'', + name:'',//鍚嶇О + phoneNumber:'',//鑱旂郴鐢佃瘽 + faxNumber:'',//浼犵湡 + remark:'',//澶囨敞 + administrativeRegion:'',//琛屾斂鍖 + address:'',//鍦板潃 + location:{ + x:'', + y:'' + }, + contactName:'',//鑱旂郴浜哄鍚 + contactTitle:'',//鑱旂郴浜鸿亴鍔 + contactPhone:'',//鑱旂郴浜虹數璇 + serviceContent:'',//鏈嶅姟鍐呭 + resourceRemark:'',//璧勬簮璇存槑 + relevantInfomationData:[]//鐩稿叧璧勬枡 + } + } + //鏂板鑱斿姩鍔涢噺 + selectedFireForceTypeIndex:any//鏂板娑堥槻鍔涢噺鍚嶇О + addLinkageForce(){ + const dialogRef = this.dialog.open(AddLinkageForce, { + data: {}, + id:'addLinkageForce' + }); + dialogRef.afterClosed().subscribe( + 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('涓婃捣甯'); + + } + } + ) + } + //淇濆瓨 + save(){ + if(!this.LinkageForceDetailInfo.name){ + alert('鍚嶇О蹇呭~') + return + } + this.isMasklayer = true + //鍒犻櫎涓涓嬫暟鎹簱鐨勬枃浠 + if(this.deletedFile.length != 0){ + this.deletedFile.forEach(item => { + this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}`).subscribe(data=>{ + console.log('鍒犻櫎鍘熸枃浠舵垚鍔') + }) + }); + } + + this.LinkageForceDetailInfo.location = {x:'',y:''} + this.LinkageForceDetailInfo.RelevantInfomationData = JSON.stringify(this.AttachmentArr) + if(this.atLastPositionLngLat.x){ + this.LinkageForceDetailInfo.location.x = this.atLastPositionLngLat.x + this.LinkageForceDetailInfo.location.y = this.atLastPositionLngLat.y + }else{ + this.LinkageForceDetailInfo.location = null + } + this.LinkageForceDetailInfo.relevantInfomationData = JSON.stringify(this.LinkageForceDetailInfo.relevantInfomationData) + 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'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.LinkageForceDetailInfo = data + this.getAllFireForce() + }) + } + + + } + + map:any + placeSearch:any//鏋勯犲湴鐐规煡璇㈢被 + isMapLabel:boolean = false //鏄惁宸茬粡鏍囪鍧愭爣 + newPositionMarkerContent:any = + '
' + + ' ' + + '
' + newPositionMarkerContentBtn:any = + '
' + + ' ' + + '
|
' + + '
' + //鍒涘缓鍦板浘 + newPositionMarker:any//鍧愭爣瀹炰緥 + createMap(){ + this.map = new AMap.Map('container', { + zoom:12 + }) + this.map.setCity('涓婃捣甯'); + //杈撳叆鎻愮ず + var autoOptions = { + input: "tipinput" + }; + AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{ + let auto = new AMap.AutoComplete(autoOptions); + this.placeSearch = new AMap.PlaceSearch(); //鏋勯犲湴鐐规煡璇㈢被 + auto.on("select", (e)=>{ + this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) + this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} + this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //璁剧疆鍦板浘涓績鐐 + });//娉ㄥ唽鐩戝惉锛屽綋閫変腑鏌愭潯璁板綍鏃朵細瑙﹀彂 + + }); + + 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 // + searchTitle:any = ''// + + positionLngLat:any = {x:'',y:''}//涓存椂鍧愭爣鐐 + atLastPositionLngLat:any = {x:'',y:''}//鏈缁堝潗鏍囩偣 + setPosition(){ + if(!this.isGisTopBox){ + 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({ + draggable: true, + position: center, + content: this.newPositionMarkerContentBtn, + offset: new AMap.Pixel(-15, -18) + }); + this.positionLngLat = {x: center.lng || center[0], y: center.lat || center[1]} + this.map.add(this.newPositionMarker); + this.isMapLabel = true + this.newPositionMarker.on('dragend', (e)=>{ + this.positionLngLat = {x: e.lnglat.lng, y: e.lnglat.lat} + }) + //鐐瑰嚮纭畾 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{ + this.isGisTopBox = false + this.map.remove(this.newPositionMarker) + this.newPositionMarker = new AMap.Marker({ + position: [this.positionLngLat.x,this.positionLngLat.y], + content: this.newPositionMarkerContent, + offset: new AMap.Pixel(-15, -18) + }); + this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) + this.map.add(this.newPositionMarker); + this.positionLngLat = this.atLastPositionLngLat + }) + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'click',(event)=>{ + this.isGisTopBox = false + this.map.remove(this.newPositionMarker) + if(this.positionLngLat.x && this.positionLngLat.x != 0 && !this.atLastPositionLngLat.x){//鐩存帴鍙栨秷 + this.map.remove(this.newPositionMarker) + this.positionLngLat = {} + this.atLastPositionLngLat = {} + }else{ + this.newPositionMarker = new AMap.Marker({ + position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], + content: this.newPositionMarkerContent, + offset: new AMap.Pixel(-15, -18) + }); + this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //璁剧疆鍦板浘涓績鐐 + this.map.add(this.newPositionMarker); + this.positionLngLat = this.atLastPositionLngLat + } + })//鍙栨秷 + } + + } + + + + + //涓婁紶闄勪欢 + file:any; //涓婁紶鐨勬枃浠 + AttachmentArr:any = []//涓婁紶闄勪欢鍦板潃闆嗗悎 + uploadId:any//鍒嗗潡涓婁紶id + objectName:any + progressBarValue:any = 0//鍒嗗潡涓婁紶杩涘害 + isMasklayer:boolean = false//鍦嗗湀閬僵灞傛槸鍚︽墦寮 + 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 //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + + 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/LinkageForce/${this.LinkageForceDetailInfo.id}`,formData).subscribe((data:any)=>{ + // this.objectName = data.objectName + let obj = { + objectName:data.objectName, + fileName:data.fileName, + fileLength:data.fileLength + } + this.AttachmentArr.push(obj) + this.isMasklayer = false + console.log('涓婁紶鎴愬姛',data) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶鎴愬姛','纭畾',config); + }) + } else if (file && fileSize>shardSize) { //涓婁紶鏂囦欢>5MB鏃,鍒嗗潡涓婁紶 + 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() + }) + } + } + PartNumberETag:any=[]; //姣忔杩斿洖闇瑕佷繚瀛樼殑淇℃伅 + + //寮濮嬪垎娈典笂浼 + async subsectionUploading () { + let file = this.file || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/5MB===鍏卞垎澶氬皯娈 + for (let i = 0;i < allSlice;i++) { //寰幆鍒嗘涓婁紶 + let start = i * shardSize //鍒囧壊鏂囦欢寮濮嬩綅缃 + let end = Math.min(fileSize, start + shardSize); //鍒囧壊鏂囦欢缁撴潫浣嶇疆 + let formData = new FormData() + formData.append("file",file.slice(start, end)) + + //鍚屾鍐欐硶瀹炵幇寮傛璋冪敤 + let result = await new Promise((resolve, reject) => { + // await 闇瑕佸悗闈㈣繑鍥炰竴涓 promise 瀵硅薄 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ + let msg = { + "partNumber":data.partNumber || null, + "eTag": data.eTag || null} + resolve(msg) // 璋冪敤 promise 鍐呯疆鏂规硶澶勭悊鎴愬姛 + }) + }); + this.PartNumberETag.push(result) + // this.progressBarValue = Number((i/allSlice).toFixed(2))*100 + this.progressBarValue = this.accMul(Number((i/allSlice).toFixed(2))*100,1,0) + if (this.PartNumberETag.length === allSlice) { + this.progressBarValue = 100 + this.endUploading()} + }//for寰幆 + + } + + //瀹屾垚鍒嗗潡涓婁紶 + endUploading () { + let data = this.PartNumberETag + let paramsData = {uploadId:this.uploadId} + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + let obj = { + objectName:this.objectName, + fileName:this.file.name, + fileLength:this.file.size + } + this.AttachmentArr.push(obj) + this.isMasklayerUploading = false//鍏抽棴杩涘害鏉¢伄缃╁眰 + this.progressBarValue = 0//閲嶇疆杩涘害鏁 + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶鎴愬姛','纭畾',config); + }) + } + + //鍙栨秷鍒嗗潡涓婁紶 + cancelUploading() { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + this.progressBarValue = 0; + this.isMasklayerUploading= false + this.PartNumberETag =[] //娓呯┖淇濆瓨杩斿洖鐨勪俊鎭 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍙栨秷涓婁紶鎴愬姛','纭畾',config); + }) + } + + //涓嬭浇 + download (e) { + this.isMasklayerDownload = true //寮鍚笅杞借繘搴︽潯 + let file = e //浼犻掕繃鏉ョ殑鏂囦欢鍏冩暟鎹 + let fileSize = file.fileLength //涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 3 * 1024 * 1024 //鏂囦欢澶у皬鏄惁澶т簬10MB + if (file && fileSize<=shardSize) { //<=3MB鏃剁洿鎺ヤ笅杞 + this.progressBarValue = 60 + this.http.get(`/api/Objects/PlanPlatform/${e.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let fileName = e.fileName ? e.fileName : e.objectName.split('/')[e.objectName.split('/').length-1] + link.setAttribute("download", fileName); + document.body.appendChild(link); + link.click(); + this.isMasklayerDownload = false //鍏抽棴涓嬭浇杩涘害鏉 + this.progressBarValue = 0 //鍒濆鍖栬繘搴︽潯 + }) + } else if (file && fileSize>shardSize) { //>3MB鏃跺垎鍧椾笅杞 + this.blockingDownload(e) //鍒嗘涓嬭浇 + } + + } + + //鍒嗘涓嬭浇骞跺悎骞 + async blockingDownload (e) { + let file = e //浼犻掕繃鏉ョ殑鏂囦欢鍏冩暟鎹 + let fileSize = file.fileLength //涓嬭浇鏂囦欢鐨勬诲ぇ灏 + let shardSize = 3 * 1024 * 1024 //3MB涓涓垎鐗 + let allSlice = Math.ceil(fileSize / shardSize) //鎬绘枃浠/3MB===鍏卞垎澶氬皯娈 + let allFile:any = [] //鎵鏈夌殑file鍒嗘 + + for (let i=0;i{ + this.http.get(`/api/Objects/PlanPlatform/${e.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ + result(data) }) + }) + allFile.push(result) + // this.progressBarValue = Number((i/allSlice).toFixed(2))*100 //鏂囦欢杩涘害鏁 + this.progressBarValue = this.accMul(Number((i/allSlice).toFixed(2))*100,1,0) + if (allFile.length === allSlice) { //鍚堝苟鏂囦欢杈撳嚭缁欐祻瑙堝櫒 + let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL鍒涘缓涓涓笅杞紹lob鐨剈rl鍦板潃 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let fileName = e.fileName ? e.fileName : e.objectName.split('/')[e.objectName.split('/').length-1] + link.setAttribute("download", fileName); + document.body.appendChild(link); + link.click(); + this.isMasklayerDownload = false //鍏抽棴涓嬭浇杩涘害鏉 + this.progressBarValue = 0 //鍒濆鍖栬繘搴︽潯 + } + + } //for寰幆缁撴潫 + + } + + //鍒犻櫎鍥剧墖 + deletedFile:any = [] + deleteFile(item,e){ + console.log(this.AttachmentArr) + e.stopPropagation() + let isTrue = window.confirm('纭畾瑕佸垹闄よ鏂囦欢鍚楋紵') + if(isTrue){ + let index + this.AttachmentArr.forEach((element,key) => { + if(element.objectName == item.objectName){ + index = key + } + }); + this.AttachmentArr.splice(index,1) + this.deletedFile.push(item) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍒犻櫎鎴愬姛','纭畾',config); + } + } + + //鐐瑰嚮鏂囦欢 + 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") + node.style.display = "none"; + node.src = "/api/Objects/PlanPlatform/" + item.objectName; + node.id = 'img' + dom.appendChild(node) + setTimeout(() => { + let viewer = new Viewer(document.getElementById(`viewerjs`), { + hidden:()=>{ + dom.removeChild(pObjs[0]); + viewer.destroy(); + } + }); + node.click(); + }, 0); + } + if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆備笉鏀寔鏌ョ湅','纭畾',config); + } + if(suffix == 'mp4'){ + const dialogRef = this.dialog.open(ViewDetails2, {//璋冪敤open鏂规硶鎵撳紑瀵硅瘽妗嗗苟涓旀惡甯﹀弬鏁拌繃鍘 + data: {item:item,type:"video"}, + id:'videodialog2' + }); + dialogRef.afterClosed().subscribe(); + } + } + +} + + + + +//鏂板鑱斿姩鍔涢噺寮瑰嚭妗 +@Component({ + selector: 'AddLinkageForce', + templateUrl: './addLinkageForce.html', + styleUrls: ['./linkage-forces.component.scss'] +}) +export class AddLinkageForce { + + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} + + + addList:any = [ + {id:0,name:'瀹夌洃',imgUrl:'/assets/linkageForces/瀹夌洃.png'}, + {id:1,name:'鐢靛姏灞',imgUrl:'/assets/linkageForces/鐢靛姏灞.png'}, + {id:2,name:'鍏畨',imgUrl:'/assets/linkageForces/鍏畨.png'}, + {id:3,name:'娴蜂簨',imgUrl:'/assets/linkageForces/娴蜂簨.png'}, + {id:4,name:'鐜繚灞',imgUrl:'/assets/linkageForces/鐜繚灞.png'}, + {id:5,name:'浜ら',imgUrl:'/assets/linkageForces/浜ら.png'}, + {id:6,name:'姘戞斂',imgUrl:'/assets/linkageForces/姘戞斂.png'}, + {id:7,name:'姘旇薄灞',imgUrl:'/assets/linkageForces/姘旇薄灞.png'}, + {id:8,name:'鐕冩皵灞',imgUrl:'/assets/linkageForces/鐕冩皵灞.png'}, + {id:9,name:'甯傛斂',imgUrl:'/assets/linkageForces/甯傛斂.png'}, + {id:10,name:'姘村埄',imgUrl:'/assets/linkageForces/姘村埄.png'}, + {id:11,name:'閫氫俊',imgUrl:'/assets/linkageForces/閫氫俊.png'}, + {id:12,name:'鍖荤枟',imgUrl:'/assets/linkageForces/鍖荤枟.png'}, + {id:13,name:'搴旀ョ鐞',imgUrl:'/assets/linkageForces/搴旀ョ鐞.png'}, + {id:14,name:'浣忓缓',imgUrl:'/assets/linkageForces/浣忓缓.png'} + ] + selectedFireForceTypeIndex:any = 0 + selecteAddType(item,key){ + this.selectedFireForceTypeIndex = item.id + + } ngOnInit(): void { + + } + + confirm(){ + this.dialogRef.close(this.selectedFireForceTypeIndex) } } + +//鏌ョ湅鍥剧墖澶у浘鍜岃棰 +@Component({ + selector: 'viewdetails', + templateUrl: './viewdetails.html', + styleUrls: ['./linkage-forces.component.scss'] +}) +export class ViewDetails2 { + // myControl = new FormControl(); + //娉ㄥ叆MatDialogRef锛屽彲浠ョ敤鏉ュ叧闂璇濇 + //瑕佽闂璇濇缁勪欢涓殑鏁版嵁锛屽繀椤讳娇鐢∕AT_DIALOG_DATA娉ㄥ叆浠ょ墝 + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) {} + Url:string + onNoClick(): void { + this.dialogRef.close(); + } + ngOnInit(): void { + this.Url = '/api/Objects/PlanPlatform/' + this.data.item.objectName + } + closeDialog(){ + this.dialogRef.close(); + } + +} \ No newline at end of file diff --git a/src/app/data-collection/linkage-forces/viewdetails.html b/src/app/data-collection/linkage-forces/viewdetails.html new file mode 100644 index 0000000..6d917bb --- /dev/null +++ b/src/app/data-collection/linkage-forces/viewdetails.html @@ -0,0 +1 @@ + diff --git a/src/app/data-collection/water-collection/water-collection.component.html b/src/app/data-collection/water-collection/water-collection.component.html index 542ed80..763a772 100644 --- a/src/app/data-collection/water-collection/water-collection.component.html +++ b/src/app/data-collection/water-collection/water-collection.component.html @@ -52,13 +52,13 @@
- +
- {{item.name}} + {{item.name}}
diff --git a/src/app/data-collection/water-collection/water-collection.component.ts b/src/app/data-collection/water-collection/water-collection.component.ts index 17dd475..153eba2 100644 --- a/src/app/data-collection/water-collection/water-collection.component.ts +++ b/src/app/data-collection/water-collection/water-collection.component.ts @@ -33,10 +33,95 @@ export class WaterCollectionComponent implements OnInit { {id:5,name:'90%-100%'} ] checkBoxList:any[] = [ - {id:0,name:'娑堢伀鏍'}, - {id:1,name:'娑堥槻姘存睜'}, - {id:2,name:'澶╃劧姘存簮'} + {id:0,name:'娑堢伀鏍',isChecked:false}, + {id:1,name:'娑堥槻姘存睜',isChecked:false}, + {id:2,name:'澶╃劧姘存簮',isChecked:false} ] + //鍕鹃夋按婧愮被鍨媍heckbox鍦ㄥ湴鍥句笂鏄剧ずmarker + checkBoxChange(){ + let WaterSourceTypesArr = [] + this.checkBoxList.forEach(item =>{ + if(item.isChecked){ + WaterSourceTypesArr.push(item.id) + } + }) + let params:any = { + PageSize : 999999, + WaterSourceTypes:WaterSourceTypesArr + } + if(WaterSourceTypesArr.length != 0){//濡傛灉鍕鹃変簡checkbox + this.http.get('/api/WaterSources',{params:params}).subscribe((data:any) => { + this.createMarker(data.items) + }) + }else{ + this.cluster.setData([]) + } + } + //寰幆娓叉煋鍑烘墍鏈夋按婧恗arkers + cluster:any //姘存簮鑱氬悎瀹炰緥 + createMarker(list){ + let markerArrcluster = [] + this.cluster ? this.cluster.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' + } + // 鐢ㄤ簬鐐归泦鍚堢殑鏁扮粍 + markerArrcluster.push({ + lnglat : [item.location.x,item.location.y], + image : image, + data : item + }) + }) + this.map.plugin(["AMap.MarkerClusterer"],() => { + var gridSize = 60 + var count = markerArrcluster.length; + var _renderClusterMarker = function (context) { + var factor = Math.pow(context.count / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + 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 = ``; + context.marker.setContent(content) + var offset = new AMap.Pixel(-12.5, -12.5); + context.marker.setOffset(offset) + } + this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, { + gridSize: gridSize, // 璁剧疆缃戞牸鍍忕礌澶у皬 + renderClusterMarker: _renderClusterMarker, // 鑷畾涔夎仛鍚堢偣鏍峰紡 + renderMarker: _renderMarker, // 鑷畾涔夐潪鑱氬悎鐐规牱寮 + }); + this.cluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + + } + }) + }); + + } ngOnInit(): void { this.getAllWaterData() setTimeout(() => { @@ -74,7 +159,7 @@ export class WaterCollectionComponent implements OnInit { } let params:any = { Keyword : this.searchForm.name, - PageSize : 30, + PageSize : 15, PageNumber : this.PageNumber, MinIntegrity : MinIntegrity, MaxIntegrity : MaxIntegrity diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.html b/src/app/gis-management/gis-labeling/gis-labeling.component.html index 331be05..60f2b04 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.html +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.html @@ -114,6 +114,7 @@ 鏄剧ず鑼冨洿 : + diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index 819a3ff..5fc2e49 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -27,28 +27,14 @@ export class GisLabelingComponent implements OnInit { {id:'0',name:'娑堢伀鏍',selected:false}, {id:'1',name:'娑堥槻姘存睜',selected:false}, {id:'2',name:'澶╃劧姘存簮',selected:false}, - // {id:'0',name:'鍗曚綅鍦颁笂娑堢伀鏍',selected:false}, - // {id:'0',name:'鍗曚綅鍦颁笅娑堢伀鏍',selected:false}, - // {id:'0',name:'甯傛斂鍦颁笂娑堢伀鏍',selected:false}, - // {id:'0',name:'娑堥槻姘存睜',selected:false}, - // {id:'0',name:'鏂瑰舰鍌ㄦ按姹',selected:false}, - // {id:'0',name:'钃勬按姹',selected:false}, - // {id:'0',name:'鍘熷瀷姘村',selected:false}, - // {id:'0',name:'姘村簱',selected:false}, - // {id:'0',name:'娑堥槻姘寸',selected:false}, - // {id:'0',name:'鐮佸ご',selected:false}, - // {id:'0',name:'娴锋磱',selected:false}, - // {id:'0',name:'娌虫祦',selected:false}, - // {id:'0',name:'婀栨硦',selected:false}, - // {id:'0',name:'娌熸笭',selected:false} - ] + ] keyUnitForm : FormGroup//gis鍙充笂瑙掗噸鐐瑰崟浣嶈〃鍗 watertForm : FormGroup//gis鍙充笂瑙掓按婧愯〃鍗 selectedUnitList:any = []//閫夋嫨鎻愪氦鐨勫崟浣 selectedWaterList:any = []//閫夋嫨鎻愪氦鐨勬按婧 - unitAreaDefault:any = '0'//榛樿鍗曚綅鑼冨洿 - waterAreaDefault:any = '0'//榛樿姘存簮鑼冨洿 + unitAreaDefault:any = '-1'//榛樿鍗曚綅鑼冨洿 + waterAreaDefault:any = '-1'//榛樿姘存簮鑼冨洿 //鑾峰緱鍗曚綅寰幆鍑烘潵鐨刢heckbox鍒楄〃锛坒ormControl瀹炰緥锛 get units():any{ return this.keyUnitForm.get('units') @@ -156,17 +142,19 @@ export class GisLabelingComponent implements OnInit { //閲嶇偣鍗曚綅鎻愪氦 ketUnitSubmit(value){ if(this.markers.length == 0){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('璇峰厛閫夋嫨涓涓崟浣','纭畾',config); + let paramsdata:any = { + PageSize:99999, + BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + } + this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { + this.createUnitMarker(data.items) + }) }else if(!this.mapPattern){ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 this.snackBar.open('璇峰垏鎹2D妯″紡浣跨敤姝ゅ姛鑳','纭畾',config); }else{ - // console.log('鎻愪氦',this.selectedUnit) this.circle.setRadius(Number(this.unitAreaDefault)) this.circle.setCenter(this.markers[0]._position) this.circle.setMap(this.map) @@ -178,32 +166,43 @@ export class GisLabelingComponent implements OnInit { }else{ Distance = Math.abs(lnglat.offset(0, this.unitAreaDefault).lat - this.selectedUnit.location.y) } - - let paramsdata:any = { - Lon : this.selectedUnit.location.x, - Lat : this.selectedUnit.location.y, - Distance : Distance, - BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] - } - // console.log(666,paramsdata) - this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { - data.items.forEach((i,index) => { - if(i.id == this.selectedUnit.id){ - data.items.splice(index,1) - } + if(this.unitAreaDefault == '-1'){//濡傛灉鍕鹃夊叏閮 + let paramsdata:any = { + PageSize:99999, + BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + } + this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { + data.items.forEach((i,index) => { + if(i.id == this.selectedUnit.id){ + data.items.splice(index,1) + } + }) + this.createUnitMarker(data.items) }) - this.createUnitMarker(data.items) - }) + }else{ + let paramsdata:any = { + PageSize:99999, + Lon : this.selectedUnit.location.x, + Lat : this.selectedUnit.location.y, + Distance : Distance, + BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + } + this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { + data.items.forEach((i,index) => { + if(i.id == this.selectedUnit.id){ + data.items.splice(index,1) + } + }) + this.createUnitMarker(data.items) + }) + } } } //鍒涘缓鍗曚綅markers - unitMarkerList:any = [] - unitlabelsLayer:any + unitCluster:any //閲嶇偣鍗曚綅鐐硅仛鍚堝疄渚 createUnitMarker(list){ - this.unitlabelsLayer ? this.map.remove(this.unitlabelsLayer) : null - this.unitMarkerList ? this.map.remove(this.unitMarkerList) : null - - let markerArr = [] + let unitMarkerArrcluster = [] + this.unitCluster ? this.unitCluster.setData([]) : null list.forEach((item) => { let image if(item.buildingTypes[0].name.indexOf('楂樺眰') != -1){ @@ -241,176 +240,262 @@ export class GisLabelingComponent implements OnInit { }else{ image = '/assets/images/鍏朵粬.png' } - var icon = { - // 鍥炬爣绫诲瀷锛岀幇闃舵鍙敮鎸 image 绫诲瀷 - type: 'image', - // 鍥剧墖 url - image: image, - // 鍥剧墖灏哄 - size: [32, 32], - // 鍥剧墖鐩稿 position 鐨勯敋鐐癸紝榛樿涓 bottom-center - anchor: 'center', - }; - var text = { - // 瑕佸睍绀虹殑鏂囧瓧鍐呭 - content: item.name, - // 鏂囧瓧鏂瑰悜锛屾湁 icon 鏃朵负鍥寸粫鏂囧瓧鐨勬柟鍚戯紝娌℃湁 icon 鏃讹紝鍒欎负鐩稿 position 鐨勪綅缃 - direction: 'bottom', - // 鍦 direction 鍩虹涓婄殑鍋忕Щ閲 - offset: [-3, -3], - // 鏂囧瓧鏍峰紡 - style: { - // 瀛椾綋澶у皬 - fontSize: 12, - // 瀛椾綋棰滆壊 - fillColor: '#22886f', - // 鎻忚竟棰滆壊 - strokeColor: '#fff', - // 鎻忚竟瀹藉害 - strokeWidth: 2, - } + // 鐢ㄤ簬鐐归泦鍚堢殑鏁扮粍 + unitMarkerArrcluster.push({ + lnglat : [item.location.x,item.location.y], + image : image, + data : item + }) + }) + this.map.plugin(["AMap.MarkerClusterer"],() => { + var gridSize = 60 + var count = unitMarkerArrcluster.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 labelMarker = new AMap.LabelMarker({ - name: item.name, // 姝ゅ睘鎬ч潪缁樺埗鏂囧瓧鍐呭锛屼粎鏈涓烘爣璇嗕娇鐢 - position: [item.location.x,item.location.y], - zIndex: 16, - // 灏嗙涓姝ュ垱寤虹殑 icon 瀵硅薄浼犵粰 icon 灞炴 - icon: icon, - // 灏嗙浜屾鍒涘缓鐨 text 瀵硅薄浼犵粰 text 灞炴 - text: text, - }); - labelMarker.on('click', (e)=>{ - // console.log(item) - let markerContent = - `
-
${item.name}
-
-
鍗曚綅鎬ц川:
-
娑堥槻璐熻矗浜:
-
-
-
闃茬伀绾у埆:
-
娑堥槻绠$悊浜:
-
-
-
闃茬伀绠¤緰:
-
闃茬伀鐩戠潱鍛:
-
-
-
璐d换闃熺珯:
-
鎬诲缓绛戦潰绉:
-
-
-
寤虹瓚淇℃伅鍒嗙被:
-
鎬诲崰鍦伴潰绉:
-
-
-
鍊肩彮鐢佃瘽:
-
-
-
鍩烘湰淇℃伅
-
瀵艰埅
-
鍏ㄦ櫙婕父
-
涓夌淮鍦烘櫙
-
鏌ョ湅棰勬
-
鍒嗕韩
-
-
` - // 鍒涘缓涓涓嚜瀹氫箟鍐呭鐨 infowindow 瀹炰緥 - this.infoWindow = new AMap.InfoWindow({ - position: [item.location.x,item.location.y], - offset: new AMap.Pixel(0, -30), - content: markerContent, - }); - this.infoWindow.open(this.map); - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(item) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//瀵艰埅鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//鍒嗕韩鐐瑰嚮浜嬩欢 + var _renderMarker = (context)=> { + var content = ``; + var offset = new AMap.Pixel(-15, -25); + context.marker.setContent(content) + context.marker.setOffset(offset) + } + this.unitCluster = new AMap.MarkerCluster(this.map, unitMarkerArrcluster, { + gridSize: gridSize, // 璁剧疆缃戞牸鍍忕礌澶у皬 + renderClusterMarker: _renderClusterMarker, // 鑷畾涔夎仛鍚堢偣鏍峰紡 + renderMarker: _renderMarker, // 鑷畾涔夐潪鑱氬悎鐐规牱寮 }); - markerArr.push(labelMarker) - }) - this.unitlabelsLayer = new AMap.LabelsLayer({ - zooms: [3, 20], - zIndex: 1000, - // 璇ュ眰鍐呮爣娉ㄦ槸鍚﹂伩璁 - collision: false, - // 璁剧疆 allowCollision锛歵rue锛屽彲浠ヨ鏍囨敞閬胯鐢ㄦ埛鐨勬爣娉 - // allowCollision: true, + this.unitCluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + let item = e.clusterData[0].data + let markerContent = + `
+
${item.name}
+
+
鍗曚綅鎬ц川:
+
娑堥槻璐熻矗浜:
+
+
+
闃茬伀绾у埆:
+
娑堥槻绠$悊浜:
+
+
+
闃茬伀绠¤緰:
+
闃茬伀鐩戠潱鍛:
+
+
+
璐d换闃熺珯:
+
鎬诲缓绛戦潰绉:
+
+
+
寤虹瓚淇℃伅鍒嗙被:
+
鎬诲崰鍦伴潰绉:
+
+
+
鍊肩彮鐢佃瘽:
+
+
+
鍩烘湰淇℃伅
+
瀵艰埅
+
鍏ㄦ櫙婕父
+
涓夌淮鍦烘櫙
+
鏌ョ湅棰勬
+
鍒嗕韩
+
+
` + // 鍒涘缓涓涓嚜瀹氫箟鍐呭鐨 infowindow 瀹炰緥 + this.infoWindow = new AMap.InfoWindow({ + position: [item.location.x,item.location.y], + offset: new AMap.Pixel(0, -30), + content: markerContent, + }); + this.infoWindow.open(this.map); + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(item) })//鍩烘湰淇℃伅鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//瀵艰埅鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//鍏ㄦ櫙婕父鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//涓夌淮鍦烘櫙鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//鏌ョ湅棰勬鐐瑰嚮浜嬩欢 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//鍒嗕韩鐐瑰嚮浜嬩欢 + } + }) }); - this.unitlabelsLayer.add(markerArr); - this.map.add(this.unitlabelsLayer);//澧炲姞鍥惧眰 - - this.unitMarkerList = markerArr - this.map.add(this.unitMarkerList);//灏唌arkers娣诲姞鍒板浘灞備笂 + } - //鍙栨秷鍗曚綅markers - clearUnitMarker(){ - this.map.remove(this.unitlabelsLayer) - this.map.remove(this.unitMarkerList); + //鍙栨秷鏄剧ず鍗曚綅 + resetUnit(){ + this.keyUnitForm.reset() + this.keyUnitForm.controls.areaUnit.setValue('-1') + this.map.remove(this.circle) + this.unitCluster.setData([]) } - //姘存簮鎻愪氦 waterSubmit(value){ if(this.markers.length == 0){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('璇峰厛閫夋嫨涓涓崟浣','纭畾',config); + if(this.selectedWaterList.length != 0){//鍕鹃変簡姘存簮绫诲瀷 + let paramsdata:any = { + PageSize:99999, + WaterSourceTypes : this.selectedWaterList + } + this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { + console.log('鎵鏈夋按婧',data) + this.createwaterMarker(data.items) + }) + }else{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('璇峰嬀閫夋兂瑕佹樉绀虹殑姘存簮绫诲瀷','纭畾',config); + } }else if(!this.mapPattern){ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 this.snackBar.open('璇峰垏鎹2D妯″紡浣跨敤姝ゅ姛鑳','纭畾',config); }else{ - this.createwaterMarker() this.circleofwater.setRadius(Number(this.waterAreaDefault)) this.circleofwater.setCenter(this.markers[0]._position) this.circleofwater.setMap(this.map) + let Distance + let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.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.selectedUnit.location.y) + }else{ + Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.selectedUnit.location.y) + } + //濡傛灉閫夋嫨鍏ㄩ儴 + if(this.waterAreaDefault == '-1'){ + if(this.selectedWaterList.length != 0){ + let paramsdata:any = { + PageSize:99999, + WaterSourceTypes : this.selectedWaterList + } + this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { + console.log('鎵鏈夋按婧',data) + this.createwaterMarker(data.items) + }) + }else{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('璇峰嬀閫夋兂瑕佹樉绀虹殑姘存簮绫诲瀷','纭畾',config); + } + + }else{ + if(this.selectedWaterList.length != 0){ + let paramsdata:any = { + PageSize:99999, + Lon : this.selectedUnit.location.x, + Lat : this.selectedUnit.location.y, + Distance : Distance, + WaterSourceTypes :this.selectedWaterList + } + this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { + console.log('鎵鏈夋按婧',data) + this.createwaterMarker(data.items) + }) + }else{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('璇峰嬀閫夋兂瑕佹樉绀虹殑姘存簮绫诲瀷','纭畾',config); + } } } } - waterIconList = []; //灞曠ず鐨勬按婧愬浘鏍 + //鍙栨秷鏄剧ず姘存簮 + resetWater(){ + this.watertForm.reset() + + this.watertForm.controls.areaWater.setValue('-1') + + this.map.remove(this.circleofwater) + this.waterCluster.setData([]) + } //寰幆娓叉煋鍑烘墍鏈夋按婧恗arkers - 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) + }) + 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 = ``; + 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){ + + } }) - } else { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('璇烽夋嫨姘存簮绫诲瀷','纭畾',config); - } + }); + } //璁$畻涓ゅ湴璺濈 @@ -442,24 +527,9 @@ export class GisLabelingComponent implements OnInit { } } - //鍙栨秷鏄剧ず鍗曚綅 - resetUnit(){ - this.keyUnitForm.reset() - this.keyUnitForm.controls.areaUnit.setValue('0') - this.map.remove(this.circle) - this.clearUnitMarker()//鍙栨秷鏄剧ず鍗曚綅markers - // console.log('鍙栨秷') - } - //鍙栨秷鏄剧ず姘存簮 - 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) - // console.log('鍙栨秷') - } + + //鍙充笂瑙掔偣鍑绘瘡涓涓猼itle clickTitle(index){ @@ -482,15 +552,6 @@ export class GisLabelingComponent implements OnInit { loadChange(e){ e.checked ? this.map.add(this.roadNetLayer) : this.map.remove(this.roadNetLayer); } - // floorLayer = new AMap.Buildings({ - // zooms: [16, 18], - // zIndex: 10, - // heightFactor: 2 //2鍊嶄簬榛樿楂樺害锛3D涓嬫湁鏁 - // }) - //妤煎眰鍥惧眰 - // floorChange(e){ - // e.checked ? this.map.add(this.floorLayer) : this.map.remove(this.floorLayer); - // } @ViewChild( 'appLeft',{static: false} ) appLeft:any //瀛愮粍浠 leftDivState:boolean = false; //宸︿晶宸ヤ綔鍖烘樉绀洪殣钘 @@ -556,19 +617,6 @@ export class GisLabelingComponent implements OnInit { that.map.setCity('涓婃捣甯'); AMap.plugin(["AMap.RangingTool", "AMap.MouseTool"],function () { that.mouseTool=new AMap.MouseTool(that.map); - /* that.measureDistance = new AMap.RangingTool(that.map, rulerOptions); //娴嬭窛绂 - that.measureArea = new AMap.MouseTool(that.map); //渚ч潰绉 */ - /* that.measureDistance.on('addnode',function(e){ //鐩戝惉娴嬭窛绂 鏍囩偣浜嬩欢 - that.distanceList.push(e.marker) - }) - that.measureDistance.on('end',function(e){ //鐩戝惉娴嬭窛绂 杩炵嚎浜嬩欢 - that.distanceList.push(e.polyline) - }) */ - /* that.mouseTool.on("rightclick",function(e){ - if(this.mouseTool.eventsList[1]==undefined){ - alert("000") - } - }) */ }); } @@ -1093,7 +1141,6 @@ export class LookPlanDialog { } this.http.get("/api/PlanComponents",{params:paramsData}).subscribe((data:any)=>{ this.allPlanComponents = data.items - // console.log(this.allPlanComponents) }) } //鏌ョ湅棰勬 @@ -1137,7 +1184,6 @@ export class LookPlanDialog { dialogRef.afterClosed().subscribe( data=>{ if(data){ - // console.log(123,data) this.downloadFileName = data.fileName this.download = data this.downloadFile() diff --git a/src/app/key-unit/edit-plan-info/edit-plan-info.component.html b/src/app/key-unit/edit-plan-info/edit-plan-info.component.html index c46fef7..cc729aa 100644 --- a/src/app/key-unit/edit-plan-info/edit-plan-info.component.html +++ b/src/app/key-unit/edit-plan-info/edit-plan-info.component.html @@ -7,52 +7,57 @@ - + - + - - - - + + + + - - - - + + + + + + + + + - + - + - + - + - + - + - +
+ + + + + 鍩烘湰淇℃伅鍚嶇О + visibility + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+ + + + +
+
+ +
+
+ keyboard_arrow_up + keyboard_arrow_down + + +
+
+
+ + + + + + + + + + photo_size_select_actual + + + + + + +
+

+ keyboard_arrow_up +

+

+ edit + delete +

+

+ cached + library_books +

+

+ keyboard_arrow_down +

+
+ +
+
+
+ + +
+
+ keyboard_arrow_up + keyboard_arrow_down + +
+
+ + + + + + +
+
+ +

{{items.name}}

+
+
+ +
+
+
+
+ + +
+
+ keyboard_arrow_up + keyboard_arrow_down + + +
+
+ + + +
+ +
+ edit + add + library_books + delete_forever +
+
+
+ +
+
+ + +
+ +
+ +
+ +
+
+
+ 灞炴 +
+
+ +
+

闈㈢Н(骞虫柟绫)

+
{{canvasData.selectStorey.area}}
+

璇︽儏

+
+ {{canvasData.selectStorey.details}} +
+
+ +
+

{{assetName}}

+ +
+

瀹藉害(鍍忕礌)

+ +

楂樺害(鍍忕礌)

+ +

瑙掑害

+
+ + +
+
+ +
+

鍘氬害

+
+ + +
+
+ +

鏄惁楂樹寒

+
+ + 閫変腑楂樹寒 +
+
+
+ 棰滆壊 +
+ +
+
+
+
    +
  • +
+
+ 閫忔槑搴 + + {{colorDivSliderValue}}% +
+
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+

{{item.PropertyName}}({{item.PhysicalUnit}})

+ +
+ +
+
+

{{item.PropertyName}}

+ {{imagesArr.length ? imagesArr.length : 0}} / {{item.PropertyValue}} + +
娣诲姞
+ + +
+
+
+
+ +
+
+ + delete + +
+
+
+ +
+

{{item.PropertyName}}

+ +
+ +
+

{{item.PropertyName}}

+ + +
+ +
+

{{item.PropertyName}}

+ +
+ +
+

{{item.PropertyName}}

+ +
+
+
+ +
+ +
+ +
+ +
+
+ 娑堥槻瑕佺礌 +
+
+ +
+ + + + + + + {{node.name}} + + ({{node.children.length}}) + visibility + + + + + + + {{node.name}} + + ({{node.children.length}}) + visibility + + + +
+
+
+ +
+
+
+
+ 鑺傜偣璇︽儏 +
+
+ 娉ㄦ剰浜嬮」 +
+
+
+ + +
+
+
+
+ +
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/collection-tools.component.scss b/src/app/ui/collection-tools-building/collection-tools.component.scss new file mode 100644 index 0000000..02c4e97 --- /dev/null +++ b/src/app/ui/collection-tools-building/collection-tools.component.scss @@ -0,0 +1,450 @@ +@import './panel.scss'; +.icongray{ + color: #D9D0DC; +} +.content { + width: 100%; + height: 100%; + overflow: hidden; + box-sizing: border-box; + padding: 1px; + display: flex; + flex-direction: column; + + .buildingbtnchecked{ + background-color: #34A6FD; + color: white; + } +} + +//header澶撮儴 +.header { + position: relative; + flex: 5%; + display: flex; + align-items:center; + min-height: 40px; + background-color: #fff; + .marginLeftRight { + margin: 0 8px; + font-size: 16px; + user-select:聽none; + cursor: pointer; + .mat-icon { vertical-align: middle; font-size: 24px; } + } + .copytobutn{ + width: 60px; + min-width: 60px; + display: flex; + justify-content: center; + } + span{ + height: 24px; + line-height: 24px; + } + .patternSwitch{ + position: absolute; + right: 140px; + span{ + font-size: 18px; + cursor: pointer; + margin: 0 3px; + display: inline-block; + border: 1px solid gray; + border-radius: 3px; + padding: 0 5px; + } + .selectedPattern{ + background-color: #2196f3; + color: white; + } + } + .rightSave { + cursor: pointer; + position: absolute; + right: 60px; + label { vertical-align: middle; color: #279FFF; } + } +} + +//澶撮儴鎿嶄綔鏍 +.headerOperate { + img { + width: 24px; + height: 24px; + vertical-align: middle; + margin-left: 1px; + } + span{ + font-size: 18px; + } + flex: 5%; + display: flex; + align-items:center; + min-height: 40px; + box-sizing: border-box; + margin: 3px 0; + background-color: white; + button{ + border: 0.5px solid rgb(208, 211, 214); + margin: 0 2px; + } + .editdeletebtn{ + display: none; + } + .bigeditdeletebtn:hover{ + .editdeletebtn{ + display: inline-block; + } + } +} + +//鍔熻兘鍖 +// icon缁熶竴鏍峰紡 +.mat-icon { + cursor:pointer; + vertical-align: middle; +} +//宸﹀彸涓や晶鍔熻兘鏍 缁熶竴鏍峰紡 +.publicCss { + border-radius: 5px; + position: absolute; + height: 100%; + top: 0; +} +.functionalDomain { + flex: 90%; + overflow: hidden; + .functionalDomainContent { + position: relative; + width: 100%; + height: 100%; + } + .functionalDomainLeft { + background-color: #fff; + display: flex; + flex-direction: column; + margin-left: 0px; + transition: margin-left 0.5s; + min-width: 235px; + border: 1px solid #E6EAEE; + width: 235px; + left: 0; + z-index: 111; + .leftDragDiv{ + position: absolute; + right: 0; + height: 100%; + width: 3px; + z-index: 1000; + cursor: e-resize; + } + } + .functionalDomainRight { + z-index: 1001; + margin-right: 0px; + transition: margin-right 0.5s; + border: 1px solid #464646; + width: 235px; + right: 0; + + } + //鍙宠竟瀵艰埅鏍忔樉绀洪殣钘 + .togglePanel2 { + margin-right: -2000px; + transition: margin-right 1s; + } + //宸︿晶瀵艰埅鏍忔樉绀洪殣钘 + .togglePanel { + margin-left: -2000px; + transition: margin-left 1s; + } + +} + +//鍙宠竟鎿嶄綔鏍 +.title{ + width: 100%; + height: 35px; + background-color: #464646; + div{ + width: 50%; + height: 35px; + line-height: 35px; + background-color: #595959; + border-radius: 5px; + span{ + color: white; + font-size: 14px; + font-weight: 400; + padding-left: 5px; + } + } +} + + +//鍙充晶灞炴 +.property{ + display: flex; + flex-flow: column; + .siteproperty{ + height: 100%; + overflow-y: auto; + p{ + color: #9c9fa5; + padding-left: 5px; + } + .siteproperty_size{ + background-color: #e3e3e3; + width: 93%; + margin: 0 auto; + border-radius: 3px; + min-height: 21px; + } + .rightAttribute{ + width: 12%; + height: 99.5%; + position: absolute; + top: 0; + right: 0; + bottom: 0; + border: 2px solid #464646; + } + } + .assetsproperty{ + overflow-y: auto; + height: 100%; + p{ + color: #9c9fa5; + margin:1px 0 3px 8px; + font-size: 14px; + } + span{ + font-size: 15px; + } + input{ + height: 18px; + } + .biginput{ + display: block; + width: 88%; + margin: 0 auto; + } + .smallinput{ + display: block; + width: 19%; + margin-left: 8px; + } + .textarea{ + display: block; + width: 88%; + height: 50px; + margin: 0 auto; + } + .swiper-button-next{ + right: 6px; + } + .swiper-button-prev{ + left: 6px; + } + .swiper-container{ + // --swiper-theme-color: #ff6600;/* 璁剧疆Swiper椋庢牸 */ + // --swiper-navigation-color: #00ff33;/* 鍗曠嫭璁剧疆鎸夐挳棰滆壊 */ + --swiper-navigation-size:20px;/* 璁剧疆鎸夐挳澶у皬 */ + } + .hoverred:hover{ + color: rgb(187, 28, 28); + } + .selectDiv{ + height: 21px; + position: relative; + margin-bottom: 5px; + select{ + width: 98px; + height: 22px; + vertical-align: middle; + position: absolute; + right: 10px; + top: 1px; + border: 1px solid rgb(208, 211, 214); + border-radius: 2px; + } + } + .colorBigDiv{ + width: 88%; + margin-left: 8px; + .colorBigTemplateDiv{ + span{ + color: #9c9fa5; + font-size: 14px; + height: 26px; + line-height: 26px; + } + .colorTemplateDiv{ + width: 65%; + height: 22px; + display: inline-block; + vertical-align: middle; + margin-left: 26px; + } + } + + .colorDiv{ + .colorLi{ + width: 24px; + height: 24px; + list-style: none; + float: left; + border: 2px solid white; + } + .coloractive{ + border: 2px solid black; + } + } + } + + } +} +//鍙充晶娑堥槻瑕佺礌 +.firecategories{ + background-color: #fff; + position: relative; + display: flex; + flex-flow: column; + .firecategoriesTree{ + overflow-y: auto; + height: 100%; + mat-tree-node{ + position: relative; + } + .isLookCss{ + position: absolute; + right: 6px; + } + } +} + +// 瑙e喅杞挱鍥捐摑妗嗛棶棰 +div:focus { + outline: none; +} + +//娌℃湁鍥剧墖鏃舵樉绀烘棤鍥剧墖鑳屾櫙鍥 +.noImgCss{ + background: url(../../../assets/images/noImg.png) no-repeat center center; + background-size: 88% 100%;/*鎸夋瘮渚嬬缉鏀*/ +} +.input{ + width: 18px; + height: 18px; + vertical-align: middle; + margin-left: 9px; + margin-right: 3px; +} + + +// tree +.mat-tree-node{ + min-height: 0; + height: 32px; + line-height: 32px; + font-size: 13px; + cursor: pointer; +} +.treeNode:hover{ + background-color: #ccebf8; +} +.isLookPattern{ + display: none; +} +.treeText{ + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + display: inline-block; + width: 65px; +} + +.bigBox{ + width: 700px; + height: 40px; + position: absolute; + overflow: hidden; + right: 0; +} +.weatherBox{ + height: 40px; + width: 700px; + line-height: 40px; + position: absolute; + right: 0; + transition: right linear .5s; + .openbtn{ + font-size: 45px; + height: 45px; + width: 40px; + } + .name{ + font-size: 16px; + vertical-align: middle; + margin-left: 3px; + } + input{ + width: 140px; + height: 22px; + margin-left: 3px; + } + select{ + width: 96px; + height: 25px; + margin-left: 3px; + vertical-align: middle; + } +} +.open{ + right: 0px; +} +.close{ + right:-622px; +} +.bottomCss{ + position: absolute; + left: 232px; + right: 0px; + bottom: 0; + height: 158px; + width: auto; + z-index: 100; + background-color: white; + border: 1px solid #464646; + .dragDiv{ + width: 100%; + height: 3px; + position: absolute; + top: 0; + z-index: 1000; + cursor: n-resize; + } + .title{ + height: 35px; + background-color: #464646; + div{ + background-color: #464646; + float: left; + width: 80px; + color: white; + font-size: 13px; + padding-left: 5px; + cursor: pointer; + } + .detailsAndattentBtn{ + background-color: #595959; + } + } + .body{ + textarea{ + width: 100%; + border-radius: 0px; + } + } +} \ No newline at end of file diff --git a/src/app/ui/collection-tools-building/collection-tools.component.spec.ts b/src/app/ui/collection-tools-building/collection-tools.component.spec.ts new file mode 100644 index 0000000..acc7d5e --- /dev/null +++ b/src/app/ui/collection-tools-building/collection-tools.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CollectionToolsComponent } from './collection-tools.component'; + +describe('CollectionToolsComponent', () => { + let component: CollectionToolsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CollectionToolsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CollectionToolsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/collection-tools-building/collection-tools.component.ts b/src/app/ui/collection-tools-building/collection-tools.component.ts new file mode 100644 index 0000000..fb2e03b --- /dev/null +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -0,0 +1,2391 @@ +import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContainerRef } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent} from './leftFunctionalDomain' +import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; +import {FlatTreeControl} from '@angular/cdk/tree'; +import {WorkingAreaComponent} from '../../working-area/working-area.component' +import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service' //寮曞叆鏈嶅姟 +import Viewer from 'viewerjs'; +import Swiper from 'swiper'; +import { saveOneDialogBuilding } from './save'; +import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree'; +import { Observable, of } from 'rxjs'; +import { GameMode } from 'src/app/working-area/model/gameMode'; +import { ActivatedRoute, Router } from '@angular/router'; +import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service'; +import { MaskLayerService } from 'src/app/mask-layer.service'; +import * as ObjectID from 'bson-objectid'; + +@Component({ + selector: 'app-collection-tools-building', + templateUrl: './collection-tools.component.html', + styleUrls: ['./collection-tools.component.scss'] +}) +export class CollectionToolsBuildingComponent 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) { } + @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; + // tree閰嶇疆 + private _transformer = (node, level: number) => {//瑕佺粰娓叉煋鑺傜偣浼犻偅浜涘睘鎬у弬鏁 + return { + expandable: !!node.children && node.children.length > 0, + name: node.name || node.Name, + level: level, + id: node.id || node.Id, + children:node.children, + isTemplate:node.isTemplate, + isNewElement:node.isNewElement, + isLook:node.isLook, + isLookPattern:node.isLookPattern || null + }; + } + treeControl = new FlatTreeControl(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); + hasChild = (_: number, node: any) => node.expandable; + + colors = ['#076eec','#4dd0e1','#00ee76','#ffff00','#eeb422', + '#FF6A6A','#ff0000','#ff6eb4','#00bfff','#54ff9f', + '#009688','#836fff','#ff8c00','#ee00ee','#ffa07a', + '#00C500','#00ffff','#6495ed','#ffdAb9','#AA00FF'] + selected = "1" //鍥炬爣澶у皬閫夋嫨妗 + + allBuildings //璇ュ崟浣嶆墍鏈夊缓绛 + beforeOneCheckedBuilding:any; //褰撳墠鐐瑰嚮閫夋嫨鐨勫缓绛 + checkedBuildingIndex:number = 0; //褰撳墠鐐瑰嚮閫夋嫨鐨勫缓绛慽ndex + isEditPat:boolean = true; //褰撳墠鏄惁鏄紪杈戞ā寮 + + assetName:String//绱犳潗鍚嶇О + assetWidth:number//绱犳潗瀹藉害 + assetHeight:number//绱犳潗楂樺害 + sliderValue:number = 0//瑙掑害婊戠鐨勫 + sliderValueThickness:number = 0//鍘氬害婊戠鐨勫 + isHighLight:boolean = false//鏄惁楂樹寒閫夋嫨妗 + PropertyInfos = [] //鍘婚櫎鍥剧墖閾炬帴鐪熸鐢ㄤ簬寰幆鐨勫唴瀹 + imagesArrNum //绱犳潗灞炴у浘鐗囨暟閲忎笂闄 + imagesArr = [] //灞炴т腑鐨勫浘鐗囬摼鎺ラ泦鍚 + clickedIndex //鐐瑰嚮鍥剧墖鏃剁殑绱㈠紩鍊 + + //浼犲叆绱犳潗瀵硅薄锛岃缃彸渚у睘鎬ф爮鍐呭 + canvasAssetObj //浼犲叆鐨勭礌鏉愬睘鎬у璞 + isImgNumCss = false //鎺у埗涓婁紶鏂囦欢input鏄鹃殣 + mySwiper:any //杞挱鍥惧疄渚 + + gallery//viewerJs瀹炰緥 + //璁剧疆灞炴ф + setAssetsProperty(obj){ + //鍒濆鍖杤iewerJs瀹炰緥 + setTimeout(() => { + obj.PropertyInfos.forEach(item => { + if(item.PropertyType == 4){ + this.gallery = new Viewer(document.getElementById('viewerjs'),{ + url: 'data-original' + }); + } + }) + }, 0); + + //浠庨鑹蹭腑鍙栧嚭閫忔槑搴 + let color = obj.Color + let strh = color.substring(color.length -2,color.length) + let opacity = Math.round(parseInt(strh,16)/255 * 100) + this.colorDivSliderValue = opacity + + this.isShowProperty = true + this.isShowAttribute = false + let _this = this + this.imagesArr = [] + this.imagesArrNum = "" + + this.canvasAssetObj = obj //灏嗛変腑绱犳潗瀵硅薄瀛樺埌鏈湴鍙橀噺 + + this.assetName = obj.Name + this.assetWidth = obj.Width + this.assetHeight = obj.Height + this.sliderValue = obj.Angle + this.selectedcolor = obj.Color + this.PropertyInfos = obj.PropertyInfos + this.sliderValueThickness = obj.Thickness + this.PropertyInfos.forEach(item => { + if(item.PropertyType == 3){ //濡傛灉鏄浘鐗囬摼鎺ョ被鍨 + this.imagesArr.push(item) + } + if(item.PropertyType == 4){//鍥剧墖鏁板间笂绾 + this.imagesArrNum = item.PropertyValue + } + }) + + //濡傛灉瀛樺湪鍥剧墖鍒欏姞杞借疆鎾浘 + if(this.imagesArr.length){ + setTimeout(() => { + this.mySwiper = new Swiper('.swiper-container',{ + loop: false, + // grabCursor: true, + // 濡傛灉闇瑕佸墠杩涘悗閫鎸夐挳 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + on:{ + click: function(){ + _this.clickedIndex = this.clickedIndex + }, + } + }); + }, 0); + } + //鍒ゆ柇姝ゆ椂鍥剧墖鏁伴噺鏄惁杈惧埌涓婇檺 + if(this.imagesArr.length < this.imagesArrNum){//濡傛灉涓嶈秴鍑 + this.isImgNumCss = true + }else{ + this.isImgNumCss = false + } + } + pattern:boolean = true//榛樿涓哄熀鏈俊鎭紪杈 + + //鍩烘湰淇℃伅缂栬緫妯″紡 + baseInfo(){ + if (!this.pattern) { + this.pattern = true + this.canvasData.gameMode = GameMode.BasicInformation + this.canvasData.selectPanelPoint = new DisposalNodeData(); + this.mateDeleteCustomize() + this.getAllLibrary() + this.checkedBuildingIndex = -1 + this.getSitePlan() //鎬诲钩闈㈠浘涓灞 + } + } + + //鎯冲畾浣滀笟缂栬緫妯″紡 + wantWork(){ + if (this.pattern) { + this.pattern = false + this.canvasData.gameMode = GameMode.Assignment + this.getAllLibrary('plan') + this.getDisposalNode() + } + } + + //ngzorro tree 鎷栨嫿 + nzEvent(event: NzFormatEmitEvent): void { + if(this.isDrag){ + let parentId + if(this.pos == 0){ + parentId = event.node.key + }else{ + if(event.node.level == 0){ + parentId = null + }else{ + parentId = event.node.origin.parentId + } + } + + + let orders = {} + let originalData = JSON.parse(JSON.stringify( this.canvasData.allDisposalNode || [] )) //tree鍘熷鏁版嵁 + let targetNodeData = []//鎷栧姩绉诲叆鑺傜偣鐨勬暟鎹紝鐢ㄤ簬閬嶅巻姹傚嚭鏀惧湪璇ユ暟缁勭殑绗嚑浣 + + //鎵惧埌闇瑕侀噸鏂版帓搴忕殑鏁扮粍 + if(this.pos == 0){ + originalData.forEach(item => { + if(item.parentId == event.node.key){ + targetNodeData.push(item) + } + }) + }else{ + if(event.node.origin.parentId){//濡傛灉鎷栧姩鐩爣涓洪潪涓绾ц妭鐐 + originalData.forEach(item => { + if(item.parentId == event.node.origin.parentId){ + targetNodeData.push(item) + } + }) + }else{//濡傛灉鎷栧姩鐩爣涓轰竴绾ц妭鐐 + originalData.forEach(item => { + if(!item.parentId){ + targetNodeData.push(item) + } + }) + } + } + + + let idArr = [] + targetNodeData.forEach(i => { + idArr.push(i.id) + }) + if(this.pos == 0 && event.node.origin.children.length == 1){ + let key = event.dragNode.key + orders[key] = 0 + parentId = event.node.key + }else{ + let array = [] + targetNodeData.forEach(item => { + if(item.id != event.dragNode.key){ //灏嗘嫋鍔ㄩ」鍏堢Щ闄ゆ帀 + array.push(item) + } + }) + if(event.dragNode.isEnd[event.dragNode.isEnd.length - 1]){ //濡傛灉绉诲叆鍒版渶鍚庝竴涓 + array.push(event.dragNode.origin) + }else if(event.dragNode.isStart[event.dragNode.isStart.length - 1]){//濡傛灉绉诲叆鍒扮涓涓 + array.unshift(event.dragNode.origin) + }else{//濡傛灉绉诲叆涓棿浣嶇疆 + array.splice(event.node.origin.order, 0, event.dragNode.origin) + } + array.forEach((item,key) => { + orders[item.id] = key + }) + } + + let obj ={ + id : event.dragNode.origin.id, + parentId : parentId, + orders : orders + } + + this.http.put("/api/DisposalNodes/Sort",obj).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鎺掑簭鎴愬姛','纭畾',config) + this.refurbishTreeData() + }) + } + } + + isDrag //鏄惁鍙互鎷栧姩 + pos//鏀剧疆浣嶇疆 + beforeDrop = (arg: NzFormatBeforeDropEvent) => { + if(arg.dragNode.origin.isDataNode && arg.node.level === 0){//濡傛灉涓烘暟鎹妭鐐瑰垯涓嶅厑璁告嫋鍒颁竴绾ц妭鐐 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏁版嵁鑺傜偣涓嶅厑璁告嫋鎷藉埌涓绾ц妭鐐','纭畾',config) + this.isDrag = false + return of(false); + }else if(!arg.dragNode.origin.isDataNode && arg.node.level === 2){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('澶勭疆鑺傜偣涓嶅厑璁告嫋鎷藉埌涓夌骇鑺傜偣','纭畾',config) + this.isDrag = false + return of(false); + }else{ + this.isDrag = true + this.pos = arg.pos + return of(true) + } + } + //ngzorro tree 鎷栨嫿 + + //澶╂皵鏍忕洰 + weatherBtn = true + weatherBtnShow(){ + this.weatherBtn = !this.weatherBtn + } + weatherBtnHidden(){ + this.weatherBtn = !this.weatherBtn + } + + //搴曢儴鍒囨崲鎸夐挳div + detailsAndattentBtn = true + //鑺傜偣璇︽儏 + details(){ + this.detailsAndattentBtn = true + } + //娉ㄦ剰浜嬮」 + attent(){ + this.detailsAndattentBtn = false + } + + //娑堥槻瑕佺礌div杈规楂樺害璋冭妭 + firecategoriesDivMouseDown(e){ + document.onmousemove = (ev) => { + let bodyHeight = document.body.clientHeight //缃戦〉瀹藉害 + let maxHeight = this.element.nativeElement.querySelector('#rightDiv').clientHeight - 35 //鏈澶у搴 + if(bodyHeight - ev.clientY >= maxHeight){ + this.element.nativeElement.querySelector('#firecategories').style.height = maxHeight+ 'px' + this.element.nativeElement.querySelector('#property').style.height = 35+ 'px' + }else{ + this.element.nativeElement.querySelector('#firecategories').style.height = (bodyHeight - ev.clientY) + 'px' ; + this.element.nativeElement.querySelector('#property').style.height = (this.element.nativeElement.querySelector('#rightDiv').clientHeight - this.element.nativeElement.querySelector('#firecategories').clientHeight) + 'px' + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + //宸︿晶div杈规瀹藉害璋冭妭 + leftDivMouseDown(e){ + document.onmousemove = (ev) => { + let bodyWidth = document.body.clientWidth //缃戦〉瀹藉害 + let maxWidth = bodyWidth - 260 - this.element.nativeElement.querySelector('#rightDiv').clientWidth //鏈澶у搴 + if(ev.clientX - 240 >= maxWidth){ + this.element.nativeElement.querySelector('#leftDiv').style.width = maxWidth + 'px' + }else{ + this.element.nativeElement.querySelector('#leftDiv').style.width = ev.clientX - 260 + 'px'; + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + //搴曢儴div楂樺害璋冭妭 + bottomDivMouseDown(e){ + document.onmousemove = (ev) => { + let bodyHeight = document.body.clientHeight //缃戦〉楂樺害 + let maxHeight = this.element.nativeElement.querySelector('#rightDiv').clientHeight //鏈澶ч珮搴 + if(bodyHeight - ev.clientY >= maxHeight){ + this.element.nativeElement.querySelector('#bottomDiv').style.height = maxHeight + 'px' + }else{ + this.element.nativeElement.querySelector('#bottomDiv').style.height = (bodyHeight - ev.clientY) + 'px' ; + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + //鍙充晶div杈规瀹藉害璋冭妭 + rightDivMouseDown(e){ + document.onmousemove = (ev) => { + let bodyWidth = document.body.clientWidth //缃戦〉瀹藉害 + let maxWidth = bodyWidth - 240 - this.element.nativeElement.querySelector('#leftDiv').clientWidth //鏈澶у搴 + if(bodyWidth - ev.clientX >= maxWidth){ + this.element.nativeElement.querySelector('#rightDiv').style.width = maxWidth + 'px' + }else{ + this.element.nativeElement.querySelector('#rightDiv').style.width = bodyWidth - ev.clientX + 'px'; + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + //鏀惧ぇ鍥炬爣 + iconScale(){ + let number = Number(this.selected) + this.canvas.setIconScale(number) + } + + //绱犳潗瀹藉害杈撳叆妗嗘敼鍙 + assetWidthIunput(){ + this.canvasAssetObj.Width = this.assetWidth + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + //绱犳潗楂樺害杈撳叆妗嗘敼鍙 + assetHeightIunput(){ + this.canvasAssetObj.Height = this.assetHeight + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + //绱犳潗瑙掑害杈撳叆妗嗘敼鍙 + assetAngleIunput(){ + this.canvasAssetObj.Angle = this.sliderValue + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + //绱犳潗鍘氬害杈撳叆妗嗘敼鍙 + assetThicknessIunput(){ + this.canvasAssetObj.Thickness = this.sliderValueThickness + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + //绱犳潗鏄惁楂樹寒鏀瑰彉----->鏈湴鎿嶄綔琛屼负 + assetHighLightIunput(){ + + } + + //鍔ㄦ佸睘鎬х礌鏉恑nput妗嗗兼敼鍙 + assetInputChange(i,e){ + let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + //鍔ㄦ佸睘鎬х礌鏉愬竷灏斿兼鏀瑰彉radio + assetRadioChange(i,boolean){ + let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = boolean + this.canvasData.isChange = true + } + + colorIndex//榛樿绱犳潗棰滆壊 + selectedcolor//鐐瑰嚮閫夋嫨鐨勯鑹 + //閫夋嫨绱犳潗棰滆壊 + selectcolor(item,key){ + //鍦ㄥ綋鍓嶉忔槑搴﹀熀纭涓婃敼鍙橀鑹 + this.selectedcolor = item + this.selectedcolor.substring(this.selectedcolor.length-2) + this.canvasAssetObj.Color = this.selectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + //棰滆壊閫夋嫨婊戠鐨勫 + colorDivSliderValue + colorDivSliderChange(){ + let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) + //鏍规嵁婊戠鍊兼敼鍙16杩涘埗棰滆壊鍚庝袱浣 + function replacepos(text,start,stop,replacetext){ + let mystr = text.substring(0,stop-1)+replacetext+text.substring(stop+1); + return mystr; + } + this.selectedcolor = replacepos(this.selectedcolor,7,8,colorOpacity.toString(16)) + this.canvasAssetObj.Color = this.selectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + //鏌ョ湅鍥剧墖璇︽儏 + lookImg(){ + const dialogRef = this.dialog.open(ViewDetailsBuilding, {//璋冪敤open鏂规硶鎵撳紑瀵硅瘽妗嗗苟涓旀惡甯﹀弬鏁拌繃鍘 + data: {imagesArr:this.imagesArr,index:this.clickedIndex} + }); + dialogRef.afterClosed().subscribe(data=>{ }); + } + + //涓婁紶绱犳潗鍥剧墖 + selectFile(e){ + let imgFile = e.target.files[0] || null //涓婁紶鐨勬枃浠 + this.startUploading(imgFile) + } + objectName:any //涓婁紶瀵硅薄鍚 + startUploading (imgFile) { + let _this = this + let file = imgFile || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let shardSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + let companyId = sessionStorage.getItem("companyId") + if (file && fileSize <= shardSize) { //涓婁紶鏂囦欢<=5MB鏃 + let formData = new FormData() + formData.append("file",file) + this.http.post(`api/Objects/WebPlan2D/${companyId}`,formData).subscribe((data:any)=>{ + this.objectName = data.objectName + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶鎴愬姛','纭畾',config) + + //鍦ㄥ師濮嬬礌鏉愬璞″拰闇瑕佸惊鐜浘鐗囩殑瀵硅薄涓垎鍒玴ush鏈鏂颁笂浼犵殑鍥剧墖 + let imgObj = { + "Tag": null, + "Order": 0, + "Enabled": false, + "Visible": false, + "Required": false, + "RuleName": null, + "RuleValue": null, + "PhysicalUnit": null, + "PropertyName": "鍥剧墖", + "PropertyType": 3, + "PropertyValue": "/api/Objects/WebPlan2D/" + this.objectName + } + + this.imagesArr.push(imgObj) + this.canvasAssetObj.PropertyInfos.push(imgObj) + + setTimeout(() => { + this.mySwiper = new Swiper('.swiper-container',{ + loop: false, + // grabCursor: true, + // 濡傛灉闇瑕佸墠杩涘悗閫鎸夐挳 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + on:{ + click: function(){ + _this.clickedIndex = this.clickedIndex + }, + } + }); + + this.mySwiper.slideTo(this.imagesArr.length - 1) + this.gallery.update() + }, 0); + + //鍒ゆ柇涓婁紶绱犳潗灞炴у浘鐗囨槸鍚﹁秴鍑烘暟閲 瓒呭嚭鏁伴噺鍒欓殣钘廼nput妗 + if(this.imagesArr.length < this.imagesArrNum){//涓嶈秴鍑篿nput鎵嶄細鏄剧ず + this.isImgNumCss = true + }else{ + this.isImgNumCss = false + } + + this.canvasData.isChange = true + }) + } else if (file && fileSize>shardSize) { //涓婁紶鏂囦欢>5MB鏃,鍒嗗潡涓婁紶 + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶鍥剧墖鏂囦欢涓嶅厑璁稿ぇ浜5mb','纭畾',config); + } + + } + + //涓嶈兘涓婁紶鍥剧墖鎻愮ず + imgNumBeyond(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍥剧墖鏁伴噺宸茶揪涓婇檺','纭畾',config); + } + + //鍒犻櫎绱犳潗灞炴у浘鐗 + deleteImg(){ + if(this.imagesArr.length == 0){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('娌℃湁鍙垹闄ょ殑鍥剧墖锛岃鍏堜笂浼','纭畾',config) + }else{ + // 鍦ㄧ礌鏉愬師濮嬪璞′腑灏嗗垹闄ょ殑鍥剧墖鍘绘帀 + this.canvasAssetObj.PropertyInfos = [...this.canvasAssetObj.PropertyInfos.filter((item)=>{ + return item.PropertyValue != this.imagesArr[this.mySwiper.activeIndex].PropertyValue + })] + //鍦ㄥ浘鐗囧惊鐜暟缁勪腑灏嗗浘鐗囧幓鎺 + this.imagesArr.splice(this.mySwiper.activeIndex, 1); + //鏇存柊swiper瑙嗗浘 + setTimeout(() => { + this.mySwiper.update(); + this.gallery.update() + }, 0); + + //灏嗕笂浼犵殑input妗嗘樉绀哄嚭鏉 + this.isImgNumCss = true; + //娓呴櫎鍥剧墖缂撳瓨 + if((document.getElementById('inputimg'))){ + (document.getElementById('inputimg')).value = null //娓呯┖input妗嗙紦瀛 + } + + this.canvasData.isChange = true + } + } + + //鍔ㄦ佸睘鎬ф柟鍚憇elect閫夋嫨妗 + direction(i,e){ + let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + } + + //鍔ㄦ佸睘鎬т緵缁欏尯鍩焥elect閫夋嫨妗 + supplyArea(i,e){ + let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + } + + //鍔ㄦ佸睘鎬т緵缁欑被鍨媠elect閫夋嫨妗 + supplyType(i,e){ + let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + } + + + isSixShow = true + isSixbtn = true //鎺у埗鎯冲畾浣滀笟缂栬緫鎸夐挳 + isediticon = true //鎺у埗鏌ョ湅缂栬緫妯″紡鐨勭紪杈戞ā寮忓皬绗旀寜閽 + ngOnInit(): void { + + if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ + this.isSixbtn = false + } + + if(!this.isSixbtn && sessionStorage.getItem("six") == "edit"){ + this.isSixShow = true + } + if(!this.isSixbtn && sessionStorage.getItem("six") == "look"){ + this.isEditPattern = false + this.isediticon = false + } + //gis妯″潡骞抽潰鍥 + if(this.router.url.indexOf("gis") != -1 && sessionStorage.getItem("gisplan") == "look"){ + this.isEditPattern = false + this.isediticon = false + this.canvasData.gameMode = GameMode.Assignment + } else { + this.getAllLibrary() //鑾峰彇绱犳潗搴 + } + + let that = this + window.setTimeout(()=>{ + document.getElementById("functionalDomainContent").oncontextmenu = function (event) { + // that.canvas.cancelPaint() + that.selectImageIndex = -1 + event.preventDefault(); + }; + }) + + this.canvasData.getMessage().subscribe((message: any)=>{ + if(message == "send a message"){ + this.refurbishTreeData() + } + }) + } + + + + ngAfterViewInit(): void { + //gis妯″潡骞抽潰鍥 + if(this.router.url.indexOf("gis") == -1) { + this.getAllBuildings(true) //鑾峰彇鎵鏈夊缓绛 + } + // 鐩戝惉canvas缁勪欢閫変腑绱犳潗浜嬩欢 + this.canvas.on("select",obj=>{ + //閫変腑绱犳潗灞炴ф敞鍏ュ嚱鏁 + this.setAssetsProperty(obj.assetData) + }) + // 鐩戝惉canvas缁勪欢鍙栨秷閫変腑绱犳潗浜嬩欢 + this.canvas.on("deselect",obj=>{ + this.isShowProperty = false + }) + //鐩戝惉鏁版嵁鍙樺寲鍚 + this.canvas.on('canvasDataChanged',()=>{ + // 鏀跺埌鏁版嵁琛ㄧず鍏变韩鏁版嵁鍙戠敓鍙樺寲 + this.renovateTreeData(false) + }); + } + + copyAssetData:any //瀛樺偍鐢ㄤ簬澶嶅埗鐨勭礌鏉 + //澶嶅埗绱犳潗 + copyAsset(){ + this.canvas.copy() + } + //绮樿创绱犳潗 + pasteAsset(){ + let companyId = sessionStorage.getItem("companyId") + let buildingId = this.beforeOneCheckedBuilding.id + let floorId = this.selectingSitePlan.id + this.canvas.paste(companyId,buildingId,floorId) + this.renovateTreeData(false) + } + + basicInfo:boolean = true //鍩烘湰淇℃伅鍚嶇О鏄鹃殣 + wantToWork:boolean = true //鎯冲畾浣滀笟鍚嶇О鏄鹃殣 + //鐐瑰嚮鍩烘湰淇℃伅鍚嶇О + basicInfoClick(){ + this.basicInfo = !this.basicInfo + this.canvas.setNameVisible(this.basicInfo,0) + } + + //鐐瑰嚮鎯冲畾浣滀笟鍚嶇О + wantToWorkClick(){ + this.wantToWork = !this.wantToWork + this.canvas.setNameVisible(this.wantToWork,1) + } + + isEditPattern:boolean = true //鏄惁涓虹紪杈戞ā寮 + //杩涘叆缂栬緫妯″紡 + editpat(){ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('杩涘叆缂栬緫妯″紡','纭畾',config); + this.isEditPattern = true + } + + //杩涘叆鏌ョ湅妯″紡 + lookpat(){ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('杩涘叆鏌ョ湅妯″紡','纭畾',config); + this.isEditPattern = false + } + + //淇濆瓨骞抽潰鍥 + saveNum :any = [] + saveSite(){ + //鏇存柊鐢ㄤ簬缁熻鐨勬暟鎹 + this.canvasData.updateBuildingData() + + + if (this.selectingSitePlan && this.selectingSitePlan.id) { + //鎵撳紑閬僵灞 + this.maskLayerService.sendMessage(true) + this.saveNum = [] + let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); + SitePlanData.data = JSON.stringify(SitePlanData.data) + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + + let object = this.canvasData.originalcompanyBuildingData.data + let adjoinArr = [] //姣楅偦鏁扮粍 + + if(this.pattern){//濡傛灉鏄熀鏈俊鎭紪杈戞ā寮 + for (const key in object) { + if (object[key].Name == "姣楅偦") {//濡傛灉鏄浉鍚屾ゼ灞傦紝鍒欑瓫閫夊嚭姣楅偦 + + object[key].PropertyInfos.forEach(element => { + if(element.PropertyName == "鏂瑰悜"){ + adjoinArr.push(element.PropertyValue) + } + }); + } + } + + if((new Set(adjoinArr)).size != adjoinArr.length){ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触锛屾瘲閭诲瓨鍦ㄧ浉鍚屾柟鍚','纭畾',config); + return false + }else{ + //濡傛灉鏄崟浣 鎬诲钩闈㈠浘 + if(this.checkedBuildingIndex==-1){ + // console.log(111,SitePlanData) + //淇濆瓨骞抽潰鍥炬暟鎹 + this.http.post("/api/SitePlanData",SitePlanData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('骞抽潰鍥炬暟鎹繚瀛樺け璐','纭畾',config); + }) + + //淇濆瓨寤虹瓚鏁版嵁 + this.http.post("/api/CompanyData",CompanyData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('鍗曚綅鏁版嵁淇濆瓨澶辫触','纭畾',config); + }) + + //鎵归噺淇濆瓨鍗曚綅姣楅偦 + let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() + this.http.post("/api/CompanyAdjoins/Batch",CompanyAdjoins,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + if(err == 'infos 鏈夐噸澶嶆柟鍚戯紒'){ + this.snackBar.open('鍗曚綅姣楅偦鍚屾澶辫触,瀛樺湪鐩稿悓鏂瑰悜','纭畾',config); + }else{ + this.snackBar.open('鍗曚綅姣楅偦鍚屾澶辫触','纭畾',config); + } + }) + + //鎵归噺淇濆瓨鍗曚綅閲嶇偣閮ㄤ綅 + let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() + this.http.post("/api/CompanyImportantLocations/Batch",CompanyImportantLocations,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('鍗曚綅閲嶇偣閮ㄤ綅鍚屾澶辫触','纭畾',config); + }) + + //鎵归噺淇濆瓨鍗曚綅娑堥槻璁炬柦绱犳潗 + let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() + this.http.post("/api/CompanyFacilityAssets/Batch",CompanyFacilityAssets,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('鍗曚綅娑堥槻璁炬柦绱犳潗鍚屾澶辫触','纭畾',config); + }) + + }else{ //濡傛灉鏄缓绛 + + //寤虹瓚骞抽潰鍥炬暟鎹 + this.http.post("/api/BuildingAreaData",SitePlanData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('骞抽潰鍥炬暟鎹繚瀛樺け璐','纭畾',config); + }) + + //寤虹瓚鏁版嵁 + this.http.post("/api/BuildingData",CompanyData,{ + params:{ + companyId:this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('鍗曚綅鏁版嵁淇濆瓨澶辫触','纭畾',config); + }) + + //鎵归噺淇濆瓨寤虹瓚姣楅偦 + let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() + this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + if(err == 'infos 鏈夐噸澶嶆柟鍚戯紒'){ + this.snackBar.open('寤虹瓚姣楅偦鍚屾澶辫触,瀛樺湪鐩稿悓鏂瑰悜','纭畾',config); + }else{ + this.snackBar.open('寤虹瓚姣楅偦鍚屾澶辫触','纭畾',config); + } + }) + + //鎵归噺淇濆瓨寤虹瓚閲嶇偣閮ㄤ綅 + let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() + this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('寤虹瓚閲嶇偣閮ㄤ綅鍚屾澶辫触','纭畾',config); + }) + + //鎵归噺淇濆瓨寤虹瓚娑堥槻璁炬柦绱犳潗 + let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() + this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => { + this.saveNum.push("1") + if(this.saveNum.length == 5){ + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config); + this.tabbarService.sendMessage('changeScore'); + } + },err=>{ + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('寤虹瓚娑堥槻璁炬柦绱犳潗鍚屾澶辫触','纭畾',config); + }) + + } + } + }else{//濡傛灉鏄兂瀹氫綔涓氱紪杈戞ā寮 + const dialogRef = this.dialog.open(saveOneDialogBuilding, { + data: {allDisposalNode: this.canvasData.allDisposalNode, + selectedBuildingData:this.beforeOneCheckedBuilding, + selectedSiteData:this.selectingSitePlan, + siteOrbuilding:this.checkedBuildingIndex, + disasterId: this.allFirePlan[0].id || '' + } + }); + + dialogRef.afterClosed().subscribe(result => { + // console.log('The dialog was closed'); + }); + } + + } else { //if + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏆傛棤妤煎眰鏁版嵁','纭畾',config); + } + } + + //鑾峰緱鎵鏈夌殑寤虹瓚鐗 + getAllBuildings(init:boolean = false){ + this.http.get("/api/Buildings",{ params:{companyId : this.params.companyId}}).subscribe((data:any)=>{ + this.allBuildings = data + if (init) { + this.checkedBuildingIndex = 0 + data && data.length? this.beforeOneCheckedBuilding = data[0] : this.beforeOneCheckedBuilding = {id:null, buildingTypes:[{id:null}]} + this.getBuildingSitePlan(this.beforeOneCheckedBuilding) + } //if + }) + } + + //鎷栨嫿tree + drop(e){ + // console.log(1111,e) + } + drop2(e){ + // console.log(222,e) + } + + //鍒涘缓寤虹瓚 + createBuilding(){ + let data = { + allBuildings:this.allBuildings, + companyId :this.params.companyId + } + let dialogRef = this.dialog.open(CreateBuildingBuilding,{data}); + dialogRef.afterClosed().subscribe(data=>{ + if (data == "鍒涘缓鎴愬姛") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍒涘缓鎴愬姛','纭畾',config); + this.allBuildings.length? this.getAllBuildings() : this.getAllBuildings(true) + }else if (data == "鍒涘缓澶辫触") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍒涘缓澶辫触','纭畾',config); + } + }); + } + + //閫夋嫨寤虹瓚 + checkedBuilding(item,index){ + if (this.checkedBuildingIndex!=index) { + + if (this.canvasData.isChange) { //true 鏁版嵁琚敼鍔 + let isTrue = confirm('鏄惁淇濆瓨褰撳墠缂栬緫鏁版嵁') + if (isTrue) { //鍏堜繚瀛樻暟鎹 鍦ㄥ垏鎹 + let isSuccess = this.saveSite()//true鐨勬椂鍊 鍏堜繚瀛樻暟鎹 + if (isSuccess != false) { + this.beforeOneCheckedBuilding = item + this.checkedBuildingIndex = index + if (index==-1) { //鎬诲钩闈㈠浘鏁版嵁 + this.getSitePlan() + } else { //寤虹瓚妤煎眰/鍖哄煙鏁版嵁 + this.getBuildingSitePlan(item) + } + } + } else { + this.beforeOneCheckedBuilding = item + this.checkedBuildingIndex = index + if (index==-1) { //鎬诲钩闈㈠浘鏁版嵁 + this.getSitePlan() + } else { //寤虹瓚妤煎眰/鍖哄煙鏁版嵁 + this.getBuildingSitePlan(item) + } + } + } else { //flase 鏁版嵁鏈鏀瑰姩 + this.beforeOneCheckedBuilding = item + this.checkedBuildingIndex = index + if (index==-1) { //鎬诲钩闈㈠浘鏁版嵁 + this.getSitePlan() + } else { //寤虹瓚妤煎眰/鍖哄煙鏁版嵁 + this.getBuildingSitePlan(item) + } + } //if + + } //if + } + + //缂栬緫寤虹瓚 + editBuilding(e,item){ + e.stopPropagation(); + let dialogRef = this.dialog.open(EditBuildingBuilding,{data: {item:item}}); + dialogRef.afterClosed().subscribe(data=>{ + if (data == "淇敼鎴愬姛") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇敼鎴愬姛','纭畾',config); + this.getAllBuildings() + }else if (data == "淇敼澶辫触") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇敼澶辫触','纭畾',config); + } + }); + } + + //鍒犻櫎寤虹瓚 + deleteBuilding(e,item){ + e.stopPropagation(); + if(confirm("鏄惁鍒犻櫎璇ュ缓绛") == true){ + let isHave = this.canvasData.allDisposalNode.find(items=>{ return items.buildingId === item.id }) + if (isHave == undefined) { + this.http.delete(`/api/Buildings/${item.id}`).subscribe(data=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍒犻櫎鎴愬姛','纭畾',config); + this.getAllBuildings(true) + },err=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍒犻櫎澶辫触','纭畾',config); + this.getAllBuildings(true) + }) + } else { //寤虹瓚 鍚湁鏁版嵁鑺傜偣鏃 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍚湁鏁版嵁鑺傜偣鐨勫缓绛戜笉鍏佽鍒犻櫎','纭畾',config); + } + } + } + + storeyData //灏嗗缓绛戠礌鏉愬拰褰撳墠妤煎眰绱犳潗鍚堜簩涓轰竴 + + //澶勭悊 tree 鏁版嵁缁撴瀯 + handleTreeData (storeyData) { + + this.storeyData = storeyData + let data = this.allFireElements //鎵鏈夋秷闃茶绱犳ā鏉 + let treeData = [] //tree鍨 澶勭悊瀹屾垚鍚庣殑鏁版嵁 + data.forEach(element => { + element.isTemplate = true //娣诲姞妯℃澘鏍囪瘑 + element.isLook = true //娣诲姞鏄惁鍙鏍囪瘑 + element.name!='鍏朵粬'? element.children = [] : null + + if(storeyData){ + for(let key in storeyData.data){ + storeyData.data[key].isLookPattern = true + if(element.id == storeyData.data[key].FireElementId){ + storeyData.data[key].isTemplate = false + storeyData.data[key].isLook = true + + element.isNewElement = true //璇ヨ妭鐐筩hildren鏄惁瀛樺湪鏂版坊鍔犵殑鐪熷疄绱犳潗 鏍囪瘑 + + //瀹氫箟鏌ョ湅妯″紡涓嬭兘鐪嬪埌鐨勫厓绱 + element.isLookPattern = true + if(element.parentId){ + data.forEach(i => { + if(i.id == element.parentId){ + i.isLookPattern = true + } + }) + } + // + + element.children.push(storeyData.data[key]) + } + } + } + data.forEach(item => { if (item.parentId == element.id) {element.children.push(item)} }); + }); + data.forEach(element => { + if (!element.parentId) { treeData.push(element) } + }); + this.dataSource.data = treeData + this.treeControl.expandAll() + + } + + //鐐瑰嚮鏍戣妭鐐 + clickTreeNode(node){ + if(this.canvasData.originalcompanyBuildingData.data[node.id]){ + this.setAssetsProperty(this.canvasData.originalcompanyBuildingData.data[node.id]) + }else if(this.canvasData.originaleveryStoreyData.data[node.id]){ + this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[node.id]) + } + + //canvas涓婄殑绱犳潗楂樹寒 + let iconHighLightArr:any = [] + if(node.isTemplate){//濡傛灉鏄ā鏉,鍒欏紑濮嬪悜涓嬫壘 + node.children.forEach(item => { + if(item.isTemplate){//濡傛灉瀛愯妭鐐逛緷鏃ф槸妯℃澘,鍒欑户缁紑濮嬪悜涓嬫壘 + item.children.forEach(i => { + iconHighLightArr.push(i.Id) + }) + }else{ + iconHighLightArr.push(item.Id) + } + }) + }else{ + iconHighLightArr.push(node.id) + } + this.canvas.setHighlight(iconHighLightArr) + } + + //鐐瑰嚮鏁拌妭鐐圭殑鏄剧ず闅愯棌icon + clickLookItem(node){ + + //淇敼鐪熷疄绱犳潗islook灞炴 + for(let key in this.storeyData.data){ + if(key == node.id){ + this.storeyData.data[key].isLook = !this.storeyData.data[key].isLook + } + } + + //鎵鏈夋秷闃茶绱犳ā鏉垮彉鍖杋slook鍊 + if(node.isTemplate){ + this.allFireElements.forEach(item=>{ + if(item.id == node.id || item.name == "鍏朵粬"){ + item.isLook = !item.isLook + } + }) + } + + + //瀛愯妭鐐硅窡闅忕埗鑺傜偣鐨刬slook鍙樺寲 + 聽 if(node.children聽&&聽node.children.length聽!=聽0){ +聽聽聽聽聽聽node.children.forEach(item=>{ +聽聽聽聽聽聽聽聽item.isLook聽=聽!node.isLook聽 +聽聽聽聽聽聽聽聽if(item.children聽&&聽item.children.length聽!=聽0){ +聽聽聽聽聽聽聽聽聽聽item.children.forEach(i=>{ +聽聽聽聽聽聽聽聽聽聽聽聽i.isLook聽=聽聽!node.isLook聽 +聽聽聽聽聽聽聽聽聽聽}) +聽聽聽聽聽聽聽聽} +聽聽聽聽聽聽}) +聽聽聽聽 } + + + const nodes = this.treeControl.dataNodes; + const expandNodes = []; + nodes.forEach((item) => { + if(item.expandable && this.treeControl.isExpanded(item)){ + expandNodes.push(item.id); + } + }); + + this.dataSource.data = [...this.dataSource.data] + + let newNodes = this.treeControl.dataNodes; + newNodes = newNodes.filter(n => { + return expandNodes.indexOf(n.id) >= 0; + }); + newNodes.forEach(item => { + this.treeControl.expand(item); + }); + + //canvas涓婄殑绱犳潗鏄鹃殣 + let iconVisibleArr:any = [] + if(node.isTemplate){//濡傛灉鏄ā鏉,鍒欏紑濮嬪悜涓嬫壘 + node.children.forEach(item => { + if(item.isTemplate){//濡傛灉瀛愯妭鐐逛緷鏃ф槸妯℃澘,鍒欑户缁紑濮嬪悜涓嬫壘 + item.children.forEach(i => { + iconVisibleArr.push(i.Id) + }) + }else{ + iconVisibleArr.push(item.Id) + } + }) + }else{ + iconVisibleArr.push(node.id) + } + this.canvas.setIconVisible(iconVisibleArr,!node.isLook) + } + + //璁$畻 鍙鍖哄煙鍐呭搴, 鏄惁缂╂斁鑳屾櫙鍥 + backGroundScale () { + // let that = this + // let dad = this.element.nativeElement.querySelector('.functionalDomainContent').clientWidth + // let dadHeight = this.element.nativeElement.querySelector('.functionalDomainContent').clientHeight + // let left = this.element.nativeElement.querySelector('.functionalDomainLeft').clientWidth + // let right = this.element.nativeElement.querySelector('.functionalDomainRight').clientWidth + // let imgWidth = dad - left - right//鍙鍖哄煙鍐 瀹藉害 + // let img = new Image() + // img.src = this.selectingSitePlan.imageUrl; + // img.onload = function(){ + // if (img.height > dadHeight && img.width > imgWidth) { + // let width = imgWidth/img.width + // let height = dadHeight/img.height + // that.canvas.setBackgroundScale((width>height? height : width)-0.005) + // return + // } else if (img.height > dadHeight) { + // that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) + // return + // } else if (img.width > imgWidth) { + // that.canvas.setBackgroundScale((imgWidth/img.width)-0.005) + // return + // } + // }; + } + + //灏佽 鍒锋柊 tree 鏁版嵁 + async renovateTreeData (isRefresh:boolean = true) { + this.allFireElements[this.allFireElements.length-1].children = [] + isRefresh? await this.canvas.refresh() : null + this.canvas.setNameVisible(this.basicInfo,0) + this.canvas.setNameVisible(this.wantToWork,1) + isRefresh? this.canvasData.isChange = false : null //鏈嶅姟涓 鏁版嵁鏄惁鏀瑰姩 鏀逛负false + isRefresh? this.isShowProperty = true : null + isRefresh? this.isShowAttribute = true : null + !this.pattern? this.mateFireForce() : null //鍒锋柊 寤虹瓚妤煎眰 鐏簮/鍔涢噺鍥炬爣 + + let beforeOneId = this.selectingSitePlan.id || '' //褰撳墠 閫変腑 骞抽潰鍥 妤煎眰/鍖哄煙 id + let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 褰撳墠 鍗曚綅/寤虹瓚 鏁版嵁 + let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //褰撳墠 妤煎眰 鏁版嵁 + + for(let key in companyBuildingData.data){ + if (companyBuildingData.data[key].FloorId === beforeOneId) { //澶勭悊 鍗曚綅/寤虹瓚 鏁版嵁鏄惁褰掍簬褰撳墠妤煎眰涓 + storeyData.data[key] = companyBuildingData.data[key] + } + } + for(let key in storeyData.data){ //绛涢夋暟鎹 娌℃湁鍖归厤鍏ㄩ儴鏀惧叆鍒 鍏朵粬 鏁扮粍 + let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) + if (!noMatch) { + this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) + } + } + this.handleTreeData(storeyData) //澶勭悊tree鏁版嵁缁撴瀯 + } + + + + //闄堥箯椋炩啌鈫撯啌 + //闄堥箯椋炩啌鈫撯啌 + //闄堥箯椋炩啌鈫撯啌 + params = {companyId: sessionStorage.getItem('companyId')} + // params = {companyId: this.route.snapshot.queryParams.id} + allFireElements:any = []; //褰撳墠 鍗曚綅/寤虹瓚 涓嬬殑娑堥槻瑕佺礌 + + isShowAttribute:boolean = true; //灞炴ф爮 鏄惁鏄剧ず 榛樿鏁版嵁 + isShowProperty:boolean = false //灞炴ф爮 鏄惁鏈変笢瑗 + + toggleExpandPanel:boolean = false; //宸︿晶鍙睍寮闈㈡澘灞曞紑鎴栧叧闂 + toggleExpandPanelRight:boolean = false; //鍙充晶鍙睍寮闈㈡澘灞曞紑鎴栧叧闂 + togglePlane:boolean = true; //鍙睍寮闈㈡澘骞抽潰鍥 鏄鹃殣 + toggleMaterialBank:boolean = false; //鍙睍寮闈㈡澘绱犳潗搴 鏄鹃殣 + toggleHandlePlans:boolean = true; //鍙睍寮闈㈡澘澶勭疆棰勬 鏄鹃殣 + //鍙睍寮闈㈡澘灞曞紑鎴栧叧闂 + toggle () { + this.toggleExpandPanel = !this.toggleExpandPanel + } + //鍙睍寮闈㈡澘灞曞紑鎴栧叧闂 + toggle2 () { + this.toggleExpandPanelRight = !this.toggleExpandPanelRight + } + //鍙睍寮闈㈡澘 骞抽潰鍥 灞曞紑鎴栧叧闂 + togglePlanarGraph () { + this.togglePlane = !this.togglePlane + } + //鍙睍寮闈㈡澘 绱犳潗搴 灞曞紑鎴栧叧闂 + toggleMaterial () { + this.toggleMaterialBank = !this.toggleMaterialBank + } + //鍙睍寮闈㈡澘 澶勭疆棰勬 灞曞紑鎴栧叧闂 + toggleHandlePlan () { + this.toggleHandlePlans = !this.toggleHandlePlans + } + + sitePlanData:any = []; //鎬诲钩闈㈠浘 妤煎眰/鍖哄煙 鏁版嵁 + selectingSitePlan:any; //閫変腑鐨 骞抽潰鍥 妤煎眰/鍖哄煙 + selectSitePlanIndex:number; //閫変腑鐨 骞抽潰鍥 妤煎眰/鍖哄煙 index + + //鑾峰彇鎬诲钩闈㈠浘 + getSitePlan () { + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //鑾峰彇鍗曚綅涓 娑堥槻瑕佺礌 + let planData = this.getSitePlanCompanyData() //鑾峰彇 鍗曚綅 鏁版嵁 + this.http.get('/api/SitePlans',{params:this.params}).subscribe(data=>{ + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[0] || {} + this.canvasData.selectStorey = this.sitePlanData[0] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.selectSitePlanIndex = 0 + + Promise.all([fireData,planData]).then((res)=>{ + this.getSitePlanStorey(this.selectingSitePlan) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + }) + + }) + } + + //鑾峰彇寤虹瓚 妤煎眰/鍖哄煙 + getBuildingSitePlan (item) { + let params = { buildingId: item.id } + let fireData = this.getFireElements(item.buildingTypes[0].id || '') //鑾峰彇寤虹瓚涓 娑堥槻瑕佺礌 + let planData = this.getBuildingData(params) //鑾峰彇 寤虹瓚 鏁版嵁 + this.http.get('/api/BuildingAreas',{params}).subscribe(data=>{ + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[0] || {} + this.canvasData.selectStorey = this.sitePlanData[0] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.selectSitePlanIndex = 0 + + Promise.all([fireData,planData]).then((res)=>{ + this.getBuildingStorey(this.selectingSitePlan) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + }) + + }) + } + + //鏍规嵁鍗曚綅绫诲瀷鑾峰緱鎵鏈夌殑娑堥槻瑕佺礌 + getFireElements (e) { + let params = {ids:e} + return new Promise ((resolve,reject)=>{ + this.http.get('/api/Companies/FireElements',{params}).subscribe((data:any)=>{ + this.allFireElements = data //鎵鏈夋秷闃茶绱 + let other = { + children: [], + computed: true, + id: '', + name: '鍏朵粬', + order: 999, + parentId: null, + tag: "INPUT", + isLookPattern : true + } + this.allFireElements.push(other) + resolve('success') + }) + }) + } + + //鑾峰彇 鍗曚綅 鏁版嵁 + getSitePlanCompanyData () { + return new Promise ((resolve,reject)=>{ + this.http.get('/api/CompanyData',{params:this.params}).subscribe((data:any)=>{ + this.canvasData.originalcompanyBuildingData = data || {} // 鍗曚綅鍘熸暟鎹 + this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} + this.canvasData.originalcompanyBuildingData.version = "2.0" + this.canvasData.originalcompanyBuildingData.companyId? null : this.canvasData.originalcompanyBuildingData.companyId = sessionStorage.getItem('companyId') + resolve('success') + }) + }) + } + + //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + getSitePlanStorey (e) { + let params = {sitePlanId: e.id} + this.http.get(`/api/SitePlanData`,{params}).subscribe((data:any)=>{ + this.canvasData.originaleveryStoreyData = data || {} // 妤煎眰鍘熸暟鎹 + this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + this.canvasData.originaleveryStoreyData.version = "2.0" + this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null + this.renovateTreeData() + }) + } + + //鑾峰彇 寤虹瓚 鏁版嵁 + getBuildingData (e) { + return new Promise ((resolve,reject)=>{ + this.http.get(`/api/BuildingData`,{params:e}).subscribe((data:any)=>{ + this.canvasData.originalcompanyBuildingData = data || {} // 寤虹瓚鍘熸暟鎹 + this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} + this.canvasData.originalcompanyBuildingData.version = "2.0" + this.canvasData.originalcompanyBuildingData.buildingId? null : this.canvasData.originalcompanyBuildingData.buildingId = e.buildingId + resolve('success') + }) + }) + } + + //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + getBuildingStorey (e) { + let params = {buildingAreaId: e.id} + this.http.get(`/api/BuildingAreaData`,{params}).subscribe((data:any)=>{ + this.canvasData.originaleveryStoreyData = data || {} // 妤煎眰鍘熸暟鎹 + this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + this.canvasData.originaleveryStoreyData.version = "2.0" + this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null + this.renovateTreeData() + }) + } + + //鐐瑰嚮閫変腑 骞抽潰鍥 妤煎眰/鍖哄煙 鏃 + selectSitePlan (item,index) { + if (this.selectSitePlanIndex != index) { + this.canvasData.selectPanelPoint = new DisposalNodeData(); + if (this.canvasData.isChange) { //true 鏁版嵁琚敼鍔 + let isTrue = confirm('鏄惁淇濆瓨褰撳墠缂栬緫鏁版嵁') + if (isTrue) { //鍏堜繚瀛樻暟鎹 鍦ㄥ垏鎹 + let isSuccess = this.saveSite()//true鐨勬椂鍊 鍏堜繚瀛樻暟鎹 + if (isSuccess != false) { + this.selectingSitePlan = item + this.selectSitePlanIndex = index + this.canvasData.selectStorey = item //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘鏃 + this.getSitePlanStorey(item) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + } else { //妤煎眰/鍖哄煙鏃 + this.getBuildingStorey(item) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + } + } + } else { //涓嶄繚瀛樻暟鎹 鐩存帴鍒囨崲 + this.selectingSitePlan = item + this.selectSitePlanIndex = index + this.canvasData.selectStorey = item //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘鏃 + this.getSitePlanStorey(item) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + this.getSitePlanCompanyData() + } else { //妤煎眰/鍖哄煙鏃 + this.getBuildingStorey(item) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + let params = { buildingId: this.beforeOneCheckedBuilding.id } + this.getBuildingData(params) + } + } + + } else { //false 鏁版嵁娌¤鏀瑰姩 + this.selectingSitePlan = item + this.selectSitePlanIndex = index + this.canvasData.selectStorey = item //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘鏃 + this.getSitePlanStorey(item) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + } else { //妤煎眰/鍖哄煙鏃 + this.getBuildingStorey(item) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + } + } //if + + } + } + + //鏂板骞抽潰鍥 妤煎眰/鍖哄煙 + foundPanel (e) { + e.stopPropagation() + let data = { + isBuilding: this.checkedBuildingIndex==-1? false:true, + Panel: this.beforeOneCheckedBuilding, + order: this.sitePlanData.length? this.sitePlanData[this.sitePlanData.length-1].order+1:0, + } + let dialogRef = this.dialog.open(leftFunctionalDomainBuildingComponent,{data}); + dialogRef.afterClosed().subscribe(data=>{ + if (data =='鎬诲钩闈㈠浘') { + this.renovateSitePlan() + } else if (data =='寤虹瓚') { + this.renovateBuilding() + } + }) + } + + //缂栬緫骞抽潰鍥 妤煎眰/鍖哄煙 + editPlaneData (e) { + let data = { + isBuilding: this.checkedBuildingIndex==-1? false:true, + Panel: this.beforeOneCheckedBuilding, + buildingData: e, + } + let dialogRef = this.dialog.open(editPlaneFigureBuildingComponent,{data}); + dialogRef.afterClosed().subscribe(data=>{ + if (data =='鎬诲钩闈㈠浘') { + this.renovateSitePlan() + } else if (data =='寤虹瓚') { + this.renovateBuilding() + } + }) + } + + //骞抽潰鍥 妤煎眰/鍖哄煙 涓婄Щ + moveUp (item,index) { + if (index != 0) { + let replaceIndex = this.sitePlanData[index].order + this.sitePlanData[index].order = this.sitePlanData[index-1].order + this.sitePlanData[index-1].order = replaceIndex + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘 + this.http.put(`/api/SitePlans/${this.sitePlanData[index-1].id}`,this.sitePlanData[index-1]).subscribe(data=>{ + this.http.put(`/api/SitePlans/${this.sitePlanData[index].id}`,this.sitePlanData[index]).subscribe(data=>{ + this.selectSitePlanIndex = this.selectSitePlanIndex-1 + this.renovateSitePlan() + }) + }) + } else { //妤煎眰/鍖哄煙 + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index-1].id}`,this.sitePlanData[index-1],{params:this.params}).subscribe(data=>{ + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index].id}`,this.sitePlanData[index],{params:this.params}).subscribe(data=>{ + this.selectSitePlanIndex = this.selectSitePlanIndex-1 + this.renovateBuilding() + }) + }) + } + + } //if index + } + + //骞抽潰鍥 妤煎眰/鍖哄煙 涓嬬Щ + moveDown (item,index) { + if (index != this.sitePlanData.length-1) { + let replaceIndex = this.sitePlanData[index].order + this.sitePlanData[index].order = this.sitePlanData[index+1].order + this.sitePlanData[index+1].order = replaceIndex + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘 + this.http.put(`/api/SitePlans/${this.sitePlanData[index+1].id}`,this.sitePlanData[index+1]).subscribe(data=>{ + this.http.put(`/api/SitePlans/${this.sitePlanData[index].id}`,this.sitePlanData[index]).subscribe(data=>{ + this.selectSitePlanIndex = this.selectSitePlanIndex+1 + this.renovateSitePlan() + }) + }) + } else { //妤煎眰/鍖哄煙 + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index+1].id}`,this.sitePlanData[index+1],{params:this.params}).subscribe(data=>{ + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index].id}`,this.sitePlanData[index],{params:this.params}).subscribe(data=>{ + this.selectSitePlanIndex = this.selectSitePlanIndex+1 + this.renovateBuilding() + }) + }) + } + + } //if index + } + + //鏃嬭浆搴曞浘 + revolveImg (item) { + item.imageAngle==270? item.imageAngle = 0 : item.imageAngle = item.imageAngle+90 + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘 + this.http.put(`/api/SitePlans/${item.id}`,item).subscribe(data=>{ + let isSuccess = this.renovateSitePlan() + isSuccess.then(res=>{ + this.canvas.refreshBackgroundImage() + }) + }) + } else { //妤煎眰/鍖哄煙 + this.http.put(`/api/BuildingAreas/${item.id}`,item,{params:this.params}).subscribe(data=>{ + let isSuccess = this.renovateBuilding() + isSuccess.then(res=>{ + this.canvas.refreshBackgroundImage() + }) + }) + } + + } + + //鍒犻櫎 骞抽潰鍥 妤煎眰/鍖哄煙 + deletePlaneData (item) { + const isDelete = confirm('鎮ㄧ‘瀹氳鍒犻櫎鍚'); + if (isDelete) { + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘 + let isHave = this.canvasData.allDisposalNode.find(items=>{ return items.sitePlanId === item.id }) + if (isHave == undefined) { + this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data=>{ + this.deleteShareData(item,-1) + }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍚湁鏁版嵁鑺傜偣鐨勬ゼ灞備笉鍏佽鍒犻櫎','纭畾',config); + } + } else { //妤煎眰/鍖哄煙 + let isHave = this.canvasData.allDisposalNode.find(items=>{ return items.buildingAreaId === item.id }) + if (isHave == undefined) { + this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data=>{ + this.deleteShareData(item,1) + }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍚湁鏁版嵁鑺傜偣鐨勬ゼ灞備笉鍏佽鍒犻櫎','纭畾',config); + } + } + } + } + + //鍒犻櫎褰撳墠 鍗曚綅/寤虹瓚鐨 鍏变韩鏁版嵁涓 宸插垹闄ata + deleteShareData (e,isCompany) { + this.sitePlanData.forEach((element,index) => { + if (element.id===e.id) { + this.sitePlanData.splice(index,1) + return + } + }); + let data = this.canvasData.originalcompanyBuildingData; + for(let key in data.data){ + if (data.data[key].FloorId === e.id) { //澶勭悊 鍗曚綅/寤虹瓚 鏁版嵁鏄惁褰掍簬褰撳墠妤煎眰涓 + delete data.data[key] + } + } + let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + newData.data = JSON.stringify(newData.data) // 杞崲JSON 鏁版嵁鏍煎紡 + this.selectingSitePlan = this.sitePlanData[0] || {} + this.canvasData.selectStorey = this.sitePlanData[0] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.selectSitePlanIndex = 0 + this.canvasData.isChange = false + if (isCompany===-1) { + this.http.post("/api/CompanyData",newData).subscribe(data => {}) + this.getSitePlanStorey(this.selectingSitePlan) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + } else { + this.http.post("/api/BuildingData",newData,{params:this.params}).subscribe(data => {}) + this.getBuildingStorey(this.selectingSitePlan) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + } + } + + //澶嶅埗鍥惧眰 骞抽潰鍥 妤煎眰/鍖哄煙 + duplicateLayer (item) { + let paramsData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData.data || {} )) + Object.keys(paramsData).forEach((key)=>{ + if (key != '鍥句緥') { + let ID = ObjectID.default.generate() + paramsData[key].Id = ID + paramsData[ID] = paramsData[key] + delete paramsData[key] + } + }) //鍥炬爣Id閲嶆柊璧嬪 + if (this.checkedBuildingIndex==-1) { //鎬诲钩闈㈠浘 + item.id = "" + item.modifiedTime = new Date() + item.name = item.name + '(鍓湰)' + item.order = this.sitePlanData[this.sitePlanData.length-1].order+1 + this.http.post('/api/SitePlans',item).subscribe((data:any)=>{ + let newData = { + version: "2.0", + id: "", + data: JSON.stringify( paramsData ) || null, + sitePlanId: data.id + } + this.http.post('/api/SitePlanData',newData,{params:this.params}).subscribe(data=>{ + this.renovateSitePlan() + }) + + }) + } else { //妤煎眰/鍖哄煙 + item.id = "" + item.modifiedTime = new Date() + item.name = item.name + '(鍓湰)' + item.order = this.sitePlanData[this.sitePlanData.length-1].order+1 + this.http.post('/api/BuildingAreas',item,{params:this.params}).subscribe((data:any)=>{ + let newData = { + version: "2.0", + id: "", + data: JSON.stringify( paramsData ) || null, + buildingAreaId: data.id + } + this.http.post('/api/BuildingAreaData',newData,{params:this.params}).subscribe(data=>{ + this.renovateBuilding() + }) + + }) + } + } + + //骞抽潰鍥 妤煎眰/鍖哄煙 鏇挎崲搴曞浘 + replaceBaseMap (e,item) { + e.stopPropagation(); + let file = e.target.files[0] || null //鑾峰彇涓婁紶鐨勬枃浠 + let fileSize = file.size || null //涓婁紶鏂囦欢鐨勬诲ぇ灏 + let maxSize = 5 * 1024 * 1024 //5MB涓涓垎鐗 + + if (file && fileSize<=maxSize) { //涓婁紶鏂囦欢<=5MB鏃 + let formData = new FormData() + formData.append("file",file) + this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{ + this.renovateBaseMap(data.objectName,item) + }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶搴曞浘闇灏忎簬5MB','纭畾',config); + } + } + + //灏佽 鏇挎崲搴曞浘 function + renovateBaseMap (e,item) { + item.imageUrl = '/api/Objects/WebPlan2D/' + e + if (this.checkedBuildingIndex ==-1) { //鎬诲钩闈㈠浘 + this.http.put(`/api/SitePlans/${item.id}`,item).subscribe(data=>{ + let isSuccess = this.renovateSitePlan() + isSuccess.then(res=>{ + this.canvas.refreshBackgroundImage() + }) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶搴曞浘鎴愬姛','纭畾',config); + }) + } else { //妤煎眰/鍖哄煙 + this.http.put(`/api/BuildingAreas/${item.id}`,item,{params:this.params}).subscribe(data=>{ + let isSuccess = this.renovateBuilding() + isSuccess.then(res=>{ + this.canvas.refreshBackgroundImage() + }) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶搴曞浘鎴愬姛','纭畾',config); + }) + } + } + + //灏佽 鍒锋柊鎬诲钩闈㈠浘 鏁版嵁 + renovateSitePlan () { + return new Promise ((resolve,reject)=>{ + this.http.get('/api/SitePlans',{params:this.params}).subscribe(data=>{ + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex] + this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = this.selectingSitePlan.id || null + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏁版嵁鏇存柊鎴愬姛','纭畾',config); + resolve('success') + }) + }) + } + + //灏佽 鍒锋柊 妤煎眰/鍖哄煙 鏁版嵁 + renovateBuilding () { + let params = { + buildingId: this.beforeOneCheckedBuilding.id + } + return new Promise ((resolve,reject)=>{ + this.http.get('/api/BuildingAreas',{params}).subscribe(data=>{ + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex] + this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = this.selectingSitePlan.id || null + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鏁版嵁鏇存柊鎴愬姛','纭畾',config); + resolve('success') + }) + }) + } + + allLibrary:any = []; //鎵鏈夌礌鏉愬簱 + 绱犳潗 + selectLibrary:any; //閫変腑鐨勭礌鏉愬簱 + selectImage:any; //閫変腑鐨勭礌鏉愬簱鍥剧墖 + selectImageIndex:number; //閫変腑鐨勭礌鏉愬簱鍥剧墖index + + //鑾峰彇绱犳潗搴 + getAllLibrary (type:string='input') { + this.http.get(`/api/AssetLibraries?tag=${type}`).subscribe((data:any)=>{ + data.forEach(element => { + element.images = [] + }); + this.allLibrary = data + this.selectImageIndex = -1 + }) + } + + //绱犳潗搴撳睍寮闈㈡澘灞曞紑鏃 + opened (e) { + if (!e.images.length) { //褰撳墠绱犳潗搴撴病鍔犺浇绱犳潗鏃 + this.http.get(`/api/Assets?libraryId=${e.id}`).subscribe((data:any)=>{ + e.images = data + }) + } + } + + //鐐瑰嚮閫変腑绱犳潗搴撳浘鐗囨椂 + selectImg (item,items,index) { + this.selectLibrary = item.name + this.selectImage = items + this.selectImageIndex = index + this.canvasData.selectTemplateData = items + this.canvas.beginPaint() + } + + + + //澶勭疆棰勬 + allFirePlan:any = []; //鎵鏈夌伨鎯 + selectDisposalNode:string = ''; //褰撳墠鐐瑰嚮tree鑺傜偣 css閫変腑鏍峰紡 + + //鑾峰彇鎵鏈夌伨鎯 + getAllFirePlan () { + let params = {componentId: sessionStorage.getItem('planId')} + this.http.get('/api/Disasters',{params:params}).subscribe((data:any)=>{ + if (!data.length) { //璇 鍗曚綅娌℃湁鐏炬儏鏃 + let msg = { + name: '鐏炬儏', + modifiedTime: new Date(), + planComponentId: sessionStorage.getItem('planId') + } + this.http.post('/api/Disasters',msg).subscribe(data=>{ + this.allFirePlan.push(data) + let params = {disasterId: this.allFirePlan[0].id || ''} + this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //鎵鏈夊缃妭鐐 + this.canvasData.allDisposalNode = data + }) + }) + } else { //鍗曚綅 鏈夌伨鎯呮椂 + this.allFirePlan = data + let params = {disasterId: this.allFirePlan[0].id || ''} + this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //鎵鏈夊缃妭鐐 + this.canvasData.allDisposalNode = data + }) + } + }) + } + + //鑾峰彇鎵鏈夊缃妭鐐 + getDisposalNode () { + this.selectDisposalNode = '' + let params = {disasterId: this.allFirePlan[0].id || ''} + this.http.get('/api/DisasterData/Markers',{params:params}).subscribe(data=>{ //鐏炬儏鏍囩淇℃伅 + this.canvasData.allNodeMarkers = data + this.mateFireForce() + }) + this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //澶勭疆鑺傜偣 + this.canvasData.allDisposalNode = data + this.handleHybridTree() + }) + } + + treeData:any = []; //娓叉煋tree澶勭悊瀹屾垚鏁版嵁 + defaultExpandedKeys:any = []; //棣栨娓叉煋 tree灞曞紑鐘舵 + //澶勭悊 鑺傜偣 Tree鏁版嵁 + handleHybridTree () { + this.defaultExpandedKeys = [] + let treeData = [] + let data = JSON.parse(JSON.stringify( this.canvasData.allDisposalNode || [] )) + data.forEach(element => { + this.defaultExpandedKeys.push(element.id) + element.title = element.name //name + element.key = element.id //id + element.children = [] //children + if (element.sitePlanId || element.buildingAreaId) { //鏄暟鎹妭鐐 + element.isLeaf = true + element.isDataNode = true + } else { //涓嶆槸鏁版嵁鑺傜偣 + element.isLeaf = false + element.isDataNode = false + } + data.forEach(item=>{ + item.parentId === element.id? element.children.push(item) : null + }) + }); + data.forEach(element=>{ + !element.parentId? treeData.push(element) : null + }) + this.treeData = [...treeData] + this.defaultExpandedKeys = [...this.defaultExpandedKeys] + } + + //鍒锋柊 treeData 淇濆瓨宸插睍寮鑺傜偣 + refurbishTreeData () { + this.defaultExpandedKeys = [] + let params = {disasterId: this.allFirePlan[0].id || ''} + this.http.get('/api/DisposalNodes',{params:params}).subscribe(nodeData=>{ //澶勭疆鑺傜偣 + this.canvasData.allDisposalNode = nodeData + let oldTreeData = this.nzTreeComponent.getExpandedNodeList() + oldTreeData.forEach(item=>{ + this.defaultExpandedKeys.push(item.key) + }) + let treeData = [] + let data = JSON.parse(JSON.stringify( this.canvasData.allDisposalNode || [] )) + data.forEach(element => { + element.title = element.name //name + element.key = element.id //id + element.children = [] //children + if (element.sitePlanId || element.buildingAreaId) { //鏄暟鎹妭鐐 + element.isLeaf = true + element.isDataNode = true + } else { //涓嶆槸鏁版嵁鑺傜偣 + element.isLeaf = false + element.isDataNode = false + } + data.forEach(item=>{ + item.parentId === element.id? element.children.push(item) : null + }) + }); + data.forEach(element=>{ + !element.parentId? treeData.push(element) : null + }) + this.treeData = [...treeData] + this.defaultExpandedKeys = [...this.defaultExpandedKeys] + }) + } + + sitePlanIcon = {fire:0,force:0} // 鎬诲钩闈㈠浘 鐏簮/鍔涢噺 鍥炬爣 鏄惁灞曠ず + + //鍒锋柊 寤虹瓚妤煎眰 鍖归厤 鐏簮/鍔涢噺 鍥炬爣 + mateFireForce () { + let data = this.canvasData.allNodeMarkers.markers || {} + for(let key in data){ //閬嶅巻 鐏/鍔涢噺 鍥炬爣 + this.sitePlanData.forEach(element => { //妤煎眰 + if (element.id==key) { // 鐩稿尮閰嶆椂 + data[key].fireCount != 0? element.fire=1 : element.fire=0 + data[key].forceCount != 0? element.force=1 : element.force=0 + } + }); + this.allBuildings.forEach(element => { //寤虹瓚 + if (element.id==key) { // 鐩稿尮閰嶆椂 + data[key].fireCount != 0? element.fire=1 : element.fire=0 + data[key].forceCount != 0? element.force=1 : element.force=0 + } + }); + if (this.params.companyId==key) { //鎬诲钩闈㈠浘鏃 + data[key].fireCount != 0? this.sitePlanIcon.fire=1 : this.sitePlanIcon.fire=0 + data[key].forceCount != 0? this.sitePlanIcon.force=1 : this.sitePlanIcon.force=0 + } + } + + let buildingMSG = this.canvasData.allNodeMarkers.highlightMarkers || {} + for (let key in buildingMSG) { + if (key === this.canvasData.selectPanelPoint.DisposalNodeId) { + for (let keys in buildingMSG[key]) { + this.sitePlanData.forEach(element => { //妤煎眰 + if (element.id === keys) { + buildingMSG[key][keys].fireCount != 0? element.fire=2 : null + buildingMSG[key][keys].forceCount != 0? element.force=2 : null + } + }); + this.allBuildings.forEach(element => { //寤虹瓚 + if (element.id === keys) { // 鐩稿尮閰嶆椂 + buildingMSG[key][keys].fireCount != 0? element.fire=2 : null + buildingMSG[key][keys].forceCount != 0? element.force=2 : null + } + }); + if (this.params.companyId === keys) { //鎬诲钩闈㈠浘鏃 + buildingMSG[key][keys].fireCount != 0? this.sitePlanIcon.fire=2 : null + buildingMSG[key][keys].forceCount != 0? this.sitePlanIcon.force=2 : null + } + } + } + } + } + + // 鍒囨崲 鍩烘湰淇℃伅鏃 鍒锋柊 鍒犻櫎 寤虹瓚妤煎眰 鑷畾涔夊睘鎬 + mateDeleteCustomize () { + this.canvasData.selectPanelPointBaseData = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''} + this.defaultExpandedKeys = [] + this.sitePlanIcon = {fire:0,force:0} + this.sitePlanData.forEach(element => { //妤煎眰 + delete element.fire + delete element.force + }); + this.allBuildings.forEach(element => { //寤虹瓚 + delete element.fire + delete element.force + }); + } + + //璁$畻宸紓 + countValue (e) { + e.stopPropagation() + let params = {disasterId: this.allFirePlan[0].id || ''} + this.http.get('/api/DisasterData/Diffs',{params:params}).subscribe(data=>{ + this.canvasData.allNodeMarkers = data + this.mateFireForce() + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('璁$畻宸紓瀹屾垚','纭畾',config); + }) + } + + //鏂板缓 澶勭疆棰勬 鑺傜偣 + addPanelPoint (e,item,treeData) { + e.stopPropagation() + let order + if (item) { + item.children.length? order = item.children[item.children.length-1].order+1 : order = 0 + } else { + treeData.length? order = treeData[treeData.length-1].order+1 : order = 0 + } + let data = { + name: '', + level: item? 1 : 0, + order: order, + description: '', + disasterId: this.allFirePlan[0].id || '', + parentId: item? item.id : null, + planComponentId: sessionStorage.getItem('planId') || '', + } + let dialogRef = this.dialog.open(addDisposalNodeBuildingComponent,{data}); + dialogRef.afterClosed().subscribe(data=>{ + if (data) { this.refurbishTreeData() } + }) + } + + //缂栬緫 澶勭疆棰勬 鑺傜偣 + editPanelPoint (e,item) { + e.stopPropagation() + let data = item.origin + let dialogRef = this.dialog.open(editDisposalNodeBuildingComponent,{data}); + dialogRef.afterClosed().subscribe(data=>{ + if (data) { + item.title = data + this.canvasData.allDisposalNode.forEach(element => { element.id === item.key? element.name=data : null }); + } + }) + } + + //澶嶅埗 澶勭疆棰勬 鑺傜偣 + copyPanelPoint (e,item,treeData) { + e.stopPropagation() + if (confirm(`纭畾瑕佸鍒 ${item.title} ?`)) { + let params = {id: item.origin.id} + let order + if (item.level==0) { + treeData.length? order = treeData[treeData.length-1].order+1 : order = 0 + } else { + let parent = item.getParentNode() //鑾峰彇鐖惰妭鐐 + parent.origin.children.length? order = parent.origin.children[parent.origin.children.length-1].order+1 : order = 0 + } + let data = { + name: item.title + '(鍓湰)', + level: item.level, + order: order, + description: '', + disasterId: item.origin.disasterId || '', + parentId: item.origin.parentId || null, + planComponentId: item.origin.planComponentId || '', + } + this.http.post('/api/DisposalNodes/Clone',data,{params:params}).subscribe(data=>{ + this.refurbishTreeData() + }) + } //isTrue + } + + //鍒犻櫎 澶勭疆棰勬 鑺傜偣 + deletePanelPoint (e,item) { + e.stopPropagation() + if (confirm(`纭畾瑕佸垹闄 ${item.name} ?`)) { + this.http.delete(`/api/DisposalNodes/${item.id}`).subscribe(data=>{ + this.refurbishTreeData() + }) + } + } + + //鐐瑰嚮 澶勭疆Tree鑺傜偣 + selectanelPoint (e) { + if (!e.buildingAreaId && !e.sitePlanId) { //褰撳墠鑺傜偣 涓嶆槸 鏁版嵁鑺傜偣 鏃 + let msg = this.canvasData.findDisposalNode(e.id) + this.canvasData.selectPanelPointBaseData = msg + this.selectDisposalNode == msg.id? this.selectDisposalNode = '' : this.selectDisposalNode = msg.id //閫変腑 鑺傜偣 + + } else if (e.buildingAreaId || e.sitePlanId) { //褰撳墠鑺傜偣 鏄 鏁版嵁鑺傜偣 鏃 + let msg = this.canvasData.findDisposalNode(e.parentId) + this.canvasData.selectPanelPointBaseData = msg + this.selectDisposalNode = e.parentId //閫変腑 鑺傜偣 + + if (this.canvasData.selectPanelPoint.DisposalNodeId != e.id) { //閫夋嫨鑺傜偣 涓嶆槸褰撳墠鑺傜偣鏃 + let params = {nodeId: e.id} + let parameter = { //鏌ヨ 鑺傜偣 瀵瑰簲 寤虹瓚/妤煎眰 index,id + buildingIndex: e.sitePlanId? -1 : this.allBuildings.findIndex(item=>{ return item.id===e.buildingId }), //鎬诲钩闈㈠浘/寤虹瓚 index + storeyId: e.sitePlanId? e.sitePlanId : e.buildingAreaId, //妤煎眰id + } + this.http.get('/api/DisposalNodeData',{params:params}).subscribe(data=>{ + this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data || new DisposalNodeData())) //閫夋嫨 褰撳墠 鑺傜偣 + this.canvasData.selectPanelPoint.Data = this.canvasData.deserialize(this.canvasData.selectPanelPoint.Data) + this.seekPanelPoint(parameter) + }) + } //if + + } //else if + } + + //鏌ユ壘 鏁版嵁鑺傜偣 瀵瑰簲 寤虹瓚/妤煎眰 + seekPanelPoint (paramsData) { + this.checkedBuildingIndex = paramsData.buildingIndex + if (paramsData.buildingIndex ==-1) { //鎬诲钩闈㈠浘鏃 + this.beforeOneCheckedBuilding={name:"鎬诲钩闈㈠浘"} + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //鑾峰彇鍗曚綅涓 娑堥槻瑕佺礌 + let planData = this.getSitePlanCompanyData() //鑾峰彇 鍗曚綅 鏁版嵁 + this.http.get('/api/SitePlans',{params:this.params}).subscribe(data=>{ + this.sitePlanData = data + let index = this.sitePlanData.findIndex(item=>{ return item.id===paramsData.storeyId }) + this.selectingSitePlan = this.sitePlanData[index] || {} + this.canvasData.selectStorey = this.sitePlanData[index] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.selectSitePlanIndex = index + + Promise.all([fireData,planData]).then((res)=>{ + this.getSitePlanStorey(this.selectingSitePlan) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 + }) + }) //get + } else { //寤虹瓚鏃 + this.beforeOneCheckedBuilding=this.allBuildings[paramsData.buildingIndex] + let params = { buildingId: this.beforeOneCheckedBuilding.id } + let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //鑾峰彇寤虹瓚涓 娑堥槻瑕佺礌 + let planData = this.getBuildingData(params) //鑾峰彇 寤虹瓚 鏁版嵁 + this.http.get('/api/BuildingAreas',{params}).subscribe(data=>{ + this.sitePlanData = data + let index = this.sitePlanData.findIndex(item=>{ return item.id===paramsData.storeyId }) + this.selectingSitePlan = this.sitePlanData[index] || {} + this.canvasData.selectStorey = this.sitePlanData[index] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 + this.selectSitePlanIndex = index + + Promise.all([fireData,planData]).then((res)=>{ + this.getBuildingStorey(this.selectingSitePlan) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 + }) + }) //get + } + } + + + +} + + + +//鍒涘缓寤虹瓚 +@Component({ + selector: 'app-createBuilding-building', + templateUrl: './createBuilding.html', + styleUrls: ['./collection-tools.component.scss'] +}) +export class CreateBuildingBuilding { + + constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } + + allBuildingType:any//鎵鏈夌殑寤虹瓚绫诲瀷 + selected:any; //閫変腑鐨勫缓绛 + ngOnInit(): void { + this.getAllBuildingType() + } + + //鑾峰緱鎵鏈夊崟浣嶇被鍨 + getAllBuildingType(){ + this.http.get("/api/BuildingTypes/Simple").subscribe(data=>{ + this.allBuildingType = data + }) + } + + //鍒涘缓寤虹瓚鍔熻兘鍒嗗尯 + onSubmit (e) { + let companyId = sessionStorage.getItem("companyId") + let lastBuildingOrder = this.data.allBuildings.length != 0 ? this.data.allBuildings[this.data.allBuildings.length - 1].order + 1 : 0 + let data = + { + id: "", + name: e.propertyName, + order: lastBuildingOrder , + enabled: true, + companyId: companyId, + buildingTypes: [ + { + id: e.buildingId, + name: "" + } + ] + } + this.http.post("/api/Buildings",data,{ + params:{ + companyId : this.data.companyId + } + }).subscribe(data=>{ + this.dialogRef.close("鍒涘缓鎴愬姛"); + },err=>{ + this.dialogRef.close("鍒涘缓澶辫触"); + }) + } +} + +//缂栬緫寤虹瓚 +@Component({ + selector: 'app-editBuilding-building', + templateUrl: './editBuilding.html', + styleUrls: ['./collection-tools.component.scss'] +}) +export class EditBuildingBuilding { + + constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } + + defaultName:String = this.data.item.name//榛樿寤虹瓚鍚嶇О + defaultBuildingType:String = this.data.item.buildingTypes[0].id//榛樿寤虹瓚绫诲瀷 + allBuildingType:any//鎵鏈夌殑寤虹瓚绫诲瀷 + + ngOnInit(): void { + this.getAllBuildingType() + } + + getAllBuildingType(){ + this.http.get("/api/BuildingTypes/Simple").subscribe(data=>{ + this.allBuildingType = data + }) + } + + //缂栬緫寤虹瓚淇℃伅 + onSubmit (e) { + let companyId = sessionStorage.getItem("companyId") + let data = + { + id: this.data.item.id, + name: e.propertyName, + order: this.data.item.order, + enabled: true, + companyId: companyId, + buildingTypes: [ + { + id: e.buildingId, + name: "" + } + ] + } + this.http.put(`/api/Buildings/${this.data.item.id}`,data,{ + params:{ + id:this.data.item.id, + companyId:companyId + } + }).subscribe(data=>{ + this.dialogRef.close("淇敼鎴愬姛"); + },err=>{ + this.dialogRef.close("淇敼澶辫触"); + }) + } +} + +//鏌ョ湅鍥剧墖澶у浘 +@Component({ + selector: 'viewdetails-building', + templateUrl: './viewdetails.html', + styleUrls: ['./collection-tools.component.scss'] +}) +export class ViewDetailsBuilding { + // myControl = new FormControl(); + //娉ㄥ叆MatDialogRef锛屽彲浠ョ敤鏉ュ叧闂璇濇 + //瑕佽闂璇濇缁勪欢涓殑鏁版嵁锛屽繀椤讳娇鐢∕AT_DIALOG_DATA娉ㄥ叆浠ょ墝 + constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private element: ElementRef) {} + imagesArr = this.data.imagesArr + onNoClick(): void { + this.dialogRef.close(); + } + ngOnInit(): void { + setTimeout(() => { + var mySwiper = new Swiper('.swiper-container',{ + loop: false, + initialSlide :this.data.index,//榛樿绱㈠紩 + // 濡傛灉闇瑕佸墠杩涘悗閫鎸夐挳 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + } + //鍏朵粬璁剧疆 + }); + }, 0); + } + closeDialog(){ + this.dialogRef.close(); + } + count = 10 + zoomimg(e) { + if(this.count != 1 || e.wheelDelta >= 120){ + if(e.wheelDelta >= 120){ + this.count++ + }else{ + this.count-- + } + } + e.srcElement.style.zoom = this.count + '0%' + e.srcElement.style.maxWidth = null + e.srcElement.style.maxHeight = null + } + +} diff --git a/src/app/ui/collection-tools-building/createBuilding.html b/src/app/ui/collection-tools-building/createBuilding.html new file mode 100644 index 0000000..16fdd7b --- /dev/null +++ b/src/app/ui/collection-tools-building/createBuilding.html @@ -0,0 +1,28 @@ +
鏂板寤虹瓚
+
+
+ +
+ + + +
+
+ + + + {{item.name}} + + + +
+
+ + +
+
+
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/editBuilding.html b/src/app/ui/collection-tools-building/editBuilding.html new file mode 100644 index 0000000..433316d --- /dev/null +++ b/src/app/ui/collection-tools-building/editBuilding.html @@ -0,0 +1,23 @@ +
缂栬緫寤虹瓚
+
+
+
+ + + +
+
+ + + + {{item.name}} + + + +
+
+ + +
+
+
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/editDisposalNode.html b/src/app/ui/collection-tools-building/editDisposalNode.html new file mode 100644 index 0000000..40b2270 --- /dev/null +++ b/src/app/ui/collection-tools-building/editDisposalNode.html @@ -0,0 +1,23 @@ +
+
+ +
+ +
+ +
+ + + +
+ +
+ + +
+ +
+ +
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/editPlaneFigure.html b/src/app/ui/collection-tools-building/editPlaneFigure.html new file mode 100644 index 0000000..a0f8016 --- /dev/null +++ b/src/app/ui/collection-tools-building/editPlaneFigure.html @@ -0,0 +1,39 @@ +
+ +
+ + +
+ +
+ +
+ + + +
+ +
+ 鏄惁涓洪伩闅惧眰 +
+ +
+ + + +
+ +
+ +
+ +
+ + +
+ +
+ +
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/leftFunctionalDomain.ts b/src/app/ui/collection-tools-building/leftFunctionalDomain.ts new file mode 100644 index 0000000..e60ca32 --- /dev/null +++ b/src/app/ui/collection-tools-building/leftFunctionalDomain.ts @@ -0,0 +1,180 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; + +@Component({ + selector: 'app-leftFunctionalDomain-building', + templateUrl: './addPlaneFigure.html', + styleUrls: ['./panel.scss'] +}) +export class leftFunctionalDomainBuildingComponent implements OnInit { + + constructor( + private http:HttpClient, + public dialog: MatDialog, + public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) { } + + ngOnInit(): void { + + } + + params = {companyId: sessionStorage.getItem('companyId')} + checked:boolean = false;//鏄惁涓洪伩闅惧眰 + + //鎻愪氦琛ㄥ崟鍒涘缓骞抽潰鍥 + onSubmit (e) { + if (!this.data.isBuilding) { //鎬诲钩闈㈠浘 鍒涘缓骞抽潰鍥 + let data = { + companyId: sessionStorage.getItem('companyId'), + name: e.name, + order: this.data.order, + area:e.area, + details:e.details, + enabled: true, + modifiedTime: new Date(), + } + this.http.post('/api/SitePlans',data).subscribe(data=>{ + this.dialogRef.close('鎬诲钩闈㈠浘'); + }) + } else { //寤虹瓚 鍒涘缓妤煎眰/鍖哄煙 + let data = { + isRefugeStorey: e.isRefugeStorey, + buildingId: this.data.Panel.id, + name: e.name, + order: this.data.order, + area:e.area, + details:e.details, + enabled: true, + modifiedTime: new Date(), + } + this.http.post('/api/BuildingAreas',data,{params:this.params}).subscribe(data=>{ + this.dialogRef.close('寤虹瓚'); + }) + } + } + + + +} + +//缂栬緫骞抽潰鍥 妤煎眰/鍖哄煙 +@Component({ + selector: 'app-editPlaneFigure-building', + templateUrl: './editPlaneFigure.html', + styleUrls: ['./panel.scss'] +}) +export class editPlaneFigureBuildingComponent implements OnInit { + + constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } + + ngOnInit(): void { + this.name = this.data.buildingData.name || '' + this.checked = this.data.buildingData.isRefugeStorey || false + this.area = this.data.buildingData.area || 0 + this.details = this.data.buildingData.details || '' + } + + params = {companyId: sessionStorage.getItem('companyId')} + name:any; //name + checked:boolean = false;//鏄惁涓洪伩闅惧眰 + area:number; //闈㈢Н + details:string; //璇︽儏 + + //鎻愪氦琛ㄥ崟淇敼骞抽潰鍥 + onSubmit (e) { + if (!this.data.isBuilding) { //鎬诲钩闈㈠浘 淇敼骞抽潰鍥 + let data = { + companyId: sessionStorage.getItem('companyId'), + id: this.data.buildingData.id, + name: e.name, + cadUrl: this.data.buildingData.cadUrl, + imageUrl: this.data.buildingData.imageUrl, + imageAngle: this.data.buildingData.imageAngle, + order: this.data.buildingData.order, + area:e.area, + details:e.details, + enabled: this.data.buildingData.enabled, + modifiedTime: new Date(), + } + this.http.put(`/api/SitePlans/${this.data.buildingData.id}`,data).subscribe(data=>{ + this.dialogRef.close('鎬诲钩闈㈠浘'); + }) + } else { //寤虹瓚 淇敼妤煎眰/鍖哄煙 + let data = { + isRefugeStorey: e.isRefugeStorey, + buildingId: this.data.Panel.id, + id: this.data.buildingData.id, + name: e.name, + cadUrl: this.data.buildingData.cadUrl, + imageUrl: this.data.buildingData.imageUrl, + imageAngle: this.data.buildingData.imageAngle, + order: this.data.buildingData.order, + area:e.area, + details:e.details, + enabled: this.data.buildingData.enabled, + modifiedTime: new Date(), + } + this.http.put(`/api/BuildingAreas/${this.data.buildingData.id}`,data,{params:this.params}).subscribe(data=>{ + this.dialogRef.close('寤虹瓚'); + }) + } + } + + + +} + + + +//鍒涘缓 澶勭疆棰勬 鑺傜偣 +@Component({ + selector: 'app-addDisposalNode-building', + templateUrl: './addDisposalNode.html', + styleUrls: ['./panel.scss'] +}) +export class addDisposalNodeBuildingComponent implements OnInit { + + constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } + + ngOnInit(): void { + } + + //鎻愪氦琛ㄥ崟 + onSubmit (e) { + this.data.name = e.name + this.http.post('/api/DisposalNodes',this.data).subscribe(data=>{ + this.dialogRef.close('success'); + }) + } + +} + + + +//缂栬緫 澶勭疆棰勬 鑺傜偣 +@Component({ + selector: 'app-editDisposalNode-building', + templateUrl: './editDisposalNode.html', + styleUrls: ['./panel.scss'] +}) +export class editDisposalNodeBuildingComponent implements OnInit { + + constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } + + ngOnInit(): void { + this.nodeName = JSON.parse(JSON.stringify( this.data.name || '' )) + } + nodeName:string; + + //鎻愪氦琛ㄥ崟 + onSubmit (e) { + this.data.name = e.name + this.http.put(`/api/DisposalNodes/${this.data.id}`,this.data).subscribe(data=>{ + this.dialogRef.close(e.name); + }) + } + +} \ No newline at end of file diff --git a/src/app/ui/collection-tools-building/panel.scss b/src/app/ui/collection-tools-building/panel.scss new file mode 100644 index 0000000..f0ae073 --- /dev/null +++ b/src/app/ui/collection-tools-building/panel.scss @@ -0,0 +1,291 @@ +.matIcons { + color: #8E909F; +} + + + +//骞抽潰鍥 绱犳潗搴 鍏叡鏍峰紡 澶撮儴 +.planarGraphHeader{ + height: 35px; + min-height: 35px; + cursor: pointer; + display: flex; + flex-direction: row; + align-items: center; + padding: 0 24px; + border-radius: 5px; + font-family: Roboto, "Helvetica Neue", sans-serif; + font-size: 15px; + font-weight: 400; + color: #000; + background: linear-gradient(to top,#cdced1,#FFF); +} +//骞抽潰鍥惧ご閮ㄥ瓧浣撳浘鏍囨牱寮 +.hover { + width: 18px; + height: 18px; + margin-left: 90px; + border: 1px solid #999; + border-radius: 3px; + .mat-icon {font-size: 18px; color: #999;} +} +.hover:hover { + background-color: #4DA5FA; + .mat-icon {color: #fff;} +} + +//骞抽潰鍥 +.sitePlanContent { + position: relative; + width: 100%; + height: 35px; + line-height: 35px; + box-sizing: border-box; + padding: 0 10px 0 25px; + .mat-icon { + font-size: 20px; + } +} + +//鐏簮/鍔涢噺 鍥炬爣 +.fireForce { + display: block; + float: right; + margin: 8px 5px 0 0; + width: 40px; + height: 20px; + line-height: 20px; + text-align: center; + position: relative; + overflow: hidden; + img{ + width: 20px; + height: 20px; + } +} +//鏇挎崲搴曞浘 inputfile +.a-upload { + display: block; + float: right; + margin: 8px 18px 0 0; + width: 20px; + height: 20px; + line-height: 20px; + text-align: center; + position: relative; + overflow: hidden; + input { + position: absolute; + width: 20px; + height: 20px; + left: 0; + top: 0; + opacity: 0; + } +} +.a-upload:hover { + .mat-icon { + color: #fff; + } +} +//涓婁紶搴曞浘 inputfile +#a-uploadImg { + display: block; + width: 300px; + height: 170px; + position: fixed; + top: 40%; + left: 48%; + overflow: hidden; + border-radius: 5px; + border: 1px solid #999; + z-index: 999; + input { + position: absolute; + width: 300px; + height: 170px; + left: 0; + top: 0; + opacity: 0; + } + img { + width: 100%; + height: auto; + } +} +#a-uploadImg:hover { + border: 5px solid skyblue; +} + +//hover鏃舵樉绀哄彸杈规搷浣滄爮 +.sitePlanContent:hover { + #rightOperate { + display: block; + } +} +//鍙宠竟鎿嶄綔鏍 +#rightOperate{ + width: 50px; + height: 100px; + position: absolute; + top: -32px; + right: -48px; + z-index: 99999; + border-radius: 0 100px 100px 0; + background-color: #F0F4F7; + // #F0F4F7 cdced1 + display: none; + .functionButton { + height: 25%; + line-height: 25px; + } + .bigFunctionIcon { + font-size: 24px; + } + .functionIcon { + color: #999; + } + .functionIcon:hover { + color: #4DA5FA; + } +} + +//澶勭疆棰勬 绱犳潗搴 鍏敤div +.publiclBankPlan { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + padding-bottom: 10px; + // border-top: 1px dashed #999; +} + + + +// 鍩烘湰淇℃伅/鎯冲畾浣滀笟 鍒囨崲 +.scenarioAssignment { + overflow-y: auto; +} +.selectEditMode { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; +} +.materialBankDIV{ + flex: 1; + overflow-x: hidden; + overflow-y: auto; +} +// 鍩烘湰淇℃伅/鎯冲畾浣滀笟 鍒囨崲 +//澶勭疆棰勬 +#terrNodePublic { + height: 35px; + line-height: 35px; + display: flex; + .textNode {flex: 1;} +} +//瀛椾綋鍥炬爣 +.planIconDiv { + display: inline-block; + .mat-icon{ + font-size: 20px; + width: 20px; + height: 20px; + color: #666; + margin-right: 3px; + } +} + + + +.mat-expansion-panel-header { + height: 40px !important; +} +//绱犳潗搴撴孩鍑洪殣钘 +#materialBank { + margin: 1px 0; +} +//绱犳潗搴撳浘鐗噁lex +#panelLibrary .text{ + box-sizing: border-box; + margin-left: 10px; +} +.panelLibraryFlex { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; /* 姘村钩灞呬腑 */ + .imgBox { + width: 70px; + height: 100px; + display: inline-block; + text-align: center; + border-radius: 3px; + margin: 5px 0; + img { + width: 70px; + height: auto; + max-height: 70px; + cursor:pointer; + } + p { + font-size: 12px; + cursor:pointer; + } + } +} + +//鏂囨湰婧㈠嚭 +.overflowText { + overflow: hidden; + text-overflow:ellipsis; + white-space: nowrap; +} +// 妤煎眰/鍖哄煙 鏄伩闅惧眰鏃 +.isRefugeStorey { + color: #fff; + background-color: rgb(238, 186, 186); +} +//閫変腑骞抽潰鍥炬椂 +.selectSitePlan { + color: #fff; + background-color: #6BC2FF; +} +//閫変腑绱犳潗搴撳浘鐗囨椂 +.selectImg { + color: #fff; + background-color: #4DA5FA; +} +//閫変腑 澶勭疆鑺傜偣鏃 +.selectanelPoint { + background-color: #F4C235; +} + + + +//宸︿晶鍔熻兘鍖哄脊鍑烘鏍峰紡 +.keyMargin { + width: 100%; + margin: 5px 0; + .mat-form-field { + width: 100%; + } +} +.submitBottom { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; /* 姘村钩灞呬腑 */ +} +.functionalDomainContent { + width: 300px; + height: 100%; + textarea { + border-radius: 5px; + border: 1px solid #999; + width: 100%; + height: 120px; + resize:none; + } +} diff --git a/src/app/ui/collection-tools-building/save.ts b/src/app/ui/collection-tools-building/save.ts new file mode 100644 index 0000000..03b5abd --- /dev/null +++ b/src/app/ui/collection-tools-building/save.ts @@ -0,0 +1,300 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import {CanvasShareDataService,DisposalNodeData} from '../../canvas-share-data.service' //寮曞叆鏈嶅姟 +// 淇濆瓨鎯冲畾浣滀笟绗竴涓脊绐 +@Component({ + selector: 'dialog-overview-example-dialog-building', + templateUrl: 'saveOne.html', + styleUrls: ['./collection-tools.component.scss'] +}) +export class saveOneDialogBuilding { + + constructor( + private http:HttpClient, + public dialog: MatDialog, + public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data) {} + + onNoClick(): void { + this.dialogRef.close() + } + allDisposalNode = this.data.allDisposalNode + + saveType(type){ + this.dialogRef.close() + const dialogRef = this.dialog.open(saveTwoDialogBuilding, { + data: {type: type, + allDisposalNode: this.data.allDisposalNode, + selectedBuildingData:this.data.selectedBuildingData, + selectedSiteData:this.data.selectedSiteData, + siteOrbuilding:this.data.siteOrbuilding, + disasterId:this.data.disasterId} + }); + dialogRef.afterClosed().subscribe(result => { + }); + } + +} + + // 淇濆瓨鎯冲畾浣滀笟绗簩涓脊绐 +@Component({ + selector: 'dialog-overview-example-dialog-building', + templateUrl: 'saveTwo.html', + styleUrls: ['./collection-tools.component.scss'] +}) +export class saveTwoDialogBuilding { + + constructor( + private http:HttpClient, + public dialogRef: MatDialogRef, + public canvasData: CanvasShareDataService, + public snackBar: MatSnackBar, + @Inject(MAT_DIALOG_DATA) public data) {} + + type = this.data.type + allDisposalNode = this.data.allDisposalNode + allPlanDisposalNode = [] + allRootDisposalNode = [{name:"鏍硅妭鐐",id:null}] + allDisposalNodeChild = [] + ngOnInit(): void { + //鎵鏈夐潪鏁版嵁鑺傜偣 + this.allDisposalNode.forEach(item => { + if(!item.sitePlanId && !item.buildingAreaId){ + this.allPlanDisposalNode.push(item) + } + }) + + //鎵鏈変竴绾ц妭鐐 + this.allDisposalNode.forEach(item => { + if(!item.parentId){ + this.allRootDisposalNode.push(item) + } + }) + this.allDisposalNodeChild = JSON.parse(JSON.stringify(this.allDisposalNode)) + this.allDisposalNodeChild.forEach(item => { + item.children = [] + this.allDisposalNodeChild.forEach(i => { + if(i.parentId == item.id){ + item.children.push(i) + } + }) + }) + // console.log(this.nodeItem.id) + } + onNoClick(): void { + this.dialogRef.close(); + } + nodeItem + itemChildNum = 0 //鐐瑰嚮澶勭疆鑺傜偣瀛愭暟鎹妭鐐圭殑鏁伴噺 + clickNode(item){ + // console.log(item) + this.nodeItem = item + this.allDisposalNodeChild.forEach(item => { + if(item.id == this.nodeItem.id){ + this.itemChildNum = item.children.length + } + }) + } + + selectedBuildingData = this.data.selectedBuildingData + selectedSiteData = this.data.selectedSiteData + onSubmit(value,type){ + // console.log(type) + let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name + //濡傛灉淇濆瓨鍒板凡鏈夎妭鐐 + var postdata = { + id: "", + name: name, + level: 0, + order: this.itemChildNum, + description: "", + notes: "", + weather: null, + airTemperature: null, + windDirection: null, + windScale: null, + imageNames: null, + imageUrls: null, + parentId: this.nodeItem ? this.nodeItem.id : null, + disasterId: this.data.disasterId, + planComponentId: sessionStorage.getItem('planId') || '', + companyId: this.data.siteOrbuilding == -1 ? sessionStorage.getItem('companyId') : null, + sitePlanId: this.data.siteOrbuilding==-1 ? this.selectedSiteData.id : null, + buildingId: this.selectedBuildingData.id || null, + buildingAreaId: this.data.siteOrbuilding!=-1 ? this.selectedSiteData.id : null + } + if(type == 'old'){ + let istrue = this.canvasData.findDisposalNode(this.nodeItem.id,name) + let putdata = this.nodeItem + putdata.weather = this.canvasData.selectPanelPointBaseData.weather + putdata.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) + putdata.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale) + putdata.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) + putdata.description = this.canvasData.selectPanelPointBaseData.description + putdata.notes = this.canvasData.selectPanelPointBaseData.notes + + + if(istrue){//濡傛灉璇ュ缃妭鐐逛笅宸叉湁鍚屽悕鏁版嵁鑺傜偣 鍒欏彧淇敼 2涓帴鍙 + new Promise((resolve,reject)=>{ + this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { + resolve("鏇存柊澶勭疆鑺傜偣鎴愬姛,灏嗗ぉ姘 鑺傜偣璇︽儏绛変俊鎭繚瀛樺埌鐐瑰嚮鐨勮妭鐐") + }) + }).then((values)=>{ + this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + // 淇濆瓨骞抽潰鍥炬暟鎹埌褰撳墠鑺傜偣 + let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) + postdata.Data = JSON.stringify(postdata.Data) + this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) + },err=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触','纭畾',config) + }) + this.dialogRef.close(); + this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + }) + + }else{//闇瑕3涓帴鍙 + new Promise((resolve,reject)=>{ + this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { + resolve("鏇存柊澶勭疆鑺傜偣鎴愬姛,灏嗗ぉ姘 鑺傜偣璇︽儏绛変俊鎭繚瀛樺埌鐐瑰嚮鐨勮妭鐐") + }) + }).then((values)=>{ + // console.log(values) + postdata.level = putdata.level + 1 + new Promise((resolve,reject) => { + this.http.post(`/api/DisposalNodes`,postdata).subscribe(data => { + resolve(data) + }) + }).then((data:any)=>{ + // console.log(7788,data) + let objData = { + id: "", + data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, + version: this.canvasData.selectPanelPoint.Version || "2.0", + disposalNodeId: data.id, + planComponentId: sessionStorage.getItem("planId"), + } + this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) + },err=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触','纭畾',config) + }) + this.dialogRef.close(); + this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + }) + }) + } + + }else{//濡傛灉淇濆瓨鍒版柊寤鸿妭鐐 + let dispositionNodeData //澶勭疆鑺傜偣data + let order + let oneLevelNum = [] + //灏唎rder璧嬪间负鎵鏈変竴绾ц妭鐐规渶鍚庝竴涓+1 + this.allDisposalNode.forEach(item => { + if(!item.parentId){ + oneLevelNum.push(item) + } + }) + if(oneLevelNum.length == 0){ + order = 0 + }else{ + order = oneLevelNum[oneLevelNum.length - 1].order + 1 + } + + if(this.nodeItem){//濡傛灉鐐瑰嚮浜嗕笅鎷夐夋嫨妗 + if(this.nodeItem.id != null){ + this.allDisposalNodeChild.forEach(item => { + if(item.id == this.nodeItem.id){ + order = item.children.length + } + }) + } + } + dispositionNodeData = { + id: "", + name: value.name, + level: this.nodeItem && this.nodeItem.id != null ? this.nodeItem.level + 1 : 0, + order: order, + description: "", + notes: "", + weather: null, + airTemperature: 0, + windDirection: 0, + windScale: 0, + imageNames: null, + imageUrls: null, + parentId: this.nodeItem ? this.nodeItem.id : null, + disasterId: this.data.disasterId, + planComponentId: sessionStorage.getItem('planId') || '', + companyId: null, + sitePlanId: null, + buildingId: null, + buildingAreaId: null + } + + dispositionNodeData.weather = this.canvasData.selectPanelPointBaseData.weather + dispositionNodeData.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) + dispositionNodeData.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale) + dispositionNodeData.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) + dispositionNodeData.description = this.canvasData.selectPanelPointBaseData.description + dispositionNodeData.notes = this.canvasData.selectPanelPointBaseData.notes + //1.鍏堝垱寤轰竴涓缃妭鐐 鐒跺悗 .then 2.鍒涘缓鏁版嵁鑺傜偣鍒板垰鍒涘缓鐨勫缃妭鐐 3.鐒跺悗鎷跨潃鍒涘缓濂界殑鏁版嵁鑺傜偣鐨刬d 灏嗗钩闈㈠浘data淇濆瓨 + new Promise((resolve,reject) => { + this.http.post("/api/DisposalNodes",dispositionNodeData).subscribe((data:any) => { + resolve(data.id) + }) + }).then((id) => { + let dataNodeData + new Promise((resolve,reject) => { + postdata.parentId = id + postdata.level = dispositionNodeData.level + 1 + this.http.post("/api/DisposalNodes",postdata).subscribe((data:any) => { + resolve(data) + }) + }).then((data:any) => { + // 淇濆瓨骞抽潰鍥炬暟鎹埌褰撳墠鑺傜偣 + // console.log(6666,data) + // let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) + // postdata.Data = JSON.stringify(postdata.Data) + let objData = { + id: "", + data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, + version: this.canvasData.selectPanelPoint.Version || "2.0", + disposalNodeId: data.id, + planComponentId: sessionStorage.getItem("planId"), + } + + this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) + + },err=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触','纭畾',config) + }) + this.dialogRef.close(); + this.canvasData.sendMessage("send a message") + }) + }) + } + } +} \ No newline at end of file diff --git a/src/app/ui/collection-tools-building/saveOne.html b/src/app/ui/collection-tools-building/saveOne.html new file mode 100644 index 0000000..a6b0b32 --- /dev/null +++ b/src/app/ui/collection-tools-building/saveOne.html @@ -0,0 +1,5 @@ +
澶勭疆鑺傜偣淇濆瓨
+
+ + +
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/saveTwo.html b/src/app/ui/collection-tools-building/saveTwo.html new file mode 100644 index 0000000..fec97ff --- /dev/null +++ b/src/app/ui/collection-tools-building/saveTwo.html @@ -0,0 +1,53 @@ +
+
鏂板鑺傜偣
+
+
+ +
+ + + +
+
+ + + + {{item.name}} + + + +
+
+ + +
+
+
+
+
+
淇濆瓨鍒板凡鏈夎妭鐐
+
+
+
+ + + + {{item.name}} + + + +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/viewdetails.html b/src/app/ui/collection-tools-building/viewdetails.html new file mode 100644 index 0000000..76638c2 --- /dev/null +++ b/src/app/ui/collection-tools-building/viewdetails.html @@ -0,0 +1,24 @@ +
+
+ clear +
+ +
+
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/addPlaneFigure.html b/src/app/ui/collection-tools-plan/addPlaneFigure.html index 930bf81..605e5e5 100644 --- a/src/app/ui/collection-tools-plan/addPlaneFigure.html +++ b/src/app/ui/collection-tools-plan/addPlaneFigure.html @@ -12,6 +12,17 @@
+ + +
+ + 涓婁紶鏈湴鍥剧墖 + +

閫夋嫨鏂囦欢: {{file.name}}

+
+
鏄惁涓洪伩闅惧眰
diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.html b/src/app/ui/collection-tools-plan/collection-tools.component.html index e461b35..ac69822 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.html +++ b/src/app/ui/collection-tools-plan/collection-tools.component.html @@ -2,105 +2,30 @@
- - - - + -
- - - - -
-
- keyboard_arrow_right - keyboard_arrow_left - 澶╂皵 - - 姘旀俯 -
- - -
- 椋庡姏 - - 椋庡悜 - -
-
+ + + + +
@@ -225,12 +150,8 @@
-
-
-
- 灞炴 -
-
+
+
灞炴

闈㈢Н(骞虫柟绫)

@@ -332,110 +253,52 @@

{{item.PropertyName}}

{{item.PropertyName}}

- - + +

{{item.PropertyName}}

{{item.PropertyName}}

-
- -
- -
- -
- -
-
- 娑堥槻瑕佺礌 -
-
- -
- - - - - - - {{node.name}} - - ({{node.children.length}}) - visibility - - - - - - - {{node.name}} - - ({{node.children.length}}) - visibility - - -
+
-
-
-
-
- 鑺傜偣璇︽儏 -
-
- 娉ㄦ剰浜嬮」 -
-
-
- - -
-
diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.scss b/src/app/ui/collection-tools-plan/collection-tools.component.scss index 1ec5d7d..acae429 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.scss +++ b/src/app/ui/collection-tools-plan/collection-tools.component.scss @@ -25,21 +25,19 @@ align-items:center; min-height: 40px; background-color: #fff; - .nameShow{ - cursor: pointer; + .marginLeftRight { + margin: 0 8px; + font-size: 16px; user-select:聽none; + cursor: pointer; + .mat-icon { vertical-align: middle; font-size: 24px; } } .copytobutn{ - width: 33px; - min-width: 33px; + width: 60px; + min-width: 60px; display: flex; justify-content: center; } - font-size: 18px; - mat-icon{ - font-size: 26px; - vertical-align: text-top; - } span{ height: 24px; line-height: 24px; @@ -61,6 +59,12 @@ color: white; } } + .rightSave { + cursor: pointer; + position: absolute; + right: 60px; + label { vertical-align: middle; color: #279FFF; } + } } //澶撮儴鎿嶄綔鏍 @@ -109,7 +113,7 @@ top: 0; } .functionalDomain { - flex: 90%; + flex: 95%; overflow: hidden; .functionalDomainContent { position: relative; @@ -140,10 +144,9 @@ z-index: 1001; margin-right: 0px; transition: margin-right 0.5s; - border: 1px solid #464646; + border: 1px solid #E6EAEE; width: 235px; right: 0; - } //鍙宠竟瀵艰埅鏍忔樉绀洪殣钘 .togglePanel2 { @@ -155,27 +158,17 @@ margin-left: -2000px; transition: margin-left 1s; } - } //鍙宠竟鎿嶄綔鏍 -.title{ - width: 100%; - height: 35px; - background-color: #464646; - div{ - width: 50%; - height: 35px; - line-height: 35px; - background-color: #595959; - border-radius: 5px; - span{ - color: white; - font-size: 14px; - font-weight: 400; - padding-left: 5px; - } - } +.rightTitle{ + height: 35x; + line-height: 35px; + text-align: center; + border-top-left-radius: 10px; + border-top-right-radius: 10px; + background-color: #2196F3; + color: #fff; } diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index b776406..d4b9d0b 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -607,7 +607,6 @@ export class CollectionToolsPlanComponent implements OnInit { this.canvasData.isChange = true } - isSixShow = true isSixbtn = true //鎺у埗鎯冲畾浣滀笟缂栬緫鎸夐挳 isediticon = true //鎺у埗鏌ョ湅缂栬緫妯″紡鐨勭紪杈戞ā寮忓皬绗旀寜閽 @@ -631,7 +630,6 @@ export class CollectionToolsPlanComponent implements OnInit { this.canvasData.gameMode = GameMode.Assignment } else { this.getAllLibrary() //鑾峰彇绱犳潗搴 - this.getAllBuildings() //鑾峰彇鎵鏈夊缓绛 } let that = this @@ -645,7 +643,7 @@ export class CollectionToolsPlanComponent implements OnInit { this.canvasData.getMessage().subscribe((message: any)=>{ if(message == "send a message"){ - this.refurbishTreeData() + // this.refurbishTreeData() } }) } @@ -669,7 +667,7 @@ export class CollectionToolsPlanComponent implements OnInit { //鐩戝惉鏁版嵁鍙樺寲鍚 this.canvas.on('canvasDataChanged',()=>{ // 鏀跺埌鏁版嵁琛ㄧず鍏变韩鏁版嵁鍙戠敓鍙樺寲 - this.renovateTreeData(false) + // this.renovateTreeData(false) }); } @@ -684,7 +682,7 @@ export class CollectionToolsPlanComponent implements OnInit { let buildingId = this.beforeOneCheckedBuilding.id let floorId = this.selectingSitePlan.id this.canvas.paste(companyId,buildingId,floorId) - this.renovateTreeData(false) + // this.renovateTreeData(false) } basicInfo:boolean = true //鍩烘湰淇℃伅鍚嶇О鏄鹃殣 @@ -761,7 +759,6 @@ export class CollectionToolsPlanComponent implements OnInit { }else{ //濡傛灉鏄崟浣 鎬诲钩闈㈠浘 if(this.checkedBuildingIndex==-1){ - // console.log(111,SitePlanData) //淇濆瓨骞抽潰鍥炬暟鎹 this.http.post("/api/SitePlanData",SitePlanData,{ params:{ @@ -1258,6 +1255,7 @@ export class CollectionToolsPlanComponent implements OnInit { //鐐瑰嚮鏁拌妭鐐圭殑鏄剧ず闅愯棌icon clickLookItem(node){ + //淇敼鐪熷疄绱犳潗islook灞炴 for(let key in this.storeyData.data){ if(key == node.id){ @@ -1352,31 +1350,30 @@ export class CollectionToolsPlanComponent implements OnInit { //灏佽 鍒锋柊 tree 鏁版嵁 async renovateTreeData (isRefresh:boolean = true) { - this.allFireElements[this.allFireElements.length-1].children = [] + // this.allFireElements[this.allFireElements.length-1].children = [] isRefresh? await this.canvas.refresh() : null this.canvas.setNameVisible(this.basicInfo,0) this.canvas.setNameVisible(this.wantToWork,1) isRefresh? this.canvasData.isChange = false : null //鏈嶅姟涓 鏁版嵁鏄惁鏀瑰姩 鏀逛负false isRefresh? this.isShowProperty = true : null isRefresh? this.isShowAttribute = true : null - !this.pattern? this.mateFireForce() : null //鍒锋柊 寤虹瓚妤煎眰 鐏簮/鍔涢噺鍥炬爣 - let beforeOneId = this.selectingSitePlan.id || '' //褰撳墠 閫変腑 骞抽潰鍥 妤煎眰/鍖哄煙 id - let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 褰撳墠 鍗曚綅/寤虹瓚 鏁版嵁 - let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //褰撳墠 妤煎眰 鏁版嵁 + // let beforeOneId = this.selectingSitePlan.id || '' //褰撳墠 閫変腑 骞抽潰鍥 妤煎眰/鍖哄煙 id + // let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 褰撳墠 鍗曚綅/寤虹瓚 鏁版嵁 + // let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //褰撳墠 妤煎眰 鏁版嵁 - for(let key in companyBuildingData.data){ - if (companyBuildingData.data[key].FloorId === beforeOneId) { //澶勭悊 鍗曚綅/寤虹瓚 鏁版嵁鏄惁褰掍簬褰撳墠妤煎眰涓 - storeyData.data[key] = companyBuildingData.data[key] - } - } - for(let key in storeyData.data){ //绛涢夋暟鎹 娌℃湁鍖归厤鍏ㄩ儴鏀惧叆鍒 鍏朵粬 鏁扮粍 - let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) - if (!noMatch) { - this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) - } - } - this.handleTreeData(storeyData) //澶勭悊tree鏁版嵁缁撴瀯 + // for(let key in companyBuildingData.data){ + // if (companyBuildingData.data[key].FloorId === beforeOneId) { //澶勭悊 鍗曚綅/寤虹瓚 鏁版嵁鏄惁褰掍簬褰撳墠妤煎眰涓 + // storeyData.data[key] = companyBuildingData.data[key] + // } + // } + // for(let key in storeyData.data){ //绛涢夋暟鎹 娌℃湁鍖归厤鍏ㄩ儴鏀惧叆鍒 鍏朵粬 鏁扮粍 + // let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) + // if (!noMatch) { + // this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) + // } + // } + // this.handleTreeData(storeyData) //澶勭悊tree鏁版嵁缁撴瀯 } @@ -1423,7 +1420,7 @@ export class CollectionToolsPlanComponent implements OnInit { //鑾峰彇鎬诲钩闈㈠浘 getSitePlan () { - let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //鑾峰彇鍗曚綅涓 娑堥槻瑕佺礌 + // let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //鑾峰彇鍗曚綅涓 娑堥槻瑕佺礌 let planData = this.getSitePlanCompanyData() //鑾峰彇 鍗曚綅 鏁版嵁 this.http.get('/api/SitePlans',{params:this.params}).subscribe(data=>{ this.sitePlanData = data @@ -1431,7 +1428,7 @@ export class CollectionToolsPlanComponent implements OnInit { this.canvasData.selectStorey = this.sitePlanData[0] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 this.selectSitePlanIndex = 0 - Promise.all([fireData,planData]).then((res)=>{ + Promise.all([planData]).then((res)=>{ this.getSitePlanStorey(this.selectingSitePlan) //鑾峰彇 骞抽潰鍥 妤煎眰鏁版嵁 }) @@ -1441,7 +1438,7 @@ export class CollectionToolsPlanComponent implements OnInit { //鑾峰彇寤虹瓚 妤煎眰/鍖哄煙 getBuildingSitePlan (item) { let params = { buildingId: item.id } - let fireData = this.getFireElements(item.buildingTypes[0].id || '') //鑾峰彇寤虹瓚涓 娑堥槻瑕佺礌 + // let fireData = this.getFireElements(item.buildingTypes[0].id || '') //鑾峰彇寤虹瓚涓 娑堥槻瑕佺礌 let planData = this.getBuildingData(params) //鑾峰彇 寤虹瓚 鏁版嵁 this.http.get('/api/BuildingAreas',{params}).subscribe(data=>{ this.sitePlanData = data @@ -1449,7 +1446,7 @@ export class CollectionToolsPlanComponent implements OnInit { this.canvasData.selectStorey = this.sitePlanData[0] || {} //鏈嶅姟涓 瀛樹竴浠芥暟鎹 this.selectSitePlanIndex = 0 - Promise.all([fireData,planData]).then((res)=>{ + Promise.all([planData]).then((res)=>{ this.getBuildingStorey(this.selectingSitePlan) //鑾峰彇 寤虹瓚 妤煎眰鏁版嵁 }) diff --git a/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts b/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts index 598e178..b010e94 100644 --- a/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts @@ -23,36 +23,75 @@ export class leftFunctionalDomainComponentPlan implements OnInit { params = {companyId: sessionStorage.getItem('companyId')} checked:boolean = false;//鏄惁涓洪伩闅惧眰 - + file:any = null; //涓婁紶鐨勬枃浠 + + //閫夋嫨鏂囦欢 + selectFile (e) { + if (e.target.files.length) { + let maxSize = 5*1024*1024 + if (e.target.files[0].size <= maxSize) { + this.file = e.target.files[0] + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶鍥剧墖闇灏忎簬5MB','纭畾',config); + } + } + } + + //瀵煎叆GIS + toGIS () { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('鍔熻兘寮鍙戞祴璇曚腑,鍗冲皢涓婄嚎','纭畾',config); + } + //鎻愪氦琛ㄥ崟鍒涘缓骞抽潰鍥 onSubmit (e) { - if (!this.data.isBuilding) { //鎬诲钩闈㈠浘 鍒涘缓骞抽潰鍥 - let data = { - companyId: sessionStorage.getItem('companyId'), - name: e.name, - order: this.data.order, - area:e.area, - details:e.details, - enabled: true, - modifiedTime: new Date(), - } - this.http.post('/api/SitePlans',data).subscribe(data=>{ - this.dialogRef.close('鎬诲钩闈㈠浘'); - }) - } else { //寤虹瓚 鍒涘缓妤煎眰/鍖哄煙 - let data = { - isRefugeStorey: e.isRefugeStorey, - buildingId: this.data.Panel.id, - name: e.name, - order: this.data.order, - area:e.area, - details:e.details, - enabled: true, - modifiedTime: new Date(), - } - this.http.post('/api/BuildingAreas',data,{params:this.params}).subscribe(data=>{ - this.dialogRef.close('寤虹瓚'); - }) + if (this.file) { + let formData = new FormData() + formData.append("file",this.file) + this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{ + let imgURL = '/api/Objects/WebPlan2D/' + data.objectName + console.log(imgURL) + if (!this.data.isBuilding) { //鎬诲钩闈㈠浘 鍒涘缓骞抽潰鍥 + let data = { + companyId: sessionStorage.getItem('companyId'), + name: e.name, + order: this.data.order, + area:e.area, + details:e.details, + enabled: true, + modifiedTime: new Date(), + imageUrl: imgURL, + } + this.http.post('/api/SitePlans',data).subscribe(data=>{ + this.dialogRef.close('鎬诲钩闈㈠浘'); + }) + } else { //寤虹瓚 鍒涘缓妤煎眰/鍖哄煙 + let data = { + isRefugeStorey: e.isRefugeStorey, + buildingId: this.data.Panel.id, + name: e.name, + order: this.data.order, + area:e.area, + details:e.details, + enabled: true, + modifiedTime: new Date(), + imageUrl: imgURL, + } + this.http.post('/api/BuildingAreas',data,{params:this.params}).subscribe(data=>{ + this.dialogRef.close('寤虹瓚'); + }) + } + }) //post + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('璇蜂笂浼犲浘鐗','纭畾',config); } } diff --git a/src/app/ui/collection-tools-plan/panel.scss b/src/app/ui/collection-tools-plan/panel.scss index f0ae073..11200e8 100644 --- a/src/app/ui/collection-tools-plan/panel.scss +++ b/src/app/ui/collection-tools-plan/panel.scss @@ -268,9 +268,34 @@ .keyMargin { width: 100%; margin: 5px 0; + text-align: center; .mat-form-field { width: 100%; } + //涓婁紶CAD寮圭獥 inputfile + .uploadBackGround { + width: 80%; + padding: 0 25px; + height: 30px; + line-height: 30px; + position: relative; + cursor: pointer; + color: #000; + font-size: 14px; + background: #fafafa; + border: 1px solid #ddd; + border-radius: 5px; + overflow: hidden; + display: inline-block; + } + .uploadBackGround input { + position: absolute; + width: 100%; + right: 0; + top: 0; + opacity: 0; + cursor: pointer + } } .submitBottom { display: flex; diff --git a/src/app/ui/collection-tools/addBGCDisposalNode.html b/src/app/ui/collection-tools/addBGCDisposalNode.html new file mode 100644 index 0000000..f9f91af --- /dev/null +++ b/src/app/ui/collection-tools/addBGCDisposalNode.html @@ -0,0 +1,24 @@ +
+
+ +
+ +
+ +
+ +
+ + 鈫戠偣鍑昏繖閲屼笂浼犳枃浠 + +

{{file.name}}

+
+ +
+ + +
+ +
+ +
\ No newline at end of file diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 58b9396..be34123 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -2,83 +2,40 @@
- - - - - - 鍩烘湰淇℃伅鍚嶇О - visibility - - - 鎯冲畾浣滀笟鍚嶇О - visibility + + 鍩烘湰淇℃伅鍚嶇Оvisibility -
- - 鍩烘湰淇℃伅缂栬緫 - - - 鎯冲畾浣滀笟缂栬緫 - -
- - tv - create - description + + 鎯冲畾浣滀笟鍚嶇Оvisibility -
- -
- - - -
+ +
- keyboard_arrow_right - keyboard_arrow_left 澶╂皵 姘旀俯
- - + +
椋庡姏 +
+
@@ -112,10 +71,79 @@ + +
+
+
+ open_with + + + + + + + +
+
+ {{item.name}} + + + + + + +
+
+
+
+
鎬诲钩闈㈠浘
+
+ {{item.name}} +
+
+
+ +
+ +
+
+ keyboard_arrow_up + keyboard_arrow_down + + +
+
+ + + +
+ +
+ edit + add + library_books + delete_forever +
+
+
+ +
+
+ + -
+ -
+
diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 19402a6..1d5a3de 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -25,21 +25,19 @@ align-items:center; min-height: 40px; background-color: #fff; - .nameShow{ - cursor: pointer; + .marginLeftRight { + margin: 0 8px; + font-size: 16px; user-select:聽none; + cursor: pointer; + .mat-icon { vertical-align: middle; font-size: 24px; } } .copytobutn{ - width: 33px; - min-width: 33px; + width: 60px; + min-width: 60px; display: flex; justify-content: center; } - font-size: 18px; - mat-icon{ - font-size: 26px; - vertical-align: text-top; - } span{ height: 24px; line-height: 24px; @@ -61,6 +59,12 @@ color: white; } } + .rightSave { + margin: 0 10px; + cursor: pointer; + vertical-align: middle; + color: #279FFF; + } } //澶撮儴鎿嶄綔鏍 @@ -109,13 +113,21 @@ top: 0; } .functionalDomain { - flex: 90%; + flex: 95%; overflow: hidden; .functionalDomainContent { position: relative; width: 100%; height: 100%; } + .centerBuildingDiv { + position: absolute; + max-width: 400px; + top: 40px; + left: 240px; + z-index: 150; + display: flex; + } .functionalDomainLeft { background-color: #fff; display: flex; @@ -137,7 +149,7 @@ } } .functionalDomainRight { - z-index: 1001; + z-index: 111; margin-right: 0px; transition: margin-right 0.5s; border: 1px solid #464646; @@ -158,6 +170,41 @@ } +//涓棿寤虹瓚/妤煎眰 +.centerTotal { + width: 197px; + background-color: #fff; + box-shadow: 0px 0px 5px 3px rgb(165, 163, 163); + border-radius: 5px; + box-sizing: border-box; + padding: 5px 0; + .centerTotalHeader { + height: 30px; + line-height: 30px; + box-sizing: border-box; + padding-right: 5px; + font-size: 14px; + .centerTotalTitle { >label{ display: inline-block; vertical-align: middle; max-width: 90px; } } + .move{margin: 0 5px;} + .move:hover {cursor: move;} + .mat-icon { + font-size: 24px; + color: rgb(175, 164, 164); + } + } + .everyTotal { + width: 100%; + height: 30px; + line-height: 30px; + box-sizing: border-box; + padding: 0 5px; + margin: 3px 0; + cursor:pointer; + font-size: 16px; + } +} +//涓棿寤虹瓚/妤煎眰 + //鍙宠竟鎿嶄綔鏍 .title{ width: 100%; @@ -304,6 +351,7 @@ //鍙充晶娑堥槻瑕佺礌 .firecategories{ position: relative; + background-color: #fff; display: flex; flex-flow: column; .firecategoriesTree{ @@ -361,19 +409,16 @@ div:focus { } .bigBox{ - width: 700px; + width: 650px; height: 40px; + line-height: 40px; position: absolute; overflow: hidden; right: 0; + top: 0; } .weatherBox{ - height: 40px; - width: 700px; - line-height: 40px; - position: absolute; - right: 0; - transition: right linear .5s; + width: 100%; .openbtn{ font-size: 45px; height: 45px; diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index b101e13..9ac9bd6 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContaine import { HttpClient, HttpHeaders } from '@angular/common/http'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeComponent,addDisposalNodeComponent} from './leftFunctionalDomain' +import {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeComponent,addDisposalNodeComponent, addBGCDisposalNodeComponent} from './leftFunctionalDomain' import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; import {FlatTreeControl} from '@angular/cdk/tree'; import {WorkingAreaComponent} from '../../working-area/working-area.component' @@ -145,7 +145,7 @@ export class CollectionToolsComponent implements OnInit { this.isImgNumCss = false } } - pattern:boolean = true//榛樿涓哄熀鏈俊鎭紪杈 + pattern:boolean = false//榛樿涓哄熀鏈俊鎭紪杈 //鍩烘湰淇℃伅缂栬緫妯″紡 @@ -625,7 +625,7 @@ export class CollectionToolsComponent implements OnInit { isxxx = true //鎺у埗鏌ョ湅缂栬緫妯″紡鐨勭紪杈戞ā寮忔寜閽 ngOnInit(): void { - + this.canvasData.gameMode = GameMode.Assignment if(this.router.url.indexOf("keyUnit/viewunitinfoplan") == -1 && this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ this.isSixbtn = false } @@ -643,7 +643,7 @@ export class CollectionToolsComponent implements OnInit { this.isxxx = false } - this.getAllLibrary() //鑾峰彇绱犳潗搴 + this.getAllLibrary('plan') //鑾峰彇绱犳潗搴 this.getAllBuildings() //鑾峰彇鎵鏈夊缓绛 this.getAllFirePlan() //鑾峰彇褰撳墠鍗曚綅鐏炬儏 @@ -666,7 +666,7 @@ export class CollectionToolsComponent implements OnInit { ngAfterViewInit(): void { - + this.getSitePlan() // 鐩戝惉canvas缁勪欢閫変腑绱犳潗浜嬩欢 this.canvas.on("select",obj=>{ @@ -680,7 +680,7 @@ export class CollectionToolsComponent implements OnInit { //鐩戝惉鏁版嵁鍙樺寲鍚 this.canvas.on('canvasDataChanged',()=>{ // 鏀跺埌鏁版嵁琛ㄧず鍏变韩鏁版嵁鍙戠敓鍙樺寲 - this.renovateTreeData(false) + this.canvasData.selectPanelPoint.BackgroundImageUrl? this.customizeNodes() : this.renovateTreeData(false) }); } @@ -695,10 +695,10 @@ export class CollectionToolsComponent implements OnInit { let buildingId = this.beforeOneCheckedBuilding.id let floorId = this.selectingSitePlan.id this.canvas.paste(companyId,buildingId,floorId) - this.renovateTreeData(false) + this.canvasData.selectPanelPoint.BackgroundImageUrl? this.customizeNodes() : this.renovateTreeData(false) } - basicInfo:boolean = true //鍩烘湰淇℃伅鍚嶇О鏄鹃殣 + basicInfo:boolean = false //鍩烘湰淇℃伅鍚嶇О鏄鹃殣 wantToWork:boolean = true //鎯冲畾浣滀笟鍚嶇О鏄鹃殣 //鐐瑰嚮鍩烘湰淇℃伅鍚嶇О basicInfoClick(){ @@ -1025,12 +1025,7 @@ export class CollectionToolsComponent implements OnInit { disasterId: this.allFirePlan[0].id || '' } }); - - dialogRef.afterClosed().subscribe(result => { - // console.log('The dialog was closed'); - }); - } - + } //else } else { //if const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -1217,10 +1212,9 @@ export class CollectionToolsComponent implements OnInit { if(selectPanelPoint.Data){ for(let key in selectPanelPoint.Data.Stock){ selectPanelPoint.Data.Stock[key].isLookPattern = true + selectPanelPoint.Data.Stock[key].isLook = true if(element.id == selectPanelPoint.Data.Stock[key].FireElementId){ selectPanelPoint.Data.Stock[key].isTemplate = false - selectPanelPoint.Data.Stock[key].isLook = true - element.isNewElement = true //璇ヨ妭鐐筩hildren鏄惁瀛樺湪鏂版坊鍔犵殑鐪熷疄绱犳潗 鏍囪瘑 //瀹氫箟鏌ョ湅妯″紡涓嬭兘鐪嬪埌鐨勫厓绱 @@ -1245,7 +1239,6 @@ export class CollectionToolsComponent implements OnInit { }); this.dataSource.data = treeData this.treeControl.expandAll() - } //鐐瑰嚮鏍戣妭鐐 @@ -1276,13 +1269,19 @@ export class CollectionToolsComponent implements OnInit { //鐐瑰嚮鏁拌妭鐐圭殑鏄剧ず闅愯棌icon clickLookItem(node){ - //淇敼鐪熷疄绱犳潗islook灞炴 for(let key in this.storeyData.data){ if(key == node.id){ this.storeyData.data[key].isLook = !this.storeyData.data[key].isLook } } + if(this.selectPanelPoint && this.selectPanelPoint.Data){ + for(let key in this.selectPanelPoint.Data.Stock){ + if(key == node.id){ + this.selectPanelPoint.Data.Stock[key].isLook = !this.selectPanelPoint.Data.Stock[key].isLook + } + } + } //鎵鏈夋秷闃茶绱犳ā鏉垮彉鍖杋slook鍊 if(node.isTemplate){ @@ -1375,10 +1374,12 @@ export class CollectionToolsComponent implements OnInit { isRefresh? await this.canvas.refresh() : null this.canvas.setNameVisible(this.basicInfo,0) this.canvas.setNameVisible(this.wantToWork,1) + this.canvas.setLegendVisible(this.isShowLegend) //鍥句緥鏄鹃殣 isRefresh? this.canvasData.isChange = false : null //鏈嶅姟涓 鏁版嵁鏄惁鏀瑰姩 鏀逛负false isRefresh? this.isShowProperty = true : null isRefresh? this.isShowAttribute = true : null !this.pattern? this.mateFireForce() : null //鍒锋柊 寤虹瓚妤煎眰 鐏簮/鍔涢噺鍥炬爣 + this.beforeOneCheckedBuildingIsShow = false let beforeOneId = this.selectingSitePlan.id || '' //褰撳墠 閫変腑 骞抽潰鍥 妤煎眰/鍖哄煙 id let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 褰撳墠 鍗曚綅/寤虹瓚 鏁版嵁 @@ -1391,15 +1392,15 @@ export class CollectionToolsComponent implements OnInit { } for(let key in storeyData.data){ //绛涢夋暟鎹 娌℃湁鍖归厤鍏ㄩ儴鏀惧叆鍒 鍏朵粬 鏁扮粍 let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) - if (!noMatch) { + if (!noMatch && storeyData.data[key].Id != "鍥句緥") { this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) } } - let selectPanelPoint = JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint || {} )) //褰撳墠 鑺傜偣 鏁版嵁 + let selectPanelPoint:any = this.canvasData.selectPanelPoint || {} //褰撳墠 鑺傜偣 鏁版嵁 if(selectPanelPoint.Data){ for(let key in selectPanelPoint.Data.Stock){ //绛涢夋暟鎹 娌℃湁鍖归厤鍏ㄩ儴鏀惧叆鍒 鍏朵粬 鏁扮粍 let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId ) - if (!noMatch) { + if (!noMatch && selectPanelPoint.Data.Stock[key].Id != "鍥句緥") { this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key]) } } @@ -1423,6 +1424,12 @@ export class CollectionToolsComponent implements OnInit { togglePlane:boolean = true; //鍙睍寮闈㈡澘骞抽潰鍥 鏄鹃殣 toggleMaterialBank:boolean = false; //鍙睍寮闈㈡澘绱犳潗搴 鏄鹃殣 toggleHandlePlans:boolean = true; //鍙睍寮闈㈡澘澶勭疆棰勬 鏄鹃殣 + + beforeOneCheckedBuildingIsShow:boolean = false; //鎯冲畾浣滀笟涓 寤虹瓚鏄惁鏄剧ず + togglebeforeOneCheckedBuilding () { this.beforeOneCheckedBuildingIsShow = !this.beforeOneCheckedBuildingIsShow } + isShowLegend:boolean = true; //鍥句緥鏄惁鏄剧ず + changeLegend (e) { this.canvasData.selectPanelPoint.BackgroundImageUrl? null : this.canvas.setLegendVisible(this.isShowLegend) } + //鍙睍寮闈㈡澘灞曞紑鎴栧叧闂 toggle () { this.toggleExpandPanel = !this.toggleExpandPanel @@ -1559,7 +1566,7 @@ export class CollectionToolsComponent implements OnInit { selectSitePlan (item,index) { if (this.selectSitePlanIndex != index) { this.canvasData.selectPanelPoint = new DisposalNodeData(); - if (this.canvasData.isChange) { //true 鏁版嵁琚敼鍔 + if (this.pattern && this.canvasData.isChange) { //true 鏁版嵁琚敼鍔 let isTrue = confirm('鏄惁淇濆瓨褰撳墠缂栬緫鏁版嵁') if (isTrue) { //鍏堜繚瀛樻暟鎹 鍦ㄥ垏鎹 let isSuccess = this.saveSite()//true鐨勬椂鍊 鍏堜繚瀛樻暟鎹 @@ -1957,6 +1964,7 @@ export class CollectionToolsComponent implements OnInit { let params = {disasterId: this.allFirePlan[0].id || ''} this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //鎵鏈夊缃妭鐐 this.canvasData.allDisposalNode = data + this.getDisposalNode() }) }) } else { //鍗曚綅 鏈夌伨鎯呮椂 @@ -1964,6 +1972,7 @@ export class CollectionToolsComponent implements OnInit { let params = {disasterId: this.allFirePlan[0].id || ''} this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //鎵鏈夊缃妭鐐 this.canvasData.allDisposalNode = data + this.getDisposalNode() }) } }) @@ -2126,6 +2135,23 @@ export class CollectionToolsComponent implements OnInit { }) } + //鏂板缓 搴曞浘鏁版嵁鑺傜偣 + addBGCPanelPoint (e) { + e.stopPropagation() + let dialogRef = this.dialog.open(addBGCDisposalNodeComponent); + dialogRef.afterClosed().subscribe(data=>{ + if (data) { + this.canvasData.customizeDisposalNode = data //鑷畾涔夋暟鎹妭鐐 + let imgURL = window.URL.createObjectURL(data.file) //灏嗗浘鐗囩敓鎴 url鍦板潃 + this.canvasData.selectPanelPointBaseData = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''} //鏇存柊 褰撳墠鏁版嵁鑺傜偣瀵瑰簲鐖剁骇鑺傜偣 + this.selectDisposalNode = '' + this.canvasData.selectPanelPoint = new DisposalNodeData() //鏇存柊 褰撳墠鏁版嵁鑺傜偣 + this.canvasData.selectPanelPoint.BackgroundImageUrl = imgURL + this.customizeNodes() + } + }) + } + //鏂板缓 澶勭疆棰勬 鑺傜偣 addPanelPoint (e,item,treeData) { e.stopPropagation() @@ -2218,16 +2244,50 @@ export class CollectionToolsComponent implements OnInit { buildingIndex: e.sitePlanId? -1 : this.allBuildings.findIndex(item=>{ return item.id===e.buildingId }), //鎬诲钩闈㈠浘/寤虹瓚 index storeyId: e.sitePlanId? e.sitePlanId : e.buildingAreaId, //妤煎眰id } - this.http.get('/api/DisposalNodeData',{params:params}).subscribe(data=>{ + this.http.get('/api/DisposalNodeData',{params:params}).subscribe((data:any)=>{ this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data || new DisposalNodeData())) //閫夋嫨 褰撳墠 鑺傜偣 this.canvasData.selectPanelPoint.Data = this.canvasData.deserialize(this.canvasData.selectPanelPoint.Data) - this.seekPanelPoint(parameter) + data.backgroundImageUrl? this.customizeNodes() : this.seekPanelPoint(parameter) }) } //if } //else if } + //鑷畾涔夋暟鎹妭鐐 鏃 + async customizeNodes() { + await this.canvas.loadNoRelevantInformationDisposalPlan(this.canvasData.selectPanelPoint) + let other = { + children: [], + computed: true, + id: '', + name: '鍏朵粬', + order: 999, + parentId: null, + tag: "INPUT", + isLookPattern : true + } + this.allFireElements = [other] + this.canvas.setNameVisible(this.basicInfo,0) + this.canvas.setNameVisible(this.wantToWork,1) + // this.canvas.setLegendVisible(this.isShowLegend) //鍥句緥鏄鹃殣 + this.beforeOneCheckedBuildingIsShow = false + this.canvasData.isChange = false //鏈嶅姟涓 鏁版嵁鏄惁鏀瑰姩 鏀逛负false + this.isShowProperty = true + this.isShowAttribute = true + + let selectPanelPoint = JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint || {} )) //褰撳墠 鑺傜偣 鏁版嵁 + if(selectPanelPoint.Data){ + for(let key in selectPanelPoint.Data.Stock){ //绛涢夋暟鎹 娌℃湁鍖归厤鍏ㄩ儴鏀惧叆鍒 鍏朵粬 鏁扮粍 + let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId ) + if (!noMatch) { + this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key]) + } + } + } + this.handleTreeData({data:{}},selectPanelPoint) //澶勭悊tree鏁版嵁缁撴瀯 + } + //鏌ユ壘 鏁版嵁鑺傜偣 瀵瑰簲 寤虹瓚/妤煎眰 seekPanelPoint (paramsData) { this.checkedBuildingIndex = paramsData.buildingIndex diff --git a/src/app/ui/collection-tools/leftFunctionalDomain.ts b/src/app/ui/collection-tools/leftFunctionalDomain.ts index 519653d..9703cd8 100644 --- a/src/app/ui/collection-tools/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools/leftFunctionalDomain.ts @@ -129,6 +129,51 @@ export class editPlaneFigureComponent implements OnInit { +//鏂板缓 搴曞浘鏁版嵁鑺傜偣 +@Component({ + selector: 'app-addBGCDisposalNode', + templateUrl: './addBGCDisposalNode.html', + styleUrls: ['./panel.scss'] +}) +export class addBGCDisposalNodeComponent implements OnInit { + + constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } + + ngOnInit(): void { } + + file:any = null; //鏂囦欢 + //涓婁紶鍥剧墖 + selectFile (e) { + if (e.target.files.length) { + let maxSize = 5*1024*1024 + if (e.target.files[0].size <= maxSize) { + this.file = e.target.files[0] + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('涓婁紶鍥剧墖闇灏忎簬5MB','纭畾',config); + } + } + } + + //鎻愪氦琛ㄥ崟 + onSubmit (e) { + if (e.name && this.file) { + e.file = this.file + this.dialogRef.close(e); + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('璇蜂笂浼犲浘鐗','纭畾',config); + } + } + +} + + + //鍒涘缓 澶勭疆棰勬 鑺傜偣 @Component({ selector: 'app-addDisposalNode', diff --git a/src/app/ui/collection-tools/panel.scss b/src/app/ui/collection-tools/panel.scss index f0ae073..a127a5b 100644 --- a/src/app/ui/collection-tools/panel.scss +++ b/src/app/ui/collection-tools/panel.scss @@ -50,8 +50,8 @@ //鐏簮/鍔涢噺 鍥炬爣 .fireForce { display: block; + margin-top: 5px; float: right; - margin: 8px 5px 0 0; width: 40px; height: 20px; line-height: 20px; @@ -261,6 +261,10 @@ .selectanelPoint { background-color: #F4C235; } +//閫変腑 鏁版嵁鑺傜偣鏃 +.selectanelPointData { + background-color: #f8da88; +} @@ -289,3 +293,39 @@ resize:none; } } + +.leftAddBGC { + div{ text-align: center; } + input { + width: 190px; + height: 30px; + padding-left: 5px; + outline: none; + border: none; + border-radius: 5px; + background: #EEF1F5; + } +} +//涓婁紶CAD寮圭獥 inputfile +.uploadFile { + padding: 3px 10px; + height: 20px; + line-height: 20px; + position: relative; + cursor: pointer; + color: #0080FF; + font-size: 14px; + background: #fafafa; + border: 1px solid #0080FF; + border-radius: 3px; + overflow: hidden; + display: inline-block; + input { + position: absolute; + width: 100%; + right: 0; + top: 0; + opacity: 0; + cursor: pointer + } +} diff --git a/src/app/ui/collection-tools/save.ts b/src/app/ui/collection-tools/save.ts index 1657b66..8721c18 100644 --- a/src/app/ui/collection-tools/save.ts +++ b/src/app/ui/collection-tools/save.ts @@ -57,10 +57,11 @@ export class saveOneDialog { @Inject(MAT_DIALOG_DATA) public data) {} type = this.data.type - allDisposalNode = this.data.allDisposalNode - allPlanDisposalNode = [] + allDisposalNode = this.data.allDisposalNode//鎵鏈夎妭鐐规暟鎹 + allPlanDisposalNode = []//鎵鏈夐潪鏁版嵁鑺傜偣 allRootDisposalNode = [{name:"鏍硅妭鐐",id:null}] allDisposalNodeChild = [] + defaultSelectedName = '鏍硅妭鐐' ngOnInit(): void { //鎵鏈夐潪鏁版嵁鑺傜偣 this.allDisposalNode.forEach(item => { @@ -84,15 +85,13 @@ export class saveOneDialog { } }) }) - // console.log(this.nodeItem.id) } onNoClick(): void { this.dialogRef.close(); } - nodeItem - itemChildNum = 0 //鐐瑰嚮澶勭疆鑺傜偣瀛愭暟鎹妭鐐圭殑鏁伴噺 + nodeItem:any//褰撳墠閫変腑鐨勮淇濆瓨鍒扮殑鐖惰妭鐐 + itemChildNum = 0 //鐐瑰嚮澶勭疆鑺傜偣瀛愭暟鎹妭鐐圭殑鏁伴噺锛堣祴鍊紀rder锛 clickNode(item){ - // console.log(item) this.nodeItem = item this.allDisposalNodeChild.forEach(item => { if(item.id == this.nodeItem.id){ @@ -105,8 +104,17 @@ export class saveOneDialog { selectedSiteData = this.data.selectedSiteData onSubmit(value,type){ this.maskLayerService.sendMessage(true) - - let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name + let name + if (this.canvasData.selectPanelPoint.BackgroundImageUrl) { //褰撳墠 涓鸿嚜瀹氫箟澶勭疆鑺傜偣 + if (this.canvasData.selectPanelPoint.DisposalNodeId) { // 淇濆瓨閫昏緫 + let node = this.canvasData.findDisposalNode(this.canvasData.selectPanelPoint.DisposalNodeId,null) + node? name = node.name : null + } else { //鏂板缓閫昏緫 + name = this.canvasData.customizeDisposalNode.name + } + } else { + name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name + } //濡傛灉淇濆瓨鍒板凡鏈夎妭鐐 var postdata = { id: "", @@ -138,8 +146,7 @@ export class saveOneDialog { putdata.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) putdata.description = this.canvasData.selectPanelPointBaseData.description putdata.notes = this.canvasData.selectPanelPointBaseData.notes - - + if(istrue){//濡傛灉璇ュ缃妭鐐逛笅宸叉湁鍚屽悕鏁版嵁鑺傜偣 鍒欏彧淇敼 2涓帴鍙 new Promise((resolve,reject)=>{ this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { @@ -150,21 +157,30 @@ export class saveOneDialog { // 淇濆瓨骞抽潰鍥炬暟鎹埌褰撳墠鑺傜偣 let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) postdata.Data = JSON.stringify(postdata.Data) - this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { - this.maskLayerService.sendMessage(false) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) - },err=>{ - this.maskLayerService.sendMessage(false) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('淇濆瓨澶辫触','纭畾',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + postdata.Version = "2.0" + postdata.DisposalNodeId ? null : postdata.DisposalNodeId = istrue.id + postdata.PlanComponentId ? null : postdata.PlanComponentId = sessionStorage.getItem("planId") + postdata.Id ? null : postdata.Id = '' + postdata.BackgroundImageUrl? null : postdata.BackgroundImageUrl = null + let imgURL = this.uploadBGC() //鏇存柊 鑳屾櫙鍥 + imgURL.then(url=>{ + url? postdata.BackgroundImageUrl = url.toString() : null + this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { + this.maskLayerService.sendMessage(false) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) + },err=>{ + this.maskLayerService.sendMessage(false) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触','纭畾',config) + }) + this.dialogRef.close(); + this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + }) //imgURL }) }else{//闇瑕3涓帴鍙 @@ -173,7 +189,6 @@ export class saveOneDialog { resolve("鏇存柊澶勭疆鑺傜偣鎴愬姛,灏嗗ぉ姘 鑺傜偣璇︽儏绛変俊鎭繚瀛樺埌鐐瑰嚮鐨勮妭鐐") }) }).then((values)=>{ - // console.log(values) postdata.level = putdata.level + 1 new Promise((resolve,reject) => { this.http.post(`/api/DisposalNodes`,postdata).subscribe(data => { @@ -186,22 +201,27 @@ export class saveOneDialog { version: this.canvasData.selectPanelPoint.Version || "2.0", disposalNodeId: data.id, planComponentId: sessionStorage.getItem("planId"), + backgroundImageUrl: this.canvasData.selectPanelPoint.BackgroundImageUrl, } - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { - this.maskLayerService.sendMessage(false) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) - },err=>{ - this.maskLayerService.sendMessage(false) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('淇濆瓨澶辫触','纭畾',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + let imgURL = this.uploadBGC() //鏇存柊 鑳屾櫙鍥 + imgURL.then(url=>{ + url? objData.backgroundImageUrl = url.toString() : null + this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { + this.maskLayerService.sendMessage(false) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) + },err=>{ + this.maskLayerService.sendMessage(false) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触','纭畾',config) + }) + this.dialogRef.close(); + this.canvasData.sendMessage('send a message');//鍙戝竷涓鏉℃秷鎭 + }) //imgURL }) }) } @@ -280,26 +300,48 @@ export class saveOneDialog { version: this.canvasData.selectPanelPoint.Version || "2.0", disposalNodeId: data.id, planComponentId: sessionStorage.getItem("planId"), + backgroundImageUrl: this.canvasData.selectPanelPoint.BackgroundImageUrl, } - - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { - this.maskLayerService.sendMessage(false) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) - - },err=>{ - this.maskLayerService.sendMessage(false) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('淇濆瓨澶辫触','纭畾',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage("send a message") + let imgURL = this.uploadBGC() //鏇存柊 鑳屾櫙鍥 + imgURL.then(url=>{ + url? objData.backgroundImageUrl = url.toString() : null + this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { + this.maskLayerService.sendMessage(false) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨鎴愬姛','纭畾',config) + + },err=>{ + this.maskLayerService.sendMessage(false) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('淇濆瓨澶辫触','纭畾',config) + }) + this.dialogRef.close(); + this.canvasData.sendMessage("send a message") + }) //imgURL }) }) } } + + //灏佽鏂规硶 涓婁紶 鑷畾涔夊簳鍥 + uploadBGC () { + return new Promise((resolve,reject)=>{ + if (this.canvasData.selectPanelPoint.BackgroundImageUrl && !this.canvasData.selectPanelPoint.DisposalNodeId) { //鏂板缓閫昏緫 + if (this.canvasData.customizeDisposalNode) { + let formData = new FormData() + formData.append("file",this.canvasData.customizeDisposalNode.file) + this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}/DisposalNode`,formData).subscribe((data:any)=>{ + resolve('/api/Objects/WebPlan2D/' + data.objectName) + }) + } + } else { + resolve(null) + } //else + }) + } + } \ No newline at end of file diff --git a/src/app/ui/collection-tools/saveTwo.html b/src/app/ui/collection-tools/saveTwo.html index fec97ff..ad8f075 100644 --- a/src/app/ui/collection-tools/saveTwo.html +++ b/src/app/ui/collection-tools/saveTwo.html @@ -11,7 +11,7 @@
- + {{item.name}} diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index eb9a555..81265f8 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -67,7 +67,6 @@ import { UnittypeComponent,DialogOverviewExampleDialog,editorialUnit } from './u import { AuthorityComponent, CreateAuthority } from './authority/authority.component'; import { RoleComponent, CreateRole, EditRole } from './role/role.component'; import { UsermanagementComponent,CreateNewUser,EditNewUser,allRoles,seeInformation } from './usermanagement/usermanagement.component'; - import { IsnoPipe } from '../pipes/boolean.pipe'; import {ConfirmpswDirective} from './changepassword/equal-validator.directive' import { TimePipe } from '../pipes/time.pipe'; @@ -90,16 +89,18 @@ import { EditGroup } from './unit-information/editgroup.component'; import { EnterpriseuserComponent,seeenterpriseuser,editenterpriseuser } from './enterpriseuser/enterpriseuser.component'; import { AddEnterpriserUser } from './enterpriseuser/addenterpriseuser.component'; import { FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent } from './fire-fighting-facilities-formwork/fire-fighting-facilities-formwork.component'; - import { CollectionToolsComponent, CreateBuilding, EditBuilding, ViewDetails } from './collection-tools/collection-tools.component'; import { WorkingAreaComponent } from '../working-area/working-area.component'; -import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent} from './collection-tools/leftFunctionalDomain' +import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,addBGCDisposalNodeComponent} from './collection-tools/leftFunctionalDomain' import { saveOneDialog, saveTwoDialog } from './collection-tools/save'; import { CollectionToolsPlanComponent, CreateBuildingPlan, EditBuildingPlan, ViewDetailsPlan } from './collection-tools-plan/collection-tools.component'; import { addDisposalNodeComponentPlan, editDisposalNodeComponentPlan, editPlaneFigureComponentPlan, leftFunctionalDomainComponentPlan } from './collection-tools-plan/leftFunctionalDomain'; import { saveOneDialogPlan, saveTwoDialogPlan } from './collection-tools-plan/save'; +import {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,ViewDetailsBuilding} from './collection-tools-building/collection-tools.component' +import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent} from './collection-tools-building/leftFunctionalDomain' +import {saveOneDialogBuilding,saveTwoDialogBuilding} from './collection-tools-building/save' @NgModule({ - declarations: [UiComponent, DateselectComponent, MenuComponent, CardComponent, ListComponent, GridComponent, StepperComponent, TabgroupComponent, ButtonComponent, BadgeComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, FooterComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,ViewDetailsPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addDisposalNodeComponentPlan,editDisposalNodeComponentPlan,saveOneDialogPlan,saveTwoDialogPlan,addOffices,editOffices], + declarations: [UiComponent, DateselectComponent, MenuComponent, CardComponent, ListComponent, GridComponent, StepperComponent, TabgroupComponent, ButtonComponent, BadgeComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, FooterComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,ViewDetailsPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addDisposalNodeComponentPlan,editDisposalNodeComponentPlan,saveOneDialogPlan,saveTwoDialogPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,ViewDetailsBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent,saveOneDialogBuilding,saveTwoDialogBuilding], imports: [ CommonModule, @@ -157,6 +158,7 @@ import { saveOneDialogPlan, saveTwoDialogPlan } from './collection-tools-plan/sa exports:[ FooterComponent, CollectionToolsComponent, + CollectionToolsBuildingComponent, CollectionToolsPlanComponent ] }) diff --git a/src/app/working-area/model/axImageShapeTest.ts b/src/app/working-area/model/axImageShapeTest.ts deleted file mode 100644 index 81c141c..0000000 --- a/src/app/working-area/model/axImageShapeTest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { AxRectangleShape } from "./axRectangleShape"; - -export class AxImageShapeTest extends AxRectangleShape{ - /** - * - */ - constructor(x:number,y:number,width:number,height:number) { - super(x,y,width,height); - - } -} \ No newline at end of file diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index a886fd3..f2158ac 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -429,7 +429,6 @@ export class AxLegend extends AxShape { */ public drawBorder(scale: number) { const visible = this.upLeft.visible; - console.log(visible); this.setPointVisiable(false); super.drawBorder(scale); diff --git a/src/app/working-area/model/axMessageSystem.ts b/src/app/working-area/model/axMessageSystem.ts new file mode 100644 index 0000000..1451f9c --- /dev/null +++ b/src/app/working-area/model/axMessageSystem.ts @@ -0,0 +1,90 @@ +/** + * 浜嬩欢绯荤粺 + */ +export class AxMessageSystem { + /** 鐩戝惉鏁扮粍 */ + private static listeners = {}; + + /** + * 娉ㄥ唽浜嬩欢 + * @param name 浜嬩欢鍚嶇О + * @param callback 鍥炶皟鍑芥暟 + * @param context 涓婁笅鏂 + */ + public static addListener(name: string, callback: () => void, context: any) { + const observers: Observer[] = AxMessageSystem.listeners[name]; + if (!observers) { + AxMessageSystem.listeners[name] = []; + } + AxMessageSystem.listeners[name].push(new Observer(callback, context)); + } + + /** + * 绉婚櫎浜嬩欢 + * @param name 浜嬩欢鍚嶇О + * @param callback 鍥炶皟鍑芥暟 + * @param context 涓婁笅鏂 + */ + public static removeListener(name: string, callback: () => void, context: any) { + const observers: Observer[] = AxMessageSystem.listeners[name]; + if (!observers) { return; } + const length = observers.length; + for (let i = 0; i < length; i++) { + const observer = observers[i]; + if (observer.compar(context)) { + observers.splice(i, 1); + break; + } + } + if (observers.length === 0) { + delete AxMessageSystem.listeners[name]; + } + } + + /** + * 鍙戦佷簨浠 + * @param name 浜嬩欢鍚嶇О + */ + public static send(name: string, ...args: any[]) { + const observers: Observer[] = AxMessageSystem.listeners[name]; + if (!observers) { return; } + const length = observers.length; + for (let i = 0; i < length; i++) { + const observer = observers[i]; + observer.notify(name, ...args); + } + } +} + +/** + * 瑙傚療鑰 + */ +class Observer { + /** 鍥炶皟鍑芥暟 */ + private callback: () => void; + /** 涓婁笅鏂 */ + private context: any = null; + + constructor(callback: () => void, context: any) { + const self = this; + self.callback = callback; + self.context = context; + } + + /** + * 鍙戦侀氱煡 + * @param args 涓嶅畾鍙傛暟 + */ + notify(...args: any[]): void { + const self = this; + self.callback.call(self.context, ...args); + } + + /** + * 涓婁笅鏂囨瘮杈 + * @param context 涓婁笅鏂 + */ + compar(context: any): boolean { + return context === this.context; + } +} diff --git a/src/app/working-area/model/axRectangleShape.ts b/src/app/working-area/model/axRectangleShape.ts index 297ffdb..cf61f6c 100644 --- a/src/app/working-area/model/axRectangleShape.ts +++ b/src/app/working-area/model/axRectangleShape.ts @@ -1,21 +1,21 @@ -import { Sprite } from "pixi.js"; -import { Graphics } from "pixi.js"; -import { WorkingAreaComponent } from "../working-area.component"; -import { AxShape } from "./axShape"; +import { Sprite } from 'pixi.js'; +import { Graphics } from 'pixi.js'; +import { WorkingAreaComponent } from '../working-area.component'; +import { AxShape } from './axShape'; -export class AxRectangleShape extends AxShape{ +export class AxRectangleShape extends AxShape { /** * */ - constructor(x:number,y:number,width:number,height:number,assetData: any, workingArea: WorkingAreaComponent) { - super(assetData,workingArea); - this.beginFill(0x0000ff,1); - this.lineStyle(1, 0xff0000,1); + constructor(x: number, y: number, width: number, height: number, assetData: any, workingArea: WorkingAreaComponent) { + super(assetData, workingArea); + this.beginFill(0x0000ff, 1); + this.lineStyle(1, 0xff0000, 1); this.drawRect(x, y, width, height); this.endFill(); - - + + } - + } diff --git a/src/app/working-area/model/axSelection.ts b/src/app/working-area/model/axSelection.ts new file mode 100644 index 0000000..8bd6400 --- /dev/null +++ b/src/app/working-area/model/axSelection.ts @@ -0,0 +1,52 @@ +/** + * 閫夋嫨鍣 + */ +export class AxSelection { + constructor() { + } + private objects: Set = new Set(); + // 鑾峰緱绗竴涓璞 + public first(): any { + if (this.objects.size > 0) { + return [...this.objects][0]; + } else { + return null; + } + } + // 鏄惁宸茬粡閫夋嫨浜嗗璞 + public has(obj: any): boolean { + return this.objects.has(obj); + } + // 鑾峰緱鎵鏈夊璞 + public all() { + return [...this.objects]; + } + // 鑾峰彇闆嗗悎闀垮害 + public size(): number { + return this.objects.size; + } + // 娣诲姞瀵硅薄 + public add(obj: any) { + this.objects.add(obj); + } + // 娣诲姞闆嗗悎 + public addArray(array: any[]) { + array.forEach(item => { + this.objects.add(item); + }); + } + // 绉婚櫎瀵硅薄 + public delete(obj: any) { + this.objects.delete(obj); + } + // 绉婚櫎闆嗗悎 + public deleteArray(array: any[]) { + array.forEach(item => { + this.objects.delete(item); + }); + } + // 娓呯┖鎵鏈夊璞 + public clear() { + this.objects.clear(); + } +} diff --git a/src/app/working-area/model/axShape.ts b/src/app/working-area/model/axShape.ts index 27c1773..3a5dae7 100644 --- a/src/app/working-area/model/axShape.ts +++ b/src/app/working-area/model/axShape.ts @@ -8,7 +8,7 @@ import { WorkingAreaComponent } from '../working-area.component'; */ export class AxShape extends Graphics { assetData: any; - pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png') + pointTexture: PIXI.Texture = PIXI.Texture.from('assets/images/handle-main.png'); workingArea: WorkingAreaComponent; // 鍙互琚Щ鍔ㄧ殑 moveable = true; @@ -20,7 +20,11 @@ export class AxShape extends Graphics { showName = true; // 杈规 border: PIXI.Graphics = new PIXI.Graphics(); - + // 榧犳爣浣嶇疆 + mousePosition: PIXI.Point; + // 榧犳爣鎷栧姩 + mouseDragging: boolean; + constructor(assetData: any, workingArea: WorkingAreaComponent) { super(); this.border.visible = false; @@ -35,50 +39,30 @@ export class AxShape extends Graphics { .on('pointerdown', event => { event.stopPropagation(); if (this.selectable) { - this.workingArea.selection.selectOne(this); + this.workingArea.select(this); } if (this.moveable) { - event.currentTarget.data = event.data; - event.currentTarget.alpha = 0.5; - event.currentTarget.dragging = true; - - event.currentTarget.dragPoint = event.data.getLocalPosition(event.currentTarget.parent); - event.currentTarget.dragPoint.x -= event.currentTarget.x; - event.currentTarget.dragPoint.y -= event.currentTarget.y; + this.mouseDragging = true; + this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y); } }) .on('pointerup', event => { - if (event.currentTarget.dragging) { - event.currentTarget.alpha = 1; - event.currentTarget.dragging = false; - event.currentTarget.data = null; - } + this.mouseDragging = false; }) .on('pointerupoutside', event => { - if (event.currentTarget.dragging) { - event.currentTarget.alpha = 1; - event.currentTarget.dragging = false; - event.currentTarget.data = null; - } + this.mouseDragging = false; }) .on('pointermove', event => { - if (event.currentTarget.dragging) { - const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); - - // const offsetX = newPosition.x - event.currentTarget.dragPoint.x; - // const offsetY = newPosition.y - event.currentTarget.dragPoint.y; - // const offset = this.workingArea.backgroundImage.toLocal(new Point(offsetX, offsetY)); - // event.currentTarget.position += offset; - // // this.workingArea.selection.objects.forEach(shpae => { - // // shpae.x = newPosition.x - event.currentTarget.dragPoint.x; - // // shpae.y = newPosition.y - event.currentTarget.dragPoint.y; - // // shpae.assetData.Point = new PIXI.Point(this.x, this.y); - // // this.workingArea.canvasData.isChange = true; - // // }) - event.currentTarget.x = newPosition.x - event.currentTarget.dragPoint.x; - event.currentTarget.y = newPosition.y - event.currentTarget.dragPoint.y; - this.assetData.Point = new PIXI.Point(this.x, this.y); - this.workingArea.canvasData.isChange = true; + if (this.mouseDragging) { + this.workingArea.selection.all().forEach(item => { + const x = event.data.global.x - this.mousePosition.x; + const y = event.data.global.y - this.mousePosition.y; + item.x += x * (1 / this.workingArea.backgroundImage.scale.x); + item.y += y * (1 / this.workingArea.backgroundImage.scale.y); + item.assetData.Point = new PIXI.Point(item.x, item.y); + this.workingArea.canvasData.isChange = true; + }); + this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y); } }) .on('rightclick', event => { @@ -86,14 +70,14 @@ export class AxShape extends Graphics { }); } redraw(): void { - + } - refresh(): void{ - + refresh(): void { + } public setItemScale(scale: number) { - + } public showBorder() { @@ -110,10 +94,10 @@ export class AxShape extends Graphics { * @param value 鏄剧ず鐘舵 */ public setPointVisiable(value: boolean) { - + } /** - * + * * @param rect 鐢昏竟妗 */ public drawBorder(scale: number) { @@ -127,14 +111,14 @@ export class AxShape extends Graphics { this.border.lineStyle(scale * 1, 0x00a8ff); - var spaceLength = scale * 1; - var lineLenght = rect.width + 0.5 + 0.5; - var dashLength = scale*( lineLenght +spaceLength - Math.floor((rect.width + rect.height)/2 / 4.1))/Math.floor((rect.width + rect.height)/2 / 4.1); - this.drawDash(this.border, p1.x -0.5*scale, p1.y, p2.x + 0.5*scale, p2.y,dashLength,spaceLength); - this.drawDash(this.border, p2.x, p2.y -0.5*scale, p3.x, p3.y + 0.5*scale, dashLength, spaceLength); - this.drawDash(this.border, p3.x+0.5*scale, p3.y, p4.x - 0.5*scale, p4.y, dashLength, spaceLength); - this.drawDash(this.border, p4.x, p4.y + 0.5*scale, p1.x, p1.y - 0.5*scale, dashLength, spaceLength); - + const spaceLength = scale * 1; + const lineLenght = rect.width + 0.5 + 0.5; + const dashLength = scale * ( lineLenght + spaceLength - Math.floor((rect.width + rect.height) / 2 / 4.1)) / Math.floor((rect.width + rect.height) / 2 / 4.1); + this.drawDash(this.border, p1.x - 0.5 * scale, p1.y, p2.x + 0.5 * scale, p2.y, dashLength, spaceLength); + this.drawDash(this.border, p2.x, p2.y - 0.5 * scale, p3.x, p3.y + 0.5 * scale, dashLength, spaceLength); + this.drawDash(this.border, p3.x + 0.5 * scale, p3.y, p4.x - 0.5 * scale, p4.y, dashLength, spaceLength); + this.drawDash(this.border, p4.x, p4.y + 0.5 * scale, p1.x, p1.y - 0.5 * scale, dashLength, spaceLength); + this.border.lineStyle(0, 0x0000ff); // this.border.beginFill(0x00ff00,0.1); this.border.moveTo(p1.x, p1.y); @@ -145,19 +129,19 @@ export class AxShape extends Graphics { // this.border.endFill(); } // 鐢昏櫄绾 - drawDash(target, x1, y1, x2, y2,dashLength = 5, spaceLength = 1) { - let x = x2 - x1; - let y = y2 - y1; + drawDash(target, x1, y1, x2, y2, dashLength = 5, spaceLength = 1) { + const x = x2 - x1; + const y = y2 - y1; let hyp = Math.sqrt((x) * (x) + (y) * (y)); - let units = hyp / (dashLength + spaceLength); - let dashSpaceRatio = dashLength / (dashLength + spaceLength); - let dashX = (x / units) * dashSpaceRatio; - let spaceX = (x / units) - dashX; - let dashY = (y / units) * dashSpaceRatio; - let spaceY = (y / units) - dashY; + const units = hyp / (dashLength + spaceLength); + const dashSpaceRatio = dashLength / (dashLength + spaceLength); + const dashX = (x / units) * dashSpaceRatio; + const spaceX = (x / units) - dashX; + const dashY = (y / units) * dashSpaceRatio; + const spaceY = (y / units) - dashY; target.moveTo(x1, y1); - + while (hyp > 0) { x1 += dashX; y1 += dashY; @@ -200,7 +184,7 @@ export class AxShape extends Graphics { return new PIXI.Point(gravityLat, gravityLng); } // 璁$畻绾挎涓偣鍧愭爣 - public getLineCenter(point1:PIXI.Point,point2:PIXI.Point) { - return new PIXI.Point((point1.x+point2.x)/2,(point1.y+point2.y)/2) + public getLineCenter(point1: PIXI.Point, point2: PIXI.Point) { + return new PIXI.Point((point1.x + point2.x) / 2, (point1.y + point2.y) / 2); } } diff --git a/src/app/working-area/model/messageSystem.ts b/src/app/working-area/model/messageSystem.ts deleted file mode 100644 index 322eef4..0000000 --- a/src/app/working-area/model/messageSystem.ts +++ /dev/null @@ -1,37 +0,0 @@ -class MyEvent extends CustomEvent { - public static readonly CMD: string = "EVENT_NAME"; - public constructor($type: string , $data: T ) { - super( $type , { detail: $data, bubbles: true, cancelable: true, composed: true }); - } -} - -class MyDispatch extends EventTarget { - private static _instance: MyDispatch; - public static get Instance(): MyDispatch { - if (!MyDispatch._instance) MyDispatch._instance = new MyDispatch(); - return MyDispatch._instance; - } - public send($data: T, $type: string = MyEvent.CMD): void { - const $event: CustomEvent = new MyEvent($type, $data); - this.dispatchEvent($event); - } -} - -class Test { - - public constructor() { - MyDispatch.Instance.addEventListener(MyEvent.CMD, this.onEvent as EventListener); - } - private onEvent($e: MyEvent): void { - console.log(`target ${$e.target}`); - console.log(`name: ${$e.detail._name} , occupation: ${$e.detail._occupation}`); - } -} - -interface ITest { - _name: string; - _occupation: string; -} - -let $test: Test = new Test(); -MyDispatch.Instance.send({ _name: `Aonaufly`, _occupation: `it` }); diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index adaa4d7..7f80485 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -16,9 +16,9 @@ import { PropertyInfo } from './model/PropertyInfo'; import { AxPreviewImageShape } from './model/axPreviewImageShape'; import { AxArrowConnector } from './model/axArrowConnector'; import { AxLegend, Legend } from './model/axLegend'; -import { NullTemplateVisitor } from '@angular/compiler'; -import { AxRectangleShape } from './model/axRectangleShape'; import { AxGrid } from './model/axGrid'; +import { AxSelection } from './model/axSelection'; +import { AxMessageSystem } from './model/axMessageSystem'; @Component({ @@ -76,7 +76,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 閫夋嫨鍣 */ - public selection: Selection = new Selection(this); + public readonly selection: AxSelection = new AxSelection(); /** * 褰撳墠榧犳爣鐨勭偣 */ @@ -141,6 +141,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 缃戞牸 */ public grid: AxGrid = null; + // 鏄惁鎸変笅Ctrl閿 + isCtrlKeyClicked = false; + isMove = false; /** * 鏈蒋浠剁増鏈彿鐢卞洓閮ㄥ垎缁勬垚锛<涓荤増鏈彿><娆$増鏈彿><淇鐗堟湰鍙><鏃ユ湡鍔犲笇鑵婂瓧姣嶇増鏈彿> 渚嬪锛1.0.0.20210105_beta * Alpha鐗: 姝ょ増鏈〃绀鸿杞欢鍦ㄦ闃舵涓昏鏄互瀹炵幇杞欢鍔熻兘涓轰富锛岄氬父鍙湪杞欢寮鍙戣呭唴閮ㄤ氦娴侊紝涓鑸岃█锛岃鐗堟湰杞欢鐨凚ug杈冨锛岄渶瑕佺户缁慨鏀广 @@ -148,7 +151,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 * Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 */ - public VERSION = '1.0.11.20210122_beta'; + public VERSION = '1.0.13.20210126_beta'; /** * 鏁版嵁鍒濆鍖 */ @@ -156,13 +159,15 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV PIXI.utils.skipHello(); this.sayHello(); this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { + event.stopPropagation(); if (event.keyCode === 17) { - this.selection.isMultiselection = true; + this.isCtrlKeyClicked = true; } }); this.eventManager.addGlobalEventListener('window', 'keyup', (event: any) => { + event.stopPropagation(); if (event.keyCode === 17) { - this.selection.isMultiselection = false; + this.isCtrlKeyClicked = false; this.rectToolGraphics.visible = false; this.rectToolGraphics.clear(); } @@ -176,18 +181,43 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 鍒犻櫎閫変腑鐨勫浘鏍 */ public deleteSelectedShape() { - this.selection.objects.forEach(item => { - this.deleteShape(item); - }); - this.selection.deselectAll(); - } - /** - * - * @param obj 鍒犻櫎涓涓舰鐘 - */ - public deleteShape(shape) { - if (this.allowEdit && this.canvasData.gameMode === shape.assetData.GameMode) { - this.emit('deleteIcon', shape); + if (this.selection.size() > 0) { + this.selection.all().forEach(axShape => { + if (this.allowEdit && this.canvasData.gameMode === axShape.assetData.GameMode) { + // 鍒犻櫎鍥句緥瀵硅薄 + const temp = this.backgroundImage.getChildByName('鍥句緥') as AxLegend; + if ( temp !== undefined + && temp !== null + && axShape.assetData.Name !== '鍥句緥') { + const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); + temp.deleteItem(itemLegend); + } + if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 鍩烘湰淇℃伅 + // 鍒犻櫎妤煎眰鏁版嵁 + delete this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id]; + // 鍒犻櫎寤虹瓚鏁版嵁 + delete this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id]; + } else if (axShape.assetData.GameMode === GameMode.Assignment) { // 澶勭疆棰勬 + delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; + delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; + delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; + } else if (axShape.assetData.GameMode === GameMode.Examinee) { // 鑰冪敓鑰冭瘯 + if (axShape.assetData.Tag === 1) { + // 鍒犻櫎妤煎眰鏁版嵁 + delete this.canvasData.examOriginaleveryStoreyData.data[axShape.assetData.Id]; + } else { + delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; + delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; + delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; + } + } + this.backgroundImage.removeChild(axShape); + } + }); + this.selection.clear(); + this.emit('canvasDataChanged'); + this.canvasData.isChange = true; + AxMessageSystem.send(CanvasAction.selectionChanged); } } /** @@ -276,7 +306,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV icon.assetData.Type === 3 || icon.assetData.Type === 4 )) { - console.log(this.backgroundImage.position); this.backgroundImage.pivot.set(icon.x, icon.y); this.backgroundImage.position.set(771, 404); clearTimeout(this.animationTime); @@ -315,7 +344,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.app.stage.addChild(this.grid); this.grid.drawGrid(); this.grid.onMousemove = (evt, gridCoord) => { - console.log(gridCoord); + }; this.createBackgroundImage(); @@ -355,28 +384,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.rectToolGraphics.endFill(); } }); - /** - * 閫変腑浜嬩欢 - */ - this.on('select', (axShape: AxShape) => { - // if (axShape instanceof AxRectangleShape) { - // let upLeft: PIXI.Sprite= new PIXI.Sprite(this.editorPointTexture); - // let upRight: PIXI.Sprite= new PIXI.Sprite(this.editorPointTexture); - // let downLeft: PIXI.Sprite= new PIXI.Sprite(this.editorPointTexture); - // let downRight: PIXI.Sprite = new PIXI.Sprite(this.editorPointTexture); - // } else { - axShape.showBorder(); - axShape.drawBorder(1 / this.backgroundImage.scale.x); - axShape.setPointVisiable(this.allowEdit); - // } - }); - /** - * 鍙栨秷閫変腑浜嬩欢 - */ - this.on('deselect', (axShape: AxShape) => { - axShape.hideBorder(); - axShape.setPointVisiable(false); - }); /** * 鍒涘缓鍥炬爣浜嬩欢锛堟暟鎹鐞嗭級 */ @@ -415,44 +422,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.emit('canvasDataChanged'); this.canvasData.isChange = true; }); - /** - * 鍒犻櫎鍥炬爣浜嬩欢(鏁版嵁澶勭悊) - */ - this.on('deleteIcon', (axShape: AxShape) => { - // 鍒犻櫎鍥句緥瀵硅薄 - const temp = this.backgroundImage.getChildByName('鍥句緥') as AxLegend; - if ( temp !== undefined - && temp !== null - && axShape.assetData.Name !== '鍥句緥') { - const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); - temp.deleteItem(itemLegend); - } - - - if (axShape.assetData.GameMode === GameMode.BasicInformation) { // 鍩烘湰淇℃伅 - // 鍒犻櫎妤煎眰鏁版嵁 - delete this.canvasData.originaleveryStoreyData.data[axShape.assetData.Id]; - // 鍒犻櫎寤虹瓚鏁版嵁 - delete this.canvasData.originalcompanyBuildingData.data[axShape.assetData.Id]; - } else if (axShape.assetData.GameMode === GameMode.Assignment) { // 澶勭疆棰勬 - delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; - delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; - delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; - } else if (axShape.assetData.GameMode === GameMode.Examinee) { // 鑰冪敓鑰冭瘯 - if (axShape.assetData.Tag === 1) { - // 鍒犻櫎妤煎眰鏁版嵁 - delete this.canvasData.examOriginaleveryStoreyData.data[axShape.assetData.Id]; - } else { - delete this.canvasData.selectPanelPoint.Data.DefinedIncrement[axShape.assetData.Id]; - delete this.canvasData.selectPanelPoint.Data.Increment[axShape.assetData.Id]; - delete this.canvasData.selectPanelPoint.Data.Stock[axShape.assetData.Id]; - } - - } - this.backgroundImage.removeChild(axShape); - this.emit('canvasDataChanged'); - this.canvasData.isChange = true; - }); } /** * 閲嶇疆鐢诲竷 @@ -504,7 +473,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV public setIconScale(value: number): void { this.backgroundImage.children.forEach(item => { if (item instanceof AxImageShape) { - console.log(item.image.scale); item.image.scale.set(value); } else if (item instanceof MultipointIcon) { @@ -513,19 +481,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV } }); } - /** - * 璁剧疆楂樹寒 - */ - public setHighlight(ids: string[]): void { - this.selection.deselectAll(); - ids.forEach(item => { - let obj = this.backgroundImage.getChildByName(item); - if (obj === null) { - obj = this.app.stage.getChildByName(item); - } - this.selection.select(obj); - }); - } /** * 鍒涘缓妤煎眰鍥惧舰 */ @@ -631,10 +586,9 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV .on('pointerdown', event => { if (event.data.button !== 0) { return; } console.log(this.backgroundImage.toLocal(this.mousePosition)); - if (!event.currentTarget.dragging && this.selection.isMultiselection === false) { - this.selection.deselectAll(); + if (!this.isMove && this.isCtrlKeyClicked === false) { event.currentTarget.data = event.data; - event.currentTarget.dragging = true; + this.isMove = true; event.currentTarget.dragPoint = event.data.getLocalPosition(event.currentTarget.parent); event.currentTarget.dragPoint.x -= event.currentTarget.x; event.currentTarget.dragPoint.y -= event.currentTarget.y; @@ -828,48 +782,47 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // this.emit('backgroundScale', this.backgroundImage.scale.x); break; } - } else if (!event.currentTarget.dragging && this.selection.isMultiselection === true) { + } else if (!this.isMove && this.isCtrlKeyClicked === true) { this.rectToolGraphics.visible = true; - event.currentTarget.dragging = true; + this.isMove = true; this.initialScreenMousePos = this.backgroundImage.toLocal(this.mousePosition); this.finalScreenMousePos = this.backgroundImage.toLocal(this.mousePosition); } }) .on('pointerup', event => { - if (event.currentTarget.dragging) { - event.currentTarget.dragging = false; - event.currentTarget.data = null; - } + this.isMove = false; + event.currentTarget.data = null; + if (this.rectToolGraphics.visible === true) { + const shapes: AxShape[] = []; this.backgroundImage.children.forEach(item => { - if ( item instanceof AxImageShape - || item instanceof MultipointIcon - || item instanceof PolygonIcon - || item instanceof AxArrowConnector) { + if ( item instanceof AxShape + && item instanceof AxPreviewImageShape === false) { // 鍒ゆ柇2涓煩褰㈡槸鍚︾浉浜 const rect1 = this.rectToolGraphics.getBounds(); const rect2 = item.getBounds(); if (this.isOverlap(rect1, rect2)) { - this.selection.select(item); + shapes.push(item); } } }); this.rectToolGraphics.clear(); this.rectToolGraphics.visible = false; + this.selectAll(shapes); } }) .on('pointerupoutside', event => { - if (event.currentTarget.dragging) { - event.currentTarget.dragging = false; + if (this.isMove) { + this.isMove = false; event.currentTarget.data = null; } }) .on('pointermove', event => { - if (event.currentTarget.dragging && this.selection.isMultiselection === false) { + if (this.isMove && this.isCtrlKeyClicked === false) { const newPosition = event.currentTarget.data.getLocalPosition(event.currentTarget.parent); event.currentTarget.x = newPosition.x - event.currentTarget.dragPoint.x; event.currentTarget.y = newPosition.y - event.currentTarget.dragPoint.y; - } else if (event.currentTarget.dragging && this.selection.isMultiselection === true) { + } else if (this.isMove && this.isCtrlKeyClicked === true) { if (this.rectToolGraphics.visible === true) { this.finalScreenMousePos = this.backgroundImage.toLocal(this.mousePosition); } @@ -877,7 +830,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV }) .on('rightclick', event => { event.stopPropagation(); - this.selection.deselectAll(); + this.deselectAll(); this.setPaintMode(PaintMode.endPaint); }) .on('pointerover', (event) => { @@ -951,11 +904,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * @param imageUrl * @param imageAngle */ - public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise { + public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, + imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise { await this.refreshBackgroundImage(); - // 娓呯┖鎵鏈夊浘褰 - this.selection.deselectAll(); + this.deselectAll(); const itemList = []; this.backgroundImage.children.forEach(item => { if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { @@ -978,10 +931,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 鍔犺浇鏃犲叧鑱斾俊鎭缃妗 * @data 澶勭疆棰勬鏁版嵁 */ - public async loadNoRelevantInformationDisposalPlan(data:DisposalNodeData): Promise { - await this.refreshBackgroundImage(data.BackgroundImageUrl,data.BackgroundImageAngle); + public async loadNoRelevantInformationDisposalPlan(data: DisposalNodeData): Promise { + await this.refreshBackgroundImage(data.BackgroundImageUrl, data.BackgroundImageAngle); // 娓呯┖鎵鏈夊浘褰 - this.selection.deselectAll(); + this.deselectAll(); const itemList = []; this.backgroundImage.children.forEach(item => { if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { @@ -1142,7 +1095,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV */ public beginPaint() { console.log(this.canvasData.selectTemplateData); - this.selection.deselectAll(); + this.deselectAll(); this.setPaintMode(PaintMode.endPaint); this.setPaintMode(this.canvasData.selectTemplateData.interactiveMode); } @@ -1291,49 +1244,53 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 澶嶅埗 */ public copy(): void { - this.copyData = []; - this.selection.objects.forEach(item => { - const newData = JSON.parse(JSON.stringify(item.assetData)); - this.copyData.push(newData); - }); + this.copyData = []; + this.selection.all().forEach(item => { + const newData = JSON.parse(JSON.stringify(item.assetData)); + this.copyData.push(newData); + }); } /** * 绮樿创 */ public paste(companyId: string, buildingId: string, floorId: string): void { - this.copyData.forEach(item => { - item.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); - const newData = JSON.parse(JSON.stringify(item)); - newData.Id = ObjectID.default.generate(), - newData.CompanyId = companyId; - newData.BuildingId = buildingId; - newData.FloorId = floorId; - newData.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); - switch (item.InteractiveMode) { - case PaintMode.singlePointIcon: - const singleIcon = new AxImageShape(newData, this); - this.emit('createIcon', singleIcon); - break; - case PaintMode.lineIcon: - const lineIcon = new MultipointIcon(newData, this); - this.emit('createIcon', lineIcon); - break; - case PaintMode.polygonIcon: - const polygonIcon = new PolygonIcon(newData, this); - this.emit('createIcon', polygonIcon); - break; - case PaintMode.Pipeline: - if (item.Name === '璺濈') { - const wall = new AxArrowConnector(newData, this, true, true); - this.emit('createIcon', wall); - } else if (item.Name === '鏅氬' || item.Name === '鎵块噸澧') { - const wall = new AxArrowConnector(newData, this, false, false); - this.emit('createIcon', wall); - } - break; - } - this.selection.select(this.backgroundImage.getChildByName(newData.Id)); - }); + const ids: string[] = []; + if (this.copyData.length > 0) { + this.copyData.forEach(item => { + item.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); + const newData = JSON.parse(JSON.stringify(item)); + newData.Id = ObjectID.default.generate(), + newData.CompanyId = companyId; + newData.BuildingId = buildingId; + newData.FloorId = floorId; + newData.Point = new PIXI.Point(item.Point.x + 5, item.Point.y + 5); + switch (item.InteractiveMode) { + case PaintMode.singlePointIcon: + const singleIcon = new AxImageShape(newData, this); + this.emit('createIcon', singleIcon); + break; + case PaintMode.lineIcon: + const lineIcon = new MultipointIcon(newData, this); + this.emit('createIcon', lineIcon); + break; + case PaintMode.polygonIcon: + const polygonIcon = new PolygonIcon(newData, this); + this.emit('createIcon', polygonIcon); + break; + case PaintMode.Pipeline: + if (item.Name === '璺濈') { + const wall = new AxArrowConnector(newData, this, true, true); + this.emit('createIcon', wall); + } else if (item.Name === '鏅氬' || item.Name === '鎵块噸澧') { + const wall = new AxArrowConnector(newData, this, false, false); + this.emit('createIcon', wall); + } + break; + } + ids.push(newData.Id); + }); + this.setHighlight(ids); + } } //////////////////////////////////////////////////////////////////////// 閫氱敤///////////////////////////////////////////////////////////////////////////// /** @@ -1357,7 +1314,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV public async onExamineeClickFloor() { await this.refreshBackgroundImage(); // 娓呯┖鎵鏈夊浘褰 - this.selection.deselectAll(); + this.deselectAll(); const itemList = []; this.backgroundImage.children.forEach(item => { if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { @@ -1384,7 +1341,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV public async onExaminerClickFloor() { await this.refreshBackgroundImage(); // 娓呯┖鎵鏈夊浘褰 - this.selection.deselectAll(); + this.deselectAll(); const itemList = []; this.backgroundImage.children.forEach(item => { if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { @@ -1410,7 +1367,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV public async onExaminerClickFloor_CreateTestpaper() { await this.refreshBackgroundImage(); // 娓呯┖鎵鏈夊浘褰 - this.selection.deselectAll(); + this.deselectAll(); const itemList = []; this.backgroundImage.children.forEach(item => { if (item instanceof AxShape && item instanceof AxPreviewImageShape === false) { @@ -1428,94 +1385,122 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // 闅愯棌鍥炬爣 this.setNameVisible(false, 0); } -} - -/** - * 閫夋嫨鍣 - */ -export class Selection { - constructor(private workingArea: WorkingAreaComponent) {} - public objects: any[] = []; - public isMultiselection = false; + //////////////////////////////////////////////////////////////////// 閫夋嫨閫昏緫 /** - * 杩斿洖閫夋嫨鍣ㄤ腑鏄惁鍖呭惈瀵硅薄 - * @param obj 瀵硅薄 + * 娓呯┖閫夋嫨锛岄夋嫨鍗曚釜褰㈢姸 + * @param shape 褰㈢姸 */ - public contains(obj: any): boolean { - return this.objects.includes(obj); + public selectSingle(shape: AxShape) { + if (this.selection.first() !== null) { + this.selection.all().forEach(item => { + this.clearSelectEffect(item); + }); + this.selection.clear(); + } + this.selection.add(shape); + this.setSelectEffect(shape); + AxMessageSystem.send(CanvasAction.selectionChanged); } /** - * 閫夊畾瀵硅薄 - * @param obj 瀵硅薄 + * 閫夋嫨 + * @param shape 褰㈢姸 */ - public select(obj: any) { - if (!this.contains(obj)) { - this.workingArea.emit('select', obj); - this.objects.push(obj); + public select(shape: AxShape) { + if (this.selection.first() !== null + && !this.isCtrlKeyClicked + && !this.selection.has(shape)) { + this.selection.all().forEach(item => { + this.clearSelectEffect(item); + }); + this.selection.clear(); } + this.selection.add(shape); + this.setSelectEffect(shape); + AxMessageSystem.send(CanvasAction.selectionChanged); } /** - * 鍙栨秷閫夊畾瀵硅薄 - * @param obj 瀵硅薄 + * 閫夋嫨闆嗗悎涓殑褰㈢姸 + * @param shape 褰㈢姸闆嗗悎 */ - public deselect(obj: any) { - if (this.contains(obj)) { - this.workingArea.emit('deselect', obj); - const idx = this.objects.findIndex(x => x === obj); - this.objects.splice(idx, 1); - } + public selectAll(shape: AxShape[]) { + this.selection.addArray(shape); + this.selection.all().forEach(item => { + this.setSelectEffect(item); + }); + AxMessageSystem.send(CanvasAction.selectionChanged); } /** - * 閫夊畾鎴栧彇娑堥夊畾瀵硅薄 - * @param obj 瀵硅薄 + * 鍏堟竻绌哄啀閫夋嫨鍏ㄩ儴 + * @param shape 褰㈢姸闆嗗悎 */ - public selectOrDeselect(obj: any) { - if (this.contains(obj)) { - this.deselect(obj); - } else { - this.select(obj); + public selectAllWithClear(shape: AxShape[]) { + if (this.selection.first() !== null) { + this.selection.all().forEach(item => { + this.clearSelectEffect(item); + }); + this.selection.clear(); } + this.selection.addArray(shape); + this.selection.all().forEach(item => { + this.setSelectEffect(item); + }); + AxMessageSystem.send(CanvasAction.selectionChanged); } /** - * 鍙栨秷閫夊畾鎵鏈夊凡閫夊畾瀵硅薄 + * 閫夋嫨闆嗗悎涓墍鏈塱d鐨勫舰鐘 + * @param ids 褰㈢姸id闆嗗悎 */ - public deselectAll() { - this.objects.forEach(item => { - this.workingArea.emit('deselect', item); + public setHighlight(ids: string[]): void { + const shapes: AxShape[] = []; + // 閲嶆柊閫夋嫨 + ids.forEach(item => { + const obj = this.backgroundImage.getChildByName(item); + shapes.push(obj as AxShape); }); - this.objects.splice(0, this.objects.length); + this.selectAllWithClear(shapes); } /** - * 鍙栨秷閫夊畾鎵鏈夊璞″悗閫夊畾涓涓璞 - * @param obj 瀵硅薄 + * 鍙栨秷鎵鏈夐夋嫨 */ - public selectOne(obj: any) { - if (this.isMultiselection) { - this.selectOrDeselect(obj); - } else { - this.deselectAll(); - this.select(obj); + public deselectAll() { + if (this.selection.first() !== null) { + this.selection.all().forEach(item => { + this.clearSelectEffect(item); + }); + this.selection.clear(); + AxMessageSystem.send(CanvasAction.selectionChanged); } } /** - * 閫夊畾瀵硅薄闆嗗悎涓墍鏈夊璞 - * @param objects 瀵硅薄闆嗗悎 + * 璁剧疆閫変腑鏁堟灉 + * @param shape 褰㈢姸 */ - public selectAll(objects: any[]) { - this.objects.forEach(item => { - this.select(item); - }); + public setSelectEffect(shape: AxShape) { + shape.hideBorder(); + shape.setPointVisiable(false); + shape.showBorder(); + shape.drawBorder(1 / this.backgroundImage.scale.x); + shape.setPointVisiable(this.allowEdit); + } + /** + * 璁剧疆褰㈢姸閫変腑鏁堟灉 + * @param shape 褰㈢姸 + */ + public clearSelectEffect(shape: AxShape) { + shape.hideBorder(); + shape.setPointVisiable(false); + } + ////////////////////////////////////////////////////////////////////////////////////////////////鍥句緥 + /** + * 璁剧疆鍥句緥鏄剧ず闅愯棌 + * @param b true 鏄剧ず锛宖alse闅愯棌 + */ + public setLegendVisible(b: boolean): void { + const legend = this.backgroundImage.getChildByName('鍥句緥') as AxLegend; + legend.visible = b; } } - - -/** - * 杞﹁締绫诲瀷 - */ -export enum Type { - 姘存簮 = 0, - 涓鹃珮鍠峰皠娑堥槻杞 = 1, - 娉℃搏娑堥槻杞 = 2, - 姘寸綈娑堥槻杞 = 3, - 鍘嬬缉绌烘皵娉℃搏娑堥槻杞 = 4 +enum CanvasAction { + selectionChanged = 'selectionChanged', + copyDataChanged = 'copyDataChanged' } diff --git a/src/assets/fireForcesMarkers/涓槦.png b/src/assets/fireForcesMarkers/涓槦.png new file mode 100644 index 0000000..e32707d Binary files /dev/null and b/src/assets/fireForcesMarkers/涓槦.png differ diff --git a/src/assets/fireForcesMarkers/鍏朵粬.png b/src/assets/fireForcesMarkers/鍏朵粬.png new file mode 100644 index 0000000..db5e809 Binary files /dev/null and b/src/assets/fireForcesMarkers/鍏朵粬.png differ diff --git a/src/assets/fireForcesMarkers/澶ч槦.png b/src/assets/fireForcesMarkers/澶ч槦.png new file mode 100644 index 0000000..f58f18c Binary files /dev/null and b/src/assets/fireForcesMarkers/澶ч槦.png differ diff --git a/src/assets/fireForcesMarkers/鎬婚槦.png b/src/assets/fireForcesMarkers/鎬婚槦.png new file mode 100644 index 0000000..45f48e3 Binary files /dev/null and b/src/assets/fireForcesMarkers/鎬婚槦.png differ diff --git a/src/assets/fireForcesMarkers/鏀槦.png b/src/assets/fireForcesMarkers/鏀槦.png new file mode 100644 index 0000000..a9174d2 Binary files /dev/null and b/src/assets/fireForcesMarkers/鏀槦.png differ diff --git a/src/assets/images/鍏朵粬.png b/src/assets/images/鍏朵粬.png index 5b0bcbc..678a7dc 100644 Binary files a/src/assets/images/鍏朵粬.png and b/src/assets/images/鍏朵粬.png differ diff --git a/src/assets/images/鍙ゅ缓绛.png b/src/assets/images/鍙ゅ缓绛.png index 0d3c068..7329c51 100644 Binary files a/src/assets/images/鍙ゅ缓绛.png and b/src/assets/images/鍙ゅ缓绛.png differ diff --git a/src/assets/images/甯傛斂娑堢伀鏍擄紙鍦颁笂锛.png b/src/assets/images/甯傛斂娑堢伀鏍擄紙鍦颁笂锛.png new file mode 100644 index 0000000..6e46ae1 Binary files /dev/null and b/src/assets/images/甯傛斂娑堢伀鏍擄紙鍦颁笂锛.png differ diff --git a/src/assets/images/杞ㄩ亾浜ら.png b/src/assets/images/杞ㄩ亾浜ら.png index 9d2483a..2d2f97d 100644 Binary files a/src/assets/images/杞ㄩ亾浜ら.png and b/src/assets/images/杞ㄩ亾浜ら.png differ diff --git a/src/assets/linkageForces/浜ら.png b/src/assets/linkageForces/浜ら.png new file mode 100644 index 0000000..96cb8f6 Binary files /dev/null and b/src/assets/linkageForces/浜ら.png differ diff --git a/src/assets/linkageForces/浣忓缓.png b/src/assets/linkageForces/浣忓缓.png new file mode 100644 index 0000000..d3378a4 Binary files /dev/null and b/src/assets/linkageForces/浣忓缓.png differ diff --git a/src/assets/linkageForces/鍏畨.png b/src/assets/linkageForces/鍏畨.png new file mode 100644 index 0000000..cb3a71c Binary files /dev/null and b/src/assets/linkageForces/鍏畨.png differ diff --git a/src/assets/linkageForces/鍖荤枟.png b/src/assets/linkageForces/鍖荤枟.png new file mode 100644 index 0000000..61d8034 Binary files /dev/null and b/src/assets/linkageForces/鍖荤枟.png differ diff --git a/src/assets/linkageForces/瀹夌洃.png b/src/assets/linkageForces/瀹夌洃.png new file mode 100644 index 0000000..6b2a903 Binary files /dev/null and b/src/assets/linkageForces/瀹夌洃.png differ diff --git a/src/assets/linkageForces/甯傛斂.png b/src/assets/linkageForces/甯傛斂.png new file mode 100644 index 0000000..dc1b744 Binary files /dev/null and b/src/assets/linkageForces/甯傛斂.png differ diff --git a/src/assets/linkageForces/搴旀ョ鐞.png b/src/assets/linkageForces/搴旀ョ鐞.png new file mode 100644 index 0000000..3cd54b8 Binary files /dev/null and b/src/assets/linkageForces/搴旀ョ鐞.png differ diff --git a/src/assets/linkageForces/姘戞斂.png b/src/assets/linkageForces/姘戞斂.png new file mode 100644 index 0000000..790924f Binary files /dev/null and b/src/assets/linkageForces/姘戞斂.png differ diff --git a/src/assets/linkageForces/姘旇薄灞.png b/src/assets/linkageForces/姘旇薄灞.png new file mode 100644 index 0000000..654a198 Binary files /dev/null and b/src/assets/linkageForces/姘旇薄灞.png differ diff --git a/src/assets/linkageForces/姘村埄.png b/src/assets/linkageForces/姘村埄.png new file mode 100644 index 0000000..3c542ee Binary files /dev/null and b/src/assets/linkageForces/姘村埄.png differ diff --git a/src/assets/linkageForces/娴蜂簨.png b/src/assets/linkageForces/娴蜂簨.png new file mode 100644 index 0000000..f6940d8 Binary files /dev/null and b/src/assets/linkageForces/娴蜂簨.png differ diff --git a/src/assets/linkageForces/鐕冩皵灞.png b/src/assets/linkageForces/鐕冩皵灞.png new file mode 100644 index 0000000..b430203 Binary files /dev/null and b/src/assets/linkageForces/鐕冩皵灞.png differ diff --git a/src/assets/linkageForces/鐜繚灞.png b/src/assets/linkageForces/鐜繚灞.png new file mode 100644 index 0000000..21d6bbd Binary files /dev/null and b/src/assets/linkageForces/鐜繚灞.png differ diff --git a/src/assets/linkageForces/鐢靛姏灞.png b/src/assets/linkageForces/鐢靛姏灞.png new file mode 100644 index 0000000..69f21cd Binary files /dev/null and b/src/assets/linkageForces/鐢靛姏灞.png differ diff --git a/src/assets/linkageForces/閫氫俊.png b/src/assets/linkageForces/閫氫俊.png new file mode 100644 index 0000000..79f5180 Binary files /dev/null and b/src/assets/linkageForces/閫氫俊.png differ diff --git a/src/assets/linkageForcesMarkers/浜ら.png b/src/assets/linkageForcesMarkers/浜ら.png new file mode 100644 index 0000000..386b5d3 Binary files /dev/null and b/src/assets/linkageForcesMarkers/浜ら.png differ diff --git a/src/assets/linkageForcesMarkers/浣忓缓.png b/src/assets/linkageForcesMarkers/浣忓缓.png new file mode 100644 index 0000000..dab8daf Binary files /dev/null and b/src/assets/linkageForcesMarkers/浣忓缓.png differ diff --git a/src/assets/linkageForcesMarkers/鍏畨.png b/src/assets/linkageForcesMarkers/鍏畨.png new file mode 100644 index 0000000..a6cec4a Binary files /dev/null and b/src/assets/linkageForcesMarkers/鍏畨.png differ diff --git a/src/assets/linkageForcesMarkers/鍖荤枟.png b/src/assets/linkageForcesMarkers/鍖荤枟.png new file mode 100644 index 0000000..5f3be9d Binary files /dev/null and b/src/assets/linkageForcesMarkers/鍖荤枟.png differ diff --git a/src/assets/linkageForcesMarkers/瀹夌洃.png b/src/assets/linkageForcesMarkers/瀹夌洃.png new file mode 100644 index 0000000..46f9fc7 Binary files /dev/null and b/src/assets/linkageForcesMarkers/瀹夌洃.png differ diff --git a/src/assets/linkageForcesMarkers/甯傛斂.png b/src/assets/linkageForcesMarkers/甯傛斂.png new file mode 100644 index 0000000..0345753 Binary files /dev/null and b/src/assets/linkageForcesMarkers/甯傛斂.png differ diff --git a/src/assets/linkageForcesMarkers/搴旀ョ鐞.png b/src/assets/linkageForcesMarkers/搴旀ョ鐞.png new file mode 100644 index 0000000..0adac17 Binary files /dev/null and b/src/assets/linkageForcesMarkers/搴旀ョ鐞.png differ diff --git a/src/assets/linkageForcesMarkers/姘戞斂.png b/src/assets/linkageForcesMarkers/姘戞斂.png new file mode 100644 index 0000000..dca1267 Binary files /dev/null and b/src/assets/linkageForcesMarkers/姘戞斂.png differ diff --git a/src/assets/linkageForcesMarkers/姘旇薄灞.png b/src/assets/linkageForcesMarkers/姘旇薄灞.png new file mode 100644 index 0000000..f3b6688 Binary files /dev/null and b/src/assets/linkageForcesMarkers/姘旇薄灞.png differ diff --git a/src/assets/linkageForcesMarkers/姘村埄.png b/src/assets/linkageForcesMarkers/姘村埄.png new file mode 100644 index 0000000..d2fc5c5 Binary files /dev/null and b/src/assets/linkageForcesMarkers/姘村埄.png differ diff --git a/src/assets/linkageForcesMarkers/娴蜂簨.png b/src/assets/linkageForcesMarkers/娴蜂簨.png new file mode 100644 index 0000000..8d8d050 Binary files /dev/null and b/src/assets/linkageForcesMarkers/娴蜂簨.png differ diff --git a/src/assets/linkageForcesMarkers/鐕冩皵灞.png b/src/assets/linkageForcesMarkers/鐕冩皵灞.png new file mode 100644 index 0000000..ffcd19b Binary files /dev/null and b/src/assets/linkageForcesMarkers/鐕冩皵灞.png differ diff --git a/src/assets/linkageForcesMarkers/鐜繚灞.png b/src/assets/linkageForcesMarkers/鐜繚灞.png new file mode 100644 index 0000000..d391ce5 Binary files /dev/null and b/src/assets/linkageForcesMarkers/鐜繚灞.png differ diff --git a/src/assets/linkageForcesMarkers/鐢靛姏灞.png b/src/assets/linkageForcesMarkers/鐢靛姏灞.png new file mode 100644 index 0000000..4ff9f6b Binary files /dev/null and b/src/assets/linkageForcesMarkers/鐢靛姏灞.png differ diff --git a/src/assets/linkageForcesMarkers/閫氫俊.png b/src/assets/linkageForcesMarkers/閫氫俊.png new file mode 100644 index 0000000..3bd0a03 Binary files /dev/null and b/src/assets/linkageForcesMarkers/閫氫俊.png differ diff --git a/src/assets/waterMarkers/澶╃劧姘存簮.png b/src/assets/waterMarkers/澶╃劧姘存簮.png new file mode 100644 index 0000000..8daa2c1 Binary files /dev/null and b/src/assets/waterMarkers/澶╃劧姘存簮.png differ diff --git a/src/assets/waterMarkers/甯傛斂娑堢伀鏍.png b/src/assets/waterMarkers/甯傛斂娑堢伀鏍.png new file mode 100644 index 0000000..9622895 Binary files /dev/null and b/src/assets/waterMarkers/甯傛斂娑堢伀鏍.png differ diff --git a/src/assets/waterMarkers/鏂瑰舰鍌ㄦ按姹.png b/src/assets/waterMarkers/鏂瑰舰鍌ㄦ按姹.png new file mode 100644 index 0000000..d7862c1 Binary files /dev/null and b/src/assets/waterMarkers/鏂瑰舰鍌ㄦ按姹.png differ diff --git a/src/styles.scss b/src/styles.scss index 2ef5a9e..7c77928 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -129,7 +129,7 @@ table td.mat-footer-cell:last-of-type{ } //寮瑰嚭妗嗘牱寮忓彇娑坧adding -#shareDialog,#lookPlanDialog,#openPlanToolDialog,#addWater,#videodialog{ +#shareDialog,#lookPlanDialog,#openPlanToolDialog,#addWater,#videodialog,#addLinkageForce,#videodialog2{ padding: 0; } @@ -182,3 +182,18 @@ table td.mat-footer-cell:last-of-type{ line-height: 30px; } } +#linkageForcesSwiper{ + .swiper-container{ + --swiper-navigation-size: 26px;/* 璁剧疆鎸夐挳澶у皬 */ + } +} +//鐐硅仛鍚堣嚜瀹氫箟鍥剧墖澶у皬 +.clusterImg{ + width: 30px; + height: 30px; +} +//姘存簮閲囬泦鐐硅仛鍚 +.clusterImgCollection{ + width:25px; + height:25px; +} \ No newline at end of file