Compare commits
No commits in common. "3666bea6bde2f01834eb57f98225e2892be813e3" and "23bd9501ffbf5e141fb44cdf6e96ccfe95be24d9" have entirely different histories.
3666bea6bd
...
23bd9501ff
|
|
@ -21,7 +21,12 @@ class TrajectoryView extends StatefulHookConsumerWidget {
|
||||||
final double boxHeight;
|
final double boxHeight;
|
||||||
final String questionNumber;
|
final String questionNumber;
|
||||||
final JobNoteTakingTrajectory trajectory;
|
final JobNoteTakingTrajectory trajectory;
|
||||||
const TrajectoryView({required this.trajectory, required this.questionNumber, required this.boxHeight, required this.boxWidth, super.key});
|
const TrajectoryView(
|
||||||
|
{required this.trajectory,
|
||||||
|
required this.questionNumber,
|
||||||
|
required this.boxHeight,
|
||||||
|
required this.boxWidth,
|
||||||
|
super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
TrajectoryViewState createState() => TrajectoryViewState();
|
TrajectoryViewState createState() => TrajectoryViewState();
|
||||||
|
|
@ -147,11 +152,15 @@ class TrajectoryViewState extends ConsumerState<TrajectoryView> {
|
||||||
|
|
||||||
/// 试题范围框左上角
|
/// 试题范围框左上角
|
||||||
trajectorys
|
trajectorys
|
||||||
..add(GestureRecording(data: Offset(2.w, trajectory.pictureQuestionTop), scopeBox: true, annotationSwitch: false, eraser: false))
|
..add(GestureRecording(
|
||||||
|
data: Offset(2.w, trajectory.pictureQuestionTop), scopeBox: true, annotationSwitch: false, eraser: false))
|
||||||
|
|
||||||
/// 右上角
|
/// 右上角
|
||||||
..add(GestureRecording(
|
..add(GestureRecording(
|
||||||
data: Offset(imagInfoModel!.scaleWidth! - 4.w, trajectory.pictureQuestionTop), scopeBox: true, annotationSwitch: false, eraser: false))
|
data: Offset(imagInfoModel!.scaleWidth! - 4.w, trajectory.pictureQuestionTop),
|
||||||
|
scopeBox: true,
|
||||||
|
annotationSwitch: false,
|
||||||
|
eraser: false))
|
||||||
|
|
||||||
/// 左下角
|
/// 左下角
|
||||||
..add(GestureRecording(
|
..add(GestureRecording(
|
||||||
|
|
@ -162,7 +171,8 @@ class TrajectoryViewState extends ConsumerState<TrajectoryView> {
|
||||||
|
|
||||||
/// 右下角
|
/// 右下角
|
||||||
..add(GestureRecording(
|
..add(GestureRecording(
|
||||||
data: Offset(imagInfoModel!.scaleWidth! - 4.w, trajectory.pictureQuestionTop + trajectory.pictureQuestionHeight),
|
data: Offset(
|
||||||
|
imagInfoModel!.scaleWidth! - 4.w, trajectory.pictureQuestionTop + trajectory.pictureQuestionHeight),
|
||||||
scopeBox: true,
|
scopeBox: true,
|
||||||
annotationSwitch: false,
|
annotationSwitch: false,
|
||||||
eraser: false));
|
eraser: false));
|
||||||
|
|
@ -171,19 +181,12 @@ class TrajectoryViewState extends ConsumerState<TrajectoryView> {
|
||||||
ref.read(jobDrawingTrajectoryProvider.notifier).setVal(trajectorys);
|
ref.read(jobDrawingTrajectoryProvider.notifier).setVal(trajectorys);
|
||||||
});
|
});
|
||||||
if (lattices.isNotEmpty) {
|
if (lattices.isNotEmpty) {
|
||||||
// Map<int, List<Lattices>> map = new Map.fromIterable(lattices,
|
Map<int, List<Lattices>> map = new Map.fromIterable(lattices,
|
||||||
// key: (key) => key.stroke,
|
key: (key) => key.stroke,
|
||||||
// value: (value) {
|
value: (value) {
|
||||||
// return lattices.where((item) => item.stroke == value.stroke).toList()
|
return lattices.where((item) => item.stroke == value.stroke).toList()
|
||||||
// ..sort((a, b) => a.time.compareTo(b.time));
|
..sort((a, b) => a.time.compareTo(b.time));
|
||||||
// });
|
});
|
||||||
|
|
||||||
var map = Map<int, List<Lattices>>();
|
|
||||||
for (var i = 0; i < lattices.length; i++) {
|
|
||||||
Lattices item = lattices[i];
|
|
||||||
if (!map.containsKey(item.stroke)) map[item.stroke] = [];
|
|
||||||
map[item.stroke]!.add(item); // 添加笔画数据
|
|
||||||
}
|
|
||||||
|
|
||||||
List<int> keys = map.keys.toList();
|
List<int> keys = map.keys.toList();
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
|
|
@ -196,7 +199,8 @@ class TrajectoryViewState extends ConsumerState<TrajectoryView> {
|
||||||
double theX = e.x * imagInfoModel!.scale!;
|
double theX = e.x * imagInfoModel!.scale!;
|
||||||
double theY = e.y * imagInfoModel!.scale! + spacingHeight;
|
double theY = e.y * imagInfoModel!.scale! + spacingHeight;
|
||||||
|
|
||||||
return GestureRecording(eraser: false, data: Offset(theX, theY), usageTime: e.time.toInt(), annotationSwitch: false);
|
return GestureRecording(
|
||||||
|
eraser: false, data: Offset(theX, theY), usageTime: e.time.toInt(), annotationSwitch: false);
|
||||||
}).toList()
|
}).toList()
|
||||||
..add(GestureRecording(eraser: false, annotationSwitch: false));
|
..add(GestureRecording(eraser: false, annotationSwitch: false));
|
||||||
// 原始轨迹展示
|
// 原始轨迹展示
|
||||||
|
|
@ -226,7 +230,8 @@ class TrajectoryViewState extends ConsumerState<TrajectoryView> {
|
||||||
if (duration2 == null && nextStrokesData != null) {
|
if (duration2 == null && nextStrokesData != null) {
|
||||||
// 此时最后一个笔画完成了 停止时间是在下一个笔画开始时间之差
|
// 此时最后一个笔画完成了 停止时间是在下一个笔画开始时间之差
|
||||||
Lattices minLattices = nextStrokesData.reduce((e1, e2) => e1.time < e2.time ? e1 : e2);
|
Lattices minLattices = nextStrokesData.reduce((e1, e2) => e1.time < e2.time ? e1 : e2);
|
||||||
differenceInMilliseconds = (Duration(milliseconds: minLattices.time.toInt()) - duration1).inMilliseconds;
|
differenceInMilliseconds =
|
||||||
|
(Duration(milliseconds: minLattices.time.toInt()) - duration1).inMilliseconds;
|
||||||
await Future.delayed(Duration(milliseconds: differenceInMilliseconds)); // 一个笔画完成进行下一个笔画的等待时间
|
await Future.delayed(Duration(milliseconds: differenceInMilliseconds)); // 一个笔画完成进行下一个笔画的等待时间
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -366,9 +366,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
||||||
Expanded(flex: 1, child: SizedBox()),
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 4,
|
flex: 4,
|
||||||
child: Stack(
|
child: Container(
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(left: 10.w),
|
padding: EdgeInsets.only(left: 10.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color.fromRGBO(244, 244, 244, 1),
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
|
@ -400,22 +398,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
|
||||||
left: 2.w,
|
|
||||||
child: Stack(
|
|
||||||
alignment: const FractionalOffset(0.52, 0.24),
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
const IconData(0xe63d, fontFamily: "AlibabaIcon"),
|
|
||||||
size: 12.sp,
|
|
||||||
color: _useSwitchStudentAndType.isFirst.value ? Color.fromRGBO(76, 199, 147, 1) : Color.fromRGBO(164, 164, 164, 1),
|
|
||||||
),
|
|
||||||
quickText('优先', size: 4.sp, color: Colors.white),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(flex: 1, child: SizedBox()),
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
@ -476,6 +458,17 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Stack(
|
||||||
|
alignment: const FractionalOffset(0.52, 0.24),
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
const IconData(0xe63d, fontFamily: "AlibabaIcon"),
|
||||||
|
size: 12.sp,
|
||||||
|
color: _useSwitchStudentAndType.isFirst.value ? Color.fromRGBO(76, 199, 147, 1) : Color.fromRGBO(164, 164, 164, 1),
|
||||||
|
),
|
||||||
|
quickText('优先', size: 4.sp, color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:marking_app/components/ReturnToHomepage.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/widget/student_kg_table.dart';
|
import 'package:marking_app/pages/homework_correction/widget/student_kg_table.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/widget/student_zg_table.dart';
|
import 'package:marking_app/pages/homework_correction/widget/student_zg_table.dart';
|
||||||
import 'package:marking_app/routes/RouterManager.dart';
|
import 'package:marking_app/routes/RouterManager.dart';
|
||||||
|
import 'package:marking_app/utils/common_utils.dart';
|
||||||
import 'package:marking_app/utils/request/rest_client.dart';
|
import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
import 'package:marking_app/utils/toast_utils.dart';
|
import 'package:marking_app/utils/toast_utils.dart';
|
||||||
|
|
||||||
|
|
@ -178,11 +179,6 @@ class _QuickCheckPersonalState extends ConsumerState<QuickCheckPersonal> with Co
|
||||||
child: StudentKgTable(
|
child: StudentKgTable(
|
||||||
headList: ['题号', '学生答案', '标准答案'],
|
headList: ['题号', '学生答案', '标准答案'],
|
||||||
bodyList: studentInfo!.kgDetails,
|
bodyList: studentInfo!.kgDetails,
|
||||||
questionNumCall: (no) {
|
|
||||||
showAnswerHandwriting(context, jobId: widget.jobId, studentId: widget.studentId, questionNo: int.parse(no)).then((value) {
|
|
||||||
ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal([]);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
@ -226,11 +222,6 @@ class _QuickCheckPersonalState extends ConsumerState<QuickCheckPersonal> with Co
|
||||||
child: StudentZgTable(
|
child: StudentZgTable(
|
||||||
headList: ['题号', '用时', '学生答案', '批注结果', '批注'],
|
headList: ['题号', '用时', '学生答案', '批注结果', '批注'],
|
||||||
bodyList: studentInfo!.zgDetails,
|
bodyList: studentInfo!.zgDetails,
|
||||||
questionNumCall: (no) {
|
|
||||||
showAnswerHandwriting(context, jobId: widget.jobId, studentId: widget.studentId, questionNo: int.parse(no)).then((value) {
|
|
||||||
ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal([]);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
|
|
@ -49,14 +48,13 @@ class AnswerHandwriting extends Dialog {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> showAnswerHandwriting(BuildContext context, {required int jobId, required int studentId, int? pageNum, int? questionNo}) async {
|
Future<void> showAnswerHandwriting(BuildContext context, {required int jobId, required int studentId, int? pageNum}) async {
|
||||||
return showDialog(
|
return showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AnswerHandwriting(
|
builder: (BuildContext context) => AnswerHandwriting(
|
||||||
jobId: jobId,
|
jobId: jobId,
|
||||||
studentId: studentId,
|
studentId: studentId,
|
||||||
pageNum: pageNum,
|
pageNum: pageNum,
|
||||||
questionNo: questionNo,
|
|
||||||
closeCall: () => Navigator.of(context).pop(),
|
closeCall: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -96,10 +94,7 @@ class AnswerHandwritingMainBox extends HookWidget {
|
||||||
});
|
});
|
||||||
|
|
||||||
useValueChanged<int?, void>(_useStateModel.pageNum.value, (oldVal, __) {
|
useValueChanged<int?, void>(_useStateModel.pageNum.value, (oldVal, __) {
|
||||||
if (oldVal != null && oldVal != _useStateModel.pageNum.value) {
|
if (oldVal != null && oldVal != _useStateModel.pageNum.value) _useStateModel.getData().catchError((e) => closeCall());
|
||||||
_useStateModel.questionNo = null;
|
|
||||||
_useStateModel.getData().catchError((e) => closeCall());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
|
|
@ -111,6 +106,7 @@ class AnswerHandwritingMainBox extends HookWidget {
|
||||||
HandwritingInfo? _dataDetail = _useStateModel.handwritingDetail.value;
|
HandwritingInfo? _dataDetail = _useStateModel.handwritingDetail.value;
|
||||||
|
|
||||||
if (_data == null || _dataDetail == null) return Container();
|
if (_data == null || _dataDetail == null) return Container();
|
||||||
|
print('数据长度:${_data.lattices.length}');
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|
@ -138,7 +134,7 @@ class AnswerHandwritingMainBox extends HookWidget {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
$BottomPlaybar(_dataDetail.timeConsuming, _dataDetail.pauseCount, _dataDetail.pauseInterval),
|
$BottomPlaybar(_dataDetail.timeConsuming, _dataDetail.pauseCount),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +143,7 @@ class AnswerHandwritingMainBox extends HookWidget {
|
||||||
class UseMainBoxState with CommonMixin {
|
class UseMainBoxState with CommonMixin {
|
||||||
final int jobId;
|
final int jobId;
|
||||||
final int studentId;
|
final int studentId;
|
||||||
int? questionNo;
|
final int? questionNo;
|
||||||
final ValueNotifier<int?> pageNum;
|
final ValueNotifier<int?> pageNum;
|
||||||
final ValueNotifier<int> pageCount;
|
final ValueNotifier<int> pageCount;
|
||||||
final ValueNotifier<JobHandwriting?> handwritingData;
|
final ValueNotifier<JobHandwriting?> handwritingData;
|
||||||
|
|
@ -227,6 +223,7 @@ class UseMainBoxState with CommonMixin {
|
||||||
lattices[item.stroke]!.add(item); // 添加笔画数据
|
lattices[item.stroke]!.add(item); // 添加笔画数据
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print('分组时间:${DateTime.now().millisecondsSinceEpoch}');
|
||||||
List<int> latticeKeys = lattices.keys.toList();
|
List<int> latticeKeys = lattices.keys.toList();
|
||||||
int timeConsuming = 0;
|
int timeConsuming = 0;
|
||||||
if (latticeKeys.isNotEmpty) {
|
if (latticeKeys.isNotEmpty) {
|
||||||
|
|
@ -245,8 +242,8 @@ class UseMainBoxState with CommonMixin {
|
||||||
}
|
}
|
||||||
timeConsuming = lastTime - firstTime;
|
timeConsuming = lastTime - firstTime;
|
||||||
}
|
}
|
||||||
|
print('获取数据总时间:${DateTime.now().millisecondsSinceEpoch}');
|
||||||
var pauseCount = 0; // 停顿次数
|
var pauseCount = 0; // 停顿次数
|
||||||
List<PauseIntervalTime> pauseInterval = [];
|
|
||||||
for (var i = 0; i < latticeKeys.length; i++) {
|
for (var i = 0; i < latticeKeys.length; i++) {
|
||||||
var currentLattices = lattices[latticeKeys[i]]!; // 当前循环笔画集合
|
var currentLattices = lattices[latticeKeys[i]]!; // 当前循环笔画集合
|
||||||
var prevLattices = i == 0 ? null : lattices[latticeKeys[i - 1]]!; // 下一个笔画集合
|
var prevLattices = i == 0 ? null : lattices[latticeKeys[i - 1]]!; // 下一个笔画集合
|
||||||
|
|
@ -257,38 +254,35 @@ class UseMainBoxState with CommonMixin {
|
||||||
if (j != 0) {
|
if (j != 0) {
|
||||||
var prevItem = currentLattices[j - 1];
|
var prevItem = currentLattices[j - 1];
|
||||||
var adjacentSpacingTime = lattice.time - prevItem.time;
|
var adjacentSpacingTime = lattice.time - prevItem.time;
|
||||||
intervalTime = adjacentSpacingTime + prevItem.intervalTime;
|
|
||||||
if (adjacentSpacingTime > 5000) {
|
if (adjacentSpacingTime > 5000) {
|
||||||
// 大于5秒算一次停顿
|
// 大于5秒算一次停顿
|
||||||
pauseCount++;
|
pauseCount++;
|
||||||
pauseInterval.add(PauseIntervalTime(startTime: prevItem.intervalTime, endTime: intervalTime));
|
|
||||||
}
|
}
|
||||||
|
intervalTime = adjacentSpacingTime + prevItem.intervalTime;
|
||||||
} else {
|
} else {
|
||||||
if (i != 0 && prevLattices != null) {
|
if (i != 0 && prevLattices != null) {
|
||||||
var prevLatticeLastItem = prevLattices[prevLattices.length - 1];
|
var prevLatticeLastItem = prevLattices[prevLattices.length - 1];
|
||||||
var adjacentSpacingTime = lattice.time - prevLatticeLastItem.time;
|
var adjacentSpacingTime = lattice.time - prevLatticeLastItem.time;
|
||||||
intervalTime = adjacentSpacingTime + prevLatticeLastItem.intervalTime;
|
|
||||||
if (adjacentSpacingTime > 5000) {
|
if (adjacentSpacingTime > 5000) {
|
||||||
// 大于5秒算一次停顿
|
// 大于5秒算一次停顿
|
||||||
pauseCount++;
|
pauseCount++;
|
||||||
pauseInterval.add(PauseIntervalTime(startTime: prevLatticeLastItem.intervalTime, endTime: intervalTime));
|
|
||||||
}
|
}
|
||||||
|
intervalTime = adjacentSpacingTime + prevLatticeLastItem.intervalTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lattice.intervalTime = intervalTime;
|
lattice.intervalTime = intervalTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return HandwritingInfo(pauseCount, timeConsuming, lattices, pauseInterval);
|
return HandwritingInfo(pauseCount, timeConsuming, lattices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HandwritingInfo {
|
class HandwritingInfo {
|
||||||
int pauseCount; // 停顿次数
|
int pauseCount; // 停顿次数
|
||||||
List<PauseIntervalTime> pauseInterval;
|
|
||||||
int timeConsuming; // 耗时(毫秒)
|
int timeConsuming; // 耗时(毫秒)
|
||||||
Map<int, List<Lattices>> strokeMap; // 笔画数据
|
Map<int, List<Lattices>> strokeMap; // 笔画数据
|
||||||
|
|
||||||
HandwritingInfo(this.pauseCount, this.timeConsuming, this.strokeMap, this.pauseInterval);
|
HandwritingInfo(this.pauseCount, this.timeConsuming, this.strokeMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片展示
|
// 图片展示
|
||||||
|
|
@ -380,7 +374,6 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
List<Timer> timers = [];
|
List<Timer> timers = [];
|
||||||
int handwritingTime = 0;
|
int handwritingTime = 0;
|
||||||
int handwritingDuration = 0;
|
int handwritingDuration = 0;
|
||||||
double speed = 1; // 播放速度
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
@ -411,13 +404,6 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
toGoPause();
|
toGoPause();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PlaybackSpeedBus:
|
|
||||||
// 播放速度
|
|
||||||
var _model = (e as PlaybackSpeedBus);
|
|
||||||
speed = _model.speed;
|
|
||||||
toGoPause(); // 先暂停再重新播放
|
|
||||||
dragProgressBarInitData(handwritingTime, handwritingDuration);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -470,7 +456,6 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
/// 拖动进度条后重新初始化数据
|
/// 拖动进度条后重新初始化数据
|
||||||
/// @param startTime 起始时间 单位秒
|
/// @param startTime 起始时间 单位秒
|
||||||
Future<void> dragProgressBarInitData(int startTime, int totalDuration) async {
|
Future<void> dragProgressBarInitData(int startTime, int totalDuration) async {
|
||||||
eventFire(model: JobHandwritingPlaybarBus(false));
|
|
||||||
timers.forEach((e) {
|
timers.forEach((e) {
|
||||||
if (e.isActive) e.cancel();
|
if (e.isActive) e.cancel();
|
||||||
});
|
});
|
||||||
|
|
@ -489,26 +474,25 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
for (var i = 0; i < _packagedHandwritingDataAll.length; i++) {
|
for (var i = 0; i < _packagedHandwritingDataAll.length; i++) {
|
||||||
var item = _packagedHandwritingDataAll[i];
|
var item = _packagedHandwritingDataAll[i];
|
||||||
|
|
||||||
if (item.intervalTime < startTime) {
|
if (item.intervalTime <= startTime) {
|
||||||
// 需要直接装配到直接打印的容器
|
// 需要直接装配到直接打印的容器
|
||||||
executeImmediately.add(item);
|
executeImmediately.add(item);
|
||||||
} else {
|
} else {
|
||||||
var intervalTime = item.intervalTime - startTime;
|
|
||||||
// 需要等待的数据
|
// 需要等待的数据
|
||||||
waitingExecution.add(GestureHandwritingRecording(
|
waitingExecution.add(GestureHandwritingRecording(
|
||||||
stroke: item.stroke,
|
stroke: item.stroke,
|
||||||
data: item.data,
|
data: item.data,
|
||||||
usageTime: item.usageTime,
|
usageTime: item.usageTime,
|
||||||
intervalTime: intervalTime < 0 ? 0 : intervalTime,
|
intervalTime: item.intervalTime - startTime,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pendingData = waitingExecution;
|
pendingData = waitingExecution;
|
||||||
ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal(executeImmediately);
|
ref.read(jobHandwritingDrawingTrajectoryProvider.notifier).setVal(executeImmediately);
|
||||||
}
|
|
||||||
eventFire(model: JobHandwritingPlaybarBus(true));
|
eventFire(model: JobHandwritingPlaybarBus(true));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> zhixinCall(GestureHandwritingRecording e) async {
|
Future<void> zhixinCall(GestureHandwritingRecording e) async {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|
@ -534,7 +518,7 @@ class _HandwritingDrawBoxState extends ConsumerState<HandwritingDrawBox> with Ev
|
||||||
if (e.intervalTime == 0) {
|
if (e.intervalTime == 0) {
|
||||||
zhixinCall(e);
|
zhixinCall(e);
|
||||||
} else {
|
} else {
|
||||||
var ter = Timer(Duration(milliseconds: e.intervalTime ~/ speed), () => zhixinCall(e));
|
var ter = Timer(Duration(milliseconds: e.intervalTime), () => zhixinCall(e));
|
||||||
timers.add(ter);
|
timers.add(ter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -657,7 +641,7 @@ Widget $pageNumberBox(int pageNum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@hwidget
|
@hwidget
|
||||||
Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, List<PauseIntervalTime> pauseIntervals) {
|
Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount) {
|
||||||
var usePlaybar = UseBottomPlaybar.use(timeConsuming);
|
var usePlaybar = UseBottomPlaybar.use(timeConsuming);
|
||||||
|
|
||||||
useValueChanged<int, void>(timeConsuming, (_, __) {
|
useValueChanged<int, void>(timeConsuming, (_, __) {
|
||||||
|
|
@ -672,9 +656,6 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
// 播放速度
|
// 播放速度
|
||||||
useValueChanged<PlaybackSpeed, void>(usePlaybar.constantFastSpeed.value, (_, __) {
|
useValueChanged<PlaybackSpeed, void>(usePlaybar.constantFastSpeed.value, (_, __) {
|
||||||
usePlaybar.eventFire(model: PlaybackSpeedBus(usePlaybar.constantFastSpeed.value.speed));
|
usePlaybar.eventFire(model: PlaybackSpeedBus(usePlaybar.constantFastSpeed.value.speed));
|
||||||
// 播放速度变化
|
|
||||||
usePlaybar.playTimingSuspend();
|
|
||||||
usePlaybar.playTimingStarts();
|
|
||||||
});
|
});
|
||||||
// 计时结束监听
|
// 计时结束监听
|
||||||
useValueChanged<int, void>(usePlaybar.useTime.value, (_, __) {
|
useValueChanged<int, void>(usePlaybar.useTime.value, (_, __) {
|
||||||
|
|
@ -687,6 +668,7 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
usePlaybar.eventOn(callback: (e) {
|
usePlaybar.eventOn(callback: (e) {
|
||||||
|
// TODO 数据
|
||||||
switch (e.runtimeType) {
|
switch (e.runtimeType) {
|
||||||
case JobHandwritingPlaybarBus:
|
case JobHandwritingPlaybarBus:
|
||||||
// 出发播放暂停
|
// 出发播放暂停
|
||||||
|
|
@ -694,17 +676,23 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
if (_val.play) {
|
if (_val.play) {
|
||||||
// 开始播放
|
// 开始播放
|
||||||
usePlaybar.playTimingStarts();
|
usePlaybar.playTimingStarts();
|
||||||
if (!usePlaybar.playPause.value) usePlaybar.playPause.value = true;
|
if (!usePlaybar.playPause.value) {
|
||||||
|
usePlaybar.playPause.value = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 暂停播放
|
// 暂停播放
|
||||||
usePlaybar.playTimingSuspend();
|
usePlaybar.playTimingSuspend();
|
||||||
if (usePlaybar.playPause.value) usePlaybar.playPause.value = false;
|
if (usePlaybar.playPause.value) {
|
||||||
|
usePlaybar.playPause.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case JobHandwritingGetReadyBus:
|
case JobHandwritingGetReadyBus:
|
||||||
// 作业笔迹已经计算好坐标 可以开始播放
|
// 作业笔迹已经计算好坐标 可以开始播放
|
||||||
Future.delayed(Duration.zero, () => (usePlaybar.handWritingReady.value = true));
|
Future.delayed(Duration.zero, () => (usePlaybar.handWritingReady.value = true));
|
||||||
break;
|
break;
|
||||||
|
case PlaybackSpeedBus:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -723,7 +711,7 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
height: 60.h,
|
height: 60.h,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
color: Color.fromRGBO(0, 0, 0, 0.4),
|
color: Color.fromRGBO(0, 0, 0, 0.5),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -743,68 +731,30 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
SpinKitPouringHourGlassRefined(size: 40.sp, color: Colors.white),
|
SpinKitPouringHourGlassRefined(size: 40.sp, color: Colors.white),
|
||||||
SizedBox(width: 6.w),
|
SizedBox(width: 6.w),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: LayoutBuilder(
|
child: Column(
|
||||||
builder: (context, constraints) {
|
|
||||||
final double containerWidth = constraints.maxWidth; // 展示区域总宽度
|
|
||||||
// print('总刻度:$timeConsuming,宽度:$containerWidth');
|
|
||||||
// print('总时长:${pauseIntervals.map((e) => e.toJson()).toList()}');
|
|
||||||
var unitScale = containerWidth / timeConsuming; // 单位刻度
|
|
||||||
var pauseIntervalsLength = pauseIntervals.length;
|
|
||||||
List<Widget> pauseTickMarks = pauseIntervals.asMap().keys.map((e) {
|
|
||||||
bool isLast = e == pauseIntervalsLength - 1;
|
|
||||||
bool isFirst = e == 0;
|
|
||||||
var item = pauseIntervals[e];
|
|
||||||
return Positioned(
|
|
||||||
top: 0,
|
|
||||||
left: unitScale * item.startTime,
|
|
||||||
child: Container(
|
|
||||||
width: unitScale * (item.apart ?? 0),
|
|
||||||
height: 8.h,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: isFirst
|
|
||||||
? BorderRadius.only(topLeft: Radius.circular(8.r), bottomLeft: Radius.circular(10.r))
|
|
||||||
: (isLast ? BorderRadius.only(topRight: Radius.circular(8.r), bottomRight: Radius.circular(10.r)) : null),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList();
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
|
||||||
Stack(
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: 8.h,
|
height: 20.h,
|
||||||
width: containerWidth,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: Color.fromRGBO(146, 146, 146, 1),
|
|
||||||
color: Color.fromRGBO(202, 201, 201, 1),
|
|
||||||
borderRadius: BorderRadius.circular(50.r),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
...pauseTickMarks,
|
|
||||||
Container(
|
|
||||||
height: 8.h,
|
|
||||||
// color: Theme.of(context).primaryColor,
|
// color: Theme.of(context).primaryColor,
|
||||||
child: SliderTheme(
|
|
||||||
data: SliderTheme.of(context).copyWith(
|
|
||||||
trackHeight: 8.h, // 轨道高度
|
|
||||||
trackShape: RoundedRectSliderTrackShape(), // 轨道形状,可以自定义
|
|
||||||
activeTrackColor: Theme.of(context).primaryColor, // 激活的轨道颜色
|
|
||||||
inactiveTrackColor: Colors.transparent, // 未激活的轨道颜色
|
|
||||||
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 0, disabledThumbRadius: 0),
|
|
||||||
thumbColor: Colors.white, // 滑块颜色
|
|
||||||
overlayShape: RoundSliderOverlayShape(overlayRadius: 0),
|
|
||||||
overlayColor: Colors.black54, // 滑块外圈颜色
|
|
||||||
// valueIndicatorShape: PaddleSliderValueIndicatorShape(), // 标签形状,可以自定义
|
|
||||||
),
|
|
||||||
child: Slider(
|
child: Slider(
|
||||||
|
/// 进度条的值
|
||||||
value: (usePlaybar.handwritingDuration.value - usePlaybar.useTime.value).toDouble(),
|
value: (usePlaybar.handwritingDuration.value - usePlaybar.useTime.value).toDouble(),
|
||||||
|
|
||||||
|
/// 进度条的最小值(默认为 0)
|
||||||
min: 0.0,
|
min: 0.0,
|
||||||
|
|
||||||
|
/// 进度条的最大值(默认为 1)
|
||||||
max: usePlaybar.handwritingDuration.value.toDouble(),
|
max: usePlaybar.handwritingDuration.value.toDouble(),
|
||||||
inactiveColor: Colors.transparent,
|
// divisions:1,
|
||||||
|
|
||||||
|
/// 滑块以及滑块左侧的颜色
|
||||||
|
// activeColor: Colors.red,
|
||||||
|
|
||||||
|
/// 滑块右侧的颜色
|
||||||
|
inactiveColor: Color.fromRGBO(217, 217, 217, 1),
|
||||||
|
|
||||||
|
/// 进度值发生变化时触发的事件(注:把 onChanged 设置为 null 则说明 Slider 为不可用状态)
|
||||||
onChangeEnd: (value) {
|
onChangeEnd: (value) {
|
||||||
usePlaybar.playTimingSuspend(); // 暂停计时器得暂停
|
usePlaybar.playTimingSuspend(); // 暂停计时器得暂停
|
||||||
usePlaybar.eventFire(model: JobHandwritingDragProgressBarBus(value.toInt(), usePlaybar.handwritingDuration.value));
|
usePlaybar.eventFire(model: JobHandwritingDragProgressBarBus(value.toInt(), usePlaybar.handwritingDuration.value));
|
||||||
|
|
@ -814,9 +764,12 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
usePlaybar.useTime.value = usePlaybar.handwritingDuration.value - value.toInt();
|
usePlaybar.useTime.value = usePlaybar.handwritingDuration.value - value.toInt();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
// /// 手指按下滑块时触发的事件
|
||||||
],
|
// onChangeStart: (value) => log('onChangeStart: $value'),
|
||||||
|
|
||||||
|
// /// 手指从滑块抬起时触发的事件
|
||||||
|
// onChangeEnd: (value) => log('onChangeEnd: $value'),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4.h),
|
SizedBox(height: 4.h),
|
||||||
Row(
|
Row(
|
||||||
|
|
@ -827,8 +780,6 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 16.w),
|
SizedBox(width: 16.w),
|
||||||
|
|
@ -847,7 +798,7 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
child: quickText(
|
child: quickText(
|
||||||
'${usePlaybar.constantFastSpeed.value.name}',
|
'${usePlaybar.constantFastSpeed.value.name}',
|
||||||
color: Color.fromRGBO(79, 114, 244, 1),
|
color: Color.fromRGBO(79, 114, 244, 1),
|
||||||
size: 8.sp,
|
size: 10.sp,
|
||||||
align: TextAlign.center,
|
align: TextAlign.center,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -857,11 +808,6 @@ Widget $bottomPlaybar(BuildContext context, int timeConsuming, int pauseCount, L
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@swidget
|
|
||||||
Widget $pauseTickMark() {
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
|
|
||||||
class UseBottomPlaybar with EventBusMixin {
|
class UseBottomPlaybar with EventBusMixin {
|
||||||
final ValueNotifier<int> handwritingDuration; // 笔迹总时长
|
final ValueNotifier<int> handwritingDuration; // 笔迹总时长
|
||||||
final ValueNotifier<bool> playPause; // 播放暂停
|
final ValueNotifier<bool> playPause; // 播放暂停
|
||||||
|
|
@ -898,8 +844,7 @@ class UseBottomPlaybar with EventBusMixin {
|
||||||
void playTimingStarts() {
|
void playTimingStarts() {
|
||||||
if (useTime.value > 0) {
|
if (useTime.value > 0) {
|
||||||
timer.value?.cancel();
|
timer.value?.cancel();
|
||||||
|
timer.value = Timer.periodic(Duration(seconds: 1), (theTime) {
|
||||||
timer.value = Timer.periodic(Duration(milliseconds: 1000 ~/ constantFastSpeed.value.speed), (theTime) {
|
|
||||||
useTime.value -= 1;
|
useTime.value -= 1;
|
||||||
if (useTime.value < 0) {
|
if (useTime.value < 0) {
|
||||||
timer.value?.cancel();
|
timer.value?.cancel();
|
||||||
|
|
@ -953,26 +898,9 @@ enum PlaybackSpeed {
|
||||||
ORIGINAL_SPEED(name: '原速播放', speed: 1),
|
ORIGINAL_SPEED(name: '原速播放', speed: 1),
|
||||||
ONE_POINT_FIVE_SPEED(name: '1.5x播放', speed: 1.5),
|
ONE_POINT_FIVE_SPEED(name: '1.5x播放', speed: 1.5),
|
||||||
DOUBLE_SPEED(name: '2.0x播放', speed: 2),
|
DOUBLE_SPEED(name: '2.0x播放', speed: 2),
|
||||||
TRIPLE_SPEED(name: '3.0x播放', speed: 3),
|
TRIPLE_SPEED(name: '3.0x播放', speed: 3);
|
||||||
FOUR_SPEED(name: '4.0x播放', speed: 4),
|
|
||||||
FIVE_SPEED(name: '5.0x播放', speed: 5),
|
|
||||||
SIX_SPEED(name: '6.0x播放', speed: 6);
|
|
||||||
|
|
||||||
const PlaybackSpeed({required this.name, required this.speed});
|
const PlaybackSpeed({required this.name, required this.speed});
|
||||||
final double speed;
|
final double speed;
|
||||||
final String name;
|
final String name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonSerializable()
|
|
||||||
class PauseIntervalTime extends Object {
|
|
||||||
int? apart;
|
|
||||||
int startTime;
|
|
||||||
int endTime;
|
|
||||||
PauseIntervalTime({required this.startTime, required this.endTime}) {
|
|
||||||
apart = endTime - startTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
factory PauseIntervalTime.fromJson(Map<String, dynamic> srcJson) => _$PauseIntervalTimeFromJson(srcJson);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$PauseIntervalTimeToJson(this);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ class StudentKgTable extends StatefulWidget {
|
||||||
final List bodyList;
|
final List bodyList;
|
||||||
final int? fixedRows;
|
final int? fixedRows;
|
||||||
final int? fixedCols;
|
final int? fixedCols;
|
||||||
final Function(String)? questionNumCall;
|
|
||||||
|
|
||||||
const StudentKgTable({
|
const StudentKgTable({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|
@ -16,7 +15,6 @@ class StudentKgTable extends StatefulWidget {
|
||||||
required this.bodyList,
|
required this.bodyList,
|
||||||
this.fixedCols = 0,
|
this.fixedCols = 0,
|
||||||
this.fixedRows = 0,
|
this.fixedRows = 0,
|
||||||
this.questionNumCall,
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -31,7 +29,6 @@ class _StudentKgTableState extends State<StudentKgTable> {
|
||||||
String sortString(String str) {
|
String sortString(String str) {
|
||||||
return String.fromCharCodes(str.codeUnits.toList()..sort());
|
return String.fromCharCodes(str.codeUnits.toList()..sort());
|
||||||
}
|
}
|
||||||
|
|
||||||
DataRow _getRow(int index, [Color? color]) {
|
DataRow _getRow(int index, [Color? color]) {
|
||||||
assert(index >= 0);
|
assert(index >= 0);
|
||||||
KgDetails item = widget.bodyList[index];
|
KgDetails item = widget.bodyList[index];
|
||||||
|
|
@ -39,43 +36,27 @@ class _StudentKgTableState extends State<StudentKgTable> {
|
||||||
index: index,
|
index: index,
|
||||||
color: color != null ? MaterialStateProperty.all(color): null,
|
color: color != null ? MaterialStateProperty.all(color): null,
|
||||||
cells: [
|
cells: [
|
||||||
DataCell(
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
if (widget.questionNumCall != null) {
|
|
||||||
widget.questionNumCall!(item.questionNo);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Center(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
|
||||||
child: Text(item.questionNo, style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
DataCell(Center(
|
DataCell(Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: Text(
|
child: Text(item.questionNo,
|
||||||
item.studentAnswer == null ? '未作答' : item.studentAnswer!,
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: 12.sp,
|
)),
|
||||||
color: item.studentAnswer == null
|
DataCell(Center(
|
||||||
? Color(0xFF525252)
|
child: Padding(
|
||||||
: item.state == 2
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
? Color(0xFF4CC793)
|
child: Text(item.studentAnswer == null?'未作答':item.studentAnswer!,
|
||||||
: item.state == 1
|
style: TextStyle(fontSize: 12.sp, color: item.studentAnswer == null?Color(0xFF525252):
|
||||||
? Color(0xFFFF7474)
|
item.state == 2?Color(0xFF4CC793):
|
||||||
: item.state == 0
|
item.state == 1?Color(0xFFFF7474):item.state == 0?Color(0xFFD3D3D3):Colors.white),
|
||||||
? Color(0xFFD3D3D3)
|
|
||||||
: Colors.white),
|
|
||||||
),
|
),
|
||||||
))),
|
))),
|
||||||
DataCell(Center(
|
DataCell(Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: Text(item.questionAnswer == null ? '无' : item.questionAnswer!, style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
|
child: Text(item.questionAnswer == null ?'无':item.questionAnswer!,
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
|
|
@ -93,10 +74,14 @@ class _StudentKgTableState extends State<StudentKgTable> {
|
||||||
dataRowHeight: 40.r,
|
dataRowHeight: 40.r,
|
||||||
headingRowHeight: 40.r,
|
headingRowHeight: 40.r,
|
||||||
border: TableBorder(
|
border: TableBorder(
|
||||||
horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
|
horizontalInside: BorderSide(
|
||||||
bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
|
width: 1, color: Colors.white, style: BorderStyle.solid),
|
||||||
verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)),
|
bottom: BorderSide(
|
||||||
headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
|
width: 1, color: Colors.white, style: BorderStyle.solid),
|
||||||
|
verticalInside: BorderSide(
|
||||||
|
width: 1, color: Colors.white, style: BorderStyle.solid)),
|
||||||
|
headingRowColor: MaterialStateProperty.resolveWith((states) =>
|
||||||
|
widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
|
||||||
headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)),
|
headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)),
|
||||||
fixedColumnsColor: Color(0xFFE6E6E6),
|
fixedColumnsColor: Color(0xFFE6E6E6),
|
||||||
fixedCornerColor: Colors.grey[400],
|
fixedCornerColor: Colors.grey[400],
|
||||||
|
|
@ -110,12 +95,14 @@ class _StudentKgTableState extends State<StudentKgTable> {
|
||||||
var item = widget.headList[index];
|
var item = widget.headList[index];
|
||||||
return DataColumn2(
|
return DataColumn2(
|
||||||
label: Center(
|
label: Center(
|
||||||
child: Text(item, style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
|
child: Text(item,
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
|
||||||
),
|
),
|
||||||
// size: ColumnSize.S,
|
// size: ColumnSize.S,
|
||||||
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r)/3,
|
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r)/3,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
rows: List<DataRow>.generate(widget.bodyList.length, (index) => _getRow(index, Color(0xFFF5F5F5))));
|
rows: List<DataRow>.generate(widget.bodyList.length,
|
||||||
|
(index) => _getRow(index, Color(0xFFF5F5F5))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:marking_app/common/model/job/job_data_report.dart';
|
import 'package:marking_app/common/model/job/job_data_report.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/components/imgDialog.dart';
|
import 'package:marking_app/pages/homework_correction/components/imgDialog.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/widget/answer_handwriting.dart';
|
|
||||||
import 'package:marking_app/utils/common_utils.dart';
|
import 'package:marking_app/utils/common_utils.dart';
|
||||||
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||||
import 'package:photo_view/photo_view.dart';
|
import 'package:photo_view/photo_view.dart';
|
||||||
|
|
@ -13,7 +12,6 @@ class StudentZgTable extends StatefulWidget {
|
||||||
final List bodyList;
|
final List bodyList;
|
||||||
final int? fixedRows;
|
final int? fixedRows;
|
||||||
final int? fixedCols;
|
final int? fixedCols;
|
||||||
final Function(String)? questionNumCall;
|
|
||||||
|
|
||||||
const StudentZgTable({
|
const StudentZgTable({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|
@ -21,7 +19,6 @@ class StudentZgTable extends StatefulWidget {
|
||||||
required this.bodyList,
|
required this.bodyList,
|
||||||
this.fixedCols = 0,
|
this.fixedCols = 0,
|
||||||
this.fixedRows = 0,
|
this.fixedRows = 0,
|
||||||
this.questionNumCall,
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -75,23 +72,18 @@ class _StudentZgTableState extends State<StudentZgTable> {
|
||||||
index: index,
|
index: index,
|
||||||
color: color != null ? MaterialStateProperty.all(color): null,
|
color: color != null ? MaterialStateProperty.all(color): null,
|
||||||
cells: [
|
cells: [
|
||||||
DataCell(InkWell(
|
DataCell(Center(
|
||||||
onTap: () {
|
|
||||||
if (widget.questionNumCall != null) {
|
|
||||||
widget.questionNumCall!(item.questionNo);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Center(
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: Text(item.questionNo, style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
|
child: Text(item.questionNo,
|
||||||
),
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD))),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
DataCell(Center(
|
DataCell(Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: Text(CommonUtils.second2HMS(item.useTime!), style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
|
child: Text(CommonUtils.second2HMS(item.useTime!),
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
DataCell(InkWell(
|
DataCell(InkWell(
|
||||||
|
|
@ -99,30 +91,22 @@ class _StudentZgTableState extends State<StudentZgTable> {
|
||||||
if(item.state != 0){
|
if(item.state != 0){
|
||||||
ImageDialog.showImgDialog(context,item.studentAnswer!);
|
ImageDialog.showImgDialog(context,item.studentAnswer!);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: Text(item.state != 0 ? '查看' : '--', style: TextStyle(fontSize: 12.sp, color: Color(0xFF3661FE))),
|
child: Text(item.state!=0 ?'查看':'--',
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF3661FE))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
DataCell(Center(
|
DataCell(Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: item.state == 2
|
child: item.state == 2?
|
||||||
? Image.asset(
|
Image.asset('assets/images/job_personal_correct_icon.png',width: 18.r,height: 18.r,):item.state == 1?
|
||||||
'assets/images/job_personal_correct_icon.png',
|
Image.asset('assets/images/job_personal_error_icon.png',width: 10.r,height: 10.r,):Text('', style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
|
||||||
width: 18.r,
|
|
||||||
height: 18.r,
|
|
||||||
)
|
|
||||||
: item.state == 1
|
|
||||||
? Image.asset(
|
|
||||||
'assets/images/job_personal_error_icon.png',
|
|
||||||
width: 10.r,
|
|
||||||
height: 10.r,
|
|
||||||
)
|
|
||||||
: Text('', style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
|
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
DataCell(InkWell(
|
DataCell(InkWell(
|
||||||
|
|
@ -130,11 +114,13 @@ class _StudentZgTableState extends State<StudentZgTable> {
|
||||||
if(item.state==1 || item.state==2){
|
if(item.state==1 || item.state==2){
|
||||||
ImageDialog.showImgDialog(context,item.annotateAnswers!);
|
ImageDialog.showImgDialog(context,item.annotateAnswers!);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
padding: EdgeInsets.symmetric(horizontal: 5.r),
|
||||||
child: Text(item.state == 1 || item.state == 2 ? '查看' : '--', style: TextStyle(fontSize: 12.sp, color: Color(0xFF3661FE))),
|
child: Text(item.state==1 || item.state==2?'查看':'--',
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF3661FE))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
|
|
@ -153,10 +139,14 @@ class _StudentZgTableState extends State<StudentZgTable> {
|
||||||
headingRowHeight: 40.r,
|
headingRowHeight: 40.r,
|
||||||
dataRowHeight: 40.r,
|
dataRowHeight: 40.r,
|
||||||
border: TableBorder(
|
border: TableBorder(
|
||||||
horizontalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
|
horizontalInside: BorderSide(
|
||||||
bottom: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid),
|
width: 1, color: Colors.white, style: BorderStyle.solid),
|
||||||
verticalInside: BorderSide(width: 1, color: Colors.white, style: BorderStyle.solid)),
|
bottom: BorderSide(
|
||||||
headingRowColor: MaterialStateProperty.resolveWith((states) => widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
|
width: 1, color: Colors.white, style: BorderStyle.solid),
|
||||||
|
verticalInside: BorderSide(
|
||||||
|
width: 1, color: Colors.white, style: BorderStyle.solid)),
|
||||||
|
headingRowColor: MaterialStateProperty.resolveWith((states) =>
|
||||||
|
widget.fixedCols! > 0 ? Colors.white : Colors.transparent),
|
||||||
headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)),
|
headingRowDecoration: BoxDecoration(color: Color(0xFFE6E6E6)),
|
||||||
fixedColumnsColor: Color(0xFFE6E6E6),
|
fixedColumnsColor: Color(0xFFE6E6E6),
|
||||||
fixedCornerColor: Colors.grey[400],
|
fixedCornerColor: Colors.grey[400],
|
||||||
|
|
@ -170,12 +160,14 @@ class _StudentZgTableState extends State<StudentZgTable> {
|
||||||
var item = widget.headList[index];
|
var item = widget.headList[index];
|
||||||
return DataColumn2(
|
return DataColumn2(
|
||||||
label: Center(
|
label: Center(
|
||||||
child: Text(item, style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
|
child: Text(item,
|
||||||
|
style: TextStyle(fontSize: 12.sp, color: Color(0xFF505767))),
|
||||||
),
|
),
|
||||||
// size: ColumnSize.S,
|
// size: ColumnSize.S,
|
||||||
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r)/5,
|
fixedWidth: (MediaQuery.of(context).size.width - 20.r - 28.r)/5,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
rows: List<DataRow>.generate(widget.bodyList.length, (index) => _getRow(index, Color(0xFFF5F5F5))));
|
rows: List<DataRow>.generate(widget.bodyList.length,
|
||||||
|
(index) => _getRow(index, Color(0xFFF5F5F5))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue