数据快查修改

This commit is contained in:
machuanyu 2024-03-19 10:05:50 +08:00
parent d793161d67
commit 6d7857ccef
9 changed files with 546 additions and 107 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

View File

@ -35,13 +35,16 @@ class JobDataReport extends Object {
int zgQuestionCount; int zgQuestionCount;
bool sortType; // true false bool sortType; // true false
bool sortLevel;
bool hasUnrated;//
@JsonKey(name: 'studentDetails') @JsonKey(name: 'studentDetails')
List<StudentDetails> studentDetails; List<StudentDetails> studentDetails;
JobDataReport(this.jobId, this.jobName, this.gradeName, this.className, this.validCount, this.noAnswerCount, JobDataReport(this.jobId, this.jobName, this.gradeName, this.className, this.validCount, this.noAnswerCount,
this.kgValidRate, this.kgQuestionCount, this.zgValidRate, this.zgQuestionCount, this.studentDetails, this.kgValidRate, this.kgQuestionCount, this.zgValidRate, this.zgQuestionCount, this.studentDetails,
[this.sortType = true]) { [this.sortType = true,this.sortLevel = false,this.hasUnrated = false]) {
this.studentDetails.sort((a, b) { this.studentDetails.sort((a, b) {
int num1 = a.kgValidRate + a.zgValidRate; int num1 = a.kgValidRate + a.zgValidRate;
int num2 = b.kgValidRate + b.zgValidRate; int num2 = b.kgValidRate + b.zgValidRate;
@ -80,6 +83,24 @@ class StudentDetails extends Object {
@JsonKey(name: 'zgDetails') @JsonKey(name: 'zgDetails')
List<KgDetails> zgDetails; List<KgDetails> zgDetails;
@JsonKey(name: 'readLevel')
int? readLevel;
@JsonKey(name: 'kgError')
int kgError;
@JsonKey(name: 'zgError')
int zgError;
@JsonKey(name: 'kgCorrect')
int kgCorrect;
@JsonKey(name: 'zgCorrect')
int zgCorrect;
@JsonKey(name: 'unrated')
int unrated;
StudentDetails( StudentDetails(
this.studentId, this.studentId,
this.studentName, this.studentName,
@ -89,6 +110,8 @@ class StudentDetails extends Object {
this.zgValidRate, this.zgValidRate,
this.kgDetails, this.kgDetails,
this.zgDetails, this.zgDetails,
this.readLevel,
[this.kgError = 0,this.kgCorrect = 0,this.zgCorrect = 0,this.zgError = 0,this.unrated = 0]
); );
factory StudentDetails.fromJson(Map<String, dynamic> srcJson) => _$StudentDetailsFromJson(srcJson); factory StudentDetails.fromJson(Map<String, dynamic> srcJson) => _$StudentDetailsFromJson(srcJson);

View File

@ -339,8 +339,8 @@ class Details extends Object {
@JsonKey(name: 'validCount') @JsonKey(name: 'validCount')
String validCount; String validCount;
@JsonKey(name: 'validStudentNames') /* @JsonKey(name: 'validStudentNames')
List<String> validStudentNames; List<String> validStudentNames;*/
@JsonKey(name: 'correctRate') @JsonKey(name: 'correctRate')
int correctRate; int correctRate;
@ -357,7 +357,13 @@ class Details extends Object {
@JsonKey(name: 'priorityStudentNames') @JsonKey(name: 'priorityStudentNames')
List<String> priorityStudentNames; List<String> priorityStudentNames;
Details(this.questionNo,this.questionId,this.partName,this.questionType,this.validRate,this.validCount,this.validStudentNames,this.correctRate,this.questionAnswer,this.questionPicture,this.priorityGeneral,this.priorityStudentNames,); @JsonKey(name: 'answerNgStudentNames')
List<String> answerNgStudentNames;
@JsonKey(name: 'noAnswerStudentNames')
List<String> noAnswerStudentNames;
Details(this.questionNo,this.questionId,this.partName,this.questionType,this.validRate,this.validCount,this.correctRate,this.questionAnswer,this.questionPicture,this.priorityGeneral,this.priorityStudentNames,this.answerNgStudentNames,this.noAnswerStudentNames);
factory Details.fromJson(Map<String, dynamic> srcJson) => _$DetailsFromJson(srcJson); factory Details.fromJson(Map<String, dynamic> srcJson) => _$DetailsFromJson(srcJson);

View File

@ -19,14 +19,20 @@ class QuickDataCheckPage extends StatefulWidget {
final int? schoolId; final int? schoolId;
final int? gradeId; final int? gradeId;
const QuickDataCheckPage({Key? key, required this.jobId, required this.className, this.schoolId, this.gradeId}) const QuickDataCheckPage(
{Key? key,
required this.jobId,
required this.className,
this.schoolId,
this.gradeId})
: super(key: key); : super(key: key);
@override @override
State<QuickDataCheckPage> createState() => _QuickDataCheckPageState(); State<QuickDataCheckPage> createState() => _QuickDataCheckPageState();
} }
class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixin { class _QuickDataCheckPageState extends State<QuickDataCheckPage>
with CommonMixin {
JobDataReport? jobData; JobDataReport? jobData;
void initState() { void initState() {
@ -47,9 +53,41 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
params['gradeId'] = widget.gradeId; params['gradeId'] = widget.gradeId;
} }
BaseStructureResult<JobDataReport?> data = await _client.getJobDataCenterReport(params); BaseStructureResult<JobDataReport?> data =
await _client.getJobDataCenterReport(params);
EasyLoading.dismiss(); EasyLoading.dismiss();
if (data.code == 200) { if (data.code == 200) {
int totalUnrated = 0;
data.data!.studentDetails.forEach((element) {
element.kgError = 0;
element.kgCorrect = 0;
element.zgError = 0;
element.zgCorrect = 0;
element.kgDetails.forEach((item) {
if (item.state == 1) {
element.kgError = element.kgError + 1;
}
if (item.state == 2) {
element.kgCorrect = element.kgCorrect + 1;
}
});
element.zgDetails.forEach((item) {
if (item.state == 1) {
element.zgError = element.zgError + 1;
}
if (item.state == 2) {
element.zgCorrect = element.zgCorrect + 1;
}
if (item.state == 3) {
element.unrated = element.unrated + 1;
totalUnrated = element.unrated;
}
});
});
if (totalUnrated > 0) {
data.data!.hasUnrated = true;
}
setState(() { setState(() {
jobData = data.data; jobData = data.data;
}); });
@ -69,13 +107,17 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ gradient: LinearGradient(
Color(0xFF6889FD), begin: Alignment.topCenter,
Color(0xFFF5F5F5), end: Alignment.bottomCenter,
], stops: [ colors: [
0.09, Color(0xFF6889FD),
0.3 Color(0xFFF5F5F5),
])), ],
stops: [
0.09,
0.3
])),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -120,16 +162,21 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
), ),
Text( Text(
widget.className, widget.className,
style: TextStyle(fontSize: 14.r, color: Colors.white), style: TextStyle(
fontSize: 14.r, color: Colors.white),
) )
], ],
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r), padding: EdgeInsets.symmetric(
margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), vertical: 15.r, horizontal: 15.r),
decoration: margin: EdgeInsets.symmetric(
BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))), vertical: 10.r, horizontal: 14.r),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(6.r))),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -143,14 +190,18 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
width: 12.r, width: 12.r,
height: 12.r, height: 12.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))), color: Color(0xFF4CC793),
borderRadius: BorderRadius.all(
Radius.circular(7.r))),
), ),
SizedBox( SizedBox(
width: 6.r, width: 6.r,
), ),
Text( Text(
'已提交', '已提交',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)), style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF333333)),
), ),
SizedBox( SizedBox(
width: 35.r, width: 35.r,
@ -159,14 +210,18 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
width: 12.r, width: 12.r,
height: 12.r, height: 12.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF6888FD), borderRadius: BorderRadius.all(Radius.circular(7.r))), color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(
Radius.circular(7.r))),
), ),
SizedBox( SizedBox(
width: 6.r, width: 6.r,
), ),
Text( Text(
'未提交', '未提交',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)), style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF333333)),
) )
], ],
), ),
@ -177,13 +232,19 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
PieChartData( PieChartData(
borderData: FlBorderData(show: false), borderData: FlBorderData(show: false),
sectionsSpace: 0, sectionsSpace: 0,
centerSpaceRadius: MediaQuery.of(context).size.width * 0.1, centerSpaceRadius:
MediaQuery.of(context).size.width * 0.1,
sections: [ sections: [
PieChartSectionData( PieChartSectionData(
color: Color(0xFF4CC793), color: Color(0xFF4CC793),
value: value: jobData!.validCount /
jobData!.validCount / (jobData!.validCount + jobData!.noAnswerCount) * 100, (jobData!.validCount +
radius: MediaQuery.of(context).size.width * 0.1 + 5, jobData!.noAnswerCount) *
100,
radius:
MediaQuery.of(context).size.width *
0.1 +
5,
title: '${jobData!.validCount}', title: '${jobData!.validCount}',
titleStyle: TextStyle( titleStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -193,9 +254,12 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
PieChartSectionData( PieChartSectionData(
color: Color(0xFF6888FD), color: Color(0xFF6888FD),
value: jobData!.noAnswerCount / value: jobData!.noAnswerCount /
(jobData!.validCount + jobData!.noAnswerCount) * (jobData!.validCount +
jobData!.noAnswerCount) *
100, 100,
radius: MediaQuery.of(context).size.width * 0.1, radius:
MediaQuery.of(context).size.width *
0.1,
title: '${jobData!.noAnswerCount}', title: '${jobData!.noAnswerCount}',
titleStyle: TextStyle( titleStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -208,21 +272,27 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
), ),
// //
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'客观题答题进度', '客观题答题进度',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)), style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF8B8B8B)),
), ),
Text( Text(
'${doubleToStringAsFixed(jobData!.kgValidRate)}%', '${doubleToStringAsFixed(jobData!.kgValidRate)}%',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF333333)), style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF333333)),
), ),
], ],
), ),
SizedBox(height: 6.r), SizedBox(height: 6.r),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 10, flex: 10,
@ -241,21 +311,27 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
SizedBox(height: 20.r), SizedBox(height: 20.r),
// //
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'主观题答题进度', '主观题答题进度',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)), style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF8B8B8B)),
), ),
Text( Text(
'${doubleToStringAsFixed(jobData!.zgValidRate)}%', '${doubleToStringAsFixed(jobData!.zgValidRate)}%',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF333333)), style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF333333)),
), ),
], ],
), ),
SizedBox(height: 6.r), SizedBox(height: 6.r),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 10, flex: 10,
@ -275,64 +351,158 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), padding: EdgeInsets.symmetric(
margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), vertical: 10.r, horizontal: 10.r),
decoration: margin: EdgeInsets.symmetric(
BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))), vertical: 10.r, horizontal: 14.r),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(6.r))),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
InkWell( Row(
onTap: () { mainAxisAlignment: MainAxisAlignment.start,
if (jobData == null) return; children: [
if (!jobData!.sortType) { InkWell(
jobData!.studentDetails.sort((a, b) { onTap: (){
int num1 = a.kgValidRate + a.zgValidRate; if (jobData == null) return;
int num2 = b.kgValidRate + b.zgValidRate; if (!jobData!.sortType) {
return num2.compareTo(num1); jobData!.studentDetails.sort((a, b) {
}); int num1 =
} else { a.kgValidRate + a.zgValidRate;
jobData!.studentDetails.sort((a, b) { int num2 =
int num1 = a.kgValidRate + a.zgValidRate; b.kgValidRate + b.zgValidRate;
int num2 = b.kgValidRate + b.zgValidRate; return num2.compareTo(num1);
return num1.compareTo(num2); });
}); } else {
} jobData!.studentDetails.sort((a, b) {
jobData!.sortType = !jobData!.sortType; int num1 =
setState(() { a.kgValidRate + a.zgValidRate;
jobData!.studentDetails; int num2 =
}); b.kgValidRate + b.zgValidRate;
}, return num1.compareTo(num2);
child: Row( });
mainAxisAlignment: MainAxisAlignment.end, }
children: [ jobData!.sortType = !jobData!.sortType;
Text(
(jobData?.sortType ?? true) ? '未提交置顶' : '已提交置顶', setState(() {
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD)), jobData!.sortLevel = false;
jobData!.studentDetails;
});
},
child: Row(
children: [
if(!jobData!.sortType)
Image.asset(
'assets/images/no_check_icon.png',
width: 16.r,
height: 16.r,
),
if(jobData!.sortType)
Image.asset(
'assets/images/check_icon.png',
width: 16.r,
height: 16.r,
),
SizedBox(width: 5.r,),
Text(
'未提交排序',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF707070)),
),
],
), ),
SizedBox( ),
width: 10.r,
SizedBox(
width: 20.r,
),
InkWell(
onTap: (){
if (jobData == null) return;
if (!jobData!.sortLevel) {
jobData!.studentDetails.sort((a, b) {
return b.readLevel!
.compareTo(a.readLevel!);
});
} else {
jobData!.studentDetails.sort((a, b) {
return a.readLevel!
.compareTo(b.readLevel!);
});
}
jobData!.sortLevel =
!jobData!.sortLevel;
setState(() {
jobData!.sortType = false;
jobData!.studentDetails;
});
},
child: Row(
children: [
if(!jobData!.sortLevel)
Image.asset(
'assets/images/no_check_icon.png',
width: 16.r,
height: 16.r,
),
if(jobData!.sortLevel)
Image.asset(
'assets/images/check_icon.png',
width: 16.r,
height: 16.r,
),
SizedBox(width: 5.r,),
Text(
'未批阅排序',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF707070)),
),
],
), ),
Image.asset( ),
'assets/images/sort_icon.png',
width: 14.r, ],
height: 14.r,
),
],
),
), ),
SizedBox( SizedBox(
height: 10.r, height: 10.r,
), ),
Text(
'注:绿色代表正确,红色代表错误,白色代表已作答未批阅,灰色代表未做',
style: TextStyle(
fontSize: 8.sp, color: Color(0xFF717171)),
),
SizedBox(
height: 5.r,
),
SizedBox( SizedBox(
height: jobData!.studentDetails.length > 5 height: jobData!.studentDetails.length > 5
? 350.r ? 350.r
: jobData!.studentDetails.length * 50.r + 40.r, : jobData!.studentDetails.length * 50.r +
40.r,
child: QuickStudentDataTable( child: QuickStudentDataTable(
headList: ['学生姓名', '客观题', '主观题', '客观题错题', '主观题错题'], headList: [
'学生姓名',
'客观题',
'主观题',
'客观题详情',
'主观题详情',
'未批阅'
],
bodyList: jobData!.studentDetails, bodyList: jobData!.studentDetails,
jobId: widget.jobId, jobId: widget.jobId,
fixedRows: 1, fixedRows: 1,
fixedCols: 0, fixedCols: 0,
hasUnrated: jobData!.hasUnrated,
kgCount: jobData!.kgQuestionCount,
zgCount: jobData!.zgQuestionCount,
), ),
) )
], ],
@ -342,7 +512,8 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixi
), ),
)) ))
: Padding( : Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r), padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height / 2 - 200.r),
child: MyEmptyWidget(), child: MyEmptyWidget(),
) )
], ],

View File

@ -11,12 +11,18 @@ class QuickStudentDataTable extends StatefulWidget {
final int? fixedRows; final int? fixedRows;
final int? fixedCols; final int? fixedCols;
final int jobId; final int jobId;
final bool hasUnrated;
final int kgCount;
final int zgCount;
const QuickStudentDataTable({ const QuickStudentDataTable({
Key? key, Key? key,
required this.headList, required this.headList,
required this.bodyList, required this.bodyList,
required this.jobId, required this.jobId,
required this.hasUnrated,
required this.kgCount,
required this.zgCount,
this.fixedCols = 0, this.fixedCols = 0,
this.fixedRows = 0, this.fixedRows = 0,
}) : super(key: key); }) : super(key: key);
@ -90,17 +96,39 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text( child: Row(
'${(item.kgValidRate / 100 * item.kgValidCount).toInt()}/${item.kgValidCount}', mainAxisAlignment: MainAxisAlignment.center,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), children: [
Text(
'${item.kgCorrect}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF4CC793))),
Text(
'/',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
Text(
'${item.kgError}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFFFF7474))),
],
),
), ),
)), )),
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text( child: Row(
'${(item.zgValidRate / 100 * item.zgValidCount).toInt()}/${item.zgValidCount}', mainAxisAlignment: MainAxisAlignment.center,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), children: [
Text(
'${item.zgCorrect}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF4CC793))),
Text(
'/',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
Text(
'${item.zgError}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFFFF7474))),
],
),
), ),
)), )),
DataCell( DataCell(
@ -119,8 +147,8 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
height: 14.r, height: 14.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: kgInfo.state == 0 color: kgInfo.state == 0
? Colors.white ? Color(0xFFD3D3D3)
: kgInfo.state == 1 : kgInfo.state == 3?Colors.white:kgInfo.state == 1
? Color(0xFFFF7474) ? Color(0xFFFF7474)
: Color(0xFF4CC793), : Color(0xFF4CC793),
borderRadius: BorderRadius.all(Radius.circular(7.r))), borderRadius: BorderRadius.all(Radius.circular(7.r))),
@ -154,10 +182,10 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
height: 14.r, height: 14.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: kgInfo.state == 0 color: kgInfo.state == 0
? Colors.white ? Color(0xFFD3D3D3)
: kgInfo.state == 1 : kgInfo.state == 3?Colors.white:kgInfo.state == 1
? Color(0xFFFF7474) ? Color(0xFFFF7474)
: Color(0xFF4CC793), : Color(0xFF4CC793),
borderRadius: BorderRadius.all(Radius.circular(7.r))), borderRadius: BorderRadius.all(Radius.circular(7.r))),
child: Center( child: Center(
child: Text( child: Text(
@ -173,12 +201,24 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
), ),
), ),
), ),
if(widget.hasUnrated)
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text('${item.unrated}',
style:
TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
),
)),
], ],
); );
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(!widget.hasUnrated){
widget.headList.removeLast();
}
return DataTable2( return DataTable2(
dividerThickness: 0, dividerThickness: 0,
scrollController: _controller, scrollController: _controller,
@ -216,13 +256,39 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
// onSelectAll: (val) => setState(() => selectAll(val)), // onSelectAll: (val) => setState(() => selectAll(val)),
columns: List.generate(widget.headList.length, (index) { columns: List.generate(widget.headList.length, (index) {
var item = widget.headList[index]; var item = widget.headList[index];
return DataColumn2( return index == 1?DataColumn2(
label: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(item,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
Text('(${widget.kgCount})',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
]
),
// size: ColumnSize.S,
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length,
):index == 2?DataColumn2(
label: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(item,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
Text('(${widget.zgCount})',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF505767))),
]
),
// size: ColumnSize.S,
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length,
):DataColumn2(
label: Center( label: Center(
child: Text(item, child: Text(item,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))), style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
), ),
// size: ColumnSize.S, // size: ColumnSize.S,
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / 5, fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r) / widget.headList.length,
); );
}), }),
rows: List<DataRow>.generate(widget.bodyList.length, rows: List<DataRow>.generate(widget.bodyList.length,

View File

@ -2,6 +2,7 @@ import 'package:data_table_2/data_table_2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/toast_utils.dart'; import 'package:marking_app/utils/toast_utils.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
@ -30,6 +31,144 @@ class _ReportTableState extends State<ReportTable> {
int? _sortColumnIndex; int? _sortColumnIndex;
bool _sortAscending = true; bool _sortAscending = true;
void showPeopleListDialog(
{required BuildContext context, required String title, required String questionNo,required List arr,List? dcList}) {
print(dcList);
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
// insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r),
contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox(
width: MediaQuery.of(context).size.width * 0.7,
height: MediaQuery.of(context).size.height * 0.7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Text(
title,
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
),
),
SizedBox(
height: 5.r,
),
Row(
children: [
Text(
widget.isKG == true ? '主观题' : '客观题',
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF436CFF)),
),
Text(
'',
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF436CFF)),
),
Text(
'$questionNo题',
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF436CFF)),
),
],
),
SizedBox(height: 15.r,),
dcList != null?Row(
children: [
Expanded(
flex: 1,
child: Center(child: Text('未作答人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
Expanded(
flex: 1,
child: Center(child: Text('答错人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
],
):Padding(padding: EdgeInsets.only(left: 15.r),child: Text(title,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),),),
SizedBox(height: 5.r,),
if(dcList != null)
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context,index){
var item = arr[index];
return Container(
padding: EdgeInsets.symmetric(vertical: 5.r),
color: index.isOdd?Colors.white:Color(0xFFF0F0F0),
child: Row(
children: [
Expanded(
flex:1,
child: Center(child: Text(item['noAnswerStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))),
Expanded(
flex:1,
child: Center(child: Text(item['answerNgStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))),
],
),
);
},itemCount: arr.length,),
)
else
arr.length>0?Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context,index){
var item = arr[index];
return Container(
padding: EdgeInsets.symmetric(vertical: 5.r,horizontal: 15.r),
color: index.isOdd?Colors.white:Color(0xFFF0F0F0),
child: Text(item,style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),),
);
},itemCount: arr.length,),
):MyEmptyWidget()
],
),
),
);
});
}
void zdHandle( BuildContext context, String title, String questionNo,List noAnswerStudentNames,List answerNgStudentNames){
List list = [];
if(noAnswerStudentNames.length>answerNgStudentNames.length){
for(int i = 0;i<answerNgStudentNames.length;i++){
var obj = {'noAnswerStudentNames':noAnswerStudentNames[i],'answerNgStudentNames':answerNgStudentNames[i]};
list.add(obj);
}
for(int i = answerNgStudentNames.length ;i<noAnswerStudentNames.length;i++){
var obj = {'noAnswerStudentNames':noAnswerStudentNames[i],'answerNgStudentNames':'-'};
list.add(obj);
}
}else{
for(int i = 0;i<noAnswerStudentNames.length;i++){
var obj = {'noAnswerStudentNames':noAnswerStudentNames[i],'answerNgStudentNames':answerNgStudentNames[i]};
list.add(obj);
}
for(int i = noAnswerStudentNames.length ;i<answerNgStudentNames.length;i++){
var obj = {'noAnswerStudentNames':'-','answerNgStudentNames':answerNgStudentNames[i]};
list.add(obj);
}
print('list.length=${list.length}');
print('noAnswerStudentNames.length=${noAnswerStudentNames.length}');
print('answerNgStudentNames.length=${answerNgStudentNames.length}');
}
showPeopleListDialog(context:context, title:title, questionNo:questionNo,arr:list,dcList:[]);
}
void dcHandle( BuildContext context, String title, String questionNo,List arr){
showPeopleListDialog(context:context, title:title, questionNo:questionNo,arr: arr);
}
DataRow _getRow(int index, [Color? color]) { DataRow _getRow(int index, [Color? color]) {
assert(index >= 0); assert(index >= 0);
var item = widget.bodyList[index]; var item = widget.bodyList[index];
@ -51,11 +190,28 @@ class _ReportTableState extends State<ReportTable> {
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
), ),
)), )),
DataCell(Center( DataCell(InkWell(
child: Padding( onTap: () {
padding: EdgeInsets.symmetric(horizontal: 5.r), zdHandle(context, '作答人数', item.questionNo,item.noAnswerStudentNames,item.answerNgStudentNames);
child: Text(item.validCount,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF4CC793))), },
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(item.validCount,
style:
TextStyle(fontSize: 12.sp, color: Color(0xFF4CC793))),
Image.asset(
'assets/images/green_right_icon.png',
width: 12.r,
height: 12.r,
),
],
),
),
), ),
)), )),
DataCell(Center( DataCell(Center(
@ -79,8 +235,8 @@ class _ReportTableState extends State<ReportTable> {
return Scaffold( return Scaffold(
appBar: AppBar(), appBar: AppBar(),
body: PhotoView( body: PhotoView(
imageProvider: NetworkImage( imageProvider:
item.questionPicture!)), NetworkImage(item.questionPicture!)),
); );
}), }),
); );
@ -100,11 +256,28 @@ class _ReportTableState extends State<ReportTable> {
: Color(0xFF4CC793))), : Color(0xFF4CC793))),
), ),
)), )),
DataCell(Center( DataCell(InkWell(
child: Padding( onTap: (){
padding: EdgeInsets.symmetric(horizontal: 5.r), List<String> parts = item.priorityGeneral.split('');
child: Text(item.priorityGeneral, dcHandle(context, '${parts[1]}', item.questionNo,item.priorityStudentNames);
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))), },
child: Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(item.priorityGeneral,
style:
TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
Image.asset(
'assets/images/job_data_right_icon.png',
width: 10.r,
height: 10.r,
)
],
),
),
), ),
)), )),
], ],

View File

@ -50,7 +50,7 @@ class _StudentKgTableState extends State<StudentKgTable> {
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(item.annotateAnswers == null ?'':item.annotateAnswers!, child: Text(item.questionAnswer == null ?'':item.questionAnswer!,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
), ),
)), )),