diff --git a/marking_app/lib/pages/homework_correction/job_personal_detail.dart b/marking_app/lib/pages/homework_correction/job_personal_detail.dart index 99b67c7..b40b7cf 100644 --- a/marking_app/lib/pages/homework_correction/job_personal_detail.dart +++ b/marking_app/lib/pages/homework_correction/job_personal_detail.dart @@ -90,8 +90,6 @@ class _JobPersonalDetailState extends State with CommonMixin, } totalPages = res.data!.pagedList.totalPages; - print('dataLists=${dataList.length}'); - print('totalpages=$totalPages'); }); } diff --git a/marking_app/lib/pages/homework_correction/widget/student_zg_table.dart b/marking_app/lib/pages/homework_correction/widget/student_zg_table.dart index 39b9edb..8156fba 100644 --- a/marking_app/lib/pages/homework_correction/widget/student_zg_table.dart +++ b/marking_app/lib/pages/homework_correction/widget/student_zg_table.dart @@ -2,6 +2,7 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:marking_app/common/model/job/job_data_report.dart'; +import 'package:marking_app/utils/common_utils.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:photo_view/photo_view.dart'; @@ -80,7 +81,7 @@ class _StudentZgTableState extends State { DataCell(Center( child: Padding( padding: EdgeInsets.symmetric(horizontal: 5.r), - child: Text(item.useTime.toString(), + child: Text(CommonUtils.second2HMS(item.useTime!), style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), ), )), diff --git a/marking_app/lib/utils/common_utils.dart b/marking_app/lib/utils/common_utils.dart index e7bb2a8..ce6ab22 100644 --- a/marking_app/lib/utils/common_utils.dart +++ b/marking_app/lib/utils/common_utils.dart @@ -18,4 +18,31 @@ class CommonUtils { // 这里其实就是 digest.toString() return hex.encode(digest.bytes); } + + ///补零 + static String zeroFill(int i) { + return i >= 10 ? "$i" : "0$i"; + } + /// 秒转时分秒 + static String second2HMS(int sec, {bool isEasy = false}) { + String hms = "00:00:00"; + if (!isEasy) hms = "00时00分00秒"; + if (sec > 0) { + int h = sec ~/ 3600; + int m = (sec % 3600) ~/ 60; + int s = sec % 60; + /* hms = "${zeroFill(h)}:${zeroFill(m)}:${zeroFill(s)}"; + if (!isEasy) hms = "${zeroFill(h)}时${zeroFill(m)}分${zeroFill(s)}秒";*/ + if(h>0){ + hms = "$h时$m分$s秒"; + }else{ + if(m>0){ + hms = "$m分$s秒"; + }else{ + hms = "$s秒"; + } + } + } + return hms; + } }