Compare commits

..

No commits in common. "42d2e4ab3944b971c63dfb4f296ef66f57b891d7" and "326a2fe99e9b435a03de419bc7289e310ae25b83" have entirely different histories.

10 changed files with 374 additions and 444 deletions

View File

@ -1,29 +0,0 @@
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<String, dynamic> srcJson) => _$JobKnowledgeDetailStudentFromJson(srcJson);
Map<String, dynamic> toJson() => _$JobKnowledgeDetailStudentToJson(this);
}

View File

@ -1,25 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'job_knowledge_detail_student.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
JobKnowledgeDetailStudent _$JobKnowledgeDetailStudentFromJson(
Map<String, dynamic> json) =>
JobKnowledgeDetailStudent(
json['studentId'] as int,
json['studentName'] as String,
json['isAnswer'] as bool,
json['isCorrect'] as bool,
);
Map<String, dynamic> _$JobKnowledgeDetailStudentToJson(
JobKnowledgeDetailStudent instance) =>
<String, dynamic>{
'studentId': instance.studentId,
'studentName': instance.studentName,
'isAnswer': instance.isAnswer,
'isCorrect': instance.isCorrect,
};

View File

@ -274,6 +274,23 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
),
),
/* 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,

View File

@ -34,9 +34,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
EntranceModel(
title: '学生历史作业',
image: '',
navigationUrl: RouterManager.jobStudentGroupPath,
page:'history',
navigationUrl: '',
),
EntranceModel(
title: '知识点掌握',
@ -52,7 +50,6 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
title: '优先批阅设定',
image: '',
navigationUrl: RouterManager.jobStudentGroupPath,
page:'set',
),
EntranceModel(
title: '批阅设置',
@ -146,12 +143,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
return InkWell(
onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
if(e.page != ''){
RouterManager.router.navigateTo(context, '${e.navigationUrl}?page=${e.page}', transition: getTransition());
}else{
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
}
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
}),
child: badges.Badge(
showBadge: isJob && data > 0,
@ -196,6 +188,5 @@ class EntranceModel extends Object {
String title;
String image;
String navigationUrl;
String? page;
EntranceModel({required this.title, required this.image, required this.navigationUrl,this.page = ''});
EntranceModel({required this.title, required this.image, required this.navigationUrl});
}

View File

@ -67,7 +67,7 @@ class _JobKnowledgePointsState extends State<JobKnowledgePoints> with CommonMixi
print('endDataTime=$endDataTime');
RestClient _client = await getClient();
BaseStructureResult<List<KnowledgePoints>> res =
await _client.getKnowledgeReport(startDataTime,endDataTime,textController.text);
await _client.getKnowledgeReport(textController.text);
if (res.success) {
setState(() {
if (page == 1) {
@ -317,6 +317,7 @@ 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,
@ -359,7 +360,7 @@ Widget progressBar(
),
),
SizedBox(width: 4.w),
quickText(percentStr, size: fontSize, color: Color(0xFF606060))
quickText(percentStr, size: fontSize, color: Color(0xFF464646))
],
),
),

View File

@ -6,7 +6,6 @@ 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';
@ -18,36 +17,41 @@ 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);
class JobKnowledgePointsDetail extends StatefulWidget {
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<JobKnowledgePointsDetail>
with CommonMixin, TickerProviderStateMixin {
class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> 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<KnowledgePointsDetail> dataList = [];
List<JobKnowledgeDetailStudent> studentList = [];
late final EasyRefreshController refreshController;
String paperImg = '';
int studentId = 0;
//
late final TextEditingController textController;
int studentId = 0;
@override
void initState() {
super.initState();
textController = TextEditingController();
refreshController = EasyRefreshController();
tabController = TabController(length: 3, vsync: this);
EasyLoading.show(status: 'loading...');
getList();
}
@ -55,135 +59,36 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail>
@override
void dispose() {
super.dispose();
tabController.dispose();
textController.dispose();
}
void getList() async {
RestClient _client = await getClient();
BaseStructureResult<List<KnowledgePointsDetail>> res =
await _client.getKnowledgeReportDetail(widget.knowledgeId);
await _client.getKnowledgeReportDetail(widget.knowledgeId);
if (res.success) {
setState(() {
dataList = res.data!;
if (page == 1) {
dataList = res.data!;
} else {
dataList = [...dataList, ...res.data!];
}
// totalPages = res.data!.pagedList.totalPages;
});
}
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<List<JobKnowledgeDetailStudent>> res =
await _client.getKnowledgeStudent(questionid);
if (res.success) {
studentList = res.data!;
} else {
studentList = [];
}
}
getImg(int sectionId, String questionNo) async {
RestClient _client = await getClient();
BaseStructureResult<String> 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),
@ -194,177 +99,197 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail>
],
elevation: 0,
),
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: () {
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: () {
/* 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: [
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(
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(
width: 49.r,
height: 22.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
border: Border.all(
width: 1.r, color: Color(0xFF8B8B8B)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
border: Border.all(width: 1.r, 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),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'2次',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)),
),
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))
],
),
Image.asset('assets/images/right_icon_blue.png',width: 8.r,height: 8.r,),
],
),
),
],
),
),
/* 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),
),*/
],
SizedBox(height: 10.r,),
progressBar(context,
title: '正确率:',
color: Color(0xFF90E0BE),
percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),
],
),
),
),
);
})
: MyEmptyWidget(),
),
);
})
: MyEmptyWidget(),
),
),
),
],
),
);
}
@ -372,16 +297,15 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail>
@swidget
Widget progressBar(
BuildContext context, {
double? fontSize,
double? lineHeight,
required String title,
required Color color,
required double percent,
required EdgeInsets padingEdg,
required EdgeInsets marginEdg,
required Future<dynamic> studentCall,
}) {
BuildContext context, {
double? fontSize,
double? lineHeight,
required String title,
required Color color,
required double percent,
required EdgeInsets padingEdg,
required EdgeInsets marginEdg,
}) {
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
fontSize ??= 10.sp;
lineHeight ??= 8.h;
@ -392,22 +316,8 @@ Widget progressBar(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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))),
),
if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize),
quickText(title, color: Color(0xFF8B8B8B), size: fontSize),
Expanded(
flex: 1,
child: Container(
@ -449,7 +359,7 @@ Widget progressBar(
),
),
SizedBox(width: 4.w),
quickText(percentStr, size: fontSize, color: Color(0xFF606060))
quickText(percentStr, size: fontSize, color: Color(0xFF464646))
],
),
),
@ -458,3 +368,119 @@ 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<PickerDateRange?>(
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: <Widget>[
const Tab(text: '近一周'),
const Tab(text: '近一月'),
Tab(text: customTimeStr),
],
),
),
);
}

View File

@ -16,9 +16,8 @@ import 'package:marking_app/utils/request/rest_client.dart';
class JobPriorityReviewSet extends StatefulWidget {
final String groupId;
final String title;
final String? page;
const JobPriorityReviewSet({Key? key, required this.groupId,required this.title,this.page = ''})
const JobPriorityReviewSet({Key? key, required this.groupId,required this.title})
: super(key: key);
@override
@ -209,16 +208,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
color: Color(0xFF6888FD)),
)),
item.readLevel == 1
?
widget.page == 'history'?Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):InkWell(
? InkWell(
onTap: () {
setState(() {
isClicking = true;
@ -228,7 +218,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
EasyLoading.show(
status: 'loading...');
},
child:Container(
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
@ -256,15 +246,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
),
),
)
: widget.page == 'history'?Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):InkWell(
: InkWell(
onTap: () {
setState(() {
isClicking = true;
@ -274,7 +256,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
EasyLoading.show(
status: 'loading...');
},
child: Container(
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
@ -365,15 +347,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
color: Color(0xFF6888FD)),
)),
item.readLevel == 1
? widget.page == 'history'?Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):InkWell(
? InkWell(
onTap: () {
setState(() {
isClicking = true;
@ -411,15 +385,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
),
),
)
: widget.page == 'history'?Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):InkWell(
: InkWell(
onTap: () {
setJobReadLevel(
item.studentGroupDetailId, 1);

View File

@ -16,8 +16,7 @@ import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart';
class JobStudentGroup extends StatefulWidget {
final String page;
const JobStudentGroup({Key? key,required this.page}) : super(key: key);
const JobStudentGroup({Key? key}) : super(key: key);
@override
State<JobStudentGroup> createState() => _JobStudentGroupState();
@ -60,7 +59,7 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
}
void goNextPage(id,title){
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}&page=${widget.page}',transition: getTransition());
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}',transition: getTransition());
}
@override

View File

@ -317,16 +317,14 @@ class RouterManager {
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
String groupId = params['groupId']![0];
String title = params['title']![0];
String? page = params['page']?[0];
return JobPriorityReviewSet(groupId: groupId,title:title,page:page);
return JobPriorityReviewSet(groupId: groupId,title:title);
},
);
//
static final _jobStudentGroupPageHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
String page = params['page']![0];
return JobStudentGroup(page:page);
return JobStudentGroup();
},
);
//

View File

@ -19,7 +19,6 @@ 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';
@ -361,8 +360,8 @@ abstract class RestClient {
// =>
@the_retrofit.GET("/api/jobs/knowledge-report")
Future<BaseStructureResult<List<KnowledgePoints>>> 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,
);
@ -371,17 +370,4 @@ abstract class RestClient {
Future<BaseStructureResult<List<KnowledgePointsDetail>>> getKnowledgeReportDetail(
@the_retrofit.Query("KnowledgeId") int knowledgeId,
);
// =>
@the_retrofit.GET("/api/jobs/knowledge-question-detail/{questionid}")
Future<BaseStructureResult<List<JobKnowledgeDetailStudent>>> getKnowledgeStudent(
@the_retrofit.Path("questionid") int questionid,
);
// =>
@the_retrofit.GET("/api/jobs/question-paper-img/{sectionid}/{questionno}")
Future<BaseStructureResult<String>> getKnowledgeImg(
@the_retrofit.Path("sectionid") int questionid,
@the_retrofit.Path("questionno") String questionno,
);
}