Selaa lähdekoodia

命题任务编辑可选题库试卷

zhangjie 1 vuosi sitten
vanhempi
commit
35000256ed

+ 18 - 8
src/modules/base/components/course-simple/AddClazzSimpleDialog.vue

@@ -11,9 +11,16 @@
     @open="visibleChange"
   >
     <el-form ref="FilterForm" label-position="left" inline label-width="0px">
+      <el-form-item>
+        <course-select
+          v-model="filter.courseCode"
+          placeholder="请选择课程"
+          clearable
+        ></course-select>
+      </el-form-item>
       <el-form-item>
         <el-input
-          v-model.trim="clazzName"
+          v-model.trim="filter.clazzName"
           placeholder="请输入教学班名称"
           clearable
         ></el-input>
@@ -46,11 +53,11 @@
         label="教学班名称"
         min-width="120"
       ></el-table-column>
-      <el-table-column
-        prop="courseCode"
-        label="课程编码"
-        min-width="120"
-      ></el-table-column>
+      <el-table-column prop="name" label="课程名称(代码)" min-width="200">
+        <span slot-scope="scope"
+          >{{ scope.row.courseName }}({{ scope.row.courseCode }})</span
+        >
+      </el-table-column>
     </el-table>
 
     <div slot="footer">
@@ -80,7 +87,10 @@ export default {
       modalIsShow: false,
       isSubmit: false,
       dataList: [],
-      clazzName: "",
+      filter: {
+        clazzName: "",
+        courseCode: "",
+      },
       multipleSelection: [],
     };
   },
@@ -98,7 +108,7 @@ export default {
     async getList() {
       const datas = {
         examId: this.course.examId,
-        clazzName: this.clazzName,
+        ...this.filter,
       };
 
       const data = await basicTeachClazzListPage(datas);

+ 1 - 0
src/modules/base/components/course-simple/TeacherSimpleManage.vue

@@ -54,6 +54,7 @@
               >分配班级</el-button
             >
             <el-button
+              v-if="course.createId !== scope.row.userId"
               class="btn-danger"
               type="text"
               @click="toDelete(scope.row)"

+ 3 - 2
src/modules/card/components/ModifyCard.vue

@@ -40,9 +40,10 @@ export default {
     open() {
       this.modalIsShow = true;
     },
-    editOver(cardId) {
+    editOver(data) {
+      // data: id,title
       this.cancel();
-      this.$emit("modified", cardId);
+      this.$emit("modified", data);
     },
   },
 };

+ 1 - 2
src/modules/card/views/CardEdit.vue

@@ -280,7 +280,6 @@ export default {
       );
       this.$refs.CardDesign.unloading();
       if (result) {
-        this.cardName = "";
         this.cardId = result.id;
         this.$ls.set("cardId", this.cardId);
         this.$refs.CardDesign.updateUnsubmitStatus(false);
@@ -305,7 +304,7 @@ export default {
     },
     goback() {
       if (this.isDialog) {
-        this.$emit("exit", this.cardId);
+        this.$emit("exit", { id: this.cardId, title: this.cardName });
       } else {
         this.$router.go(-1);
       }

+ 13 - 0
src/modules/course/components/EndScoreManage.vue

@@ -50,6 +50,19 @@
           </template>
         </el-table-column>
       </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :pager-count="5"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+          @size-change="pageSizeChange"
+        >
+        </el-pagination>
+      </div>
     </div>
 
     <!-- ModifyEndScore -->

+ 365 - 159
src/modules/exam/components/ApplyContent.vue

@@ -1,13 +1,15 @@
 <template>
   <div class="apply-content task-detail">
     <div class="task-body">
-      <div v-if="IS_APPLY" class="mb-2 text-right">
+      <div class="mb-4 tab-btns">
         <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>
       <table class="table mb-2">
         <tr>
@@ -23,142 +25,230 @@
               >(已曝光)</span
             >
           </td>
-          <td>
-            <el-button
-              v-if="!attachment.isExposed && IS_APPLY"
-              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>
-            <el-button
-              v-else
-              type="text"
-              class="btn-primary"
-              @click="downloadPaper(attachment)"
-            >
-              <i
-                class="icon icon-download mr-1"
-                v-if="attachment.attachmentId"
-              ></i>
-              <i
-                :class="{
-                  'color-primary': auditLogCache.paper[attachment.attachmentId],
-                }"
-                >{{ attachment.filename }}</i
+          <template v-if="IS_TIKU_TAB">
+            <td>
+              <el-button
+                v-if="!attachment.isExposed && IS_APPLY"
+                type="text"
+                class="btn-primary"
+                @click="toSelect(attachment)"
               >
-            </el-button>
-          </td>
-          <td>
-            <template v-if="IS_APPLY">
-              <el-select
-                class="mr-2"
-                v-model="attachment.cardId"
-                placeholder="请选择"
-                style="width: 200px"
-                filterable
-                @visible-change="
-                  (visible) => cardOptionOpened(visible, attachment)
-                "
-                @change="cardChange(attachment)"
+                <i
+                  :class="[
+                    'icon',
+                    attachment.attachmentId ? 'icon-files-act' : 'icon-files',
+                  ]"
+                ></i
+                >{{ attachment.filename || "选择试卷" }}
+              </el-button>
+              <el-button
+                v-else
+                type="text"
+                class="btn-primary"
+                @click="downloadPaper(attachment)"
               >
-                <el-option
-                  v-for="item in cards"
-                  :key="item.id"
-                  :value="item.id"
-                  :label="item.title"
-                  :disabled="item.disabled"
+                <i
+                  class="icon icon-download mr-1"
+                  v-if="attachment.attachmentId"
+                ></i>
+                <i
+                  :class="{
+                    'color-primary':
+                      auditLogCache.paper[attachment.attachmentId],
+                  }"
+                  >{{ attachment.filename }}</i
                 >
-                  <span
-                    :class="[
-                      item.type === 'GENERIC'
-                        ? 'color-success'
-                        : 'color-primary',
-                      'mr-1',
-                      {
-                        'color-danger': item.used,
-                      },
-                    ]"
-                    >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
+              </el-button>
+            </td>
+            <td>
+              <template v-if="IS_APPLY">
+                <el-select
+                  v-model="attachment.cardId"
+                  placeholder="请选择"
+                  style="width: 260px; margin-right: 10px"
+                >
+                  <el-option
+                    v-if="attachment.cardId"
+                    :value="attachment.cardId"
+                    :label="attachment.cardTitle"
                   >
-                  {{ item.title }}
-                </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-option>
+                </el-select>
+                <el-button
+                  class="btn-primary"
+                  type="text"
+                  :disabled="!attachment.cardId"
+                  @click="toViewCard(attachment)"
+                  >预览</el-button
+                >
+                <el-button
+                  class="btn-primary"
+                  type="text"
+                  :disabled="!attachment.cardId"
+                  @click="toEditCard(attachment)"
+                  >编辑</el-button
+                >
+              </template>
               <el-button
-                class="btn-primary"
+                v-else
                 type="text"
-                :disabled="!attachment.cardId"
+                class="btn-primary"
                 @click="toViewCard(attachment)"
-                >预览</el-button
+                ><i
+                  :class="{
+                    'color-primary': auditLogCache.card[attachment.cardId],
+                  }"
+                  >{{ attachment.cardTitle || "预览" }}</i
+                ></el-button
               >
+            </td>
+          </template>
+          <template v-else>
+            <td>
               <el-button
-                class="btn-primary"
+                v-if="!attachment.isExposed && IS_APPLY"
                 type="text"
-                :disabled="
-                  !attachment.cardId ||
-                  (attachment.cardType === 'GENERIC' &&
-                    attachment.createMethod !== 'STANDARD')
-                "
-                @click="toCopyCard(attachment)"
-                >复制</el-button
+                class="btn-primary"
+                @click="toUpload(attachment)"
               >
+                <i
+                  :class="[
+                    'icon',
+                    attachment.attachmentId ? 'icon-files-act' : 'icon-files',
+                  ]"
+                ></i
+                >{{
+                  attachment.attachmentId
+                    ? attachment.filename
+                    : "点击上传试卷文件"
+                }}
+              </el-button>
               <el-button
-                class="btn-primary"
+                v-else
                 type="text"
-                :disabled="
-                  !attachment.cardId ||
-                  attachment.cardType === 'GENERIC' ||
-                  !(!attachment.used && attachment.createId === user.id)
-                "
-                @click="toEditCard(attachment)"
-                >编辑</el-button
+                class="btn-primary"
+                @click="downloadPaper(attachment)"
               >
+                <i
+                  class="icon icon-download mr-1"
+                  v-if="attachment.attachmentId"
+                ></i>
+                <i
+                  :class="{
+                    'color-primary':
+                      auditLogCache.paper[attachment.attachmentId],
+                  }"
+                  >{{ attachment.filename }}</i
+                >
+              </el-button>
+            </td>
+            <td>
+              <template v-if="IS_APPLY">
+                <el-select
+                  class="mr-2"
+                  v-model="attachment.cardId"
+                  placeholder="请选择"
+                  style="width: 200px"
+                  filterable
+                  @visible-change="
+                    (visible) => cardOptionOpened(visible, attachment)
+                  "
+                  @change="cardChange(attachment)"
+                >
+                  <el-option
+                    v-for="item in cards"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.title"
+                    :disabled="item.disabled"
+                  >
+                    <span
+                      :class="[
+                        item.type === 'GENERIC'
+                          ? 'color-success'
+                          : 'color-primary',
+                        'mr-1',
+                        {
+                          'color-danger': item.used,
+                        },
+                      ]"
+                      >[{{ item.type === "GENERIC" ? "通" : "专" }}]</span
+                    >
+                    {{ item.title }}
+                  </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
+                >
+                <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>
               <el-button
-                class="btn-primary"
+                v-else
                 type="text"
-                :disabled="!canCreateCard"
-                @click="toCreateCard(attachment)"
-                >新建</el-button
+                class="btn-primary"
+                @click="toViewCard(attachment)"
+                ><i
+                  :class="{
+                    'color-primary': auditLogCache.card[attachment.cardId],
+                  }"
+                  >{{ attachment.cardTitle || "预览" }}</i
+                ></el-button
               >
-            </template>
+            </td>
+          </template>
+          <td v-if="IS_APPLY" class="text-right">
             <el-button
-              v-else
+              v-if="index === paperAttachments.length - 1"
+              class="btn-primary btn-icon"
               type="text"
-              class="btn-primary"
-              @click="toViewCard(attachment)"
-              ><i
-                :class="{
-                  'color-primary': auditLogCache.card[attachment.cardId],
-                }"
-                >{{ attachment.cardTitle || "预览" }}</i
-              ></el-button
-            >
-          </td>
-          <td v-if="IS_APPLY">
+              icon="el-icon-circle-plus"
+              @click="addAtachment"
+            ></el-button>
             <el-button
               v-if="attachment.canDelete"
               class="btn-danger"
@@ -531,11 +621,27 @@
     ></select-user-dialog>
     <!-- ModifyCard -->
     <modify-card ref="ModifyCard" @modified="cardModified"></modify-card>
+
+    <!-- SelectTikuPaperDialog -->
+    <select-tiku-paper-dialog
+      ref="SelectTikuPaperDialog"
+      :row="curAttachment"
+      @confirm="tikuPaperSelected"
+    ></select-tiku-paper-dialog>
+    <!-- CardBuildDialog -->
+    <card-build-dialog
+      ref="CardBuildDialog"
+      :presetData="cardBuildPresetData"
+      @confirm="cardBuildConfirm"
+    ></card-build-dialog>
   </div>
 </template>
 
 <script>
 import UploadPaperDialog from "./UploadPaperDialog";
+import SelectTikuPaperDialog from "./createExamAndPrintTask/SelectTikuPaperDialog.vue";
+import CardBuildDialog from "../../card/components/CardBuildDialog.vue";
+
 import {
   taskApplyDetail,
   updateTaskApply,
@@ -597,6 +703,8 @@ export default {
     SimpleImagePreview,
     SelectUserDialog,
     ModifyCard,
+    CardBuildDialog,
+    SelectTikuPaperDialog,
   },
   props: {
     examTask: {
@@ -613,6 +721,17 @@ export default {
   data() {
     return {
       isSubmit: false,
+      tabs: [
+        {
+          name: "上传本地试卷",
+          val: "upload",
+        },
+        {
+          name: "从题库选择试卷",
+          val: "tiku",
+        },
+      ],
+      curTab: "upload",
       user: {},
       curTaskApply: { ...initTaskApply },
       paperConfirmAttachmentId: { attachmentId: "", filename: "", url: "" },
@@ -681,6 +800,8 @@ export default {
       selectUserType: "exchange", // exchange:转审,approve:下一节点审核
       curSelectedUsers: [],
       auditLogCache: { paper: {}, card: {} },
+      // card-build
+      cardBuildPresetData: {},
       // 选择下一节点审批人
       IS_NEED_SELECT_APPROVE_USER: false,
       nextFlowTaskResult: {}, //下一节点信息
@@ -712,6 +833,9 @@ export default {
     FLOW_IS_OVER() {
       return ["END", "FINISH"].includes(this.curTaskApply.flowStatus);
     },
+    IS_TIKU_TAB() {
+      return this.curTab === "tiku";
+    },
     maxFetchCount() {
       return this.paperAttachments.length < 1
         ? 1
@@ -763,6 +887,14 @@ export default {
         ? JSON.parse(this.curTaskApply.paperAttachmentIds)
         : [];
 
+      const pAttachment = this.paperAttachments.some((item) => !!item.paperId);
+      if (pAttachment) {
+        this.curTab = "tiku";
+        this.curTaskApply.uuid = pAttachment.uuid || this.$randomCode(32);
+      } else {
+        this.curTab = "upload";
+      }
+
       const exposedPaperType = data.exposedPaperType || "";
       let exposedPaperTypes = exposedPaperType.split(",");
       exposedPaperTypes.sort((a, b) => (a > b ? -1 : 1));
@@ -800,6 +932,23 @@ export default {
 
       // if (this.IS_AUDIT) this.getCurFlowNodeInfo();
     },
+    async selectMenu(tab) {
+      if (!this.IS_APPLY) return;
+
+      const attachment = this.paperAttachments[0];
+      if (attachment.cardId || attachment.attachmentId) {
+        const result = await this.$confirm(
+          "更改类型会清空已设置数据,确定要更改类型?",
+          "提示",
+          {
+            type: "warning",
+          }
+        ).catch(() => {});
+        if (result !== "confirm") return;
+      }
+
+      this.curTab = tab;
+    },
     async getCardList() {
       if (!this.curTaskApply.courseCode || !this.curTaskApply.examId) return;
       const data = await cardForSelectList({
@@ -908,6 +1057,8 @@ export default {
         name,
         attachmentId: "",
         filename: "",
+        paperId: null,
+        uuid: null,
         cardId: "",
         cardType: "",
         createMethod: "",
@@ -982,7 +1133,7 @@ export default {
         attachment.cardId,
         this.curTaskApply.courseCode
       );
-      this.cardModified(newCardId);
+      this.cardModified({ id: newCardId });
     },
     toEditCard(attachment) {
       this.curAttachment = { ...attachment };
@@ -998,10 +1149,20 @@ export default {
       });
       this.$refs.ModifyCard.open();
     },
-    async cardModified(cardId) {
-      if (!cardId) return;
+    async cardModified(data) {
+      // data: {id,title}
+      if (!data.id) return;
+
+      if (this.IS_TIKU_TAB) {
+        const aind = this.paperAttachments.findIndex(
+          (item) => item.name === this.curAttachment.name
+        );
+        this.paperAttachments[aind].cardTitle = card.title;
+        return;
+      }
+
       await this.getCardList();
-      let card = this.cards.find((item) => item.id === cardId);
+      let card = this.cards.find((item) => item.id === data.id);
 
       const aind = this.paperAttachments.findIndex(
         (item) => item.name === this.curAttachment.name
@@ -1121,48 +1282,45 @@ export default {
       return data;
     },
     checkDataValid() {
-      // 设置了入库强制包含试卷时,校验试卷是否上传。
-      // 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。
-      if (this.curTaskApply.includePaper) {
+      if (this.IS_TIKU_TAB) {
         const attachmentValid = !this.paperAttachments.some(
-          (item) => !item.attachmentId
+          (item) => !item.cardId
         );
         if (!attachmentValid) {
-          this.$message.error("请完成试卷文件上传!");
+          this.$message.error("请完成试卷选择!");
           return;
         }
       } else {
-        const hasUploadPaperAttachments = this.paperAttachments.filter(
-          (item) => item.attachmentId
-        );
-        if (
-          hasUploadPaperAttachments.length > 0 &&
-          hasUploadPaperAttachments.length !== this.paperAttachments.length
-        ) {
-          this.$message.error("有试卷文件未完成上传!");
-          return;
+        // 设置了入库强制包含试卷时,校验试卷是否上传。
+        // 未设置入库强制包含试卷时,若有试卷上传,则需要上传全部。若无试卷上传,则通过。
+        if (this.curTaskApply.includePaper) {
+          const attachmentValid = !this.paperAttachments.some(
+            (item) => !item.attachmentId
+          );
+          if (!attachmentValid) {
+            this.$message.error("请完成试卷文件上传!");
+            return;
+          }
+        } else {
+          const hasUploadPaperAttachments = this.paperAttachments.filter(
+            (item) => item.attachmentId
+          );
+          if (
+            hasUploadPaperAttachments.length > 0 &&
+            hasUploadPaperAttachments.length !== this.paperAttachments.length
+          ) {
+            this.$message.error("有试卷文件未完成上传!");
+            return;
+          }
         }
-      }
-
-      // if (!this.paperConfirmAttachments.length) {
-      //   this.$message.error("请上传附件!");
-      //   return;
-      // }
 
-      let cardValid = !this.paperAttachments.some((item) => !item.cardId);
-      if (!cardValid) {
-        this.$message.error("有试卷类型未选择题卡!");
-        return;
+        const cardValid = !this.paperAttachments.some((item) => !item.cardId);
+        if (!cardValid) {
+          this.$message.error("有试卷类型未选择题卡!");
+          return;
+        }
       }
 
-      //   const usedCards = this.paperAttachments
-      //     .filter((item) => item.cardId && item.used)
-      //     .map((item) => item.name);
-      //   if (usedCards.length) {
-      //     this.$message.error(`${usedCards.join()}卷选择的题卡已经被使用过!`);
-      //     return;
-      //   }
-
       if (this.IS_NEED_SELECT_APPROVE_USER && !this.approveUsers.length) {
         this.$message.error("请设置审核人员!");
         return;
@@ -1170,6 +1328,54 @@ export default {
 
       return true;
     },
+    // select-paper
+    toSelect(attachment) {
+      this.curAttachment = {
+        ...attachment,
+        courseCode: this.examTask.courseCode,
+      };
+      this.$refs.SelectTikuPaperDialog.open();
+    },
+    async tikuPaperSelected(data) {
+      this.cardBuildPresetData = {
+        examId: this.examTask.examId,
+        courseCode: this.examTask.courseCode,
+        courseName: this.examTask.courseName,
+        schoolName: this.$ls.get("schoolName"),
+        makeMethod: "SELF",
+        cardName: "",
+        cardRuleId: this.examTask.cardRuleId,
+        type: "CUSTOM",
+        createMethod: "STANDARD",
+        paperId: data.id,
+        paperName: data.name,
+        uuid: this.curTaskApply.uuid,
+      };
+      this.$refs.CardBuildDialog.open();
+    },
+    cardBuildConfirm(data) {
+      if (!data.success) {
+        this.$message.error(data.message);
+        return;
+      }
+      const ind = this.paperAttachments.findIndex(
+        (item) => item.name === this.curAttachment.name
+      );
+      if (ind === -1) return;
+
+      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,
+      });
+    },
     async toSave() {
       if (this.isSubmit) return;
       this.isSubmit = true;

+ 4 - 4
src/modules/exam/components/ModifyTaskPaper.vue

@@ -472,7 +472,7 @@ export default {
         attachment.cardId,
         this.curTaskApply.courseCode
       );
-      this.cardModified(newCardId);
+      this.cardModified({ id: newCardId });
     },
     toEditCard(attachment) {
       this.curAttachment = { ...attachment };
@@ -489,10 +489,10 @@ export default {
       });
       this.$refs.ModifyCard.open();
     },
-    async cardModified(cardId) {
-      if (!cardId) return;
+    async cardModified(data) {
+      if (!data.id) return;
       await this.getCardList();
-      let card = this.cards.find((item) => item.id === cardId);
+      let card = this.cards.find((item) => item.id === data.id);
 
       const aind = this.paperAttachments.findIndex(
         (item) => item.name === this.curAttachment.name

+ 34 - 9
src/modules/exam/components/createExamAndPrintTask/InfoExamTask.vue

@@ -119,7 +119,7 @@
                 <i
                   :class="[
                     'icon',
-                    attachment.filename ? 'icon-files-act' : 'icon-files',
+                    attachment.attachmentId ? 'icon-files-act' : 'icon-files',
                   ]"
                 ></i
                 >{{ attachment.filename || "选择试卷" }}
@@ -534,7 +534,22 @@ export default {
         this.$refs.examTaskComp.clearValidate();
       });
     },
-    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;
+
+        this.paperAttachments = [];
+        this.addAtachment();
+      }
+
       this.curTab = tab;
     },
     async getCardList() {
@@ -699,12 +714,22 @@ export default {
         attachment.cardId,
         this.examTask.courseCode
       );
-      this.cardModified(newCardId);
+      this.cardModified({ id: newCardId });
     },
-    async cardModified(cardId) {
-      if (!cardId) return;
+    async cardModified(data) {
+      // data: {id,title}
+      if (!data.id) return;
+
+      if (this.IS_TIKU_TAB) {
+        const aind = this.paperAttachments.findIndex(
+          (item) => item.name === this.curAttachment.name
+        );
+        this.paperAttachments[aind].cardTitle = card.title;
+        return;
+      }
+
       await this.getCardList();
-      let card = this.cards.find((item) => item.id === cardId);
+      let card = this.cards.find((item) => item.id === data.id);
 
       const aind = this.paperAttachments.findIndex(
         (item) => item.name === this.curAttachment.name
@@ -842,13 +867,13 @@ export default {
       const newAttachment = {
         name: this.abc[this.paperAttachments.length],
         attachmentId: "",
+        filename: "",
+        paperId: null,
+        uuid: null,
         cardId: "",
         cardType: "",
         createMethod: "",
         cardTitle: "",
-        filename: "",
-        paperId: null,
-        uuid: null,
         pages: 0,
         used: false,
         createId: null,