|
|
|
@ -10,6 +10,7 @@ import {WorkingAreaComponent} from '../../working-area/working-area.component'
|
|
|
|
|
import {CanvasShareDataService} from '../../canvas-share-data.service' //引入服务
|
|
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
|
import { MaskLayerService } from 'src/app/mask-layer.service'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-collection-tools', |
|
|
|
@ -20,7 +21,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
@ViewChild('canvas') canvas:WorkingAreaComponent; //父组件中获得子组件的引用
|
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService) { } |
|
|
|
|
constructor(private maskLayerService:MaskLayerService, private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService) { } |
|
|
|
|
// tree配置
|
|
|
|
|
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
|
|
|
|
|
return { |
|
|
|
@ -296,7 +297,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
formData.append("file",file) |
|
|
|
|
await new Promise((resolve,reject)=>{ |
|
|
|
|
this.http.delete(`/api/Objects/WebPlan2D/${companyId}/${file.name}?x-oss-process=image/resize,m_fixed,h_100,w_100`).subscribe(data=>{ |
|
|
|
|
console.log('删除缩略图成功') |
|
|
|
|
// console.log('删除缩略图成功')
|
|
|
|
|
resolve('删除缩略图成功') |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
@ -520,7 +521,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//更新用于统计的数据
|
|
|
|
|
this.canvasData.updateBuildingData() |
|
|
|
|
|
|
|
|
|
this.maskLayerService.sendMessage(true) |
|
|
|
|
if (this.selectingSitePlan && this.selectingSitePlan.id) { |
|
|
|
|
this.saveNum = [] |
|
|
|
|
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); |
|
|
|
@ -555,6 +556,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/SitePlanData",SitePlanData).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'; |
|
|
|
@ -573,6 +575,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/CompanyData",CompanyData).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'; |
|
|
|
@ -592,6 +595,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/CompanyAdjoins/Batch",CompanyAdjoins).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'; |
|
|
|
@ -611,6 +615,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/CompanyImportantLocations/Batch",CompanyImportantLocations).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'; |
|
|
|
@ -630,6 +635,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/CompanyFacilityAssets/Batch",CompanyFacilityAssets).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'; |
|
|
|
@ -650,6 +656,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/BuildingAreaData",SitePlanData).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'; |
|
|
|
@ -668,6 +675,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post("/api/CompanyAccount/BuildingData",CompanyData).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'; |
|
|
|
@ -687,6 +695,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post(`/api/CompanyAccount/BuildingAdjoins/Batch?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'; |
|
|
|
@ -706,6 +715,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post(`/api/CompanyAccount/BuildingImportantLocations/Batch?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'; |
|
|
|
@ -725,6 +735,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post(`/api/CompanyAccount/BuildingFacilityAssets/Batch?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'; |
|
|
|
|