|
@@ -34,6 +34,7 @@
|
|
|
<span class="color-gray-2" v-if="attachment.isExposed">(已曝光)</span>
|
|
|
</td>
|
|
|
<template v-if="IS_TIKU_TAB">
|
|
|
+ <!-- 试卷文件 -->
|
|
|
<td>
|
|
|
<template v-if="!attachment.isExposed && taskStatus.IS_APPLY">
|
|
|
<div class="box-justify">
|
|
@@ -78,18 +79,30 @@
|
|
|
</div>
|
|
|
</el-button>
|
|
|
</td>
|
|
|
+ <!-- 答题卡 -->
|
|
|
<td>
|
|
|
<template v-if="taskStatus.IS_APPLY">
|
|
|
<el-select
|
|
|
v-model="attachment.cardId"
|
|
|
placeholder="请选择"
|
|
|
style="width: 260px; margin-right: 10px"
|
|
|
+ @change="(val) => tkCardChange(val, attachment)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-if="attachment.cardId"
|
|
|
- :value="attachment.cardId"
|
|
|
- :label="attachment.cardTitle"
|
|
|
+ v-for="item in attachment.cards"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.title"
|
|
|
>
|
|
|
+ <div class="box-justify">
|
|
|
+ <div class="box-grow">{{ item.title }}</div>
|
|
|
+ <el-button
|
|
|
+ class="btn-danger btn-icon box-static"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-remove"
|
|
|
+ @click="toDeleteCard(item, attachment)"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-button
|
|
@@ -123,6 +136,7 @@
|
|
|
</td>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
+ <!-- 试卷文件 -->
|
|
|
<td>
|
|
|
<el-button
|
|
|
v-if="!attachment.isExposed && taskStatus.IS_APPLY"
|
|
@@ -161,6 +175,7 @@
|
|
|
</div>
|
|
|
</el-button>
|
|
|
</td>
|
|
|
+ <!-- 答题卡 -->
|
|
|
<td>
|
|
|
<template v-if="taskStatus.IS_APPLY">
|
|
|
<el-select
|
|
@@ -261,6 +276,7 @@
|
|
|
</el-button>
|
|
|
</td>
|
|
|
</template>
|
|
|
+ <!-- 操作 -->
|
|
|
<td
|
|
|
v-if="taskStatus.IS_APPLY && !taskStatus.IS_REBUILD"
|
|
|
class="text-right"
|
|
@@ -398,6 +414,7 @@ import { mapState, mapMutations, mapActions } from "vuex";
|
|
|
|
|
|
import { cardForSelectList } from "../../api";
|
|
|
import { attachmentPreview } from "../../../login/api";
|
|
|
+import { deleteCard } from "../../../base/api";
|
|
|
import { copyCard } from "../../../card/api";
|
|
|
|
|
|
import UploadPaperDialog from "../UploadPaperDialog.vue";
|
|
@@ -535,6 +552,20 @@ export default {
|
|
|
this.cards = this.cards.filter((item) => item.type === "GENERIC");
|
|
|
}
|
|
|
},
|
|
|
+ async getTkCardList(attachment) {
|
|
|
+ if (
|
|
|
+ !this.curTaskApply.courseId ||
|
|
|
+ !this.curTaskApply.examId ||
|
|
|
+ !attachment.paperId
|
|
|
+ )
|
|
|
+ return;
|
|
|
+ const data = await cardForSelectList({
|
|
|
+ courseId: this.curTaskApply.courseId,
|
|
|
+ examId: this.curTaskApply.examId,
|
|
|
+ paperId: attachment.paperId,
|
|
|
+ });
|
|
|
+ attachment.cards = data || [];
|
|
|
+ },
|
|
|
addAtachment() {
|
|
|
if (this.paperAttachments.length >= this.attachmentLimitCount) return;
|
|
|
|
|
@@ -556,6 +587,7 @@ export default {
|
|
|
used: false,
|
|
|
createId: null,
|
|
|
};
|
|
|
+ if (this.IS_TIKU_TAB) newAttachment.cards = [];
|
|
|
this.paperAttachments.push(newAttachment);
|
|
|
},
|
|
|
deleteAttachment(index) {
|
|
@@ -645,6 +677,8 @@ export default {
|
|
|
(item) => item.name === this.curAttachment.name
|
|
|
);
|
|
|
this.paperAttachments[aind].cardTitle = data.title;
|
|
|
+ await this.getTkCardList(this.curAttachment);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -673,6 +707,27 @@ export default {
|
|
|
attachment.createId = card.createId;
|
|
|
}
|
|
|
},
|
|
|
+ tkCardChange(card, attachment) {
|
|
|
+ attachment.cardTitle = card.title;
|
|
|
+ },
|
|
|
+ async toDeleteCard(card, attachment) {
|
|
|
+ const confirm = await this.$confirm(
|
|
|
+ `确定要删除题卡【${card.title}】吗?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
+
|
|
|
+ await deleteCard(card.id);
|
|
|
+ this.$message.success("删除成功!");
|
|
|
+ attachment.cards = attachment.cards.filter((item) => item.id !== card.id);
|
|
|
+ if (attachment.cardId === card.id) {
|
|
|
+ attachment.cardId = null;
|
|
|
+ attachment.cardTitle = "";
|
|
|
+ }
|
|
|
+ },
|
|
|
async toCreateCard(attachment) {
|
|
|
if (!this.examTask.cardRuleId) {
|
|
|
this.$message.error("题卡规则缺失!");
|
|
@@ -758,6 +813,7 @@ export default {
|
|
|
attachmentId: info.attachmentId,
|
|
|
paperUrl: info.paperUrl,
|
|
|
});
|
|
|
+ this.getTkCardList(this.paperAttachments[ind]);
|
|
|
},
|
|
|
toViewPaper(attachment) {
|
|
|
if (!attachment.paperUrl) return;
|