|
@@ -85,6 +85,16 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="启用AB卷:">
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="examTask.openAb"
|
|
|
|
+ @change="openAbChange"
|
|
|
|
+ ></el-switch>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -106,12 +116,14 @@
|
|
<table class="table mb-2">
|
|
<table class="table mb-2">
|
|
<colgroup>
|
|
<colgroup>
|
|
<col width="90" />
|
|
<col width="90" />
|
|
|
|
+ <col width="60" />
|
|
<col width="280" />
|
|
<col width="280" />
|
|
<col />
|
|
<col />
|
|
<col v-if="!IS_REBUILD" width="80" />
|
|
<col v-if="!IS_REBUILD" width="80" />
|
|
</colgroup>
|
|
</colgroup>
|
|
<tr>
|
|
<tr>
|
|
- <th>试卷类型</th>
|
|
|
|
|
|
+ <th>备用卷</th>
|
|
|
|
+ <th>卷型</th>
|
|
<th>试卷文件</th>
|
|
<th>试卷文件</th>
|
|
<th>
|
|
<th>
|
|
答题卡
|
|
答题卡
|
|
@@ -121,15 +133,50 @@
|
|
</th>
|
|
</th>
|
|
<th v-if="!IS_REBUILD">操作</th>
|
|
<th v-if="!IS_REBUILD">操作</th>
|
|
</tr>
|
|
</tr>
|
|
- <tr v-for="(attachment, index) in paperAttachments" :key="index">
|
|
|
|
- <td>{{ attachment.name }}卷</td>
|
|
|
|
|
|
+ <template v-for="(paperAttachment, pindex) in paperAttachments">
|
|
|
|
+ <tr
|
|
|
|
+ v-for="(attachment, index) in paperAttachment.paperAttachmentIds"
|
|
|
|
+ :key="`${pindex}-${index}`"
|
|
|
|
+ >
|
|
|
|
+ <td
|
|
|
|
+ v-if="index === 0"
|
|
|
|
+ :rowspan="paperAttachment.paperAttachmentIds.length"
|
|
|
|
+ >
|
|
|
|
+ 卷{{ paperAttachment.serialNumber }}
|
|
|
|
+ </td>
|
|
|
|
+ <td>{{ attachment.name }}</td>
|
|
|
|
|
|
- <td v-if="IS_TIKU_TAB">
|
|
|
|
- <div class="box-justify">
|
|
|
|
|
|
+ <td v-if="IS_TIKU_TAB">
|
|
|
|
+ <div class="box-justify">
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ class="btn-primary box-grow"
|
|
|
|
+ @click="toSelect(attachment)"
|
|
|
|
+ >
|
|
|
|
+ <i
|
|
|
|
+ :class="[
|
|
|
|
+ 'icon',
|
|
|
|
+ attachment.attachmentId
|
|
|
|
+ ? 'icon-files-act'
|
|
|
|
+ : 'icon-files',
|
|
|
|
+ ]"
|
|
|
|
+ ></i
|
|
|
|
+ >{{ attachment.filename || "选择试卷" }}
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ class="btn-primary box-static"
|
|
|
|
+ :disabled="!attachment.paperUrl"
|
|
|
|
+ @click="toViewPaper(attachment)"
|
|
|
|
+ >预览</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
|
|
+ <td v-else>
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
- class="btn-primary box-grow"
|
|
|
|
- @click="toSelect(attachment)"
|
|
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ @click="toUpload(attachment)"
|
|
>
|
|
>
|
|
<i
|
|
<i
|
|
:class="[
|
|
:class="[
|
|
@@ -137,186 +184,168 @@
|
|
attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
]"
|
|
]"
|
|
></i
|
|
></i
|
|
- >{{ attachment.filename || "选择试卷" }}
|
|
|
|
|
|
+ >{{
|
|
|
|
+ attachment.attachmentId
|
|
|
|
+ ? attachment.filename
|
|
|
|
+ : "点击上传试卷文件"
|
|
|
|
+ }}
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button
|
|
|
|
- type="text"
|
|
|
|
- class="btn-primary box-static"
|
|
|
|
- :disabled="!attachment.paperUrl"
|
|
|
|
- @click="toViewPaper(attachment)"
|
|
|
|
- >预览</el-button
|
|
|
|
- >
|
|
|
|
- </div>
|
|
|
|
- </td>
|
|
|
|
- <td v-else>
|
|
|
|
- <el-button
|
|
|
|
- type="text"
|
|
|
|
- class="btn-primary"
|
|
|
|
- @click="toUpload(attachment)"
|
|
|
|
- >
|
|
|
|
- <i
|
|
|
|
- :class="[
|
|
|
|
- 'icon',
|
|
|
|
- attachment.attachmentId ? 'icon-files-act' : 'icon-files',
|
|
|
|
- ]"
|
|
|
|
- ></i
|
|
|
|
- >{{
|
|
|
|
- attachment.attachmentId
|
|
|
|
- ? attachment.filename
|
|
|
|
- : "点击上传试卷文件"
|
|
|
|
- }}
|
|
|
|
- </el-button>
|
|
|
|
- </td>
|
|
|
|
- <td v-if="IS_TIKU_TAB">
|
|
|
|
- <el-select
|
|
|
|
- v-model="attachment.cardId"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- style="width: 260px; margin-right: 10px"
|
|
|
|
- @change="(val) => tkCardChange(val, attachment)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- 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
|
|
|
|
- class="btn-primary"
|
|
|
|
- type="text"
|
|
|
|
- :disabled="!attachment.cardId"
|
|
|
|
- @click="toViewCard(attachment)"
|
|
|
|
- >预览</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- v-if="!IS_REBUILD"
|
|
|
|
- class="btn-primary"
|
|
|
|
- type="text"
|
|
|
|
- :disabled="!attachment.cardId"
|
|
|
|
- @click="toEditCard(attachment)"
|
|
|
|
- >编辑</el-button
|
|
|
|
- >
|
|
|
|
- </td>
|
|
|
|
- <td v-else>
|
|
|
|
- <el-select
|
|
|
|
- class="mr-2"
|
|
|
|
- v-model="attachment.cardId"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- style="width: 200px"
|
|
|
|
- filterable
|
|
|
|
- @change="cardChange(attachment)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in cards"
|
|
|
|
- :key="item.id"
|
|
|
|
- :value="item.id"
|
|
|
|
- :label="item.title"
|
|
|
|
- :disabled="item.disabled"
|
|
|
|
|
|
+ </td>
|
|
|
|
+ <td v-if="IS_TIKU_TAB">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="attachment.cardId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ style="width: 260px; margin-right: 10px"
|
|
|
|
+ @change="(val) => tkCardChange(val, attachment)"
|
|
>
|
|
>
|
|
- <div class="box-justify">
|
|
|
|
- <div class="box-grow">
|
|
|
|
- <span
|
|
|
|
- :class="[
|
|
|
|
- item.type === 'GENERIC'
|
|
|
|
- ? 'color-success'
|
|
|
|
- : 'color-primary',
|
|
|
|
- 'mr-1',
|
|
|
|
- {
|
|
|
|
- 'color-danger': item.used,
|
|
|
|
- },
|
|
|
|
- ]"
|
|
|
|
- >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
|
|
|
|
- >
|
|
|
|
- {{ item.title }}
|
|
|
|
|
|
+ <el-option
|
|
|
|
+ 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>
|
|
</div>
|
|
- <el-button
|
|
|
|
- v-if="item.type !== 'GENERIC'"
|
|
|
|
- class="btn-danger btn-icon box-static"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-remove"
|
|
|
|
- @click="toDeleteCard(item, attachment)"
|
|
|
|
- ></el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-option>
|
|
|
|
- </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
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- class="btn-primary"
|
|
|
|
- type="text"
|
|
|
|
- :disabled="!attachment.cardId"
|
|
|
|
- @click="toViewCard(attachment)"
|
|
|
|
- >预览</el-button
|
|
|
|
- >
|
|
|
|
- <template v-if="!IS_REBUILD">
|
|
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
<el-button
|
|
<el-button
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
- :disabled="
|
|
|
|
- !attachment.cardId ||
|
|
|
|
- (attachment.cardType === 'GENERIC' &&
|
|
|
|
- attachment.createMethod !== 'STANDARD')
|
|
|
|
- "
|
|
|
|
- @click="toCopyCard(attachment)"
|
|
|
|
- >复制</el-button
|
|
|
|
|
|
+ :disabled="!attachment.cardId"
|
|
|
|
+ @click="toViewCard(attachment)"
|
|
|
|
+ >预览</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
|
|
+ v-if="!IS_REBUILD"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
- :disabled="
|
|
|
|
- !attachment.cardId ||
|
|
|
|
- attachment.cardType === 'GENERIC' ||
|
|
|
|
- !(!attachment.used && attachment.createId === user.id)
|
|
|
|
- "
|
|
|
|
|
|
+ :disabled="!attachment.cardId"
|
|
@click="toEditCard(attachment)"
|
|
@click="toEditCard(attachment)"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
|
|
+ </td>
|
|
|
|
+ <td v-else>
|
|
|
|
+ <el-select
|
|
|
|
+ class="mr-2"
|
|
|
|
+ v-model="attachment.cardId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ style="width: 200px"
|
|
|
|
+ filterable
|
|
|
|
+ @change="cardChange(attachment)"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in cards"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :label="item.title"
|
|
|
|
+ :disabled="item.disabled"
|
|
|
|
+ >
|
|
|
|
+ <div class="box-justify">
|
|
|
|
+ <div class="box-grow">
|
|
|
|
+ <span
|
|
|
|
+ :class="[
|
|
|
|
+ item.type === 'GENERIC'
|
|
|
|
+ ? 'color-success'
|
|
|
|
+ : 'color-primary',
|
|
|
|
+ 'mr-1',
|
|
|
|
+ {
|
|
|
|
+ 'color-danger': item.used,
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
|
|
|
|
+ >
|
|
|
|
+ {{ item.title }}
|
|
|
|
+ </div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="item.type !== 'GENERIC'"
|
|
|
|
+ class="btn-danger btn-icon box-static"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-remove"
|
|
|
|
+ @click="toDeleteCard(item, attachment)"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-option>
|
|
|
|
+ </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
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
- :disabled="!canCreateCard"
|
|
|
|
- @click="toCreateCard(attachment)"
|
|
|
|
- >新建</el-button
|
|
|
|
|
|
+ :disabled="!attachment.cardId"
|
|
|
|
+ @click="toViewCard(attachment)"
|
|
|
|
+ >预览</el-button
|
|
>
|
|
>
|
|
- </template>
|
|
|
|
- </td>
|
|
|
|
- <td v-if="!IS_REBUILD" 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
|
|
|
|
- class="btn-danger btn-icon"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-remove"
|
|
|
|
- @click="deleteAttachment(index)"
|
|
|
|
- ></el-button>
|
|
|
|
- </td>
|
|
|
|
- </tr>
|
|
|
|
|
|
+ <template v-if="!IS_REBUILD">
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ :disabled="
|
|
|
|
+ !attachment.cardId ||
|
|
|
|
+ (attachment.cardType === 'GENERIC' &&
|
|
|
|
+ attachment.createMethod !== 'STANDARD')
|
|
|
|
+ "
|
|
|
|
+ @click="toCopyCard(attachment)"
|
|
|
|
+ >复制</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ :disabled="
|
|
|
|
+ !attachment.cardId ||
|
|
|
|
+ attachment.cardType === 'GENERIC' ||
|
|
|
|
+ !(!attachment.used && attachment.createId === user.id)
|
|
|
|
+ "
|
|
|
|
+ @click="toEditCard(attachment)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-primary"
|
|
|
|
+ type="text"
|
|
|
|
+ :disabled="!canCreateCard"
|
|
|
|
+ @click="toCreateCard(attachment)"
|
|
|
|
+ >新建</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </td>
|
|
|
|
+ <td
|
|
|
|
+ v-if="!IS_REBUILD && index === 0"
|
|
|
|
+ :rowspan="paperAttachment.paperAttachmentIds.length"
|
|
|
|
+ class="text-right"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="pindex === paperAttachments.length - 1"
|
|
|
|
+ class="btn-primary btn-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
|
+ @click="addAtachment"
|
|
|
|
+ ></el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ class="btn-danger btn-icon"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-remove"
|
|
|
|
+ @click="deleteAttachment(pindex)"
|
|
|
|
+ ></el-button>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ </template>
|
|
<tr v-if="!paperAttachments.length">
|
|
<tr v-if="!paperAttachments.length">
|
|
<td colspan="5">
|
|
<td colspan="5">
|
|
<p class="tips-info text-center">暂无数据</p>
|
|
<p class="tips-info text-center">暂无数据</p>
|
|
@@ -324,19 +353,6 @@
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
|
|
|
|
- <el-form v-if="!IS_REBUILD">
|
|
|
|
- <el-form-item label="单次抽卷卷型数量:" label-width="150">
|
|
|
|
- <el-input-number
|
|
|
|
- v-model="examTaskDetail.drawCount"
|
|
|
|
- :min="1"
|
|
|
|
- :max="1"
|
|
|
|
- :step="1"
|
|
|
|
- step-strictly
|
|
|
|
- :controls="false"
|
|
|
|
- ></el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
<h4 class="mb-2">
|
|
<h4 class="mb-2">
|
|
附件<span>(最多4个,仅限{{ attachmentFormat.join("、") }}文件)</span
|
|
附件<span>(最多4个,仅限{{ attachmentFormat.join("、") }}文件)</span
|
|
>:
|
|
>:
|
|
@@ -454,6 +470,7 @@ import { copyCard } from "../../../card/api";
|
|
|
|
|
|
import CardBuildDialog from "../../../card/components/CardBuildDialog.vue";
|
|
import CardBuildDialog from "../../../card/components/CardBuildDialog.vue";
|
|
import CardPreviewDialog from "../../../card/components/CardPreviewDialog.vue";
|
|
import CardPreviewDialog from "../../../card/components/CardPreviewDialog.vue";
|
|
|
|
+import { deepCopy } from "@/plugins/utils";
|
|
|
|
|
|
// type=GENERIC时, 为通卡,不可复制,不可编辑,可预览。
|
|
// type=GENERIC时, 为通卡,不可复制,不可编辑,可预览。
|
|
// type=CUSTOM时,可复制,不可编辑,如果是当前自己任务的题卡,才可编辑。
|
|
// type=CUSTOM时,可复制,不可编辑,如果是当前自己任务的题卡,才可编辑。
|
|
@@ -535,7 +552,7 @@ export default {
|
|
// card-build
|
|
// card-build
|
|
cardBuildPresetData: {},
|
|
cardBuildPresetData: {},
|
|
// exam-task-detail
|
|
// exam-task-detail
|
|
- examTaskDetail: { makeMethod: "" },
|
|
|
|
|
|
+ examTaskDetail: [],
|
|
paperConfirmAttachmentId: {
|
|
paperConfirmAttachmentId: {
|
|
attachmentId: "",
|
|
attachmentId: "",
|
|
filename: "",
|
|
filename: "",
|
|
@@ -546,7 +563,6 @@ export default {
|
|
paperConfirmAttachments: [],
|
|
paperConfirmAttachments: [],
|
|
curAttachment: {},
|
|
curAttachment: {},
|
|
curUploadType: "paper",
|
|
curUploadType: "paper",
|
|
- attachmentLimitCount: 26,
|
|
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
examTaskInstr: this.$ls.get("schoolInfo", { examTaskInstr: "" })
|
|
examTaskInstr: this.$ls.get("schoolInfo", { examTaskInstr: "" })
|
|
.examTaskInstr,
|
|
.examTaskInstr,
|
|
@@ -609,18 +625,22 @@ export default {
|
|
const userOrg = this.user.orgInfo;
|
|
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.paperAttachments = this.examTaskDetail.paperAttachmentIds
|
|
|
|
- ? JSON.parse(this.examTaskDetail.paperAttachmentIds)
|
|
|
|
- : [];
|
|
|
|
|
|
+ this.paperAttachments = this.examTaskDetail.map((item) => {
|
|
|
|
+ const paperAttachmentIds = item.paperAttachmentIds
|
|
|
|
+ ? JSON.parse(item.paperAttachmentIds)
|
|
|
|
+ : [];
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ paperAttachmentIds,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
|
|
if (!this.paperAttachments.length) {
|
|
if (!this.paperAttachments.length) {
|
|
this.addAtachment();
|
|
this.addAtachment();
|
|
}
|
|
}
|
|
|
|
|
|
- this.paperConfirmAttachments = this.examTaskDetail
|
|
|
|
- .paperConfirmAttachmentIds
|
|
|
|
- ? JSON.parse(this.examTaskDetail.paperConfirmAttachmentIds)
|
|
|
|
|
|
+ this.paperConfirmAttachments = this.examTask.paperConfirmAttachmentIds
|
|
|
|
+ ? JSON.parse(this.examTask.paperConfirmAttachmentIds)
|
|
: [];
|
|
: [];
|
|
|
|
|
|
this.getCourses();
|
|
this.getCourses();
|
|
@@ -630,21 +650,35 @@ export default {
|
|
this.$refs.examTaskComp.clearValidate();
|
|
this.$refs.examTaskComp.clearValidate();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ openAbChange() {
|
|
|
|
+ if (this.examTask.openAb) {
|
|
|
|
+ this.paperAttachments.forEach((paperAttachment) => {
|
|
|
|
+ const attachment = paperAttachment.paperAttachmentIds[0];
|
|
|
|
+ paperAttachment.paperAttachmentIds.push(
|
|
|
|
+ Object.assign(deepCopy(attachment), {
|
|
|
|
+ name: "B",
|
|
|
|
+ })
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.paperAttachments.forEach((paperAttachment) => {
|
|
|
|
+ paperAttachment.paperAttachmentIds =
|
|
|
|
+ paperAttachment.paperAttachmentIds.slice(0, 1);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async selectMenu(tab) {
|
|
async selectMenu(tab) {
|
|
- const attachment = this.paperAttachments[0];
|
|
|
|
- if (attachment.cardId || attachment.attachmentId) {
|
|
|
|
- const result = await this.$confirm(
|
|
|
|
- "更改类型会清空已设置数据,确定要更改类型?",
|
|
|
|
- "提示",
|
|
|
|
- {
|
|
|
|
- type: "warning",
|
|
|
|
- }
|
|
|
|
- ).catch(() => {});
|
|
|
|
- if (result !== "confirm") return;
|
|
|
|
|
|
+ const result = await this.$confirm(
|
|
|
|
+ "更改类型会清空已设置数据,确定要更改类型?",
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (result !== "confirm") return;
|
|
|
|
|
|
- this.paperAttachments = [];
|
|
|
|
- this.addAtachment();
|
|
|
|
- }
|
|
|
|
|
|
+ this.paperAttachments = [];
|
|
|
|
+ this.addAtachment();
|
|
|
|
|
|
this.curTab = tab;
|
|
this.curTab = tab;
|
|
},
|
|
},
|
|
@@ -724,6 +758,14 @@ export default {
|
|
this.cards = [];
|
|
this.cards = [];
|
|
this.getCardList();
|
|
this.getCardList();
|
|
},
|
|
},
|
|
|
|
+ updateExamTaskDetail() {
|
|
|
|
+ this.examTaskDetail = this.paperAttachments.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ ...item,
|
|
|
|
+ paperAttachmentIds: JSON.stringify(item.paperAttachmentIds),
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ },
|
|
async examAndRoomChange() {
|
|
async examAndRoomChange() {
|
|
this.updateTaskInfo({ infoExamTask: this.examTask });
|
|
this.updateTaskInfo({ infoExamTask: this.examTask });
|
|
|
|
|
|
@@ -734,9 +776,11 @@ export default {
|
|
orgId: teachingRoomId,
|
|
orgId: teachingRoomId,
|
|
});
|
|
});
|
|
this.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
this.examTask.cardRuleId = examPrintPlan.cardRuleId;
|
|
- this.examTaskDetail.review = examPrintPlan.review;
|
|
|
|
- this.examTaskDetail.includePaper =
|
|
|
|
|
|
+ this.examTask.review = examPrintPlan.review;
|
|
|
|
+ this.examTask.includePaper =
|
|
examPrintPlan.printContent.indexOf("PAPER") !== -1;
|
|
examPrintPlan.printContent.indexOf("PAPER") !== -1;
|
|
|
|
+ this.updateExamTaskDetail();
|
|
|
|
+
|
|
this.updateTaskInfo({
|
|
this.updateTaskInfo({
|
|
infoExamPrintPlan: Object.assign(
|
|
infoExamPrintPlan: Object.assign(
|
|
{},
|
|
{},
|
|
@@ -818,28 +862,31 @@ export default {
|
|
// data: {id,title}
|
|
// data: {id,title}
|
|
if (!data.id) return;
|
|
if (!data.id) return;
|
|
|
|
|
|
|
|
+ const pos = this.getAttachmentPos(this.curAttachment);
|
|
|
|
+ if (!pos) return;
|
|
|
|
+
|
|
if (this.IS_TIKU_TAB) {
|
|
if (this.IS_TIKU_TAB) {
|
|
- const aind = this.paperAttachments.findIndex(
|
|
|
|
- (item) => item.name === this.curAttachment.name
|
|
|
|
- );
|
|
|
|
- this.paperAttachments[aind].cardTitle = data.title;
|
|
|
|
|
|
+ this.paperAttachments[pos.pindex].paperAttachmentIds[
|
|
|
|
+ pos.index
|
|
|
|
+ ].cardTitle = data.title;
|
|
await this.getTkCardList(this.curAttachment);
|
|
await this.getTkCardList(this.curAttachment);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
await this.getCardList();
|
|
await this.getCardList();
|
|
let card = this.cards.find((item) => item.id === data.id);
|
|
let card = this.cards.find((item) => item.id === data.id);
|
|
-
|
|
|
|
- const aind = this.paperAttachments.findIndex(
|
|
|
|
- (item) => item.name === this.curAttachment.name
|
|
|
|
- );
|
|
|
|
- if (aind !== -1 && card) {
|
|
|
|
- this.paperAttachments[aind].cardId = card.id;
|
|
|
|
- this.paperAttachments[aind].cardType = card.type;
|
|
|
|
- this.paperAttachments[aind].createMethod = card.createMethod;
|
|
|
|
- this.paperAttachments[aind].cardTitle = card.title;
|
|
|
|
- this.paperAttachments[aind].used = card.used;
|
|
|
|
- this.paperAttachments[aind].createId = card.createId;
|
|
|
|
|
|
+ if (card) {
|
|
|
|
+ Object.assign(
|
|
|
|
+ this.paperAttachments[pos.pindex].paperAttachmentIds[pos.index],
|
|
|
|
+ {
|
|
|
|
+ cardId: card.id,
|
|
|
|
+ cardType: card.type,
|
|
|
|
+ createMethod: card.createMethod,
|
|
|
|
+ cardTitle: card.title,
|
|
|
|
+ used: card.used,
|
|
|
|
+ createId: card.createId,
|
|
|
|
+ }
|
|
|
|
+ );
|
|
}
|
|
}
|
|
},
|
|
},
|
|
tkCardChange(card, attachment) {
|
|
tkCardChange(card, attachment) {
|
|
@@ -873,14 +920,18 @@ export default {
|
|
const valid = await this.$refs.examTaskComp.validate().catch(() => {});
|
|
const valid = await this.$refs.examTaskComp.validate().catch(() => {});
|
|
if (!valid) return Promise.reject();
|
|
if (!valid) return Promise.reject();
|
|
|
|
|
|
|
|
+ const paperAttachments = this.paperAttachments
|
|
|
|
+ .map((item) => item.paperAttachmentIds)
|
|
|
|
+ .flat();
|
|
|
|
+
|
|
if (this.IS_TIKU_TAB) {
|
|
if (this.IS_TIKU_TAB) {
|
|
- const paperValid = !this.paperAttachments.some((item) => !item.paperId);
|
|
|
|
|
|
+ const paperValid = !paperAttachments.some((item) => !item.paperId);
|
|
if (!paperValid) {
|
|
if (!paperValid) {
|
|
this.$message.error("请完成试卷选择!");
|
|
this.$message.error("请完成试卷选择!");
|
|
return Promise.reject();
|
|
return Promise.reject();
|
|
}
|
|
}
|
|
|
|
|
|
- const cardValid = !this.paperAttachments.some((item) => !item.cardId);
|
|
|
|
|
|
+ const cardValid = !paperAttachments.some((item) => !item.cardId);
|
|
if (!cardValid) {
|
|
if (!cardValid) {
|
|
this.$message.error("有试卷类型未选择题卡!");
|
|
this.$message.error("有试卷类型未选择题卡!");
|
|
return Promise.reject();
|
|
return Promise.reject();
|
|
@@ -890,8 +941,8 @@ export default {
|
|
|
|
|
|
// 设置了入库强制包含试卷时,校验试卷是否上传。
|
|
// 设置了入库强制包含试卷时,校验试卷是否上传。
|
|
// 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。
|
|
// 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。
|
|
- if (this.examTaskDetail.includePaper) {
|
|
|
|
- const attachmentValid = !this.paperAttachments.some(
|
|
|
|
|
|
+ if (this.examTask.includePaper) {
|
|
|
|
+ const attachmentValid = !paperAttachments.some(
|
|
(item) => !item.attachmentId
|
|
(item) => !item.attachmentId
|
|
);
|
|
);
|
|
if (!attachmentValid) {
|
|
if (!attachmentValid) {
|
|
@@ -899,12 +950,12 @@ export default {
|
|
return Promise.reject();
|
|
return Promise.reject();
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- const hasUploadPaperAttachments = this.paperAttachments.filter(
|
|
|
|
|
|
+ const hasUploadPaperAttachments = paperAttachments.filter(
|
|
(item) => item.attachmentId
|
|
(item) => item.attachmentId
|
|
);
|
|
);
|
|
if (
|
|
if (
|
|
hasUploadPaperAttachments.length > 0 &&
|
|
hasUploadPaperAttachments.length > 0 &&
|
|
- hasUploadPaperAttachments.length !== this.paperAttachments.length
|
|
|
|
|
|
+ hasUploadPaperAttachments.length !== paperAttachments.length
|
|
) {
|
|
) {
|
|
this.$message.error("有试卷文件未完成上传!");
|
|
this.$message.error("有试卷文件未完成上传!");
|
|
return Promise.reject();
|
|
return Promise.reject();
|
|
@@ -916,12 +967,12 @@ export default {
|
|
// return;
|
|
// return;
|
|
// }
|
|
// }
|
|
|
|
|
|
- const cardValid = !this.paperAttachments.some((item) => !item.cardId);
|
|
|
|
|
|
+ const cardValid = !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
|
|
|
|
|
|
+ // const usedCards = paperAttachments
|
|
// .filter((item) => item.cardId && item.used)
|
|
// .filter((item) => item.cardId && item.used)
|
|
// .map((item) => item.name);
|
|
// .map((item) => item.name);
|
|
// if (usedCards.length) {
|
|
// if (usedCards.length) {
|
|
@@ -932,9 +983,10 @@ export default {
|
|
return Promise.resolve(true);
|
|
return Promise.resolve(true);
|
|
},
|
|
},
|
|
updateData() {
|
|
updateData() {
|
|
|
|
+ this.updateExamTaskDetail();
|
|
let data = {
|
|
let data = {
|
|
infoExamTask: this.examTask,
|
|
infoExamTask: this.examTask,
|
|
- infoExamTaskDetail: this.getTaskDetailData(),
|
|
|
|
|
|
+ infoExamTaskDetail: this.examTaskDetail,
|
|
};
|
|
};
|
|
this.updateTaskInfo(data);
|
|
this.updateTaskInfo(data);
|
|
},
|
|
},
|
|
@@ -942,6 +994,19 @@ export default {
|
|
this.$emit("relate-info-change", this.getData(), type);
|
|
this.$emit("relate-info-change", this.getData(), type);
|
|
},
|
|
},
|
|
// select-paper
|
|
// select-paper
|
|
|
|
+ getAttachmentPos(attachment) {
|
|
|
|
+ const pindex = this.paperAttachments.findIndex(
|
|
|
|
+ (item) => item.serialNumber === attachment.serialNumber
|
|
|
|
+ );
|
|
|
|
+ if (pindex === -1) return;
|
|
|
|
+
|
|
|
|
+ const index = this.paperAttachments[pindex].paperAttachmentIds.findIndex(
|
|
|
|
+ (item) => item.name === attachment.name
|
|
|
|
+ );
|
|
|
|
+ if (index === -1) return;
|
|
|
|
+
|
|
|
|
+ return { pindex, index };
|
|
|
|
+ },
|
|
toSelect(attachment) {
|
|
toSelect(attachment) {
|
|
this.curAttachment = {
|
|
this.curAttachment = {
|
|
...attachment,
|
|
...attachment,
|
|
@@ -972,25 +1037,31 @@ export default {
|
|
this.$message.error(data.message);
|
|
this.$message.error(data.message);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- const ind = this.paperAttachments.findIndex(
|
|
|
|
- (item) => item.name === this.curAttachment.name
|
|
|
|
- );
|
|
|
|
- if (ind === -1) return;
|
|
|
|
|
|
+ const pos = this.getAttachmentPos(this.curAttachment);
|
|
|
|
+ if (!pos) return;
|
|
|
|
|
|
const info = data.data;
|
|
const info = data.data;
|
|
- this.curAttachment = { ...this.paperAttachments[ind] };
|
|
|
|
- this.paperAttachments[ind] = Object.assign(this.paperAttachments[ind], {
|
|
|
|
- paperId: this.cardBuildPresetData.paperId,
|
|
|
|
- cardType: this.cardBuildPresetData.type,
|
|
|
|
- createMethod: this.cardBuildPresetData.createMethod,
|
|
|
|
- filename: this.cardBuildPresetData.paperName,
|
|
|
|
- cardId: info.id,
|
|
|
|
- cardTitle: info.title,
|
|
|
|
- uuid: info.uuid,
|
|
|
|
- attachmentId: info.attachmentId,
|
|
|
|
- paperUrl: info.paperUrl,
|
|
|
|
- });
|
|
|
|
- this.getTkCardList(this.paperAttachments[ind]);
|
|
|
|
|
|
+ this.curAttachment = {
|
|
|
|
+ ...this.paperAttachments[pos.pindex].paperAttachmentIds[pos.index],
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ Object.assign(
|
|
|
|
+ this.paperAttachments[pos.pindex].paperAttachmentIds[pos.index],
|
|
|
|
+ {
|
|
|
|
+ paperId: this.cardBuildPresetData.paperId,
|
|
|
|
+ cardType: this.cardBuildPresetData.type,
|
|
|
|
+ createMethod: this.cardBuildPresetData.createMethod,
|
|
|
|
+ filename: this.cardBuildPresetData.paperName,
|
|
|
|
+ cardId: info.id,
|
|
|
|
+ cardTitle: info.title,
|
|
|
|
+ uuid: info.uuid,
|
|
|
|
+ attachmentId: info.attachmentId,
|
|
|
|
+ paperUrl: info.paperUrl,
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ this.getTkCardList(
|
|
|
|
+ this.paperAttachments[pos.pindex].paperAttachmentIds[pos.index]
|
|
|
|
+ );
|
|
},
|
|
},
|
|
toViewPaper(attachment) {
|
|
toViewPaper(attachment) {
|
|
if (!attachment.paperUrl) return;
|
|
if (!attachment.paperUrl) return;
|
|
@@ -998,10 +1069,10 @@ export default {
|
|
},
|
|
},
|
|
// exam-task-detail edit
|
|
// exam-task-detail edit
|
|
addAtachment() {
|
|
addAtachment() {
|
|
- if (this.paperAttachments.length >= this.attachmentLimitCount) return;
|
|
|
|
-
|
|
|
|
|
|
+ const serialNumber = this.paperAttachments.length + 1;
|
|
const newAttachment = {
|
|
const newAttachment = {
|
|
- name: this.abc[this.paperAttachments.length],
|
|
|
|
|
|
+ name: "A",
|
|
|
|
+ serialNumber,
|
|
attachmentId: "",
|
|
attachmentId: "",
|
|
filename: "",
|
|
filename: "",
|
|
paperId: null,
|
|
paperId: null,
|
|
@@ -1016,7 +1087,19 @@ export default {
|
|
createId: null,
|
|
createId: null,
|
|
cards: [],
|
|
cards: [],
|
|
};
|
|
};
|
|
- this.paperAttachments.push(newAttachment);
|
|
|
|
|
|
+ const paperAttachment = {
|
|
|
|
+ serialNumber,
|
|
|
|
+ paperType: "",
|
|
|
|
+ paperAttachmentIds: [],
|
|
|
|
+ };
|
|
|
|
+ paperAttachment.paperAttachmentIds.push(newAttachment);
|
|
|
|
+
|
|
|
|
+ if (this.examTask.openAb) {
|
|
|
|
+ paperAttachment.paperAttachmentIds.push(
|
|
|
|
+ Object.assign(deepCopy(newAttachment), { name: "B" })
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ this.paperAttachments.push(paperAttachment);
|
|
},
|
|
},
|
|
deleteAttachment(index) {
|
|
deleteAttachment(index) {
|
|
if (this.paperAttachments.length <= 1) {
|
|
if (this.paperAttachments.length <= 1) {
|
|
@@ -1025,14 +1108,11 @@ export default {
|
|
}
|
|
}
|
|
this.paperAttachments.splice(index, 1);
|
|
this.paperAttachments.splice(index, 1);
|
|
this.paperAttachments.forEach((item, itemIndex) => {
|
|
this.paperAttachments.forEach((item, itemIndex) => {
|
|
- item.name = this.abc[itemIndex];
|
|
|
|
|
|
+ item.serialNumber = itemIndex + 1;
|
|
|
|
+ item.paperAttachmentIds.forEach((attachment) => {
|
|
|
|
+ attachment.serialNumber = item.serialNumber;
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- if (
|
|
|
|
- this.examTaskDetail.drawCount &&
|
|
|
|
- this.examTaskDetail.drawCount > this.paperAttachments.length
|
|
|
|
- ) {
|
|
|
|
- this.examTaskDetail.drawCount = this.paperAttachments.length;
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
toUpload(attachment) {
|
|
toUpload(attachment) {
|
|
this.curUploadType = "paper";
|
|
this.curUploadType = "paper";
|
|
@@ -1051,10 +1131,16 @@ export default {
|
|
},
|
|
},
|
|
uploadConfirm(attachment, uploadType) {
|
|
uploadConfirm(attachment, uploadType) {
|
|
if (uploadType === "paper") {
|
|
if (uploadType === "paper") {
|
|
- const index = this.paperAttachments.findIndex(
|
|
|
|
- (item) => item.name === attachment.name
|
|
|
|
|
|
+ const pos = this.getAttachmentPos(attachment);
|
|
|
|
+ if (!pos) return;
|
|
|
|
+
|
|
|
|
+ this.paperAttachments[pos.pindex].paperAttachmentIds.splice(
|
|
|
|
+ pos.index,
|
|
|
|
+ 1,
|
|
|
|
+ {
|
|
|
|
+ ...attachment,
|
|
|
|
+ }
|
|
);
|
|
);
|
|
- this.paperAttachments.splice(index, 1, { ...attachment });
|
|
|
|
} else {
|
|
} else {
|
|
this.paperConfirmAttachments.push(attachment);
|
|
this.paperConfirmAttachments.push(attachment);
|
|
}
|
|
}
|
|
@@ -1068,17 +1154,6 @@ export default {
|
|
// cardConfirm(data) {
|
|
// cardConfirm(data) {
|
|
// this.examTaskDetail = this.$objAssign(this.examTaskDetail, data);
|
|
// this.examTaskDetail = this.$objAssign(this.examTaskDetail, data);
|
|
// },
|
|
// },
|
|
- getTaskDetailData() {
|
|
|
|
- let data = { ...this.examTaskDetail };
|
|
|
|
- data.paperType = this.paperAttachments.map((item) => item.name).join(",");
|
|
|
|
- data.paperAttachmentIds = JSON.stringify(this.paperAttachments, (k, v) =>
|
|
|
|
- k === "url" ? undefined : v
|
|
|
|
- );
|
|
|
|
- data.paperConfirmAttachmentIds = JSON.stringify(
|
|
|
|
- this.paperConfirmAttachments
|
|
|
|
- );
|
|
|
|
- return data;
|
|
|
|
- },
|
|
|
|
// image-preview
|
|
// image-preview
|
|
toPreview(index) {
|
|
toPreview(index) {
|
|
this.curImageIndex = index;
|
|
this.curImageIndex = index;
|