exam_info.dart 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import 'package:fis_common/event/event_type.dart';
  2. /// 检查信息
  3. class ExamInfo {
  4. int _selectedImageIndex = -1;
  5. /// 检查编号
  6. final String code;
  7. /// 检查图像集合
  8. List<ExamImageInfo> images = [];
  9. ExamInfo(this.code);
  10. /// 选中图像索引
  11. int get selectedImageIndex => _selectedImageIndex;
  12. set selectedImageIndex(int value) {
  13. if (value != _selectedImageIndex) {
  14. _selectedImageIndex = value;
  15. selectedImageChanged.emit(this, value);
  16. }
  17. }
  18. /// 当前选中图像
  19. ExamImageInfo get selectedImage => images[selectedImageIndex];
  20. /// 图像选中变化事件
  21. final selectedImageChanged = FEventHandler<int>();
  22. }
  23. /// 检查图像信息
  24. class ExamImageInfo {
  25. /// 图像文件链接
  26. final String url;
  27. /// 预览图链接
  28. final String previewUrl;
  29. /// 图像code
  30. final String? remedicalCode;
  31. ExamImageInfo(
  32. this.url,
  33. this.previewUrl, {
  34. this.remedicalCode,
  35. });
  36. }