diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss
index f01a7b7..9f00105 100644
--- a/src/app/ui/collection-tools/collection-tools.component.scss
+++ b/src/app/ui/collection-tools/collection-tools.component.scss
@@ -59,6 +59,12 @@
color: white;
}
}
+ .rightSave {
+ cursor: pointer;
+ position: absolute;
+ right: 60px;
+ label { vertical-align: middle; color: #279FFF; }
+ }
}
//头部操作栏
diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts
index c9da111..e3ce60c 100644
--- a/src/app/ui/collection-tools/collection-tools.component.ts
+++ b/src/app/ui/collection-tools/collection-tools.component.ts
@@ -1025,12 +1025,7 @@ export class CollectionToolsComponent implements OnInit {
disasterId: this.allFirePlan[0].id || ''
}
});
-
- dialogRef.afterClosed().subscribe(result => {
- // console.log('The dialog was closed');
- });
- }
-
+ } //else
} else { //if
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@@ -1276,7 +1271,6 @@ export class CollectionToolsComponent implements OnInit {
//点击数节点的显示隐藏icon
clickLookItem(node){
-
//修改真实素材islook属性
for(let key in this.storeyData.data){
if(key == node.id){
@@ -1563,7 +1557,7 @@ export class CollectionToolsComponent implements OnInit {
selectSitePlan (item,index) {
if (this.selectSitePlanIndex != index) {
this.canvasData.selectPanelPoint = new DisposalNodeData();
- if (this.canvasData.isChange) { //true 数据被改动
+ if (this.pattern && this.canvasData.isChange) { //true 数据被改动
let isTrue = confirm('是否保存当前编辑数据')
if (isTrue) { //先保存数据 在切换
let isSuccess = this.saveSite()//true的时候 先保存数据
@@ -2136,9 +2130,13 @@ export class CollectionToolsComponent implements OnInit {
let dialogRef = this.dialog.open(addBGCDisposalNodeComponent);
dialogRef.afterClosed().subscribe(data=>{
if (data) {
- this.canvasData.customizeDisposalNode = data
+ this.canvasData.customizeDisposalNode = data //自定义数据节点
let imgURL = window.URL.createObjectURL(data.file) //将图片生成 url地址
- console.log(imgURL,this.canvasData.customizeDisposalNode)
+ this.canvasData.selectPanelPointBaseData = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''} //更新 当前数据节点对应父级节点
+ this.selectDisposalNode = ''
+ this.canvasData.selectPanelPoint = new DisposalNodeData() //更新 当前数据节点
+ this.canvasData.selectPanelPoint.BackgroundImageUrl = imgURL
+ this.customizeNodes()
}
})
}
@@ -2235,16 +2233,46 @@ export class CollectionToolsComponent implements OnInit {
buildingIndex: e.sitePlanId? -1 : this.allBuildings.findIndex(item=>{ return item.id===e.buildingId }), //总平面图/建筑 index
storeyId: e.sitePlanId? e.sitePlanId : e.buildingAreaId, //楼层id
}
- this.http.get('/api/DisposalNodeData',{params:params}).subscribe(data=>{
+ this.http.get('/api/DisposalNodeData',{params:params}).subscribe((data:any)=>{
this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data || new DisposalNodeData())) //选择 当前 节点
this.canvasData.selectPanelPoint.Data = this.canvasData.deserialize(this.canvasData.selectPanelPoint.Data)
- this.seekPanelPoint(parameter)
+ data.backgroundImageUrl? this.customizeNodes() : this.seekPanelPoint(parameter)
})
} //if
} //else if
}
+ //自定义数据节点 时
+ async customizeNodes() {
+ await this.canvas.loadNoRelevantInformationDisposalPlan(this.canvasData.selectPanelPoint)
+ let other = {
+ children: [],
+ computed: true,
+ id: '',
+ name: '其他',
+ order: 999,
+ parentId: null,
+ tag: "INPUT",
+ isLookPattern : true
+ }
+ this.allFireElements = [other]
+ this.canvas.setNameVisible(this.basicInfo,0)
+ this.canvas.setNameVisible(this.wantToWork,1)
+ this.beforeOneCheckedBuildingIsShow = false
+
+ let selectPanelPoint = JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint || {} )) //当前 节点 数据
+ if(selectPanelPoint.Data){
+ for(let key in selectPanelPoint.Data.Stock){ //筛选数据 没有匹配全部放入到 其他 数组
+ let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId )
+ if (!noMatch) {
+ this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key])
+ }
+ }
+ }
+ this.handleTreeData({data:{}},selectPanelPoint) //处理tree数据结构
+ }
+
//查找 数据节点 对应 建筑/楼层
seekPanelPoint (paramsData) {
this.checkedBuildingIndex = paramsData.buildingIndex
diff --git a/src/app/ui/collection-tools/leftFunctionalDomain.ts b/src/app/ui/collection-tools/leftFunctionalDomain.ts
index 3deb432..9703cd8 100644
--- a/src/app/ui/collection-tools/leftFunctionalDomain.ts
+++ b/src/app/ui/collection-tools/leftFunctionalDomain.ts
@@ -144,7 +144,7 @@ export class addBGCDisposalNodeComponent implements OnInit {
file:any = null; //文件
//上传图片
selectFile (e) {
- if (e.target.files.length ) {
+ if (e.target.files.length) {
let maxSize = 5*1024*1024
if (e.target.files[0].size <= maxSize) {
this.file = e.target.files[0]
diff --git a/src/app/ui/collection-tools/save.ts b/src/app/ui/collection-tools/save.ts
index 1657b66..4be3e0b 100644
--- a/src/app/ui/collection-tools/save.ts
+++ b/src/app/ui/collection-tools/save.ts
@@ -92,7 +92,6 @@ export class saveOneDialog {
nodeItem
itemChildNum = 0 //点击处置节点子数据节点的数量
clickNode(item){
- // console.log(item)
this.nodeItem = item
this.allDisposalNodeChild.forEach(item => {
if(item.id == this.nodeItem.id){
@@ -105,8 +104,17 @@ export class saveOneDialog {
selectedSiteData = this.data.selectedSiteData
onSubmit(value,type){
this.maskLayerService.sendMessage(true)
-
- let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name
+ let name
+ if (this.canvasData.selectPanelPoint.BackgroundImageUrl) { //当前 为自定义处置节点
+ if (this.canvasData.selectPanelPoint.DisposalNodeId) { // 保存逻辑
+ let node = this.canvasData.findDisposalNode(this.canvasData.selectPanelPoint.DisposalNodeId,null)
+ node? name = node.name : null
+ } else { //新建逻辑
+ name = this.canvasData.customizeDisposalNode.name
+ }
+ } else {
+ name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name
+ }
//如果保存到已有节点
var postdata = {
id: "",
@@ -138,8 +146,7 @@ export class saveOneDialog {
putdata.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection)
putdata.description = this.canvasData.selectPanelPointBaseData.description
putdata.notes = this.canvasData.selectPanelPointBaseData.notes
-
-
+
if(istrue){//如果该处置节点下已有同名数据节点 则只修改 2个接口
new Promise((resolve,reject)=>{
this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => {
@@ -150,21 +157,30 @@ export class saveOneDialog {
// 保存平面图数据到当前节点
let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint))
postdata.Data = JSON.stringify(postdata.Data)
- this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => {
- this.maskLayerService.sendMessage(false)
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('保存成功','确定',config)
- },err=>{
- this.maskLayerService.sendMessage(false)
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('保存失败','确定',config)
- })
- this.dialogRef.close();
- this.canvasData.sendMessage('send a message');//发布一条消息
+ postdata.Version = "2.0"
+ postdata.DisposalNodeId ? null : postdata.DisposalNodeId = istrue.id
+ postdata.PlanComponentId ? null : postdata.PlanComponentId = sessionStorage.getItem("planId")
+ postdata.Id ? null : postdata.Id = ''
+ postdata.BackgroundImageUrl? null : postdata.BackgroundImageUrl = null
+ let imgURL = this.uploadBGC() //更新 背景图
+ imgURL.then(url=>{
+ url? postdata.BackgroundImageUrl = url.toString() : null
+ this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => {
+ this.maskLayerService.sendMessage(false)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('保存成功','确定',config)
+ },err=>{
+ this.maskLayerService.sendMessage(false)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('保存失败','确定',config)
+ })
+ this.dialogRef.close();
+ this.canvasData.sendMessage('send a message');//发布一条消息
+ }) //imgURL
})
}else{//需要3个接口
@@ -186,22 +202,27 @@ export class saveOneDialog {
version: this.canvasData.selectPanelPoint.Version || "2.0",
disposalNodeId: data.id,
planComponentId: sessionStorage.getItem("planId"),
+ backgroundImageUrl: this.canvasData.selectPanelPoint.BackgroundImageUrl,
}
- this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => {
- this.maskLayerService.sendMessage(false)
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('保存成功','确定',config)
- },err=>{
- this.maskLayerService.sendMessage(false)
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('保存失败','确定',config)
- })
- this.dialogRef.close();
- this.canvasData.sendMessage('send a message');//发布一条消息
+ let imgURL = this.uploadBGC() //更新 背景图
+ imgURL.then(url=>{
+ url? objData.backgroundImageUrl = url.toString() : null
+ this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => {
+ this.maskLayerService.sendMessage(false)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('保存成功','确定',config)
+ },err=>{
+ this.maskLayerService.sendMessage(false)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('保存失败','确定',config)
+ })
+ this.dialogRef.close();
+ this.canvasData.sendMessage('send a message');//发布一条消息
+ }) //imgURL
})
})
}
@@ -280,26 +301,48 @@ export class saveOneDialog {
version: this.canvasData.selectPanelPoint.Version || "2.0",
disposalNodeId: data.id,
planComponentId: sessionStorage.getItem("planId"),
+ backgroundImageUrl: this.canvasData.selectPanelPoint.BackgroundImageUrl,
}
-
- this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => {
- this.maskLayerService.sendMessage(false)
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('保存成功','确定',config)
-
- },err=>{
- this.maskLayerService.sendMessage(false)
- const config = new MatSnackBarConfig();
- config.verticalPosition = 'top';
- config.duration = 3000
- this.snackBar.open('保存失败','确定',config)
- })
- this.dialogRef.close();
- this.canvasData.sendMessage("send a message")
+ let imgURL = this.uploadBGC() //更新 背景图
+ imgURL.then(url=>{
+ url? objData.backgroundImageUrl = url.toString() : null
+ this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => {
+ this.maskLayerService.sendMessage(false)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('保存成功','确定',config)
+
+ },err=>{
+ this.maskLayerService.sendMessage(false)
+ const config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('保存失败','确定',config)
+ })
+ this.dialogRef.close();
+ this.canvasData.sendMessage("send a message")
+ }) //imgURL
})
})
}
}
+
+ //封装方法 上传 自定义底图
+ uploadBGC () {
+ return new Promise((resolve,reject)=>{
+ if (this.canvasData.selectPanelPoint.BackgroundImageUrl && !this.canvasData.selectPanelPoint.DisposalNodeId) { //新建逻辑
+ if (this.canvasData.customizeDisposalNode) {
+ let formData = new FormData()
+ formData.append("file",this.canvasData.customizeDisposalNode.file)
+ this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}/DisposalNode`,formData).subscribe((data:any)=>{
+ resolve('/api/Objects/WebPlan2D/' + data.objectName)
+ })
+ }
+ } else {
+ resolve(null)
+ } //else
+ })
+ }
+
}
\ No newline at end of file
diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts
index d1129ac..81265f8 100644
--- a/src/app/ui/ui.module.ts
+++ b/src/app/ui/ui.module.ts
@@ -96,8 +96,11 @@ import { saveOneDialog, saveTwoDialog } from './collection-tools/save';
import { CollectionToolsPlanComponent, CreateBuildingPlan, EditBuildingPlan, ViewDetailsPlan } from './collection-tools-plan/collection-tools.component';
import { addDisposalNodeComponentPlan, editDisposalNodeComponentPlan, editPlaneFigureComponentPlan, leftFunctionalDomainComponentPlan } from './collection-tools-plan/leftFunctionalDomain';
import { saveOneDialogPlan, saveTwoDialogPlan } from './collection-tools-plan/save';
+import {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,ViewDetailsBuilding} from './collection-tools-building/collection-tools.component'
+import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent} from './collection-tools-building/leftFunctionalDomain'
+import {saveOneDialogBuilding,saveTwoDialogBuilding} from './collection-tools-building/save'
@NgModule({
- declarations: [UiComponent, DateselectComponent, MenuComponent, CardComponent, ListComponent, GridComponent, StepperComponent, TabgroupComponent, ButtonComponent, BadgeComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, FooterComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,ViewDetailsPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addDisposalNodeComponentPlan,editDisposalNodeComponentPlan,saveOneDialogPlan,saveTwoDialogPlan,addOffices,editOffices,addBGCDisposalNodeComponent],
+ declarations: [UiComponent, DateselectComponent, MenuComponent, CardComponent, ListComponent, GridComponent, StepperComponent, TabgroupComponent, ButtonComponent, BadgeComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, FooterComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,ViewDetailsPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addDisposalNodeComponentPlan,editDisposalNodeComponentPlan,saveOneDialogPlan,saveTwoDialogPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,ViewDetailsBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent,saveOneDialogBuilding,saveTwoDialogBuilding],
imports: [
CommonModule,
@@ -155,6 +158,7 @@ import { saveOneDialogPlan, saveTwoDialogPlan } from './collection-tools-plan/sa
exports:[
FooterComponent,
CollectionToolsComponent,
+ CollectionToolsBuildingComponent,
CollectionToolsPlanComponent
]
})