/* *********************************************************** */ // 创建: Macheng 2019/09/05. // 修改: Macheng 2019/09/05 // Description: // 该文件定义了报警类Alarm。用于保存报警数据。 /* *********************************************************** */ import BaseModel from './baseModel' class Alarm extends BaseModel { id = 0 // 报警编号 beginTime = 0 // 报警起始时间 endTime = 0 // 报警结束时间 srcType = 0 // 报警源类型 0:标签, 1:基站 srcId = 0 // 报警源ID 当srcType==0时表示标签的地址,当srcType==0时表示基站的地址 buildingId = 0 // 报警所在建筑ID buildingName = '' // 报警所在建筑名称 floorId = 0 // 报警所在层级 ID floorName = '' // 报警所在层级名称 areaId = 0 // 报警所在区域ID areaName = '' // 报警所在区域名称 x = 0 // 报警所在坐标X y = 0 // 报警所在坐标Y z = 0 // 报警所在坐标Z type = 0 // 报警类型 //报警发生人员相关信息(现场) playerId = 0 // 报警人员ID,当srcType==0时有效 playerName = '' // 报警人员名称 majorName = '' // 报警人员专业名称 depId = 0 // 报警人员部门ID depName = '' // 报警人员部门名称 //报警确认人员相关信息(监控) confirmTime = 0 // 报警确认时间 confirmPlayerId = 0 // 报警确认人员ID confirmPlayerName = '' // 报警确认人员名称 confirmMajorName = '' // 报警确认人员专业名称 confirmDepId = 0 // 报警确认人员部门ID confirmDepName = '' // 报警确认人员部门名称 constructor(opts) { if (!opts) opts = {} super(opts) this.init(opts) } init(opts) { if (!opts) opts = {} super.init(opts) this.id = Number(opts['id']) || 0 this.beginTime = Number(opts['beginTime']) || 0 this.endTime = Number(opts['endTime']) || 0 this.srcType = Number(opts['srcType']) || 0 this.srcId = Number(opts['srcId']) || 0 this.buildingId = Number(opts['buildingId']) || 0 this.buildingName = opts['buildingName'] || '' this.floorId = Number(opts['floorId']) || 0 this.floorName = opts['floorName'] || '' this.areaId = Number(opts['areaId']) || 0 this.areaName = opts['areaName'] || '' this.x = Number(opts['x']) || 0 this.y = Number(opts['y']) || 0 this.z = Number(opts['z']) || 0 this.type = Number(opts['type']) || 0 this.playerId = Number(opts['playerId']) || 0 this.playerName = opts['playerName'] || '' this.majorName = opts['majorName'] || '' this.depId = Number(opts['depId']) || 0 this.depName = opts['depName'] || '' this.confirmTime = Number(opts['confirmTime']) || 0 this.confirmPlayerId = Number(opts['confirmPlayerId']) || 0 this.confirmPlayerName = opts['confirmPlayerName'] || '' this.confirmMajorName = opts['confirmMajorName'] || '' this.confirmDepId = Number(opts['confirmDepId']) || 0 this.confirmDepName = opts['confirmDepName'] || '' } toJson() { const obj1 = super.toJson() const obj2 = { id: this.id, beginTime: this.beginTime, endTime: this.endTime, srcType: this.srcType, srcId: this.srcId, buildingId: this.buildingId, buildingName: this.buildingName, floorId: this.floorId, floorName: this.floorName, areaId: this.areaId, areaName: this.areaName, x: this.x, y: this.y, z: this.z, type: this.type, playerId: this.playerId, playerName: this.playerName, majorName: this.majorName, depId: this.depId, depName: this.depName, confirmTime: this.confirmTime, confirmPlayerId: this.confirmPlayerId, confirmPlayerName: this.confirmPlayerName, confirmMajorName: this.confirmMajorName, confirmDepId: this.confirmDepId, confirmDepName: this.confirmDepName } return Object.assign({}, obj1, obj2) } } export default Alarm