|
|
|
@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import '../../../core/theme/app_colors.dart'; |
|
|
|
import '../controllers/meeting_stats_controller.dart'; |
|
|
|
import '../../../data/models/user_Info.dart'; |
|
|
|
|
|
|
|
class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
const MeetingStatsView({Key? key}) : super(key: key); |
|
|
|
@ -23,19 +24,24 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
PreferredSizeWidget _buildAppBar(bool isDarkMode) { |
|
|
|
return AppBar( |
|
|
|
leading: IconButton( |
|
|
|
icon: Icon(Icons.arrow_back_ios, color: isDarkMode ? Colors.white : Colors.black, size: 20.sp), |
|
|
|
icon: Icon(Icons.arrow_back_ios, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, size: 20.sp), |
|
|
|
onPressed: () => Get.back(), |
|
|
|
), |
|
|
|
backgroundColor: isDarkMode ? AppColors.darkBackground : Colors.white, |
|
|
|
elevation: 0.5, |
|
|
|
title: Text( |
|
|
|
'会议统计', |
|
|
|
style: TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 17.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
), |
|
|
|
centerTitle: true, |
|
|
|
actions: [ |
|
|
|
IconButton( |
|
|
|
icon: Icon(Icons.refresh, color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
icon: Icon(Icons.refresh, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
onPressed: controller.refreshData, |
|
|
|
), |
|
|
|
], |
|
|
|
@ -51,6 +57,8 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
_buildIntegralCard(isDarkMode), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
_buildOverviewCard(isDarkMode), |
|
|
|
], |
|
|
|
), |
|
|
|
@ -67,7 +75,10 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
color: isDarkMode ? AppColors.cardBackground : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow(color: Colors.black.withValues(alpha: 0.05), blurRadius: 10, offset: const Offset(0, 2)), |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withValues(alpha: 0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2)), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Obx(() => Row( |
|
|
|
@ -99,7 +110,9 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: isSelected ? FontWeight.w600 : FontWeight.w400, |
|
|
|
color: isSelected ? Colors.white : (isDarkMode ? Colors.white70 : Colors.black54), |
|
|
|
color: isSelected |
|
|
|
? Colors.white |
|
|
|
: (isDarkMode ? Colors.white70 : Colors.black54), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
@ -115,7 +128,10 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
color: isDarkMode ? AppColors.cardBackground : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow(color: Colors.black.withValues(alpha: 0.05), blurRadius: 10, offset: const Offset(0, 2)), |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withValues(alpha: 0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2)), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
@ -127,22 +143,45 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
SizedBox(width: 8.w), |
|
|
|
Obx(() => Text( |
|
|
|
'${controller.selectedTimeRange.value}概览', |
|
|
|
style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
)), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Expanded(child: _buildStatItem('ASR调用次数', controller.formatNumber(stats.allAsrCalls), Icons.api, isDarkMode)), |
|
|
|
Expanded(child: _buildStatItem('音频总时长', controller.formatDuration(stats.allAudioSeconds), Icons.mic, isDarkMode)), |
|
|
|
Expanded( |
|
|
|
child: _buildStatItem( |
|
|
|
'ASR调用次数', |
|
|
|
controller.formatNumber(stats.allAsrCalls), |
|
|
|
Icons.api, |
|
|
|
isDarkMode)), |
|
|
|
Expanded( |
|
|
|
child: _buildStatItem( |
|
|
|
'音频总时长', |
|
|
|
controller.formatDuration(stats.allAudioSeconds), |
|
|
|
Icons.mic, |
|
|
|
isDarkMode)), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 12.h), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Expanded(child: _buildStatItem('音频文件大小', controller.formatBytes(stats.allAudioFileBytes), Icons.folder, isDarkMode)), |
|
|
|
Expanded(child: _buildStatItem('转写字节', controller.formatNumber(stats.allTranscriptBytes), Icons.text_snippet, isDarkMode)), |
|
|
|
Expanded( |
|
|
|
child: _buildStatItem( |
|
|
|
'音频文件大小', |
|
|
|
controller.formatBytes(stats.allAudioFileBytes), |
|
|
|
Icons.folder, |
|
|
|
isDarkMode)), |
|
|
|
Expanded( |
|
|
|
child: _buildStatItem( |
|
|
|
'转写字节', |
|
|
|
controller.formatNumber(stats.allTranscriptBytes), |
|
|
|
Icons.text_snippet, |
|
|
|
isDarkMode)), |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
@ -150,22 +189,100 @@ class MeetingStatsView extends GetView<MeetingStatsController> { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildStatItem(String label, String value, IconData icon, bool isDarkMode) { |
|
|
|
Widget _buildStatItem( |
|
|
|
String label, String value, IconData icon, bool isDarkMode) { |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Icon(icon, color: AppColors.primary, size: 24.sp), |
|
|
|
SizedBox(height: 8.h), |
|
|
|
Text( |
|
|
|
value, |
|
|
|
style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.bold, color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
), |
|
|
|
SizedBox(height: 4.h), |
|
|
|
Text( |
|
|
|
label, |
|
|
|
style: TextStyle(fontSize: 12.sp, color: isDarkMode ? Colors.white70 : Colors.black54), |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.white70 : Colors.black54), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildIntegralCard(bool isDarkMode) { |
|
|
|
return Container( |
|
|
|
padding: EdgeInsets.all(16.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: isDarkMode ? AppColors.cardBackground : Colors.white, |
|
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
|
boxShadow: [ |
|
|
|
BoxShadow( |
|
|
|
color: Colors.black.withValues(alpha: 0.05), |
|
|
|
blurRadius: 10, |
|
|
|
offset: const Offset(0, 2), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Icon(Icons.stacked_line_chart, |
|
|
|
color: AppColors.primary, size: 20.sp), |
|
|
|
SizedBox(width: 8.w), |
|
|
|
Text( |
|
|
|
'积分统计', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
Obx(() { |
|
|
|
final _ = User.refreshTick.value; |
|
|
|
final u = User.instance; |
|
|
|
return _buildIntegralRow( |
|
|
|
'会议', |
|
|
|
'${controller.formatNumber(u.meetintegral)}/${controller.formatNumber(u.meettotalintegral)}', |
|
|
|
Icons.people, |
|
|
|
isDarkMode, |
|
|
|
); |
|
|
|
}), |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _buildIntegralRow( |
|
|
|
String label, String value, IconData icon, bool isDarkMode) { |
|
|
|
return Row( |
|
|
|
children: [ |
|
|
|
Icon(icon, color: AppColors.primary, size: 18.sp), |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
label, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
value, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|