|
|
@ -2,11 +2,11 @@ import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContaine |
|
|
|
import { HttpClient, HttpHeaders } from '@angular/common/http'; |
|
|
|
import { HttpClient, HttpHeaders } from '@angular/common/http'; |
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
import {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeComponent,addDisposalNodeComponent, addBGCDisposalNodeComponent} from './leftFunctionalDomain' |
|
|
|
import {leftFunctionalDomainComponent,editPlaneFigureComponent,editDisposalNodeComponent,addDisposalNodeComponent, addBGCDisposalNodeComponent} from './leftFunctionalDomain'; |
|
|
|
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; |
|
|
|
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; |
|
|
|
import {FlatTreeControl} from '@angular/cdk/tree'; |
|
|
|
import {FlatTreeControl} from '@angular/cdk/tree'; |
|
|
|
import {WorkingAreaComponent} from '../../working-area/working-area.component' |
|
|
|
import {WorkingAreaComponent} from '../../working-area/working-area.component'; |
|
|
|
import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service' //引入服务
|
|
|
|
import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service'; //引入服务
|
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
import Swiper from 'swiper'; |
|
|
|
import Swiper from 'swiper'; |
|
|
|
import { saveOneDialog } from './save'; |
|
|
|
import { saveOneDialog } from './save'; |
|
|
@ -17,6 +17,7 @@ import { ActivatedRoute, Router } from '@angular/router'; |
|
|
|
import { MaskLayerService } from 'src/app/mask-layer.service'; |
|
|
|
import { MaskLayerService } from 'src/app/mask-layer.service'; |
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem'; |
|
|
|
import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem'; |
|
|
|
|
|
|
|
import { TreeService } from 'src/app/http-interceptors/tree.service'; |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-collection-tools', |
|
|
|
selector: 'app-collection-tools', |
|
|
|
templateUrl: './collection-tools.component.html', |
|
|
|
templateUrl: './collection-tools.component.html', |
|
|
@ -119,6 +120,12 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
if(item.PropertyType == 4){//图片数值上线
|
|
|
|
if(item.PropertyType == 4){//图片数值上线
|
|
|
|
this.imagesArrNum = item.PropertyValue |
|
|
|
this.imagesArrNum = item.PropertyValue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(item.PropertyName == '所属单位'){ |
|
|
|
|
|
|
|
if(!item.PropertyValue){ |
|
|
|
|
|
|
|
item.PropertyValue = this.organizationName |
|
|
|
|
|
|
|
item.Tag = this.organizationId |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//如果存在图片则加载轮播图
|
|
|
|
//如果存在图片则加载轮播图
|
|
|
@ -147,9 +154,24 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
this.isImgNumCss = false |
|
|
|
this.isImgNumCss = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
pattern:boolean = false//默认为基本信息编辑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//人或车选择所属单位
|
|
|
|
|
|
|
|
changeOr(){ |
|
|
|
|
|
|
|
let dialogRef = this.dialog.open(Organization); |
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(data=>{ |
|
|
|
|
|
|
|
if(data && data.name){ |
|
|
|
|
|
|
|
this.PropertyInfos.forEach(item => { |
|
|
|
|
|
|
|
if(item.PropertyName == '所属单位'){ |
|
|
|
|
|
|
|
item.PropertyValue = data.name |
|
|
|
|
|
|
|
item.Tag = data.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pattern:boolean = false//默认为基本信息编辑
|
|
|
|
//基本信息编辑模式
|
|
|
|
//基本信息编辑模式
|
|
|
|
baseInfo(){ |
|
|
|
baseInfo(){ |
|
|
|
if (!this.pattern) { |
|
|
|
if (!this.pattern) { |
|
|
@ -476,14 +498,6 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
this.canvas.refreshIcon(this.canvasAssetObj.Id) |
|
|
|
this.canvas.refreshIcon(this.canvasAssetObj.Id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//查看图片详情
|
|
|
|
|
|
|
|
lookImg(){ |
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
|
|
|
data: {imagesArr:this.imagesArr,index:this.clickedIndex} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(data=>{ });
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上传素材图片
|
|
|
|
//上传素材图片
|
|
|
|
selectFile(e){ |
|
|
|
selectFile(e){ |
|
|
|
let imgFile = e.target.files[0] || null //上传的文件
|
|
|
|
let imgFile = e.target.files[0] || null //上传的文件
|
|
|
@ -639,11 +653,11 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
}//多个素材共同属性
|
|
|
|
}//多个素材共同属性
|
|
|
|
multipleAssetData:any//当前多选的素材
|
|
|
|
multipleAssetData:any//当前多选的素材
|
|
|
|
firstMultipleAssetData:any//当前多选的第一个素材
|
|
|
|
firstMultipleAssetData:any//当前多选的第一个素材
|
|
|
|
|
|
|
|
organizationName:any = this.route.snapshot.queryParams.orName//当前预案单位所属机构名称
|
|
|
|
|
|
|
|
organizationId:any = this.route.snapshot.queryParams.orId//当前预案单位所属机构名称
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
|
|
|
this.canvasData.isInheritSky = { weather:'', airTemperature:'', windDirection:'', windScale:'', }; //缓存 节点 天气
|
|
|
|
this.canvasData.isInheritSky = { weather:'', airTemperature:'', windDirection:'', windScale:'', }; //缓存 节点 天气
|
|
|
|
AxMessageSystem.addListener('selectionChanged', ()=>{ |
|
|
|
AxMessageSystem.addListener('selectionChanged', ()=>{ |
|
|
|
|
|
|
|
|
|
|
|
if(this.canvas.selection.size() == 1){//如果是单选
|
|
|
|
if(this.canvas.selection.size() == 1){//如果是单选
|
|
|
|
this.isMultipleAsset = false |
|
|
|
this.isMultipleAsset = false |
|
|
|
// console.log('单选',this.canvas.selection.first().assetData)
|
|
|
|
// console.log('单选',this.canvas.selection.first().assetData)
|
|
|
@ -2635,50 +2649,47 @@ export class EditBuilding { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//查看图片大图
|
|
|
|
//选择所属单位
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'viewdetails', |
|
|
|
selector: 'app-organization', |
|
|
|
templateUrl: './viewdetails.html', |
|
|
|
templateUrl: './changeOr.html', |
|
|
|
styleUrls: ['./collection-tools.component.scss'] |
|
|
|
styleUrls: ['./collection-tools.component.scss'] |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class ViewDetails { |
|
|
|
export class Organization { |
|
|
|
// myControl = new FormControl();
|
|
|
|
|
|
|
|
//注入MatDialogRef,可以用来关闭对话框
|
|
|
|
constructor(private tree:TreeService,private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<Organization>,@Inject(MAT_DIALOG_DATA) public data) { } |
|
|
|
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
|
|
|
|
|
|
|
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ViewDetails>,@Inject(MAT_DIALOG_DATA) public data,private element: ElementRef) {} |
|
|
|
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
|
|
|
|
imagesArr = this.data.imagesArr |
|
|
|
return { |
|
|
|
onNoClick(): void { |
|
|
|
expandable: !!node.children && node.children.length > 0, |
|
|
|
this.dialogRef.close(); |
|
|
|
name: node.name, |
|
|
|
|
|
|
|
level: level, |
|
|
|
|
|
|
|
id: node.id, |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
treeControl = new FlatTreeControl<any>(node => node.level, node => node.expandable); |
|
|
|
|
|
|
|
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); |
|
|
|
|
|
|
|
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); |
|
|
|
|
|
|
|
hasChild = (_: number, node: any) => node.expandable; |
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
setTimeout(() => { |
|
|
|
this.getAllOrganization() |
|
|
|
var mySwiper = new Swiper('.swiper-container',{ |
|
|
|
} |
|
|
|
loop: false, |
|
|
|
selectedNodeId:any |
|
|
|
initialSlide :this.data.index,//默认索引
|
|
|
|
selectedNodeName:any |
|
|
|
// 如果需要前进后退按钮
|
|
|
|
selectedNode(node){ |
|
|
|
navigation: { |
|
|
|
this.selectedNodeId = node.id |
|
|
|
nextEl: '.swiper-button-next', |
|
|
|
this.selectedNodeName = node.name |
|
|
|
prevEl: '.swiper-button-prev', |
|
|
|
} |
|
|
|
}
|
|
|
|
getAllOrganization(){ |
|
|
|
//其他设置
|
|
|
|
this.http.get('/api/Organizations').subscribe(data => { |
|
|
|
});
|
|
|
|
this.dataSource.data = this.tree.toTree(data); |
|
|
|
}, 0); |
|
|
|
this.treeControl.expand(this.treeControl.dataNodes[0]); |
|
|
|
} |
|
|
|
}) |
|
|
|
closeDialog(){ |
|
|
|
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
count = 10 |
|
|
|
ok(){ |
|
|
|
zoomimg(e) { |
|
|
|
this.dialogRef.close({ |
|
|
|
if(this.count != 1 || e.wheelDelta >= 120){ |
|
|
|
id:this.selectedNodeId, |
|
|
|
if(e.wheelDelta >= 120){ |
|
|
|
name:this.selectedNodeName |
|
|
|
this.count++ |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
|
|
|
|
this.count-- |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.srcElement.style.zoom = this.count + '0%' |
|
|
|
|
|
|
|
e.srcElement.style.maxWidth = null |
|
|
|
|
|
|
|
e.srcElement.style.maxHeight = null |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|