From 7fcd875c7142f3bf3cc0ce8115944ad6922553e3 Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Fri, 7 Mar 2025 13:55:18 +0800 Subject: [PATCH 01/12] -- --- .../class_student/class_student_view.dart | 389 +++++++++--------- .../student_work_detail_logic.dart | 14 +- .../student_work_detail_state.dart | 3 + .../student_work_detail_view.dart | 79 ++-- .../widget/line_chart.dart | 237 +++++++++++ 5 files changed, 494 insertions(+), 228 deletions(-) create mode 100644 making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart diff --git a/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart index 17f88ce..88af4f0 100644 --- a/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart @@ -44,205 +44,208 @@ class _ClassStudentPageState extends State { actions: const [ ReturnToHomepage(), ], + elevation: 0, ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - logic.getList(); - }, - child: state.studentList.isNotEmpty - ? Utils.isPad() - ? GridView( - shrinkWrap: true, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 10.r, - crossAxisSpacing: 10.r, - childAspectRatio: 556 / 112, - ), - children: - List.generate(state.studentList.length, (index) { - StudentItem item = state.studentList[index]; - return InkWell( - onTap: () { - // RouterManager.router.navigateTo(context, - // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); - Get.toNamed(Routes.studentWorkDetailPage, - arguments: { - 'studentName': item.name, - 'studentId': item.id, - 'subject':state.subject, - }); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 10.r), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10.r)), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Text( - item.name, - style: TextStyle( - fontSize: 12.sp, - color: Theme.of(context).primaryColor), - )), - state.page == 'answerTrajectory' - ? Container( - height: 20.r, - width: 70.r, - decoration: BoxDecoration( - border: Border.all( - width: 1.r, - color: const Color(0xFFB2DA93)), - borderRadius: BorderRadius.all( - Radius.circular(20.r)), - ), - child: Center( - child: Text('详情', - style: TextStyle( - fontSize: 10.r, - color: Color(0xFFB2DA93))), - )) - : state.page == 'history' - ? Container( + body: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + logic.getList(); + }, + child: state.studentList.isNotEmpty + ? Utils.isPad() + ? GridView( + shrinkWrap: true, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisSpacing: 0.r, + crossAxisSpacing: 0.r, + childAspectRatio: 556 / 90, + ), + children: + List.generate(state.studentList.length, (index) { + StudentItem item = state.studentList[index]; + return InkWell( + onTap: () { + // RouterManager.router.navigateTo(context, + // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); + Get.toNamed(Routes.studentWorkDetailPage, + arguments: { + 'studentName': item.name, + 'studentId': item.id, + 'subject':state.subject, + }); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10.r), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(0.r)), + color: Colors.transparent, + border: Border(left: BorderSide(width: + (index + 1)%2 == 0? 1.r:0,color: const Color(0xFFA5A5A5)),bottom: BorderSide(width: 1.r,color: const Color(0xFFA5A5A5))) + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + item.name, + style: TextStyle( + fontSize: 12.sp, + color: Theme.of(context).primaryColor), + )), + state.page == 'answerTrajectory' + ? Container( height: 20.r, width: 70.r, decoration: BoxDecoration( - color: - Theme.of(context).primaryColor, - borderRadius: - BorderRadius.all( - Radius.circular( - 20.r))), + border: Border.all( + width: 1.r, + color: const Color(0xFFB2DA93)), + borderRadius: BorderRadius.all( + Radius.circular(20.r)), + ), child: Center( - child: Text( - '历史作业', + child: Text('详情', style: TextStyle( fontSize: 10.r, - color: Colors.white), - )), - ) - : item.priorityAnnotate - ? InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, false); - EasyLoading.show( - status: 'loading...'); - }, - child: Container( - height: 20.r, - width: 80.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 4.r)), - color: const Color( - 0xFFEBE4FF), - ), - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Padding( - padding: - EdgeInsets.only( - left: 3.r), - child: Image.asset( - 'assets/images/youx_icon_active.png', - width: 14.r, - height: 14.r, - ), - ), - Padding( - padding: - EdgeInsets.only( - top: 2.r, - left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: Theme.of(context).primaryColor), - ), - ), - ], - ), + color: Color(0xFFB2DA93))), + )) + : state.page == 'history' + ? Container( + height: 20.r, + width: 70.r, + decoration: BoxDecoration( + color: + Theme.of(context).primaryColor, + borderRadius: + BorderRadius.all( + Radius.circular( + 20.r))), + child: Center( + child: Text( + '历史作业', + style: TextStyle( + fontSize: 10.r, + color: Colors.white), + )), + ) + : item.priorityAnnotate + ? InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, false); + EasyLoading.show( + status: 'loading...'); + }, + child: Container( + height: 20.r, + width: 80.r, + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular( + 4.r)), + color: const Color( + 0xFFEBE4FF), ), - ) - : InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, true); - EasyLoading.show( - status: 'loading...'); - }, - child: Container( - height: 20.r, - width: 80.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 4.r)), - color: const Color( - 0xFFE1E1E1), - ), - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Padding( - padding: - EdgeInsets.only( - left: 3.r), - child: Image.asset( - 'assets/images/youx_icon_default.png', - width: 14.r, - height: 14.r, - ), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + EdgeInsets.only( + left: 3.r), + child: Image.asset( + 'assets/images/youx_icon_active.png', + width: 14.r, + height: 14.r, ), - Padding( - padding: - EdgeInsets.only( - top: 2.r, - left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: const Color( - 0xFF8A9691)), - ), + ), + Padding( + padding: + EdgeInsets.only( + top: 2.r, + left: 4.r), + child: Text( + '优先批阅', + style: TextStyle( + fontSize: 10.sp, + color: Theme.of(context).primaryColor), ), - ], - ), + ), + ], ), ), - ], - ), + ) + : InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, true); + EasyLoading.show( + status: 'loading...'); + }, + child: Container( + height: 20.r, + width: 80.r, + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular( + 4.r)), + color: const Color( + 0xFFE1E1E1), + ), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + EdgeInsets.only( + left: 3.r), + child: Image.asset( + 'assets/images/youx_icon_default.png', + width: 14.r, + height: 14.r, + ), + ), + Padding( + padding: + EdgeInsets.only( + top: 2.r, + left: 4.r), + child: Text( + '优先批阅', + style: TextStyle( + fontSize: 10.sp, + color: const Color( + 0xFF8A9691)), + ), + ), + ], + ), + ), + ), + ], ), - ); - }), - ) - : ListView.builder( - itemBuilder: (context, index) { + ), + ); + }), + ) + : Padding( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + child: ListView.builder( + itemBuilder: (context, index) { StudentItem item = state.studentList[index]; return InkWell( onTap: () { @@ -414,13 +417,13 @@ class _ClassStudentPageState extends State { ), ), ); - }, - itemCount: state.studentList.length, - ) - : const MyEmptyWidget(), - ); - }), - ), + }, + itemCount: state.studentList.length, + ), + ) + : const MyEmptyWidget(), + ); + }), ); } ); diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart index ce0d2fa..797bc81 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart @@ -37,7 +37,14 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi ); StudentHistory data = await getClient().getStudentHistory(params); state.studentData.value = data; - for (var element in state.studentData.value.items.items) { + /* state.kgtLine.value = [{'id':0,'rate':0}]; + state.zgtLine.value = [{'id':0,'rate':0}]; + state.allLine.value = [{'id':0,'rate':0}];*/ + state.kgtLine.value = []; + state.zgtLine.value = []; + state.allLine.value = []; + for (var i = 0;i studentData = Rx(StudentHistory(0, 0, Items([], 0), 0)); late final int subject; + late RxList kgtLine = [].obs; + late RxList zgtLine = [].obs; + late RxList allLine = [].obs; } diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart index f35531f..dfd5863 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart @@ -1,3 +1,4 @@ +import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; @@ -9,6 +10,7 @@ import 'package:making_school_asignment_app/common/utils/utils.dart'; import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/line_chart.dart'; import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart'; @@ -124,16 +126,22 @@ class _StudentWorkDetailPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( + /* Text( '总览:', style: TextStyle( fontSize: 12.sp, color: Theme.of(context).primaryColor, fontWeight: FontWeight.w600), + ),*/ + SizedBox(height: 10.r,), + SizedBox( + height: 200.r, + child: LineChartCon(isShowingMainData: true,lineNum: 3,line1:state.kgtLine.value,line2: state.zgtLine.value,line3: state.allLine.value,), ), + SizedBox(height: 20.r,), ProgressBar( title: '客观题正确率:', - color:Theme.of(context).primaryColor, + color:const Color(0xFF4DE6BF), percent: state.studentData.value.kgtCorrectRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), @@ -145,7 +153,7 @@ class _StudentWorkDetailPageState extends State { marginEdg: EdgeInsets.only(top: 8.h)), ProgressBar( title: '总正确率:', - color: Theme.of(context).primaryColor, + color: const Color(0xFF1890FF), percent: state.studentData.value.correctRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), @@ -153,6 +161,7 @@ class _StudentWorkDetailPageState extends State { ), ); }), + Obx(() { return JobConditionFilter( controller: logic.tabController, @@ -221,8 +230,8 @@ class _StudentWorkDetailPageState extends State { height: 10.r, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFF4CC793), - border: Border.all(width: 1.r, color: Theme.of(context).primaryColor), + color: const Color(0xFF00B386), + border: Border.all(width: 1.r, color: const Color(0xFF00B386)), ), ), SizedBox( @@ -240,8 +249,8 @@ class _StudentWorkDetailPageState extends State { height: 10.r, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFFFF7474), - border: Border.all(width: 1.r, color: Color(0xFFFF7474)), + color: const Color(0xFFCB191B), + border: Border.all(width: 1.r, color: const Color(0xFFCB191B)), ), ), SizedBox( @@ -422,7 +431,7 @@ class _StudentWorkDetailPageState extends State { '客:', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), SizedBox( width: 5.r, @@ -444,16 +453,18 @@ class _StudentWorkDetailPageState extends State { width: 25.r, height: 25.r, decoration: BoxDecoration( - color: Colors.transparent, + color: subjective.state == 3 + ?const Color(0xFF00B386):subjective.state == 2 + ? const Color(0xFFCB191B):Colors.transparent, border: Border.all( width: 1.r, color: subjective.state == 0 - ? Color(0xFFDDDDDD) + ? const Color(0xFFDDDDDD) : subjective.state == 3 - ?Theme.of(context).primaryColor + ?const Color(0xFF00B386) : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), + ? const Color(0xFFCB191B) + : const Color(0xFF666666)), borderRadius: BorderRadius.all(Radius.circular(12.5.r))), child: Center( child: Text( @@ -464,16 +475,15 @@ class _StudentWorkDetailPageState extends State { color: subjective .state == 0 - ? Color( + ? const Color( 0xFFDDDDDD) : subjective.state == 3 - ? Theme.of(context).primaryColor + ? Colors.white : subjective.state == 2 - ? Color( - 0xFFFF7474) - : Color( + ?Colors.white + : const Color( 0xFF666666)), )), ); @@ -484,7 +494,7 @@ class _StudentWorkDetailPageState extends State { '无', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), ], ), @@ -499,7 +509,7 @@ class _StudentWorkDetailPageState extends State { '主:', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), SizedBox( width: 5.r, @@ -521,16 +531,18 @@ class _StudentWorkDetailPageState extends State { width: 25.r, height: 25.r, decoration: BoxDecoration( - color: Colors.transparent, + color: subjective.state == 3 + ? const Color(0xFF00B386):subjective.state == 2 + ? const Color(0xFFCB191B):Colors.transparent, border: Border.all( width: 1.r, color: subjective.state == 0 - ? Color(0xFFDDDDDD) + ? const Color(0xFFDDDDDD) : subjective.state == 3 - ? Theme.of(context).primaryColor + ? const Color(0xFF00B386) : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), + ? const Color(0xFFCB191B) + : const Color(0xFF666666)), borderRadius: BorderRadius.all(Radius.circular(12.5.r))), child: Center( child: Text( @@ -541,16 +553,15 @@ class _StudentWorkDetailPageState extends State { color: subjective .state == 0 - ? Color( + ? const Color( 0xFFDDDDDD) : subjective.state == 3 - ? Theme.of(context).primaryColor + ? Colors.white : subjective.state == 2 - ? Color( - 0xFFFF7474) - : Color( + ? Colors.white + : const Color( 0xFF666666)), )), ); @@ -561,25 +572,25 @@ class _StudentWorkDetailPageState extends State { '无', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), ], ), ProgressBar( title: '客观题正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.kgtCorrectRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), ProgressBar( title: '主观题正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.zgtCorrectRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), ProgressBar( title: '总正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.correctRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart new file mode 100644 index 0000000..588dbda --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart @@ -0,0 +1,237 @@ +import 'dart:math'; + +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class LineChartCon extends StatefulWidget { + final bool isShowingMainData; + final int lineNum; + final List? line1; + final List? line2; + final List? line3; + + LineChartCon( + {required this.isShowingMainData, + required this.lineNum, + this.line1, + this.line2, + this.line3}); + + @override + State createState() => _LineChartConState(); +} + +class _LineChartConState extends State { + double maxX = 0.0; + + @override + void initState() { + super.initState(); + } + + getMaxX(){ + if (widget.lineNum > 2) { + if (widget.line3!.length > widget.line2!.length && + widget.line3!.length > widget.line1!.length) { + maxX = double.parse(widget.line3!.length.toString()); + } else if (widget.line2!.length > widget.line3!.length && + widget.line2!.length > widget.line1!.length) { + maxX = double.parse(widget.line2!.length.toString()); + } else { + maxX = double.parse(widget.line1!.length.toString()); + } + } else if (widget.lineNum > 1) { + + } + print('maxx=======$maxX'); + return maxX; + } + + @override + Widget build(BuildContext context) { + + return LineChart( + LineChartData( + lineTouchData: const LineTouchData(enabled: false), + gridData: gridData, + titlesData: titlesData1, + borderData: borderData, + lineBarsData: lineBarsData1, + minX: 1, + maxX: getMaxX()>0? getMaxX():3, + maxY: 6, + minY: 0, + ), + duration: const Duration(milliseconds: 250), + ); + } + + FlTitlesData get titlesData1 => FlTitlesData( + bottomTitles: AxisTitles( + sideTitles: bottomTitles, + ), + rightTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + topTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + leftTitles: AxisTitles( + sideTitles: leftTitles(), + ), + ); + + List get lineBarsData1 => [ + lineChartBarData1_1, + lineChartBarData1_2, + lineChartBarData1_3, + ]; + + Widget leftTitleWidgets(double value, TitleMeta meta) { + String text; + switch (value.toInt()) { + case 0: + text = '0'; + break; + case 1: + text = '20%'; + break; + case 2: + text = '40%'; + break; + case 3: + text = '60%'; + break; + case 4: + text = '80%'; + break; + case 5: + text = '100%'; + break; + default: + return Container(); + } + + return Text(text, style: TextStyle(fontSize: 12.sp, color: const Color(0xFF070707)), textAlign: TextAlign.left); + + /* return SideTitleWidget( + axisSide: meta.axisSide, + child: Text( + '${value}', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF070707)), + ), + );*/ + } + + SideTitles leftTitles() => SideTitles( + getTitlesWidget: leftTitleWidgets, + showTitles: true, + interval: 1, + reservedSize: 50, + ); + + Widget bottomTitleWidgets(double value, TitleMeta meta) { + return SideTitleWidget( + axisSide: meta.axisSide, + space: 10, + child: Text( + value.toString() == '0.0' ? '' : value.toStringAsFixed(0), + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 12.sp, + color: const Color.fromRGBO(39, 39, 39, 0.5), + ), + ), + ); + } + + SideTitles get bottomTitles => SideTitles( + showTitles: true, + reservedSize: 32, + interval: 1, + getTitlesWidget: bottomTitleWidgets, + ); + + FlGridData get gridData => const FlGridData( + show: true, drawVerticalLine: false, horizontalInterval: 1.0); + + FlBorderData get borderData => FlBorderData( + show: true, + border: const Border( + bottom: BorderSide(color: Colors.transparent, width: 1), + left: BorderSide(color: Colors.transparent), + right: BorderSide(color: Colors.transparent), + top: BorderSide(color: Colors.transparent), + ), + ); + + LineChartBarData get lineChartBarData1_1 => LineChartBarData( + isCurved: true, + curveSmoothness: 0, + color: const Color(0xFF4DE6BF), + barWidth: 2, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData(show: false), + spots: List.generate(widget.line1!.length, (index){ + var element = widget.line1![index]; + return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString())); + }) + /* const [ + FlSpot(1, 0), + FlSpot(3, 1.5), + FlSpot(5, 1.4), + FlSpot(7, 3.4), + FlSpot(10, 2), + FlSpot(12, 2.2), + FlSpot(13, 1.8), + ],*/ + ); + + LineChartBarData get lineChartBarData1_2 => LineChartBarData( + isCurved: true, + curveSmoothness: 0, + color: Theme.of(context).primaryColor, + barWidth: 2, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData( + show: false, + color: Colors.yellow, + ), + spots: List.generate(widget.line2!.length, (index){ + var element = widget.line2![index]; + return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString())); + }) + /* const [ + FlSpot(1, 1), + FlSpot(3, 2.8), + FlSpot(7, 1.2), + FlSpot(10, 2.8), + FlSpot(12, 2.6), + FlSpot(13, 3.9), + ],*/ + ); + + LineChartBarData get lineChartBarData1_3 => LineChartBarData( + isCurved: true, + curveSmoothness: 0, + color: const Color(0xFF1890FF), + barWidth: 2, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData(show: false), + spots: List.generate(widget.line3!.length, (index){ + var element = widget.line3![index]; + return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString())); + }) + /* const [ + FlSpot(1, 2.8), + FlSpot(3, 1.9), + FlSpot(6, 3), + FlSpot(10, 1.3), + FlSpot(13, 2.5), + ],*/ + ); +} From 2f2395bfe20e8e38e871c072355cb1e77fe7e9f0 Mon Sep 17 00:00:00 2001 From: "1147192855@qq.com" <1147192855@qq.com> Date: Thu, 13 Mar 2025 14:57:38 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=A2=98=E5=8F=B7?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E9=9D=9E=E6=95=B0=E5=AD=97=E5=AD=97=E7=AC=A6=E4=B8=B2=E8=BD=AC?= =?UTF-8?q?=E6=95=B0=E5=AD=97=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/common/utils/utils.dart | 42 +++-- .../job_report/widget/knowledge_point.dart | 166 +++++++++--------- 2 files changed, 117 insertions(+), 91 deletions(-) diff --git a/making_school_asignment_app/lib/common/utils/utils.dart b/making_school_asignment_app/lib/common/utils/utils.dart index 13c0e70..e74e7c2 100644 --- a/making_school_asignment_app/lib/common/utils/utils.dart +++ b/making_school_asignment_app/lib/common/utils/utils.dart @@ -117,13 +117,36 @@ class Utils { for (var stu in data.students) { stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList(); - stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); + // stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); + // stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); + stu.kgtStu!.sort((a, b) { + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } + }); stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length; stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length; stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length; stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList(); - stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); + // stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); + stu.zgtStu!.sort((a, b) { + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } + }); //正确 stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length; //错误 @@ -167,21 +190,20 @@ class Utils { var stuDtls = data.dtls.where((w) => w.studentId == stu.studentId); var secList = []; - for(var sec in stuDtls){ - if(sec.useTime >= 1){ + for (var sec in stuDtls) { + if (sec.useTime >= 1) { var date = DateTime.parse(sec.lastAnswerTime!); - var lastSec =(date.difference(DateTime(1970)).inSeconds).floor(); + var lastSec = (date.difference(DateTime(1970)).inSeconds).floor(); secList.add(lastSec); secList.add(lastSec - sec.useTime); } } - secList.sort(); - var maxSec = secList.isNotEmpty?secList.last:0; - var minSec = secList.isNotEmpty?secList.first:0; - var secTime = secList.isNotEmpty?maxSec-minSec:0; + secList.sort(); + var maxSec = secList.isNotEmpty ? secList.last : 0; + var minSec = secList.isNotEmpty ? secList.first : 0; + var secTime = secList.isNotEmpty ? maxSec - minSec : 0; stu.ttlSec = second2HMS(secTime); - } data.students.sort((a, b) { diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart index a1f2277..16eaad1 100644 --- a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart @@ -14,7 +14,8 @@ class KnowledgePoint extends StatefulWidget { final String className; final String homeworkId; final int subject; - KnowledgePoint({Key? key, required this.knowsList, required this.data, required this.className, required this.homeworkId,required this.subject}) : super(key: key); + const KnowledgePoint( + {super.key, required this.knowsList, required this.data, required this.className, required this.homeworkId, required this.subject}); @override State createState() => _KnowledgePointState(); @@ -23,7 +24,7 @@ class KnowledgePoint extends StatefulWidget { class _KnowledgePointState extends State { void goQuickCheckPersonalPath(studentId) { if (studentId != null) { - Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': studentId, 'homeworkId': widget.homeworkId,'subject':widget.subject}); + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': studentId, 'homeworkId': widget.homeworkId, 'subject': widget.subject}); } } @@ -208,89 +209,92 @@ class _KnowledgePointState extends State { child: quickText('知识点掌握情况', color: const Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), ), Expanded( - child: widget.knowsList.isNotEmpty? ListView( - children: widget.knowsList.value.map((item) { - return Container( - margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Expanded( - flex: 10, - child: Row( + child: widget.knowsList.isNotEmpty + ? ListView( + children: widget.knowsList.value.map((item) { + return Container( + margin: EdgeInsets.only(bottom: 15.h, left: 15.r, right: 15.r), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Expanded( + flex: 10, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + quickText(item.knowledgeName, size: 12.sp, color: const Color.fromRGBO(152, 152, 152, 1)), + quickText('${item.okRate!.toStringAsFixed(0)}%', size: 12.sp, color: const Color.fromRGBO(64, 64, 64, 1)), + ], + ), + ), + SizedBox(width: 10.w), + const Expanded(flex: 1, child: SizedBox()), + ], + ), + SizedBox(height: 3.h), + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - quickText(item.knowledgeName, size: 12.sp, color: const Color.fromRGBO(152, 152, 152, 1)), - quickText('${item.okRate!.toStringAsFixed(0)}%', size: 12.sp, color: const Color.fromRGBO(64, 64, 64, 1)), - ], - ), - ), - SizedBox(width: 10.w), - const Expanded(flex: 1, child: SizedBox()), - ], - ), - SizedBox(height: 3.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 10.h, - animationDuration: 2500, - percent: item.okRate! / 100, - progressColor: Theme.of(context).primaryColor, - backgroundColor: const Color.fromRGBO(219, 224, 243, 1), - barRadius: Radius.circular(10.r), - )), - SizedBox(width: 10.w), - InkWell( - onTap: () { - List ques = - widget.data.questions.where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1).toList(); - List array2 = [...widget.data.students]; - for (var stu in array2) { - stu.queDtls = widget.data.dtls - .where((w) => - w.studentId == stu.studentId && - ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1) - .toList(); - int okCount = stu.queDtls!.where((w) => w.state == 3).length; - int ttlCount = stu.queDtls!.length; - stu.okRate = Utils.calcRate(okCount, ttlCount); - stu.queDtls!.sort((a, b) { - num num1 = num.parse(a.questionNo); - num num2 = num.parse(b.questionNo); - return num1.compareTo(num2); - }); - } + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 10.h, + animationDuration: 2500, + percent: item.okRate! / 100, + progressColor: Theme.of(context).primaryColor, + backgroundColor: const Color.fromRGBO(219, 224, 243, 1), + barRadius: Radius.circular(10.r), + )), + SizedBox(width: 10.w), + InkWell( + onTap: () { + List ques = widget.data.questions + .where((w) => w.knows.indexWhere((k) => k.knowledgeId == item.knowledgeId) > -1) + .toList(); + List array2 = [...widget.data.students]; + for (var stu in array2) { + stu.queDtls = widget.data.dtls + .where((w) => + w.studentId == stu.studentId && + ques.indexWhere((q) => w.templateId == q.templateId && w.questionNo == q.questionNo) > -1) + .toList(); + int okCount = stu.queDtls!.where((w) => w.state == 3).length; + int ttlCount = stu.queDtls!.length; + stu.okRate = Utils.calcRate(okCount, ttlCount); + stu.queDtls!.sort((a, b) { + num num1 = num.parse(a.questionNo); + num num2 = num.parse(b.questionNo); + return num1.compareTo(num2); + }); + } - showPeopleListDialog( - context: context, - title: item.knowledgeName, - arr: array2, - ); - }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - quickText('查看', size: 12.sp, color: const Color.fromRGBO(239, 135, 20, 1)), - Icon(Icons.arrow_forward_ios, size: 11.sp, color: const Color.fromRGBO(239, 135, 20, 1)), + showPeopleListDialog( + context: context, + title: item.knowledgeName, + arr: array2, + ); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + quickText('查看', size: 12.sp, color: const Color.fromRGBO(239, 135, 20, 1)), + Icon(Icons.arrow_forward_ios, size: 11.sp, color: const Color.fromRGBO(239, 135, 20, 1)), + ], + ), + ), ], - ), - ), - ], - ) - ], - ), - ); - }).toList()): MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp), + ) + ], + ), + ); + }).toList()) + : MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp), ), ], )); From 829ac8fbadfafdf4e9009f17a29acda18617fd54 Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Thu, 13 Mar 2025 14:59:09 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=BE=85=E6=89=B9=E9=98=85=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../read_over/widget/annotate_list.dart | 260 +++++++++++------- .../widget/job_condition_filter.dart | 6 +- .../widget/personal_detail_topbar.dart | 20 +- 3 files changed, 173 insertions(+), 113 deletions(-) diff --git a/making_school_asignment_app/lib/page/home_page/children/read_over/widget/annotate_list.dart b/making_school_asignment_app/lib/page/home_page/children/read_over/widget/annotate_list.dart index d720c2a..f9298a7 100644 --- a/making_school_asignment_app/lib/page/home_page/children/read_over/widget/annotate_list.dart +++ b/making_school_asignment_app/lib/page/home_page/children/read_over/widget/annotate_list.dart @@ -19,16 +19,20 @@ import 'package:making_school_asignment_app/common/job/work_student.dart'; part 'annotate_list.g.dart'; -class AnnotateList extends StatefulWidget{ +class AnnotateList extends StatefulWidget { final int tabIndex; final int assessType; - const AnnotateList({Key? key,required this.tabIndex,required this.assessType}) : super(key: key); + + const AnnotateList( + {Key? key, required this.tabIndex, required this.assessType}) + : super(key: key); @override State createState() => _AnnotateListState(); } -class _AnnotateListState extends State with RequestToolMixin, SingleTickerProviderStateMixin{ +class _AnnotateListState extends State + with RequestToolMixin, SingleTickerProviderStateMixin { late RxString customTimeStr = '自定义'.obs; int active = 1; late RxList unAnnotateList = RxList(); @@ -47,10 +51,12 @@ class _AnnotateListState extends State with RequestToolMixin, Sing WorkStudentParams params2 = WorkStudentParams( assessType: 0, pageSize: 10, + startDate: Utils.getWeekStartDate().toString().substring(0, 10), + endDate: Utils.getWeekEndDate().toString().substring(0, 10), ); @override - void initState(){ + void initState() { super.initState(); params.assessType = widget.assessType; params2.assessType = widget.assessType; @@ -95,19 +101,18 @@ class _AnnotateListState extends State with RequestToolMixin, Sing tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists); } catch (e) {} toUpState(setState, () {}, mounted);*/ - if(widget.tabIndex == 0){ + if (widget.tabIndex == 0) { getUnAnnotateList(); - }else{ + } else { getAnnotateList(); } - } Future getCollect(item) async { await getClient().getCollect(item.id); - if(widget.tabIndex == 0){ + if (widget.tabIndex == 0) { getUnAnnotateList(); - }else{ + } else { getAnnotateList(); } } @@ -128,45 +133,63 @@ class _AnnotateListState extends State with RequestToolMixin, Sing return Column( children: [ if(widget.tabIndex == 1) - JobConditionFilter( - customTimeStr: customTimeStr.value, - controller: tabController2, - hasAll: true, - jobType: 1, - customTime: tabController2.index != 3 || (params2.startDate == null && params2.endDate == null) - ? null - : PickerDateRange( - params2.startDate == null ? null : DateTime.parse(params2.startDate!), - params2.endDate == null ? null : DateTime.parse(params2.endDate!), - ), - onTimeFilter: (String? startTime, String? endTime) { - if (startTime == null && endTime == null && tabController2.index == 3) { - tabController2.animateTo(0); - } - params2.endDate = endTime; - params2.startDate = startTime; - page = 1; - if(widget.tabIndex == 0){ - getUnAnnotateList(); - }else{ - getAnnotateList(); - } - // refreshController2.callRefresh(); - }, - refreshTime: (value) { - if (value != null && value.startDate != null) { - customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; - - if (value.endDate != null) { - if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { - customTimeStr.value = - '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; + Obx(() { + return JobConditionFilter( + customTimeStr: customTimeStr.value, + controller: tabController2, + hasAll: true, + jobType: 1, + customTime: tabController2.index != 2 || + (params2.startDate == null && params2.endDate == null) + ? null + : PickerDateRange( + params2.startDate == null ? null : DateTime.parse( + params2.startDate!), + params2.endDate == null ? null : DateTime.parse( + params2.endDate!), + ), + onTimeFilter: (String? startTime, String? endTime) { + if (startTime == null && endTime == null && + tabController2.index == 2) { + tabController2.animateTo(0); + params2.endDate = + Utils.getWeekEndDate().toString().substring(0, 10); + params2.startDate = + Utils.getWeekStartDate().toString().substring(0, 10); + customTimeStr.value = '自定义'; } else { - customTimeStr.value = '${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; + params2.endDate = endTime; + params2.startDate = startTime; } - } - } - }), + page = 1; + EasyLoading.show(status: 'loading...'); + if (widget.tabIndex == 0) { + getUnAnnotateList(); + } else { + getAnnotateList(); + } + // refreshController2.callRefresh(); + }, + refreshTime: (value) { + if (value != null && value.startDate != null) { + customTimeStr.value = + value.startDate?.toString().substring(0, 10) ?? ''; + + if (value.endDate != null) { + if (!Utils.isPad() && + value.startDate!.year == value.endDate!.year) { + customTimeStr.value = + '${value.startDate.toString().substring(5, 10)}~${value + .endDate.toString().substring(5, 10)}'; + } else { + customTimeStr.value = + '${customTimeStr.value}~${value.endDate?.toString() + .substring(0, 10)}'; + } + } + } + }); + }), Expanded(child: IndexedStack( index: widget.tabIndex, children: [ @@ -199,8 +222,10 @@ class _AnnotateListState extends State with RequestToolMixin, Sing @swidget Widget $easyRefresh({ required EasyRefreshController controller, - required Future Function(EasyRefreshController controller, int tab) onRefresh, - required Future Function(EasyRefreshController controller, int tab) onLoad, + required Future< + void> Function(EasyRefreshController controller, int tab) onRefresh, + required Future< + void> Function(EasyRefreshController controller, int tab) onLoad, required List data, required int tab, required int type, @@ -220,7 +245,8 @@ Widget $easyRefresh({ footer: TaurusFooter(), child: completed && isPadFlag ? GridView( - padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + padding: EdgeInsets.only( + top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, //横轴三个子widget mainAxisSpacing: 10.h, @@ -230,19 +256,24 @@ Widget $easyRefresh({ children: List.generate(data.length, (index) { Items item = data[index]; String subjectName = EnumUtils.formatSubject(item.subject); - return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName, collectFun: collectFun,tabIndex:tab - 1); + return $reviewedItem(jobTaskItem: item, + type: type, + subjectName: subjectName, + collectFun: collectFun, + tabIndex: tab - 1); }), ) : ListView.builder( - padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), + padding: EdgeInsets.only( + top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), itemBuilder: (context, index) { Items item = data[index]; return TaskListItem( - completed: completed, - jobTaskItem: item, - type: type, - collectFun: collectFun, - tabIndex:tab - 1 + completed: completed, + jobTaskItem: item, + type: type, + collectFun: collectFun, + tabIndex: tab - 1 ); }, itemCount: data.length, @@ -266,10 +297,17 @@ Widget $reviewedItem({ return InkWell( onTap: () { Get.toNamed(Routes.annotateClassPage, - arguments: {'id': jobTaskItem.id, 'name': jobTaskItem.name, 'grade': jobTaskItem.grade,'subject':jobTaskItem.subject, 'completed': true,'tabIndex':tabIndex}); + arguments: { + 'id': jobTaskItem.id, + 'name': jobTaskItem.name, + 'grade': jobTaskItem.grade, + 'subject': jobTaskItem.subject, + 'completed': true, + 'tabIndex': tabIndex + }); }, child: Container( - padding: EdgeInsets.only(right: 5.w), + padding: EdgeInsets.only(top: 10.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.r), color: Colors.white, @@ -286,39 +324,47 @@ Widget $reviewedItem({ mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // 顶部任务名称 - Row( - crossAxisAlignment: CrossAxisAlignment.start, + Padding( + padding: padEdg, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 32.w, - height: 18.h, - alignment: Alignment.center, - padding: EdgeInsets.only(left: 2.w), - decoration: BoxDecoration( - color: type == 1 ? const Color(0xFFB2DA93) : const Color(0xFFEF8714), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(6.r), - topRight: Radius.circular(0.r), - bottomLeft: Radius.circular(0.r), - bottomRight: Radius.circular(12.r), + children: [ + Container( + width: 32.w, + height: 18.h, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 2.w), + decoration: BoxDecoration( + color: type == 1 ? const Color(0xFF4CC793) : const Color + .fromRGBO(255, 175, 56, 1), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(14.r), + topRight: Radius.circular(3.r), + bottomLeft: Radius.circular(4.r), + bottomRight: Radius.circular(4.r), + ), ), + margin: EdgeInsets.only(top: 3.h, right: 4.w), + child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, + size: 10.sp), ), - margin: EdgeInsets.only(top:0.h,right: 4.w), - child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp), - ), - Expanded( - child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2), - ), - if (jobTaskItem.isFixed!) - Padding( - padding: EdgeInsets.only(top: 3.r), - child: Text( - '已订正', - style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)), + Expanded( + child: quickText(jobTaskItem.name, size: 14.sp, + color: const Color.fromRGBO(70, 70, 70, 1), + maxLines: 2), + ), + if (jobTaskItem.isFixed!) + Padding( + padding: EdgeInsets.only(top: 3.r), + child: Text( + '已订正', + style: TextStyle( + fontSize: 10.sp, color: const Color(0xFFF16262)), + ), ), - ), - ], + ], + ), ), Padding( @@ -327,26 +373,31 @@ Widget $reviewedItem({ crossAxisAlignment: CrossAxisAlignment.end, children: [ quickText( - DateTime.parse(jobTaskItem.publishTime).toString().substring(0, 10), + DateTime.parse(jobTaskItem.publishTime).toString().substring( + 0, 10), color: const Color.fromRGBO(97, 97, 97, 1), size: 10.sp, fontWeight: FontWeight.w500, ), - quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), + size: 10.sp, + fontWeight: FontWeight.w500), quickText( '参与班级:', - color: const Color(0xFF8C68FF), + color: const Color.fromRGBO(76, 199, 147, 1), size: 9.sp, ), quickText( '${jobTaskItem.classCount}', - color: const Color(0xFF8C68FF), + color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, ), - quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500), + quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), + size: 10.sp, + fontWeight: FontWeight.w500), quickText( '科目:$subjectName', - color: const Color(0xFF8C68FF), + color: const Color.fromRGBO(116, 145, 253, 1), size: 9.sp, ), ], @@ -363,7 +414,8 @@ Widget $reviewedItem({ Container( padding: EdgeInsets.symmetric(vertical: 6.h), decoration: BoxDecoration( - borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), + bottomRight: Radius.circular(6.r)), color: Colors.white, boxShadow: const [ BoxShadow( @@ -375,7 +427,7 @@ Widget $reviewedItem({ ], ), child: Row(children: [ - /*if (!jobTaskItem.isFixed!) + if (!jobTaskItem.isFixed!) Expanded( flex: 1, child: GestureDetector( @@ -389,23 +441,31 @@ Widget $reviewedItem({ child: Container( alignment: Alignment.center, decoration: BoxDecoration( - border: Border(right: BorderSide(width: 1.r, color: const Color(0xFFDCDCDC))), + border: Border(right: BorderSide( + width: 1.r, color: const Color(0xFFDCDCDC))), ), - child: quickText('收集订正', color: const Color(0xFF8C68FF), size: 11.sp), + child: quickText( + '收集订正', color: const Color(0xFF4CC793), size: 11.sp), ), ), - ),*/ + ), Expanded( flex: 1, child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { Get.toNamed(Routes.jobReportPage, - arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade}); + arguments: { + 'title': jobTaskItem.name, + 'homeworkId': jobTaskItem.id, + 'grade': jobTaskItem.grade + }); }, child: Container( alignment: Alignment.center, - child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp), + child: quickText( + '查看报告', color: const Color.fromRGBO(118, 118, 118, 1), + size: 11.sp), ), ), ), diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart index e33210d..fa8de0f 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart @@ -70,14 +70,14 @@ class _JobConditionFilterState extends State { customTimeStr: widget.customTimeStr, hasAll: widget.hasAll, onTap: (int val) async { - if (val == 0 && widget.hasAll == true) { + if (val == 3 && widget.hasAll == true) { widget.onTimeFilter(null, null); - } else if ((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) { + } else if ((val == 0 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) { widget.onTimeFilter( Utils.getWeekStartDate().toString().substring(0, 10), Utils.getWeekEndDate().toString().substring(0, 10), ); - } else if ((val == 2 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) { + } else if ((val == 1 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) { widget.onTimeFilter( getMonthStartDate().toString().substring(0, 10), getMonthEndDate().toString().substring(0, 10), diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart index 3924fd0..2d8459b 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/personal_detail_topbar.dart @@ -13,10 +13,10 @@ class PersonalDetailTopBar extends StatefulWidget { } class _PersonalDetailTopBarState extends State { - @override - void initState(){ - super.initState(); - } + @override + void initState(){ + super.initState(); + } @override Widget build(BuildContext context) { @@ -33,26 +33,26 @@ class _PersonalDetailTopBarState extends State { labelStyle: TextStyle( fontSize: 12.sp, fontWeight: FontWeight.bold, - color: const Color(0xFF8C68FF), + color: const Color(0xFF4CC793), ), isScrollable: true, - labelColor:const Color(0xFF8C68FF), + labelColor: const Color(0xFF4CC793), unselectedLabelColor: const Color(0xFF505E6E), padding: EdgeInsets.symmetric(horizontal: 14.r), // indicatorSize: TabBarIndicatorSize.label, // 设置指示器高度和标签一样高 onTap: widget.onTap, indicator: UnderlineTabIndicator( borderSide: BorderSide( - width: 2.r, - color:const Color(0xFF8C68FF) + width: 2.r, + color:const Color(0xFF4CC793) ), ), tabs: [ - if(widget.hasAll == true) - const Tab(text: '全部'), const Tab(text: '近一周'), const Tab(text: '近一月'), Tab(text: widget.customTimeStr), + if(widget.hasAll == true) + const Tab(text: '全部'), ], ), ); From 2e1ca0f6b2180ce5d6c52bf0c08764ef0d992296 Mon Sep 17 00:00:00 2001 From: "1147192855@qq.com" <1147192855@qq.com> Date: Thu, 13 Mar 2025 17:46:30 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=98=E5=8C=96BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/src/main/res/drawable/background.png | Bin 6323 -> 69 bytes .../lib/common/request/rest_dio.dart | 2 +- .../children/job_report/job_report_view.dart | 176 +++++---- .../job_report/widget/knowledge_point.dart | 12 +- .../knowledge_points_grasp_logic.dart | 14 +- .../knowledge_points_grasp_view.dart | 297 +++++++------- .../knowledge_points_grasp_detail_view.dart | 103 +++-- .../widget/kgt_zgt_table.dart | 18 +- .../quick_data_check/widget/report_table.dart | 365 +++++++----------- .../student_personal_logic.dart | 24 +- .../student_personal_view.dart | 9 +- .../student_work_detail_logic.dart | 36 +- making_school_asignment_app/pubspec.yaml | 2 +- making_school_asignment_app/web/index.html | 2 + 14 files changed, 521 insertions(+), 539 deletions(-) diff --git a/making_school_asignment_app/android/app/src/main/res/drawable/background.png b/making_school_asignment_app/android/app/src/main/res/drawable/background.png index b2901c910580366192b4b76917f50637fae68cd2..3107d37fa533216ce211fdcdd7c9b8633fab4cc4 100644 GIT binary patch literal 69 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1SBVv2j2ryJf1F&Ar*|tKmY%?XJF%FW@0Ma R`v54;;OXk;vd$@?2>`rk4}t&y literal 6323 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 diff --git a/making_school_asignment_app/lib/common/request/rest_dio.dart b/making_school_asignment_app/lib/common/request/rest_dio.dart index 0e0eef1..8eb6b04 100644 --- a/making_school_asignment_app/lib/common/request/rest_dio.dart +++ b/making_school_asignment_app/lib/common/request/rest_dio.dart @@ -149,7 +149,7 @@ class TheError extends Interceptor { message = '请求发送超时'; break; case DioExceptionType.receiveTimeout: - message = '接收超时时发生'; + message = '接收超时'; break; case DioExceptionType.badResponse: if (error.response == null) { diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart index 114b697..a2bc6ad 100644 --- a/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/job_report_view.dart @@ -14,7 +14,7 @@ import 'package:making_school_asignment_app/page/home_page/children/quick_data_c import 'job_report_logic.dart'; class JobReportPage extends StatefulWidget { - const JobReportPage({Key? key}) : super(key: key); + const JobReportPage({super.key}); @override State createState() => _JobReportPageState(); @@ -26,102 +26,100 @@ class _JobReportPageState extends State { @override Widget build(BuildContext context) { - return OrientationBuilder( - builder: (BuildContext context, Orientation orientation){ - return Scaffold( - backgroundColor: Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - centerTitle: true, - title: Center(child: Obx(() { - return quickText( - '${state.title.value}作业报告', - size: 14.sp, - color: const Color.fromRGBO(51, 51, 51, 1), - ); - })), - leading: IconButton( - icon: const Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - ), - body: Obx(() { - if (state.hasData.value) { - return SingleChildScrollView( - child: Column( - children: [ - // 下拉框 - Container( - padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w), - decoration: const BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Obx(() { - return DropdownSelection( - involveClasses: state.involveClasses.value, - classData: state.classData.value, - call: (AnnotatedClass item) { - state.classData.value = item; - if (item.grade == -1) state.classData.value = state.defaultClass; - logic.getWorkData(); - }); - }), - // Expanded(child: Text('')), - ], - ), - ), - //完成率、正确率 - TopCount( - state.dataCount, state.classData == null ? '' : state.classData.value.className, state.homeworkId.value,state.subject), - //客观题、主观题 - KgtZgtTable( - studentCount: state.dataCount.studentCount!, - homeworkId: state.homeworkId.value, - kgReport: state.kgReport, - zgReport: state.zgReport, - kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), - zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0), - kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0), - zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0), - subject:state.subject), - // 掌握知识点的情况 - Container( - margin: EdgeInsets.symmetric(horizontal: 10.r), - child: KnowledgePoint( - knowsList: state.knowsList, - data: state.homeData, - className: state.classData.value.className, - homeworkId: state.homeworkId.value, - subject:state.subject,)), - // 掌握知识点的情况 - /* Container( + return OrientationBuilder(builder: (BuildContext context, Orientation orientation) { + return Scaffold( + backgroundColor: Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + centerTitle: true, + title: Center(child: Obx(() { + return quickText( + '${state.title.value}作业报告', + size: 14.sp, + color: const Color.fromRGBO(51, 51, 51, 1), + ); + })), + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + ), + body: Obx(() { + if (state.hasData.value) { + return SingleChildScrollView( + child: Column( + children: [ + // 下拉框 + Container( + padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 10.w), + decoration: const BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Obx(() { + return DropdownSelection( + involveClasses: state.involveClasses.value, + classData: state.classData.value, + call: (AnnotatedClass item) { + state.classData.value = item; + if (item.grade == -1) state.classData.value = state.defaultClass; + logic.getWorkData(); + }); + }), + // Expanded(child: Text('')), + ], + ), + ), + //完成率、正确率 + TopCount(state.dataCount, state.classData == null ? '' : state.classData.value.className, state.homeworkId.value, state.subject), + //客观题、主观题 + KgtZgtTable( + studentCount: state.dataCount.studentCount!, + homeworkId: state.homeworkId.value, + kgReport: state.kgReport, + zgReport: state.zgReport, + kgtOkRate: state.dataCount.kgtOkRate!.toStringAsFixed(0), + zgtOkRate: state.dataCount.zgtOkRate!.toStringAsFixed(0), + kgtCorrectRate: state.dataCount.kgtCorrectRate!.toStringAsFixed(0), + zgtCorrectRate: state.dataCount.zgtCorrectRate!.toStringAsFixed(0), + subject: state.subject), + // 掌握知识点的情况 + Container( + margin: EdgeInsets.symmetric(horizontal: 10.r), + child: KnowledgePoint( + knowsList: state.knowsList, + data: state.homeData, + className: state.classData.value.className, + homeworkId: state.homeworkId.value, + subject: state.subject, + )), + // 掌握知识点的情况 + /* Container( margin: EdgeInsets.symmetric(horizontal: 10.r), child: $OverallPerformance(data.studentCount, data.overallTitles)), // 单位时间答题情况 Container( margin: EdgeInsets.symmetric(horizontal: 10.r), child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/ - // 人员数据概况 - Container(margin: EdgeInsets.symmetric(horizontal: 10.r), child: PersonnelDataOverview(studentList: state.studentList.value)), + // 人员数据概况 + Container(margin: EdgeInsets.symmetric(horizontal: 10.r), child: PersonnelDataOverview(studentList: state.studentList.value)), - SizedBox( - height: 30.r, - ), - ], + SizedBox( + height: 30.r, ), - ); - } else { - return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); - } - }), - ); - } - ); + ], + ), + ); + } else { + return Padding(padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), child: const MyEmptyWidget()); + } + }), + ); + }); } @override diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart index 16eaad1..f1c64fd 100644 --- a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart @@ -268,9 +268,15 @@ class _KnowledgePointState extends State { int ttlCount = stu.queDtls!.length; stu.okRate = Utils.calcRate(okCount, ttlCount); stu.queDtls!.sort((a, b) { - num num1 = num.parse(a.questionNo); - num num2 = num.parse(b.questionNo); - return num1.compareTo(num2); + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } }); } diff --git a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart index 29e08b7..8bf9dea 100644 --- a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_logic.dart @@ -4,6 +4,8 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart'; import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; +import 'package:making_school_asignment_app/common/utils/utils.dart'; import 'knowledge_points_grasp_state.dart'; @@ -27,9 +29,15 @@ class KnowledgePointsGraspLogic extends GetxController with RequestToolMixin, Ge } void getList() async { - List data = await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text,state.classId,state.subject); - state.dataList.value = data; - EasyLoading.dismiss(); + try { + ToastUtils.showLoading(); + List data = + await getClient().getKnowledgeReport(state.dateStart, state.dateEnd, textController.text, state.classId, state.subject); + state.dataList.value = data; + } catch (_) { + } finally { + ToastUtils.dismiss(); + } } @override diff --git a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart index 6906d10..766bce8 100644 --- a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart @@ -1,9 +1,11 @@ +import 'package:easy_debounce/easy_throttle.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:making_school_asignment_app/common/job/knowledge_points_grasp.dart'; +import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart'; import 'package:making_school_asignment_app/common/utils/utils.dart'; import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; @@ -15,7 +17,7 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart'; import 'knowledge_points_grasp_logic.dart'; class KnowledgePointsGraspPage extends StatefulWidget { - const KnowledgePointsGraspPage({Key? key}) : super(key: key); + const KnowledgePointsGraspPage({super.key}); @override State createState() => _KnowledgePointsGraspPageState(); @@ -27,145 +29,141 @@ class _KnowledgePointsGraspPageState extends State { @override Widget build(BuildContext context) { - return OrientationBuilder( - builder: (BuildContext context, Orientation orientation){ - return Scaffold( - backgroundColor: Color.fromRGBO(245, 245, 245, 1), - appBar: AppBar( - backgroundColor: Colors.white, - title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), - centerTitle: true, - leading: IconButton( - icon: Icon(Icons.arrow_back_ios, color: Colors.black), - onPressed: () => Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - elevation: 0, - ), - body: Column( - children: [ - Container( - margin: EdgeInsets.all(15.r), - // height: 30.r, - child: Row( - children: [ - Expanded( - child: Container( - padding: EdgeInsets.only(left: 10.r, right: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.r), - border: Border.all(width: 1.r, color: Color(0xFFDDDDDD)), - color: Colors.white, - ), - child: TextField( - controller: logic.textController, - textInputAction: TextInputAction.next, - style: TextStyle( - color: const Color.fromRGBO(80, 87, 103, 1), - fontSize: 10.sp, - ), - decoration: InputDecoration( - hintText: "请输入知识点名称", - hintStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(153, 153, 153, 1)), - labelStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(148, 163, 182, 1)), - border: InputBorder.none, - ), - ), + return OrientationBuilder(builder: (BuildContext context, Orientation orientation) { + return Scaffold( + backgroundColor: const Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333))), + centerTitle: true, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + elevation: 0, + ), + body: Column( + children: [ + Container( + margin: EdgeInsets.all(15.r), + // height: 30.r, + child: Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10.r, right: 10.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.r), + border: Border.all(width: 1.r, color: const Color(0xFFDDDDDD)), + color: Colors.white, + ), + child: TextField( + controller: logic.textController, + textInputAction: TextInputAction.next, + style: TextStyle( + color: const Color.fromRGBO(80, 87, 103, 1), + fontSize: 10.sp, + ), + decoration: InputDecoration( + hintText: "请输入知识点名称", + hintStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(153, 153, 153, 1)), + labelStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(148, 163, 182, 1)), + border: InputBorder.none, ), ), - SizedBox( - width: 10.r, - ), - InkWell( - onTap: () { - state.page = 1; - logic.getList(); - }, - child: Container( - width: 50.r, - height: 30.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.r), - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Text( - '查询', - style: TextStyle(fontSize: 12.sp, color: Colors.white), - ), - ), - ), - ) - ], - ), - ), - Obx(() { - return JobConditionFilter( - jobType: 1, - controller: logic.tabController, - customTimeStr: state.customTimeStr.value, - customTime: logic.tabController.index != 2 || - ((state.dateEnd == null || state.dateEnd == '') && (state.dateStart == null || state.dateStart == '')) - ? null - : PickerDateRange( - state.dateStart == null || state.dateStart == '' ? null : DateTime.parse(state.dateStart!), - state.dateEnd == null || state.dateEnd == '' ? null : DateTime.parse(state.dateEnd!), ), - onTimeFilter: (String? startTime, String? endTime) { - EasyLoading.show(status: 'loading...'); - if (startTime == null && endTime == null) { - if (logic.tabController.index == 2) { - logic.tabController.animateTo(0); - } - state.dateStart = Utils.getWeekStartDate().toString().substring(0, 10); - state.dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); - state.customTimeStr.value = '自定义'; + ), + SizedBox( + width: 10.r, + ), + InkWell( + onTap: () => easyThrottle('zshi_shi_dian_cx', () { + Utils.hideKeyboard(); + logic.refreshController.callRefresh(); + }), + child: Container( + width: 50.r, + height: 30.r, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(4.r), color: Theme.of(context).primaryColor), + child: Center( + child: Text( + '查询', + style: TextStyle(fontSize: 12.sp, color: Colors.white), + ), + ), + ), + ) + ], + ), + ), + Obx(() { + return JobConditionFilter( + jobType: 1, + controller: logic.tabController, + customTimeStr: state.customTimeStr.value, + customTime: logic.tabController.index != 2 || + ((state.dateEnd == null || state.dateEnd == '') && (state.dateStart == null || state.dateStart == '')) + ? null + : PickerDateRange( + state.dateStart == null || state.dateStart == '' ? null : DateTime.parse(state.dateStart!), + state.dateEnd == null || state.dateEnd == '' ? null : DateTime.parse(state.dateEnd!), + ), + onTimeFilter: (String? startTime, String? endTime) { + EasyLoading.show(status: 'loading...'); + if (startTime == null && endTime == null) { + if (logic.tabController.index == 2) { + logic.tabController.animateTo(0); + } + state.dateStart = Utils.getWeekStartDate().toString().substring(0, 10); + state.dateEnd = Utils.getWeekEndDate().toString().substring(0, 10); + state.customTimeStr.value = '自定义'; + } else { + state.dateStart = startTime ?? ''; + state.dateEnd = endTime ?? ''; + } + state.page = 1; + logic.getList(); + // _refreshController2.callRefresh(); + }, + refreshTime: (value) { + if (value != null && value.startDate != null) { + state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; + if (value.endDate != null) { + if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { + state.customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; } else { - state.dateStart = startTime ?? ''; - state.dateEnd = endTime ?? ''; + state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; } + } + } + }, + ); + }), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 10.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { state.page = 1; logic.getList(); - // _refreshController2.callRefresh(); }, - refreshTime: (value) { - if (value != null && value.startDate != null) { - state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? ''; - if (value.endDate != null) { - if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) { - state.customTimeStr.value = '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}'; - } else { - state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}'; - } - } + onLoad: () async { + if (state.page < state.totalPages) { + state.page += 1; + logic.getList(); } }, - ); - }), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 10.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - state.page = 1; - logic.getList(); - }, - onLoad: () async { - if (state.page < state.totalPages) { - state.page += 1; - logic.getList(); - } - }, - child: state.dataList.isNotEmpty - ? ListView.builder( + child: state.dataList.isNotEmpty + ? ListView.builder( itemCount: state.dataList.value.length, itemBuilder: (context, index) { KnowledgePointsGrasp item = state.dataList[index]; @@ -176,7 +174,7 @@ class _KnowledgePointsGraspPageState extends State { 'dateEnd': state.dateEnd, 'knowledgeId': item.knowledgeId, 'knowledgeName': item.knowledgeName, - 'subject':state.subject + 'subject': state.subject }); }, child: Container( @@ -193,9 +191,9 @@ class _KnowledgePointsGraspPageState extends State { children: [ Expanded( child: Text( - item.knowledgeName, - style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), - )), + item.knowledgeName, + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF505050)), + )), Container( width: 49.r, height: 22.r, @@ -211,11 +209,16 @@ class _KnowledgePointsGraspPageState extends State { '${item.count}次', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor), ), - Image.asset( - 'assets/images/job_data_right_icon.png', - width: 10.r, - height: 10.r, + SizedBox(width: 1.w), + Padding( + padding: EdgeInsets.only(top: 2.h), + child: Icon(Icons.chevron_right, size: 12.r, color: Theme.of(context).primaryColor), ), + // Image.asset( + // 'assets/images/job_data_right_icon.png', + // width: 10.r, + // height: 10.r, + // ), ], ), ), @@ -226,7 +229,7 @@ class _KnowledgePointsGraspPageState extends State { ), ProgressBar( title: '正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.correctRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), @@ -235,15 +238,15 @@ class _KnowledgePointsGraspPageState extends State { ), ); }) - : const MyEmptyWidget(), - ); - }), - ), - ), - ], + : const MyEmptyWidget(), + ); + }), + ), ), - ); - }); + ], + ), + ); + }); } @override diff --git a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart index df6e4ea..e5c2de0 100644 --- a/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart @@ -15,7 +15,7 @@ import 'package:making_school_asignment_app/page/global_widget/show_student_list import 'knowledge_points_grasp_detail_logic.dart'; class KnowledgePointsGraspDetailPage extends StatefulWidget { - const KnowledgePointsGraspDetailPage({Key? key}) : super(key: key); + const KnowledgePointsGraspDetailPage({super.key}); @override State createState() => _KnowledgePointsGraspDetailPageState(); @@ -70,42 +70,41 @@ class _KnowledgePointsGraspDetailPageState extends State Get.back(), - ), - actions: const [ - ReturnToHomepage(), - ], - elevation: 0, - ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 10.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - logic.getList(); - }, - onLoad: () async { - // getList(); - }, - child: state.dataList.isNotEmpty - ? ListView.builder( + return OrientationBuilder(builder: (BuildContext context, Orientation orientation) { + return Scaffold( + backgroundColor: const Color.fromRGBO(245, 245, 245, 1), + appBar: AppBar( + backgroundColor: Colors.white, + title: Obx(() { + return Text(state.knowledgeName.value, style: TextStyle(fontSize: 14.sp, color: const Color(0xFF333333))); + }), + centerTitle: true, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, color: Colors.black), + onPressed: () => Get.back(), + ), + actions: const [ + ReturnToHomepage(), + ], + elevation: 0, + ), + body: Padding( + padding: EdgeInsets.symmetric(vertical: 10.r), + child: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + logic.getList(); + }, + onLoad: () async { + // getList(); + }, + child: state.dataList.isNotEmpty + ? ListView.builder( itemCount: state.dataList.length, itemBuilder: (context, index) { KnowledgeReportDetail item = state.dataList[index]; @@ -132,32 +131,32 @@ class _KnowledgePointsGraspDetailPageState extends State { children: [ Text( '客观题', - style: TextStyle(fontSize: 14.sp, color: Color(0xFF5C5C5C), fontWeight: FontWeight.w600), - ), - SizedBox( - height: 20.r, + style: TextStyle(fontSize: 14.sp, color: const Color(0xFF5C5C5C), fontWeight: FontWeight.w600), ), + SizedBox(height: 20.r), ProgressBar( color: const Color.fromRGBO(76, 199, 147, 1), percent: double.parse(widget.kgtCorrectRate) / 100, @@ -80,19 +78,17 @@ class _KgtZgtTableState extends State { lineHeight: 10.h, marginEdg: EdgeInsets.only(top: 5.h), ), - SizedBox( - height: 10.r, - ), + SizedBox(height: 10.r), SizedBox( height: widget.kgReport.length > 10 ? 300.r : widget.kgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r), child: ReportTable( - headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率','标准答案', '优先批阅概况'], + headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '标准答案', '优先批阅概况'], bodyList: widget.kgReport, fixedCols: 1, fixedRows: 1, jobId: widget.homeworkId, studentCount: widget.studentCount, - subject:widget.subject, + subject: widget.subject, ), ), if (widget.kgReport.isEmpty) MyEmptyWidget(imgWidth: 100.r, imgHeight: 100.r, font: 8.sp), @@ -135,12 +131,12 @@ class _KgtZgtTableState extends State { marginEdg: EdgeInsets.only(top: 5.h), ), SizedBox( - height:10.r, + height: 10.r, ), SizedBox( height: widget.zgReport.length > 10 ? 300.r : widget.zgReport.length * 40.r + (Utils.isPad() == true ? 40.r : 65.r), child: ReportTable( - headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况','作答效率'], + headList: const ['题', '作答率', '作答人数', '作答正确率', '全班正确率', '查看原题', '优先批阅概况', '作答效率'], bodyList: widget.zgReport, fixedCols: 1, fixedRows: 1, diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart index ee5ad10..0c74896 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/report_table.dart @@ -56,8 +56,7 @@ class _ReportTableState extends State { builder: (BuildContext context) { return AlertDialog( contentPadding: EdgeInsets.all(20.r), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), content: SizedBox( width: MediaQuery.of(context).size.width * 0.5, height: MediaQuery.of(context).size.height * 0.4, @@ -65,49 +64,52 @@ class _ReportTableState extends State { children: [ Text( '作答效率', - style: TextStyle( - fontSize: 15.sp, - color: const Color(0xFF3C3C3C), - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500), ), Padding( - padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 10.r), + padding: EdgeInsets.symmetric(vertical: 20.r, horizontal: 10.r), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - mapIcon(const Color(0xFFB8A1FF)), - SizedBox(width: 5.r,), + mapIcon(const Color(0xFFB8A1FF)), + SizedBox( + width: 5.r, + ), mapTxt('优'), const Spacer(), mapIcon(const Color(0xFF4CC793)), - SizedBox(width: 5.r,), + SizedBox( + width: 5.r, + ), mapTxt('良'), const Spacer(), mapIcon(const Color(0xFF90E0BE)), - SizedBox(width: 5.r,), + SizedBox( + width: 5.r, + ), mapTxt('中'), const Spacer(), mapIcon(const Color(0xFFFF6B6B)), - SizedBox(width: 5.r,), + SizedBox( + width: 5.r, + ), mapTxt('差'), ], ), ), Expanded( - child: - - PieChart( + child: PieChart( PieChartData( borderData: FlBorderData(show: true), sectionsSpace: 0, centerSpaceRadius: 0, - sections: List.generate(overallTitles.length,(index) { + sections: List.generate(overallTitles.length, (index) { var e = overallTitles[index]; return PieChartSectionData( color: colorMap[index], value: e.count / widget.studentCount * 100, radius: 110, - // borderSide:BorderSide(color: const Color(0xFF273366),width: 0.5.r), + // borderSide:BorderSide(color: const Color(0xFF273366),width: 0.5.r), // title: e.title + (Utils.doubleToStringAsFixed(e.count / widget.studentCount * 100) + '%'), title: e.title + e.count.toString(), titleStyle: TextStyle(fontSize: 12.sp, color: Color(0xFFFFFFFF)), @@ -151,20 +153,14 @@ class _ReportTableState extends State { }); } - void showPeopleListDialog( - {required BuildContext context, - required String title, - required String questionNo, - required List arr, - List? dcList}) { + void showPeopleListDialog({required BuildContext context, required String title, required String questionNo, required List arr, List? dcList}) { showDialog( context: context, builder: (BuildContext context) { return AlertDialog( // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), contentPadding: EdgeInsets.all(20.r), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(15.r))), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))), content: SizedBox( width: MediaQuery.of(context).size.width * 0.7, height: MediaQuery.of(context).size.height * 0.7, @@ -174,10 +170,7 @@ class _ReportTableState extends State { Center( child: Text( title, - style: TextStyle( - fontSize: 15.sp, - color: const Color(0xFF3C3C3C), - fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 15.sp, color: const Color(0xFF3C3C3C), fontWeight: FontWeight.w500), ), ), SizedBox( @@ -187,18 +180,15 @@ class _ReportTableState extends State { children: [ Text( widget.isZG == true ? '主观题' : '客观题', - style: TextStyle( - fontSize: 14.sp, color: Theme.of(context).primaryColor), + style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor), ), Text( '―', - style: TextStyle( - fontSize: 14.sp, color: Theme.of(context).primaryColor), + style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor), ), Text( '第$questionNo题', - style: TextStyle( - fontSize: 14.sp, color: Theme.of(context).primaryColor), + style: TextStyle(fontSize: 14.sp, color: Theme.of(context).primaryColor), ), ], ), @@ -213,27 +203,21 @@ class _ReportTableState extends State { child: Center( child: Text( '未作答人', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ))), Expanded( flex: 1, child: Center( child: Text( '答对人数', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ))), Expanded( flex: 1, child: Center( child: Text( '答错人', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ))), ], ) @@ -241,8 +225,7 @@ class _ReportTableState extends State { padding: EdgeInsets.only(left: 15.r), child: Text( title, - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF6A6A6A)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF6A6A6A)), ), ), SizedBox( @@ -256,60 +239,41 @@ class _ReportTableState extends State { var item = arr[index]; return Container( padding: EdgeInsets.symmetric(vertical: 5.r), - color: - index.isOdd ? Colors.white : Color(0xFFF0F0F0), + color: index.isOdd ? Colors.white : Color(0xFFF0F0F0), child: Row( children: [ Expanded( flex: 1, child: InkWell( onTap: () { - goQuickCheckPersonalPath( - item['noAnswerStudents'] - .studentId); + goQuickCheckPersonalPath(item['noAnswerStudents'].studentId); }, child: Center( child: Text( - item['noAnswerStudents'] - ?.studentName ?? - '--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item['noAnswerStudents']?.studentName ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), )))), Expanded( flex: 1, child: InkWell( onTap: () { - goQuickCheckPersonalPath( - item['answerOkStudents'] - .studentId); + goQuickCheckPersonalPath(item['answerOkStudents'].studentId); }, child: Center( child: Text( - item['answerOkStudents'] - ?.studentName ?? - '--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item['answerOkStudents']?.studentName ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), )))), Expanded( flex: 1, child: InkWell( onTap: () { - goQuickCheckPersonalPath( - item['answerNgStudents'] - .studentId); + goQuickCheckPersonalPath(item['answerNgStudents'].studentId); }, child: Center( child: Text( - item['answerNgStudents'] - ?.studentName ?? - '--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + item['answerNgStudents']?.studentName ?? '--', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), )))), ], ), @@ -330,16 +294,11 @@ class _ReportTableState extends State { goQuickCheckPersonalPath(item.studentId); }, child: Container( - padding: EdgeInsets.symmetric( - vertical: 5.r, horizontal: 15.r), - color: index.isOdd - ? Colors.white - : Color(0xFFF0F0F0), + padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r), + color: index.isOdd ? Colors.white : Color(0xFFF0F0F0), child: Text( item.studentName! ?? '--', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF323232)), + style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)), ), ), ); @@ -357,65 +316,56 @@ class _ReportTableState extends State { void goQuickCheckPersonalPath(id) { if (id != null) { - Get.toNamed(Routes.studentPersonalPage, - arguments: {'studentId': id, 'homeworkId': widget.jobId,'subject':widget.subject}); + Get.toNamed(Routes.studentPersonalPage, arguments: {'studentId': id, 'homeworkId': widget.jobId, 'subject': widget.subject}); } } - void zdHandle(BuildContext context, String title, String questionNo, - List noAnswerStudents, List answerNgStudents, List answerOkStudents) { + void zdHandle(BuildContext context, String title, String questionNo, List noAnswerStudents, List answerNgStudents, List answerOkStudents) { List list = []; // Questions student = Questions('','',-1,-1,'',-1,'','',[],-1,-1,[] as double?); - if (noAnswerStudents.length > answerNgStudents.length && - noAnswerStudents.length > answerOkStudents.length) { + if (noAnswerStudents.length > answerNgStudents.length && noAnswerStudents.length > answerOkStudents.length) { for (int i = 0; i < noAnswerStudents.length; i++) { var obj = { 'noAnswerStudents': noAnswerStudents[i], - 'answerNgStudents': - answerNgStudents.length > i ? answerNgStudents[i] : null, - 'answerOkStudents': - answerOkStudents.length > i ? answerOkStudents[i] : null + 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null, + 'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null }; list.add(obj); } - } else if (answerNgStudents.length > noAnswerStudents.length && - answerNgStudents.length > answerOkStudents.length) { + } else if (answerNgStudents.length > noAnswerStudents.length && answerNgStudents.length > answerOkStudents.length) { for (int i = 0; i < answerNgStudents.length; i++) { var obj = { - 'noAnswerStudents': - noAnswerStudents.length > i ? noAnswerStudents[i] : null, + 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null, 'answerNgStudents': answerNgStudents[i], - 'answerOkStudents': - answerOkStudents.length > i ? answerOkStudents[i] : null + 'answerOkStudents': answerOkStudents.length > i ? answerOkStudents[i] : null }; list.add(obj); } - } else if (answerOkStudents.length > noAnswerStudents.length && - answerOkStudents.length > answerNgStudents.length) { + } else if (answerOkStudents.length > noAnswerStudents.length && answerOkStudents.length > answerNgStudents.length) { for (int i = 0; i < answerOkStudents.length; i++) { var obj = { - 'noAnswerStudents': - noAnswerStudents.length > i ? noAnswerStudents[i] : null, - 'answerNgStudents': - answerNgStudents.length > i ? answerNgStudents[i] : null, + 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null, + 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null, + 'answerOkStudents': answerOkStudents[i] + }; + list.add(obj); + } + } else { + for (int i = 0; i < answerOkStudents.length; i++) { + var obj = { + 'noAnswerStudents': noAnswerStudents.length > i ? noAnswerStudents[i] : null, + 'answerNgStudents': answerNgStudents.length > i ? answerNgStudents[i] : null, 'answerOkStudents': answerOkStudents[i] }; list.add(obj); } } - showPeopleListDialog( - context: context, - title: title, - questionNo: questionNo, - arr: list, - dcList: []); + showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: list, dcList: []); } - void dcHandle( - BuildContext context, String title, String questionNo, List arr) { - showPeopleListDialog( - context: context, title: title, questionNo: questionNo, arr: arr); + void dcHandle(BuildContext context, String title, String questionNo, List arr) { + showPeopleListDialog(context: context, title: title, questionNo: questionNo, arr: arr); } DataRow _getRow(int index, [Color? color]) { @@ -428,28 +378,18 @@ class _ReportTableState extends State { DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text(item.questionNo.toString(), - style: - TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), + child: Text(item.questionNo.toString(), style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), ), )), DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('${item.answerRate.toStringAsFixed(0)}%', - style: - TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), + child: Text('${item.answerRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: const Color(0xFF525252))), ), )), DataCell(InkWell( onTap: () { - zdHandle( - context, - '作答人数', - item.questionNo.toString(), - item.noAnswerStudents, - item.answerNgStudents, - item.answerOkStudents); + zdHandle(context, '作答人数', item.questionNo.toString(), item.noAnswerStudents, item.answerNgStudents, item.answerOkStudents); }, child: Center( child: Padding( @@ -457,9 +397,7 @@ class _ReportTableState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text('${item.answerCount}/${widget.studentCount}', - style: TextStyle( - fontSize: 10.sp, color: Theme.of(context).primaryColor)), + Text('${item.answerCount}/${widget.studentCount}', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor)), Image.asset( 'assets/images/green_right_icon.png', width: 12.r, @@ -470,19 +408,16 @@ class _ReportTableState extends State { ), ), )), - DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('${item.correctRate.toStringAsFixed(0)}%', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), + child: Text('${item.correctRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), ), )), DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text('${item.okRate.toStringAsFixed(0)}%', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), + child: Text('${item.okRate.toStringAsFixed(0)}%', style: TextStyle(fontSize: 10.sp, color: Color(0xFF525252))), ), )), DataCell(Center( @@ -494,30 +429,20 @@ class _ReportTableState extends State { if (item.questionPicture == null) { ToastUtils.showInfo('当前试题没有原题'); } else { - ImageDialog.showImgDialog( - context, item.questionPicture); + ImageDialog.showImgDialog(context, item.questionPicture); } }, child: Text('原题', - style: TextStyle( - fontSize: 10.sp, - color: widget.isZG == true - ? const Color(0xFFFF8A00) - : Theme.of(context).primaryColor)), + style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)), ) : Text(item.answer, - style: TextStyle( - fontSize: 10.sp, - color: widget.isZG == true - ? const Color(0xFFFF8A00) - : Theme.of(context).primaryColor)), + style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)), ), )), DataCell(InkWell( onTap: () { // List parts = item.priorityGeneral.split('人'); - dcHandle(context, '优先批阅答错人', item.questionNo.toString(), - item.priorityInfo); + dcHandle(context, '优先批阅答错人', item.questionNo.toString(), item.priorityInfo); }, child: Center( child: Padding( @@ -525,9 +450,7 @@ class _ReportTableState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text('${item.priorityInfo.length}人答错', - style: TextStyle( - fontSize: 10.sp, color: Theme.of(context).primaryColor)), + Text('${item.priorityInfo.length}人答错', style: TextStyle(fontSize: 10.sp, color: Theme.of(context).primaryColor)), Image.asset( 'assets/images/green_right_icon.png', width: 12.r, @@ -548,18 +471,10 @@ class _ReportTableState extends State { showAnswerEfficiency(item.overallTitles); }, child: Text('查看', - style: TextStyle( - fontSize: 10.sp, - color: widget.isZG == true - ? const Color(0xFFFF8A00) - : Theme.of(context).primaryColor)), + style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)), ) : Text(item.answer, - style: TextStyle( - fontSize: 10.sp, - color: widget.isZG == true - ? const Color(0xFFFF8A00) - : Theme.of(context).primaryColor)), + style: TextStyle(fontSize: 10.sp, color: widget.isZG == true ? const Color(0xFFFF8A00) : Theme.of(context).primaryColor)), ), )), ], @@ -577,16 +492,12 @@ class _ReportTableState extends State { dataRowHeight: 40.r, bottomMargin: 0, border: const TableBorder( - horizontalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - bottom: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid), - verticalInside: BorderSide( - width: 1, color: Colors.white, style: BorderStyle.solid)), - headingRowColor: MaterialStateProperty.resolveWith((states) => - widget.fixedCols! > 0 ? Colors.white : Colors.transparent), - headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)), - fixedColumnsColor: Color(0xFFE6E6E6), + horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid), + verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)), + headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent), + headingRowDecoration: const BoxDecoration(color: Color(0xFFE6E6E6)), + fixedColumnsColor: const Color(0xFFE6E6E6), fixedCornerColor: Colors.grey[400], minWidth: widget.headList.length > 6 ? 80.r * widget.headList.length @@ -601,65 +512,75 @@ class _ReportTableState extends State { columns: List.generate(widget.headList.length, (index) { var item = widget.headList[index]; return DataColumn2( - label: index == 3 ? - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), - SizedBox(width: 2.r,), - const Tooltip( - message: '答对人数/作答人数', - triggerMode: TooltipTriggerMode.tap, - preferBelow:false, - child: Icon(Icons.info_outline_rounded,color: Colors.grey,)), - ], - ): - index == 4 ?Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), - SizedBox(width: 2.r,), - const Tooltip( - message: '答对人数/总人数', - triggerMode: TooltipTriggerMode.tap, - preferBelow:false, - child: Icon(Icons.info_outline_rounded,color: Colors.grey,)), - ], - ): - Center( - child: Text(item, - style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))), - ), + label: index == 3 + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))), + SizedBox( + width: 2.r, + ), + const Tooltip( + message: '答对人数/作答人数', + triggerMode: TooltipTriggerMode.tap, + preferBelow: false, + child: Icon( + Icons.info_outline_rounded, + color: Colors.grey, + )), + ], + ) + : index == 4 + ? Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))), + SizedBox( + width: 2.r, + ), + const Tooltip( + message: '答对人数/总人数', + triggerMode: TooltipTriggerMode.tap, + preferBelow: false, + child: Icon( + Icons.info_outline_rounded, + color: Colors.grey, + )), + ], + ) + : Center( + child: Text(item, style: TextStyle(fontSize: 10.sp, color: const Color(0xFF505767))), + ), // size: ColumnSize.S, fixedWidth: index == 0 ? 40.r : widget.headList.length > 6 ? 80.r : isPadFlag - ? (MediaQuery.of(context).size.width - 8.r) / - widget.headList.length + ? (MediaQuery.of(context).size.width - 8.r) / widget.headList.length : 85.r, ); }), - rows: List.generate(widget.bodyList.length, - (index) => _getRow(index, Color(0xFFF5F5F5)))); + rows: List.generate(widget.bodyList.length, (index) => _getRow(index, const Color(0xFFF5F5F5)))); } } -Widget mapIcon(Color bgColor){ -return Container( - width: 12.r, - height: 12.r, - decoration: BoxDecoration( - color: bgColor, - borderRadius: BorderRadius.all(Radius.circular(6.r)), - ), -); +Widget mapIcon(Color bgColor) { + return Container( + width: 12.r, + height: 12.r, + decoration: BoxDecoration( + color: bgColor, + borderRadius: BorderRadius.all(Radius.circular(6.r)), + ), + ); +} + +Widget mapTxt(String title) { + return Text( + title, + style: TextStyle(fontSize: 12.sp, color: const Color(0xFF525252), fontWeight: FontWeight.w400), + ); } -Widget mapTxt(String title){ - return Text(title,style: TextStyle(fontSize: 12.sp,color: Color(0xFF525252),fontWeight: FontWeight.w400),); -} \ No newline at end of file diff --git a/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart index 370098c..4120d9d 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_logic.dart @@ -11,13 +11,35 @@ class StudentPersonalLogic extends GetxController with RequestToolMixin { void onInit() { super.onInit(); state.studentId = Get.arguments['studentId']; - state.subject = Get.arguments['subject']??-1; + state.subject = Get.arguments['subject'] ?? -1; state.homeworkId = Get.arguments['homeworkId']; getInfo(); } void getInfo() async { StudentPersonalInfo data = await getClient().getStudentHomework(state.homeworkId, state.studentId); + data.kgtList.sort((a, b) { + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } + }); + data.zgtList.sort((a, b) { + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } + }); state.studentInfo.value = data; } } diff --git a/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart index ac1d347..faa4a47 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_personal/student_personal_view.dart @@ -11,7 +11,7 @@ import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'student_personal_logic.dart'; class StudentPersonalPage extends StatefulWidget { - const StudentPersonalPage({Key? key}) : super(key: key); + const StudentPersonalPage({super.key}); @override State createState() => _StudentPersonalPageState(); @@ -54,8 +54,11 @@ class _StudentPersonalPageState extends State { onTap: () { // RouterManager.router.navigateTo(context, // '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(state.studentInfo.studentName!)}'); - Get.toNamed(Routes.studentWorkDetailPage, - arguments: {'studentId': state.studentInfo.value.studentId, 'studentName': state.studentInfo.value.studentName,'subject':state.subject}); + Get.toNamed(Routes.studentWorkDetailPage, arguments: { + 'studentId': state.studentInfo.value.studentId, + 'studentName': state.studentInfo.value.studentName, + 'subject': state.subject + }); }, child: Container( width: 93.r, diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart index 797bc81..ee13754 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart @@ -31,19 +31,43 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi studentId: state.studentId, dateStart: state.dateStart, dateEnd: state.dateEnd, - subject:state.subject, + subject: state.subject, pageNumber: state.page, pageSize: 10, ); StudentHistory data = await getClient().getStudentHistory(params); + data.items.items.forEach((e) { + e.kgtList.sort((a, b) { + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } + }); + e.zgtList.sort((a, b) { + try { + if (RegExp(r'^\d*\.?\d+$').hasMatch(a.questionNo) && RegExp(r'^\d*\.?\d+$').hasMatch(b.questionNo)) { + return num.parse(a.questionNo).compareTo(num.parse(b.questionNo)); + } else { + throw Exception(); + } + } catch (e) { + return a.questionNo.toLowerCase().compareTo(b.questionNo.toLowerCase()); + } + }); + }); state.studentData.value = data; - /* state.kgtLine.value = [{'id':0,'rate':0}]; + /* state.kgtLine.value = [{'id':0,'rate':0}]; state.zgtLine.value = [{'id':0,'rate':0}]; state.allLine.value = [{'id':0,'rate':0}];*/ state.kgtLine.value = []; state.zgtLine.value = []; state.allLine.value = []; - for (var i = 0;i=3.4.1 <4.0.0' diff --git a/making_school_asignment_app/web/index.html b/making_school_asignment_app/web/index.html index be6f12e..d2e2c0e 100644 --- a/making_school_asignment_app/web/index.html +++ b/making_school_asignment_app/web/index.html @@ -197,6 +197,8 @@ + + From 87b2b75f4e700c60e496950fe2b4097eac7197dd Mon Sep 17 00:00:00 2001 From: "1147192855@qq.com" <1147192855@qq.com> Date: Fri, 14 Mar 2025 11:45:11 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- making_school_asignment_app/appcast.xml | 16 ++++++++-------- .../windows/runner/main.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/making_school_asignment_app/appcast.xml b/making_school_asignment_app/appcast.xml index 0b2c6ed..e94316d 100644 --- a/making_school_asignment_app/appcast.xml +++ b/making_school_asignment_app/appcast.xml @@ -29,7 +29,7 @@ type="application/octet-stream" /> --> - Version 1.0.1+2 + Version 1.0.2+3 #发行说明-读取html方式(2选1) - Version 1.0.2+3 + Version 1.0.3+4 #发行说明-读取html方式(2选1)