123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import 'package:fis_jsonrpc/services/vitalContractRecord.m.dart';
- import 'package:get/get.dart';
- import 'package:vitalapp/architecture/defines.dart';
- import 'package:vitalapp/global.dart';
- import 'package:vitalapp/managers/interfaces/models/patient_model_dto.dart';
- import 'package:vitalapp/pages/controllers/paged_state_mixin.dart';
- class PatientListState with PagedStateMixin<PatientModelDTO> {
- static int _statisticTotalCountCache = 0;
- static int _statisticTodayCountCache = 0;
- PatientListState() {
- if (!kIsOnline) {
- _statisticTotalCount.value = _statisticTotalCountCache;
- _statisticTodayCount.value = _statisticTodayCountCache;
- }
- }
- final _now = DateTime.now();
- final RxInt _currentTabIndex = RxInt(0);
- final RxList<String> _offlineCodes = RxList<String>();
- final RxInt _statisticTotalCount = RxInt(0);
- final RxInt _statisticTodayCount = RxInt(0);
- final RxInt _selectBoxFilterFounder = RxInt(0);
- final Rx<ContractStateEnum?> _contractStateSelectedItem =
- Rx<ContractStateEnum?>(null);
- ContractStateEnum? get contractStateSelectedItem =>
- _contractStateSelectedItem.value;
- set contractStateSelectedItem(ContractStateEnum? val) =>
- _contractStateSelectedItem.value = val;
- int get selectBoxFilterFounder => _selectBoxFilterFounder.value;
- set selectBoxFilterFounder(int val) =>
- _selectBoxFilterFounder.updateValue(val);
- int get currentTabIndex => _currentTabIndex.value;
- set currentTabIndex(int val) => _currentTabIndex.updateValue(val);
- /// 离线code列表
- List<String> get offlineCodes => _offlineCodes.toList();
- set offlineCodes(List<String> val) => _offlineCodes.value = val;
- /// 离线数量
- int get offlineCount => offlineCodes.length;
- /// 查询结果总数
- int get queryResultTotalCount => offlineCount + totalCount;
- /// 居民总数
- int get statisticTotalCount => _statisticTotalCount.value;
- set statisticTotalCount(int val) {
- _statisticTotalCount.updateValue(val);
- _statisticTotalCountCache = val;
- }
- /// 今日新增数
- int get statisticTodayCount => _statisticTodayCount.value;
- set statisticTodayCount(int val) {
- _statisticTodayCount.updateValue(val);
- _statisticTodayCountCache = val;
- }
- late Rx<DateTime?> startTime =
- DateTime(_now.year - 1, _now.month, _now.day).obs; // >= 1年前00:00:00
- late Rx<DateTime?> endTime =
- DateTime(_now.year, _now.month, _now.day).obs; // < 第二天00:00:00
- }
|