|
@@ -39,8 +39,8 @@
|
|
v-if="dataCheckStore.curPage"
|
|
v-if="dataCheckStore.curPage"
|
|
:key="dataCheckStore.curPage.kid"
|
|
:key="dataCheckStore.curPage.kid"
|
|
:cant-change-img="true"
|
|
:cant-change-img="true"
|
|
- @prev="onPrevPage"
|
|
|
|
- @next="onNextPage"
|
|
|
|
|
|
+ @prev="onPrevStudent"
|
|
|
|
+ @next="onNextStudent"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -119,7 +119,7 @@ function buildStudentList(dataList: StudentCheckItem[]): DataCheckListItem[] {
|
|
const data: DataCheckListItem[] = (dataList || []).map((item) => {
|
|
const data: DataCheckListItem[] = (dataList || []).map((item) => {
|
|
const studentId = `${item.imageName}_${randomCode(8)}`;
|
|
const studentId = `${item.imageName}_${randomCode(8)}`;
|
|
const questions = (item.smda ? item.smda.split("|") : []).map((item) =>
|
|
const questions = (item.smda ? item.smda.split("|") : []).map((item) =>
|
|
- item.trim().replace(/[\.\?]/g, "")
|
|
|
|
|
|
+ item.trim().replace(/[\.\?]/g, "#")
|
|
);
|
|
);
|
|
return {
|
|
return {
|
|
...item,
|
|
...item,
|
|
@@ -257,7 +257,6 @@ async function onPrevStudent() {
|
|
async function onNextStudent() {
|
|
async function onNextStudent() {
|
|
if (!dataCheckStore.curStudent) return;
|
|
if (!dataCheckStore.curStudent) return;
|
|
|
|
|
|
- dataCheckStore.curStudent.checked = true;
|
|
|
|
if (dataCheckStore.curStudentIndex >= studentList.value.length - 1) {
|
|
if (dataCheckStore.curStudentIndex >= studentList.value.length - 1) {
|
|
if (pageNumber.value >= pageCount.value) {
|
|
if (pageNumber.value >= pageCount.value) {
|
|
message.error("没有下一个学生了");
|
|
message.error("没有下一个学生了");
|
|
@@ -361,7 +360,9 @@ function registShortcut() {
|
|
function removeShortcut() {
|
|
function removeShortcut() {
|
|
document.removeEventListener("keydown", shortcutHandle);
|
|
document.removeEventListener("keydown", shortcutHandle);
|
|
}
|
|
}
|
|
-function shortcutHandle(e: KeyboardEvent) {
|
|
|
|
|
|
+const studentChanging = ref(false);
|
|
|
|
+async function shortcutHandle(e: KeyboardEvent) {
|
|
|
|
+ if (studentChanging.value) return;
|
|
const moveAction = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
const moveAction = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
if (!moveAction.includes(e.code) || e.repeat) {
|
|
if (!moveAction.includes(e.code) || e.repeat) {
|
|
return;
|
|
return;
|
|
@@ -369,22 +370,18 @@ function shortcutHandle(e: KeyboardEvent) {
|
|
|
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
|
|
- if (e.code === "ArrowUp") {
|
|
|
|
- onPrevStudent();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (e.code === "ArrowDown") {
|
|
|
|
- onNextStudent();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (e.code === "ArrowLeft") {
|
|
|
|
- onPrevPage();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (e.code === "ArrowRight") {
|
|
|
|
- onNextPage();
|
|
|
|
- return;
|
|
|
|
|
|
+ try {
|
|
|
|
+ studentChanging.value = true;
|
|
|
|
+ if (e.code === "ArrowUp" || e.code === "ArrowLeft") {
|
|
|
|
+ await onPrevStudent();
|
|
|
|
+ } else if (e.code === "ArrowDown" || e.code === "ArrowRight") {
|
|
|
|
+ await onNextStudent();
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error(error);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ studentChanging.value = false;
|
|
}
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
@@ -393,7 +390,9 @@ onMounted(async () => {
|
|
message.error("请先设置服务器地址");
|
|
message.error("请先设置服务器地址");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- appStore.setState({ serverUrl: appConfig.base.serverUrl });
|
|
|
|
|
|
+ appStore.setState({
|
|
|
|
+ serverUrl: process.env.VITE_APP_PROXY_URL || appConfig.base.serverUrl,
|
|
|
|
+ });
|
|
registShortcut();
|
|
registShortcut();
|
|
menuChange();
|
|
menuChange();
|
|
});
|
|
});
|