import 'package:fis_common/event/event_type.dart'; class FormInfo { static FormInfo? _reportInfo; ///需要提交到Server的表单值 Map _formValue = {}; FormInfo._internal(); ///ReportInfo全局单例 static FormInfo get instance { _reportInfo ??= FormInfo._internal(); return _reportInfo!; } ///需要联动的值改变事件 FEventHandler onValueChange = FEventHandler(); ///改变目标的值 FEventHandler onChangeTargetValue = FEventHandler(); Map get formValue => _formValue; set formValue(Map newValue) { _formValue = newValue; } } class UpdateFormArgs { final String sourceKey; final UpdateFormType type; final dynamic sourceValue; UpdateFormArgs({ required this.sourceKey, required this.sourceValue, this.type = UpdateFormType.UpdateValue, }); } class TargetFormArgs { final String targetKey; final String targetValue; ///是否禁用组件 final bool isDisabledValue; ///是否隐藏组件(不显示) final bool isHidden; TargetFormArgs( this.targetKey, { this.targetValue = "", this.isDisabledValue = false, this.isHidden = false, }); } enum UpdateFormType { Add, UpdateValue, Remove, }