123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <div
- class="tw-flex tw-gap-4 tw-justify-between tw-items-center header-container"
- v-if="store.setting"
- >
- <div>
- <a
- class="tw-text-white tw-underline tw-block tw-overflow-ellipsis tw-w-32 tw-overflow-hidden tw-whitespace-nowrap"
- :title="store.setting.subject.name"
- href="/mark/subject-select"
- >{{ store.setting.subject.code + "-" + store.setting.subject.name }}</a
- >
- </div>
- <div v-if="store.setting.statusValue === 'TRIAL'">试评</div>
- <div class="tw-flex tw-gap-1">
- <div>
- 编号<span class="highlight-text">{{
- store.currentTask?.secretNumber
- }}</span>
- </div>
- <div
- v-if="store.currentTask && store.currentTask.objectiveScore !== null"
- >
- 客观分<span class="highlight-text">{{
- store.currentTask.objectiveScore
- }}</span>
- </div>
- </div>
- <ul class="tw-flex tw-gap-2 tw-mb-0">
- <li>
- 已评<span class="highlight-text">{{ store.status.markedCount }}</span>
- </li>
- <li v-if="store.setting.topCount">
- 分配<span class="highlight-text">{{ store.setting.topCount }}</span>
- </li>
- <li>
- 未评<span class="highlight-text">{{
- store.status.totalCount - store.status.markedCount
- }}</span>
- </li>
- <li
- :title="`问题卷${store.status.problemCount}\n待仲裁${store.status.arbitrateCount}`"
- >
- <QuestionCircleOutlined class="icon-font icon-font-size-20" />
- </li>
- <li>
- 进度<span class="highlight-text">{{ progress }}%</span>
- </li>
- </ul>
- <ul class="tw-flex tw-gap-2 tw-mb-0">
- <li @click="upScale" title="放大">
- <PlusCircleOutlined
- class="icon-font icon-font-size-20"
- :style="{
- color: greaterThanOneScale ? 'red' : 'white',
- }"
- />
- </li>
- <li @click="downScale" title="缩小">
- <MinusCircleOutlined
- class="icon-font icon-font-size-20"
- :style="{
- color: lessThanOneScale ? 'red' : 'white',
- }"
- />
- </li>
- <li @click="normalScale" title="适应">
- <FullscreenOutlined class="icon-font icon-font-size-20" />
- </li>
- </ul>
- <div @click="toggleSettingMode">
- {{ modeName }} {{ store.setting.forceMode ? "" : "(切换)" }}
- </div>
- <div @click="toggleHistory" title="回看">
- <HistoryOutlined class="icon-font icon-font-size-20" />
- </div>
- <div
- class="tw-flex tw-place-items-center"
- :title="
- '评卷时间段:' +
- $filters.datetimeFilter(store.setting.startTime) +
- ' ~ ' +
- $filters.datetimeFilter(store.setting.startTime)
- "
- >
- <ClockCircleOutlined class="icon-font icon-font-size-20" />
- </div>
- <div
- @click="switchGroupDialog"
- class="tw-overflow-ellipsis tw-w-20 tw-overflow-hidden tw-whitespace-nowrap"
- :title="group?.title"
- >
- {{ group?.title }}(切换)
- </div>
- <div class="tw-flex tw-place-items-center">
- <UserOutlined class="icon-font icon-with-text" />{{
- store.setting.userName
- }}
- </div>
- <div class="tw-flex tw-place-items-center">
- <PoweroffOutlined class="icon-font icon-with-text" />退出
- </div>
- </div>
- </template>
- <script lang="ts">
- import { getGroups, getHistoryTask } from "@/api/markPage";
- import { computed, defineComponent } from "vue";
- import { store } from "./store";
- import {
- PlusCircleOutlined,
- MinusCircleOutlined,
- FullscreenOutlined,
- HistoryOutlined,
- UserOutlined,
- PoweroffOutlined,
- ClockCircleOutlined,
- QuestionCircleOutlined,
- } from "@ant-design/icons-vue";
- import { ModeEnum } from "@/types";
- export default defineComponent({
- name: "MarkHeader",
- components: {
- PlusCircleOutlined,
- MinusCircleOutlined,
- FullscreenOutlined,
- HistoryOutlined,
- UserOutlined,
- PoweroffOutlined,
- ClockCircleOutlined,
- QuestionCircleOutlined,
- },
- setup() {
- const modeName = computed(() =>
- store.setting.mode === ModeEnum.TRACK ? "轨迹模式" : "普通模式"
- );
- function toggleSettingMode() {
- if (store.setting.mode === ModeEnum.TRACK) {
- store.setting.mode = ModeEnum.COMMON;
- } else {
- store.setting.mode = ModeEnum.TRACK;
- }
- if (store.currentMarkResult) {
- store.currentMarkResult.scoreList = [];
- store.currentMarkResult.trackList = [];
- }
- if (store.currentTask) {
- store.currentTask.questionList.forEach((q) => (q.score = null));
- }
- store.currentQuestion = undefined;
- store.currentScore = undefined;
- }
- const progress = computed(() => {
- const { totalCount, markedCount } = store.status;
- if (totalCount <= 0) return 0;
- let p = markedCount / totalCount;
- if (p < 0.01 && markedCount >= 1) p = 0.01;
- p = Math.floor(p * 100);
- return p;
- });
- const group = computed(() => {
- return store.groups.find((g) => g.number === store.setting.groupNumber);
- });
- const upScale = () => {
- const s = store.setting.uiSetting["answer.paper.scale"];
- if (s < 3)
- store.setting.uiSetting["answer.paper.scale"] = +(s + 0.2).toFixed(1);
- };
- const downScale = () => {
- const s = store.setting.uiSetting["answer.paper.scale"];
- if (s > 0.2)
- store.setting.uiSetting["answer.paper.scale"] = +(s - 0.2).toFixed(1);
- };
- const normalScale = () => {
- store.setting.uiSetting["answer.paper.scale"] = 1;
- };
- const toggleHistory = () => {
- store.historyOpen = !store.historyOpen;
- };
- const greaterThanOneScale = computed(() => {
- return store.setting.uiSetting["answer.paper.scale"] > 1;
- });
- const lessThanOneScale = computed(() => {
- return store.setting.uiSetting["answer.paper.scale"] < 1;
- });
- async function switchGroupDialog() {
- const groups = await getGroups();
- console.log(groups);
- }
- async function updateHistoryTask({
- pageNumber = 1,
- pageSize = 10,
- order = "markerTime",
- sort = "DESC",
- secretNumber = null,
- }: {
- pageNumber: number; // 从1开始
- pageSize: number;
- order: "markerTime" | "markerScore";
- sort: "ASC" | "DESC";
- secretNumber: string | null;
- }) {
- const res = await getHistoryTask({
- pageNumber,
- pageSize,
- order,
- sort,
- secretNumber,
- });
- if (res.data) {
- store.historyTasks.push(res.data);
- }
- }
- return {
- store,
- modeName,
- toggleSettingMode,
- progress,
- group,
- upScale,
- downScale,
- normalScale,
- greaterThanOneScale,
- lessThanOneScale,
- updateHistoryTask,
- toggleHistory,
- switchGroupDialog,
- };
- },
- });
- </script>
- <style scoped>
- .header-container {
- /* z-index: 10000; */
- position: relative;
- font-size: 16px;
- height: 40px;
- background-color: #5d6d7d;
- color: white;
- }
- .highlight-text {
- color: #ffe400;
- }
- .icon-font {
- display: block;
- }
- .icon-font-size-20 {
- font-size: 20px;
- }
- .line-height-20 {
- line-height: 20px;
- }
- .icon-with-text {
- font-size: 18px;
- line-height: 18px;
- }
- </style>
|