Browse Source

属性完善

dev
陈鹏飞 3 years ago
parent
commit
401d38c326
  1. 2
      src/app/babylon/controller/data-manager.ts
  2. 20
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-jyj.ts
  3. 20
      src/app/babylon/model/data/institution/facility/property-data/in/property-data-yg.ts
  4. 26
      src/app/pages/left-domain/left-domain.component.ts

2
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_4:
case FacilityType.XF_MHQ_GF_8: case FacilityType.XF_MHQ_GF_8:
case FacilityType.XF_MHQ_GF_35: result = new PropertyData_MHQ(key, facilityType); break; 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_YG: result = new PropertyData_YG(key); break;
case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break; case FacilityType.JY_SYGX: result = new PropertyData_SYGX(key); break;
case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break; case FacilityType.JY_YQHSGX: result = new PropertyData_YQHSGX(key); break;

20
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 { export class PropertyData_JYJ extends PropertyData_Base {
brand: string = ""; //品牌
superBrand: string = ""; //超大牌
constructor(key: string) { oilGunNum: string = ""; //油枪数量
super(key, FacilityType.JY_JYJ); 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) { 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; return result;
} }

20
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 { export class PropertyData_YG extends PropertyData_Base {
constructor(key: string) { oilProductNo: string = ""; //油品品号
super(key, FacilityType.JY_YG); oilTankVolume: string = ""; //油罐容积
safeVolume: string = ""; //安全容积
quantity: string = ""; //数量
tankFarm: string = ""; //罐区
oilTankType: string = ""; //油罐类型
} constructor(key: string) {
super(key, FacilityType.JY_YG);
}
clone(key: string) { clone(key: string) {
let result = new PropertyData_YG(key); let result = new PropertyData_YG(key);
return result; return result;
} }
} }

26
src/app/pages/left-domain/left-domain.component.ts

@ -19,6 +19,7 @@ export class LeftDomainComponent implements OnInit {
this.initComponent() this.initComponent()
} }
editModel: boolean = true; //编辑/查看模式
beforeFence: number; //当前选中功能栏 beforeFence: number; //当前选中功能栏
FacilityList: FacilityInfoUIItem[] = []; //统计设备 list FacilityList: FacilityInfoUIItem[] = []; //统计设备 list
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
@ -48,6 +49,7 @@ export class LeftDomainComponent implements OnInit {
} }
}) })
this.FacilityList = list this.FacilityList = list
console.log(this.FacilityList,this.FacilityList[0].getPropertyData(),'筛选设备')
if (this.beforeFence === 3) { //消防设施 if (this.beforeFence === 3) { //消防设施
this.handleTreeData(this.FacilityList) 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 (this.editModel) {
if (!isFind) { let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' })
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, } if (!isFind) {
this.treeData.push(primaryNode) 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')) { for (let facility in FacilityType) {
let isFind = this.treeData.find(item=>{ return item.key === facility }) if (facility.slice(0,3) === "XF_" && !facility.includes('XF_MHQ')) {
if (!isFind) { let isFind = this.treeData.find(item=>{ return item.key === facility })
let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, } if (!isFind) {
this.treeData.push(primaryNode) let primaryNode = { title: ConfigManager.getFacilityTypeName(FacilityType[facility]), key: facility, selectable: false, }
this.treeData.push(primaryNode)
}
} }
} }
} }

Loading…
Cancel
Save