| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- /* *********************************************************** */
- // 创建: Macheng 2025/09/13.
- // 修改: Macheng 2025/09/13
- // Description:
- // 该文件定义了 考勤单项 AttendItem。用于保存单人考勤数据。
- /* *********************************************************** */
- import BaseModel from './baseModel'
- class AttendItem extends BaseModel {
- id = 0 // 人员ID
- name = '' // 人员名称
- job = '' // 职位
- phone = '' // 电话
- tagId = 0 // 绑定标签地址
- rssi = 0 // 信号强度
- confirm = 0 // 0:缺岗,1:到岗
- tm = 0
- projId = 0
- locId = 0
- parent = null
- get isOnline() {
- return this.rssi != 0
- }
- constructor(opts) {
- if (!opts) opts = {}
- super(opts)
- this.init(opts)
- }
- init(opts) {
- if (!opts) opts = {}
- super.init(opts)
- this.id = Number(opts.id) || this.id
- this.name = opts.name || this.wifiLocalMaskname
- this.job = opts.job || this.job
- this.phone = opts.phone || this.phone
- this.tagId = Number(opts.tagId) || Number(opts.tagAddr) || this.tagId
- this.rssi = Number(opts.rssi) || this.rssi
- this.confirm = Number(opts.confirm) || this.confirm
- this.isEnable = opts.enable || opts.isEnable || false
- }
- toJson() {
- const obj1 = super.toJson()
- const obj2 = {
- id: this.id,
- name: this.name,
- job: this.job,
- phone: this.phone,
- tagId: this.tagId,
- tagAddr: this.tagAddr,
- rssi: this.rssi,
- confirm: this.confirm,
- }
- return Object.assign({}, obj1, obj2)
- }
- }
- export default AttendItem
|