Compare commits
No commits in common. "aca987a4df118c20b361e54ad114089d9574798a" and "9db7a540dd76e5d2fd48dcdc14c252ae5e8f2eb5" have entirely different histories.
aca987a4df
...
9db7a540dd
|
|
@ -15,22 +15,17 @@ import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
|
|
||||||
class JobPriorityReviewSet extends StatefulWidget {
|
class JobPriorityReviewSet extends StatefulWidget {
|
||||||
final String groupId;
|
final String groupId;
|
||||||
final String title;
|
const JobPriorityReviewSet({Key? key,required this.groupId}) : super(key: key);
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -41,46 +36,31 @@ 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);
|
||||||
getList();
|
getReadLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void getList() async {
|
void getReadLevel() async{
|
||||||
await getReadLevel(1);
|
RestClient _client = await getClient();
|
||||||
await getReadLevel(0);
|
BaseStructureResult<List<JobStudentLevel>> res = await _client.getJobReadLevel(widget.groupId,tabIndex == 0?1:0);
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
levelList = [...list1, ...list2];
|
if(res.success){
|
||||||
|
levelList = res.data!;
|
||||||
isClicking = false;
|
isClicking = false;
|
||||||
|
}else{
|
||||||
|
levelList = [];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
EasyLoading.dismiss();
|
EasyLoading.dismiss();
|
||||||
refreshController.finishRefresh();
|
refreshController.finishRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
getReadLevel(int readLevel) async {
|
void setJobReadLevel(int studentId,int level) 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){
|
||||||
getList();
|
getReadLevel();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,7 +79,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,
|
||||||
|
|
@ -114,10 +94,8 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(height: 10.r,),
|
||||||
height: 10.r,
|
Container(
|
||||||
),
|
|
||||||
/* 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)))
|
||||||
|
|
@ -158,268 +136,171 @@ 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{
|
||||||
getList();
|
getReadLevel();
|
||||||
},
|
},
|
||||||
child: levelList.length > 0
|
child: levelList.length>0?isPadFlag?GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
? isPadFlag
|
|
||||||
? GridView(
|
|
||||||
gridDelegate:
|
|
||||||
SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 2,
|
||||||
mainAxisSpacing: 10.r,
|
mainAxisSpacing: 10.r,
|
||||||
crossAxisSpacing: 10.r,
|
crossAxisSpacing: 10.r,
|
||||||
childAspectRatio: 556 / 112,
|
childAspectRatio: 556 / 112,
|
||||||
),
|
),children: List.generate(levelList.length, (index) {
|
||||||
children: List.generate(levelList.length, (index) {
|
|
||||||
JobStudentLevel item = levelList[index];
|
JobStudentLevel item = levelList[index];
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||||
BorderRadius.all(Radius.circular(10.r)),
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
|
||||||
child: Text(
|
|
||||||
item.studentName,
|
tabIndex == 0?InkWell(
|
||||||
style: TextStyle(
|
onTap: (){
|
||||||
fontSize: 12.sp,
|
|
||||||
color: Color(0xFF6888FD)),
|
|
||||||
)),
|
|
||||||
item.readLevel == 1
|
|
||||||
? InkWell(
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
isClicking = true;
|
isClicking = true;
|
||||||
});
|
});
|
||||||
setJobReadLevel(
|
setJobReadLevel(item.studentGroupDetailId,0);
|
||||||
item.studentGroupDetailId, 0);
|
EasyLoading.show(status: 'loading...');
|
||||||
EasyLoading.show(
|
|
||||||
status: 'loading...');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 20.r,
|
height: 20.r,
|
||||||
width: 70.r,
|
width: 70.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
Radius.circular(20.r)),
|
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
|
||||||
color: isClicking
|
|
||||||
? Color(0xFFDCE3FF)
|
|
||||||
: Color(0xFF6888FD),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
|
||||||
'取消优先',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 10.sp,
|
|
||||||
color: Colors.white),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
):InkWell(
|
||||||
)
|
onTap: (){
|
||||||
: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
isClicking = true;
|
isClicking = true;
|
||||||
});
|
});
|
||||||
setJobReadLevel(
|
setJobReadLevel(item.studentGroupDetailId,1);
|
||||||
item.studentGroupDetailId, 1);
|
EasyLoading.show(status: 'loading...');
|
||||||
EasyLoading.show(
|
|
||||||
status: 'loading...');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 20.r,
|
height: 20.r,
|
||||||
width: 70.r,
|
width: 70.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
Radius.circular(20.r)),
|
color: isClicking?Color(0xFF6888FD):Color(0xFFFFFFFF),
|
||||||
color: isClicking
|
border: Border.all(width: 1.r,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),
|
||||||
? Color(0xFF6888FD)
|
|
||||||
: Color(0xFFFFFFFF),
|
|
||||||
border: Border.all(
|
|
||||||
width: 1.r,
|
|
||||||
color: isClicking
|
|
||||||
? Color(0xFFFFFFFF)
|
|
||||||
: Color(0xFF6888FD)),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),),
|
||||||
'设为优先',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 10.sp,
|
|
||||||
color: isClicking
|
|
||||||
? Color(0xFFFFFFFF)
|
|
||||||
: Color(0xFF6888FD)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(width: 5.r,),
|
||||||
SizedBox(
|
|
||||||
width: 5.r,
|
|
||||||
),
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: (){
|
||||||
RouterManager.router.navigateTo(context,
|
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||||
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 20.r,
|
height: 20.r,
|
||||||
width: 70.r,
|
width: 70.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
Radius.circular(20.r)),
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
border: Border.all(
|
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
|
||||||
width: 1.r,
|
|
||||||
color: Color(0xFFFCA017))),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'详情',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 10.sp,
|
|
||||||
color: Color(0xFFFCA017)),
|
|
||||||
),
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),):ListView.builder(itemBuilder: (context,index){
|
||||||
)
|
|
||||||
: ListView.builder(
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
JobStudentLevel item = levelList[index];
|
JobStudentLevel item = levelList[index];
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 15.r),
|
||||||
vertical: 20.r, horizontal: 15.r),
|
|
||||||
margin: EdgeInsets.only(bottom: 15.r),
|
margin: EdgeInsets.only(bottom: 15.r),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.all(Radius.circular(10.r)),
|
||||||
BorderRadius.all(Radius.circular(10.r)),
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
|
||||||
child: Text(
|
tabIndex == 0?InkWell(
|
||||||
item.studentName,
|
onTap: (){
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12.sp,
|
|
||||||
color: Color(0xFF6888FD)),
|
|
||||||
)),
|
|
||||||
item.readLevel == 1
|
|
||||||
? InkWell(
|
|
||||||
onTap: () {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
isClicking = true;
|
isClicking = true;
|
||||||
});
|
});
|
||||||
setJobReadLevel(
|
setJobReadLevel(item.studentGroupDetailId,0);
|
||||||
item.studentGroupDetailId, 0);
|
EasyLoading.show(status: 'loading...');
|
||||||
EasyLoading.show(
|
|
||||||
status: 'loading...');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 24.r,
|
height: 24.r,
|
||||||
width: 82.r,
|
width: 82.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
Radius.circular(20.r)),
|
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
|
||||||
color: isClicking
|
|
||||||
? Color(0xFFDCE3FF)
|
|
||||||
: Color(0xFF6888FD),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
|
||||||
'取消优先',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 10.sp,
|
|
||||||
color: Colors.white),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
):InkWell(
|
||||||
)
|
onTap: (){
|
||||||
: InkWell(
|
setJobReadLevel(item.studentGroupDetailId,1);
|
||||||
onTap: () {
|
EasyLoading.show(status: 'loading...');
|
||||||
setJobReadLevel(
|
|
||||||
item.studentGroupDetailId, 1);
|
|
||||||
EasyLoading.show(
|
|
||||||
status: 'loading...');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 24.r,
|
height: 24.r,
|
||||||
width: 82.r,
|
width: 82.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
Radius.circular(20.r)),
|
|
||||||
color: Color(0xFFFFFFFF),
|
color: Color(0xFFFFFFFF),
|
||||||
border: Border.all(
|
border: Border.all(width: 1.r,color: Color(0xFF6888FD)),
|
||||||
width: 1.r,
|
|
||||||
color: Color(0xFF6888FD)),
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: Color(0xFF6888FD)),),
|
||||||
'设为优先',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 10.sp,
|
|
||||||
color: Color(0xFF6888FD)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(width: 5.r,),
|
||||||
SizedBox(
|
|
||||||
width: 5.r,
|
|
||||||
),
|
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: (){
|
||||||
RouterManager.router.navigateTo(context,
|
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
||||||
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 20.r,
|
height: 20.r,
|
||||||
width: 70.r,
|
width: 70.r,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(Radius.circular(20.r)),
|
||||||
Radius.circular(20.r)),
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
border: Border.all(
|
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
|
||||||
width: 1.r,
|
|
||||||
color: Color(0xFFFCA017))),
|
|
||||||
child: Center(
|
|
||||||
child: Text(
|
|
||||||
'详情',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 10.sp,
|
|
||||||
color: Color(0xFFFCA017)),
|
|
||||||
),
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},itemCount: levelList.length,):MyEmptyWidget(),
|
||||||
itemCount: levelList.length,
|
|
||||||
)
|
|
||||||
: MyEmptyWidget(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -428,3 +309,4 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ 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';
|
||||||
|
|
@ -58,10 +57,6 @@ 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();
|
||||||
|
|
@ -99,7 +94,136 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
|
||||||
onRefresh: () async{
|
onRefresh: () async{
|
||||||
getStudentGroups();
|
getStudentGroups();
|
||||||
},
|
},
|
||||||
child: StudentGroupList(studentGroups,goNextPage),
|
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(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,149 +0,0 @@
|
||||||
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,8 +309,7 @@ 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];
|
||||||
String title = params['title']![0];
|
return JobPriorityReviewSet(groupId: groupId);
|
||||||
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 = "0";
|
String hms = "00:00:00";
|
||||||
if (!isEasy) hms = "0秒";
|
if (!isEasy) hms = "00时00分00秒";
|
||||||
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