import 'package:fis_jsonrpc/rpc.dart';
import 'package:get/get.dart' hide Node;
import 'package:fis_ui/widgets/tree/flutter_treeview/lib/flutter_treeview.dart';

class LaboratoryState {
  final _templateFileUrl = Rx('');
  final Rx<int> _selectIndex = Rx(0);
  final Rx<LabUploadTypeEnum> _currentUploadMethod =
      Rx(LabUploadTypeEnum.DirectUpload);
  final Rx<bool> _currentComprehensiveImageAnalysis = Rx(false);
  final Rx<bool> _currentImageAnalysisAlone = Rx(true);
  final Rx<String> _currentImageFolderName = Rx('');
  final Rx<List<Node<LabFolderDTO>>> _caseAnalysis = Rx([]);
  final Rx<String> _selectedKey = Rx('');
  final Rx<List<RemedicalInfoDTO>> _imageList = Rx([]);
  final Rx<List<FileUploadInfoDTO>> _fileUploadInfos = Rx([]);

  set templateFileUrl(value) => _templateFileUrl.value = value;
  get templateFileUrl => _templateFileUrl.value;

  /// tab的下标
  int get selectIndex => _selectIndex.value;
  set selectIndex(int val) => _selectIndex.value = val;

  /// 当前上传方式
  LabUploadTypeEnum get currentUploadMethod => _currentUploadMethod.value;
  set currentUploadMethod(LabUploadTypeEnum val) =>
      _currentUploadMethod.value = val;

  /// 图像综合分析
  bool get currentComprehensiveImageAnalysis =>
      _currentComprehensiveImageAnalysis.value;
  set currentComprehensiveImageAnalysis(bool val) =>
      _currentComprehensiveImageAnalysis.value = val;

  /// 图像单独分析
  bool get currentImageAnalysisAlone => _currentImageAnalysisAlone.value;
  set currentImageAnalysisAlone(bool val) =>
      _currentImageAnalysisAlone.value = val;

  /// 图像文件夹名称
  String get currentImageFolderName => _currentImageFolderName.value;
  set currentImageFolderName(String val) => _currentImageFolderName.value = val;

  /// 图像文件夹树形结构
  List<Node<LabFolderDTO>> get caseAnalysis => _caseAnalysis.value;
  set caseAnalysis(List<Node<LabFolderDTO>> val) => _caseAnalysis.value = val;

  /// 当前选中的项
  String get selectedKey => _selectedKey.value;
  set selectedKey(String val) => _selectedKey.value = val;

  /// 上传的文件
  List<FileUploadInfoDTO> get fileUploadInfos => _fileUploadInfos.value;
  set fileUploadInfos(List<FileUploadInfoDTO> val) =>
      _fileUploadInfos.value = val;

  /// 图像列表
  List<RemedicalInfoDTO> get imageList => _imageList.value;
  set imageList(List<RemedicalInfoDTO> val) => _imageList.value = val;
}
