|
|
@@ -50,7 +50,7 @@
|
|
|
标准模板
|
|
|
</div>
|
|
|
<div class="header_right">
|
|
|
- <div :class="item.pageNum==currentTemplatePageIndex?'page_num_active':'page_num_item'" v-for="(item,index) in currentTemplateList" :key="'template_'+index" @click="ChangeTemplatePage(item)">{{item.pageNum}}</div>
|
|
|
+ <div :class="item.pageNum==currentTemplatePageIndex?'page_num_active':'page_num_item'" v-for="(item,index) in templateList" :key="'template_'+index" @click="ChangeTemplatePage(item)">{{item.pageNum}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content_canvas">
|
|
|
@@ -329,7 +329,7 @@ import { useExamStore } from '@/store/exam'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { onMounted,onUnmounted, ref, computed, nextTick, watch } from 'vue';
|
|
|
import { ElMessage,ElMessageBox } from 'element-plus'
|
|
|
-import { getExamAbnormalList,getSearchScanStudents,claimAnswerCard, correctObjectiveQuestion,markPositionAbnormal, deletePaper ,reRecognizePosition,getTemplateDetail} from '@/api/exam'
|
|
|
+import { getExamAbnormalList,getSearchScanStudents,claimAnswerCard, correctObjectiveQuestion,markPositionAbnormal, deletePaper ,reRecognizePosition} from '@/api/exam'
|
|
|
|
|
|
// 引入子组件 (确保路径正确)
|
|
|
import PositionCanvas from '@/components/PositionCanvas.vue'
|
|
|
@@ -341,6 +341,14 @@ import AddStudent from '../components/addStudent.vue' // 新增学生弹窗
|
|
|
const examStore = useExamStore()
|
|
|
const router = useRouter()
|
|
|
|
|
|
+// 定义 Props
|
|
|
+const props = defineProps({
|
|
|
+ templateList: {
|
|
|
+ type: Array as () => any[],
|
|
|
+ default: () => [],
|
|
|
+ }, // 模板数据(由父组件统一获取并传入)
|
|
|
+})
|
|
|
+
|
|
|
// ==================== 考试通用数据(可追加)====================
|
|
|
// 考试科目 ID
|
|
|
const examSubjectId = computed(() => {
|
|
|
@@ -420,7 +428,7 @@ const showAddStudent=ref(false);//新增学生弹窗
|
|
|
const usedCardType = ref(2) // 1 系统卡 2 三方卡 默认2
|
|
|
const sourcePoints = ref<any[]>([]) // 模板点位
|
|
|
const targetPoints = ref<any[]>([]) // 学生点位
|
|
|
-const currentTemplateList = ref<any[]>([]) // 模板数据
|
|
|
+// 模板数据已提升至父组件 abnormalDetail.vue,通过 props.templateList 传入
|
|
|
|
|
|
//客观题异常相关
|
|
|
const currentQuestionList= ref<any[]>([]);//客观题题目异常校正列表
|
|
|
@@ -601,8 +609,8 @@ const ShowDrawData = () => {
|
|
|
const ObjectDataChange = () => {
|
|
|
// TODO: 根据 isShowDrawType 重新渲染右侧列表或 Canvas
|
|
|
console.log('客观题答案回显', )
|
|
|
- console.log("打印模板数据",currentTemplateList.value);
|
|
|
- let questionList=currentTemplateList.value[0].examCardGroupVOS;//选择题判分就一页
|
|
|
+ console.log("打印模板数据",props.templateList);
|
|
|
+ let questionList=props.templateList[0].examCardGroupVOS;//选择题判分就一页
|
|
|
console.log("打印客观题模板数据",questionList);
|
|
|
const drawList: any[] = [];
|
|
|
questionList.forEach((item:any, index:number) => {
|
|
|
@@ -851,7 +859,7 @@ const SavePositionImage = () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- console.log("打印当前的模板页",currentTemplateList.value);
|
|
|
+ console.log("打印当前的模板页",props.templateList);
|
|
|
console.log("打印当前的模板页码",currentTemplatePageIndex.value);
|
|
|
console.log("打印当前currentPaperList",currentPaperList.value);
|
|
|
console.log("打印当前图片的地址",currentPaperUrl.value);
|
|
|
@@ -1663,38 +1671,7 @@ const GetAbnormalList = async () => {
|
|
|
|
|
|
}
|
|
|
|
|
|
-//获取模板详情
|
|
|
-const GetTemplateDetail = async () => {
|
|
|
- const params={
|
|
|
- examSubjectId: examSubjectId.value,//考试id
|
|
|
- };
|
|
|
- const res = await getTemplateDetail(params);
|
|
|
- console.log("打印模板数据",res);
|
|
|
- if(res.code == 200)
|
|
|
- {
|
|
|
- currentTemplateList.value=[];
|
|
|
- res.data.forEach((item:any)=>{
|
|
|
- let obj={
|
|
|
- examCardGroupVOS: item.examCardGroupVOS,
|
|
|
- pageNo: item.pageNo,
|
|
|
- paperInfo: item.paperInfo,
|
|
|
- templateUrl: item.templateUrl,
|
|
|
- pageNum: item.pageNo,
|
|
|
-
|
|
|
- };
|
|
|
- currentTemplateList.value.push(obj);
|
|
|
- currentTemplatePageIndex.value=currentTemplateList.value[0].pageNum;
|
|
|
- currentTemplateUrl.value=item.templateUrl;
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
+//获取模板详情(已提升至父组件 abnormalDetail.vue,通过 props.templateList 传入)
|
|
|
|
|
|
// ==================== 生命周期 ====================
|
|
|
|
|
|
@@ -1707,7 +1684,11 @@ onMounted(() => {
|
|
|
// LoadAbnormalList(abnormalType.value)
|
|
|
}
|
|
|
GetAbnormalList();
|
|
|
- GetTemplateDetail();//获取模板数据
|
|
|
+ // 从 props 初始化模板页码和模板图片地址
|
|
|
+ if (props.templateList && props.templateList.length > 0) {
|
|
|
+ currentTemplatePageIndex.value = props.templateList[0].pageNum;
|
|
|
+ currentTemplateUrl.value = props.templateList[0].templateUrl;
|
|
|
+ }
|
|
|
// 监听窗口变化调整高度
|
|
|
window.addEventListener('resize', CalculateTableHeight)
|
|
|
CalculateTableHeight()
|