|
@@ -75,10 +75,15 @@
|
|
|
<th v-if="IS_EDIT">操作</th>
|
|
|
</tr>
|
|
|
<tr v-for="(attachment, index) in paperAttachments" :key="index">
|
|
|
- <td>{{ attachment.name }}卷</td>
|
|
|
+ <td>
|
|
|
+ <span>{{ attachment.name }}卷</span>
|
|
|
+ <span class="color-gray-2" v-if="attachment.isExposed"
|
|
|
+ >(已曝光)</span
|
|
|
+ >
|
|
|
+ </td>
|
|
|
<td>
|
|
|
<el-button
|
|
|
- v-if="attachment.editable && IS_EDIT"
|
|
|
+ v-if="!attachment.isExposed && IS_EDIT"
|
|
|
type="text"
|
|
|
class="btn-primary"
|
|
|
@click="toUpload(attachment)"
|
|
@@ -127,7 +132,7 @@
|
|
|
</td>
|
|
|
<td v-if="IS_EDIT">
|
|
|
<el-button
|
|
|
- v-if="attachment.editable"
|
|
|
+ v-if="attachment.canDelete"
|
|
|
class="btn-danger"
|
|
|
type="text"
|
|
|
@click="deleteAttachment(index)"
|
|
@@ -136,6 +141,24 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
+
|
|
|
+ <p class="tips-info tips-dark mb-2">
|
|
|
+ 提示:多卷型试卷由于会绑定一个答题卡模板,因此试卷结构必须相同。多卷型试卷之间客观题要求试题内容相同,可允许大题内的小题题序不同。
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="单次抽卷卷型数量:" label-width="150">
|
|
|
+ <el-input-number
|
|
|
+ v-model="curTaskApply.drawCount"
|
|
|
+ :min="1"
|
|
|
+ :max="maxFetchCount"
|
|
|
+ :step="1"
|
|
|
+ step-strictly
|
|
|
+ :controls="false"
|
|
|
+ :disabled="!IS_EDIT || exposedMode"
|
|
|
+ ></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer">
|
|
@@ -182,6 +205,8 @@ const initTaskApply = {
|
|
|
makeMethod: "",
|
|
|
courseCode: "",
|
|
|
courseName: "",
|
|
|
+ drawCount: 1,
|
|
|
+ exposedPaperType: "",
|
|
|
// 题卡状态
|
|
|
status: "",
|
|
|
// 考务规则
|
|
@@ -190,7 +215,7 @@ const initTaskApply = {
|
|
|
};
|
|
|
|
|
|
export default {
|
|
|
- name: "preview-task-paper",
|
|
|
+ name: "modify-task-paper",
|
|
|
components: { UploadPaperDialog, CardOptionDialog },
|
|
|
props: {
|
|
|
instance: {
|
|
@@ -232,6 +257,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return name;
|
|
|
+ },
|
|
|
+ maxFetchCount() {
|
|
|
+ return this.paperAttachments.length < 1
|
|
|
+ ? 1
|
|
|
+ : this.paperAttachments.length;
|
|
|
+ },
|
|
|
+ exposedMode() {
|
|
|
+ return !!this.curTaskApply.exposedPaperType;
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -240,7 +273,6 @@ export default {
|
|
|
modalIsShow: false,
|
|
|
curTaskApply: { ...initTaskApply },
|
|
|
paperAttachments: [],
|
|
|
- paperConfirmAttachments: [],
|
|
|
curAttachment: {},
|
|
|
curUploadType: "paper",
|
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
@@ -265,9 +297,16 @@ export default {
|
|
|
this.paperAttachments = data.paperAttachmentIds
|
|
|
? JSON.parse(data.paperAttachmentIds)
|
|
|
: [];
|
|
|
- const exposedPaperType = this.instance.exposedPaperType || "";
|
|
|
+
|
|
|
+ const exposedPaperType = data.exposedPaperType || "";
|
|
|
+ let exposedPaperTypes = exposedPaperType.split(",");
|
|
|
+ exposedPaperTypes.sort((a, b) => (a > b ? -1 : 1));
|
|
|
+ const maxExposedPaperType = exposedPaperTypes[0];
|
|
|
this.paperAttachments.forEach(paper => {
|
|
|
- paper.editable = !exposedPaperType.includes(paper.name);
|
|
|
+ paper.canDelete = maxExposedPaperType
|
|
|
+ ? paper.name > maxExposedPaperType
|
|
|
+ : true;
|
|
|
+ paper.isExposed = exposedPaperTypes.includes(paper.name);
|
|
|
});
|
|
|
},
|
|
|
cancel() {
|
|
@@ -279,19 +318,16 @@ export default {
|
|
|
addAtachment() {
|
|
|
if (this.paperAttachments.length >= this.abc.length) return;
|
|
|
|
|
|
- const paperType = this.paperAttachments.map(item => item.name);
|
|
|
- const name = this.abc.split("").find(code => !paperType.includes(code));
|
|
|
-
|
|
|
+ const name = this.abc[this.paperAttachments.length];
|
|
|
const newAttachment = {
|
|
|
name,
|
|
|
attachmentId: "",
|
|
|
filename: "",
|
|
|
pages: 0,
|
|
|
- editable: true
|
|
|
+ canDelete: true,
|
|
|
+ isExposed: false
|
|
|
};
|
|
|
this.paperAttachments.push(newAttachment);
|
|
|
-
|
|
|
- this.paperAttachments.sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
|
},
|
|
|
deleteAttachment(index) {
|
|
|
if (this.paperAttachments.length <= 1) {
|
|
@@ -299,6 +335,16 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.paperAttachments.splice(index, 1);
|
|
|
+ this.paperAttachments.forEach((item, itemIndex) => {
|
|
|
+ item.name = this.abc[itemIndex];
|
|
|
+ });
|
|
|
+
|
|
|
+ if (
|
|
|
+ this.curTaskApply.drawCount &&
|
|
|
+ this.curTaskApply.drawCount > this.paperAttachments.length
|
|
|
+ ) {
|
|
|
+ this.curTaskApply.drawCount = this.paperAttachments.length;
|
|
|
+ }
|
|
|
},
|
|
|
toUpload(attachment) {
|
|
|
this.curUploadType = "paper";
|
|
@@ -371,14 +417,6 @@ export default {
|
|
|
return data;
|
|
|
},
|
|
|
checkDataValid() {
|
|
|
- // 校验试卷类型是否连续
|
|
|
- const lastPaperName = this.paperAttachments.slice(-1)[0].name;
|
|
|
- const paperLength = this.abc.indexOf(lastPaperName) + 1;
|
|
|
- if (this.paperAttachments.length !== paperLength) {
|
|
|
- this.$message.error("请保持试卷类型连续!");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
const attachmentValid = !this.paperAttachments.some(
|
|
|
item => !item.attachmentId
|
|
|
);
|