优先配置修改
This commit is contained in:
parent
d7ad4912eb
commit
46f4beaf81
|
|
@ -15,17 +15,22 @@ import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
|
|
||||||
class JobPriorityReviewSet extends StatefulWidget {
|
class JobPriorityReviewSet extends StatefulWidget {
|
||||||
final String groupId;
|
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
|
@override
|
||||||
State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState();
|
State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
with CommonMixin,SingleTickerProviderStateMixin {
|
with CommonMixin, SingleTickerProviderStateMixin {
|
||||||
late final EasyRefreshController refreshController;
|
late final EasyRefreshController refreshController;
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
int tabIndex = 0;
|
int tabIndex = 0;
|
||||||
|
List list1 = [];
|
||||||
|
List list2 = [];
|
||||||
List levelList = [];
|
List levelList = [];
|
||||||
bool isClicking = false;
|
bool isClicking = false;
|
||||||
|
|
||||||
|
|
@ -36,32 +41,47 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
refreshController = EasyRefreshController();
|
refreshController = EasyRefreshController();
|
||||||
tabController =
|
tabController =
|
||||||
TabController(initialIndex: tabIndex, length: 2, vsync: this);
|
TabController(initialIndex: tabIndex, length: 2, vsync: this);
|
||||||
getReadLevel();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void getReadLevel() async{
|
void getList() async {
|
||||||
RestClient _client = await getClient();
|
await getReadLevel(1);
|
||||||
BaseStructureResult<List<JobStudentLevel>> res = await _client.getJobReadLevel(widget.groupId,tabIndex == 0?1:0);
|
await getReadLevel(0);
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
if(res.success){
|
levelList = [...list1, ...list2];
|
||||||
levelList = res.data!;
|
isClicking = false;
|
||||||
isClicking = false;
|
|
||||||
}else{
|
|
||||||
levelList = [];
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
EasyLoading.dismiss();
|
EasyLoading.dismiss();
|
||||||
refreshController.finishRefresh();
|
refreshController.finishRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setJobReadLevel(int studentId,int level) async{
|
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();
|
RestClient _client = await getClient();
|
||||||
JobLevelSetParams params = JobLevelSetParams(studentId, level);
|
JobLevelSetParams params = JobLevelSetParams(studentId, level);
|
||||||
BaseStructureResult res = await _client.getSetJobReadLevel(params);
|
BaseStructureResult res = await _client.getSetJobReadLevel(params);
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
getReadLevel();
|
getList();
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -79,7 +99,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
title: Text(
|
title: Text(
|
||||||
'优先批阅人配置',
|
widget.title,
|
||||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
|
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
|
||||||
),
|
),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
|
@ -94,8 +114,10 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 10.r,),
|
SizedBox(
|
||||||
Container(
|
height: 10.r,
|
||||||
|
),
|
||||||
|
/* Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 14.r),
|
padding: EdgeInsets.symmetric(horizontal: 14.r),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC)))
|
border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC)))
|
||||||
|
|
@ -136,171 +158,268 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
indicatorSize: TabBarIndicatorSize.label,
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
labelPadding: const EdgeInsets.all(0),
|
labelPadding: const EdgeInsets.all(0),
|
||||||
),
|
),
|
||||||
),
|
),*/
|
||||||
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child:Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical:14.r,horizontal: 14.r),
|
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
|
||||||
child: EasyRefresh(
|
child: EasyRefresh(
|
||||||
firstRefresh: true,
|
firstRefresh: true,
|
||||||
taskIndependence: true,
|
taskIndependence: true,
|
||||||
controller: refreshController,
|
controller: refreshController,
|
||||||
header: MaterialHeader(),
|
header: MaterialHeader(),
|
||||||
footer: TaurusFooter(),
|
footer: TaurusFooter(),
|
||||||
onRefresh: () async{
|
onRefresh: () async {
|
||||||
getReadLevel();
|
getList();
|
||||||
},
|
},
|
||||||
child: levelList.length>0?isPadFlag?GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
child: levelList.length > 0
|
||||||
crossAxisCount: 2,
|
? isPadFlag
|
||||||
mainAxisSpacing: 10.r,
|
? GridView(
|
||||||
crossAxisSpacing: 10.r,
|
gridDelegate:
|
||||||
childAspectRatio: 556 / 112,
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
),children: List.generate(levelList.length, (index) {
|
crossAxisCount: 2,
|
||||||
JobStudentLevel item = levelList[index];
|
mainAxisSpacing: 10.r,
|
||||||
return Container(
|
crossAxisSpacing: 10.r,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
childAspectRatio: 556 / 112,
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
|
|
||||||
|
|
||||||
tabIndex == 0?InkWell(
|
|
||||||
onTap: (){
|
|
||||||
setState(() {
|
|
||||||
isClicking = true;
|
|
||||||
});
|
|
||||||
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),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
children: List.generate(levelList.length, (index) {
|
||||||
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
|
JobStudentLevel item = levelList[index];
|
||||||
),
|
return Container(
|
||||||
),
|
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
):InkWell(
|
decoration: BoxDecoration(
|
||||||
onTap: (){
|
borderRadius:
|
||||||
setState(() {
|
BorderRadius.all(Radius.circular(10.r)),
|
||||||
isClicking = true;
|
color: Colors.white,
|
||||||
});
|
),
|
||||||
setJobReadLevel(item.studentGroupDetailId,1);
|
child: Row(
|
||||||
EasyLoading.show(status: 'loading...');
|
mainAxisAlignment:
|
||||||
},
|
MainAxisAlignment.spaceBetween,
|
||||||
child: Container(
|
children: [
|
||||||
height: 20.r,
|
Expanded(
|
||||||
width: 70.r,
|
child: Text(
|
||||||
decoration: BoxDecoration(
|
item.studentName,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
style: TextStyle(
|
||||||
color: isClicking?Color(0xFF6888FD):Color(0xFFFFFFFF),
|
fontSize: 12.sp,
|
||||||
border: Border.all(width: 1.r,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),
|
color: Color(0xFF6888FD)),
|
||||||
),
|
)),
|
||||||
child: Center(
|
item.readLevel == 1
|
||||||
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),),
|
? InkWell(
|
||||||
),
|
onTap: () {
|
||||||
),
|
setState(() {
|
||||||
),
|
isClicking = true;
|
||||||
SizedBox(width: 5.r,),
|
});
|
||||||
InkWell(
|
setJobReadLevel(
|
||||||
onTap: (){
|
item.studentGroupDetailId, 0);
|
||||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
EasyLoading.show(
|
||||||
},
|
status: 'loading...');
|
||||||
child: Container(
|
},
|
||||||
height: 20.r,
|
child: Container(
|
||||||
width: 70.r,
|
height: 20.r,
|
||||||
decoration: BoxDecoration(
|
width: 70.r,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
borderRadius: BorderRadius.all(
|
||||||
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
|
Radius.circular(20.r)),
|
||||||
),
|
color: isClicking
|
||||||
child: Center(
|
? Color(0xFFDCE3FF)
|
||||||
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
|
: Color(0xFF6888FD),
|
||||||
),
|
),
|
||||||
),
|
child: Center(
|
||||||
)
|
child: Text(
|
||||||
],
|
'取消优先',
|
||||||
),
|
style: TextStyle(
|
||||||
);
|
fontSize: 10.sp,
|
||||||
}),):ListView.builder(itemBuilder: (context,index){
|
color: Colors.white),
|
||||||
JobStudentLevel item = levelList[index];
|
),
|
||||||
return Container(
|
),
|
||||||
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 15.r),
|
),
|
||||||
margin: EdgeInsets.only(bottom: 15.r),
|
)
|
||||||
decoration: BoxDecoration(
|
: InkWell(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
onTap: () {
|
||||||
color: Colors.white,
|
setState(() {
|
||||||
),
|
isClicking = true;
|
||||||
child: Row(
|
});
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
setJobReadLevel(
|
||||||
children: [
|
item.studentGroupDetailId, 1);
|
||||||
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
|
EasyLoading.show(
|
||||||
tabIndex == 0?InkWell(
|
status: 'loading...');
|
||||||
onTap: (){
|
},
|
||||||
setState(() {
|
child: Container(
|
||||||
isClicking = true;
|
height: 20.r,
|
||||||
});
|
width: 70.r,
|
||||||
setJobReadLevel(item.studentGroupDetailId,0);
|
decoration: BoxDecoration(
|
||||||
EasyLoading.show(status: 'loading...');
|
borderRadius: BorderRadius.all(
|
||||||
},
|
Radius.circular(20.r)),
|
||||||
child: Container(
|
color: isClicking
|
||||||
height: 24.r,
|
? Color(0xFF6888FD)
|
||||||
width: 82.r,
|
: Color(0xFFFFFFFF),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
width: 1.r,
|
||||||
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
|
color: isClicking
|
||||||
),
|
? Color(0xFFFFFFFF)
|
||||||
child: Center(
|
: Color(0xFF6888FD)),
|
||||||
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
|
),
|
||||||
),
|
child: Center(
|
||||||
),
|
child: Text(
|
||||||
):InkWell(
|
'设为优先',
|
||||||
onTap: (){
|
style: TextStyle(
|
||||||
setJobReadLevel(item.studentGroupDetailId,1);
|
fontSize: 10.sp,
|
||||||
EasyLoading.show(status: 'loading...');
|
color: isClicking
|
||||||
},
|
? Color(0xFFFFFFFF)
|
||||||
child: Container(
|
: Color(0xFF6888FD)),
|
||||||
height: 24.r,
|
),
|
||||||
width: 82.r,
|
),
|
||||||
decoration: BoxDecoration(
|
),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
),
|
||||||
color: Color(0xFFFFFFFF),
|
SizedBox(
|
||||||
border: Border.all(width: 1.r,color: Color(0xFF6888FD)),
|
width: 5.r,
|
||||||
),
|
),
|
||||||
child: Center(
|
InkWell(
|
||||||
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: Color(0xFF6888FD)),),
|
onTap: () {
|
||||||
),
|
RouterManager.router.navigateTo(context,
|
||||||
),
|
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||||
),
|
},
|
||||||
SizedBox(width: 5.r,),
|
child: Container(
|
||||||
InkWell(
|
height: 20.r,
|
||||||
onTap: (){
|
width: 70.r,
|
||||||
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
decoration: BoxDecoration(
|
||||||
},
|
borderRadius: BorderRadius.all(
|
||||||
child: Container(
|
Radius.circular(20.r)),
|
||||||
height: 20.r,
|
color: Colors.white,
|
||||||
width: 70.r,
|
border: Border.all(
|
||||||
decoration: BoxDecoration(
|
width: 1.r,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
color: Color(0xFFFCA017))),
|
||||||
color: Colors.white,
|
child: Center(
|
||||||
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
|
child: Text(
|
||||||
),
|
'详情',
|
||||||
child: Center(
|
style: TextStyle(
|
||||||
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
|
fontSize: 10.sp,
|
||||||
),
|
color: Color(0xFFFCA017)),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
),
|
||||||
),
|
)
|
||||||
);
|
],
|
||||||
},itemCount: levelList.length,):MyEmptyWidget(),
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
JobStudentLevel item = levelList[index];
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 20.r, horizontal: 15.r),
|
||||||
|
margin: EdgeInsets.only(bottom: 15.r),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.all(Radius.circular(10.r)),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
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...');
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 24.r,
|
||||||
|
width: 82.r,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
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)),
|
||||||
|
color: Color(0xFFFFFFFF),
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.r,
|
||||||
|
color: Color(0xFF6888FD)),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'设为优先',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10.sp,
|
||||||
|
color: Color(0xFF6888FD)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 5.r,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
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)),
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(
|
||||||
|
width: 1.r,
|
||||||
|
color: Color(0xFFFCA017))),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'详情',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10.sp,
|
||||||
|
color: Color(0xFFFCA017)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
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/job/job_student_goups.dart';
|
||||||
import 'package:marking_app/common/model/user/user_info.dart';
|
import 'package:marking_app/common/model/user/user_info.dart';
|
||||||
import 'package:marking_app/components/ReturnToHomepage.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/routes/RouterManager.dart';
|
||||||
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||||
import 'package:marking_app/utils/fast_data.dart';
|
import 'package:marking_app/utils/fast_data.dart';
|
||||||
|
|
@ -57,6 +58,10 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
|
||||||
refreshController.finishRefresh();
|
refreshController.finishRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void goNextPage(id,title){
|
||||||
|
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}',transition: getTransition());
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
|
@ -94,136 +99,7 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
|
||||||
onRefresh: () async{
|
onRefresh: () async{
|
||||||
getStudentGroups();
|
getStudentGroups();
|
||||||
},
|
},
|
||||||
child: studentGroups != null && studentGroups.length > 0
|
child: StudentGroupList(studentGroups,goNextPage),
|
||||||
? 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(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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(
|
static final _jobPriorityReviewSetPageHandler = Handler(
|
||||||
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||||
String groupId = params['groupId']![0];
|
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}) {
|
static String second2HMS(int sec, {bool isEasy = false}) {
|
||||||
String hms = "00:00:00";
|
String hms = "0";
|
||||||
if (!isEasy) hms = "00时00分00秒";
|
if (!isEasy) hms = "0秒";
|
||||||
if (sec > 0) {
|
if (sec > 0) {
|
||||||
int h = sec ~/ 3600;
|
int h = sec ~/ 3600;
|
||||||
int m = (sec % 3600) ~/ 60;
|
int m = (sec % 3600) ~/ 60;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue