rt_table_info.dart 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:fis_lib_report/report/element_type.dart';
  2. import 'package:fis_lib_report/report/interfaces/report_element.dart';
  3. import 'package:fis_lib_report/report/rt_table.dart';
  4. import 'package:fis_lib_report/report_info/block_element_info_interface.dart';
  5. import 'package:fis_lib_report/report_info/element_info.dart';
  6. import 'package:fis_lib_report/report_info/rt_grid.dart';
  7. class RTTableInfo extends RTGridInfo implements IBlockElementInfo {
  8. bool? autoHide;
  9. bool? isAverageColumnWidth;
  10. bool? allowBreakAcrossPages;
  11. bool allowEmptyCell = false;
  12. @override
  13. List<ElementInfo>? elementInfos;
  14. RTTableInfo() : super();
  15. RTTableInfo.fromElement(
  16. RTTable table, {
  17. this.allowEmptyCell = false,
  18. }) : super.fromElement(table) {
  19. autoHide = table.autoHide;
  20. isAverageColumnWidth = table.isAverageColumnWidth;
  21. allowBreakAcrossPages = table.allowBreakAcrossPages;
  22. }
  23. @override
  24. Map<String, dynamic> toJson() {
  25. final map = <String, dynamic>{};
  26. map.addAll(super.toJson());
  27. return map;
  28. }
  29. /// 深拷贝方法
  30. RTTableInfo clone() {
  31. final tableInfo = RTTableInfo();
  32. tableInfo.elementType = elementType;
  33. tableInfo.index = index;
  34. tableInfo.measureTag = measureTag;
  35. tableInfo.parent = parent;
  36. tableInfo.tag = tag;
  37. tableInfo.id = id;
  38. tableInfo.element = element;
  39. tableInfo.columnDefinitions = columnDefinitions;
  40. tableInfo.rowDefinitions = rowDefinitions;
  41. tableInfo.isDelete = isDelete;
  42. tableInfo.isInsertColumn = isInsertColumn;
  43. tableInfo.deleteRowIndex = deleteRowIndex;
  44. tableInfo.deleteColumnIndex = deleteColumnIndex;
  45. tableInfo.isMergeCell = isMergeCell;
  46. tableInfo.mergeDeleteStartColumnIndex = mergeDeleteStartColumnIndex;
  47. tableInfo.mergeDeleteEndColumnIndex = mergeDeleteEndColumnIndex;
  48. tableInfo.cells = cells;
  49. tableInfo.autoHide = autoHide;
  50. tableInfo.isAverageColumnWidth = isAverageColumnWidth;
  51. tableInfo.allowBreakAcrossPages = allowBreakAcrossPages;
  52. tableInfo.elementInfos = elementInfos;
  53. return tableInfo;
  54. }
  55. }