12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import 'package:fis_lib_report/report/cellPostion.dart';
- import 'package:fis_lib_report/report/element_type.dart';
- import 'package:fis_lib_report/report/interfaces/cell.dart';
- import 'package:fis_lib_report/report/interfaces/grid.dart';
- import 'package:fis_lib_report/report/interfaces/report_element.dart';
- import 'package:fis_lib_report/report/rt_table.dart';
- import 'package:fis_lib_report/report_info/block_element_info_interface.dart';
- import 'package:fis_lib_report/report_info/element_info.dart';
- import 'package:fis_lib_report/report_info/rt_cell_info.dart';
- class RTGridInfo extends ElementInfo {
- @override
- List<RTColumnDefinition>? columnDefinitions = [];
- @override
- List<RTRowDefinition>? rowDefinitions = [];
- bool? isDelete;
- bool? isInsertColumn;
- int? deleteRowIndex;
- int? deleteColumnIndex;
- bool? isMergeCell;
- int? mergeDeleteStartColumnIndex;
- int? mergeDeleteEndColumnIndex;
- Map<CellPostion, RTCellInfo>? cells = {};
- RTGridInfo.fromElement(RTTable table) : super.fromElement(table) {
- columnDefinitions = table.columnDefinitions;
- rowDefinitions = table.rowDefinitions;
- isDelete = table.isDelete;
- isInsertColumn = table.isInsertColumn;
- deleteRowIndex = table.deleteColumnIndex;
- deleteColumnIndex = table.deleteColumnIndex;
- isMergeCell = table.isMergeCell;
- mergeDeleteStartColumnIndex = table.mergeDeleteStartColumnIndex;
- mergeDeleteEndColumnIndex = table.mergeDeleteEndColumnIndex;
- table.cells!.forEach((key, value) {
- cells![key] = RTCellInfo.fromElement(value);
- });
- }
- @override
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- map.addAll(super.toJson());
- final blockInfos = [];
- cells!.forEach((key, value) {
- blockInfos.add(key.toJson());
- blockInfos.add(value.toJson());
- });
- map['Cells'] = blockInfos;
- return map;
- }
- }
|