front dev update
This commit is contained in:
@@ -6,10 +6,10 @@ import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
class OperationFilters extends StatelessWidget {
|
||||
final DateTimeRange? selectedRange;
|
||||
final Set<String> selectedStatuses;
|
||||
final Set<OperationStatus> selectedStatuses;
|
||||
final VoidCallback onPickRange;
|
||||
final VoidCallback onApply;
|
||||
final ValueChanged<String> onToggleStatus;
|
||||
final ValueChanged<OperationStatus> onToggleStatus;
|
||||
|
||||
const OperationFilters({
|
||||
super.key,
|
||||
@@ -66,11 +66,12 @@ class OperationFilters extends StatelessWidget {
|
||||
Wrap(
|
||||
spacing: 12,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
OperationStatus.success.localized(context),
|
||||
OperationStatus.processing.localized(context),
|
||||
OperationStatus.error.localized(context),
|
||||
children: const [
|
||||
OperationStatus.success,
|
||||
OperationStatus.processing,
|
||||
OperationStatus.error,
|
||||
].map((status) {
|
||||
final label = status.localized(context);
|
||||
final isSelected = selectedStatuses.contains(status);
|
||||
return GestureDetector(
|
||||
onTap: () => onToggleStatus(status),
|
||||
@@ -89,7 +90,7 @@ class OperationFilters extends StatelessWidget {
|
||||
vertical: 4,
|
||||
),
|
||||
child: Text(
|
||||
l10n.status(status),
|
||||
l10n.status(label),
|
||||
style: TextStyle(
|
||||
color: isSelected ? Colors.white : Colors.black87,
|
||||
fontSize: 14,
|
||||
|
||||
@@ -8,6 +8,13 @@ import 'package:pweb/pages/report/table/badge.dart';
|
||||
|
||||
class OperationRow {
|
||||
static DataRow build(OperationItem op, BuildContext context) {
|
||||
final isUnknownDate = op.date.millisecondsSinceEpoch == 0;
|
||||
final localDate = op.date.toLocal();
|
||||
final dateLabel = isUnknownDate
|
||||
? '-'
|
||||
: '${TimeOfDay.fromDateTime(localDate).format(context)}\n'
|
||||
'${localDate.toIso8601String().split("T").first}';
|
||||
|
||||
return DataRow(cells: [
|
||||
DataCell(OperationStatusBadge(status: op.status)),
|
||||
DataCell(Text(op.fileName ?? '')),
|
||||
@@ -16,10 +23,7 @@ class OperationRow {
|
||||
DataCell(Text(op.payId)),
|
||||
DataCell(Text(op.cardNumber ?? '-')),
|
||||
DataCell(Text(op.name)),
|
||||
DataCell(Text(
|
||||
'${TimeOfDay.fromDateTime(op.date).format(context)}\n'
|
||||
'${op.date.toLocal().toIso8601String().split("T").first}',
|
||||
)),
|
||||
DataCell(Text(dateLabel)),
|
||||
DataCell(Text(op.comment)),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user