|
@@ -84,20 +84,22 @@
|
|
|
|
|
|
<div class="apply-content task-detail">
|
|
<div class="apply-content task-detail">
|
|
<div class="task-body">
|
|
<div class="task-body">
|
|
- <div class="mb-2 text-right">
|
|
|
|
|
|
+ <div class="mb-4 tab-btns">
|
|
<el-button
|
|
<el-button
|
|
- type="info"
|
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
|
- @click="addAtachment"
|
|
|
|
- >增加卷型</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ v-for="tab in tabs"
|
|
|
|
+ :key="tab.val"
|
|
|
|
+ size="medium"
|
|
|
|
+ :type="curTab == tab.val ? 'primary' : 'default'"
|
|
|
|
+ @click="selectMenu(tab.val)"
|
|
|
|
+ >{{ tab.name }}
|
|
|
|
+ </el-button>
|
|
</div>
|
|
</div>
|
|
<table class="table mb-2">
|
|
<table class="table mb-2">
|
|
<colgroup>
|
|
<colgroup>
|
|
<col width="100" />
|
|
<col width="100" />
|
|
<col width="280" />
|
|
<col width="280" />
|
|
<col />
|
|
<col />
|
|
- <col width="60" />
|
|
|
|
|
|
+ <col width="90" />
|
|
</colgroup>
|
|
</colgroup>
|
|
<tr>
|
|
<tr>
|
|
<th>试卷类型</th>
|
|
<th>试卷类型</th>
|
|
@@ -107,7 +109,25 @@
|
|
</tr>
|
|
</tr>
|
|
<tr v-for="(attachment, index) in paperAttachments" :key="index">
|
|
<tr v-for="(attachment, index) in paperAttachments" :key="index">
|
|
<td>{{ attachment.name }}卷</td>
|
|
<td>{{ attachment.name }}卷</td>
|
|
- <td>
|
|
|
|
|
|
+
|
|
|
|
+ <td v-if="IS_TIKU_TAB">
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ @click="toSelect(attachment)"
|
|
|
|
+ >
|
|
|
|
+ <i
|
|
|
|
+ :class="[
|
|
|
|
+ 'icon',
|
|
|
|
+ attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
|
|
+ ]"
|
|
|
|
+ ></i
|
|
|
|
+ >{{
|
|
|
|
+ attachment.attachmentId ? attachment.filename : "选择试卷"
|
|
|
|
+ }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </td>
|
|
|
|
+ <td v-else>
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
@@ -126,7 +146,21 @@
|
|
}}
|
|
}}
|
|
</el-button>
|
|
</el-button>
|
|
</td>
|
|
</td>
|
|
- <td>
|
|
|
|
|
|
+ <td v-if="IS_TIKU_TAB">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="attachment.cardId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ style="width: 260px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-if="attachment.cardId"
|
|
|
|
+ :value="attachment.cardId"
|
|
|
|
+ :label="attachment.cardTitle"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </td>
|
|
|
|
+ <td v-else>
|
|
<el-select
|
|
<el-select
|
|
class="mr-2"
|
|
class="mr-2"
|
|
v-model="attachment.cardId"
|
|
v-model="attachment.cardId"
|
|
@@ -160,19 +194,21 @@
|
|
{{ item.title }}
|
|
{{ 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',
|
|
|
|
- {
|
|
|
|
- 'color-danger': attachment.used,
|
|
|
|
- },
|
|
|
|
- ]"
|
|
|
|
- >[{{ attachment.cardType === "GENERIC" ? "通" : "专" }}]</span
|
|
|
|
- >
|
|
|
|
|
|
+ <template v-if="!IS_TIKU_TAB">
|
|
|
|
+ <span
|
|
|
|
+ v-if="attachment.cardId"
|
|
|
|
+ :class="[
|
|
|
|
+ attachment.cardType === 'GENERIC'
|
|
|
|
+ ? 'color-success'
|
|
|
|
+ : 'color-primary',
|
|
|
|
+ 'mr-1',
|
|
|
|
+ {
|
|
|
|
+ 'color-danger': attachment.used,
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ >[{{ attachment.cardType === "GENERIC" ? "通" : "专" }}]</span
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
<el-button
|
|
<el-button
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
@@ -181,6 +217,7 @@
|
|
>预览</el-button
|
|
>预览</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="!IS_TIKU_TAB"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
:disabled="
|
|
:disabled="
|
|
@@ -195,6 +232,7 @@
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
:disabled="
|
|
:disabled="
|
|
|
|
+ IS_TIKU_TAB ||
|
|
!attachment.cardId ||
|
|
!attachment.cardId ||
|
|
attachment.cardType === 'GENERIC' ||
|
|
attachment.cardType === 'GENERIC' ||
|
|
!(!attachment.used && attachment.createId === user.id)
|
|
!(!attachment.used && attachment.createId === user.id)
|
|
@@ -203,6 +241,7 @@
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="!IS_TIKU_TAB"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
:disabled="!canCreateCard"
|
|
:disabled="!canCreateCard"
|
|
@@ -210,13 +249,20 @@
|
|
>新建</el-button
|
|
>新建</el-button
|
|
>
|
|
>
|
|
</td>
|
|
</td>
|
|
- <td>
|
|
|
|
|
|
+ <td class="text-right">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="index === paperAttachments.length - 1"
|
|
|
|
+ class="btn-primary btn-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
|
+ @click="addAtachment"
|
|
|
|
+ ></el-button>
|
|
<el-button
|
|
<el-button
|
|
- class="btn-danger"
|
|
|
|
|
|
+ class="btn-danger btn-icon"
|
|
type="text"
|
|
type="text"
|
|
|
|
+ icon="el-icon-remove"
|
|
@click="deleteAttachment(index)"
|
|
@click="deleteAttachment(index)"
|
|
- >删除</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ ></el-button>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
<tr v-if="!paperAttachments.length">
|
|
<tr v-if="!paperAttachments.length">
|
|
@@ -300,6 +346,12 @@
|
|
></simple-image-preview>
|
|
></simple-image-preview>
|
|
<!-- ModifyCard -->
|
|
<!-- ModifyCard -->
|
|
<modify-card ref="ModifyCard" @modified="cardModified"></modify-card>
|
|
<modify-card ref="ModifyCard" @modified="cardModified"></modify-card>
|
|
|
|
+ <!-- SelectTikuPaperDialog -->
|
|
|
|
+ <select-tiku-paper-dialog
|
|
|
|
+ ref="SelectTikuPaperDialog"
|
|
|
|
+ :row="curAttachment"
|
|
|
|
+ @confirm="tikuPaperSelected"
|
|
|
|
+ ></select-tiku-paper-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -307,6 +359,7 @@
|
|
import UploadPaperDialog from "../UploadPaperDialog";
|
|
import UploadPaperDialog from "../UploadPaperDialog";
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
import SimpleImagePreview from "@/components/SimpleImagePreview";
|
|
import ModifyCard from "../../../card/components/ModifyCard";
|
|
import ModifyCard from "../../../card/components/ModifyCard";
|
|
|
|
+import SelectTikuPaperDialog from "./SelectTikuPaperDialog.vue";
|
|
import { COMMON_CARD_RULE_ID } from "../../../../constants/enumerate";
|
|
import { COMMON_CARD_RULE_ID } from "../../../../constants/enumerate";
|
|
import { cardForSelectList } from "../../api";
|
|
import { cardForSelectList } from "../../api";
|
|
import { courseQuery, examConfigByExamIdOrgId } from "../../../base/api";
|
|
import { courseQuery, examConfigByExamIdOrgId } from "../../../base/api";
|
|
@@ -317,9 +370,25 @@ import { copyCard } from "../../../card/api";
|
|
// type=CUSTOM时,可复制,不可编辑,如果是当前自己任务的题卡,才可编辑。
|
|
// type=CUSTOM时,可复制,不可编辑,如果是当前自己任务的题卡,才可编辑。
|
|
export default {
|
|
export default {
|
|
name: "info-exam-task",
|
|
name: "info-exam-task",
|
|
- components: { UploadPaperDialog, SimpleImagePreview, ModifyCard },
|
|
|
|
|
|
+ components: {
|
|
|
|
+ UploadPaperDialog,
|
|
|
|
+ SimpleImagePreview,
|
|
|
|
+ ModifyCard,
|
|
|
|
+ SelectTikuPaperDialog,
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ tabs: [
|
|
|
|
+ {
|
|
|
|
+ name: "上传本地试卷",
|
|
|
|
+ val: "upload",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: "从题库选择试卷",
|
|
|
|
+ val: "tiku",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ curTab: "upload",
|
|
user: {},
|
|
user: {},
|
|
task: {},
|
|
task: {},
|
|
rules: {
|
|
rules: {
|
|
@@ -404,6 +473,9 @@ export default {
|
|
this.examTask.cardRuleId !== COMMON_CARD_RULE_ID
|
|
this.examTask.cardRuleId !== COMMON_CARD_RULE_ID
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
+ IS_TIKU_TAB() {
|
|
|
|
+ return this.curTab === "tiku";
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
"examTask.examId": function (val, oldval) {
|
|
"examTask.examId": function (val, oldval) {
|
|
@@ -444,6 +516,9 @@ export default {
|
|
this.$refs.examTaskComp.clearValidate();
|
|
this.$refs.examTaskComp.clearValidate();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ selectMenu(tab) {
|
|
|
|
+ this.curTab = tab;
|
|
|
|
+ },
|
|
async getCardList() {
|
|
async getCardList() {
|
|
if (!this.examTask.courseCode || !this.examTask.examId) return;
|
|
if (!this.examTask.courseCode || !this.examTask.examId) return;
|
|
const data = await cardForSelectList({
|
|
const data = await cardForSelectList({
|
|
@@ -688,6 +763,16 @@ export default {
|
|
emitRelateInfo(type) {
|
|
emitRelateInfo(type) {
|
|
this.$emit("relate-info-change", this.getData(), type);
|
|
this.$emit("relate-info-change", this.getData(), type);
|
|
},
|
|
},
|
|
|
|
+ toSelect(attachment) {
|
|
|
|
+ this.curAttachment = attachment;
|
|
|
|
+ this.$refs.SelectTikuPaperDialog.open();
|
|
|
|
+ },
|
|
|
|
+ tikuPaperSelected(data) {
|
|
|
|
+ // TODO:
|
|
|
|
+ Object.assign(this.curAttachment, {
|
|
|
|
+ paperId: data.id,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// exam-task-detail edit
|
|
// exam-task-detail edit
|
|
addAtachment() {
|
|
addAtachment() {
|
|
if (this.paperAttachments.length >= this.attachmentLimitCount) return;
|
|
if (this.paperAttachments.length >= this.attachmentLimitCount) return;
|