|
@@ -1,10 +1,14 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <!-- <el-form>
|
|
|
+ <el-form>
|
|
|
<el-form-item label="启用AB卷:">
|
|
|
- <el-switch v-model="examTask.openAb" @change="openAbChange"></el-switch>
|
|
|
+ <el-switch
|
|
|
+ v-model="openAb"
|
|
|
+ :disabled="!this.taskStatus.IS_APPLY"
|
|
|
+ @change="openAbChange"
|
|
|
+ ></el-switch>
|
|
|
</el-form-item>
|
|
|
- </el-form> -->
|
|
|
+ </el-form>
|
|
|
<!-- menu -->
|
|
|
<div
|
|
|
v-if="checkPrivilege('button', 'SelectTikuPaper', 'TaskApplyManage')"
|
|
@@ -22,9 +26,9 @@
|
|
|
<!-- table -->
|
|
|
<table class="table mb-2">
|
|
|
<colgroup>
|
|
|
- <col width="90" />
|
|
|
+ <col width="80" />
|
|
|
<col width="60" />
|
|
|
- <col width="240" />
|
|
|
+ <col width="200" />
|
|
|
<col />
|
|
|
<col v-if="taskStatus.IS_APPLY && !taskStatus.IS_REBUILD" width="80" />
|
|
|
</colgroup>
|
|
@@ -50,9 +54,9 @@
|
|
|
:rowspan="paperAttachment.paperAttachmentIds.length"
|
|
|
>
|
|
|
卷{{ paperAttachment.serialNumber }}
|
|
|
- <!-- <span class="color-gray-2" v-if="paperAttachment.isExposed"
|
|
|
+ <span class="color-gray-2" v-if="paperAttachment.exposed"
|
|
|
>(已曝光)</span
|
|
|
- > -->
|
|
|
+ >
|
|
|
</td>
|
|
|
<td>
|
|
|
<span>{{ attachment.name }}</span>
|
|
@@ -60,7 +64,7 @@
|
|
|
<template v-if="IS_TIKU_TAB">
|
|
|
<!-- 试卷文件 -->
|
|
|
<td>
|
|
|
- <template v-if="!attachment.isExposed && taskStatus.IS_APPLY">
|
|
|
+ <template v-if="!paperAttachment.exposed && taskStatus.IS_APPLY">
|
|
|
<div class="box-justify">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -169,7 +173,7 @@
|
|
|
<!-- 试卷文件 -->
|
|
|
<td>
|
|
|
<el-button
|
|
|
- v-if="!attachment.isExposed && taskStatus.IS_APPLY"
|
|
|
+ v-if="!paperAttachment.exposed && taskStatus.IS_APPLY"
|
|
|
type="text"
|
|
|
class="btn-primary"
|
|
|
@click="toUpload(attachment)"
|
|
@@ -335,7 +339,7 @@
|
|
|
@click="addAtachment"
|
|
|
></el-button>
|
|
|
<el-button
|
|
|
- v-if="attachment.canDelete"
|
|
|
+ v-if="!paperAttachment.exposed"
|
|
|
class="btn-danger btn-icon"
|
|
|
type="text"
|
|
|
icon="el-icon-remove"
|
|
@@ -504,6 +508,7 @@ export default {
|
|
|
curTab: "upload",
|
|
|
uuid: "",
|
|
|
user: {},
|
|
|
+ openAb: false,
|
|
|
paperConfirmAttachmentId: {
|
|
|
attachmentId: "",
|
|
|
filename: "",
|
|
@@ -557,34 +562,39 @@ export default {
|
|
|
...mapActions("exam", ["addPreviewLog"]),
|
|
|
initData() {
|
|
|
this.user = this.$ls.get("user", {});
|
|
|
- this.paperAttachments = this.curTaskApply.paperAttachmentIds
|
|
|
- ? JSON.parse(this.curTaskApply.paperAttachmentIds)
|
|
|
- : [];
|
|
|
+ this.paperAttachments = (this.curTaskApply.examTaskDetailList || []).map(
|
|
|
+ (item) => {
|
|
|
+ const paperAttachmentIds = item.paperAttachmentIds
|
|
|
+ ? JSON.parse(item.paperAttachmentIds)
|
|
|
+ : [];
|
|
|
+ paperAttachmentIds.forEach((aitem) => {
|
|
|
+ aitem.serialNumber = item.serialNumber;
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ paperAttachmentIds,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.openAb = this.examTask.openAb;
|
|
|
|
|
|
if (!this.paperAttachments.length) {
|
|
|
this.addAtachment();
|
|
|
}
|
|
|
|
|
|
- const pAttachment = this.paperAttachments.some((item) => !!item.paperId);
|
|
|
+ const pAttachment = this.paperAttachments.some((item) =>
|
|
|
+ item.paperAttachmentIds.some((p) => !!p.paperId)
|
|
|
+ );
|
|
|
if (pAttachment) {
|
|
|
this.curTab = "tiku";
|
|
|
- this.uuid = pAttachment.uuid || this.$randomCode(32);
|
|
|
+ this.uuid =
|
|
|
+ this.paperAttachments[0]?.paperAttachments[0]?.uuid ||
|
|
|
+ this.$randomCode(32);
|
|
|
} else {
|
|
|
this.curTab = "upload";
|
|
|
this.uuid = this.$randomCode(32);
|
|
|
}
|
|
|
|
|
|
- const exposedPaperType = this.curTaskApply.exposedPaperType || "";
|
|
|
- let exposedPaperTypes = exposedPaperType.split(",");
|
|
|
- exposedPaperTypes.sort((a, b) => (a > b ? -1 : 1));
|
|
|
- const maxExposedPaperType = exposedPaperTypes[0];
|
|
|
- this.paperAttachments.forEach((paper) => {
|
|
|
- paper.canDelete = maxExposedPaperType
|
|
|
- ? paper.name > maxExposedPaperType
|
|
|
- : true;
|
|
|
- paper.isExposed = exposedPaperTypes.includes(paper.name);
|
|
|
- });
|
|
|
-
|
|
|
this.paperConfirmAttachments = this.curTaskApply.paperConfirmAttachmentIds
|
|
|
? JSON.parse(this.curTaskApply.paperConfirmAttachmentIds)
|
|
|
: [];
|
|
@@ -594,7 +604,7 @@ export default {
|
|
|
openAbChange() {
|
|
|
if (!this.taskStatus.IS_APPLY) return;
|
|
|
|
|
|
- if (this.examTask.openAb) {
|
|
|
+ if (this.openAb) {
|
|
|
this.paperAttachments.forEach((paperAttachment) => {
|
|
|
const attachment = paperAttachment.paperAttachmentIds[0];
|
|
|
paperAttachment.paperAttachmentIds.push(
|
|
@@ -614,6 +624,9 @@ export default {
|
|
|
paperAttachment.paperAttachmentIds.slice(0, 1);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ this.setExamTask({ ...this.examTask, openAb: this.openAb });
|
|
|
+ this.setCurTaskApply({ ...this.curTaskApply, openAb: this.openAb });
|
|
|
},
|
|
|
async selectMenu(tab) {
|
|
|
if (!this.taskStatus.IS_APPLY) return;
|
|
@@ -788,6 +801,7 @@ export default {
|
|
|
courseName: this.curTaskApply.courseName,
|
|
|
makeMethod: this.curTaskApply.makeMethod,
|
|
|
cardRuleId: this.curTaskApply.cardRuleId,
|
|
|
+ openAb: this.examTask.openAb,
|
|
|
type: attachment.cardType,
|
|
|
createMethod: attachment.createMethod,
|
|
|
});
|
|
@@ -884,6 +898,7 @@ export default {
|
|
|
this.$ls.set("prepareTcPCard", {
|
|
|
courseId: this.examTask.courseId,
|
|
|
courseName: this.examTask.courseName,
|
|
|
+ openAb: this.examTask.openAb,
|
|
|
schoolName: this.$ls.get("schoolName"),
|
|
|
makeMethod: "SELF",
|
|
|
cardName: res.value,
|
|
@@ -1007,12 +1022,14 @@ export default {
|
|
|
},
|
|
|
// action
|
|
|
getData() {
|
|
|
- // TODO:
|
|
|
- let data = { ...this.curTaskApply };
|
|
|
- data.paperType = this.paperAttachments.map((item) => item.name).join(",");
|
|
|
- data.paperAttachmentIds = JSON.stringify(this.paperAttachments, (k, v) =>
|
|
|
- k === "url" ? undefined : v
|
|
|
- );
|
|
|
+ this.updateExamTaskDetail();
|
|
|
+ const data = { ...this.curTaskApply };
|
|
|
+ data.examTaskDetailList = this.paperAttachments.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ paperAttachmentIds: JSON.stringify(item.paperAttachmentIds),
|
|
|
+ };
|
|
|
+ });
|
|
|
data.paperConfirmAttachmentIds = JSON.stringify(
|
|
|
this.paperConfirmAttachments
|
|
|
);
|
|
@@ -1032,15 +1049,9 @@ export default {
|
|
|
});
|
|
|
paperAttachment.paperType = paperAttachment.paperAttachmentIds
|
|
|
.map((item) => item.name)
|
|
|
- .join("");
|
|
|
+ .join();
|
|
|
});
|
|
|
}
|
|
|
- // this.examTaskDetail = this.paperAttachments.map((item) => {
|
|
|
- // return {
|
|
|
- // ...item,
|
|
|
- // paperAttachmentIds: JSON.stringify(item.paperAttachmentIds),
|
|
|
- // };
|
|
|
- // });
|
|
|
},
|
|
|
checkData() {
|
|
|
this.updateExamTaskDetail();
|