|
@@ -145,8 +145,28 @@
|
|
:label="item.title"
|
|
:label="item.title"
|
|
:disabled="item.disabled"
|
|
:disabled="item.disabled"
|
|
>
|
|
>
|
|
|
|
+ <span
|
|
|
|
+ :class="[
|
|
|
|
+ item.type === 'GENERIC'
|
|
|
|
+ ? 'color-success'
|
|
|
|
+ : 'color-primary',
|
|
|
|
+ 'mr-1'
|
|
|
|
+ ]"
|
|
|
|
+ >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
|
|
|
|
+ >
|
|
|
|
+ {{ item.title }}
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
|
|
+ <span
|
|
|
|
+ v-if="attachment.cardId"
|
|
|
|
+ :class="[
|
|
|
|
+ attachment.cardType === 'GENERIC'
|
|
|
|
+ ? 'color-success'
|
|
|
|
+ : 'color-primary',
|
|
|
|
+ 'mr-1'
|
|
|
|
+ ]"
|
|
|
|
+ >[{{ attachment.cardType === "GENERIC" ? "通" : "专" }}]</span
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
@@ -169,7 +189,9 @@
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
:disabled="
|
|
:disabled="
|
|
- !attachment.cardId || attachment.cardType === 'GENERIC'
|
|
|
|
|
|
+ !attachment.cardId ||
|
|
|
|
+ attachment.cardType === 'GENERIC' ||
|
|
|
|
+ !(!attachment.used && attachment.createId === user.id)
|
|
"
|
|
"
|
|
@click="toEditCard(attachment)"
|
|
@click="toEditCard(attachment)"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
@@ -285,11 +307,14 @@ import { courseQuery, examConfigByExamIdOrgId } from "../../../base/api";
|
|
import { mapState, mapMutations } from "vuex";
|
|
import { mapState, mapMutations } from "vuex";
|
|
import { copyCard } from "../../../card/api";
|
|
import { copyCard } from "../../../card/api";
|
|
|
|
|
|
|
|
+// type=GENERIC时, 为通卡,不可复制,不可编辑,可预览。
|
|
|
|
+// type=CUSTOM时,可复制,不可编辑,如果是当前自己任务的题卡,才可编辑。
|
|
export default {
|
|
export default {
|
|
name: "info-exam-task",
|
|
name: "info-exam-task",
|
|
components: { UploadPaperDialog, SimpleImagePreview, ModifyCard },
|
|
components: { UploadPaperDialog, SimpleImagePreview, ModifyCard },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ user: {},
|
|
task: {},
|
|
task: {},
|
|
rules: {
|
|
rules: {
|
|
semesterId: [
|
|
semesterId: [
|
|
@@ -388,7 +413,8 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...mapMutations("exam", ["updateTaskInfo"]),
|
|
...mapMutations("exam", ["updateTaskInfo"]),
|
|
initData() {
|
|
initData() {
|
|
- const userOrg = this.$ls.get("user", { orgInfo: {} }).orgInfo;
|
|
|
|
|
|
+ this.user = this.$ls.get("user", {});
|
|
|
|
+ const userOrg = this.user.orgInfo;
|
|
this.teachingRoomName = userOrg.name;
|
|
this.teachingRoomName = userOrg.name;
|
|
this.examTask = { ...this.infoExamTask, teachingRoomId: userOrg.id };
|
|
this.examTask = { ...this.infoExamTask, teachingRoomId: userOrg.id };
|
|
this.examTaskDetail = { ...this.infoExamTaskDetail };
|
|
this.examTaskDetail = { ...this.infoExamTaskDetail };
|
|
@@ -501,6 +527,8 @@ export default {
|
|
attachment.cardType = card.type;
|
|
attachment.cardType = card.type;
|
|
attachment.createMethod = card.createMethod;
|
|
attachment.createMethod = card.createMethod;
|
|
attachment.cardTitle = card.title;
|
|
attachment.cardTitle = card.title;
|
|
|
|
+ attachment.used = card.used;
|
|
|
|
+ attachment.createId = card.createId;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
cardOptionOpened(visible, attachment) {
|
|
cardOptionOpened(visible, attachment) {
|
|
@@ -613,11 +641,18 @@ export default {
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
|
|
|
|
- const cardValid = !this.paperAttachments.some(item => !item.cardId);
|
|
|
|
|
|
+ let cardValid = !this.paperAttachments.some(item => !item.cardId);
|
|
if (!cardValid) {
|
|
if (!cardValid) {
|
|
this.$message.error("有试卷类型未选择题卡!");
|
|
this.$message.error("有试卷类型未选择题卡!");
|
|
return Promise.reject();
|
|
return Promise.reject();
|
|
}
|
|
}
|
|
|
|
+ const usedCards = this.paperAttachments
|
|
|
|
+ .filter(item => item.cardId && item.used)
|
|
|
|
+ .map(item => item.name);
|
|
|
|
+ if (!usedCards.length) {
|
|
|
|
+ this.$message.error(`${usedCards.join()}卷选择的题卡已经被使用过!`);
|
|
|
|
+ return Promise.reject();
|
|
|
|
+ }
|
|
|
|
|
|
return Promise.resolve(true);
|
|
return Promise.resolve(true);
|
|
},
|
|
},
|
|
@@ -643,7 +678,9 @@ export default {
|
|
createMethod: "",
|
|
createMethod: "",
|
|
cardTitle: "",
|
|
cardTitle: "",
|
|
filename: "",
|
|
filename: "",
|
|
- pages: 0
|
|
|
|
|
|
+ pages: 0,
|
|
|
|
+ used: false,
|
|
|
|
+ createId: null
|
|
};
|
|
};
|
|
this.paperAttachments.push(newAttachment);
|
|
this.paperAttachments.push(newAttachment);
|
|
},
|
|
},
|