EndCheck.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div class="radius-base">
  3. <div class="fill-blank radius-base p-t-base">
  4. <base-form :items="items" :model="model" :label-width="useVW(66)" size="small">
  5. <template #form-item-button>
  6. <el-button type="primary" @click="onStartCheck">开始检查</el-button>
  7. </template>
  8. </base-form>
  9. </div>
  10. <div class="m-t-base flex">
  11. <div class="radius-base fill-blank p-base overflow-hidden flex-1">
  12. <div class="flex items-center m-b-base table-title">
  13. <span class="label">在评卷员手中</span>
  14. <span class="data-count">{{ unMarkPaperList?.result?.length }}</span>
  15. <el-button type="primary" size="small" @click="onTaskChangeMarker">任务指定评卷员</el-button>
  16. </div>
  17. <base-table :columns="columns1" :data="unMarkPaperList?.result" @current-change="onCheckTask"></base-table>
  18. </div>
  19. <div class="radius-base fill-blank p-base overflow-hidden m-l-base flex-1">
  20. <div class="flex items-center m-b-base table-title">
  21. <span class="label">未处理问题卷</span>
  22. <span class="data-count">{{ unProcessProblemList?.length }}</span>
  23. </div>
  24. <base-table :columns="columns2" :data="unProcessProblemList"></base-table>
  25. </div>
  26. <div class="radius-base fill-blank p-base overflow-hidden m-l-base flex-1">
  27. <div class="flex items-center m-b-base table-title">
  28. <span class="label">未处理雷同卷</span>
  29. <span class="data-count">{{ unProcessSimilarList?.length }}</span>
  30. </div>
  31. <base-table :columns="columns3" :data="unProcessSimilarList"></base-table>
  32. </div>
  33. </div>
  34. </div>
  35. <base-dialog v-model="visibleChangeMarker" title="任务指定评卷员" destroy-on-close>
  36. <base-form
  37. ref="formRef"
  38. size="small"
  39. :rules="rules"
  40. :model="changeMarkerModel"
  41. :items="changeMarkerItems"
  42. ></base-form>
  43. <template #footer>
  44. <confirm-button around @confirm="onSubmitChangeMarker" @cancel="visibleChangeMarker = false"></confirm-button>
  45. </template>
  46. </base-dialog>
  47. </template>
  48. <script setup lang="ts" name="EndCheck">
  49. /** 收尾检查 */
  50. import { reactive, ref, computed, watch } from 'vue'
  51. import { ElButton } from 'element-plus'
  52. import BaseForm from '@/components/element/BaseForm.vue'
  53. import BaseTable from '@/components/element/BaseTable.vue'
  54. import BaseDialog from '@/components/element/BaseDialog.vue'
  55. import ConfirmButton from '@/components/common/ConfirmButton.vue'
  56. import useFetch from '@/hooks/useFetch'
  57. import useOptions from '@/hooks/useOptions'
  58. import useVW from '@/hooks/useVW'
  59. import useForm from '@/hooks/useForm'
  60. import type { ExtractApiParams, ExtractMultipleApiResponse } from '@/api/api'
  61. import type { EpFormItem, EpTableColumn, EpFormRules } from 'global-type'
  62. /** 指定评卷员 */
  63. const visibleChangeMarker = ref<boolean>(false)
  64. const changeMarkerModel = reactive({ loginName: '' })
  65. const { formRef, elFormRef } = useForm()
  66. const changeMarkerItems: EpFormItem[] = [{ label: '请输入指定评卷员账号', prop: 'loginName', slotType: 'input' }]
  67. const rules: EpFormRules = {
  68. loginName: [{ required: true, message: '请输入指定评卷员账号' }],
  69. }
  70. const { mainQuestionList, groupListWithAll, onOptionInit, dataModel, changeModelValue } = useOptions([
  71. 'question',
  72. 'group',
  73. ])
  74. /** 搜索 */
  75. const model = reactive<ExtractApiParams<'unProcessProblemList'>>({
  76. markingGroupNumber: dataModel.group,
  77. questionMainNumber: dataModel.question,
  78. subjectCode: dataModel.subject || '',
  79. })
  80. const { fetch: getUnMarkPaperList, result: unMarkPaperList } = useFetch('unMarkPaperList')
  81. const { fetch: getUnProcessProblemList, result: unProcessProblemList } = useFetch('unProcessProblemList')
  82. const { fetch: getUnProcessSimilarList, result: unProcessSimilarList } = useFetch('unProcessSimilarList')
  83. watch(dataModel, () => {
  84. model.subjectCode = dataModel.subject || ''
  85. model.questionMainNumber = dataModel.question
  86. model.markingGroupNumber = dataModel.group
  87. })
  88. const { defineColumn, _ } = useForm()
  89. const OneRow = defineColumn(_, 'row-1', { span: 6 })
  90. const items = computed<EpFormItem[]>(() => [
  91. OneRow({
  92. label: '大题',
  93. prop: 'questionMainNumber',
  94. slotType: 'select',
  95. slot: {
  96. options: mainQuestionList.value,
  97. onChange: changeModelValue('question'),
  98. disabled: true,
  99. },
  100. }),
  101. OneRow({
  102. label: '小组',
  103. prop: 'markingGroupNumber',
  104. slotType: 'select',
  105. slot: {
  106. options: groupListWithAll.value,
  107. onChange: changeModelValue('group'),
  108. },
  109. }),
  110. OneRow({
  111. slotName: 'button',
  112. }),
  113. ])
  114. /** 未评卷 table */
  115. const columns1: EpTableColumn[] = [
  116. { label: '评卷员', prop: 'markerName' },
  117. { label: '密号', prop: 'secretNumber' },
  118. { label: '大题', prop: 'questionMainName' },
  119. ]
  120. /** 未处理问题卷table */
  121. const columns2: EpTableColumn[] = [
  122. { label: '密号', prop: 'secretNumber' },
  123. { label: '大题', prop: 'questionMainName' },
  124. ]
  125. /** 未处理雷同卷table */
  126. const columns3: EpTableColumn[] = [
  127. { label: '密号', prop: 'secretNumber' },
  128. { label: '雷同密号', prop: 'sameSecretNumber' },
  129. { label: '大题', prop: 'questionMainName' },
  130. ]
  131. /** 开始检查 */
  132. const onStartCheck = () => {
  133. getUnMarkPaperList({ pageNumber: 1, pageSize: 20, ...model })
  134. getUnProcessProblemList(model)
  135. getUnProcessSimilarList(model)
  136. }
  137. const currentTask = ref<ExtractMultipleApiResponse<'unMarkPaperList'>>()
  138. const onCheckTask = (row: ExtractMultipleApiResponse<'unMarkPaperList'>) => {
  139. currentTask.value = row
  140. }
  141. /** 任务指定评卷员 */
  142. const onTaskChangeMarker = () => {
  143. visibleChangeMarker.value = true
  144. }
  145. const onSubmitChangeMarker = async () => {
  146. try {
  147. const valid = await elFormRef?.value?.validate()
  148. if (valid && currentTask.value) {
  149. useFetch('changeTaskMarker')
  150. .fetch({ taskId: currentTask.value.taskId, loginName: changeMarkerModel.loginName })
  151. .then(() => {
  152. visibleChangeMarker.value = false
  153. })
  154. }
  155. } catch (error) {
  156. console.error(error)
  157. }
  158. }
  159. onOptionInit(onStartCheck)
  160. </script>
  161. <style scoped lang="scss">
  162. .table-title {
  163. .label {
  164. font-size: $SmallFont;
  165. color: $RegularFontColor;
  166. }
  167. .data-count {
  168. padding: 4px 10px;
  169. margin: 0 12px;
  170. border: $OnePixelLine;
  171. border-radius: 4px;
  172. font-size: $MediumFont;
  173. color: $NormalColor;
  174. }
  175. }
  176. </style>