From 401d38c3263b1c9b24b964fe11a92bc1f04797bf Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Fri, 12 Nov 2021 09:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/controller/data-manager.ts | 2 +- .../property-data/in/property-data-jyj.ts | 20 +++++++++----- .../property-data/in/property-data-yg.ts | 20 +++++++++----- .../left-domain/left-domain.component.ts | 26 +++++++++++-------- 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/app/babylon/controller/data-manager.ts b/src/app/babylon/controller/data-manager.ts index 8d784f4..aed716a 100644 --- a/src/app/babylon/controller/data-manager.ts +++ b/src/app/babylon/controller/data-manager.ts @@ -443,7 +443,7 @@ export class DataManager { case FacilityType.XF_MHQ_GF_4: case FacilityType.XF_MHQ_GF_8: case FacilityType.XF_MHQ_GF_35: result = new PropertyData_MHQ(key, facilityType); break; - case FacilityType.JY_JYJ: result = new PropertyData_JYJ(key); break; + case FacilityType.JY_JYJ: result = new PropertyData_JYJ(key,"", "","", "","",); break; case FacilityType.JY_YG: result = new PropertyData_YG(key); break; case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break; case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break; diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts index 1455610..43fdad7 100644 --- a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts +++ b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts @@ -7,15 +7,23 @@ import { PropertyData_Base } from "../property-data-base"; */ export class PropertyData_JYJ extends PropertyData_Base { - - - constructor(key: string) { - super(key, FacilityType.JY_JYJ); - + brand: string = ""; //品牌 + superBrand: string = ""; //超大牌 + oilGunNum: string = ""; //油枪数量 + oilProductNo: string = ""; //油品品号 + oilPumpType: string = ""; //油泵类型 + + constructor(key: string,brand: string,superBrand: string,oilGunNum: string,oilProductNo: string,oilPumpType: string) { + super(key, FacilityType.JY_JYJ); + this.brand = brand + this.superBrand = superBrand + this.oilGunNum = oilGunNum + this.oilProductNo = oilProductNo + this.oilPumpType = oilPumpType } clone(key: string) { - let result = new PropertyData_JYJ(key); + let result = new PropertyData_JYJ(key,this.brand,this.superBrand,this.oilGunNum,this.oilProductNo,this.oilPumpType); return result; } diff --git a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts index a495585..c0b1888 100644 --- a/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts +++ b/src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts @@ -7,14 +7,20 @@ import { PropertyData_Base } from "../property-data-base"; */ export class PropertyData_YG extends PropertyData_Base { - constructor(key: string) { - super(key, FacilityType.JY_YG); + oilProductNo: string = ""; //油品品号 + oilTankVolume: string = ""; //油罐容积 + safeVolume: string = ""; //安全容积 + quantity: string = ""; //数量 + tankFarm: string = ""; //罐区 + oilTankType: string = ""; //油罐类型 - } + constructor(key: string) { + super(key, FacilityType.JY_YG); + } - clone(key: string) { - let result = new PropertyData_YG(key); - return result; - } + clone(key: string) { + let result = new PropertyData_YG(key); + return result; + } } \ No newline at end of file diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index cf9afca..71bc4be 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -19,6 +19,7 @@ export class LeftDomainComponent implements OnInit { this.initComponent() } + editModel: boolean = true; //编辑/查看模式 beforeFence: number; //当前选中功能栏 FacilityList: FacilityInfoUIItem[] = []; //统计设备 list @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; @@ -48,6 +49,7 @@ export class LeftDomainComponent implements OnInit { } }) this.FacilityList = list + console.log(this.FacilityList,this.FacilityList[0].getPropertyData(),'筛选设备') if (this.beforeFence === 3) { //消防设施 this.handleTreeData(this.FacilityList) } @@ -76,17 +78,19 @@ export class LeftDomainComponent implements OnInit { } }) //编辑模式 - let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' }) - if (!isFind) { - let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, } - this.treeData.push(primaryNode) - } - for (let facility in FacilityType) { - if (facility.slice(0,3) === "XF_" && !facility.includes('XF_MHQ')) { - let isFind = this.treeData.find(item=>{ return item.key === facility }) - if (!isFind) { - let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, } - this.treeData.push(primaryNode) + if (this.editModel) { + let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' }) + if (!isFind) { + let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, } + this.treeData.push(primaryNode) + } + for (let facility in FacilityType) { + if (facility.slice(0,3) === "XF_" && !facility.includes('XF_MHQ')) { + let isFind = this.treeData.find(item=>{ return item.key === facility }) + if (!isFind) { + let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, } + this.treeData.push(primaryNode) + } } } }