|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
|
import 'package:aku_community_manager/utils/weekdays_to_chinese.dart';
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class ClockRecordListModel {
|
|
|
|
|
int? id;
|
|
|
|
@ -10,6 +12,7 @@ class ClockRecordListModel {
|
|
|
|
|
String? clockName;
|
|
|
|
|
String? clockTel;
|
|
|
|
|
String? createDate;
|
|
|
|
|
int? status;
|
|
|
|
|
|
|
|
|
|
ClockRecordListModel(
|
|
|
|
|
{required this.id,
|
|
|
|
@ -19,6 +22,7 @@ class ClockRecordListModel {
|
|
|
|
|
this.operatorName,
|
|
|
|
|
this.clockName,
|
|
|
|
|
this.clockTel,
|
|
|
|
|
this.status,
|
|
|
|
|
this.createDate});
|
|
|
|
|
|
|
|
|
|
ClockRecordListModel.fromJson(Map<String, dynamic> json) {
|
|
|
|
@ -30,6 +34,7 @@ class ClockRecordListModel {
|
|
|
|
|
clockName = json['clockName'];
|
|
|
|
|
clockTel = json['clockTel'];
|
|
|
|
|
createDate = json['createDate'];
|
|
|
|
|
status = json['status'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
@ -42,6 +47,7 @@ class ClockRecordListModel {
|
|
|
|
|
data['clockName'] = this.clockName;
|
|
|
|
|
data['clockTel'] = this.clockTel;
|
|
|
|
|
data['createDate'] = this.createDate;
|
|
|
|
|
data['status'] = this.status;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -55,4 +61,29 @@ class ClockRecordListModel {
|
|
|
|
|
DateUtil.formatDateStr(this.createDate ?? '', format: 'yyyy.MM.dd');
|
|
|
|
|
String get weekDay => WeekDaysToChinese.fromInt(
|
|
|
|
|
DateUtil.getDateTime(this.createDate ?? '')?.weekday ?? 0);
|
|
|
|
|
String get statusString {
|
|
|
|
|
switch (this.status) {
|
|
|
|
|
case 1:
|
|
|
|
|
return '节假日';
|
|
|
|
|
case 2:
|
|
|
|
|
return '工作日';
|
|
|
|
|
case 3:
|
|
|
|
|
return '休息日';
|
|
|
|
|
default:
|
|
|
|
|
return '未知';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Color get statusColor {
|
|
|
|
|
switch (this.status) {
|
|
|
|
|
case 1:
|
|
|
|
|
return Colors.red;
|
|
|
|
|
case 2:
|
|
|
|
|
return kTextSubColor;
|
|
|
|
|
case 3:
|
|
|
|
|
return kPrimaryColor;
|
|
|
|
|
default:
|
|
|
|
|
return Colors.redAccent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|