|
|
@@ -54,7 +54,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content_canvas">
|
|
|
- <PositionCanvas ref="PositionCanvas" :usedCardType="usedCardType" :positionList="sourcePoints" :paperImgUrl="currentTemplateUrl" @GetCutPosition="GetCutTemaplatePosition" :paperType="usedCardType==1?'template':'student'" v-if="currentTemplateUrl"> </PositionCanvas>
|
|
|
+ <PositionCanvas :usedCardType="usedCardType" :positionList="sourcePoints" :paperImgUrl="currentTemplateUrl" @GetCutPosition="GetCutTemaplatePosition" paperType="'template'" v-if="currentTemplateUrl"> </PositionCanvas>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="paper_content">
|
|
|
@@ -72,7 +72,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content_canvas">
|
|
|
- <PositionCanvas ref="PaperCanvas" :usedCardType="usedCardType" :positionList="targetPoints" :paperImgUrl="currentPaperUrl" @GetCutPosition="GetCutStudentPosition" paperType="student" v-if="currentPaperUrl"> </PositionCanvas>
|
|
|
+ <PositionCanvas :usedCardType="usedCardType" :positionList="targetPoints" :paperImgUrl="currentPaperUrl" @GetCutPosition="GetCutStudentPosition" paperType="student" v-if="currentPaperUrl"> </PositionCanvas>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -412,7 +412,7 @@ const currentPageInfo = ref<any>({}) // 当前页面信息
|
|
|
const usedCardType = ref(2) // 1 系统卡 2 三方卡 默认2
|
|
|
const sourcePoints = ref<any[]>([]) // 模板点位
|
|
|
const targetPoints = ref<any[]>([]) // 学生点位
|
|
|
-const currentTemplateList = ref<any[]>([]) // 模板页码列表
|
|
|
+const currentTemplateList = ref<any[]>([]) // 模板数据
|
|
|
|
|
|
//客观题异常相关
|
|
|
const currentQuestionList= ref<any[]>([]);//客观题题目异常校正列表
|
|
|
@@ -485,6 +485,7 @@ const AbnormalChanage = (type: number) => {
|
|
|
console.log('试卷图片列表',currentPaperList.value)
|
|
|
currentPaperUrl.value=currentPaperList.value[0].recognizeUrl;//当前图片地址
|
|
|
}
|
|
|
+ GetTemplateDetail();//调用模板数据
|
|
|
}
|
|
|
|
|
|
//考号异常 3
|
|
|
@@ -499,6 +500,10 @@ const AbnormalChanage = (type: number) => {
|
|
|
currentPaperUrl.value=currentPaperList.value[0].recognizeUrl;//当前图片地址
|
|
|
currentImagePageNo.value=currentPaperList.value[0].pageNo;//当前图片的页码
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ClearCurrentData();
|
|
|
+ }
|
|
|
}
|
|
|
//客观题异常
|
|
|
if(type==4)
|
|
|
@@ -519,11 +524,24 @@ const AbnormalChanage = (type: number) => {
|
|
|
console.log('客观题异常',currentItem.value)
|
|
|
ObjectDataChange();//客观题答案回显
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ClearCurrentData();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
CalculateTableHeight();//计算表格高度
|
|
|
}
|
|
|
|
|
|
+//当前数据数据重置
|
|
|
+const ClearCurrentData = () => {
|
|
|
+ currentIndex.value = 0;//重置索引
|
|
|
+ currentItem.value={};//当前学生数据
|
|
|
+ currentPaperList.value=[];//试卷图片列表
|
|
|
+ currentPaperUrl.value="";//当前图片地址
|
|
|
+ currentQuestionList.value=[];//清空客观题数据
|
|
|
+}
|
|
|
+
|
|
|
// 2. 刷新异常列表
|
|
|
const RefreshAbnormalList = () => {
|
|
|
// TODO: 调用接口刷新当前 abnormalType 的数据
|
|
|
@@ -542,10 +560,107 @@ const ShowDrawData = () => {
|
|
|
// TODO: 更新 ActionImage 的 drawData 显示状态
|
|
|
}
|
|
|
|
|
|
-// 5. 客观题答案回显数据设置切换
|
|
|
+// 5. 客观题答案回显数据设置切换 客观题数据处理 客观题回显
|
|
|
const ObjectDataChange = () => {
|
|
|
// TODO: 根据 isShowDrawType 重新渲染右侧列表或 Canvas
|
|
|
console.log('客观题答案回显', )
|
|
|
+ console.log("打印模板数据",currentTemplateList.value);
|
|
|
+ let questionList=currentTemplateList.value[0].examCardGroupVOS;//选择题判分就一页
|
|
|
+ console.log("打印客观题模板数据",questionList);
|
|
|
+ const drawList: any[] = [];
|
|
|
+ questionList.forEach((item:any, index:number) => {
|
|
|
+
|
|
|
+ console.log("打印第"+index+"个切块数据",item);
|
|
|
+ if (item.position) {
|
|
|
+ let position = JSON.parse(item.position);
|
|
|
+ let unit = 'px';//默认px单位
|
|
|
+ let topiclist = [];
|
|
|
+ if(item.groupTopicList)
|
|
|
+ {
|
|
|
+ //处理答案数据
|
|
|
+ item.groupTopicList.forEach((topic:any) => {
|
|
|
+ let answerItem=currentQuestionList.value.find(questionItem => questionItem.objectiveName == topic.topicName);
|
|
|
+ console.log("打印topic",topic);
|
|
|
+ console.log("打印currentQuestionList", currentQuestionList.value);
|
|
|
+ console.log("打印answerItem",answerItem);
|
|
|
+ let answerList=JSON.parse(topic.optionJsons);
|
|
|
+ console.log("打印answerList",answerList);
|
|
|
+ topic.answerList=answerList;
|
|
|
+ if(answerItem)
|
|
|
+ {
|
|
|
+ if(answerItem.selectValue)
|
|
|
+ {
|
|
|
+ // 将多个字母拆分成数组
|
|
|
+ // const answerLetters = answerItem.selectValue.split('');
|
|
|
+ // 将多个字母拆分成数组(兼容多种分隔符)
|
|
|
+ const answerLetters = answerItem.selectValue.match(/[A-Za-z]/g) || [];
|
|
|
+ // console.log('answerLetters',answerLetters);
|
|
|
+ answerLetters.forEach((letter:any) => {
|
|
|
+ let answerIndex = GetAnswerIndexToLetter(letter);
|
|
|
+ if(topic.topicType==3)
|
|
|
+ {
|
|
|
+ //判断题
|
|
|
+ answerIndex=GetAnswerIndexToLetterTF(letter);
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("打印answerIndex", answerIndex);
|
|
|
+ if (answerIndex !== -1 && topic.answerList[answerIndex]) {
|
|
|
+ topic.answerList[answerIndex].isCheck = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if(answerItem.hasAbnormal==1)
|
|
|
+ {
|
|
|
+ //异常的背景显示红色
|
|
|
+ topic.hasAbnormal=true;//是否异常
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.groupTopicList[0].answerList
|
|
|
+ topiclist=item.groupTopicList;
|
|
|
+ }
|
|
|
+
|
|
|
+ var obj = {
|
|
|
+ x: position.x,
|
|
|
+ y: position.y,
|
|
|
+ w: position.w,
|
|
|
+ h: position.h,
|
|
|
+ position: item.position,
|
|
|
+ blockArea: item.blockArea,
|
|
|
+ page: 1,//选择题就一页 默认1
|
|
|
+ blockName: item.name,
|
|
|
+ id: item.groupId,
|
|
|
+ unit: unit,//单位
|
|
|
+ usedCardType:2,//默认三方卡 选择题,
|
|
|
+ areaOption: item.groupConfig,//添加选择题设置信息
|
|
|
+ topiclist: topiclist,
|
|
|
+ };
|
|
|
+ // 1 全部区域 2 定位区 3 标题区 4 学号区 5 姓名区 6 缺考区 7 AB卷区 8 客观题区 9 选做题区
|
|
|
+
|
|
|
+
|
|
|
+ drawList.push(obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ currentDrawData.value=drawList;
|
|
|
+ console.log("打印客观题画框数据",currentDrawData.value);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 根据字母转换成索引
|
|
|
+const GetAnswerIndexToLetter = (value: string) => {
|
|
|
+ const letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
|
|
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
|
|
|
+ return letters.findIndex(letter => letter == value);
|
|
|
+}
|
|
|
+
|
|
|
+// 判断题的
|
|
|
+const GetAnswerIndexToLetterTF = (value: string) => {
|
|
|
+ const letters = ['T', 'F'];
|
|
|
+ return letters.findIndex(letter => letter == value);
|
|
|
}
|
|
|
|
|
|
// 6. 模板页码切换
|
|
|
@@ -1197,14 +1312,14 @@ const ObjectiveCheck = async () => {
|
|
|
console.log("打印学生列表", studentList)
|
|
|
console.log("打印当前学生索引", currentIndex.value)
|
|
|
|
|
|
- // if (currentIndex.value < studentList.length - 1) {
|
|
|
- // if(rightTab.value === 'processed') {
|
|
|
- // currentIndex.value = currentIndex.value + 1
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // console.log("已经是最后一个学生")
|
|
|
- // currentIndex.value = 0
|
|
|
- // }
|
|
|
+ if (currentIndex.value < studentList.length - 1) {
|
|
|
+ if(rightTab.value === 'processed') {
|
|
|
+ currentIndex.value = currentIndex.value + 1
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("已经是最后一个学生")
|
|
|
+ currentIndex.value = 0
|
|
|
+ }
|
|
|
console.log("打印当前索引", currentIndex.value)
|
|
|
GetAbnormalList()
|
|
|
} else {
|
|
|
@@ -1313,8 +1428,28 @@ const GetAbnormalList = async () => {
|
|
|
if(res.data.abnormalGroupVO.objectiveAbnormal)
|
|
|
{
|
|
|
objectData.value.pendingList = res.data.abnormalGroupVO.objectiveAbnormal || [];
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //清空数据
|
|
|
+ objectData.value.pendingList = [];
|
|
|
+ currentIndex.value = 0;
|
|
|
+ currentItem.value={};//当前学生数据
|
|
|
+ currentPaperList.value=[];//试卷图片列表
|
|
|
+ currentPaperUrl.value="";//当前图片地址
|
|
|
+ currentQuestionList.value=[];//清空客观题数据
|
|
|
+
|
|
|
+ }
|
|
|
+ if(res.data.abnormalGroupVO.dealObjectiveAbnormal)
|
|
|
+ {
|
|
|
objectData.value.processedList = res.data.abnormalGroupVO.dealObjectiveAbnormal || [];
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ objectData.value.processedList = [];
|
|
|
+ currentIndex.value = 0;
|
|
|
+ }
|
|
|
|
|
|
abnormalObj.value={
|
|
|
locationErrorNum: positionData.value.pendingList.length, // 定位异常数量
|
|
|
@@ -1349,6 +1484,20 @@ const GetTemplateDetail = async () => {
|
|
|
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;
|
|
|
+ })
|
|
|
|
|
|
|
|
|
|