待批阅分页
This commit is contained in:
parent
094f0385dc
commit
9d760da027
|
|
@ -37,20 +37,23 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
int active = 1;
|
int active = 1;
|
||||||
late RxList<Items> unAnnotateList = RxList();
|
late RxList<Items> unAnnotateList = RxList();
|
||||||
late RxList<Items> annotateList = RxList();
|
late RxList<Items> annotateList = RxList();
|
||||||
late int page = 1;
|
|
||||||
|
|
||||||
|
// late int page = 1;
|
||||||
|
|
||||||
late TabController tabController2;
|
late TabController tabController2;
|
||||||
|
|
||||||
/* 待阅卷 */
|
/* 待阅卷 */
|
||||||
late final EasyRefreshController refreshController1;
|
late final EasyRefreshController refreshController1;
|
||||||
late final EasyRefreshController refreshController2;
|
late final EasyRefreshController refreshController2;
|
||||||
WorkStudentParams params = WorkStudentParams(
|
WorkStudentParams params = WorkStudentParams(
|
||||||
assessType: 0,
|
assessType: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageNumber: 1,
|
||||||
);
|
);
|
||||||
WorkStudentParams params2 = WorkStudentParams(
|
WorkStudentParams params2 = WorkStudentParams(
|
||||||
assessType: 0,
|
assessType: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
pageNumber: 1,
|
||||||
startDate: Utils.getWeekStartDate().toString().substring(0, 10),
|
startDate: Utils.getWeekStartDate().toString().substring(0, 10),
|
||||||
endDate: Utils.getWeekEndDate().toString().substring(0, 10),
|
endDate: Utils.getWeekEndDate().toString().substring(0, 10),
|
||||||
);
|
);
|
||||||
|
|
@ -67,32 +70,41 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
EasyLoading.show(status: 'loading...');
|
EasyLoading.show(status: 'loading...');
|
||||||
getUnAnnotateList();
|
getUnAnnotateList();
|
||||||
getAnnotateList();
|
getAnnotateList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//待批阅列表
|
//待批阅列表
|
||||||
void getUnAnnotateList() async {
|
void getUnAnnotateList() async {
|
||||||
WorkStudent data = WorkStudent([], 0);
|
WorkStudent data = WorkStudent([], 0);
|
||||||
params.pageNumber = page;
|
|
||||||
data = await getClient().getUnAnnotateList(params);
|
data = await getClient().getUnAnnotateList(params);
|
||||||
|
if (params.pageNumber == 1) {
|
||||||
unAnnotateList.value = data.items;
|
unAnnotateList.value = data.items;
|
||||||
|
} else {
|
||||||
|
List<Items> list = unAnnotateList.value;
|
||||||
|
unAnnotateList.value = [...list,...data.items];
|
||||||
|
}
|
||||||
refreshController1.finishRefresh();
|
refreshController1.finishRefresh();
|
||||||
refreshController2.finishRefresh();
|
refreshController2.finishRefresh();
|
||||||
EasyLoading.dismiss();
|
EasyLoading.dismiss();
|
||||||
print('state.unAnnotateList.length=${unAnnotateList.length}');
|
print('state.unAnnotateList.length=${unAnnotateList.length}');
|
||||||
}
|
}
|
||||||
|
|
||||||
//已批阅列表
|
//已批阅列表
|
||||||
void getAnnotateList() async {
|
void getAnnotateList() async {
|
||||||
WorkStudent data = WorkStudent([], 0);
|
WorkStudent data = WorkStudent([], 0);
|
||||||
params2.pageNumber = page;
|
|
||||||
data = await getClient().getAnnotatedList(params2);
|
data = await getClient().getAnnotatedList(params2);
|
||||||
|
if (params2.pageNumber == 1) {
|
||||||
annotateList.value = data.items;
|
annotateList.value = data.items;
|
||||||
|
} else {
|
||||||
|
List<Items> list = annotateList.value;
|
||||||
|
annotateList.value = [...list,...data.items];
|
||||||
|
}
|
||||||
|
|
||||||
refreshController1.finishRefresh();
|
refreshController1.finishRefresh();
|
||||||
refreshController2.finishRefresh();
|
refreshController2.finishRefresh();
|
||||||
EasyLoading.dismiss();
|
EasyLoading.dismiss();
|
||||||
print('state.annotateList.length=${annotateList.length}');
|
print('state.annotateList.length=${annotateList.length}');
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 刷新方法
|
/// 刷新方法
|
||||||
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
|
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
|
||||||
/* params.page = RequestConfig.basePage.page;
|
/* params.page = RequestConfig.basePage.page;
|
||||||
|
|
@ -102,8 +114,10 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
toUpState(setState, () {}, mounted);*/
|
toUpState(setState, () {}, mounted);*/
|
||||||
if (widget.tabIndex == 0) {
|
if (widget.tabIndex == 0) {
|
||||||
|
params.pageNumber = 1;
|
||||||
getUnAnnotateList();
|
getUnAnnotateList();
|
||||||
} else {
|
} else {
|
||||||
|
params2.pageNumber = 1;
|
||||||
getAnnotateList();
|
getAnnotateList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -125,8 +139,14 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
tab == 1 ? markingDatas1.addAll(lists) : markingDatas2.addAll(lists);
|
tab == 1 ? markingDatas1.addAll(lists) : markingDatas2.addAll(lists);
|
||||||
toUpState(setState, () {}, mounted);
|
toUpState(setState, () {}, mounted);
|
||||||
}*/
|
}*/
|
||||||
|
if (widget.tabIndex == 0) {
|
||||||
|
params.pageNumber++;
|
||||||
|
getUnAnnotateList();
|
||||||
|
} else {
|
||||||
|
params2.pageNumber++;
|
||||||
|
getAnnotateList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -143,13 +163,16 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
(params2.startDate == null && params2.endDate == null)
|
(params2.startDate == null && params2.endDate == null)
|
||||||
? null
|
? null
|
||||||
: PickerDateRange(
|
: PickerDateRange(
|
||||||
params2.startDate == null ? null : DateTime.parse(
|
params2.startDate == null
|
||||||
params2.startDate!),
|
? null
|
||||||
params2.endDate == null ? null : DateTime.parse(
|
: DateTime.parse(params2.startDate!),
|
||||||
params2.endDate!),
|
params2.endDate == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(params2.endDate!),
|
||||||
),
|
),
|
||||||
onTimeFilter: (String? startTime, String? endTime) {
|
onTimeFilter: (String? startTime, String? endTime) {
|
||||||
if (startTime == null && endTime == null &&
|
if (startTime == null &&
|
||||||
|
endTime == null &&
|
||||||
tabController2.index == 2) {
|
tabController2.index == 2) {
|
||||||
tabController2.animateTo(0);
|
tabController2.animateTo(0);
|
||||||
params2.endDate =
|
params2.endDate =
|
||||||
|
|
@ -161,7 +184,7 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
params2.endDate = endTime;
|
params2.endDate = endTime;
|
||||||
params2.startDate = startTime;
|
params2.startDate = startTime;
|
||||||
}
|
}
|
||||||
page = 1;
|
params2.pageNumber = 1;
|
||||||
EasyLoading.show(status: 'loading...');
|
EasyLoading.show(status: 'loading...');
|
||||||
if (widget.tabIndex == 0) {
|
if (widget.tabIndex == 0) {
|
||||||
getUnAnnotateList();
|
getUnAnnotateList();
|
||||||
|
|
@ -179,18 +202,17 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
if (!Utils.isPad() &&
|
if (!Utils.isPad() &&
|
||||||
value.startDate!.year == value.endDate!.year) {
|
value.startDate!.year == value.endDate!.year) {
|
||||||
customTimeStr.value =
|
customTimeStr.value =
|
||||||
'${value.startDate.toString().substring(5, 10)}~${value
|
'${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
|
||||||
.endDate.toString().substring(5, 10)}';
|
|
||||||
} else {
|
} else {
|
||||||
customTimeStr.value =
|
customTimeStr.value =
|
||||||
'${customTimeStr.value}~${value.endDate?.toString()
|
'${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
|
||||||
.substring(0, 10)}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
Expanded(child: IndexedStack(
|
Expanded(
|
||||||
|
child: IndexedStack(
|
||||||
index: widget.tabIndex,
|
index: widget.tabIndex,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
$EasyRefresh(
|
$EasyRefresh(
|
||||||
|
|
@ -222,10 +244,10 @@ class _AnnotateListState extends State<AnnotateList>
|
||||||
@swidget
|
@swidget
|
||||||
Widget $easyRefresh({
|
Widget $easyRefresh({
|
||||||
required EasyRefreshController controller,
|
required EasyRefreshController controller,
|
||||||
required Future<
|
required Future<void> Function(EasyRefreshController controller, int tab)
|
||||||
void> Function(EasyRefreshController controller, int tab) onRefresh,
|
onRefresh,
|
||||||
required Future<
|
required Future<void> Function(EasyRefreshController controller, int tab)
|
||||||
void> Function(EasyRefreshController controller, int tab) onLoad,
|
onLoad,
|
||||||
required List<Items> data,
|
required List<Items> data,
|
||||||
required int tab,
|
required int tab,
|
||||||
required int type,
|
required int type,
|
||||||
|
|
@ -256,7 +278,8 @@ Widget $easyRefresh({
|
||||||
children: List.generate(data.length, (index) {
|
children: List.generate(data.length, (index) {
|
||||||
Items item = data[index];
|
Items item = data[index];
|
||||||
String subjectName = EnumUtils.formatSubject(item.subject);
|
String subjectName = EnumUtils.formatSubject(item.subject);
|
||||||
return $reviewedItem(jobTaskItem: item,
|
return $reviewedItem(
|
||||||
|
jobTaskItem: item,
|
||||||
type: type,
|
type: type,
|
||||||
subjectName: subjectName,
|
subjectName: subjectName,
|
||||||
collectFun: collectFun,
|
collectFun: collectFun,
|
||||||
|
|
@ -273,8 +296,7 @@ Widget $easyRefresh({
|
||||||
jobTaskItem: item,
|
jobTaskItem: item,
|
||||||
type: type,
|
type: type,
|
||||||
collectFun: collectFun,
|
collectFun: collectFun,
|
||||||
tabIndex: tab - 1
|
tabIndex: tab - 1);
|
||||||
);
|
|
||||||
},
|
},
|
||||||
itemCount: data.length,
|
itemCount: data.length,
|
||||||
),
|
),
|
||||||
|
|
@ -296,8 +318,7 @@ Widget $reviewedItem({
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(Routes.annotateClassPage,
|
Get.toNamed(Routes.annotateClassPage, arguments: {
|
||||||
arguments: {
|
|
||||||
'id': jobTaskItem.id,
|
'id': jobTaskItem.id,
|
||||||
'name': jobTaskItem.name,
|
'name': jobTaskItem.name,
|
||||||
'grade': jobTaskItem.grade,
|
'grade': jobTaskItem.grade,
|
||||||
|
|
@ -328,7 +349,6 @@ Widget $reviewedItem({
|
||||||
padding: padEdg,
|
padding: padEdg,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 32.w,
|
width: 32.w,
|
||||||
|
|
@ -336,8 +356,9 @@ Widget $reviewedItem({
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: EdgeInsets.only(left: 2.w),
|
padding: EdgeInsets.only(left: 2.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: type == 1 ? const Color(0xFF4CC793) : const Color
|
color: type == 1
|
||||||
.fromRGBO(255, 175, 56, 1),
|
? const Color(0xFF4CC793)
|
||||||
|
: const Color.fromRGBO(255, 175, 56, 1),
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(14.r),
|
topLeft: Radius.circular(14.r),
|
||||||
topRight: Radius.circular(3.r),
|
topRight: Radius.circular(3.r),
|
||||||
|
|
@ -346,11 +367,12 @@ Widget $reviewedItem({
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.only(top: 3.h, right: 4.w),
|
margin: EdgeInsets.only(top: 3.h, right: 4.w),
|
||||||
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white,
|
child: quickText(type == 1 ? '作业' : '考试',
|
||||||
size: 10.sp),
|
color: Colors.white, size: 10.sp),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: quickText(jobTaskItem.name, size: 14.sp,
|
child: quickText(jobTaskItem.name,
|
||||||
|
size: 14.sp,
|
||||||
color: const Color.fromRGBO(70, 70, 70, 1),
|
color: const Color.fromRGBO(70, 70, 70, 1),
|
||||||
maxLines: 2),
|
maxLines: 2),
|
||||||
),
|
),
|
||||||
|
|
@ -373,13 +395,15 @@ Widget $reviewedItem({
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
quickText(
|
quickText(
|
||||||
DateTime.parse(jobTaskItem.publishTime).toString().substring(
|
DateTime.parse(jobTaskItem.publishTime)
|
||||||
0, 10),
|
.toString()
|
||||||
|
.substring(0, 10),
|
||||||
color: const Color.fromRGBO(97, 97, 97, 1),
|
color: const Color.fromRGBO(97, 97, 97, 1),
|
||||||
size: 10.sp,
|
size: 10.sp,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1),
|
quickText(' / ',
|
||||||
|
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||||
size: 10.sp,
|
size: 10.sp,
|
||||||
fontWeight: FontWeight.w500),
|
fontWeight: FontWeight.w500),
|
||||||
quickText(
|
quickText(
|
||||||
|
|
@ -392,7 +416,8 @@ Widget $reviewedItem({
|
||||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||||
size: 10.sp,
|
size: 10.sp,
|
||||||
),
|
),
|
||||||
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1),
|
quickText(' / ',
|
||||||
|
color: const Color.fromRGBO(116, 145, 253, 1),
|
||||||
size: 10.sp,
|
size: 10.sp,
|
||||||
fontWeight: FontWeight.w500),
|
fontWeight: FontWeight.w500),
|
||||||
quickText(
|
quickText(
|
||||||
|
|
@ -414,7 +439,8 @@ Widget $reviewedItem({
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 6.h),
|
padding: EdgeInsets.symmetric(vertical: 6.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r),
|
borderRadius: BorderRadius.only(
|
||||||
|
bottomLeft: Radius.circular(6.r),
|
||||||
bottomRight: Radius.circular(6.r)),
|
bottomRight: Radius.circular(6.r)),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
boxShadow: const [
|
boxShadow: const [
|
||||||
|
|
@ -441,11 +467,12 @@ Widget $reviewedItem({
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(right: BorderSide(
|
border: Border(
|
||||||
|
right: BorderSide(
|
||||||
width: 1.r, color: const Color(0xFFDCDCDC))),
|
width: 1.r, color: const Color(0xFFDCDCDC))),
|
||||||
),
|
),
|
||||||
child: quickText(
|
child: quickText('收集订正',
|
||||||
'收集订正', color: const Color(0xFF4CC793), size: 11.sp),
|
color: const Color(0xFF4CC793), size: 11.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -454,8 +481,7 @@ Widget $reviewedItem({
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(Routes.jobReportPage,
|
Get.toNamed(Routes.jobReportPage, arguments: {
|
||||||
arguments: {
|
|
||||||
'title': jobTaskItem.name,
|
'title': jobTaskItem.name,
|
||||||
'homeworkId': jobTaskItem.id,
|
'homeworkId': jobTaskItem.id,
|
||||||
'grade': jobTaskItem.grade
|
'grade': jobTaskItem.grade
|
||||||
|
|
@ -463,8 +489,8 @@ Widget $reviewedItem({
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: quickText(
|
child: quickText('查看报告',
|
||||||
'查看报告', color: const Color.fromRGBO(118, 118, 118, 1),
|
color: const Color.fromRGBO(118, 118, 118, 1),
|
||||||
size: 11.sp),
|
size: 11.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
import app_settings
|
|
||||||
import auto_updater_macos
|
import auto_updater_macos
|
||||||
import connectivity_plus
|
import connectivity_plus
|
||||||
import device_info_plus
|
import device_info_plus
|
||||||
|
|
@ -15,7 +14,6 @@ import sqflite
|
||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
AppSettingsPlugin.register(with: registry.registrar(forPlugin: "AppSettingsPlugin"))
|
|
||||||
AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin"))
|
AutoUpdaterMacosPlugin.register(with: registry.registrar(forPlugin: "AutoUpdaterMacosPlugin"))
|
||||||
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
|
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
|
||||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue