|
@@ -187,6 +187,21 @@ class UserState extends StateModuleBase {
|
|
|
}
|
|
|
},
|
|
|
);
|
|
|
+ map.pickPersistentProp('selectPatientInfo', (x) {
|
|
|
+ if (x != null) {
|
|
|
+ _updateSelectPatientInfo(PatientDTO.fromJson(x));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map.pickPersistentProp('menuPermissionList', (x) {
|
|
|
+ if (x != null) {
|
|
|
+ _updateMenuPermissionList((x as List).cast<UserFeatureDTO>());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map.pickPersistentProp('operationPermissionList', (x) {
|
|
|
+ if (x != null) {
|
|
|
+ _updateOperationPermissionList((x as List).cast<UserFeatureDTO>());
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@override
|
|
@@ -199,11 +214,26 @@ class UserState extends StateModuleBase {
|
|
|
"displayName": displayName,
|
|
|
"userInfo": _userInfo,
|
|
|
"features": _features,
|
|
|
+ "selectPatientInfo": _currentSelectPatientInfo,
|
|
|
+ "menuPermissionList": _menuPermissionList,
|
|
|
+ "operationPermissionList": _operationPermissionList,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- void _updateFeatures(Iterable<String> keys) {
|
|
|
- _features.value = List.unmodifiable(keys);
|
|
|
+ void _updateFeatures(Iterable<String> features) {
|
|
|
+ _features.value = List.unmodifiable(features);
|
|
|
+ }
|
|
|
+
|
|
|
+ void _updateMenuPermissionList(Iterable<UserFeatureDTO> permissionList) {
|
|
|
+ _menuPermissionList.value = List.unmodifiable(permissionList);
|
|
|
+ }
|
|
|
+
|
|
|
+ void _updateOperationPermissionList(Iterable<UserFeatureDTO> permissionList) {
|
|
|
+ _operationPermissionList.value = List.unmodifiable(permissionList);
|
|
|
+ }
|
|
|
+
|
|
|
+ void _updateSelectPatientInfo(PatientDTO patient) {
|
|
|
+ _currentSelectPatientInfo.value = patient;
|
|
|
}
|
|
|
|
|
|
void _clearFeatures() => _features.value = [];
|