Forráskód Böngészése

增加选择考试名单页面

dengshaobo 1 hónapja
szülő
commit
9070901ae9

BIN
src/assets/bg/first_select.png


BIN
src/assets/bg/second_select.png


BIN
src/assets/bg/thrid_select.png


+ 3 - 3
src/router/index.ts

@@ -60,9 +60,9 @@ const routes: Array<RouteRecordRaw> = [
         component: () => import('@/views/exam/scanDetail.vue')
       },
       {
-        path: 'selectStudent',
-        name: 'selectStudent',
-        component: () => import('@/views/exam/selectExamStudent.vue')
+        path: 'selectExamination',
+        name: 'selectExamination',
+        component: () => import('@/views/exam/selectExamination.vue')
       },
       {
         path: 'examList',

+ 171 - 1
src/styles/common.scss

@@ -2467,7 +2467,177 @@ body {
   }
 }
 
-.dialog_table {
+//选择模板公关样式
+.page_container {
+  background: #fff;
+  border-radius: 10px;
+  width: 100%;
+  margin: auto;
+  height: 100%;
+  background-color: #ffffff;
+
+  // padding: 40px;
+
+  .container_content {
+    width: calc(100% - 60px);
+    margin: auto;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 0px 20px;
+    position: relative;
+
+    .select_school {
+      position: absolute;
+      left: 30px;
+      top: 30px;
+    }
+
+    .content_list {
+      width: auto;
+      display: flex;
+      justify-content: flex-start;
+      align-items: center;
+      flex-wrap: nowrap;
+    }
+  }
+
+  .container_item {
+    width: calc(33% - 20px); //计算方式  总宽度 减去两边的间距 40+40  再减去中间2个间隔的20  再除以3  100% - 120
+    max-width: 358px;
+    height: auto;
+
+    /* 小屏幕笔记本的样式 常见分辨率:1366x768 */
+    @media (max-width: 1366px) {
+      margin-right: 40px;
+    }
+
+    /* 中等屏幕笔记本的样式(14-15英寸) 常见分辨率:1600x900, 1920x1080*/
+    @media (min-width: 1367px) and (max-width: 1920px) {
+      margin-right: 100px;
+    }
+
+    /* 大屏幕笔记本的样式(17-20英寸) 常见分辨率:2560x1440*/
+    @media screen and (min-width: 1920px) {
+      margin-right: 100px;
+    }
+
+    /* 高分辨率设备的样式 */
+    @media only screen and (-webkit-min-device-pixel-ratio: 2),
+    only screen and (min-resolution: 192dpi),
+    only screen and (min-resolution: 2dppx) {
+      margin-right: 120px;
+    }
+
+    .item_title {
+      font-weight: 500;
+      font-size: 16px;
+      color: #909399;
+      width: 100%;
+      line-height: 32px;
+      margin-bottom: 10px;
+    }
+
+    .item_card {
+      width: 100%;
+      min-width: 300px;
+      height: auto;
+      border-radius: 4px 4px 4px 4px;
+      border: 1px solid #e9e9e9;
+      cursor: pointer;
+
+      .card_title {
+        width: 100%;
+        height: 54px;
+        line-height: 54px;
+
+        font-weight: 500;
+        font-size: 16px;
+        color: #303133;
+        text-align: left;
+        text-indent: 16px;
+      }
+
+      .card_center {
+        width: calc(100% - 32px);
+        margin: auto;
+        // padding-top: 17.22%; /* 16:9 的宽高比,即 9/16 * 100% */
+        // padding-bottom: 17.23%;
+        height: calc((100% - 32px) * 0.3445);
+        background-repeat: no-repeat;
+        /* 设置背景图片不重复 */
+        background-size: 100% auto;
+        /* 设置背景图片的尺寸为包含整个元素 */
+        background-position: center center;
+        /* 设置背景图片居中显示 */
+        position: relative;
+
+        .span_name {
+          position: absolute;
+          left: 6px;
+          top: 30px;
+          margin-left: 5px;
+          font-size: 41px;
+          font-weight: 600;
+          color: rgba(0, 0, 0, 0.6);
+        }
+
+        img {
+          width: 100%;
+          height: auto;
+        }
+      }
+
+      .card_desc {
+        width: calc(100% - 32px);
+        margin: auto;
+        margin-top: 10px;
+        height: 50px;
+
+        font-weight: 400;
+        font-size: 14px;
+        color: #666666;
+        line-height: 14px;
+        text-align: left;
+        line-height: 18px;
+        // display: block;
+        // overflow: hidden; /* 隐藏超出容器的内容 */
+        // white-space: nowrap; /* 保持文本在一行内 单行显示 */
+        // text-overflow: ellipsis; /* 超出部分显示省略号 */
+      }
+
+      .card_button {
+        width: calc(100% - 32px);
+        margin: auto;
+        text-align: right;
+        margin-bottom: 16px;
+
+        .el-button {
+          padding: 0 !important;
+          width: 88px;
+          height: 36px;
+          line-height: 36px;
+          margin-left: 16px;
+        }
+      }
+    }
+  }
+
+  .container_item:last-child {
+    margin-right: 0px;
+  }
+
+  .container_item:hover {
+    .item_title {
+      color: #2e64fa;
+    }
+
+    .item_card {
+      border: 1px solid #2e64fa;
+      box-shadow: 0 0 20px #2e64fa;
+    }
+  }
 }
 
 //弹窗全屏

+ 1 - 1
src/views/exam/components/selectStudent.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog
     v-model="dialogVisible"
-    title="请选择考场名单"
+    title="系统名单"
     width="800px"
     class="page_dialog"
     :before-close="handleClose"

+ 1 - 1
src/views/exam/components/stepItem.vue

@@ -145,7 +145,7 @@ const activeIndex = computed(() => {
   {
     return 0
   }
-  else if(currentPath=='/exam/scanList')
+  else if(currentPath=='/exam/scanList' || currentPath=='/exam/selectExamination' || currentPath=='/exam/examList' || currentPath=='/exam/scanDetail')
   {
     return 1
   }

+ 2 - 2
src/views/exam/scanList.vue

@@ -224,7 +224,7 @@ const HasImportStudent = async () => {
         console.log("未导入学生名单,跳转到选择学生名单界面");
         //跳转导入学生名单界面
         router.push({
-            name: 'selectStudent',
+            name: 'selectExamination',
            
         });
     }
@@ -520,7 +520,7 @@ const MessageBack = (data:any) => {
             if(Number(targetItem.scannedPaperNum) === Number(targetItem.uploadNum))
             {
                 targetItem.uploadStatus=1;
-                loadingText.value='';
+                // loadingText.value='';
                 isScanning.value=false;
                 // removeBeforeUnloadListener();// 移除页面离开阻止监听器
             }

+ 264 - 107
src/views/exam/selectExamination.vue

@@ -1,138 +1,295 @@
 <template>
-  <div class="page_list">
-    
-
-  </div>
-</template>
+    <div class="page_container">
+      <div class="container_content">
+        <div class="select_school" v-if="schoolType==1">
+          选择学校:
+          <el-select  v-model="selectSchoolId" @change="ChangeSchool"  placeholder="选择学校" class="select_width" >
+            <el-option label="联校" value="" ></el-option>
+            <el-option
+                v-for="item in schoolList"
+                :key="item.schoolCode"
+                :label="item.schoolNickName || item.schoolName"
+                :value="item.schoolId">
+            </el-option>
+        </el-select>
+        </div>
+        <div class="container_item">
+          <div class="item_title">方案1</div>
+          <div class="item_card" >
+            <div class="card_title">
+              系统名单
+            </div>
+            <div class="card_center">
+              <img src="@/assets/bg/first_select.png">
+              <span class="span_name">系统名单</span>
+              
+            </div>
+            <div class="card_desc">从系统名单制作导入</div>
+            <div class="card_button">
+              <el-button class="buttom" type="primary" :disabled="schoolType==0 && examSchoolType==1" @click="OpenSystemDialog">立即使用</el-button>
+            </div>
+          </div>
+        </div>
+        <div class="container_item">
+          <div class="item_title">方案2</div>
+          <div class="item_card" >
+            <div class="card_title">
+              EXCEL导入
+            </div>
+            <div class="card_center">
+              <img src="@/assets/bg/second_select.png">
+              <span class="span_name">导入表格</span>
+            </div>
+            <div class="card_desc">以标准EXCEL模板导入        </div>
+            <div class="card_button">
+              <el-button @click="DownloadModule" class="bottom">下载模板</el-button>
+              <!-- <el-button  @click="OpenUpload" class="buttom" type="primary" :loading="uploadLoading" :disabled="schoolType==0 && examSchoolType==1">{{uploadText}}</el-button> -->
+              <el-button class="buttom" type="primary"  :disabled="true">{{uploadText}}</el-button>
+              <input ref="uploadRef" accept=".xls, .xlsx" @change="UploadFile" class="buttom" type="file" style="display: none;"></input>
+            </div>
+          </div>
+        </div>
+        <!-- 联校账号 查看联考的时候选择单校的时候 不显示历史名单 其他都显示 -->
+        <div class="container_item" >
+          <div class="item_title" v-if="!(schoolType == 1 && examSchoolType == 1 && selectSchoolId)">方案3</div>
+          <div class="item_card" v-if="!(schoolType == 1 && examSchoolType == 1 && selectSchoolId)">
+            <div class="card_title">
+              历史考试
+            </div>
+            <div class="card_center">
+              <img src="@/assets/bg/thrid_select.png">
+              <span class="span_name">复用名单</span>
+            </div>
+            <div class="card_desc">从历史考试调用考场名单</div>
+            <div class="card_button">
+              <!-- <el-button class="buttom" type="primary" @click="OpenHistoryDialog" :disabled="schoolType==0 && examSchoolType==1">立即复用</el-button> -->
+               <el-button class="buttom" type="primary"  :disabled="true">立即复用</el-button>
+            </div>
+          </div>
+        </div>
+      </div>
+      <SelectStudent v-model="showSelectStudent"  @success="StudentSuccess"></SelectStudent>
+      <!-- <SelectHistoryList ref="selectHistoryListRef" @GoToScanExamHome="GoToScanExamHome" typeValue="1" :schoolId="selectSchoolId" v-if="showHistoryList" @historyCancel="CancelHistoryDialog"></SelectHistoryList>
+      <DialogSystemQuery ref="selectSystemListRef" @GoToScanExamHome="GoToScanExamHome" :schoolId="selectSchoolId" v-if="showSystemList" @sysCancel="CancelSystemDialog"></DialogSystemQuery> -->
+    </div>
+  </template>
+  
 <script lang="ts" setup>
-import { useExamStore } from '@/store/exam'
-import { useUserStore } from '@/store/user'
-import { useRouter } from 'vue-router'
-import { onMounted ,ref,computed,onUnmounted,nextTick } from 'vue';
-import ScanButton from './components/scanButton.vue'
+import { ref, computed, onMounted, nextTick } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import SelectStudent from './components/selectStudent.vue'
-import { finishScanned,hasImportStudent,getBatchList,getCurrentBatchNo,deleteBatch,updateScanCount,setExamScanSetting,saveChooseCode} from '@/api/exam'
-import scanCommon from '@/utils/scanCommon';
-import { ElMessageBox, ElMessage } from 'element-plus'
-import { formatTimestamp } from '@/utils/common';
-import AbnormalDetail from './abnormalDetail.vue';
-import WebSocketManager from '@/utils/webSocket'//后端websocket链接js
-// 实例化 Store
-const examStore = useExamStore()
-const userStore = useUserStore()
+// import SelectHistoryList from './ReviewBlock/SelectHistoryList.vue'
+import { useExamStore } from '@/store/exam'
 
+const route = useRoute()
 const router = useRouter()
+const examStore = useExamStore()
 
-// 考试科目 ID
+// 响应式数据
+const showSystemList = ref(true)
+const showHistoryList = ref(true)
+const selectSchoolId = ref<string | number>('')
+const schoolList = ref<any[]>([])
+const uploadLoading = ref(false)
+const uploadText = ref('立即上传')
+const uploadRef = ref<HTMLInputElement | null>(null)
+const showSelectStudent = ref(false);
+const selectSystemListRef = ref<any>(null)
+
+// 计算属性
 const examSubjectId = computed(() => {
-  return examStore.currentExam?.id
-})//计算属性
-
-const userInfo=computed(() => {
-    return userStore.userInfo;
-})//用户信息
-
-const schoolType=computed(() => {
-    return ''
+  return examStore.examTempDetail?.id
 })
 
-//考试科目code
-const examSubjectCode=computed(() => {
-    return examStore.currentExam?.examSubjectCode
-})
-//当前登录人姓名
-const currentUserName=computed(() => {
-    return userStore.userName;
+const examId = computed(() => {
+  return examStore.examDetail?.id
 })
 
+const schoolType = computed(() => {
+  return examStore.userSchoolType
+})
 
+const examSchoolType = computed(() => {
+  return examStore.examDetail?.schoolType
+})
 
+// 获取考试的学校列表
+const GetExamSchoolList = () => {
+  const param = {
+    examId: examId.value,
+  }
+//   // 假设 API 在 examStore 或全局 API 中
+//   examStore.getJoinExamSchoolList(param).then((res: any) => {
+//     console.log("打印当前考试的学校列表", res)
+//     if (res.code === 200) {
+//       schoolList.value = res.data || []
+//     }
+//   })
+}
 
+// 切换学校
+const ChangeSchool = () => {
+  // 预留逻辑
+}
 
+// 下载模板
+const DownloadModule = () => {
+//   examStore.downloadModule().then((res: any) => {
+//     if (res.data) {
+//       const blobFile = res.data
+//       const url = window.URL.createObjectURL(new Blob([blobFile]))
+//       const link = document.createElement('a')
+//       link.href = url
+//       link.setAttribute('download', '导入模板.xls')
+//       document.body.appendChild(link)
+//       link.click()
+//       window.URL.revokeObjectURL(url)
+//       ElMessage({
+//         type: 'success',
+//         message: '模板下载成功'
+//       })
+//     }
+//   })
+}
 
+// 上传文件
+const UploadFile = (event: Event) => {
+  const target = event.target as HTMLInputElement
+  if (!target.files || target.files.length === 0) return
+  
+  const formdata = new FormData()
+  formdata.append('examSubjectId', examSubjectId.value as string)
+  formdata.append('reuse', (route.query.reuse as string) || '0')
+  formdata.append('file', target.files[0])
+  
+  if (selectSchoolId.value) {
+    formdata.append('schoolId', String(selectSchoolId.value))
+  }
+  
+  uploadLoading.value = true
+  uploadText.value = '上传中'
+  
+  examStore.uploadStudentList(formdata).then((res: any) => {
+    if (res.code === 200) {
+      uploadLoading.value = false
+      uploadText.value = '立即上传'
+      if (uploadRef.value) {
+        uploadRef.value.value = ''
+      }
+      router.push({ path: '/joinExamDetail/scanStudentHome' })
+    } else {
+      uploadLoading.value = false
+      uploadText.value = '立即上传'
+      if (uploadRef.value) {
+        uploadRef.value.value = ''
+      }
+      ElMessageBox.confirm(`导入失败! ${res.msg}`, '提示', {
+        confirmButtonText: '确定',
+        showCancelButton: false,
+        closeOnClickModal: false,
+        customClass: "page_dialog",
+        type: 'error'
+      }).catch(() => {})
+    }
+  })
+}
 
+// 打开上传文件弹窗
+const OpenUpload = () => {
+  if (uploadRef.value) {
+    uploadRef.value.click()
+  }
+}
 
+// 学生名单使用成
+const StudentSuccess=(data: any)=>
+{
+    console.log("学生名单使用成功",data)
+    router.push({
+      path: '/exam/scanList',
+    })
 
+}
 
+// 去到扫描首页
+const GoToScanExamHome = (data: any) => {
+  console.log("关闭弹窗", data)
+  if (route.query.reuse === '1') {
+    router.push({
+      path: '/joinExamDetail/scanStudentHome',
+      query: {
+        id: route.query.id as string,
+      }
+    })
+  } else {
+    console.log("返回事件GoToScanExamHome", data)
+    console.log("打印当前路由", route.path)
+    if (route.path === '/joinExamDetail/selectStudentList') {
+      router.push({
+        path: '/joinExamDetail/scanStudentHome',
+        query: {
+          id: route.query.id as string,
+          schoolId: selectSchoolId.value ? String(selectSchoolId.value) : undefined,
+        }
+      })
+    }
+  }
+}
 
+// 取消打开系统名单弹窗
+const CancelSystemDialog = () => {
+  showSystemList.value = false
+  nextTick(() => {
+    showSystemList.value = true
+  })
+}
 
+// 打开系统名单
+const OpenSystemDialog = () => {
+  showSelectStudent.value = true
+  console.log("打印当前选择的学校id", selectSchoolId.value)
+  if (schoolType.value === 0) {
+    selectSchoolId.value = 0
+  }
 
+}
 
+// 打开历史考试名单弹窗
+const OpenHistoryDialog = () => {
+  showHistoryList.value = true
+  nextTick(() => {
+    if (selectHistoryListRef.value) {
+      selectHistoryListRef.value.OpenDialog()
+    }
+  })
+}
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+// 关闭历史考生弹窗
+const CancelHistoryDialog = () => {
+  showHistoryList.value = false
+  nextTick(() => {
+    showHistoryList.value = true
+  })
+}
 
 onMounted(() => {
-    
-
-   
-});
-
-// 卸载时移除监听,防止内存泄漏
-onUnmounted(() => {
+  console.log("打印schoolType", schoolType.value)
+  console.log("打印examSchoolType", examSchoolType.value)
+  console.log("打印当前selectSchoolId", selectSchoolId.value)
   
-});
-</script>
- 
-<style lang="scss" scoped>
-.page_list
-{
-    width: 100%;
-    height: 100%;
-    padding: 20px;
-    background-color: #fff;
-    border-radius: 4px;
-    box-sizing: border-box;
-
-}
-
-.scan_state_title
-{
-    font-size: 14px;
-    color:#333;
-    font-weight: 400;
-
-}
-.scan_state_open
-{   margin-left: 5px;
-    font-size: 14px;
-    font-weight: 400;
-    color: #2BC644;
-     i
-    {
-        margin-right: 5px;
+  if (route.query.schoolId) {
+    if (route.query.schoolId === '-1') {
+      selectSchoolId.value = ""
+    } else {
+      selectSchoolId.value = route.query.schoolId as string
     }
-}
+  }
+  
+  GetExamSchoolList()
+})
+</script>
 
-.scan_state_close
-{
-    font-size: 14px;
-    font-weight: 400;
-    margin-left: 5px;
-    color:#F56C6C;
-    i
-    {
-        margin-right: 5px;
-    }
-    
-}
+<style lang="scss" scoped>
+// 原有样式保持不变
 </style>