|
@@ -131,6 +131,7 @@
|
|
|
import ModifyMarkerQuestion from "./ModifyMarkerQuestion";
|
|
|
import ModifyMarkArea from "./ModifyMarkArea.vue";
|
|
|
import { examStructureFindJpg, examBindMarker } from "../../api";
|
|
|
+import { cardDetail } from "../../../card/api";
|
|
|
|
|
|
export default {
|
|
|
name: "mark-paper-marker",
|
|
@@ -166,6 +167,7 @@ export default {
|
|
|
1: "双评",
|
|
|
},
|
|
|
paperList: [],
|
|
|
+ cardPages: [],
|
|
|
};
|
|
|
},
|
|
|
filters: {
|
|
@@ -177,7 +179,10 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initData();
|
|
|
- if (!this.onlyMarker) this.getPaperList();
|
|
|
+ if (!this.onlyMarker) {
|
|
|
+ this.getPaperList();
|
|
|
+ this.getCardPages();
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
async getPaperList() {
|
|
@@ -197,6 +202,11 @@ export default {
|
|
|
};
|
|
|
});
|
|
|
},
|
|
|
+ async getCardPages() {
|
|
|
+ const detData = await cardDetail(this.datas.basicPaperInfo.cardId);
|
|
|
+ const cardContent = JSON.parse(detData.content);
|
|
|
+ this.cardPages = cardContent.pages;
|
|
|
+ },
|
|
|
initData() {
|
|
|
this.groupInfo = this.datas.groupInfo.map((item, index) => {
|
|
|
return { ...item, groupNumber: index + 1 };
|
|
@@ -267,6 +277,10 @@ export default {
|
|
|
},
|
|
|
groupModified(row) {
|
|
|
const pos = this.groupInfo.findIndex((item) => item.id === row.id);
|
|
|
+ if (!row.pictureConfigList.length) {
|
|
|
+ row.pictureConfigList = this.autoParsePictureConfigList(row.questions);
|
|
|
+ }
|
|
|
+
|
|
|
if (pos === -1) {
|
|
|
this.groupInfo.push(row);
|
|
|
} else {
|
|
@@ -279,6 +293,50 @@ export default {
|
|
|
this.updateGroupMarker(row);
|
|
|
}
|
|
|
},
|
|
|
+ autoParsePictureConfigList(questions) {
|
|
|
+ if (!questions.length) return [];
|
|
|
+ let pictureConfigList = [];
|
|
|
+ const structs = questions.map(
|
|
|
+ (item) => `${item.mainNumber}_${item.subNumber}`
|
|
|
+ );
|
|
|
+ this.cardPages.forEach((page, pindex) => {
|
|
|
+ page.exchange.answer_area.forEach((area) => {
|
|
|
+ const [x, y, w, h] = area.area;
|
|
|
+ const qStruct = `${area.main_number}_${area.sub_number}`;
|
|
|
+
|
|
|
+ const pConfig = {
|
|
|
+ i: pindex + 1,
|
|
|
+ x,
|
|
|
+ y,
|
|
|
+ w,
|
|
|
+ h,
|
|
|
+ qStruct,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (typeof area.sub_number === "number") {
|
|
|
+ if (!structs.includes(qStruct)) return;
|
|
|
+ pictureConfigList.push(pConfig);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 复合区域处理,比如填空题,多个小题合并为一个区域
|
|
|
+ if (typeof area.sub_number === "string") {
|
|
|
+ const areaStructs = area.sub_number
|
|
|
+ .split(",")
|
|
|
+ .map((subNumber) => `${area.main_number}_${subNumber}`);
|
|
|
+ if (
|
|
|
+ structs.some((struct) => areaStructs.includes(struct)) &&
|
|
|
+ !pictureConfigList.find((item) => item.qStruct === qStruct)
|
|
|
+ ) {
|
|
|
+ pictureConfigList.push(pConfig);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ pictureConfigList.forEach((item) => {
|
|
|
+ delete item.qStruct;
|
|
|
+ });
|
|
|
+ return pictureConfigList;
|
|
|
+ },
|
|
|
async updateGroupMarker(group) {
|
|
|
console.log(group);
|
|
|
await examBindMarker({
|