知识点详情
This commit is contained in:
parent
5cdf645f86
commit
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)
|
if (_tabIndex == 1)
|
||||||
$CompletedJobConditionFilter(
|
$CompletedJobConditionFilter(
|
||||||
controller: _tabController2,
|
controller: _tabController2,
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class _JobKnowledgePointsState extends State<JobKnowledgePoints> with CommonMixi
|
||||||
print('endDataTime=$endDataTime');
|
print('endDataTime=$endDataTime');
|
||||||
RestClient _client = await getClient();
|
RestClient _client = await getClient();
|
||||||
BaseStructureResult<List<KnowledgePoints>> res =
|
BaseStructureResult<List<KnowledgePoints>> res =
|
||||||
await _client.getKnowledgeReport(textController.text);
|
await _client.getKnowledgeReport(startDataTime,endDataTime,textController.text);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
|
|
@ -317,7 +317,6 @@ Widget progressBar(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize),
|
|
||||||
quickText(title, color: Color(0xFF8B8B8B), size: fontSize),
|
quickText(title, color: Color(0xFF8B8B8B), size: fontSize),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|
@ -360,7 +359,7 @@ Widget progressBar(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 4.w),
|
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:functional_widget_annotation/functional_widget_annotation.dart';
|
||||||
import 'package:marking_app/common/mixin/common.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/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.dart';
|
||||||
import 'package:marking_app/common/model/job/job_knowledge_points_detail.dart';
|
import 'package:marking_app/common/model/job/job_knowledge_points_detail.dart';
|
||||||
import 'package:marking_app/common/model/job/job_student_history.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/my_text.dart';
|
||||||
import 'package:marking_app/utils/request/rest_client.dart';
|
import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
import 'package:percent_indicator/percent_indicator.dart';
|
import 'package:percent_indicator/percent_indicator.dart';
|
||||||
|
import 'package:photo_view/photo_view.dart';
|
||||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||||
|
|
||||||
|
|
||||||
class JobKnowledgePointsDetail extends StatefulWidget {
|
class JobKnowledgePointsDetail extends StatefulWidget {
|
||||||
final String knowledgeName;
|
final String knowledgeName;
|
||||||
final int knowledgeId;
|
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
|
@override
|
||||||
_JobKnowledgePointsDetailState createState() => _JobKnowledgePointsDetailState();
|
_JobKnowledgePointsDetailState createState() =>
|
||||||
|
_JobKnowledgePointsDetailState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> with CommonMixin, TickerProviderStateMixin {
|
class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail>
|
||||||
|
with CommonMixin, TickerProviderStateMixin {
|
||||||
@override
|
@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<KnowledgePointsDetail> dataList = [];
|
||||||
|
List<JobKnowledgeDetailStudent> studentList = [];
|
||||||
late final EasyRefreshController refreshController;
|
late final EasyRefreshController refreshController;
|
||||||
|
String paperImg = '';
|
||||||
|
|
||||||
//文本输入框控制器
|
int studentId = 0;
|
||||||
late final TextEditingController textController;
|
|
||||||
int studentId = 0;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
textController = TextEditingController();
|
|
||||||
|
|
||||||
refreshController = EasyRefreshController();
|
refreshController = EasyRefreshController();
|
||||||
tabController = TabController(length: 3, vsync: this);
|
|
||||||
EasyLoading.show(status: 'loading...');
|
EasyLoading.show(status: 'loading...');
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
@ -59,36 +55,135 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
tabController.dispose();
|
|
||||||
textController.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void getList() async {
|
void getList() async {
|
||||||
RestClient _client = await getClient();
|
RestClient _client = await getClient();
|
||||||
BaseStructureResult<List<KnowledgePointsDetail>> res =
|
BaseStructureResult<List<KnowledgePointsDetail>> res =
|
||||||
await _client.getKnowledgeReportDetail(widget.knowledgeId);
|
await _client.getKnowledgeReportDetail(widget.knowledgeId);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (page == 1) {
|
dataList = res.data!;
|
||||||
dataList = res.data!;
|
|
||||||
} else {
|
|
||||||
dataList = [...dataList, ...res.data!];
|
|
||||||
}
|
|
||||||
|
|
||||||
// totalPages = res.data!.pagedList.totalPages;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
EasyLoading.dismiss();
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
|
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.white,
|
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,
|
centerTitle: true,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
|
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
|
||||||
|
|
@ -99,197 +194,177 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
||||||
],
|
],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Padding(
|
||||||
children: [
|
padding: EdgeInsets.symmetric(vertical: 10.r),
|
||||||
Container(
|
child: EasyRefresh(
|
||||||
margin: EdgeInsets.all(15.r),
|
firstRefresh: false,
|
||||||
height: 30.r,
|
taskIndependence: true,
|
||||||
child: Row(
|
controller: refreshController,
|
||||||
children: [
|
header: MaterialHeader(),
|
||||||
Expanded(
|
footer: TaurusFooter(),
|
||||||
child: Container(
|
onRefresh: () async {
|
||||||
padding: EdgeInsets.only(left: 10.r,right: 10.r),
|
getList();
|
||||||
decoration: BoxDecoration(
|
},
|
||||||
borderRadius: BorderRadius.circular(6.r),
|
onLoad: () async {
|
||||||
border: Border.all(width: 1.r,color: Color(0xFFDDDDDD)),
|
// getList();
|
||||||
color: Colors.white,
|
},
|
||||||
),
|
child: dataList.length > 0
|
||||||
child: TextField(
|
? ListView.builder(
|
||||||
controller: textController,
|
itemCount: dataList.length,
|
||||||
textInputAction: TextInputAction.next,
|
itemBuilder: (context, index) {
|
||||||
style: TextStyle(
|
KnowledgePointsDetail item = dataList[index];
|
||||||
color: const Color.fromRGBO(80, 87, 103, 1),
|
return InkWell(
|
||||||
fontSize: 10.sp,
|
onTap: () {
|
||||||
),
|
|
||||||
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(
|
/* RouterManager.router.navigateTo(
|
||||||
context,
|
context,
|
||||||
RouterManager.quickCheckPersonalPath +
|
RouterManager.quickCheckPersonalPath +
|
||||||
'?jobId=${item.jobName}&studentId=$studentId',
|
'?jobId=${item.jobName}&studentId=$studentId',
|
||||||
transition: getTransition(),
|
transition: getTransition(),
|
||||||
);*/
|
);*/
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r),
|
margin: EdgeInsets.symmetric(
|
||||||
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),
|
vertical: 5.r, horizontal: 14.r),
|
||||||
decoration: BoxDecoration(
|
padding: EdgeInsets.symmetric(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
vertical: 14.r, horizontal: 10.r),
|
||||||
color: Colors.white),
|
decoration: BoxDecoration(
|
||||||
child: Column(
|
borderRadius:
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
BorderRadius.all(Radius.circular(10.r)),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
color: Colors.white),
|
||||||
children: [
|
child: Column(
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Expanded(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
child: Text(
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
item.jobName,
|
children: [
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)),
|
Text(
|
||||||
)),
|
item.publishTime.substring(0, 10),
|
||||||
|
style: TextStyle(
|
||||||
Container(
|
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,
|
width: 49.r,
|
||||||
height: 22.r,
|
height: 22.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
borderRadius: BorderRadius.all(
|
||||||
border: Border.all(width: 1.r, color: Color(0xFF6888FD)),
|
Radius.circular(20.r)),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.r, color: Color(0xFF8B8B8B)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Center(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Text(
|
||||||
children: [
|
'${item.questionNo}题',
|
||||||
Text(
|
style: TextStyle(
|
||||||
'2次',
|
fontSize: 10.sp,
|
||||||
style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)),
|
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,
|
/* progressBar(context,
|
||||||
title: '正确率:',
|
title: '正确率 >',
|
||||||
color: Color(0xFF90E0BE),
|
color: Color(0xFF90E0BE),
|
||||||
percent: item.correctRate / 100,
|
percent: item.correctRate / 100,
|
||||||
padingEdg: EdgeInsets.zero,
|
padingEdg: EdgeInsets.zero,
|
||||||
marginEdg: EdgeInsets.only(top: 8.h)),
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
],
|
studentCall:showStudent(item.questionId,item.jobName),
|
||||||
),
|
),*/
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
})
|
);
|
||||||
: MyEmptyWidget(),
|
})
|
||||||
),
|
: MyEmptyWidget(),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -297,15 +372,16 @@ class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail> wit
|
||||||
|
|
||||||
@swidget
|
@swidget
|
||||||
Widget progressBar(
|
Widget progressBar(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
double? fontSize,
|
double? fontSize,
|
||||||
double? lineHeight,
|
double? lineHeight,
|
||||||
required String title,
|
required String title,
|
||||||
required Color color,
|
required Color color,
|
||||||
required double percent,
|
required double percent,
|
||||||
required EdgeInsets padingEdg,
|
required EdgeInsets padingEdg,
|
||||||
required EdgeInsets marginEdg,
|
required EdgeInsets marginEdg,
|
||||||
}) {
|
required Future<dynamic> studentCall,
|
||||||
|
}) {
|
||||||
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
|
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
|
||||||
fontSize ??= 10.sp;
|
fontSize ??= 10.sp;
|
||||||
lineHeight ??= 8.h;
|
lineHeight ??= 8.h;
|
||||||
|
|
@ -316,8 +392,22 @@ Widget progressBar(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize),
|
InkWell(
|
||||||
quickText(title, color: Color(0xFF8B8B8B), size: fontSize),
|
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(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
@ -359,7 +449,7 @@ Widget progressBar(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 4.w),
|
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),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -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_do_marking_status_info.dart';
|
||||||
import 'package:marking_app/common/model/job/job_fav_student.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_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.dart';
|
||||||
import 'package:marking_app/common/model/job/job_knowledge_points_detail.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';
|
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")
|
@the_retrofit.GET("/api/jobs/knowledge-report")
|
||||||
Future<BaseStructureResult<List<KnowledgePoints>>> getKnowledgeReport(
|
Future<BaseStructureResult<List<KnowledgePoints>>> getKnowledgeReport(
|
||||||
/* @the_retrofit.Query("dateStart") String? dateStart,
|
@the_retrofit.Query("dateStart") String? dateStart,
|
||||||
@the_retrofit.Query("dateEnd") String? dateEnd,*/
|
@the_retrofit.Query("dateEnd") String? dateEnd,
|
||||||
@the_retrofit.Query("knowledgeName") String? knowledgeName,
|
@the_retrofit.Query("knowledgeName") String? knowledgeName,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -370,4 +371,17 @@ abstract class RestClient {
|
||||||
Future<BaseStructureResult<List<KnowledgePointsDetail>>> getKnowledgeReportDetail(
|
Future<BaseStructureResult<List<KnowledgePointsDetail>>> getKnowledgeReportDetail(
|
||||||
@the_retrofit.Query("KnowledgeId") int knowledgeId,
|
@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