|
@@ -1,9 +1,9 @@
|
|
|
+import 'package:fis_lib_report/converts/alignment_convert.dart';
|
|
|
import 'package:fis_lib_report/pages/components/RDateTime.dart';
|
|
|
import 'package:fis_lib_report/pages/components/input_text.dart';
|
|
|
import 'package:fis_lib_report/pages/components/line.dart';
|
|
|
import 'package:fis_lib_report/pages/components/multi_select.dart';
|
|
|
import 'package:fis_lib_report/pages/components/static_Text.dart';
|
|
|
-import 'package:fis_lib_report/pages/helpler.dart';
|
|
|
import 'package:fis_lib_report/report/dateTimeElement.dart';
|
|
|
import 'package:fis_lib_report/report/element_type.dart';
|
|
|
import 'package:fis_lib_report/report/inputText.dart';
|
|
@@ -14,7 +14,6 @@ import 'package:fis_lib_report/report/multiSelected.dart';
|
|
|
import 'package:fis_lib_report/report/paragraph.dart';
|
|
|
import 'package:fis_lib_report/report/singleSelected.dart';
|
|
|
import 'package:fis_lib_report/report/staticText.dart';
|
|
|
-import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
class ParagraphPage extends StatefulWidget {
|
|
@@ -44,83 +43,95 @@ class _ParagraphState extends State<ParagraphPage> {
|
|
|
if (_itemCount == 0) {
|
|
|
return const SizedBox();
|
|
|
}
|
|
|
- return Row(
|
|
|
- mainAxisAlignment:
|
|
|
- widget.paragraph.horizontalAlignment == HorizontalLayout.Center
|
|
|
- ? MainAxisAlignment.center
|
|
|
- : MainAxisAlignment.start,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- ..._elements!.map((element) {
|
|
|
- if (element.elementType!.name == ElementType.inputText!.name) {
|
|
|
- InputText inputText = element as InputText;
|
|
|
- return RInputText(
|
|
|
- inputText: inputText,
|
|
|
- );
|
|
|
- } else if (element.elementType!.name ==
|
|
|
- ElementType.staticText!.name) {
|
|
|
- StaticText staticText = element as StaticText;
|
|
|
- return RStaticText(staticText);
|
|
|
- } else if (element.elementType!.name ==
|
|
|
- ElementType.singleSelected!.name) {
|
|
|
- SingleSelected singleSelected = element as SingleSelected;
|
|
|
+ final margin = widget.paragraph.margin!;
|
|
|
+ return Container(
|
|
|
+ margin: EdgeInsets.only(
|
|
|
+ top: margin.top!,
|
|
|
+ bottom: margin.bottom!,
|
|
|
+ left: margin.left!,
|
|
|
+ right: margin.right!,
|
|
|
+ ),
|
|
|
+ alignment: AlignmentConvert.verticalLayoutConvert(
|
|
|
+ widget.paragraph.verticalAlignment),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment:
|
|
|
+ widget.paragraph.horizontalAlignment == HorizontalLayout.Center
|
|
|
+ ? MainAxisAlignment.center
|
|
|
+ : MainAxisAlignment.start,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ ..._elements!.map((element) {
|
|
|
+ if (element.elementType!.name == ElementType.inputText!.name) {
|
|
|
+ InputText inputText = element as InputText;
|
|
|
+ return RInputText(
|
|
|
+ inputText: inputText,
|
|
|
+ );
|
|
|
+ } else if (element.elementType!.name ==
|
|
|
+ ElementType.staticText!.name) {
|
|
|
+ StaticText staticText = element as StaticText;
|
|
|
+ return RStaticText(staticText);
|
|
|
+ } else if (element.elementType!.name ==
|
|
|
+ ElementType.singleSelected!.name) {
|
|
|
+ SingleSelected singleSelected = element as SingleSelected;
|
|
|
+
|
|
|
+ List<String>? values = singleSelected.items;
|
|
|
|
|
|
- List<String>? values = singleSelected.items;
|
|
|
+ if (values != null && values.isNotEmpty) {
|
|
|
+ return SizedBox(
|
|
|
+ width: 104,
|
|
|
+ height: 28,
|
|
|
+ child: DropdownButton(
|
|
|
+ onChanged: (Object? value) {},
|
|
|
+ items: values.map<DropdownMenuItem<String>>((String value) {
|
|
|
+ return DropdownMenuItem<String>(
|
|
|
+ value: value,
|
|
|
+ child: Text(value),
|
|
|
+ );
|
|
|
+ }).toList(),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (element.elementType!.name == ElementType.line!.name) {
|
|
|
+ Line line = element as Line;
|
|
|
+ return RLine(line);
|
|
|
+ } else if (element.elementType!.name ==
|
|
|
+ ElementType.dateTime!.name) {
|
|
|
+ final dateTime = element as DateTimeElement;
|
|
|
+ return RDateTime(dateTime);
|
|
|
+ } else if (element.elementType!.name ==
|
|
|
+ ElementType.multiSelected!.name) {
|
|
|
+ final multiSelected = element as MultiSelected;
|
|
|
|
|
|
- if (values != null && values.isNotEmpty) {
|
|
|
+ List<String>? values = multiSelected.items;
|
|
|
return SizedBox(
|
|
|
- width: 104,
|
|
|
+ width: 120,
|
|
|
height: 28,
|
|
|
- child: DropdownButton(
|
|
|
- onChanged: (Object? value) {},
|
|
|
- items: values.map<DropdownMenuItem<String>>((String value) {
|
|
|
- return DropdownMenuItem<String>(
|
|
|
- value: value,
|
|
|
- child: Text(value),
|
|
|
- );
|
|
|
- }).toList(),
|
|
|
+ child: TextField(
|
|
|
+ cursorWidth: 0,
|
|
|
+ mouseCursor: SystemMouseCursors.click,
|
|
|
+ decoration: const InputDecoration(
|
|
|
+ suffixIcon: Icon(Icons.arrow_drop_down),
|
|
|
+ ),
|
|
|
+ onTap: () {
|
|
|
+ _showMultiSelect(values);
|
|
|
+ },
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
- } else if (element.elementType!.name == ElementType.line!.name) {
|
|
|
- Line line = element as Line;
|
|
|
- return RLine(line);
|
|
|
- } else if (element.elementType!.name == ElementType.dateTime!.name) {
|
|
|
- final dateTime = element as DateTimeElement;
|
|
|
- return RDateTime(dateTime);
|
|
|
- } else if (element.elementType!.name ==
|
|
|
- ElementType.multiSelected!.name) {
|
|
|
- final multiSelected = element as MultiSelected;
|
|
|
-
|
|
|
- List<String>? values = multiSelected.items;
|
|
|
- return SizedBox(
|
|
|
- width: 120,
|
|
|
- height: 28,
|
|
|
- child: TextField(
|
|
|
- cursorWidth: 0,
|
|
|
- mouseCursor: SystemMouseCursors.click,
|
|
|
- decoration: const InputDecoration(
|
|
|
- suffixIcon: Icon(Icons.arrow_drop_down),
|
|
|
- ),
|
|
|
- onTap: () {
|
|
|
- _showMultiSelect(values);
|
|
|
- },
|
|
|
- ),
|
|
|
+ return Container(
|
|
|
+ height: 30,
|
|
|
+ width: 80,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(
|
|
|
+ width: 0.5,
|
|
|
+ color: const Color.fromARGB(255, 83, 83, 83),
|
|
|
+ ),
|
|
|
+ color: Colors.grey[200]),
|
|
|
+ child: const Text('组件占位'),
|
|
|
);
|
|
|
- }
|
|
|
- return Container(
|
|
|
- height: 30,
|
|
|
- width: 80,
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border.all(
|
|
|
- width: 0.5,
|
|
|
- color: const Color.fromARGB(255, 83, 83, 83),
|
|
|
- ),
|
|
|
- color: Colors.grey[200]),
|
|
|
- child: const Text('组件占位'),
|
|
|
- );
|
|
|
- }),
|
|
|
- ],
|
|
|
+ }),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
|