Merge branch 'mcy_revision' into main
This commit is contained in:
commit
aca987a4df
|
|
@ -15,7 +15,10 @@ import 'package:marking_app/utils/request/rest_client.dart';
|
|||
|
||||
class JobPriorityReviewSet extends StatefulWidget {
|
||||
final String groupId;
|
||||
const JobPriorityReviewSet({Key? key,required this.groupId}) : super(key: key);
|
||||
final String title;
|
||||
|
||||
const JobPriorityReviewSet({Key? key, required this.groupId,required this.title})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState();
|
||||
|
|
@ -26,6 +29,8 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
late final EasyRefreshController refreshController;
|
||||
late TabController tabController;
|
||||
int tabIndex = 0;
|
||||
List list1 = [];
|
||||
List list2 = [];
|
||||
List levelList = [];
|
||||
bool isClicking = false;
|
||||
|
||||
|
|
@ -36,31 +41,46 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
refreshController = EasyRefreshController();
|
||||
tabController =
|
||||
TabController(initialIndex: tabIndex, length: 2, vsync: this);
|
||||
getReadLevel();
|
||||
getList();
|
||||
}
|
||||
|
||||
void getReadLevel() async{
|
||||
RestClient _client = await getClient();
|
||||
BaseStructureResult<List<JobStudentLevel>> res = await _client.getJobReadLevel(widget.groupId,tabIndex == 0?1:0);
|
||||
void getList() async {
|
||||
await getReadLevel(1);
|
||||
await getReadLevel(0);
|
||||
|
||||
setState(() {
|
||||
if(res.success){
|
||||
levelList = res.data!;
|
||||
levelList = [...list1, ...list2];
|
||||
isClicking = false;
|
||||
}else{
|
||||
levelList = [];
|
||||
}
|
||||
});
|
||||
EasyLoading.dismiss();
|
||||
refreshController.finishRefresh();
|
||||
}
|
||||
|
||||
getReadLevel(int readLevel) async {
|
||||
RestClient _client = await getClient();
|
||||
BaseStructureResult<List<JobStudentLevel>> res =
|
||||
await _client.getJobReadLevel(widget.groupId, readLevel);
|
||||
if (res.success) {
|
||||
if (readLevel == 1) {
|
||||
list1 = res.data!;
|
||||
} else {
|
||||
list2 = res.data!;
|
||||
}
|
||||
} else {
|
||||
if (readLevel == 1) {
|
||||
list1 = [];
|
||||
} else {
|
||||
list2 = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setJobReadLevel(int studentId, int level) async {
|
||||
RestClient _client = await getClient();
|
||||
JobLevelSetParams params = JobLevelSetParams(studentId, level);
|
||||
BaseStructureResult res = await _client.getSetJobReadLevel(params);
|
||||
if (res.code == 200) {
|
||||
getReadLevel();
|
||||
|
||||
getList();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +99,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
title: Text(
|
||||
'优先批阅人配置',
|
||||
widget.title,
|
||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
|
||||
),
|
||||
centerTitle: true,
|
||||
|
|
@ -94,8 +114,10 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 10.r,),
|
||||
Container(
|
||||
SizedBox(
|
||||
height: 10.r,
|
||||
),
|
||||
/* Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 14.r),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC)))
|
||||
|
|
@ -136,7 +158,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
indicatorSize: TabBarIndicatorSize.label,
|
||||
labelPadding: const EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
),*/
|
||||
|
||||
Expanded(
|
||||
child: Padding(
|
||||
|
|
@ -148,159 +170,256 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
onRefresh: () async {
|
||||
getReadLevel();
|
||||
getList();
|
||||
},
|
||||
child: levelList.length>0?isPadFlag?GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
child: levelList.length > 0
|
||||
? isPadFlag
|
||||
? GridView(
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 10.r,
|
||||
crossAxisSpacing: 10.r,
|
||||
childAspectRatio: 556 / 112,
|
||||
),children: List.generate(levelList.length, (index) {
|
||||
),
|
||||
children: List.generate(levelList.length, (index) {
|
||||
JobStudentLevel item = levelList[index];
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
|
||||
|
||||
tabIndex == 0?InkWell(
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.studentName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Color(0xFF6888FD)),
|
||||
)),
|
||||
item.readLevel == 1
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isClicking = true;
|
||||
});
|
||||
setJobReadLevel(item.studentGroupDetailId,0);
|
||||
EasyLoading.show(status: 'loading...');
|
||||
setJobReadLevel(
|
||||
item.studentGroupDetailId, 0);
|
||||
EasyLoading.show(
|
||||
status: 'loading...');
|
||||
},
|
||||
child: Container(
|
||||
height: 20.r,
|
||||
width: 70.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20.r)),
|
||||
color: isClicking
|
||||
? Color(0xFFDCE3FF)
|
||||
: Color(0xFF6888FD),
|
||||
),
|
||||
child: Center(
|
||||
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
|
||||
child: Text(
|
||||
'取消优先',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
):InkWell(
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isClicking = true;
|
||||
});
|
||||
setJobReadLevel(item.studentGroupDetailId,1);
|
||||
EasyLoading.show(status: 'loading...');
|
||||
setJobReadLevel(
|
||||
item.studentGroupDetailId, 1);
|
||||
EasyLoading.show(
|
||||
status: 'loading...');
|
||||
},
|
||||
child: Container(
|
||||
height: 20.r,
|
||||
width: 70.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: isClicking?Color(0xFF6888FD):Color(0xFFFFFFFF),
|
||||
border: Border.all(width: 1.r,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20.r)),
|
||||
color: isClicking
|
||||
? Color(0xFF6888FD)
|
||||
: Color(0xFFFFFFFF),
|
||||
border: Border.all(
|
||||
width: 1.r,
|
||||
color: isClicking
|
||||
? Color(0xFFFFFFFF)
|
||||
: Color(0xFF6888FD)),
|
||||
),
|
||||
child: Center(
|
||||
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),),
|
||||
child: Text(
|
||||
'设为优先',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: isClicking
|
||||
? Color(0xFFFFFFFF)
|
||||
: Color(0xFF6888FD)),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 5.r,),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5.r,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||
RouterManager.router.navigateTo(context,
|
||||
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||
},
|
||||
child: Container(
|
||||
height: 20.r,
|
||||
width: 70.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20.r)),
|
||||
color: Colors.white,
|
||||
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
|
||||
),
|
||||
border: Border.all(
|
||||
width: 1.r,
|
||||
color: Color(0xFFFCA017))),
|
||||
child: Center(
|
||||
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
|
||||
child: Text(
|
||||
'详情',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Color(0xFFFCA017)),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}),):ListView.builder(itemBuilder: (context,index){
|
||||
}),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
JobStudentLevel item = levelList[index];
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 15.r),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 20.r, horizontal: 15.r),
|
||||
margin: EdgeInsets.only(bottom: 15.r),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
|
||||
tabIndex == 0?InkWell(
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.studentName,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Color(0xFF6888FD)),
|
||||
)),
|
||||
item.readLevel == 1
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isClicking = true;
|
||||
});
|
||||
setJobReadLevel(item.studentGroupDetailId,0);
|
||||
EasyLoading.show(status: 'loading...');
|
||||
setJobReadLevel(
|
||||
item.studentGroupDetailId, 0);
|
||||
EasyLoading.show(
|
||||
status: 'loading...');
|
||||
},
|
||||
child: Container(
|
||||
height: 24.r,
|
||||
width: 82.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20.r)),
|
||||
color: isClicking
|
||||
? Color(0xFFDCE3FF)
|
||||
: Color(0xFF6888FD),
|
||||
),
|
||||
child: Center(
|
||||
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
|
||||
child: Text(
|
||||
'取消优先',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
):InkWell(
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
onTap: () {
|
||||
setJobReadLevel(item.studentGroupDetailId,1);
|
||||
EasyLoading.show(status: 'loading...');
|
||||
setJobReadLevel(
|
||||
item.studentGroupDetailId, 1);
|
||||
EasyLoading.show(
|
||||
status: 'loading...');
|
||||
},
|
||||
child: Container(
|
||||
height: 24.r,
|
||||
width: 82.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20.r)),
|
||||
color: Color(0xFFFFFFFF),
|
||||
border: Border.all(width: 1.r,color: Color(0xFF6888FD)),
|
||||
border: Border.all(
|
||||
width: 1.r,
|
||||
color: Color(0xFF6888FD)),
|
||||
),
|
||||
child: Center(
|
||||
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: Color(0xFF6888FD)),),
|
||||
child: Text(
|
||||
'设为优先',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Color(0xFF6888FD)),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 5.r,),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5.r,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||
RouterManager.router.navigateTo(context,
|
||||
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||
},
|
||||
child: Container(
|
||||
height: 20.r,
|
||||
width: 70.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20.r)),
|
||||
color: Colors.white,
|
||||
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
|
||||
),
|
||||
border: Border.all(
|
||||
width: 1.r,
|
||||
color: Color(0xFFFCA017))),
|
||||
child: Center(
|
||||
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
|
||||
child: Text(
|
||||
'详情',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Color(0xFFFCA017)),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},itemCount: levelList.length,):MyEmptyWidget(),
|
||||
},
|
||||
itemCount: levelList.length,
|
||||
)
|
||||
: MyEmptyWidget(),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -309,4 +428,3 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import 'package:marking_app/common/model/common/base_structure_result.dart';
|
|||
import 'package:marking_app/common/model/job/job_student_goups.dart';
|
||||
import 'package:marking_app/common/model/user/user_info.dart';
|
||||
import 'package:marking_app/components/ReturnToHomepage.dart';
|
||||
import 'package:marking_app/pages/homework_correction/widget/student_group_list.dart';
|
||||
import 'package:marking_app/routes/RouterManager.dart';
|
||||
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||
import 'package:marking_app/utils/fast_data.dart';
|
||||
|
|
@ -57,6 +58,10 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
|
|||
refreshController.finishRefresh();
|
||||
}
|
||||
|
||||
void goNextPage(id,title){
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}',transition: getTransition());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
|
|
@ -94,136 +99,7 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
|
|||
onRefresh: () async{
|
||||
getStudentGroups();
|
||||
},
|
||||
child: studentGroups != null && studentGroups.length > 0
|
||||
? isPadFlag?GridView(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 10.r,
|
||||
crossAxisSpacing: 10.r,
|
||||
childAspectRatio: 556 / 112,
|
||||
),
|
||||
children: List.generate(studentGroups.length, (index) {
|
||||
JobStudentGroups item = studentGroups[index];
|
||||
String classNames = item.classNames.join(" ");
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 8.r),
|
||||
child: Text(
|
||||
item.groupName,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: Color(0xFF6888FD)),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
classNames,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Color(0xFF999999),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 5.r),
|
||||
height: 20.r,
|
||||
width: 55.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(20.r)),
|
||||
color: Color(0xFF6888FD),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'设置',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
):ListView.builder(
|
||||
itemBuilder: (context,index){
|
||||
JobStudentGroups item = studentGroups[index];
|
||||
String classNames = item.classNames.join(" ");
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical:15.r,horizontal: 10.r),
|
||||
margin: EdgeInsets.only(bottom: 10.r),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 8.r),
|
||||
child: Text(
|
||||
item.groupName,
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp, color: Color(0xFF6888FD)),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
classNames,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Color(0xFF999999),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: (){
|
||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 5.r),
|
||||
height: 24.r,
|
||||
width: 55.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(20.r)),
|
||||
color: Color(0xFF6888FD),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'设置',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: studentGroups.length,
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r),
|
||||
child: MyEmptyWidget(),
|
||||
),
|
||||
child: StudentGroupList(studentGroups,goNextPage),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:marking_app/common/model/job/job_student_goups.dart';
|
||||
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||
import 'package:marking_app/utils/index.dart';
|
||||
|
||||
class StudentGroupList extends StatelessWidget {
|
||||
final List studentGroups;
|
||||
final Function goNextPage;
|
||||
const StudentGroupList(this.studentGroups,this.goNextPage,{Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return studentGroups != null && studentGroups.length > 0
|
||||
? isPad()?GridView(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 10.r,
|
||||
crossAxisSpacing: 10.r,
|
||||
childAspectRatio: 556 / 112,
|
||||
),
|
||||
children: List.generate(studentGroups.length, (index) {
|
||||
JobStudentGroups item = studentGroups[index];
|
||||
String classNames = item.classNames.join(" ");
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
goNextPage(item.groupId,item.groupName);
|
||||
// RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 8.r),
|
||||
child: Text(
|
||||
item.groupName,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: Color(0xFF6888FD)),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
classNames,
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Color(0xFF999999),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 5.r),
|
||||
height: 20.r,
|
||||
width: 55.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(20.r)),
|
||||
color: Color(0xFF6888FD),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'详情',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
):ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context,index){
|
||||
JobStudentGroups item = studentGroups[index];
|
||||
String classNames = item.classNames.join(" ");
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical:15.r,horizontal: 10.r),
|
||||
margin: EdgeInsets.only(bottom: 10.r),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 8.r),
|
||||
child: Text(
|
||||
item.groupName,
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp, color: Color(0xFF6888FD)),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
classNames,
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Color(0xFF999999),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: (){
|
||||
goNextPage(item.groupId,item.groupName);
|
||||
// RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 5.r),
|
||||
height: 24.r,
|
||||
width: 55.r,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(20.r)),
|
||||
color: Color(0xFF6888FD),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'详情',
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: studentGroups.length,
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r),
|
||||
child: MyEmptyWidget(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -309,7 +309,8 @@ class RouterManager {
|
|||
static final _jobPriorityReviewSetPageHandler = Handler(
|
||||
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||
String groupId = params['groupId']![0];
|
||||
return JobPriorityReviewSet(groupId: groupId);
|
||||
String title = params['title']![0];
|
||||
return JobPriorityReviewSet(groupId: groupId,title:title);
|
||||
},
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ class CommonUtils {
|
|||
}
|
||||
/// 秒转时分秒
|
||||
static String second2HMS(int sec, {bool isEasy = false}) {
|
||||
String hms = "00:00:00";
|
||||
if (!isEasy) hms = "00时00分00秒";
|
||||
String hms = "0";
|
||||
if (!isEasy) hms = "0秒";
|
||||
if (sec > 0) {
|
||||
int h = sec ~/ 3600;
|
||||
int m = (sec % 3600) ~/ 60;
|
||||
|
|
|
|||
Loading…
Reference in New Issue