|
|
|
@ -25,10 +25,11 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
expandable: !!node.children && node.children.length > 0, |
|
|
|
|
name: node.name || node.Name, |
|
|
|
|
level: level, |
|
|
|
|
id: node.id, |
|
|
|
|
id: node.id || node.Id, |
|
|
|
|
children:node.children, |
|
|
|
|
isTemplate:node.isTemplate, |
|
|
|
|
isNewElement:node.isNewElement, |
|
|
|
|
isLook:node.isLook, |
|
|
|
|
node:node |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
@ -299,11 +300,13 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.canvasAssetObj.Width = this.assetWidth |
|
|
|
|
// this.proObject.Width = this.assetWidth
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//素材高度输入框改变
|
|
|
|
|
assetHeightIunput(){ |
|
|
|
|
this.canvasAssetObj.Height = this.assetHeight |
|
|
|
|
// this.proObject.Height = this.assetHeight
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//素材角度输入框改变
|
|
|
|
|
assetAngleIunput(){ |
|
|
|
|
this.canvasAssetObj.Angle = this.sliderValue |
|
|
|
@ -326,6 +329,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
document.onmouseup = null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//消防要素div边框高度调节
|
|
|
|
|
firecategoriesDivMouseDown(e){ |
|
|
|
|
document.onmousemove = (ev) => { |
|
|
|
@ -350,6 +354,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
assetHighLightIunput(){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//动态属性素材input框值改变
|
|
|
|
|
assetInputChange(i,e){ |
|
|
|
|
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ |
|
|
|
@ -357,6 +362,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//动态属性素材布尔值框改变radio
|
|
|
|
|
assetRadioChange(i,boolean){ |
|
|
|
|
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ |
|
|
|
@ -380,6 +386,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let imgFile = e.target.files[0] || null //上传的文件
|
|
|
|
|
this.startUploading(imgFile) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
objectName:any //上传对象名
|
|
|
|
|
startUploading (imgFile) { |
|
|
|
|
let _this = this |
|
|
|
@ -483,11 +490,9 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}, 0); |
|
|
|
|
//此处需要把 this.canvasAssetObj这个传入对象 返回给canvas ↓↓↓↓↓↓↓↓↓↓
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//动态属性方向select选择框
|
|
|
|
|
direction(i,e){ |
|
|
|
|
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ |
|
|
|
@ -496,6 +501,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//动态属性供给区域select选择框
|
|
|
|
|
supplyArea(i,e){ |
|
|
|
|
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ |
|
|
|
@ -503,6 +509,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//动态属性供给类型select选择框
|
|
|
|
|
supplyType(i,e){ |
|
|
|
|
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ |
|
|
|
@ -519,6 +526,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
// this.setAssetsProperty(this.proObject) //测试
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
|
// 监听canvas组件选中素材事件
|
|
|
|
|
this.canvas.on("select",obj=>{ |
|
|
|
@ -533,10 +541,12 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
basicInfoClick(){ |
|
|
|
|
this.basicInfo = !this.basicInfo |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//点击想定作业名称
|
|
|
|
|
wantToWorkClick(){ |
|
|
|
|
this.wantToWork = !this.wantToWork |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//进入编辑模式
|
|
|
|
|
editpat(){ |
|
|
|
|
this.isEditPat = true |
|
|
|
@ -545,6 +555,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('进入编辑模式','确定',config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//进入查看模式
|
|
|
|
|
lookpat(){ |
|
|
|
|
this.isEditPat = false |
|
|
|
@ -553,16 +564,19 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('进入查看模式','确定',config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//保存平面图
|
|
|
|
|
saveSite(){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获得所有的建筑物
|
|
|
|
|
getAllBuildings(){ |
|
|
|
|
this.http.get("/api/CompanyAccount/Buildings").subscribe(data=>{ |
|
|
|
|
this.allBuildings = data |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//创建建筑
|
|
|
|
|
createBuilding(){ |
|
|
|
|
let data = this.allBuildings |
|
|
|
@ -582,6 +596,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
});
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//选择建筑
|
|
|
|
|
checkedBuilding(item,index){ |
|
|
|
|
if (this.checkedBuildingIndex!=index) { |
|
|
|
@ -594,6 +609,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//编辑建筑
|
|
|
|
|
editBuilding(e,item){ |
|
|
|
|
e.stopPropagation(); |
|
|
|
@ -613,6 +629,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
});
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//删除建筑
|
|
|
|
|
deleteBuilding(e,item){ |
|
|
|
|
e.stopPropagation(); |
|
|
|
@ -638,23 +655,28 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
storeyData //将建筑素材和当前楼层素材合二为一
|
|
|
|
|
|
|
|
|
|
//处理 tree 数据结构
|
|
|
|
|
handleTreeData (storeyData) { |
|
|
|
|
this.storeyData = storeyData |
|
|
|
|
|
|
|
|
|
let data = this.allFireElements //所有消防要素
|
|
|
|
|
let treeData = [] //tree型 处理完成后的数据
|
|
|
|
|
data.forEach(element => { |
|
|
|
|
element.isTemplate = true //添加模板标识
|
|
|
|
|
element.isLook = true //添加是否可见标识
|
|
|
|
|
element.children = [] |
|
|
|
|
if(storeyData){ |
|
|
|
|
for(let key in storeyData.data){ |
|
|
|
|
if(element.id == storeyData.data[key].FireElementId){ |
|
|
|
|
storeyData.data[key].isTemplate = false |
|
|
|
|
storeyData.data[key].isLook = true |
|
|
|
|
element.isNewElement = true |
|
|
|
|
element.children.push(storeyData.data[key]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
data.forEach(item => { if (item.parentId == element.id) {element.children.push(item)} }); |
|
|
|
|
}); |
|
|
|
|
data.forEach(element => { |
|
|
|
@ -671,11 +693,48 @@ 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 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.allFireElements.forEach(item=>{ |
|
|
|
|
if(item.id == node.id){ |
|
|
|
|
item.isLook = !item.isLook |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
function updateChildrenIsLook(node, childHandleCb) { |
|
|
|
|
if(node.children && node.children.length != 0){ |
|
|
|
|
node.children.forEach(item => { |
|
|
|
|
item.isLook = !item.isLook |
|
|
|
|
if (childHandleCb) { |
|
|
|
|
childHandleCb(item) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
updateChildrenIsLook(node, (child) => { |
|
|
|
|
updateChildrenIsLook(child, null) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.dataSource.data = [...this.dataSource.data] |
|
|
|
|
this.treeControl.expandAll() |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//封装 刷新 tree 数据
|
|
|
|
|
renovateTreeData () { |
|
|
|
|
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] |
|
|
|
|