Merge branch 'mcy_new' into new_main
This commit is contained in:
commit
9421c6e90e
|
|
@ -28,10 +28,6 @@ class UserStore extends GetxController with RequestToolMixin {
|
|||
//年级
|
||||
RxList<EnumSubject> gradeList = RxList();
|
||||
|
||||
RxInt readOver = 0.obs;
|
||||
|
||||
RxInt assessType = 0.obs;
|
||||
|
||||
UserStore init() {
|
||||
token = StorageService.to.read(AppStorageKey.token.value);
|
||||
xToken = StorageService.to.read(AppStorageKey.xToken.value);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,11 @@ class MyApp extends StatelessWidget {
|
|||
primaryTextTheme: TextTheme(
|
||||
bodyLarge: TextStyle(fontSize: 14.sp, color: Colors.black87),
|
||||
),
|
||||
useMaterial3: true,
|
||||
useMaterial3: false,
|
||||
colorScheme: const ColorScheme.light(
|
||||
// 修改亮色主题的主题颜色
|
||||
primary: Color.fromRGBO(46, 91, 255, 1),
|
||||
)
|
||||
),
|
||||
enableLog: true,
|
||||
logWriterCallback: (text, {bool isError = false}) {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin {
|
|||
state.homeworkId.value = Get.arguments['id'] ?? '';
|
||||
state.name.value = Get.arguments['name'] ?? '';
|
||||
state.grade = Get.arguments['grade'];
|
||||
state.subject = Get.arguments['subject'];
|
||||
state.completed.value = Get.arguments['completed'] ?? false;
|
||||
EasyLoading.show(status: 'loading...');
|
||||
getList();
|
||||
|
|
|
|||
|
|
@ -11,4 +11,5 @@ class AnnotateClassState {
|
|||
late RxString homeworkId = ''.obs;
|
||||
late RxBool completed = false.obs;
|
||||
late int grade;
|
||||
late int subject;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,76 +13,16 @@ import 'read_over_state.dart';
|
|||
class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin {
|
||||
final ReadOverState state = ReadOverState();
|
||||
late TabController tabController;
|
||||
late TabController tabController2;
|
||||
/* 待阅卷 */
|
||||
late final EasyRefreshController refreshController1;
|
||||
late final EasyRefreshController refreshController2;
|
||||
|
||||
WorkStudentParams params = WorkStudentParams(
|
||||
assessType: UserStore.to.assessType.value,
|
||||
pageSize: 10,
|
||||
);
|
||||
WorkStudentParams params2 = WorkStudentParams(
|
||||
assessType: UserStore.to.assessType.value,
|
||||
pageSize: 10,
|
||||
);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
refreshController1 = EasyRefreshController();
|
||||
refreshController2 = EasyRefreshController();
|
||||
state.tabIndex.value = 0;
|
||||
tabController = TabController(
|
||||
length: 2,
|
||||
vsync: this,
|
||||
);
|
||||
tabController2 = TabController(length: 4, vsync: this);
|
||||
EasyLoading.show(status: 'loading...');
|
||||
getList();
|
||||
}
|
||||
|
||||
//待批阅列表
|
||||
void getList() async {
|
||||
WorkStudent data = WorkStudent([], 0);
|
||||
if (state.tabIndex.value == 0) {
|
||||
params.pageNumber = state.page;
|
||||
data = await getClient().getUnAnnotateList(params);
|
||||
} else {
|
||||
params2.pageNumber = state.page;
|
||||
data = await getClient().getAnnotatedList(params2);
|
||||
}
|
||||
|
||||
state.workList.value = data.items;
|
||||
refreshController1.finishRefresh();
|
||||
refreshController2.finishRefresh();
|
||||
EasyLoading.dismiss();
|
||||
print('state.workList.length=${state.workList.length}');
|
||||
}
|
||||
|
||||
/// 刷新方法
|
||||
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
|
||||
/* params.page = RequestConfig.basePage.page;
|
||||
List<JobTaskItem> lists = await getData(controller, params, isReFresh: true);
|
||||
try {
|
||||
tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists);
|
||||
} catch (e) {}
|
||||
toUpState(setState, () {}, mounted);*/
|
||||
getList();
|
||||
}
|
||||
|
||||
void getCollect(item) async {
|
||||
await getClient().getCollect(item.id);
|
||||
getList();
|
||||
}
|
||||
|
||||
/// 加载方法
|
||||
Future<void> onMyLoad(EasyRefreshController controller, int tab) async {
|
||||
/*params.page++;
|
||||
List<JobTaskItem> lists = await getData(controller, params);
|
||||
if (lists.isNotEmpty) {
|
||||
tab == 1 ? markingDatas1.addAll(lists) : markingDatas2.addAll(lists);
|
||||
toUpState(setState, () {}, mounted);
|
||||
}*/
|
||||
}
|
||||
|
||||
/* Future<void> showStudents(
|
||||
|
|
@ -151,8 +91,8 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi
|
|||
void dispose() {
|
||||
super.dispose();
|
||||
tabController.dispose();
|
||||
tabController2.dispose();
|
||||
/* tabController2.dispose();
|
||||
refreshController1.dispose();
|
||||
refreshController2.dispose();
|
||||
refreshController2.dispose();*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/common/job/work_student.dart';
|
||||
|
||||
class ReadOverState {
|
||||
ReadOverState() {
|
||||
///Initialize variables
|
||||
}
|
||||
|
||||
int active = 1;
|
||||
late RxList<Items> workList = RxList();
|
||||
late RxInt tabIndex = 0.obs;
|
||||
|
||||
|
||||
late RxInt tabIndex = 2.obs;
|
||||
late bool completedToRefresh = true;
|
||||
late RxString customTimeStr = '自定义'.obs;
|
||||
late int page = 1;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ import 'package:making_school_asignment_app/common/utils/enum_untils.dart';
|
|||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/annotate_list.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/task_list_item.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart';
|
||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||
|
||||
import 'read_over_logic.dart';
|
||||
part 'read_over_view.g.dart';
|
||||
|
||||
class ReadOverPage extends StatefulWidget {
|
||||
const ReadOverPage({Key? key}) : super(key: key);
|
||||
|
|
@ -27,7 +27,9 @@ class ReadOverPage extends StatefulWidget {
|
|||
|
||||
class _ReadOverPageState extends State<ReadOverPage> {
|
||||
final logic = Get.find<ReadOverLogic>();
|
||||
final state = Get.find<ReadOverLogic>().state;
|
||||
final state = Get
|
||||
.find<ReadOverLogic>()
|
||||
.state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -48,7 +50,10 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
children: <Widget>[
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
margin: EdgeInsets.only(top: MediaQuery
|
||||
.of(context)
|
||||
.padding
|
||||
.top),
|
||||
padding: EdgeInsets.only(bottom: 9.h, top: 4.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
|
@ -93,7 +98,13 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
color: const Color.fromRGBO(104, 136, 253, 1),
|
||||
),
|
||||
// labelColor: const Color.fromRGBO(45, 56, 76, 1),
|
||||
indicator: const BoxDecoration(),
|
||||
indicator: const UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
width: 0, // 设置边界宽度为0,从而去除下划线
|
||||
color: Colors.transparent
|
||||
),
|
||||
|
||||
),
|
||||
onTap: (index) {
|
||||
state.tabIndex.value = index;
|
||||
if (index == 1 && state.completedToRefresh) {
|
||||
|
|
@ -101,7 +112,6 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
// _refreshController2.callRefresh();
|
||||
state.completedToRefresh = false;
|
||||
}
|
||||
logic.getList();
|
||||
},
|
||||
tabs: <Widget>[
|
||||
Tab(
|
||||
|
|
@ -112,14 +122,23 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
width: 140.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: state.tabIndex.value == 0 ? const Color.fromRGBO(255, 255, 255, 1) : null,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.r)),
|
||||
color: state.tabIndex.value == 0
|
||||
? const Color.fromRGBO(
|
||||
255, 255, 255, 1)
|
||||
: null,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(8.r)),
|
||||
),
|
||||
child: quickText(
|
||||
'待批阅',
|
||||
size: 14.sp,
|
||||
color: state.tabIndex.value == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
|
||||
fontWeight: state.tabIndex.value == 0 ? FontWeight.bold : null,
|
||||
color: state.tabIndex.value == 0 ? Theme
|
||||
.of(context)
|
||||
.primaryColor : const Color.fromRGBO(
|
||||
80, 94, 110, 1),
|
||||
fontWeight: state.tabIndex.value == 0
|
||||
? FontWeight.bold
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
|
@ -132,14 +151,23 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
width: 140.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: state.tabIndex.value == 1 ? const Color.fromRGBO(255, 255, 255, 1) : null,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.r)),
|
||||
color: state.tabIndex.value == 1
|
||||
? const Color.fromRGBO(
|
||||
255, 255, 255, 1)
|
||||
: null,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(8.r)),
|
||||
),
|
||||
child: quickText(
|
||||
'已批阅',
|
||||
size: 14.sp,
|
||||
color: state.tabIndex.value == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
|
||||
fontWeight: state.tabIndex.value == 1 ? FontWeight.bold : null,
|
||||
color: state.tabIndex.value == 1 ? Theme
|
||||
.of(context)
|
||||
.primaryColor : const Color.fromRGBO(
|
||||
80, 94, 110, 1),
|
||||
fontWeight: state.tabIndex.value == 1
|
||||
? FontWeight.bold
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
|
@ -152,76 +180,22 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.studentHistoryWorkPage, arguments: {'page': 'set'});
|
||||
Get.toNamed(Routes.studentHistoryWorkPage,
|
||||
arguments: {'page': 'set'});
|
||||
},
|
||||
child: Icon(const IconData(0xe63e, fontFamily: "AlibabaIcon"), color: const Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
|
||||
child: Icon(
|
||||
const IconData(0xe63e, fontFamily: "AlibabaIcon"),
|
||||
color: const Color.fromRGBO(44, 48, 63, 1),
|
||||
size: 24.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
return state.tabIndex.value == 1
|
||||
? JobConditionFilter(
|
||||
customTimeStr: state.customTimeStr.value,
|
||||
controller: logic.tabController2,
|
||||
hasAll: true,
|
||||
jobType: 1,
|
||||
customTime: logic.tabController2.index != 3 || (logic.params2.startDate == null && logic.params2.endDate == null)
|
||||
? null
|
||||
: PickerDateRange(
|
||||
logic.params2.startDate == null ? null : DateTime.parse(logic.params2.startDate!),
|
||||
logic.params2.endDate == null ? null : DateTime.parse(logic.params2.endDate!),
|
||||
),
|
||||
onTimeFilter: (String? startTime, String? endTime) {
|
||||
if (startTime == null && endTime == null && logic.tabController2.index == 3) {
|
||||
logic.tabController2.animateTo(0);
|
||||
}
|
||||
logic.params2.endDate = endTime;
|
||||
logic.params2.startDate = startTime;
|
||||
state.page = 1;
|
||||
logic.getList();
|
||||
// logic.refreshController2.callRefresh();
|
||||
},
|
||||
refreshTime: (value) {
|
||||
if (value != null && value.startDate != null) {
|
||||
state.customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? '';
|
||||
|
||||
if (value.endDate != null) {
|
||||
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) {
|
||||
state.customTimeStr.value =
|
||||
'${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
|
||||
} else {
|
||||
state.customTimeStr.value = '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
: Container();
|
||||
}),
|
||||
Expanded(child: Obx(() {
|
||||
return IndexedStack(
|
||||
index: state.tabIndex.value,
|
||||
children: <Widget>[
|
||||
$EasyRefresh(
|
||||
controller: logic.refreshController1,
|
||||
tab: 1,
|
||||
type: state.active,
|
||||
data: state.workList,
|
||||
onLoad: logic.onMyLoad,
|
||||
onRefresh: logic.onMyRefresh,
|
||||
logic: logic),
|
||||
$EasyRefresh(
|
||||
controller: logic.refreshController2,
|
||||
tab: 2,
|
||||
type: state.active,
|
||||
data: state.workList,
|
||||
onLoad: logic.onMyLoad,
|
||||
onRefresh: logic.onMyRefresh,
|
||||
logic: logic),
|
||||
],
|
||||
);
|
||||
})),
|
||||
return AnnotateList(tabIndex: state.tabIndex.value,assessType: 0,);
|
||||
}),),
|
||||
|
||||
],
|
||||
);
|
||||
},
|
||||
|
|
@ -236,229 +210,3 @@ class _ReadOverPageState extends State<ReadOverPage> {
|
|||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// 已阅卷
|
||||
/// OnRefreshCallback? onRefresh
|
||||
///
|
||||
@swidget
|
||||
Widget $easyRefresh({
|
||||
required EasyRefreshController controller,
|
||||
required Future<void> Function(EasyRefreshController controller, int tab) onRefresh,
|
||||
required Future<void> Function(EasyRefreshController controller, int tab) onLoad,
|
||||
required List<Items> data,
|
||||
required int tab,
|
||||
required int type,
|
||||
required ReadOverLogic logic,
|
||||
}) {
|
||||
bool completed = tab == 2; // 是否是待批阅
|
||||
bool isPadFlag = Utils.isPad();
|
||||
return Obx(() {
|
||||
return EasyRefresh(
|
||||
firstRefresh: false,
|
||||
taskIndependence: true,
|
||||
/*enableControlFinishLoad: true,
|
||||
enableControlFinishRefresh: true,*/
|
||||
emptyWidget: data.isEmpty ? const MyEmptyWidget() : null,
|
||||
controller: controller,
|
||||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
child: completed && isPadFlag
|
||||
? GridView(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2, //横轴三个子widget
|
||||
mainAxisSpacing: 10.h,
|
||||
crossAxisSpacing: 6.w,
|
||||
childAspectRatio: 1.81 //宽高比为1时,子widget
|
||||
),
|
||||
children: List.generate(data.length, (index) {
|
||||
Items item = data[index];
|
||||
String subjectName = EnumUtils.formatSubject(item.subject);
|
||||
return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName, logic: logic);
|
||||
}),
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||
itemBuilder: (context, index) {
|
||||
Items item = data[index];
|
||||
return TaskListItem(
|
||||
completed: completed,
|
||||
jobTaskItem: item,
|
||||
type: type,
|
||||
logic: logic,
|
||||
);
|
||||
},
|
||||
itemCount: data.length,
|
||||
),
|
||||
onRefresh: () => onRefresh(controller, tab),
|
||||
onLoad: () => onLoad(controller, tab),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@swidget
|
||||
Widget $reviewedItem({
|
||||
required Items jobTaskItem,
|
||||
required int type,
|
||||
required String subjectName,
|
||||
required ReadOverLogic logic,
|
||||
}) {
|
||||
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
|
||||
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.annotateClassPage,
|
||||
arguments: {'id': jobTaskItem.id, 'name': jobTaskItem.name, 'grade': jobTaskItem.grade, 'completed': true});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10.h),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6.r),
|
||||
color: Colors.white,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(210, 216, 241, 1),
|
||||
offset: Offset.zero, //阴影y轴偏移量
|
||||
blurRadius: 5.8, //阴影模糊程度
|
||||
spreadRadius: 0, //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 顶部任务名称
|
||||
Padding(
|
||||
padding: padEdg,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 32.w,
|
||||
height: 18.h,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(left: 2.w),
|
||||
decoration: BoxDecoration(
|
||||
color: type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(14.r),
|
||||
topRight: Radius.circular(3.r),
|
||||
bottomLeft: Radius.circular(4.r),
|
||||
bottomRight: Radius.circular(4.r),
|
||||
),
|
||||
),
|
||||
margin: EdgeInsets.only(right: 4.w),
|
||||
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp),
|
||||
),
|
||||
Expanded(
|
||||
child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
if (jobTaskItem.isFixed!)
|
||||
Padding(
|
||||
padding: padEdg,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'已订正',
|
||||
style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: padEdg,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
quickText(
|
||||
DateTime.parse(jobTaskItem.publishTime).toString().substring(0, 10),
|
||||
color: const Color.fromRGBO(97, 97, 97, 1),
|
||||
size: 10.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
||||
quickText(
|
||||
'参与班级:',
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
size: 9.sp,
|
||||
),
|
||||
quickText(
|
||||
'${jobTaskItem.classCount}',
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
size: 10.sp,
|
||||
),
|
||||
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
||||
quickText(
|
||||
'科目:$subjectName',
|
||||
color: const Color.fromRGBO(116, 145, 253, 1),
|
||||
size: 9.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
/*Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: FavoriteButton(
|
||||
jobTaskItem.id,
|
||||
jobTaskItem.title,
|
||||
margin: EdgeInsets.only(top: 4.h, bottom: 6.h),
|
||||
),
|
||||
),*/
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 6.h),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
|
||||
color: Colors.white,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.15),
|
||||
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
||||
blurRadius: 4, //阴影模糊程度
|
||||
spreadRadius: 0, //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Row(children: [
|
||||
if (!jobTaskItem.isFixed!)
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (!jobTaskItem.isFixed!) {
|
||||
EasyLoading.show(status: 'loading...');
|
||||
logic.getCollect(jobTaskItem);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(right: BorderSide(width: 1.r, color: const Color(0xFFDCDCDC))),
|
||||
),
|
||||
child: quickText('收集订正', color: const Color(0xFF4CC793), size: 11.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.jobReportPage,
|
||||
arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade});
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,420 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/common/job/work_student_params.dart';
|
||||
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/enum_untils.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/task_list_item.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart';
|
||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||
import 'package:making_school_asignment_app/common/job/work_student.dart';
|
||||
|
||||
part 'annotate_list.g.dart';
|
||||
|
||||
class AnnotateList extends StatefulWidget{
|
||||
final int tabIndex;
|
||||
final int assessType;
|
||||
const AnnotateList({Key? key,required this.tabIndex,required this.assessType}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AnnotateList> createState() => _AnnotateListState();
|
||||
}
|
||||
|
||||
class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, SingleTickerProviderStateMixin{
|
||||
late RxString customTimeStr = '自定义'.obs;
|
||||
int active = 1;
|
||||
late RxList<Items> unAnnotateList = RxList();
|
||||
late RxList<Items> annotateList = RxList();
|
||||
late int page = 1;
|
||||
|
||||
|
||||
late TabController tabController2;
|
||||
/* 待阅卷 */
|
||||
late final EasyRefreshController refreshController1;
|
||||
late final EasyRefreshController refreshController2;
|
||||
WorkStudentParams params = WorkStudentParams(
|
||||
assessType: 0,
|
||||
pageSize: 10,
|
||||
);
|
||||
WorkStudentParams params2 = WorkStudentParams(
|
||||
assessType: 0,
|
||||
pageSize: 10,
|
||||
);
|
||||
|
||||
@override
|
||||
void initState(){
|
||||
super.initState();
|
||||
params.assessType = widget.assessType;
|
||||
params2.assessType = widget.assessType;
|
||||
refreshController1 = EasyRefreshController();
|
||||
refreshController2 = EasyRefreshController();
|
||||
|
||||
tabController2 = TabController(length: 4, vsync: this);
|
||||
EasyLoading.show(status: 'loading...');
|
||||
getUnAnnotateList();
|
||||
getAnnotateList();
|
||||
|
||||
}
|
||||
|
||||
//待批阅列表
|
||||
void getUnAnnotateList() async {
|
||||
WorkStudent data = WorkStudent([], 0);
|
||||
params.pageNumber = page;
|
||||
data = await getClient().getUnAnnotateList(params);
|
||||
unAnnotateList.value = data.items;
|
||||
refreshController1.finishRefresh();
|
||||
refreshController2.finishRefresh();
|
||||
EasyLoading.dismiss();
|
||||
print('state.unAnnotateList.length=${unAnnotateList.length}');
|
||||
}
|
||||
//已批阅列表
|
||||
void getAnnotateList() async {
|
||||
WorkStudent data = WorkStudent([], 0);
|
||||
params2.pageNumber = page;
|
||||
data = await getClient().getAnnotatedList(params2);
|
||||
|
||||
annotateList.value = data.items;
|
||||
refreshController1.finishRefresh();
|
||||
refreshController2.finishRefresh();
|
||||
EasyLoading.dismiss();
|
||||
print('state.annotateList.length=${annotateList.length}');
|
||||
}
|
||||
/// 刷新方法
|
||||
Future<void> onMyRefresh(EasyRefreshController controller, int tab) async {
|
||||
/* params.page = RequestConfig.basePage.page;
|
||||
List<JobTaskItem> lists = await getData(controller, params, isReFresh: true);
|
||||
try {
|
||||
tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists);
|
||||
} catch (e) {}
|
||||
toUpState(setState, () {}, mounted);*/
|
||||
if(widget.tabIndex == 0){
|
||||
getUnAnnotateList();
|
||||
}else{
|
||||
getAnnotateList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Future<void> getCollect(item) async {
|
||||
await getClient().getCollect(item.id);
|
||||
if(widget.tabIndex == 0){
|
||||
getUnAnnotateList();
|
||||
}else{
|
||||
getAnnotateList();
|
||||
}
|
||||
}
|
||||
|
||||
/// 加载方法
|
||||
Future<void> onMyLoad(EasyRefreshController controller, int tab) async {
|
||||
/*params.page++;
|
||||
List<JobTaskItem> lists = await getData(controller, params);
|
||||
if (lists.isNotEmpty) {
|
||||
tab == 1 ? markingDatas1.addAll(lists) : markingDatas2.addAll(lists);
|
||||
toUpState(setState, () {}, mounted);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
if(widget.tabIndex == 1)
|
||||
JobConditionFilter(
|
||||
customTimeStr: customTimeStr.value,
|
||||
controller: tabController2,
|
||||
hasAll: true,
|
||||
jobType: 1,
|
||||
customTime: tabController2.index != 3 || (params2.startDate == null && params2.endDate == null)
|
||||
? null
|
||||
: PickerDateRange(
|
||||
params2.startDate == null ? null : DateTime.parse(params2.startDate!),
|
||||
params2.endDate == null ? null : DateTime.parse(params2.endDate!),
|
||||
),
|
||||
onTimeFilter: (String? startTime, String? endTime) {
|
||||
if (startTime == null && endTime == null && tabController2.index == 3) {
|
||||
tabController2.animateTo(0);
|
||||
}
|
||||
params2.endDate = endTime;
|
||||
params2.startDate = startTime;
|
||||
page = 1;
|
||||
if(widget.tabIndex == 0){
|
||||
getUnAnnotateList();
|
||||
}else{
|
||||
getAnnotateList();
|
||||
}
|
||||
// refreshController2.callRefresh();
|
||||
},
|
||||
refreshTime: (value) {
|
||||
if (value != null && value.startDate != null) {
|
||||
customTimeStr.value = value.startDate?.toString().substring(0, 10) ?? '';
|
||||
|
||||
if (value.endDate != null) {
|
||||
if (!Utils.isPad() && value.startDate!.year == value.endDate!.year) {
|
||||
customTimeStr.value =
|
||||
'${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
|
||||
} else {
|
||||
customTimeStr.value = '${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
Expanded(child: IndexedStack(
|
||||
index: widget.tabIndex,
|
||||
children: <Widget>[
|
||||
$EasyRefresh(
|
||||
controller: refreshController1,
|
||||
tab: 1,
|
||||
type: active,
|
||||
data: unAnnotateList,
|
||||
onLoad: onMyLoad,
|
||||
onRefresh: onMyRefresh,
|
||||
collectFun: getCollect),
|
||||
$EasyRefresh(
|
||||
controller: refreshController2,
|
||||
tab: 2,
|
||||
type: active,
|
||||
data: annotateList,
|
||||
onLoad: onMyLoad,
|
||||
onRefresh: onMyRefresh,
|
||||
collectFun: getCollect),
|
||||
],
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 已阅卷
|
||||
/// OnRefreshCallback? onRefresh
|
||||
///
|
||||
@swidget
|
||||
Widget $easyRefresh({
|
||||
required EasyRefreshController controller,
|
||||
required Future<void> Function(EasyRefreshController controller, int tab) onRefresh,
|
||||
required Future<void> Function(EasyRefreshController controller, int tab) onLoad,
|
||||
required List<Items> data,
|
||||
required int tab,
|
||||
required int type,
|
||||
required Future<void> Function(Items item) collectFun,
|
||||
}) {
|
||||
bool completed = tab == 2; // 是否是待批阅
|
||||
bool isPadFlag = Utils.isPad();
|
||||
return Obx(() {
|
||||
return EasyRefresh(
|
||||
firstRefresh: false,
|
||||
taskIndependence: true,
|
||||
/*enableControlFinishLoad: true,
|
||||
enableControlFinishRefresh: true,*/
|
||||
emptyWidget: data.isEmpty ? const MyEmptyWidget() : null,
|
||||
controller: controller,
|
||||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
child: completed && isPadFlag
|
||||
? GridView(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2, //横轴三个子widget
|
||||
mainAxisSpacing: 10.h,
|
||||
crossAxisSpacing: 6.w,
|
||||
childAspectRatio: 1.81 //宽高比为1时,子widget
|
||||
),
|
||||
children: List.generate(data.length, (index) {
|
||||
Items item = data[index];
|
||||
String subjectName = EnumUtils.formatSubject(item.subject);
|
||||
return $reviewedItem(jobTaskItem: item, type: type, subjectName: subjectName, collectFun: collectFun);
|
||||
}),
|
||||
)
|
||||
: ListView.builder(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||
itemBuilder: (context, index) {
|
||||
Items item = data[index];
|
||||
return TaskListItem(
|
||||
completed: completed,
|
||||
jobTaskItem: item,
|
||||
type: type,
|
||||
collectFun: collectFun,
|
||||
);
|
||||
},
|
||||
itemCount: data.length,
|
||||
),
|
||||
onRefresh: () => onRefresh(controller, tab),
|
||||
onLoad: () => onLoad(controller, tab),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@swidget
|
||||
Widget $reviewedItem({
|
||||
required Items jobTaskItem,
|
||||
required int type,
|
||||
required String subjectName,
|
||||
required Future<void> Function(Items item) collectFun,
|
||||
}) {
|
||||
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
|
||||
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.annotateClassPage,
|
||||
arguments: {'id': jobTaskItem.id, 'name': jobTaskItem.name, 'grade': jobTaskItem.grade,'subject':jobTaskItem.subject, 'completed': true});
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10.h),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6.r),
|
||||
color: Colors.white,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(210, 216, 241, 1),
|
||||
offset: Offset.zero, //阴影y轴偏移量
|
||||
blurRadius: 5.8, //阴影模糊程度
|
||||
spreadRadius: 0, //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 顶部任务名称
|
||||
Padding(
|
||||
padding: padEdg,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 32.w,
|
||||
height: 18.h,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(left: 2.w),
|
||||
decoration: BoxDecoration(
|
||||
color: type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(14.r),
|
||||
topRight: Radius.circular(3.r),
|
||||
bottomLeft: Radius.circular(4.r),
|
||||
bottomRight: Radius.circular(4.r),
|
||||
),
|
||||
),
|
||||
margin: EdgeInsets.only(right: 4.w),
|
||||
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp),
|
||||
),
|
||||
Expanded(
|
||||
child: quickText(jobTaskItem.name, size: 14.sp, color: const Color.fromRGBO(70, 70, 70, 1), maxLines: 2),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
if (jobTaskItem.isFixed!)
|
||||
Padding(
|
||||
padding: padEdg,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'已订正',
|
||||
style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: padEdg,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
quickText(
|
||||
DateTime.parse(jobTaskItem.publishTime).toString().substring(0, 10),
|
||||
color: const Color.fromRGBO(97, 97, 97, 1),
|
||||
size: 10.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
||||
quickText(
|
||||
'参与班级:',
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
size: 9.sp,
|
||||
),
|
||||
quickText(
|
||||
'${jobTaskItem.classCount}',
|
||||
color: const Color.fromRGBO(76, 199, 147, 1),
|
||||
size: 10.sp,
|
||||
),
|
||||
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
||||
quickText(
|
||||
'科目:$subjectName',
|
||||
color: const Color.fromRGBO(116, 145, 253, 1),
|
||||
size: 9.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
/*Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: FavoriteButton(
|
||||
jobTaskItem.id,
|
||||
jobTaskItem.title,
|
||||
margin: EdgeInsets.only(top: 4.h, bottom: 6.h),
|
||||
),
|
||||
),*/
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 6.h),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
|
||||
color: Colors.white,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(0, 0, 0, 0.15),
|
||||
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
||||
blurRadius: 4, //阴影模糊程度
|
||||
spreadRadius: 0, //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Row(children: [
|
||||
if (!jobTaskItem.isFixed!)
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (!jobTaskItem.isFixed!) {
|
||||
EasyLoading.show(status: 'loading...');
|
||||
collectFun(jobTaskItem);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(right: BorderSide(width: 1.r, color: const Color(0xFFDCDCDC))),
|
||||
),
|
||||
child: quickText('收集订正', color: const Color(0xFF4CC793), size: 11.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.jobReportPage,
|
||||
arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade});
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
child: quickText('查看报告', color: const Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -16,9 +16,9 @@ class TaskListItem extends StatefulWidget {
|
|||
final bool completed;
|
||||
final Items jobTaskItem;
|
||||
final int type;
|
||||
final ReadOverLogic logic;
|
||||
final Function(Items item) collectFun;
|
||||
|
||||
const TaskListItem({Key? key, required this.completed, required this.jobTaskItem, required this.type, required this.logic}) : super(key: key);
|
||||
const TaskListItem({Key? key, required this.completed, required this.jobTaskItem, required this.type, required this.collectFun}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<TaskListItem> createState() => _TaskListItemState();
|
||||
|
|
@ -31,7 +31,7 @@ class _TaskListItemState extends State<TaskListItem> {
|
|||
? InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.annotateClassPage,
|
||||
arguments: {'id': widget.jobTaskItem.id, 'name': widget.jobTaskItem.name, 'grade': widget.jobTaskItem.grade, 'completed': true});
|
||||
arguments: {'id': widget.jobTaskItem.id, 'name': widget.jobTaskItem.name, 'grade': widget.jobTaskItem.grade,'subject': widget.jobTaskItem.subject, 'completed': true});
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
|
|
@ -157,7 +157,7 @@ class _TaskListItemState extends State<TaskListItem> {
|
|||
: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.annotateClassPage,
|
||||
arguments: {'id': widget.jobTaskItem.id, 'name': widget.jobTaskItem.name, 'grade': widget.jobTaskItem.grade});
|
||||
arguments: {'id': widget.jobTaskItem.id, 'name': widget.jobTaskItem.name, 'grade': widget.jobTaskItem.grade,'subject':widget.jobTaskItem.subject,});
|
||||
},
|
||||
child: Stack(
|
||||
alignment: const FractionalOffset(0.95, 0),
|
||||
|
|
@ -247,7 +247,7 @@ class _TaskListItemState extends State<TaskListItem> {
|
|||
onTap: () {
|
||||
if (!widget.jobTaskItem.isFixed!) {
|
||||
EasyLoading.show(status: 'loading...');
|
||||
widget.logic.getCollect(widget.jobTaskItem);
|
||||
widget.collectFun(widget.jobTaskItem);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
|
|
|||
|
|
@ -41,6 +41,12 @@ class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
|
|||
padding: EdgeInsets.symmetric(horizontal: 14.r),
|
||||
// indicatorSize: TabBarIndicatorSize.label, // 设置指示器高度和标签一样高
|
||||
onTap: widget.onTap,
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(
|
||||
width: 2.r,
|
||||
color:const Color(0xFF7491FD)
|
||||
),
|
||||
),
|
||||
tabs: <Widget>[
|
||||
if(widget.hasAll == true)
|
||||
const Tab(text: '全部'),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class HomeLogic extends GetxController with RequestToolMixin, GetTickerProviderS
|
|||
assessType: 0,
|
||||
);
|
||||
WorkStudent data = await getClient().getUnAnnotateList(params);
|
||||
UserStore.to.readOver.value = data.items.length;
|
||||
state.readOver.value = data.items.length;
|
||||
state.workList.value = data.items;
|
||||
refreshController.finishRefresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class HomeState {
|
|||
}
|
||||
|
||||
late Rx<UserInfo?> userInfo;
|
||||
late RxInt readOver = UserStore.to.readOver;
|
||||
late RxInt readOver = 0.obs;
|
||||
late RxList<Items> workList = RxList();
|
||||
late int type = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,12 @@ class HomePage extends StatefulWidget {
|
|||
State<HomePage> createState() => _HomePageState();
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
|
||||
class _HomePageState extends State<HomePage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
final logic = Get.find<HomeLogic>();
|
||||
final state = Get.find<HomeLogic>().state;
|
||||
final state = Get
|
||||
.find<HomeLogic>()
|
||||
.state;
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
|
@ -44,188 +47,235 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
|||
statusBarIconBrightness: Brightness.dark,
|
||||
statusBarBrightness: Brightness.light,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 200.h,
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/job_home_top_bgm.png'),
|
||||
fit: BoxFit.fill, // 完全填充
|
||||
child: EasyRefresh(
|
||||
firstRefresh: false,
|
||||
taskIndependence: true,
|
||||
controller: logic.refreshController,
|
||||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
child: Column(
|
||||
children: [
|
||||
/* Container(
|
||||
height: 200.h,
|
||||
width: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage('assets/images/job_home_top_bgm.png'),
|
||||
fit: BoxFit.fill, // 完全填充
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
Obx(() {
|
||||
return $TermRow([
|
||||
EntranceModel(title: '作业批阅', image: 'assets/images/job_home_marking.png', navigationUrl: Routes.readOverPage),
|
||||
EntranceModel(
|
||||
title: '学生历史作业',
|
||||
image: 'assets/images/job_home_history.png',
|
||||
navigationUrl: Routes.studentHistoryWorkPage,
|
||||
page: 'history',
|
||||
),
|
||||
EntranceModel(title: '知识点点掌握', image: 'assets/images/job_home_knowledge.png', navigationUrl: Routes.knowledgePointsGraspPage)
|
||||
], state.readOver.value);
|
||||
}),
|
||||
spaceWidth,
|
||||
$TermRow([
|
||||
EntranceModel(title: '答题轨迹', image: 'assets/images/job_home_answer_record.png', navigationUrl: Routes.answerTrajectoryPage),
|
||||
EntranceModel(
|
||||
title: '优先批阅设定',
|
||||
image: 'assets/images/job_home_youxian.png',
|
||||
navigationUrl: Routes.studentHistoryWorkPage,
|
||||
page: 'set',
|
||||
)
|
||||
], 0),
|
||||
|
||||
/* $TermRow(
|
||||
context,
|
||||
[
|
||||
),*/
|
||||
SizedBox(height: 30.h),
|
||||
Obx(() {
|
||||
return $TermRow([
|
||||
EntranceModel(title: '作业批阅',
|
||||
image: 'assets/images/job_home_marking.png',
|
||||
navigationUrl: Routes.readOverPage),
|
||||
EntranceModel(
|
||||
title: '批阅设置',
|
||||
image: 'assets/images/job_home_marking_set.png',
|
||||
navigationUrl: '')
|
||||
],
|
||||
0),*/
|
||||
Expanded(child: Obx(() {
|
||||
return EasyRefresh(
|
||||
firstRefresh: false,
|
||||
taskIndependence: true,
|
||||
controller: logic.refreshController,
|
||||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||
itemBuilder: (context, index) {
|
||||
Items item = state.workList[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.annotateClassPage, arguments: {'id': item.id, 'name': item.name, 'grade': item.grade});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 30.h),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6.r),
|
||||
color: const Color.fromRGBO(255, 255, 255, 1),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(210, 216, 241, 1),
|
||||
offset: Offset.zero, //阴影y轴偏移量
|
||||
blurRadius: 5.8, //阴影模糊程度
|
||||
spreadRadius: 0, //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: Utils.isPad() ? 32.w : 38.w,
|
||||
height: 18.h,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w),
|
||||
decoration: BoxDecoration(
|
||||
color: state.type == 1 ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(14.r),
|
||||
topRight: Radius.circular(3.r),
|
||||
bottomLeft: Radius.circular(4.r),
|
||||
bottomRight: Radius.circular(4.r),
|
||||
title: '学生历史作业',
|
||||
image: 'assets/images/job_home_history.png',
|
||||
navigationUrl: Routes.studentHistoryWorkPage,
|
||||
page: 'history',
|
||||
),
|
||||
EntranceModel(title: '知识点点掌握',
|
||||
image: 'assets/images/job_home_knowledge.png',
|
||||
navigationUrl: Routes.knowledgePointsGraspPage)
|
||||
], state.readOver.value);
|
||||
}),
|
||||
spaceWidth,
|
||||
$TermRow([
|
||||
EntranceModel(title: '答题轨迹',
|
||||
image: 'assets/images/job_home_answer_record.png',
|
||||
navigationUrl: Routes.answerTrajectoryPage),
|
||||
EntranceModel(
|
||||
title: '优先批阅设定',
|
||||
image: 'assets/images/job_home_youxian.png',
|
||||
navigationUrl: Routes.studentHistoryWorkPage,
|
||||
page: 'set',
|
||||
)
|
||||
], 0),
|
||||
|
||||
/* $TermRow(
|
||||
context,
|
||||
[
|
||||
EntranceModel(
|
||||
title: '批阅设置',
|
||||
image: 'assets/images/job_home_marking_set.png',
|
||||
navigationUrl: '')
|
||||
],
|
||||
0),*/
|
||||
SizedBox(height: 16.h),
|
||||
Obx(() {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Column(
|
||||
children: List.generate(state.workList.length, (index) {
|
||||
Items item = state.workList[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.annotateClassPage, arguments: {
|
||||
'id': item.id,
|
||||
'name': item.name,
|
||||
'grade': item.grade,
|
||||
'subject':item.subject,
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 16.h),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 4.h),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 10.w),
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6.r),
|
||||
color: const Color.fromRGBO(255, 255, 255, 1),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color.fromRGBO(210, 216, 241, 1),
|
||||
offset: Offset.zero, //阴影y轴偏移量
|
||||
blurRadius: 5.8, //阴影模糊程度
|
||||
spreadRadius: 0, //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Container(
|
||||
width: Utils.isPad() ? 32.w : 38.w,
|
||||
height: 18.h,
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(
|
||||
left: Utils.isPad() ? 2.w : 3.w),
|
||||
decoration: BoxDecoration(
|
||||
color: state.type == 1
|
||||
? const Color.fromRGBO(
|
||||
104, 136, 253, 1)
|
||||
: const Color.fromRGBO(
|
||||
255, 175, 56, 1),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(14.r),
|
||||
topRight: Radius.circular(3.r),
|
||||
bottomLeft: Radius.circular(4.r),
|
||||
bottomRight: Radius.circular(4.r),
|
||||
),
|
||||
),
|
||||
margin: EdgeInsets.only(right: 4.w),
|
||||
child: quickText(
|
||||
state.type == 1 ? '作业' : '考试',
|
||||
color: Colors.white, size: 10.sp),
|
||||
),
|
||||
margin: EdgeInsets.only(right: 4.w),
|
||||
child: quickText(state.type == 1 ? '作业' : '考试', color: Colors.white, size: 10.sp),
|
||||
),
|
||||
Expanded(
|
||||
child: quickText(
|
||||
item.name,
|
||||
maxLines: 2,
|
||||
size: Utils.isPad() ? 14.sp : 16.sp,
|
||||
color: const Color.fromRGBO(70, 70, 70, 1),
|
||||
fontWeight: FontWeight.bold,
|
||||
Expanded(
|
||||
child: quickText(
|
||||
item.name,
|
||||
maxLines: 2,
|
||||
size: Utils.isPad() ? 14.sp : 16.sp,
|
||||
color: const Color.fromRGBO(
|
||||
70, 70, 70, 1),
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
quickText(
|
||||
EnumUtils.formatSubject(item.subject),
|
||||
color: const Color.fromRGBO(
|
||||
97, 97, 97, 1),
|
||||
size: 12.sp,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
quickText(
|
||||
EnumUtils.formatSubject(item.subject),
|
||||
color: const Color.fromRGBO(97, 97, 97, 1),
|
||||
size: 12.sp,
|
||||
),
|
||||
quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
|
||||
Container(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
quickText(' / ',
|
||||
color: const Color.fromRGBO(
|
||||
130, 130, 130, 1),
|
||||
size: 11.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment
|
||||
.end,
|
||||
children: [
|
||||
quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp),
|
||||
quickText('题量:',
|
||||
color: const Color.fromRGBO(
|
||||
130, 130, 130, 1),
|
||||
size: 11.sp),
|
||||
quickText(
|
||||
'10',
|
||||
color: const Color.fromRGBO(97, 97, 97, 1),
|
||||
color: const Color.fromRGBO(
|
||||
97, 97, 97, 1),
|
||||
size: 13.sp,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
quickText(' / ', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
|
||||
quickText(DateTime.parse(item.publishTime).toString().substring(0, 10),
|
||||
color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
),
|
||||
child: LinearPercentIndicator(
|
||||
padding: EdgeInsets.zero,
|
||||
animation: true,
|
||||
lineHeight: 8.h,
|
||||
animationDuration: 2500,
|
||||
percent: item.annotateRate == null ? 0 : item.annotateRate! / 100,
|
||||
progressColor: const Color(0xFF6888FD),
|
||||
backgroundColor: const Color(0xFFE8E8E8),
|
||||
barRadius: Radius.circular(10.r),
|
||||
quickText(' / ',
|
||||
color: const Color.fromRGBO(
|
||||
130, 130, 130, 1),
|
||||
size: 11.sp,
|
||||
fontWeight: FontWeight.w500),
|
||||
quickText(DateTime.parse(item.publishTime)
|
||||
.toString()
|
||||
.substring(0, 10),
|
||||
color: const Color.fromRGBO(
|
||||
97, 97, 97, 1), size: 12.sp),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(
|
||||
10.r),
|
||||
),
|
||||
child: LinearPercentIndicator(
|
||||
padding: EdgeInsets.zero,
|
||||
animation: true,
|
||||
lineHeight: 8.h,
|
||||
animationDuration: 2500,
|
||||
percent: item.annotateRate == null
|
||||
? 0
|
||||
: item.annotateRate! / 100,
|
||||
progressColor: const Color(
|
||||
0xFF6888FD),
|
||||
backgroundColor: const Color(
|
||||
0xFFE8E8E8),
|
||||
barRadius: Radius.circular(10.r),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.r,
|
||||
),
|
||||
quickText('${item.annotateRate!.toStringAsFixed(0)}%', size: 10.sp, color: const Color(0xFF464646)),
|
||||
],
|
||||
),
|
||||
// FavoriteButton(jobTaskItem.id, jobTaskItem.title),
|
||||
],
|
||||
SizedBox(
|
||||
width: 10.r,
|
||||
),
|
||||
quickText(
|
||||
'${item.annotateRate!.toStringAsFixed(
|
||||
0)}%', size: 10.sp,
|
||||
color: const Color(0xFF464646)),
|
||||
],
|
||||
),
|
||||
// FavoriteButton(jobTaskItem.id, jobTaskItem.title),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: state.workList.length,
|
||||
),
|
||||
);
|
||||
})),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -243,7 +293,8 @@ class EntranceModel extends Object {
|
|||
String navigationUrl;
|
||||
String? page;
|
||||
|
||||
EntranceModel({required this.title, required this.image, required this.navigationUrl, this.page});
|
||||
EntranceModel(
|
||||
{required this.title, required this.image, required this.navigationUrl, this.page});
|
||||
}
|
||||
|
||||
@swidget
|
||||
|
|
@ -252,7 +303,8 @@ Widget $termRow(BuildContext context, List<EntranceModel> items, int? data) {
|
|||
Widget childWidget;
|
||||
switch (leng) {
|
||||
case 1:
|
||||
childWidget = Row(children: [Expanded(child: $TermItem(items[0], data!))]);
|
||||
childWidget =
|
||||
Row(children: [Expanded(child: $TermItem(items[0], data!))]);
|
||||
break;
|
||||
case 2:
|
||||
childWidget = Row(children: [
|
||||
|
|
@ -286,11 +338,13 @@ Widget $termRow(BuildContext context, List<EntranceModel> items, int? data) {
|
|||
childWidget = Container();
|
||||
}
|
||||
|
||||
return Container(padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget);
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget);
|
||||
}
|
||||
|
||||
@swidget
|
||||
Widget $termItem(BuildContext context, EntranceModel e, int data, {double? theHeight}) {
|
||||
Widget $termItem(BuildContext context, EntranceModel e, int data,
|
||||
{double? theHeight}) {
|
||||
bool isJob = e.title == '作业批阅';
|
||||
|
||||
return Material(
|
||||
|
|
@ -319,10 +373,13 @@ Widget $termItem(BuildContext context, EntranceModel e, int data, {double? theHe
|
|||
badgeStyle: badges.BadgeStyle(
|
||||
badgeColor: const Color.fromRGBO(255, 105, 105, 1),
|
||||
shape: badges.BadgeShape.square,
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10.r), topRight: Radius.circular(8.5.r), bottomRight: Radius.circular(8.5.r)),
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(10.r),
|
||||
topRight: Radius.circular(8.5.r),
|
||||
bottomRight: Radius.circular(8.5.r)),
|
||||
// borderSide: BorderSide(color: Colors.white, width: 2),
|
||||
elevation: 1,
|
||||
padding: EdgeInsets.symmetric(horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: Utils.isPad() ? 11.w : 16.w, vertical: 2.h),
|
||||
),
|
||||
position: badges.BadgePosition.topEnd(top: 10.r, end: 10.r),
|
||||
child: Container(
|
||||
|
|
@ -343,21 +400,27 @@ Widget $termItem(BuildContext context, EntranceModel e, int data, {double? theHe
|
|||
alignment: Alignment.center,
|
||||
child: isJob
|
||||
? Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
|
||||
SizedBox(height: 6.r),
|
||||
quickText(e.title, size: 12.sp, color: const Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500),
|
||||
],
|
||||
)
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
|
||||
SizedBox(height: 6.r),
|
||||
quickText(e.title, size: 12.sp,
|
||||
color: const Color.fromRGBO(79, 79, 79, 1),
|
||||
fontWeight: FontWeight.w500),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
|
||||
SizedBox(width: 6.r),
|
||||
quickText(e.title, size: 12.sp, color: const Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500),
|
||||
],
|
||||
),
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
|
||||
SizedBox(width: 6.r),
|
||||
quickText(e.title, size: 12.sp,
|
||||
color: const Color.fromRGBO(79, 79, 79, 1),
|
||||
fontWeight: FontWeight.w500),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,26 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
|
||||
|
||||
import 'work_state.dart';
|
||||
|
||||
class WorkLogic extends GetxController {
|
||||
class WorkLogic extends GetxController with RequestToolMixin, GetTickerProviderStateMixin {
|
||||
final WorkState state = WorkState();
|
||||
late TabController tabController;
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
state.tabIndex.value = 0;
|
||||
tabController = TabController(
|
||||
length: 2,
|
||||
vsync: this,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
tabController.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/common/job/work_student.dart';
|
||||
|
||||
class WorkState {
|
||||
WorkState() {
|
||||
///Initialize variables
|
||||
}
|
||||
int active = 1;
|
||||
late RxList<Items> workList = RxList();
|
||||
late RxInt tabIndex = 0.obs;
|
||||
late bool completedToRefresh = true;
|
||||
late RxString customTimeStr = '自定义'.obs;
|
||||
late int page = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/read_over_logic.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/read_over_view.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/read_over/widget/annotate_list.dart';
|
||||
import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart';
|
||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||
|
||||
import 'work_logic.dart';
|
||||
|
||||
|
|
@ -20,11 +29,131 @@ class _WorkPageState extends State<WorkPage> with AutomaticKeepAliveClientMixin
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
alignment: Alignment.center,
|
||||
child: quickText('考试页面'),
|
||||
return AnnotatedRegion(
|
||||
value: const SystemUiOverlayStyle(
|
||||
systemNavigationBarColor: Color(0xFF000000),
|
||||
systemNavigationBarDividerColor: null,
|
||||
statusBarColor: Colors.white,
|
||||
systemNavigationBarIconBrightness: Brightness.light,
|
||||
statusBarIconBrightness: Brightness.dark,
|
||||
statusBarBrightness: Brightness.light,
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color.fromRGBO(244, 244, 244, 1),
|
||||
body: OrientationBuilder(
|
||||
builder: (BuildContext context, Orientation orientation) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||
padding: EdgeInsets.only(bottom: 9.h, top: 4.h),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.only(left: 10.w),
|
||||
)),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 2.h),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color.fromRGBO(243, 243, 243, 1),
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
),
|
||||
child: TabBar(
|
||||
padding: EdgeInsets.zero,
|
||||
indicatorPadding: EdgeInsets.zero,
|
||||
indicatorWeight: 0,
|
||||
labelPadding: EdgeInsets.symmetric(horizontal: 2.w),
|
||||
controller: logic.tabController,
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: const Color.fromRGBO(69, 83, 100, 1),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 14.sp,
|
||||
color: const Color.fromRGBO(104, 136, 253, 1),
|
||||
),
|
||||
// labelColor: const Color.fromRGBO(45, 56, 76, 1),
|
||||
indicator: const BoxDecoration(),
|
||||
onTap: (index) {
|
||||
state.tabIndex.value = index;
|
||||
if (index == 1 && state.completedToRefresh) {
|
||||
// 已阅卷
|
||||
// _refreshController2.callRefresh();
|
||||
state.completedToRefresh = false;
|
||||
}
|
||||
},
|
||||
tabs: <Widget>[
|
||||
Tab(
|
||||
iconMargin: EdgeInsets.zero,
|
||||
height: 34.h,
|
||||
child: Obx(() {
|
||||
return Container(
|
||||
width: 140.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: state.tabIndex.value == 0 ? const Color.fromRGBO(255, 255, 255, 1) : null,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.r)),
|
||||
),
|
||||
child: quickText(
|
||||
'待批阅',
|
||||
size: 14.sp,
|
||||
color: state.tabIndex.value == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
|
||||
fontWeight: state.tabIndex.value == 0 ? FontWeight.bold : null,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
Tab(
|
||||
iconMargin: EdgeInsets.zero,
|
||||
height: 34.h,
|
||||
child: Obx(() {
|
||||
return Container(
|
||||
width: 140.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: state.tabIndex.value == 1 ? const Color.fromRGBO(255, 255, 255, 1) : null,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.r)),
|
||||
),
|
||||
child: quickText(
|
||||
'已批阅',
|
||||
size: 14.sp,
|
||||
color: state.tabIndex.value == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
|
||||
fontWeight: state.tabIndex.value == 1 ? FontWeight.bold : null,
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(Routes.studentHistoryWorkPage, arguments: {'page': 'set'});
|
||||
},
|
||||
child: Icon(const IconData(0xe63e, fontFamily: "AlibabaIcon"), color: const Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(child: Obx(() {
|
||||
return AnnotateList(tabIndex: state.tabIndex.value,assessType: 1,);
|
||||
}),),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue