|
|
@@ -77,14 +77,13 @@
|
|
|
<span>
|
|
|
识别号:
|
|
|
<el-select v-model="params.batchNo" placeholder="请选择" @change="GoSearch()" style="width: 120px;">
|
|
|
- <el-option label="全部状态" value=""></el-option>
|
|
|
- <el-option v-for="item in batchList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ <el-option v-for="item in scanIdentifyList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="right_center">
|
|
|
- <div class="scan_buttons" @click="OpenScan">
|
|
|
- <ScanButton></ScanButton>
|
|
|
+ <div class="scan_buttons">
|
|
|
+ <ScanButton @click="OpenScan()"></ScanButton>
|
|
|
</div>
|
|
|
<div class="scan_list">
|
|
|
<div class="list_item no_scan" >
|
|
|
@@ -148,9 +147,9 @@ import { useRouter } from 'vue-router'
|
|
|
import { onMounted ,ref,computed,onUnmounted,nextTick } from 'vue';
|
|
|
import ScanButton from './components/scanButton.vue'
|
|
|
import SelectStudent from './components/selectStudent.vue'
|
|
|
-import { hasImportStudent, } from '@/api/exam'
|
|
|
+import { hasImportStudent,getBatchList } from '@/api/exam'
|
|
|
import scanCommon from '@/utils/scanCommon';
|
|
|
-
|
|
|
+import { ElMessageBox, ElMessage } from 'element-plus'
|
|
|
|
|
|
// 实例化 Store
|
|
|
const examStore = useExamStore()
|
|
|
@@ -166,17 +165,73 @@ const params=ref({
|
|
|
keyWord:''
|
|
|
})
|
|
|
|
|
|
-const batchList=[];
|
|
|
+const batchList=ref([]);//批次列表
|
|
|
const listMode=ref('list');
|
|
|
const scanClientStates=ref(false);//客户端状态
|
|
|
const tableData=ref([]);
|
|
|
|
|
|
const tableHeight=ref(500);
|
|
|
-
|
|
|
+const scanIdentifyList=[
|
|
|
+ {
|
|
|
+ label:'考号',
|
|
|
+ value:'2',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label:'学号',
|
|
|
+ value:'1',
|
|
|
+ }
|
|
|
+];//识别号列表
|
|
|
|
|
|
const isImportStudent=ref(false);//是否导入了学生名单
|
|
|
const showSelectStudent=ref(false);//是否显示选择学生名单弹窗
|
|
|
|
|
|
+//刷新
|
|
|
+const Refresh = () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//重新识别弹窗
|
|
|
+const OpenReIdentify=() => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//开始扫描
|
|
|
+const OpenScan = () => {
|
|
|
+ //判断客户端是否已经连接
|
|
|
+ if(scanClientStates.value)
|
|
|
+ {
|
|
|
+ //一打开客户端
|
|
|
+ console.log('客户端已打开,开始扫描');
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //提示客户端未打开
|
|
|
+ ElMessage.warning('请先打开客户端');
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const GotoDetail = (type: number) => {
|
|
|
+ //根据类型跳转到不同的详情页
|
|
|
+ // switch (type) {
|
|
|
+ // case 0:
|
|
|
+ // router.push({
|
|
|
+ // path: '/exam/noScanList',
|
|
|
+ // query: {
|
|
|
+ // examSubjectId: examSubjectId.value,
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 1:
|
|
|
+ // router.push({
|
|
|
+ // path: '/exam/uploadedList',
|
|
|
+ // query: {
|
|
|
+ // examSubjectId: examSubjectId.value,
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+}
|
|
|
+
|
|
|
// 打开导入学生名单
|
|
|
const OpenImportStudent = () => {
|
|
|
showSelectStudent.value=true;
|
|
|
@@ -218,6 +273,20 @@ const HasImportStudent = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//获取扫描批次列表
|
|
|
+const GetScanBatchList=async()=>{
|
|
|
+ const params = {
|
|
|
+ examSubjectId: examSubjectId.value,
|
|
|
+ schoolId: 0,//单校 0
|
|
|
+ };
|
|
|
+ const res = await getBatchList(params);
|
|
|
+ if(res.code==200)
|
|
|
+ {
|
|
|
+ batchList.value=res.data;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//计算高度的函数
|
|
|
const CalculateTableHeight = () => {
|
|
|
@@ -254,7 +323,8 @@ onMounted(() => {
|
|
|
console.warn('当前没有选中的考试信息')
|
|
|
// 可选:如果没有数据,可以重定向回列表页或提示用户
|
|
|
}
|
|
|
- HasImportStudent();
|
|
|
+ HasImportStudent();//查询是否导入了学生名单
|
|
|
+ GetScanBatchList();//获取扫描批次列表
|
|
|
// 初始化计算
|
|
|
CalculateTableHeight();
|
|
|
|