|
@@ -1,9 +1,203 @@
|
|
|
<template>
|
|
|
- <div></div>
|
|
|
+ <a-form class="m-b-16px" layout="inline">
|
|
|
+ <a-form-item label="科目">
|
|
|
+ <SelectCourse />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <a-button>查询</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <qm-button type="primary" :icon="h(PlusCircleOutlined)" @click="onAdd"
|
|
|
+ >新增评卷点信息</qm-button
|
|
|
+ >
|
|
|
+ </a-form>
|
|
|
+
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ :row-key="(record) => record.id"
|
|
|
+ :data-source="dataList"
|
|
|
+ :pagination="pagination"
|
|
|
+ :loading="loading"
|
|
|
+ bordered
|
|
|
+ >
|
|
|
+ <template #bodyCell="{ column, index }">
|
|
|
+ <template v-if="column.dataIndex === 'condition'">
|
|
|
+ {{ getConditionContent(index) }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'finishCount'">
|
|
|
+ {{ getConditionProgress(index) }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'operation'">
|
|
|
+ <qm-button type="text" @click="onArbitrate(index)">仲裁</qm-button>
|
|
|
+ <qm-button type="text" @click="onEdit(index)">修改</qm-button>
|
|
|
+ <qm-button type="text" @click="onReset(index)">重置</qm-button>
|
|
|
+ <qm-button type="text" @click="onRecheck(index)">复查</qm-button>
|
|
|
+ <qm-button type="text" @click="onBuildTask(index)">生成任务</qm-button>
|
|
|
+ <qm-button type="text" @click="onDelete(index)">删除</qm-button>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+
|
|
|
+ <ModifyRecognizeCheckTask
|
|
|
+ ref="modifyRecognizeCheckTaskRef"
|
|
|
+ :row-data="curRow"
|
|
|
+ @modified="getList"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
+import { ref, h } from "vue";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+import { PlusCircleOutlined } from "@ant-design/icons-vue";
|
|
|
+import { message } from "ant-design-vue";
|
|
|
+import type { TableProps } from "ant-design-vue";
|
|
|
+
|
|
|
+import useTable from "@/hooks/useTable";
|
|
|
+import { RecognizeCheckListItem } from "@/ap/types/recognizeCheck";
|
|
|
+import {
|
|
|
+ recognizeCheckListPage,
|
|
|
+ recognizeCheckTaskDelete,
|
|
|
+ recognizeCheckResetTask,
|
|
|
+ recognizeCheckBuildTask,
|
|
|
+ recognizeCheckTaskStatusSave,
|
|
|
+} from "@/ap/recognizeCheck";
|
|
|
+import { showConfirm } from "@/utils/uiUtils";
|
|
|
+
|
|
|
+import ModifyRecognizeCheckTask from "./ModifyRecognizeCheckTask.vue";
|
|
|
+
|
|
|
defineOptions({
|
|
|
name: "RecognizeCheck",
|
|
|
});
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const columns: TableProps["columns"] = [
|
|
|
+ {
|
|
|
+ title: "任务条件",
|
|
|
+ dataIndex: "condition",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "科目",
|
|
|
+ dataIndex: "subjectName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "状态",
|
|
|
+ dataIndex: "stage",
|
|
|
+ width: "120px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "任务总数",
|
|
|
+ dataIndex: "totalCount",
|
|
|
+ width: "100px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "完成进度",
|
|
|
+ dataIndex: "finishCount",
|
|
|
+ width: "100px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "已仲裁数量",
|
|
|
+ dataIndex: "arbitratedCount",
|
|
|
+ width: "120px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "待仲裁数量",
|
|
|
+ dataIndex: "unarbitrateCount",
|
|
|
+ width: "120px",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "操作",
|
|
|
+ dataIndex: "operation",
|
|
|
+ width: "280px",
|
|
|
+ customCell: () => {
|
|
|
+ return {
|
|
|
+ class: "operation-cell",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+const curRow = ref(null as RecognizeCheckTaskSaveParams | null);
|
|
|
+
|
|
|
+const { dataList, pagination, loading, getList, toPage, deletePageLastItem } =
|
|
|
+ useTable<RecognizeCheckListItem>(
|
|
|
+ recognizeCheckListPage,
|
|
|
+ { examId: 1 },
|
|
|
+ false
|
|
|
+ );
|
|
|
+
|
|
|
+function getConditionContent(index: number): string {
|
|
|
+ const record = dataList.value[index];
|
|
|
+ return record.conditions.map((item) => `${item.name}${item.value}`).join(";");
|
|
|
+}
|
|
|
+function getConditionProgress(index: number): string {
|
|
|
+ const record = dataList.value[index];
|
|
|
+ const progress = ((100 * record.finishCount) / record.totalCount).toFixed(2);
|
|
|
+ return `${progress}%`;
|
|
|
+}
|
|
|
+
|
|
|
+const modifyRecognizeCheckTaskRef = ref();
|
|
|
+function onAdd() {
|
|
|
+ curRow.value = null;
|
|
|
+ modifyRecognizeCheckTaskRef.value?.open();
|
|
|
+}
|
|
|
+function onEdit(index: number) {
|
|
|
+ curRow.value = dataList.value[index];
|
|
|
+ modifyRecognizeCheckTaskRef.value?.open();
|
|
|
+}
|
|
|
+
|
|
|
+function onArbitrate(index) {
|
|
|
+ const record = dataList.value[index];
|
|
|
+ router.push({ name: "RecognizeArbitrate", params: { groupId: record.id } });
|
|
|
+}
|
|
|
+
|
|
|
+async function onReset(index: number) {
|
|
|
+ const confirm = await showConfirm({
|
|
|
+ content: "确定要重置任务吗?",
|
|
|
+ }).catch(() => false);
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
+
|
|
|
+ const record = dataList.value[index];
|
|
|
+ const res = await recognizeCheckResetTask(record.id).catch(() => false);
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ message.success("操作成功");
|
|
|
+ await getList();
|
|
|
+}
|
|
|
+
|
|
|
+async function onRecheck(index: number) {
|
|
|
+ const confirm = await showConfirm({
|
|
|
+ content: "确定要复查任务吗?",
|
|
|
+ }).catch(() => false);
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
+
|
|
|
+ const record = dataList.value[index];
|
|
|
+ const res = await recognizeCheckTaskStatusSave(record.id).catch(() => false);
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ message.success("操作成功");
|
|
|
+ await getList();
|
|
|
+}
|
|
|
+
|
|
|
+async function onBuildTask(index: number) {
|
|
|
+ const record = dataList.value[index];
|
|
|
+ const res = await recognizeCheckBuildTask(record.id).catch(() => false);
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ message.success("操作成功");
|
|
|
+ await getList();
|
|
|
+}
|
|
|
+
|
|
|
+async function onDelete(index: number) {
|
|
|
+ const confirm = await showConfirm({
|
|
|
+ content: "确定要删除任务吗?",
|
|
|
+ }).catch(() => false);
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
+
|
|
|
+ const record = dataList.value[index];
|
|
|
+ const res = await recognizeCheckTaskDelete(record.id).catch(() => false);
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ deletePageLastItem();
|
|
|
+ message.success("操作成功");
|
|
|
+}
|
|
|
</script>
|