|
@@ -70,8 +70,8 @@
|
|
|
v-model:value="result"
|
|
|
@change="onMark"
|
|
|
>
|
|
|
- <a-radio :value="1">正常</a-radio>
|
|
|
- <a-radio :value="0">异常</a-radio>
|
|
|
+ <a-radio :value="false">正常</a-radio>
|
|
|
+ <a-radio :value="true">异常</a-radio>
|
|
|
</a-radio-group>
|
|
|
</a-collapse-panel>
|
|
|
<a-collapse-panel key="4">
|
|
@@ -110,8 +110,8 @@
|
|
|
v-model:value="historyResult"
|
|
|
@change="onMark"
|
|
|
>
|
|
|
- <a-radio :value="1">正常</a-radio>
|
|
|
- <a-radio :value="0">异常</a-radio>
|
|
|
+ <a-radio :value="false">正常</a-radio>
|
|
|
+ <a-radio :value="true">异常</a-radio>
|
|
|
</a-radio-group>
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
@@ -135,10 +135,10 @@
|
|
|
<li style="width: 80px">
|
|
|
<span
|
|
|
:class="
|
|
|
- item.assignedSuspect ? 'color-success' : 'color-error'
|
|
|
+ !item.assignedSuspect ? 'color-success' : 'color-error'
|
|
|
"
|
|
|
>
|
|
|
- {{ item.assignedSuspect ? "正常" : "异常" }}
|
|
|
+ {{ !item.assignedSuspect ? "正常" : "异常" }}
|
|
|
</span>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -178,17 +178,26 @@ defineOptions({
|
|
|
name: "ReviewAction",
|
|
|
});
|
|
|
const emit = defineEmits(["search", "reset", "mark"]);
|
|
|
-defineExpose({ switchTab });
|
|
|
+defineExpose({ switchTab, updateTaskStatus });
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
const reviewStore = useReviewStore();
|
|
|
|
|
|
+const searchCourseCode = ref("");
|
|
|
+const exportCourseCode = ref("");
|
|
|
+const resetCourseCode = ref("");
|
|
|
+const result = ref();
|
|
|
+const historyResult = ref();
|
|
|
const fieldNames = { label: "name", value: "code" };
|
|
|
|
|
|
// tab
|
|
|
const reviewKey = ref(["1", "2", "3", "4"]);
|
|
|
|
|
|
async function switchTab(key: "review" | "history") {
|
|
|
+ if (key === "history" && !searchCourseCode.value) {
|
|
|
+ message.error("请先选择科目");
|
|
|
+ return;
|
|
|
+ }
|
|
|
reviewStore.setInfo({ tabKey: key });
|
|
|
|
|
|
if (key === "history") {
|
|
@@ -208,23 +217,23 @@ async function getCourses() {
|
|
|
}
|
|
|
getCourses();
|
|
|
|
|
|
-const searchCourseCode = ref("");
|
|
|
-const exportCourseCode = ref("");
|
|
|
-const resetCourseCode = ref("");
|
|
|
-const result = ref();
|
|
|
-const historyResult = ref();
|
|
|
-
|
|
|
// history
|
|
|
const curHistoryTaskIndex = ref(0);
|
|
|
const dataList = ref<ReviewTaskListItem[]>([]);
|
|
|
async function getHistory() {
|
|
|
- if (!reviewStore.waitTask?.id) return;
|
|
|
const res = await reviewTaskHistory({
|
|
|
- id: reviewStore.waitTask?.id,
|
|
|
+ examId: userStore.curExam.id,
|
|
|
subjectCode: searchCourseCode.value,
|
|
|
- pageSize: 30,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 20,
|
|
|
});
|
|
|
- dataList.value = res || [];
|
|
|
+ dataList.value = res.result || [];
|
|
|
+}
|
|
|
+
|
|
|
+function updateTaskStatus(assignedSuspect: boolean) {
|
|
|
+ const row = dataList.value.find((item) => item.id === reviewStore.curTask.id);
|
|
|
+ if (!row) return;
|
|
|
+ row.assignedSuspect = assignedSuspect;
|
|
|
}
|
|
|
|
|
|
function setCurTask(index: number) {
|
|
@@ -281,12 +290,15 @@ async function onExportConfirm(type: ReviewExportType) {
|
|
|
|
|
|
// watch
|
|
|
watch(
|
|
|
- () => reviewStore.curTask,
|
|
|
+ () => reviewStore.curTask?.id,
|
|
|
(val) => {
|
|
|
- result.value = undefined;
|
|
|
+ result.value = null;
|
|
|
if (reviewStore.tabKey === "history") {
|
|
|
historyResult.value = reviewStore.curTask?.assignedSuspect;
|
|
|
}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
}
|
|
|
);
|
|
|
</script>
|