邵佳豪 4 years ago
parent
commit
672b8a827a
  1. 48
      src/app/ui/collection-tools/collection-tools.component.ts
  2. 2
      src/app/ui/collection-tools/panel.scss
  3. 25
      src/app/working-area/working-area.component.ts

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

@ -630,15 +630,17 @@ export class CollectionToolsComponent implements OnInit {
//获取总平面图
getSitePlan () {
this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素
this.getSitePlanCompanyData() //获取 单位 数据
let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素
let planData = this.getSitePlanCompanyData() //获取 单位 数据
this.http.get('/api/CompanyAccount/SitePlans').subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[0] || {}
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
this.selectSitePlanIndex = 0
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
if (fireData=='success' && planData=='success') {
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
}
})
}
@ -647,32 +649,38 @@ export class CollectionToolsComponent implements OnInit {
let params = {
buildingId: item.id
}
this.getFireElements(item.buildingTypes[0].id || '') //获取建筑下 消防要素
this.getBuildingData(params) //获取 建筑 数据
let fireData = this.getFireElements(item.buildingTypes[0].id || '') //获取建筑下 消防要素
let planData = this.getBuildingData(params) //获取 建筑 数据
this.http.get('/api/CompanyAccount/BuildingAreas',{params}).subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[0] || {}
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
this.selectSitePlanIndex = 0
this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据
if (fireData=='success' && planData=='success') {
this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据
}
})
}
//根据单位类型获得所有的消防要素
getFireElements (e) {
let params = {ids:e}
this.http.get('/api/Companies/FireElements',{params}).subscribe((data:any)=>{
let isTrue = this.http.get('/api/Companies/FireElements',{params}).subscribe((data:any)=>{
this.allFireElements = data //所有消防要素
return true
})
if (isTrue) { return 'success' }
}
//获取 单位 数据
getSitePlanCompanyData () {
this.http.get('/api/CompanyAccount/CompanyData').subscribe((data:any)=>{
let isTrue = this.http.get('/api/CompanyAccount/CompanyData').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 = {}
return true
})
if (isTrue) { return 'success' }
}
//获取 平面图 楼层数据
@ -687,10 +695,12 @@ export class CollectionToolsComponent implements OnInit {
//获取 建筑 数据
getBuildingData (e) {
this.http.get(`/api/CompanyAccount/BuildingData`,{params:e}).subscribe((data:any)=>{
let isTrue = this.http.get(`/api/CompanyAccount/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 = {}
return true
})
if (isTrue) { return 'success' }
}
//获取 建筑 楼层数据
@ -807,11 +817,13 @@ export class CollectionToolsComponent implements OnInit {
item.imageAngle==270? item.imageAngle = 0 : item.imageAngle = item.imageAngle+90
if (this.checkedBuildingIndex==-1) { //总平面图
this.http.put(`/api/CompanyAccount/SitePlans/${item.id}`,item).subscribe(data=>{
this.renovateSitePlan()
const revolve = this.renovateSitePlan()
if (revolve=='renovate') { this.canvas.refreshBackgroundImage(); }
})
} else { //楼层/区域
this.http.put(`/api/CompanyAccount/BuildingAreas/${item.id}`,item).subscribe(data=>{
this.renovateBuilding()
const revolve = this.renovateBuilding()
if (revolve=='renovate') { this.canvas.refreshBackgroundImage(); }
})
}
@ -898,7 +910,8 @@ export class CollectionToolsComponent implements OnInit {
item.imageUrl = '/api/Objects/WebPlan2D/' + e
if (this.checkedBuildingIndex ==-1) { //总平面图
this.http.put(`/api/CompanyAccount/SitePlans/${item.id}`,item).subscribe(data=>{
this.renovateSitePlan()
const revolve = this.renovateSitePlan()
if (revolve=='renovate') { this.canvas.refreshBackgroundImage(); }
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -906,7 +919,8 @@ export class CollectionToolsComponent implements OnInit {
})
} else { //楼层/区域
this.http.put(`/api/CompanyAccount/BuildingAreas/${item.id}`,item).subscribe(data=>{
this.renovateBuilding()
const revolve = this.renovateBuilding()
if (revolve=='renovate') { this.canvas.refreshBackgroundImage(); }
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -922,7 +936,7 @@ export class CollectionToolsComponent implements OnInit {
//封装 刷新总平面图 数据
renovateSitePlan () {
this.http.get('/api/CompanyAccount/SitePlans').subscribe(data=>{
let isTrue = this.http.get('/api/CompanyAccount/SitePlans').subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex]
this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //服务中 存一份数据
@ -930,7 +944,9 @@ export class CollectionToolsComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
return true
})
if (isTrue) { return 'renovate' }
}
//封装 刷新 楼层/区域 数据
@ -938,7 +954,7 @@ export class CollectionToolsComponent implements OnInit {
let params = {
buildingId: this.beforeOneCheckedBuilding.id
}
this.http.get('/api/CompanyAccount/BuildingAreas',{params}).subscribe(data=>{
let isTrue = this.http.get('/api/CompanyAccount/BuildingAreas',{params}).subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex]
this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //服务中 存一份数据
@ -946,7 +962,9 @@ export class CollectionToolsComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
return true
})
if (isTrue) { return 'renovate' }
}
allLibrary:any = []; //所有素材库 + 素材

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

@ -112,7 +112,7 @@
height: 100px;
position: absolute;
top: -32px;
right: -51px;
right: -50.5px;
border-radius: 0 100px 100px 0;
background-color: #cdced1;
// #F0F4F7

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

@ -653,6 +653,7 @@ export class SinglePointIcon extends PIXI.Container {
singlePointIcon.y = this.assetData.Point.y;
singlePointIcon.width = this.assetData.Width;
singlePointIcon.height = this.assetData.Height;
singlePointIcon.alpha = 1;
singlePointIcon.anchor.set(0.5);
singlePointIcon.interactive = true;
@ -687,6 +688,12 @@ export class SinglePointIcon extends PIXI.Container {
.on('rightclick', event => {
});
const text = new PIXI.Text(this.assetData.Name, {
fontFamily: 'Arial', fontSize: 24, fill: 0xffffff, align: 'center'
});
text.anchor.set(0.5);
text.y -= this.assetData.Height + 12;
singlePointIcon.addChild(text);
this.addChild(singlePointIcon);
}
}
@ -726,6 +733,15 @@ export class MultipointIcon extends PIXI.Container {
icon.angle = angle;
this.iconsTilingSprite.push(icon);
this.addChild(icon);
if (i === 0) {
// 名称
const text = new PIXI.Text(this.assetData.Name, {
fontFamily: 'Arial', fontSize: 24, fill: 0xffffff, align: 'center'
});
text.anchor.set(0.5);
text.y -= this.assetData.Height;
icon.addChild(text);
}
}
// 画点
this.pointsData.forEach((item, index, array) => {
@ -904,6 +920,13 @@ export class PolygonIcon extends PIXI.Container {
this.polygonLineGraphics.drawPolygon(this.getPoints());
this.polygonLineGraphics.closePath();
this.addChild(this.polygonLineGraphics);
// 名称
const text = new PIXI.Text(this.assetData.Name, {
fontFamily: 'Arial', fontSize: 24, fill: 0xffffff, align: 'center'
});
text.anchor.set(0.5);
text.y -= this.assetData.Height;
this.polygonLineGraphics.addChild(text);
// 添加圆点事件
this.pointsGraphics.forEach((item, index, array) => {
item.interactive = true;
@ -1135,7 +1158,7 @@ export class PropertyInfo {
*/
public Tag: string;
/**
*
*
*/
public Order: number;
/**

Loading…
Cancel
Save