From 65e57bcae812d50bddc869e84692975c02cb4052 Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Mon, 26 Feb 2024 10:44:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=AD=97=E6=AE=B5=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/model/report/detail_base_info.dart | 8 ++++++- .../lib/pages/report_detail/index.dart | 2 +- .../report_detail/widgets/basic_table.dart | 21 +++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/marking_app/lib/common/model/report/detail_base_info.dart b/marking_app/lib/common/model/report/detail_base_info.dart index 58648a7..3fe2a91 100644 --- a/marking_app/lib/common/model/report/detail_base_info.dart +++ b/marking_app/lib/common/model/report/detail_base_info.dart @@ -57,7 +57,13 @@ class BaseInfo extends Object { @JsonKey(name: 'RatePass') String ratePass; - BaseInfo(this.examName,this.examType,this.grade,this.subject,this.examTime,this.totalScore,this.avgScore,this.maxScore,this.rateGood,this.ratePass,); + @JsonKey(name: 'TotalRank') + int totalRank; + + @JsonKey(name: 'JoinCount') + int joinCount; + + BaseInfo(this.examName,this.examType,this.grade,this.subject,this.examTime,this.totalScore,this.avgScore,this.maxScore,this.rateGood,this.ratePass,this.totalRank,this.joinCount,); factory BaseInfo.fromJson(Map srcJson) => _$BaseInfoFromJson(srcJson); diff --git a/marking_app/lib/pages/report_detail/index.dart b/marking_app/lib/pages/report_detail/index.dart index e74f68b..bb4e31a 100644 --- a/marking_app/lib/pages/report_detail/index.dart +++ b/marking_app/lib/pages/report_detail/index.dart @@ -404,7 +404,7 @@ class _ReportDetailState extends ConsumerState with CommonMixin { ), ), LabTitle('基本信息', 'assets/images/basic_info.png'), - BasicTable(baseInfo), + BasicTable(baseInfo,!widget.showGrade || !isGrade), LabTitle('总体水平', 'assets/images/overall_level.png'), OverallLevelTable( overallLevelRes!.data!.module1CJZL.sheets[0]), diff --git a/marking_app/lib/pages/report_detail/widgets/basic_table.dart b/marking_app/lib/pages/report_detail/widgets/basic_table.dart index 0a0b6b1..84bb212 100644 --- a/marking_app/lib/pages/report_detail/widgets/basic_table.dart +++ b/marking_app/lib/pages/report_detail/widgets/basic_table.dart @@ -5,8 +5,9 @@ import 'package:marking_app/pages/report_detail/widgets/basic_tablecell.dart'; class BasicTable extends StatelessWidget { final BaseInfo? baseInfo; + final bool? showGrade; - const BasicTable(this.baseInfo, {Key? key}) : super(key: key); + const BasicTable(this.baseInfo, this.showGrade ,{Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -96,7 +97,23 @@ class BasicTable extends StatelessWidget { ], ), ), - ) + ), + if(showGrade == true) + Container( + decoration: BoxDecoration( + border: Border(bottom: BorderSide(width: 1, color: Color(0xFFE8EBFF))) + ), + child: IntrinsicHeight( + child: Row( + children: [ + Expanded(flex: 1, child: BasicTableCell('年级平均分排名', false)), + Expanded(flex: 1, child: BasicTableCell(baseInfo!.totalRank.toString(), true)), + Expanded(flex: 1, child: BasicTableCell('参考班级总数', false)), + Expanded(flex: 1, child: BasicTableCell(baseInfo!.joinCount.toString(), true)), + ], + ), + ), + ) ], ), );