chenhao 2 роки тому
батько
коміт
c81bf655a8

+ 1 - 0
.eslintrc.cjs

@@ -24,6 +24,7 @@ module.exports = {
     '@typescript-eslint/no-explicit-any': 0,
     '@typescript-eslint/no-unused-vars': 0,
     '@typescript-eslint/no-empty-interface': 0,
+    '@typescript-eslint/no-non-null-assertion': 0,
     'prettier/prettier': ['error'],
     'vue/v-slot-style': 0,
     'vue/require-explicit-emits': 0,

+ 2 - 2
server.config.ts

@@ -3,9 +3,9 @@ import type { ServerOptions } from 'vite'
 const server: ServerOptions = {
   proxy: {
     '^/?(api|file)/': {
-      // target: 'http://192.168.10.41:8200',
+      target: 'http://192.168.10.41:8200',
       // target: 'http://cet-test.markingtool.cn',
-      target: 'http://cet-dev.markingtool.cn:8200',
+      // target: 'http://cet-dev.markingtool.cn:8200',
     },
   },
 }

+ 4 - 0
src/api/api-types/system.d.ts

@@ -13,6 +13,8 @@ export namespace System {
 
   type ImportMarkingData = BaseDefine<MarkingDataImport>
 
+  type ExportStudentTask = BaseDefine<{ subjectCode: string; mainNumber: number; dayNumber: number }>
+
   /** 获取导入文件路径 */
   type GetImportFilePath = BaseDefine<
     {
@@ -121,6 +123,8 @@ export namespace System {
   >
   export interface ApiMap {
     importMarkingData: ImportMarkingData
+    /** 创建评卷分配表 */
+    exportStudentTask: ExportStudentTask
     getImportFilePath: GetImportFilePath
     importSamplePaper: ImportSamplePaper
     importRfPaper: ImportRfPaper

+ 5 - 0
src/api/system.ts

@@ -9,6 +9,11 @@ const SystemApi: DefineApiModule<System.ApiMap> = {
       'Content-Type': 'multipart/form-data',
     },
   },
+  /** 创建评卷分配表 */
+  exportStudentTask: {
+    url: '/api/student/task/export',
+    download: true,
+  },
   /** 获取培训卷RF卷评分标准路径 */
   getImportFilePath: '/api/reference/paper/file/path',
   /** 导入培训卷 */

+ 3 - 7
src/components/common/ColorPicker.vue

@@ -140,18 +140,14 @@ const onConfirm = () => {
 .color-box {
   color: $NormalColor;
   .color-list {
+    margin-left: -6px;
     .color-item {
       width: 20px;
       height: 20px;
       background-color: var(--color);
-      margin-right: 6px;
+      margin-left: 6px;
+      margin-bottom: 9px;
       transition: scale 0.1s linear;
-      &:nth-child(8n) {
-        margin-right: 0;
-      }
-      &:nth-child(n + 9) {
-        margin-top: 6px;
-      }
       &:hover {
         transform: scale(1.15);
       }

+ 3 - 3
src/components/shared/ScoringPanel.vue

@@ -24,7 +24,7 @@
       </template>
     </div>
     <template #footer>
-      <el-button type="primary" class="full-w m-t-base" :disabled="!allowSubmit" @click="onSubmit">确定</el-button>
+      <el-button type="primary" class="full-w m-t-base" :disabled="!allowSubmit" @click="onEnter(0)">确定</el-button>
     </template>
   </scoring-panel-container>
 </template>
@@ -82,7 +82,7 @@ const modalVisible = useVModel(props, 'visible')
 
 const scoreValues = useVModel(props, 'score')
 
-const activeIndex = ref<number>(0)
+const activeIndex = ref<number | null>(null)
 
 const scoreValidFail = ref<boolean[]>([])
 
@@ -121,7 +121,7 @@ const questionList = computed(() => {
 })
 
 const allowSubmit = computed(() => {
-  return questionList.value?.length && scoreValues.value?.length === questionList.value?.length
+  return scoreValues.value?.length === questionList.value?.length
 })
 
 const getClass = (val: string, callback?: string) => {

+ 6 - 4
src/components/shared/ScoringPanelItem.vue

@@ -65,7 +65,7 @@
 import { watch, computed, ref, nextTick, withDefaults, defineComponent, useSlots } from 'vue'
 import SvgIcon from '@/components/common/SvgIcon.vue'
 import useVModel from '@/hooks/useVModel'
-import { getNumbers, isDefine } from '@/utils/common'
+import { getNumbers } from '@/utils/common'
 
 interface QuestionInfo {
   mainNumber: number
@@ -131,7 +131,7 @@ const refInput1 = ref<HTMLInputElement>()
 const refInput2 = ref<HTMLInputElement>()
 
 watch(
-  props,
+  () => props.active,
   () => {
     nextTick(() => {
       if (props.active) {
@@ -141,7 +141,7 @@ watch(
       }
     })
   },
-  { immediate: true, deep: true }
+  { immediate: true }
 )
 
 const getClass = (val: string, callback?: string) => {
@@ -333,11 +333,13 @@ const onToggleClick = () => {
     font-size: 32px;
     outline: none;
     margin-left: 6px;
+    overflow: hidden;
     .score-input {
       background: inherit;
       color: inherit;
       font-size: inherit;
-      width: 100%;
+      width: 100% !important;
+      height: 100%;
     }
   }
 

+ 21 - 2
src/modules/admin-data/marking/index.vue

@@ -39,6 +39,7 @@
             cancel-text="创建评卷分配表"
             :loading="loading"
             @confirm="onSubmit"
+            @cancel="exportMarkTasks"
           ></confirm-button>
         </el-form-item>
       </base-form>
@@ -183,8 +184,8 @@ async function onSubmit() {
       await fetch(model)
       setPercentage(100)
       ElMessage.success(`导入成功`)
-      elFormRef?.value?.resetFields()
-      reset()
+      // elFormRef?.value?.resetFields()
+      // reset()
     }
   } catch (error) {
     showProgress.value = false
@@ -192,6 +193,24 @@ async function onSubmit() {
     console.error(error)
   }
 }
+
+async function exportMarkTasks() {
+  try {
+    const subjectCodeValid = await elFormRef?.value?.validateField('subjectCode')
+    const mainNumberValid = await elFormRef?.value?.validateField('mainNumber')
+    const dayNumberValid = await elFormRef?.value?.validateField('dayNumber')
+    subjectCodeValid &&
+      mainNumberValid &&
+      dayNumberValid &&
+      (await useFetch('exportStudentTask').fetch({
+        subjectCode: model.subjectCode,
+        dayNumber: model.dayNumber!,
+        mainNumber: model.mainNumber!,
+      }))
+  } catch (error) {
+    console.error(error)
+  }
+}
 </script>
 
 <style scoped lang="scss"></style>

+ 1 - 1
src/modules/analysis/view-marked-detail/index.vue

@@ -75,7 +75,7 @@
 /** 提取阅卷明细 */
 import { ref, computed } from 'vue'
 import { useRoute } from 'vue-router'
-import { ElButton } from 'element-plus'
+import { ElButton, ElPagination } from 'element-plus'
 import { useSetImgBg } from '@/hooks/useSetImgBg'
 import useFetch from '@/hooks/useFetch'
 import useTable from '@/hooks/useTable'

+ 1 - 1
src/modules/expert/standard/index.vue

@@ -91,7 +91,7 @@ const { mainQuestionList, dataModel, changeModelValue, onOptionInit } = useOptio
 
 const formModel = reactive<ExtractApiParams<'getStandardList'>>({
   mainNumber: dataModel.question,
-  dispensed: true,
+  dispensed: false,
   scoreStart: '',
   scoreEnd: '',
   pageNumber: 1,