|
@@ -1,7 +1,9 @@
|
|
|
import 'package:fis_lib_report/converts/pt_to_px_converter.dart';
|
|
|
import 'package:fis_lib_report/converts/text_size_converter.dart';
|
|
|
import 'package:fis_lib_report/converts/alignment_convert.dart';
|
|
|
+import 'package:fis_lib_report/report/element_tag.dart';
|
|
|
import 'package:fis_lib_report/report/inputText.dart';
|
|
|
+import 'package:fis_lib_report/report_info/element_tag_names.dart';
|
|
|
import 'package:fis_lib_report/report_info/input_text_info.dart';
|
|
|
import 'package:fis_lib_report/report_info/report_info.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -63,35 +65,65 @@ class _RInputTextState extends State<RInputText> {
|
|
|
} catch (e) {
|
|
|
print(e);
|
|
|
}
|
|
|
- return Container(
|
|
|
- //constraints: BoxConstraints(minWidth: _lineWidth!, maxWidth: 480),
|
|
|
- width: _lineWidth,
|
|
|
- height: _textWrap! ? _height! * 4 : (_height! - 2),
|
|
|
- padding: const EdgeInsets.only(right: 5, left: 5),
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border.all(
|
|
|
- width: 1,
|
|
|
- color: _isReadOnly ? Colors.transparent : Colors.grey,
|
|
|
+ return Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ width: _lineWidth,
|
|
|
+ height: _textWrap! ? _height! * 4 : (_height! - 2),
|
|
|
+ padding: const EdgeInsets.only(right: 5, left: 5),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border.all(
|
|
|
+ width: 1,
|
|
|
+ color: _isReadOnly ? Colors.transparent : Colors.grey,
|
|
|
+ ),
|
|
|
+ color: _backgroundColor,
|
|
|
+ ),
|
|
|
+ child: TextField(
|
|
|
+ focusNode: _focusNode,
|
|
|
+ readOnly: _isReadOnly,
|
|
|
+ decoration: null,
|
|
|
+ textAlignVertical: AlignmentConvert.verticalAlignmentConvert(
|
|
|
+ widget.inputText.verticalAlignment),
|
|
|
+ minLines: 1,
|
|
|
+ maxLines: _textWrap! ? 6 : 1,
|
|
|
+ controller: _controller,
|
|
|
+ textAlign: TextAlign.start,
|
|
|
+ style: _textStyle,
|
|
|
+ onChanged: (v) {
|
|
|
+ // _onInputChanged(_textStyle!, v);
|
|
|
+ },
|
|
|
+ onEditingComplete: () {
|
|
|
+ _onInputChanged(_textStyle!, _controller.text);
|
|
|
+ }),
|
|
|
),
|
|
|
- color: _backgroundColor,
|
|
|
- ),
|
|
|
- child: TextField(
|
|
|
- focusNode: _focusNode,
|
|
|
- readOnly: _isReadOnly,
|
|
|
- decoration: null,
|
|
|
- textAlignVertical: AlignmentConvert.verticalAlignmentConvert(
|
|
|
- widget.inputText.verticalAlignment),
|
|
|
- minLines: 1,
|
|
|
- maxLines: _textWrap! ? 6 : 1,
|
|
|
- controller: _controller,
|
|
|
- textAlign: TextAlign.start,
|
|
|
- style: _textStyle,
|
|
|
- onChanged: (v) {
|
|
|
- // _onInputChanged(_textStyle!, v);
|
|
|
- },
|
|
|
- onEditingComplete: () {
|
|
|
- _onInputChanged(_textStyle!, _controller.text);
|
|
|
- }),
|
|
|
+ const SizedBox(height: 5),
|
|
|
+ if (_inputTextInfo!.tag != null &&
|
|
|
+ _inputTextInfo!.tag!.elementTagType ==
|
|
|
+ ElementTagType.DiagnosticEntry) ...[
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ children: [
|
|
|
+ ElevatedButton(
|
|
|
+ onPressed: () {
|
|
|
+ ReportInfo.instance.onDiagnosticTap
|
|
|
+ .emit(this, _inputTextInfo!.tag!.name ?? '');
|
|
|
+ },
|
|
|
+ child: const Text('选择词条'),
|
|
|
+ ),
|
|
|
+ const SizedBox(width: 10),
|
|
|
+ ElevatedButton(
|
|
|
+ onPressed: () {
|
|
|
+ setState(() {
|
|
|
+ _inputTextInfo!.text = '';
|
|
|
+ });
|
|
|
+ },
|
|
|
+ child: const Text('撤销'),
|
|
|
+ ),
|
|
|
+ const SizedBox(width: 5),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ],
|
|
|
);
|
|
|
}
|
|
|
|