|
@@ -1,138 +1,91 @@
|
|
|
<template>
|
|
|
- <div
|
|
|
- class="history-container tw-px-1"
|
|
|
- :class="[store.historyOpen ? 'show' : 'hide']"
|
|
|
- >
|
|
|
- <div class="tw-mt-1 tw-mb-1 tw-flex tw-place-items-center">
|
|
|
- <div class="tw-text-lg main-text-color tw-mr-3 tw-font-bold">
|
|
|
- {{ title }}
|
|
|
- </div>
|
|
|
- <div
|
|
|
- v-if="showSearch && store.getStatusValueName !== '试评'"
|
|
|
- class="tw-flex-1 tw-flex"
|
|
|
+ <div class="mark-history" :class="[store.historyOpen ? 'show' : 'hide']">
|
|
|
+ <div class="mark-history-title">
|
|
|
+ {{ title }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="showSearch && store.getStatusValueName !== '试评'"
|
|
|
+ class="mark-history-search"
|
|
|
+ >
|
|
|
+ <a-select
|
|
|
+ ref="select"
|
|
|
+ v-model:value="searchType"
|
|
|
+ style="width: 75px; margin-right: 12px; font-size: 12px"
|
|
|
+ @change="searchTypeChange"
|
|
|
>
|
|
|
- <a-select
|
|
|
- ref="select"
|
|
|
- v-model:value="searchType"
|
|
|
- style="width: 75px; margin-right: 4px; font-size: 12px"
|
|
|
- @change="searchTypeChange"
|
|
|
- >
|
|
|
- <a-select-option value="1">编号</a-select-option>
|
|
|
- <a-select-option value="2">分数</a-select-option>
|
|
|
- </a-select>
|
|
|
- <a-input-search
|
|
|
- v-model:value="secretNumberInput"
|
|
|
- style="font-size: 13px"
|
|
|
- class="tw-flex-1 search-value"
|
|
|
- placeholder="查找试卷"
|
|
|
- allowClear
|
|
|
- @keyup.enter="searchHistoryTask"
|
|
|
- @keypress.stop=""
|
|
|
- @keydown.stop=""
|
|
|
- @search="searchHistoryTask"
|
|
|
- >
|
|
|
- <!-- <template #suffix>
|
|
|
- <SearchOutlined style="color: rgba(0, 0, 0, 0.45)" />
|
|
|
- </template> -->
|
|
|
- </a-input-search>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- <input
|
|
|
- v-if="showSearch"
|
|
|
- v-model="secretNumberInput"
|
|
|
- type="text"
|
|
|
+ <a-select-option value="1">编号</a-select-option>
|
|
|
+ <a-select-option value="2">分数</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-input
|
|
|
+ v-model:value="secretNumberInput"
|
|
|
+ style="font-size: 13px"
|
|
|
+ class="search-value"
|
|
|
placeholder="查找试卷"
|
|
|
- class="tw-flex-1 tw-rounded tw-h-8 tw-pl-1 tw-pr-8"
|
|
|
- @keydown.stop=""
|
|
|
- @keypress.stop=""
|
|
|
+ allowClear
|
|
|
@keyup.enter="searchHistoryTask"
|
|
|
- />
|
|
|
- <SearchOutlined
|
|
|
- v-if="showSearch"
|
|
|
- style="margin-left: -24px; font-size: 18px; padding: 3px"
|
|
|
+ @keypress.stop=""
|
|
|
+ @keydown.stop=""
|
|
|
+ >
|
|
|
+ </a-input>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-left: 8px"
|
|
|
@click="searchHistoryTask"
|
|
|
- /> -->
|
|
|
+ >搜索</a-button
|
|
|
+ >
|
|
|
</div>
|
|
|
- <div class="tw-flex tw-justify-between tw-mt-5">
|
|
|
- <div class="tw-cursor-pointer tw-flex">编号</div>
|
|
|
- <!-- <div
|
|
|
- class="tw-cursor-pointer tw-flex tw-items-center"
|
|
|
- @click="toggleOrderBy(orderTimeField)"
|
|
|
- > -->
|
|
|
- <div class="tw-flex tw-items-center">
|
|
|
- 时间
|
|
|
- <!-- <CaretUpOutlined
|
|
|
- v-if="showOrder && order === orderTimeField && sort === 'ASC'"
|
|
|
- />
|
|
|
- <CaretDownOutlined
|
|
|
- v-if="showOrder && order === orderTimeField && sort === 'DESC'"
|
|
|
- /> -->
|
|
|
- </div>
|
|
|
- <!-- <div
|
|
|
- class="tw-cursor-pointer tw-flex tw-items-center"
|
|
|
- @click="toggleOrderBy('markerScore')"
|
|
|
- > -->
|
|
|
- <div class="tw-flex tw-items-center">
|
|
|
- 分数
|
|
|
- <!-- <CaretUpOutlined
|
|
|
- v-if="showOrder && order === 'markerScore' && sort === 'ASC'"
|
|
|
- />
|
|
|
- <CaretDownOutlined
|
|
|
- v-if="showOrder && order === 'markerScore' && sort === 'DESC'"
|
|
|
- /> -->
|
|
|
- </div>
|
|
|
+ <div class="mark-history-table-head">
|
|
|
+ <div class="head-item">编号</div>
|
|
|
+ <div class="head-item head-item-time">时间</div>
|
|
|
+ <div class="head-item">分数</div>
|
|
|
</div>
|
|
|
- <a-spin
|
|
|
- v-if="remarkCount !== 0"
|
|
|
- :spinning="loading"
|
|
|
- size="large"
|
|
|
- tip="Loading..."
|
|
|
- :delay="500"
|
|
|
- >
|
|
|
- <div style="margin-bottom: -40px; padding-bottom: 72px">
|
|
|
- <div v-for="(task, index) of store.historyTasks" :key="index">
|
|
|
- <div
|
|
|
- class="tw-flex tw-justify-between tw-place-items-center tw-rounded tw-cursor-pointer tw-font-bold tw-py-2"
|
|
|
- :class="store.currentTask === task && 'current-task'"
|
|
|
- @click="replaceCurrentTask(task)"
|
|
|
- >
|
|
|
- <div class="tw-break-words" style="width: 62px">
|
|
|
- {{ task.secretNumber }}
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- {{ $filters.datetimeFilter(task.markerTime ?? task.inspectTime) }}
|
|
|
- </div>
|
|
|
- <div style="width: 30px; text-align: right">
|
|
|
- {{ task.markerScore === -1 ? "未选做" : task.markerScore }}
|
|
|
- </div>
|
|
|
+ <div class="mark-history-table-body">
|
|
|
+ <a-spin
|
|
|
+ v-if="remarkCount !== 0"
|
|
|
+ :spinning="loading"
|
|
|
+ size="large"
|
|
|
+ tip="Loading..."
|
|
|
+ :delay="500"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-for="(task, index) of store.historyTasks"
|
|
|
+ :key="index"
|
|
|
+ :class="['body-row', { 'is-active': store.currentTask === task }]"
|
|
|
+ @click="replaceCurrentTask(task)"
|
|
|
+ >
|
|
|
+ <div class="body-col">
|
|
|
+ {{ task.secretNumber }}
|
|
|
+ </div>
|
|
|
+ <div class="body-col">
|
|
|
+ {{ $filters.datetimeFilter(task.markerTime ?? task.inspectTime) }}
|
|
|
+ </div>
|
|
|
+ <div class="body-col">
|
|
|
+ {{ task.markerScore === -1 ? "未选做" : task.markerScore }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </a-spin>
|
|
|
- <div
|
|
|
- class="tw-flex tw-justify-between tw-place-content-center tw-mt-2 pager-container"
|
|
|
- >
|
|
|
- <div class="tw-font-bold" style="line-height: 30px">
|
|
|
- 第{{ currentPage }}页
|
|
|
- </div>
|
|
|
- <div class="tw-flex tw-gap-2">
|
|
|
- <a-button
|
|
|
- shape="circle"
|
|
|
- type="primary"
|
|
|
- title="上一页"
|
|
|
- @click="previousPage"
|
|
|
- >
|
|
|
- <div class="left-triangle"></div>
|
|
|
- </a-button>
|
|
|
+ </a-spin>
|
|
|
+ </div>
|
|
|
+ <div class="mark-history-table-page">
|
|
|
+ <div>共{{ total }}项数据</div>
|
|
|
+ <a-pagination v-model:current="currentPage" simple :total="total" />
|
|
|
+
|
|
|
+ <!-- <a-button
|
|
|
+ shape="circle"
|
|
|
+ type="primary"
|
|
|
+ title="上一页"
|
|
|
+ @click="previousPage"
|
|
|
+ >
|
|
|
+ <div class="page-prev"></div>
|
|
|
+ <div class="page-body"></div>
|
|
|
+ <div class="page-next"></div>
|
|
|
<a-button
|
|
|
shape="circle"
|
|
|
- type="primary"
|
|
|
+ type=" d"
|
|
|
title="下一页"
|
|
|
@click="nextPage"
|
|
|
>
|
|
|
- <div class="right-triangle"></div>
|
|
|
</a-button>
|
|
|
- </div>
|
|
|
+ </a-button> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -147,11 +100,6 @@ import type {
|
|
|
} from "@/types";
|
|
|
import { watch, computed } from "vue";
|
|
|
import { store } from "@/store/store";
|
|
|
-import {
|
|
|
- SearchOutlined,
|
|
|
- CaretDownOutlined,
|
|
|
- CaretUpOutlined,
|
|
|
-} from "@ant-design/icons-vue";
|
|
|
import { cloneDeep } from "lodash-es";
|
|
|
import EventBus from "@/plugins/eventBus";
|
|
|
import { addFileServerPrefixToTask, preDrawImageHistory } from "@/utils/utils";
|
|
@@ -165,6 +113,7 @@ const limitPageSize = computed(() => {
|
|
|
// : 20
|
|
|
return 20;
|
|
|
});
|
|
|
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
const hasLimit = computed(() => {
|
|
|
console.log("remarkCount.value:", remarkCount.value);
|
|
|
return typeof remarkCount.value == "number";
|
|
@@ -213,6 +162,7 @@ const searchTypeChange = (val) => {
|
|
|
};
|
|
|
let loading = $ref(false);
|
|
|
let currentPage = $ref(1);
|
|
|
+let total = $ref(0);
|
|
|
let order: MarkHistoryOrderBy = $ref("markerTime");
|
|
|
if (orderTimeField) {
|
|
|
order = orderTimeField;
|
|
@@ -293,16 +243,16 @@ EventBus.on("should-reload-history", () => {
|
|
|
if (data[0]) {
|
|
|
// 如果原任务依然存在
|
|
|
store.historyTasks.splice(indexOfTasks, 1, data[0]);
|
|
|
- replaceCurrentTask(store.historyTasks[indexOfTasks]);
|
|
|
+ await replaceCurrentTask(store.historyTasks[indexOfTasks]);
|
|
|
} else {
|
|
|
// 问题卷会查找不到,这里直接删除此任务
|
|
|
store.historyTasks.splice(indexOfTasks, 1);
|
|
|
- replaceCurrentTask(store.historyTasks[indexOfTasks]);
|
|
|
+ await replaceCurrentTask(store.historyTasks[indexOfTasks]);
|
|
|
}
|
|
|
} else {
|
|
|
// 问题卷会将清除它作为 currentTask ,然后刷新当前页
|
|
|
store.historyTasks = data;
|
|
|
- replaceCurrentTask(store.historyTasks[0]);
|
|
|
+ await replaceCurrentTask(store.historyTasks[0]);
|
|
|
}
|
|
|
}
|
|
|
} finally {
|
|
@@ -313,6 +263,7 @@ EventBus.on("should-reload-history", () => {
|
|
|
|
|
|
async function updateHistoryTask({
|
|
|
pageNumber = 1,
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
pageSize = 20,
|
|
|
order = "markerTime",
|
|
|
sort = "DESC",
|
|
@@ -345,6 +296,7 @@ async function updateHistoryTask({
|
|
|
}
|
|
|
data = data.map(addFileServerPrefixToTask);
|
|
|
store.historyTasks = data;
|
|
|
+ total = data.length;
|
|
|
replaceCurrentTask(store.historyTasks[0]).catch((err) => {
|
|
|
console.log(err);
|
|
|
void message.error("切换至回评任务失败");
|
|
@@ -378,6 +330,7 @@ function nextPage() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
function toggleOrderBy(toOrder: MarkHistoryOrderBy) {
|
|
|
if (showOrder) {
|
|
|
if (toOrder === order) {
|
|
@@ -396,59 +349,3 @@ async function searchHistoryTask() {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.history-container {
|
|
|
- min-width: 290px;
|
|
|
- width: 290px;
|
|
|
- padding: 20px;
|
|
|
- font-size: var(--app-secondary-font-size);
|
|
|
- overflow-y: auto;
|
|
|
- height: calc(100vh - 56px);
|
|
|
- transition: margin-left 0.5s;
|
|
|
-}
|
|
|
-.history-container .search-value :deep(.ant-input::-webkit-input-placeholder) {
|
|
|
- font-size: 12px;
|
|
|
-}
|
|
|
-.history-container :deep(.ant-input-affix-wrapper) {
|
|
|
- padding: 4px 6px;
|
|
|
-}
|
|
|
-.history-container.show {
|
|
|
- margin-left: 0;
|
|
|
-}
|
|
|
-.history-container.hide {
|
|
|
- margin-left: -290px;
|
|
|
-}
|
|
|
-
|
|
|
-.current-task {
|
|
|
- background-color: var(--app-score-color);
|
|
|
- color: white;
|
|
|
- padding-left: 5px;
|
|
|
- margin-left: -5px;
|
|
|
- padding-right: 5px;
|
|
|
- margin-right: -5px;
|
|
|
-}
|
|
|
-
|
|
|
-.left-triangle {
|
|
|
- width: 12px;
|
|
|
- height: 12px;
|
|
|
- background-color: white;
|
|
|
- clip-path: polygon(0 50%, 100% 0, 100% 100%);
|
|
|
- transform: translateX(60%);
|
|
|
-}
|
|
|
-
|
|
|
-.right-triangle {
|
|
|
- width: 12px;
|
|
|
- height: 12px;
|
|
|
- background-color: white;
|
|
|
- clip-path: polygon(100% 50%, 0 100%, 0 0);
|
|
|
- transform: translateX(90%);
|
|
|
-}
|
|
|
-.pager-container {
|
|
|
- position: absolute;
|
|
|
- bottom: 0px;
|
|
|
- padding-bottom: 20px;
|
|
|
- width: 250px;
|
|
|
- background-color: var(--app-main-bg-color);
|
|
|
-}
|
|
|
-</style>
|