import 'package:flyinsono/pages/organization/org_info/state.dart';
import 'package:get/get.dart';

class UserProfileState {
  final Rx<String> _userCode = Rx('');
  final Rx<String> _depShortCode = Rx('');
  final Rx<bool> _isTitleReadOnly = Rx(false);
  final Rx<String> _fullname = Rx('');
  final Rx<String> _userName = Rx('');
  final Rx<String> _displayName = Rx('');
  final Rx<String> _phone = Rx('');
  final Rx<String> _email = Rx('');
  final Rx<String> _nickName = Rx('');
  final Rx<String> _department = Rx('');
  final Rx<String> _postIdentity = Rx('');
  final Rx<String> _title = Rx('');
  final Rx<String?> _hospitalCode = Rx(null);
  final Rx<String?> _depCode = Rx(null);
  final RxString _orgShortCode = RxString('');
  final Rx<List<OrgModel>> _depOptions = Rx(<OrgModel>[]);
  final Rx<List<OrgModel>> _orgOptions = Rx(<OrgModel>[]);
  final RxString _orgName = RxString('');

  int pageIndex = 1;

  ///医院名称
  String get orgName => _orgName.value;
  set orgName(String v) => _orgName.value = v;

  ///医院短码
  String get orgShortCode => _orgShortCode.value;
  set orgShortCode(String val) => _orgShortCode.value = val;

  ///用户Code
  String get userCode => _userCode.value;
  set userCode(String val) => _userCode.value = val;

  ///用户全名
  String get fullName => _fullname.value;
  set fullName(String val) => _fullname.value = val;

  ///用户姓名
  String get userName => _userName.value;
  set userName(String val) => _userName.value = val;

  ///展示用名字
  String get displayName => _displayName.value;
  set displayName(String val) => _displayName.value = val;

  ///手机号
  String get phone => _phone.value;
  set phone(String val) => _phone.value = val;

  ///邮箱
  String get email => _email.value;
  set email(String val) => _email.value = val;

  ///昵称
  String get nickName => _nickName.value;
  set nickName(String val) => _nickName.value = val;

  ///部门
  String get department => _department.value;
  set department(String val) => _department.value = val;

  ///岗位身份
  String get postIdentity => _postIdentity.value;
  set postIdentity(String val) => _postIdentity.value = val;

  bool get isTitleReadOnly => _isTitleReadOnly.value;
  set isTitleReadOnly(bool value) => _isTitleReadOnly(value);

  ///职称
  String get title => _title.value;
  set title(String val) => _title.value = val;

  /// 部门ShortCode
  String get depShortCode => _depShortCode.value;
  set depShortCode(String val) => _depShortCode.value = val;

  /// 医院 code
  String? get hospitalCode => _hospitalCode.value;
  set hospitalCode(String? val) =>
      _hospitalCode.value = (val?.isEmpty == true) ? null : val;

  /// 部门选项集合
  set depOptions(List<OrgModel> value) => _depOptions(value);
  List<OrgModel> get depOptions => _depOptions.value;
}
