mcy_new #1

Merged
wangyang merged 179 commits from mcy_new into master 2025-08-28 10:10:45 +08:00
3 changed files with 173 additions and 113 deletions
Showing only changes of commit 829ac8fbad - Show all commits

View File

@ -19,16 +19,20 @@ import 'package:making_school_asignment_app/common/job/work_student.dart';
part 'annotate_list.g.dart';
class AnnotateList extends StatefulWidget{
class AnnotateList extends StatefulWidget {
final int tabIndex;
final int assessType;
const AnnotateList({Key? key,required this.tabIndex,required this.assessType}) : super(key: key);
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{
class _AnnotateListState extends State<AnnotateList>
with RequestToolMixin, SingleTickerProviderStateMixin {
late RxString customTimeStr = '自定义'.obs;
int active = 1;
late RxList<Items> unAnnotateList = RxList();
@ -47,10 +51,12 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
WorkStudentParams params2 = WorkStudentParams(
assessType: 0,
pageSize: 10,
startDate: Utils.getWeekStartDate().toString().substring(0, 10),
endDate: Utils.getWeekEndDate().toString().substring(0, 10),
);
@override
void initState(){
void initState() {
super.initState();
params.assessType = widget.assessType;
params2.assessType = widget.assessType;
@ -95,19 +101,18 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
tab == 1 ? (markingDatas1 = lists) : (markingDatas2 = lists);
} catch (e) {}
toUpState(setState, () {}, mounted);*/
if(widget.tabIndex == 0){
if (widget.tabIndex == 0) {
getUnAnnotateList();
}else{
} else {
getAnnotateList();
}
}
Future<void> getCollect(item) async {
await getClient().getCollect(item.id);
if(widget.tabIndex == 0){
if (widget.tabIndex == 0) {
getUnAnnotateList();
}else{
} else {
getAnnotateList();
}
}
@ -128,45 +133,63 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
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)}';
Obx(() {
return JobConditionFilter(
customTimeStr: customTimeStr.value,
controller: tabController2,
hasAll: true,
jobType: 1,
customTime: tabController2.index != 2 ||
(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 == 2) {
tabController2.animateTo(0);
params2.endDate =
Utils.getWeekEndDate().toString().substring(0, 10);
params2.startDate =
Utils.getWeekStartDate().toString().substring(0, 10);
customTimeStr.value = '自定义';
} else {
customTimeStr.value = '${customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
params2.endDate = endTime;
params2.startDate = startTime;
}
}
}
}),
page = 1;
EasyLoading.show(status: 'loading...');
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>[
@ -199,8 +222,10 @@ class _AnnotateListState extends State<AnnotateList> with RequestToolMixin, Sing
@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 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,
@ -220,7 +245,8 @@ Widget $easyRefresh({
footer: TaurusFooter(),
child: completed && isPadFlag
? GridView(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
padding: EdgeInsets.only(
top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
@ -230,19 +256,24 @@ Widget $easyRefresh({
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,tabIndex:tab - 1);
return $reviewedItem(jobTaskItem: item,
type: type,
subjectName: subjectName,
collectFun: collectFun,
tabIndex: tab - 1);
}),
)
: ListView.builder(
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
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,
tabIndex:tab - 1
completed: completed,
jobTaskItem: item,
type: type,
collectFun: collectFun,
tabIndex: tab - 1
);
},
itemCount: data.length,
@ -266,10 +297,17 @@ Widget $reviewedItem({
return InkWell(
onTap: () {
Get.toNamed(Routes.annotateClassPage,
arguments: {'id': jobTaskItem.id, 'name': jobTaskItem.name, 'grade': jobTaskItem.grade,'subject':jobTaskItem.subject, 'completed': true,'tabIndex':tabIndex});
arguments: {
'id': jobTaskItem.id,
'name': jobTaskItem.name,
'grade': jobTaskItem.grade,
'subject': jobTaskItem.subject,
'completed': true,
'tabIndex': tabIndex
});
},
child: Container(
padding: EdgeInsets.only(right: 5.w),
padding: EdgeInsets.only(top: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Colors.white,
@ -286,39 +324,47 @@ Widget $reviewedItem({
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Row(
crossAxisAlignment: CrossAxisAlignment.start,
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(0xFFB2DA93) : const Color(0xFFEF8714),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6.r),
topRight: Radius.circular(0.r),
bottomLeft: Radius.circular(0.r),
bottomRight: Radius.circular(12.r),
children: [
Container(
width: 32.w,
height: 18.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration(
color: type == 1 ? const Color(0xFF4CC793) : 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(top: 3.h, right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white,
size: 10.sp),
),
margin: EdgeInsets.only(top:0.h,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: EdgeInsets.only(top: 3.r),
child: Text(
'已订正',
style: TextStyle(fontSize: 10.sp, color: const Color(0xFFF16262)),
Expanded(
child: quickText(jobTaskItem.name, size: 14.sp,
color: const Color.fromRGBO(70, 70, 70, 1),
maxLines: 2),
),
if (jobTaskItem.isFixed!)
Padding(
padding: EdgeInsets.only(top: 3.r),
child: Text(
'已订正',
style: TextStyle(
fontSize: 10.sp, color: const Color(0xFFF16262)),
),
),
),
],
],
),
),
Padding(
@ -327,26 +373,31 @@ Widget $reviewedItem({
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText(
DateTime.parse(jobTaskItem.publishTime).toString().substring(0, 10),
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(0xFF8C68FF), 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(0xFF8C68FF),
color: const Color.fromRGBO(76, 199, 147, 1),
size: 9.sp,
),
quickText(
'${jobTaskItem.classCount}',
color: const Color(0xFF8C68FF),
color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
),
quickText(' / ', color: const Color(0xFF8C68FF), size: 10.sp, fontWeight: FontWeight.w500),
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1),
size: 10.sp,
fontWeight: FontWeight.w500),
quickText(
'科目:$subjectName',
color: const Color(0xFF8C68FF),
color: const Color.fromRGBO(116, 145, 253, 1),
size: 9.sp,
),
],
@ -363,7 +414,8 @@ Widget $reviewedItem({
Container(
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r),
bottomRight: Radius.circular(6.r)),
color: Colors.white,
boxShadow: const [
BoxShadow(
@ -375,7 +427,7 @@ Widget $reviewedItem({
],
),
child: Row(children: [
/*if (!jobTaskItem.isFixed!)
if (!jobTaskItem.isFixed!)
Expanded(
flex: 1,
child: GestureDetector(
@ -389,23 +441,31 @@ Widget $reviewedItem({
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border(right: BorderSide(width: 1.r, color: const Color(0xFFDCDCDC))),
border: Border(right: BorderSide(
width: 1.r, color: const Color(0xFFDCDCDC))),
),
child: quickText('收集订正', color: const Color(0xFF8C68FF), size: 11.sp),
child: quickText(
'收集订正', color: const Color(0xFF4CC793), size: 11.sp),
),
),
),*/
),
Expanded(
flex: 1,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Get.toNamed(Routes.jobReportPage,
arguments: {'title': jobTaskItem.name, 'homeworkId': jobTaskItem.id, 'grade': jobTaskItem.grade});
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),
child: quickText(
'查看报告', color: const Color.fromRGBO(118, 118, 118, 1),
size: 11.sp),
),
),
),

View File

@ -70,14 +70,14 @@ class _JobConditionFilterState extends State<JobConditionFilter> {
customTimeStr: widget.customTimeStr,
hasAll: widget.hasAll,
onTap: (int val) async {
if (val == 0 && widget.hasAll == true) {
if (val == 3 && widget.hasAll == true) {
widget.onTimeFilter(null, null);
} else if ((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) {
} else if ((val == 0 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)) {
widget.onTimeFilter(
Utils.getWeekStartDate().toString().substring(0, 10),
Utils.getWeekEndDate().toString().substring(0, 10),
);
} else if ((val == 2 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) {
} else if ((val == 1 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)) {
widget.onTimeFilter(
getMonthStartDate().toString().substring(0, 10),
getMonthEndDate().toString().substring(0, 10),

View File

@ -13,10 +13,10 @@ class PersonalDetailTopBar extends StatefulWidget {
}
class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
@override
void initState(){
super.initState();
}
@override
void initState(){
super.initState();
}
@override
Widget build(BuildContext context) {
@ -33,26 +33,26 @@ class _PersonalDetailTopBarState extends State<PersonalDetailTopBar> {
labelStyle: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: const Color(0xFF8C68FF),
color: const Color(0xFF4CC793),
),
isScrollable: true,
labelColor:const Color(0xFF8C68FF),
labelColor: const Color(0xFF4CC793),
unselectedLabelColor: const Color(0xFF505E6E),
padding: EdgeInsets.symmetric(horizontal: 14.r),
// indicatorSize: TabBarIndicatorSize.label, //
onTap: widget.onTap,
indicator: UnderlineTabIndicator(
borderSide: BorderSide(
width: 2.r,
color:const Color(0xFF8C68FF)
width: 2.r,
color:const Color(0xFF4CC793)
),
),
tabs: <Widget>[
if(widget.hasAll == true)
const Tab(text: '全部'),
const Tab(text: '近一周'),
const Tab(text: '近一月'),
Tab(text: widget.customTimeStr),
if(widget.hasAll == true)
const Tab(text: '全部'),
],
),
);