/* *********************************************************** */ // 创建: Macheng 2019/09/05. // 修改: Macheng 2019/09/05 // Description: // 该文件定义了标记类Sign。用于保存报警数据。 /* *********************************************************** */ import BaseModel from './baseModel' class Sign extends BaseModel { id = 0 // 编号 lat = 0 // 纬度 lng = 0 // 经度 mainType = 0 // 类型 mode = 0 // 模式 nmManage = '' // 主管单位名称 nmOwn = '' // 权属单位名称 nmMaintain = '' // 养护单位名称 grid = '' // 所属单元网格 status = 0 // 状态 0:完好,1:预设,2:维护,3:废弃 recorderId = 0 // 记录员Id recorderName = '' // 记录员名称 phone = '' // 联系电话 mat = '' // 材质 spec = '' // 规格 createTime = '' // 创建时间 memo = '' // 备注 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.lat = Number(opts['lat']) || 0 this.lng = Number(opts['lng']) || 0 this.mainType = Number(opts['mainType']) || 0 this.mode = Number(opts['mode']) || 0 this.nmManage = opts['nmManage'] || '' this.nmOwn = opts['nmOwn'] || '' this.nmMaintain = opts['nmMaintain'] || '' this.grid = opts['grid'] || '' this.status = Number(opts['status']) || 0 this.recorderId = Number(opts['recorderId']) || 0 this.recorderName = opts['recorderName'] || '' this.phone = opts['phone'] || '' this.mat = opts['mat'] || '' this.spec = opts['spec'] || '' this.createTime = opts['createTime'] || '' this.memo = opts['memo'] || '' } get x() { return this.lng } get y() { return this.lat } toJson() { const obj1 = super.toJson() const obj2 = { id: this.id, lat: this.lat, lng: this.lng, mainType: this.mainType, mode: this.mode, nmManage: this.nmManage, nmOwn: this.nmOwn, nmMaintain: this.nmMaintain, grid: this.grid, status: this.status, recorderId: this.recorderId, recorderName: this.recorderName, phone: this.phone, mat: this.mat, spec: this.spec, createTime: this.createTime, memo: this.memo } return Object.assign({}, obj1, obj2) } } export default Sign