123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import 'dart:convert';
- class ExcelDataItem {
- String value;
- String key;
- String? des;
- String? unit;
- String? identifier;
- String? referenceRange;
- ExcelDataItem({
- required this.value,
- required this.key,
- this.des,
- this.unit,
- this.identifier,
- this.referenceRange,
- });
- }
- class ExcelDataRecord {
- ///一条记录中的所有项,包含:值、单位、参考范围、描述等
- List<ExcelDataItem> excelDatas;
- ExcelDataRecord(this.excelDatas);
- String toJson(List<String> keys) {
- Map<String, String> formValues = {};
- var datas =
- excelDatas.where((element) => keys.contains(element.key)).toList();
- for (var d in datas) {
- formValues[d.key] = d.value;
- }
- return jsonEncode(formValues);
- }
- }
|