123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <template>
- <div class="radius-base">
- <div class="fill-blank radius-base p-t-base">
- <base-form :items="items" :model="model" :label-width="useVW(66)" size="small">
- <template #form-item-button>
- <el-button type="primary" @click="onStartCheck">开始检查</el-button>
- </template>
- </base-form>
- </div>
- <div class="m-t-base flex">
- <div class="radius-base fill-blank p-base overflow-hidden flex-1">
- <div class="flex items-center m-b-base table-title">
- <span class="label">在评卷员手中</span>
- <span class="data-count">{{ unMarkPaperList?.result?.length }}</span>
- <el-button type="primary" size="small" @click="onTaskChangeMarker">任务指定评卷员</el-button>
- </div>
- <base-table :columns="columns1" :data="unMarkPaperList?.result" @current-change="onCheckTask"></base-table>
- </div>
- <div class="radius-base fill-blank p-base overflow-hidden m-l-base flex-1">
- <div class="flex items-center m-b-base table-title">
- <span class="label">未处理问题卷</span>
- <span class="data-count">{{ unProcessProblemList?.length }}</span>
- </div>
- <base-table :columns="columns2" :data="unProcessProblemList"></base-table>
- </div>
- <div class="radius-base fill-blank p-base overflow-hidden m-l-base flex-1">
- <div class="flex items-center m-b-base table-title">
- <span class="label">未处理雷同卷</span>
- <span class="data-count">{{ unProcessSimilarList?.length }}</span>
- </div>
- <base-table :columns="columns3" :data="unProcessSimilarList"></base-table>
- </div>
- </div>
- </div>
- <base-dialog v-model="visibleChangeMarker" title="任务指定评卷员" destroy-on-close>
- <base-form
- ref="formRef"
- size="small"
- :rules="rules"
- :model="changeMarkerModel"
- :items="changeMarkerItems"
- ></base-form>
- <template #footer>
- <confirm-button around @confirm="onSubmitChangeMarker" @cancel="visibleChangeMarker = false"></confirm-button>
- </template>
- </base-dialog>
- </template>
- <script setup lang="ts" name="EndCheck">
- /** 收尾检查 */
- import { reactive, ref, computed, watch } from 'vue'
- import { ElButton } from 'element-plus'
- import BaseForm from '@/components/element/BaseForm.vue'
- import BaseTable from '@/components/element/BaseTable.vue'
- import BaseDialog from '@/components/element/BaseDialog.vue'
- import ConfirmButton from '@/components/common/ConfirmButton.vue'
- import useFetch from '@/hooks/useFetch'
- import useOptions from '@/hooks/useOptions'
- import useVW from '@/hooks/useVW'
- import useForm from '@/hooks/useForm'
- import type { ExtractApiParams, ExtractMultipleApiResponse } from '@/api/api'
- import type { EpFormItem, EpTableColumn, EpFormRules } from 'global-type'
- /** 指定评卷员 */
- const visibleChangeMarker = ref<boolean>(false)
- const changeMarkerModel = reactive({ loginName: '' })
- const { formRef, elFormRef } = useForm()
- const changeMarkerItems: EpFormItem[] = [{ label: '请输入指定评卷员账号', prop: 'loginName', slotType: 'input' }]
- const rules: EpFormRules = {
- loginName: [{ required: true, message: '请输入指定评卷员账号' }],
- }
- const { mainQuestionList, groupListWithAll, onOptionInit, dataModel, changeModelValue } = useOptions([
- 'question',
- 'group',
- ])
- /** 搜索 */
- const model = reactive<ExtractApiParams<'unProcessProblemList'>>({
- markingGroupNumber: dataModel.group,
- questionMainNumber: dataModel.question,
- subjectCode: dataModel.subject || '',
- })
- const { fetch: getUnMarkPaperList, result: unMarkPaperList } = useFetch('unMarkPaperList')
- const { fetch: getUnProcessProblemList, result: unProcessProblemList } = useFetch('unProcessProblemList')
- const { fetch: getUnProcessSimilarList, result: unProcessSimilarList } = useFetch('unProcessSimilarList')
- watch(dataModel, () => {
- model.subjectCode = dataModel.subject || ''
- model.questionMainNumber = dataModel.question
- model.markingGroupNumber = dataModel.group
- })
- const { defineColumn, _ } = useForm()
- const OneRow = defineColumn(_, 'row-1', { span: 6 })
- const items = computed<EpFormItem[]>(() => [
- OneRow({
- label: '大题',
- prop: 'questionMainNumber',
- slotType: 'select',
- slot: {
- options: mainQuestionList.value,
- onChange: changeModelValue('question'),
- disabled: true,
- },
- }),
- OneRow({
- label: '小组',
- prop: 'markingGroupNumber',
- slotType: 'select',
- slot: {
- options: groupListWithAll.value,
- onChange: changeModelValue('group'),
- },
- }),
- OneRow({
- slotName: 'button',
- }),
- ])
- /** 未评卷 table */
- const columns1: EpTableColumn[] = [
- { label: '评卷员', prop: 'markerName' },
- { label: '密号', prop: 'secretNumber' },
- { label: '大题', prop: 'questionMainName' },
- ]
- /** 未处理问题卷table */
- const columns2: EpTableColumn[] = [
- { label: '密号', prop: 'secretNumber' },
- { label: '大题', prop: 'questionMainName' },
- ]
- /** 未处理雷同卷table */
- const columns3: EpTableColumn[] = [
- { label: '密号', prop: 'secretNumber' },
- { label: '雷同密号', prop: 'sameSecretNumber' },
- { label: '大题', prop: 'questionMainName' },
- ]
- /** 开始检查 */
- const onStartCheck = () => {
- getUnMarkPaperList({ pageNumber: 1, pageSize: 20, ...model })
- getUnProcessProblemList(model)
- getUnProcessSimilarList(model)
- }
- const currentTask = ref<ExtractMultipleApiResponse<'unMarkPaperList'>>()
- const onCheckTask = (row: ExtractMultipleApiResponse<'unMarkPaperList'>) => {
- currentTask.value = row
- }
- /** 任务指定评卷员 */
- const onTaskChangeMarker = () => {
- visibleChangeMarker.value = true
- }
- const onSubmitChangeMarker = async () => {
- try {
- const valid = await elFormRef?.value?.validate()
- if (valid && currentTask.value) {
- useFetch('changeTaskMarker')
- .fetch({ taskId: currentTask.value.taskId, loginName: changeMarkerModel.loginName })
- .then(() => {
- visibleChangeMarker.value = false
- })
- }
- } catch (error) {
- console.error(error)
- }
- }
- onOptionInit(onStartCheck)
- </script>
- <style scoped lang="scss">
- .table-title {
- .label {
- font-size: $SmallFont;
- color: $RegularFontColor;
- }
- .data-count {
- padding: 4px 10px;
- margin: 0 12px;
- border: $OnePixelLine;
- border-radius: 4px;
- font-size: $MediumFont;
- color: $NormalColor;
- }
- }
- </style>
|