|
|
|
@ -11,6 +11,7 @@ import {CanvasShareDataService,GameMode} from '../../canvas-share-data.service'
|
|
|
|
|
import {CacheTokenService} from '../../http-interceptors/cache-token.service' |
|
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
|
import { saveOneDialog } from './save'; |
|
|
|
|
import { ActivatedRoute } from '@angular/router'; |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-collection-tools', |
|
|
|
|
templateUrl: './collection-tools.component.html', |
|
|
|
@ -20,7 +21,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
@ViewChild('canvas',{static: true}) canvas:WorkingAreaComponent; //父组件中获得子组件的引用
|
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,public token: CacheTokenService) { } |
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,public token: CacheTokenService,public route: ActivatedRoute) { } |
|
|
|
|
// tree配置
|
|
|
|
|
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
|
|
|
|
|
return { |
|
|
|
@ -520,6 +521,26 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//根据科达 url地址 统一社会信用代码 查询单位信息
|
|
|
|
|
queryCompanyData () { |
|
|
|
|
return new Promise ((resolve,reject)=>{ |
|
|
|
|
|
|
|
|
|
this.route.queryParams.subscribe(paramsData=>{ |
|
|
|
|
let params = {USCI: paramsData.usci || ''} |
|
|
|
|
this.http.get("/api/Companies",{params:params}).subscribe((data:any)=>{ |
|
|
|
|
if (data.items.length) { //查询到结果时
|
|
|
|
|
sessionStorage.setItem("buildingTypeId",data.items[0].buildingTypes[0].id || ''); //建筑类型
|
|
|
|
|
sessionStorage.setItem("companyId",data.items[0].id || ''); //单位ID
|
|
|
|
|
sessionStorage.setItem("planId",paramsData.planId || ''); //建筑类型
|
|
|
|
|
resolve('success') |
|
|
|
|
} else { //未查询到结果时
|
|
|
|
|
reject('beDefeated') |
|
|
|
|
} |
|
|
|
|
}) //http
|
|
|
|
|
|
|
|
|
|
}) //route
|
|
|
|
|
}) //Promise
|
|
|
|
|
} |
|
|
|
|
//右侧属性和消防要素切换
|
|
|
|
|
isProperty = true |
|
|
|
|
rightSwitch(type){ |
|
|
|
@ -548,17 +569,21 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
|
const token = sessionStorage.getItem('token'); // 判断 是否登录状态
|
|
|
|
|
if (token) { |
|
|
|
|
this.queryCompanyData().then(res=>{ |
|
|
|
|
// this.getAllLibrary() //获取素材库
|
|
|
|
|
this.getAllBuildings(); // 获取所有建筑
|
|
|
|
|
this.getAllFirePlan(); // 获取所有灾情
|
|
|
|
|
this.getAllBuildings(); // 获取所有建筑
|
|
|
|
|
this.getSitePlan(); // 获取总平面图 数据
|
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.token.login().then(res => { |
|
|
|
|
this.queryCompanyData().then(res=>{ |
|
|
|
|
this.params.companyId = sessionStorage.getItem('companyId'); |
|
|
|
|
// this.getAllLibrary() //获取素材库
|
|
|
|
|
this.getAllBuildings(); // 获取所有建筑
|
|
|
|
|
this.getAllFirePlan(); // 获取所有灾情
|
|
|
|
|
this.getSitePlan(); //获取总平面图 数据
|
|
|
|
|
this.getAllBuildings(); // 获取所有建筑
|
|
|
|
|
this.getSitePlan(); // 获取总平面图 数据
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// 监听canvas组件选中素材事件
|
|
|
|
@ -2030,7 +2055,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
export class CreateBuilding { |
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<CreateBuilding>,@Inject(MAT_DIALOG_DATA) public data) { } |
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<CreateBuilding>,@Inject(MAT_DIALOG_DATA) public data,public route: ActivatedRoute) { } |
|
|
|
|
|
|
|
|
|
allBuildingType:any//所有的建筑类型
|
|
|
|
|
selected:any; //选中的建筑
|
|
|
|
@ -2090,7 +2115,7 @@ export class EditBuilding {
|
|
|
|
|
allBuildingType:any//所有的建筑类型
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getAllBuildingType() |
|
|
|
|
// this.getAllBuildingType()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getAllBuildingType(){ |
|
|
|
|