数据快查修改

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;
bool sortType; // true false
bool sortLevel;
bool hasUnrated;//
@JsonKey(name: 'studentDetails')
List<StudentDetails> studentDetails;
JobDataReport(this.jobId, this.jobName, this.gradeName, this.className, this.validCount, this.noAnswerCount,
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) {
int num1 = a.kgValidRate + a.zgValidRate;
int num2 = b.kgValidRate + b.zgValidRate;
@ -80,6 +83,24 @@ class StudentDetails extends Object {
@JsonKey(name: '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(
this.studentId,
this.studentName,
@ -89,6 +110,8 @@ class StudentDetails extends Object {
this.zgValidRate,
this.kgDetails,
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);

View File

@ -339,8 +339,8 @@ class Details extends Object {
@JsonKey(name: 'validCount')
String validCount;
@JsonKey(name: 'validStudentNames')
List<String> validStudentNames;
/* @JsonKey(name: 'validStudentNames')
List<String> validStudentNames;*/
@JsonKey(name: 'correctRate')
int correctRate;
@ -357,7 +357,13 @@ class Details extends Object {
@JsonKey(name: '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);

View File

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

View File

@ -11,12 +11,18 @@ class QuickStudentDataTable extends StatefulWidget {
final int? fixedRows;
final int? fixedCols;
final int jobId;
final bool hasUnrated;
final int kgCount;
final int zgCount;
const QuickStudentDataTable({
Key? key,
required this.headList,
required this.bodyList,
required this.jobId,
required this.hasUnrated,
required this.kgCount,
required this.zgCount,
this.fixedCols = 0,
this.fixedRows = 0,
}) : super(key: key);
@ -90,17 +96,39 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(
'${(item.kgValidRate / 100 * item.kgValidCount).toInt()}/${item.kgValidCount}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
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(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(
'${(item.zgValidRate / 100 * item.zgValidCount).toInt()}/${item.zgValidCount}',
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
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(
@ -119,8 +147,8 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
height: 14.r,
decoration: BoxDecoration(
color: kgInfo.state == 0
? Colors.white
: kgInfo.state == 1
? Color(0xFFD3D3D3)
: kgInfo.state == 3?Colors.white:kgInfo.state == 1
? Color(0xFFFF7474)
: Color(0xFF4CC793),
borderRadius: BorderRadius.all(Radius.circular(7.r))),
@ -154,10 +182,10 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
height: 14.r,
decoration: BoxDecoration(
color: kgInfo.state == 0
? Colors.white
: kgInfo.state == 1
? Color(0xFFFF7474)
: Color(0xFF4CC793),
? Color(0xFFD3D3D3)
: kgInfo.state == 3?Colors.white:kgInfo.state == 1
? Color(0xFFFF7474)
: Color(0xFF4CC793),
borderRadius: BorderRadius.all(Radius.circular(7.r))),
child: Center(
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
Widget build(BuildContext context) {
if(!widget.hasUnrated){
widget.headList.removeLast();
}
return DataTable2(
dividerThickness: 0,
scrollController: _controller,
@ -216,13 +256,39 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
// onSelectAll: (val) => setState(() => selectAll(val)),
columns: List.generate(widget.headList.length, (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(
child: Text(item,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
),
// 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,

View File

@ -2,6 +2,7 @@ import 'package:data_table_2/data_table_2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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:photo_view/photo_view.dart';
@ -30,6 +31,144 @@ class _ReportTableState extends State<ReportTable> {
int? _sortColumnIndex;
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]) {
assert(index >= 0);
var item = widget.bodyList[index];
@ -51,11 +190,28 @@ class _ReportTableState extends State<ReportTable> {
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
),
)),
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(item.validCount,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF4CC793))),
DataCell(InkWell(
onTap: () {
zdHandle(context, '作答人数', item.questionNo,item.noAnswerStudentNames,item.answerNgStudentNames);
},
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(
@ -79,8 +235,8 @@ class _ReportTableState extends State<ReportTable> {
return Scaffold(
appBar: AppBar(),
body: PhotoView(
imageProvider: NetworkImage(
item.questionPicture!)),
imageProvider:
NetworkImage(item.questionPicture!)),
);
}),
);
@ -100,11 +256,28 @@ class _ReportTableState extends State<ReportTable> {
: Color(0xFF4CC793))),
),
)),
DataCell(Center(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(item.priorityGeneral,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
DataCell(InkWell(
onTap: (){
List<String> parts = item.priorityGeneral.split('');
dcHandle(context, '${parts[1]}', item.questionNo,item.priorityStudentNames);
},
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(
child: Padding(
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))),
),
)),