|
|
@@ -73,7 +73,7 @@ class _ExcelExportPageState extends State<ExcelExportPage> {
|
|
|
if (mounted) {
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
SnackBar(
|
|
|
- content: Text('数据已保存到目录:${result.message}'),
|
|
|
+ content: Text('数据已保存到目录:\n ${result.message}'),
|
|
|
backgroundColor: Colors.green,
|
|
|
),
|
|
|
);
|
|
|
@@ -81,7 +81,23 @@ class _ExcelExportPageState extends State<ExcelExportPage> {
|
|
|
// 导出成功后刷新选项
|
|
|
_refreshExportOptions();
|
|
|
} else {
|
|
|
- ToastUtil.error('导出失败: ${result.message}');
|
|
|
+ if (type == "all") {
|
|
|
+ if (mounted) {
|
|
|
+ final arr = result.message.split('@@@');
|
|
|
+ if (arr.length > 1) {
|
|
|
+ ScaffoldMessenger.of(context).showSnackBar(
|
|
|
+ SnackBar(
|
|
|
+ content: Text('部分导出成功:\n ${arr[1]}'),
|
|
|
+ backgroundColor: Colors.orange,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+ ToastUtil.errorAlert(arr[0]);
|
|
|
+ }
|
|
|
+ _refreshExportOptions();
|
|
|
+ } else {
|
|
|
+ ToastUtil.error('导出失败: ${result.message}');
|
|
|
+ }
|
|
|
}
|
|
|
} catch (e) {
|
|
|
ToastUtil.error('导出失败: ${e.toString()}');
|
|
|
@@ -148,19 +164,40 @@ class _ExcelExportPageState extends State<ExcelExportPage> {
|
|
|
left: 12.0,
|
|
|
right: 12.0,
|
|
|
),
|
|
|
+ color: dataCount > 0
|
|
|
+ ? option['type'] == "all"
|
|
|
+ ? Colors.yellowAccent
|
|
|
+ : Colors.greenAccent
|
|
|
+ : null,
|
|
|
child: ListTile(
|
|
|
title: Text(
|
|
|
option['name'],
|
|
|
- style: const TextStyle(
|
|
|
+ style: TextStyle(
|
|
|
fontSize: 18,
|
|
|
fontWeight: FontWeight.bold,
|
|
|
+ color: dataCount > 0 ? null : Colors.grey,
|
|
|
),
|
|
|
),
|
|
|
+
|
|
|
subtitle: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Text(option['description']),
|
|
|
- if (dataCount > 0) Text('未导出数量: $dataCount'),
|
|
|
+ Text(
|
|
|
+ option['description'],
|
|
|
+ style: TextStyle(
|
|
|
+ color: dataCount > 0 ? null : Colors.grey,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ if (dataCount > 0) const SizedBox(height: 5),
|
|
|
+ if (dataCount > 0)
|
|
|
+ Text(
|
|
|
+ '未导出数量: $dataCount',
|
|
|
+ style: TextStyle(
|
|
|
+ color: option['type'] == "all"
|
|
|
+ ? Colors.red
|
|
|
+ : Colors.deepOrange,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
trailing: isCurrentExporting
|