diff --git a/marking_app/lib/common/model/job/job_knowledge_detail_student.dart b/marking_app/lib/common/model/job/job_knowledge_detail_student.dart new file mode 100644 index 0000000..43f34b2 --- /dev/null +++ b/marking_app/lib/common/model/job/job_knowledge_detail_student.dart @@ -0,0 +1,29 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'job_knowledge_detail_student.g.dart'; + + +@JsonSerializable() +class JobKnowledgeDetailStudent extends Object { + + @JsonKey(name: 'studentId') + int studentId; + + @JsonKey(name: 'studentName') + String studentName; + + @JsonKey(name: 'isAnswer') + bool isAnswer; + + @JsonKey(name: 'isCorrect') + bool isCorrect; + + JobKnowledgeDetailStudent(this.studentId,this.studentName,this.isAnswer,this.isCorrect,); + + factory JobKnowledgeDetailStudent.fromJson(Map srcJson) => _$JobKnowledgeDetailStudentFromJson(srcJson); + + Map toJson() => _$JobKnowledgeDetailStudentToJson(this); + +} + + diff --git a/marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart b/marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart new file mode 100644 index 0000000..9a570b7 --- /dev/null +++ b/marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'job_knowledge_detail_student.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +JobKnowledgeDetailStudent _$JobKnowledgeDetailStudentFromJson( + Map json) => + JobKnowledgeDetailStudent( + json['studentId'] as int, + json['studentName'] as String, + json['isAnswer'] as bool, + json['isCorrect'] as bool, + ); + +Map _$JobKnowledgeDetailStudentToJson( + JobKnowledgeDetailStudent instance) => + { + 'studentId': instance.studentId, + 'studentName': instance.studentName, + 'isAnswer': instance.isAnswer, + 'isCorrect': instance.isCorrect, + }; diff --git a/marking_app/lib/pages/homework_correction/index.dart b/marking_app/lib/pages/homework_correction/index.dart index 8bee856..b3314ad 100644 --- a/marking_app/lib/pages/homework_correction/index.dart +++ b/marking_app/lib/pages/homework_correction/index.dart @@ -274,23 +274,6 @@ class _HomeworkCorrectionState extends ConsumerState ), ), - /* Row( - children: [ - InkWell( - onTap: (){ - RouterManager.router.navigateTo( - context, - RouterManager.jobKnowledgePointsPath, - transition: getTransition(), - ); - }, - child: SizedBox( - height: 30.r, - child: Text('知识点掌握')), - ), - ], - ),*/ - if (_tabIndex == 1) $CompletedJobConditionFilter( controller: _tabController2, diff --git a/marking_app/lib/pages/homework_correction/job_knowledge_points.dart b/marking_app/lib/pages/homework_correction/job_knowledge_points.dart index dd410b2..d114935 100644 --- a/marking_app/lib/pages/homework_correction/job_knowledge_points.dart +++ b/marking_app/lib/pages/homework_correction/job_knowledge_points.dart @@ -67,7 +67,7 @@ class _JobKnowledgePointsState extends State with CommonMixi print('endDataTime=$endDataTime'); RestClient _client = await getClient(); BaseStructureResult> res = - await _client.getKnowledgeReport(textController.text); + await _client.getKnowledgeReport(startDataTime,endDataTime,textController.text); if (res.success) { setState(() { if (page == 1) { @@ -317,7 +317,6 @@ Widget progressBar( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize), quickText(title, color: Color(0xFF8B8B8B), size: fontSize), Expanded( flex: 1, @@ -360,7 +359,7 @@ Widget progressBar( ), ), SizedBox(width: 4.w), - quickText(percentStr, size: fontSize, color: Color(0xFF464646)) + quickText(percentStr, size: fontSize, color: Color(0xFF606060)) ], ), ), diff --git a/marking_app/lib/pages/homework_correction/job_knowledge_points_detail.dart b/marking_app/lib/pages/homework_correction/job_knowledge_points_detail.dart index f5be7a1..8506b57 100644 --- a/marking_app/lib/pages/homework_correction/job_knowledge_points_detail.dart +++ b/marking_app/lib/pages/homework_correction/job_knowledge_points_detail.dart @@ -6,6 +6,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/model/common/base_structure_result.dart'; +import 'package:marking_app/common/model/job/job_knowledge_detail_student.dart'; import 'package:marking_app/common/model/job/job_knowledge_points.dart'; import 'package:marking_app/common/model/job/job_knowledge_points_detail.dart'; import 'package:marking_app/common/model/job/job_student_history.dart'; @@ -17,41 +18,36 @@ import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/my_text.dart'; import 'package:marking_app/utils/request/rest_client.dart'; import 'package:percent_indicator/percent_indicator.dart'; +import 'package:photo_view/photo_view.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart'; - class JobKnowledgePointsDetail extends StatefulWidget { -final String knowledgeName; -final int knowledgeId; - const JobKnowledgePointsDetail({Key? key,required this.knowledgeName,required this.knowledgeId}) : super(key: key); + final String knowledgeName; + final int knowledgeId; + + const JobKnowledgePointsDetail( + {Key? key, required this.knowledgeName, required this.knowledgeId}) + : super(key: key); @override - _JobKnowledgePointsDetailState createState() => _JobKnowledgePointsDetailState(); + _JobKnowledgePointsDetailState createState() => + _JobKnowledgePointsDetailState(); } -class _JobKnowledgePointsDetailState extends State with CommonMixin, TickerProviderStateMixin { +class _JobKnowledgePointsDetailState extends State + with CommonMixin, TickerProviderStateMixin { @override - int page = 1; - int pageSize = 10; - int totalPages = 0; - late TabController tabController; - String startDataTime = CommonUtils.getWeekStartDate().toString().substring(0, 10); - String endDataTime = CommonUtils.getWeekEndDate().toString().substring(0, 10); - String customTimeStr = '自定义'; List dataList = []; + List studentList = []; late final EasyRefreshController refreshController; + String paperImg = ''; - //文本输入框控制器 - late final TextEditingController textController; - int studentId = 0; + int studentId = 0; @override void initState() { super.initState(); - textController = TextEditingController(); - refreshController = EasyRefreshController(); - tabController = TabController(length: 3, vsync: this); EasyLoading.show(status: 'loading...'); getList(); } @@ -59,36 +55,135 @@ class _JobKnowledgePointsDetailState extends State wit @override void dispose() { super.dispose(); - tabController.dispose(); - textController.dispose(); } void getList() async { RestClient _client = await getClient(); BaseStructureResult> res = - await _client.getKnowledgeReportDetail(widget.knowledgeId); + await _client.getKnowledgeReportDetail(widget.knowledgeId); if (res.success) { setState(() { - if (page == 1) { - dataList = res.data!; - } else { - dataList = [...dataList, ...res.data!]; - } - - // totalPages = res.data!.pagedList.totalPages; + dataList = res.data!; }); } EasyLoading.dismiss(); } + showStudent(questionid, title) async { + await getStudents(questionid); + + showModalBottomSheet( + context: context, + elevation: 10, + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20.r), + topRight: Radius.circular(20.r), + ), + ), + builder: (BuildContext context) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 2.w), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 14.h), + child: quickText( + title, + size: 18.sp, + fontWeight: FontWeight.bold, + color: Color.fromRGBO(60, 60, 60, 1), + ), + ), + Expanded( + child: ListView( + padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 4.w), + children: [ + Wrap( + spacing: 6.r, // 主轴(水平)方向间距 + runSpacing: 4.r, // 纵轴(垂直)方向间距 + alignment: WrapAlignment.spaceAround, //沿主轴方向居中 + children: studentList.map((e) { + return Container( + padding: EdgeInsets.symmetric( + vertical: 4.r, horizontal: 8.r), + decoration: BoxDecoration( + color: e.isAnswer + ? Color(0xFF4CC793) + : Color(0xFFE2E2E2), + borderRadius: BorderRadius.circular(4.r), + ), + child: quickText(e.studentName, + color: + e.isAnswer ? Colors.white : Color(0xFF505E6E), + size: 10.sp), + ); + }).toList(), + ), + ], + ), + ) + ], + ), + ); + }, + ); + EasyLoading.dismiss(); + } + + showImg(int sectionId, String questionNo) async { + await getImg(sectionId, questionNo); + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + insetPadding: EdgeInsets.symmetric(vertical: 55.r,horizontal: 45.r), + contentPadding: EdgeInsets.all(0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(15.r))), + content: Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height, + child: Image.network(paperImg), + ), + ); + }, + ); + EasyLoading.dismiss(); + } + + getStudents(questionid) async { + RestClient _client = await getClient(); + BaseStructureResult> res = + await _client.getKnowledgeStudent(questionid); + if (res.success) { + studentList = res.data!; + } else { + studentList = []; + } + } + + getImg(int sectionId, String questionNo) async { + RestClient _client = await getClient(); + BaseStructureResult res = + await _client.getKnowledgeImg(sectionId, questionNo); + if (res.success) { + paperImg = res.data!; + } else { + paperImg = ''; + } + } + @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color.fromRGBO(245, 245, 245, 1), appBar: AppBar( backgroundColor: Colors.white, - title: Text(widget.knowledgeName, style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), + title: Text(widget.knowledgeName, + style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))), centerTitle: true, leading: IconButton( icon: Icon(Icons.arrow_back_ios, color: Colors.black), @@ -99,197 +194,177 @@ class _JobKnowledgePointsDetailState extends State wit ], 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: 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: (){ - page = 1; - setState(() {}); - getList(); - }, - child: Container( - width: 50.r, - height: 30.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4.r), - color: Color(0xFF6888FD), - ), - child:Center( - child: Text('查询',style: TextStyle(fontSize: 12.sp,color: Colors.white),), - ), - ), - ) - ], - ), - ), - - - jobConditionFilter(context, - controller: tabController, - customTimeStr: customTimeStr, - customTime: tabController.index != 3 || - ((endDataTime == null || endDataTime == '') && (startDataTime == null || startDataTime == '')) - ? null - : PickerDateRange( - startDataTime == null || startDataTime == '' ? null : DateTime.parse(startDataTime!), - endDataTime == null || endDataTime == '' ? null : DateTime.parse(endDataTime!), - ), onTimeFilter: (String? startTime, String? endTime) { - EasyLoading.show(status: 'loading...'); - if (startTime == null && endTime == null) { - if (tabController.index == 3) { - tabController.animateTo(0); - } - startDataTime = ''; - endDataTime = ''; - customTimeStr = '自定义'; - } else { - startDataTime = startTime != null ? startTime : ''; - endDataTime = endTime != null ? endTime : ''; - } - page = 1; - setState(() {}); - getList(); - // _refreshController2.callRefresh(); - }, refreshTime: (value) { - if (value != null && value.startDate != null) { - customTimeStr = value.startDate?.toString().substring(0, 10) ?? ''; - setState(() {}); - if (value.endDate != null) { - if (!isPad() && value.startDate!.year == value.endDate!.year) { - customTimeStr = - value.startDate.toString().substring(5, 10) + '~${value.endDate.toString().substring(5, 10)}'; - setState(() {}); - } else { - customTimeStr = '$customTimeStr~${value.endDate?.toString().substring(0, 10)}'; - setState(() {}); - } - } - } - }), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 10.r), - child: EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - setState(() { - page = 1; - }); - getList(); - }, - onLoad: () async { - if (page < totalPages) { - setState(() { - page += 1; - }); - getList(); - } - }, - child: dataList.length > 0 - ? ListView.builder( - itemCount: dataList.length, - itemBuilder: (context, index) { - KnowledgePointsDetail item = dataList[index]; - return InkWell( - onTap: () { + body: Padding( + padding: EdgeInsets.symmetric(vertical: 10.r), + child: EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + getList(); + }, + onLoad: () async { + // getList(); + }, + child: dataList.length > 0 + ? ListView.builder( + itemCount: dataList.length, + itemBuilder: (context, index) { + KnowledgePointsDetail item = dataList[index]; + return InkWell( + onTap: () { /* RouterManager.router.navigateTo( - context, - RouterManager.quickCheckPersonalPath + - '?jobId=${item.jobName}&studentId=$studentId', - transition: getTransition(), - );*/ - }, - child: Container( - margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r), - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10.r)), - color: Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Text( - item.jobName, - style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)), - )), - - Container( + context, + RouterManager.quickCheckPersonalPath + + '?jobId=${item.jobName}&studentId=$studentId', + transition: getTransition(), + );*/ + }, + child: Container( + margin: EdgeInsets.symmetric( + vertical: 5.r, horizontal: 14.r), + padding: EdgeInsets.symmetric( + vertical: 14.r, horizontal: 10.r), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10.r)), + color: Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + item.publishTime.substring(0, 10), + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF505050)), + ), + SizedBox( + width: 10.r, + ), + Expanded( + child: Text( + item.jobName, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF505050)), + )), + InkWell( + onTap: () { + EasyLoading.show(status: 'loading...'); + showImg(item.sectionId, item.questionNo); + }, + child: Container( width: 49.r, height: 22.r, decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.r)), - border: Border.all(width: 1.r, color: Color(0xFF6888FD)), + borderRadius: BorderRadius.all( + Radius.circular(20.r)), + border: Border.all( + width: 1.r, color: Color(0xFF8B8B8B)), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '2次', - style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)), + child: Center( + child: Text( + '${item.questionNo}题', + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF8B8B8B)), + ), + ), + ), + ), + ], + ), + SizedBox( + height: 10.r, + ), + Container( + margin: EdgeInsets.only(top: 8.h), + padding: EdgeInsets.zero, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () { + EasyLoading.show(status: 'loading...'); + showStudent( + item.questionId, item.jobName); + }, + child: Container( + margin: EdgeInsets.only(right: 6.r), + width: 56.r, + height: 20.r, + decoration: BoxDecoration( + color: Color(0xFFD4FFED), + borderRadius: + BorderRadius.circular(20.r), ), - Image.asset('assets/images/right_icon_blue.png',width: 8.r,height: 8.r,), - ], + child: Center( + child: quickText('正确率 >', + color: Color(0xFF4CC793), + size: 10.sp))), + ), + Expanded( + flex: 1, + child: Container( + child: Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(10.r), + ), + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 8.h, + animationDuration: 2500, + percent: item.correctRate / 100, + progressColor: + Color(0xFF90E0BE), + backgroundColor: + Color(0xFFE8E8E8), + barRadius: + Radius.circular(10.r), + ), + ), + ), + SizedBox(width: 4.w), + quickText( + '${doubleToStringAsFixed(item.correctRate / 100 * 100)}%', + size: 10.sp, + color: Color(0xFF606060)) + ], + ), ), ), ], ), - SizedBox(height: 10.r,), - progressBar(context, - title: '正确率:', - color: Color(0xFF90E0BE), - percent: item.correctRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ], - ), + ), + /* progressBar(context, + title: '正确率 >', + color: Color(0xFF90E0BE), + percent: item.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h), + studentCall:showStudent(item.questionId,item.jobName), + ),*/ + ], ), - ); - }) - : MyEmptyWidget(), - ), - ), - ), - ], + ), + ); + }) + : MyEmptyWidget(), + ), ), ); } @@ -297,15 +372,16 @@ class _JobKnowledgePointsDetailState extends State wit @swidget Widget progressBar( - BuildContext context, { - double? fontSize, - double? lineHeight, - required String title, - required Color color, - required double percent, - required EdgeInsets padingEdg, - required EdgeInsets marginEdg, - }) { + BuildContext context, { + double? fontSize, + double? lineHeight, + required String title, + required Color color, + required double percent, + required EdgeInsets padingEdg, + required EdgeInsets marginEdg, + required Future studentCall, +}) { var percentStr = '${doubleToStringAsFixed(percent * 100)}%'; fontSize ??= 10.sp; lineHeight ??= 8.h; @@ -316,8 +392,22 @@ Widget progressBar( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize), - quickText(title, color: Color(0xFF8B8B8B), size: fontSize), + InkWell( + onTap: () { + studentCall; + }, + child: Container( + margin: EdgeInsets.only(right: 6.r), + width: 56.r, + height: 20.r, + decoration: BoxDecoration( + color: Color(0xFFD4FFED), + borderRadius: BorderRadius.circular(20.r), + ), + child: Center( + child: quickText(title, + color: Color(0xFF4CC793), size: fontSize))), + ), Expanded( flex: 1, child: Container( @@ -359,7 +449,7 @@ Widget progressBar( ), ), SizedBox(width: 4.w), - quickText(percentStr, size: fontSize, color: Color(0xFF464646)) + quickText(percentStr, size: fontSize, color: Color(0xFF606060)) ], ), ), @@ -368,119 +458,3 @@ Widget progressBar( ), ); } - -/// 已完成作业条件筛选栏 -@hwidget -Widget jobConditionFilter(BuildContext context, - {required TabController controller, - PickerDateRange? customTime, - required Function refreshTime, - required String customTimeStr, - required Function(String? startTime, String? endTime) onTimeFilter}) { - var customTimeState = PickerDateRange(null, null); - if (customTime != null) { - customTimeState = PickerDateRange(customTime!.startDate != null ? customTime!.startDate : null, - customTime!.endDate != null ? customTime!.endDate : null); - } - - DateTime getMonthStartDate() { - DateTime now = DateTime.now(); - return DateTime(now.year, now.month, 1); // 获取当前月份的第一天 - } - - DateTime getMonthEndDate() { - DateTime now = DateTime.now(); - int nextMonth = now.month + 1; - if (nextMonth > 12) { - nextMonth = 1; - now = now.add(Duration(days: 31 - now.day)); // 跨年了,所以加到当前月的最后一天 - } else { - now = now.add(Duration(days: DateTime(now.year, nextMonth, 0).day - now.day)); // 加到下个月的第一天的前一天,即本月最后一天 - } - return now; - } - - return Container( - // height: 39.h, - // padding: EdgeInsets.only(left: 4.w, right: 12.w), - decoration: BoxDecoration( - color: Color.fromRGBO(244, 244, 244, 1), - // border: Border(bottom: BorderSide(color: Color.fromRGBO(204, 204, 204, 1), width: 1)), - ), - child: Container( - alignment: Alignment.centerLeft, - decoration: BoxDecoration( - border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC))) - ), - child: TabBar( - controller: controller, - unselectedLabelStyle: TextStyle(fontSize: 12.sp, color: const Color.fromRGBO(102, 102, 102, 1)), - labelStyle: TextStyle( - fontSize: 12.sp, - fontWeight: FontWeight.bold, - color: Color.fromRGBO(116, 145, 253, 1), - ), - isScrollable: true, - labelColor: Color(0xFF6888FD), - unselectedLabelColor: Color(0xFF666666), - padding: EdgeInsets.symmetric(horizontal: 14.r), - // indicatorSize: TabBarIndicatorSize.label, // 设置指示器高度和标签一样高 - onTap: (int val) async { - switch (val) { - case 0: // 近一周 - onTimeFilter( - CommonUtils.getWeekStartDate().toString().substring(0, 10), - CommonUtils.getWeekEndDate().toString().substring(0, 10), - ); - break; - case 1: // 近一个月 - onTimeFilter( - getMonthStartDate().toString().substring(0, 10), - getMonthEndDate().toString().substring(0, 10), - ); - break; - default: // 自定义 - var dialogData = await showDialog( - context: context, - builder: (BuildContext context1) { - return Center( - child: Container( - color: Colors.white, - width: isPad() ? ScreenUtil().screenWidth / 2 : ScreenUtil().screenWidth / 1.3, - height: ScreenUtil().screenHeight / 2, - child: SfDateRangePicker( - showActionButtons: true, - confirmText: '确定', - cancelText: '取消', - onSubmit: (p0) { - print(p0); - Navigator.of(context1).pop(p0); - refreshTime(p0); - }, - onCancel: () { - Navigator.of(context1).pop(); - }, - selectionMode: DateRangePickerSelectionMode.range, - initialSelectedRange: customTimeState, - ), - ), - ); - }); - // startDate: 2024-03-04 18:47:00.117958, endDate: 2024-03-11 18:47:00.117986 - // if (dialogData != null && (dialogData.startDate != null || dialogData.endDate != null)) {} - onTimeFilter( - dialogData?.startDate?.toString().substring(0, 10), - dialogData?.endDate?.toString().substring(0, 10), - ); - customTimeState = dialogData!; - } - }, - tabs: [ - const Tab(text: '近一周'), - const Tab(text: '近一月'), - Tab(text: customTimeStr), - ], - ), - ), - ); -} diff --git a/marking_app/lib/utils/request/rest_client.dart b/marking_app/lib/utils/request/rest_client.dart index 614d087..6d8789a 100644 --- a/marking_app/lib/utils/request/rest_client.dart +++ b/marking_app/lib/utils/request/rest_client.dart @@ -19,6 +19,7 @@ import 'package:marking_app/common/model/job/job_data_report.dart'; import 'package:marking_app/common/model/job/job_do_marking_status_info.dart'; import 'package:marking_app/common/model/job/job_fav_student.dart'; import 'package:marking_app/common/model/job/job_favorite_model.dart'; +import 'package:marking_app/common/model/job/job_knowledge_detail_student.dart'; import 'package:marking_app/common/model/job/job_knowledge_points.dart'; import 'package:marking_app/common/model/job/job_knowledge_points_detail.dart'; import 'package:marking_app/common/model/job/job_level_set_params.dart'; @@ -360,8 +361,8 @@ abstract class RestClient { // 作业 => 知识点掌握 @the_retrofit.GET("/api/jobs/knowledge-report") Future>> getKnowledgeReport( - /* @the_retrofit.Query("dateStart") String? dateStart, - @the_retrofit.Query("dateEnd") String? dateEnd,*/ + @the_retrofit.Query("dateStart") String? dateStart, + @the_retrofit.Query("dateEnd") String? dateEnd, @the_retrofit.Query("knowledgeName") String? knowledgeName, ); @@ -370,4 +371,17 @@ abstract class RestClient { Future>> getKnowledgeReportDetail( @the_retrofit.Query("KnowledgeId") int knowledgeId, ); + + // 作业 => 知识点掌握详情人员名单 + @the_retrofit.GET("/api/jobs/knowledge-question-detail/{questionid}") + Future>> getKnowledgeStudent( + @the_retrofit.Path("questionid") int questionid, + ); + + // 作业 => 知识点掌握详情原卷图 + @the_retrofit.GET("/api/jobs/question-paper-img/{sectionid}/{questionno}") + Future> getKnowledgeImg( + @the_retrofit.Path("sectionid") int questionid, + @the_retrofit.Path("questionno") String questionno, + ); }