Compare commits
3 Commits
326a2fe99e
...
42d2e4ab39
| Author | SHA1 | Date |
|---|---|---|
|
|
42d2e4ab39 | |
|
|
994ca04988 | |
|
|
e22d5f2655 |
|
|
@ -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<String, dynamic> srcJson) => _$JobKnowledgeDetailStudentFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$JobKnowledgeDetailStudentToJson(this);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
// 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,
|
||||
};
|
||||
|
|
@ -274,23 +274,6 @@ 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,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
|||
EntranceModel(
|
||||
title: '学生历史作业',
|
||||
image: '',
|
||||
navigationUrl: '',
|
||||
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||
page:'history',
|
||||
|
||||
),
|
||||
EntranceModel(
|
||||
title: '知识点掌握',
|
||||
|
|
@ -50,6 +52,7 @@ class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, Auto
|
|||
title: '优先批阅设定',
|
||||
image: '',
|
||||
navigationUrl: RouterManager.jobStudentGroupPath,
|
||||
page:'set',
|
||||
),
|
||||
EntranceModel(
|
||||
title: '批阅设置',
|
||||
|
|
@ -143,7 +146,12 @@ 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());
|
||||
}
|
||||
|
||||
}),
|
||||
child: badges.Badge(
|
||||
showBadge: isJob && data > 0,
|
||||
|
|
@ -188,5 +196,6 @@ class EntranceModel extends Object {
|
|||
String title;
|
||||
String image;
|
||||
String navigationUrl;
|
||||
EntranceModel({required this.title, required this.image, required this.navigationUrl});
|
||||
String? page;
|
||||
EntranceModel({required this.title, required this.image, required this.navigationUrl,this.page = ''});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(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))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
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 = '';
|
||||
|
||||
//文本输入框控制器
|
||||
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();
|
||||
}
|
||||
|
|
@ -59,8 +55,6 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
|||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
tabController.dispose();
|
||||
textController.dispose();
|
||||
}
|
||||
|
||||
void getList() async {
|
||||
|
|
@ -69,26 +63,127 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
|||
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;
|
||||
});
|
||||
}
|
||||
|
||||
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),
|
||||
|
|
@ -99,105 +194,7 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> 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(
|
||||
body: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.r),
|
||||
child: EasyRefresh(
|
||||
firstRefresh: false,
|
||||
|
|
@ -206,18 +203,10 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
|||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
onRefresh: () async {
|
||||
setState(() {
|
||||
page = 1;
|
||||
});
|
||||
getList();
|
||||
},
|
||||
onLoad: () async {
|
||||
if (page < totalPages) {
|
||||
setState(() {
|
||||
page += 1;
|
||||
});
|
||||
getList();
|
||||
}
|
||||
// getList();
|
||||
},
|
||||
child: dataList.length > 0
|
||||
? ListView.builder(
|
||||
|
|
@ -234,10 +223,13 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
|||
);*/
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r),
|
||||
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),
|
||||
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)),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
|
@ -247,39 +239,125 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
|||
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)),
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: Color(0xFF505050)),
|
||||
)),
|
||||
|
||||
Container(
|
||||
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: 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(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'2次',
|
||||
style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)),
|
||||
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: '正确率:',
|
||||
),
|
||||
/* progressBar(context,
|
||||
title: '正确率 >',
|
||||
color: Color(0xFF90E0BE),
|
||||
percent: item.correctRate / 100,
|
||||
padingEdg: EdgeInsets.zero,
|
||||
marginEdg: EdgeInsets.only(top: 8.h)),
|
||||
marginEdg: EdgeInsets.only(top: 8.h),
|
||||
studentCall:showStudent(item.questionId,item.jobName),
|
||||
),*/
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -288,9 +366,6 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
|||
: MyEmptyWidget(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -305,6 +380,7 @@ Widget progressBar(
|
|||
required double percent,
|
||||
required EdgeInsets padingEdg,
|
||||
required EdgeInsets marginEdg,
|
||||
required Future<dynamic> studentCall,
|
||||
}) {
|
||||
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
|
||||
fontSize ??= 10.sp;
|
||||
|
|
@ -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<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),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,9 @@ 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})
|
||||
const JobPriorityReviewSet({Key? key, required this.groupId,required this.title,this.page = ''})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
|
|
@ -208,7 +209,16 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
color: Color(0xFF6888FD)),
|
||||
)),
|
||||
item.readLevel == 1
|
||||
? InkWell(
|
||||
?
|
||||
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(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isClicking = true;
|
||||
|
|
@ -246,7 +256,15 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
),
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
: 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(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isClicking = true;
|
||||
|
|
@ -347,7 +365,15 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
color: Color(0xFF6888FD)),
|
||||
)),
|
||||
item.readLevel == 1
|
||||
? InkWell(
|
||||
? 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(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isClicking = true;
|
||||
|
|
@ -385,7 +411,15 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
),
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
: 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(
|
||||
onTap: () {
|
||||
setJobReadLevel(
|
||||
item.studentGroupDetailId, 1);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ import 'package:marking_app/utils/index.dart';
|
|||
import 'package:marking_app/utils/request/rest_client.dart';
|
||||
|
||||
class JobStudentGroup extends StatefulWidget {
|
||||
const JobStudentGroup({Key? key}) : super(key: key);
|
||||
final String page;
|
||||
const JobStudentGroup({Key? key,required this.page}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<JobStudentGroup> createState() => _JobStudentGroupState();
|
||||
|
|
@ -59,7 +60,7 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
|
|||
}
|
||||
|
||||
void goNextPage(id,title){
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}',transition: getTransition());
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}&page=${widget.page}',transition: getTransition());
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -317,14 +317,16 @@ class RouterManager {
|
|||
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||
String groupId = params['groupId']![0];
|
||||
String title = params['title']![0];
|
||||
return JobPriorityReviewSet(groupId: groupId,title:title);
|
||||
String? page = params['page']?[0];
|
||||
return JobPriorityReviewSet(groupId: groupId,title:title,page:page);
|
||||
},
|
||||
);
|
||||
|
||||
//学生分组
|
||||
static final _jobStudentGroupPageHandler = Handler(
|
||||
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||
return JobStudentGroup();
|
||||
String page = params['page']![0];
|
||||
return JobStudentGroup(page:page);
|
||||
},
|
||||
);
|
||||
//作业收藏页面
|
||||
|
|
|
|||
|
|
@ -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<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,
|
||||
);
|
||||
|
||||
|
|
@ -370,4 +371,17 @@ 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,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue