Parcourir la source

已曝光修改

zhangjie il y a 3 ans
Parent
commit
4726c33aca

+ 3 - 0
src/assets/styles/base.scss

@@ -337,6 +337,9 @@ body {
 .color-gray {
   color: $--color-text-gray;
 }
+.color-gray-2 {
+  color: $--color-text-gray-2;
+}
 .color-white {
   color: #fff;
 }

+ 4 - 4
src/assets/styles/icons.scss

@@ -75,12 +75,12 @@
   }
   &-files {
     background-image: url(../images/icon-files.png);
-    width: 18px;
-    height: 14px;
+    width: 14px;
+    height: 12px;
   }
   &-files-act {
     background-image: url(../images/icon-files-act.png);
-    width: 18px;
-    height: 14px;
+    width: 14px;
+    height: 12px;
   }
 }

+ 19 - 7
src/assets/styles/pages.scss

@@ -213,36 +213,48 @@
 }
 // label-edit
 .label-edit {
+  min-height: 60px;
   .label-item {
     display: inline-block;
     vertical-align: top;
     border: 1px solid $--color-text-gray-6;
     border-radius: $--border-radius;
-    padding: 8px 40px 8px 10px;
+    padding: 5px 40px 5px 10px;
     position: relative;
     margin: 0 10px 10px 0;
-    line-height: 26px;
+    line-height: 21px;
   }
   .label-item-content {
     margin: 0;
-    line-height: 26px;
+    line-height: 21px;
     vertical-align: middle;
   }
   .label-item-delete {
     position: absolute;
-    width: 20px;
-    height: 20px;
     right: 10px;
     top: 50%;
-    margin-top: -10px;
+    transform: translateY(-50%);
     z-index: 99;
-    font-size: 20px;
+    font-size: 16px;
     color: $--color-text-gray-5;
     cursor: pointer;
     &:hover {
       color: $--color-danger;
     }
   }
+  .label-add {
+    display: inline-block;
+    vertical-align: top;
+    border: 1px solid $--color-text-gray-6;
+    border-radius: $--border-radius;
+    padding: 0 10px;
+    color: $--color-text-gray-2;
+    cursor: pointer;
+    &:hover {
+      border-color: $--color-primary;
+      color: $--color-primary;
+    }
+  }
 }
 
 // rule-exam

+ 2 - 2
src/modules/base/api.js

@@ -133,8 +133,8 @@ export const flowPublish = id => {
 export const flowEnd = flowId => {
   return $post("/api/admin/flow/end", { flowId });
 };
-export const flowDelete = ({ flowId, enable }) => {
-  return $post("/api/admin/flow/approve/enable", { flowId, enable });
+export const flowDelete = () => {
+  return $post("/api/admin/flow/enable", {});
 };
 export const flowRegister = (datas, headers) => {
   return $post("/api/admin/flow/register", datas, { headers });

+ 3 - 5
src/modules/base/components/RuleExam.vue

@@ -30,11 +30,9 @@
                 @click="deleteField(field)"
               ></i>
             </div>
-          </div>
-          <div>
-            <el-button type="text" icon="el-icon-plus" @click="toAddField"
-              >添加</el-button
-            >
+            <div class="label-add" @click="toAddField">
+              <i class="el-icon-plus"></i><i>添加</i>
+            </div>
           </div>
         </div>
       </el-form-item>

+ 1 - 4
src/modules/base/views/FlowManage.vue

@@ -135,10 +135,7 @@ export default {
         type: "warning"
       })
         .then(async () => {
-          await flowDelete({
-            flowId: row.id,
-            enable: false
-          });
+          await flowDelete();
           this.$message.success("操作成功!");
           this.getList();
         })

+ 35 - 9
src/modules/exam/components/ApplyContent.vue

@@ -18,10 +18,15 @@
           <th v-if="IS_APPLY">操作</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="IS_APPLY"
+              v-if="!attachment.isExposed && IS_APPLY"
               type="text"
               class="btn-primary"
               @click="toUpload(attachment)"
@@ -58,7 +63,7 @@
             <el-button
               type="text"
               class="btn-primary"
-              v-if="IS_APPLY"
+              v-if="!exposedMode && IS_APPLY"
               @click="toCreateOrViewCard"
               >{{ cardTodoName }}</el-button
             >
@@ -74,6 +79,7 @@
               v-if="
                 curTaskApply.makeMethod &&
                   curTaskApply.makeMethod !== 'CUST' &&
+                  !exposedMode &&
                   IS_APPLY
               "
               type="text"
@@ -84,6 +90,7 @@
           </td>
           <td v-if="IS_APPLY">
             <el-button
+              v-if="attachment.canDelete"
               class="btn-danger"
               type="text"
               @click="deleteAttachment(index)"
@@ -111,7 +118,7 @@
             :step="1"
             step-strictly
             :controls="false"
-            :disabled="!IS_APPLY"
+            :disabled="!IS_APPLY || exposedMode"
           ></el-input-number>
         </el-form-item>
       </el-form>
@@ -294,6 +301,7 @@ const initTaskApply = {
   courseCode: "",
   courseName: "",
   drawCount: 1,
+  exposedPaperType: "",
   // 流程
   flowId: "",
   setup: 0,
@@ -420,6 +428,9 @@ export default {
       return this.paperAttachments.length < 1
         ? 1
         : this.paperAttachments.length;
+    },
+    exposedMode() {
+      return !!this.curTaskApply.exposedPaperType;
     }
   },
   mounted() {
@@ -441,6 +452,18 @@ export default {
       this.paperAttachments = this.curTaskApply.paperAttachmentIds
         ? JSON.parse(this.curTaskApply.paperAttachmentIds)
         : [];
+
+      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.canDelete = maxExposedPaperType
+          ? paper.name > maxExposedPaperType
+          : true;
+        paper.isExposed = exposedPaperTypes.includes(paper.name);
+      });
+
       this.paperConfirmAttachments = this.curTaskApply.paperConfirmAttachmentIds
         ? JSON.parse(this.curTaskApply.paperConfirmAttachmentIds)
         : [];
@@ -511,11 +534,14 @@ export default {
     addAtachment() {
       if (this.paperAttachments.length >= this.attachmentLimitCount) return;
 
+      const name = this.abc[this.paperAttachments.length];
       const newAttachment = {
-        name: this.abc[this.paperAttachments.length],
+        name,
         attachmentId: "",
         filename: "",
-        pages: 0
+        pages: 0,
+        canDelete: true,
+        isExposed: false
       };
       this.paperAttachments.push(newAttachment);
     },
@@ -530,10 +556,10 @@ export default {
       });
 
       if (
-        this.examTaskDetail.drawCount &&
-        this.examTaskDetail.drawCount > this.paperAttachments.length
+        this.curTaskApply.drawCount &&
+        this.curTaskApply.drawCount > this.paperAttachments.length
       ) {
-        this.examTaskDetail.drawCount = this.paperAttachments.length;
+        this.curTaskApply.drawCount = this.paperAttachments.length;
       }
     },
     toUpload(attachment) {

+ 59 - 21
src/modules/exam/components/ModifyTaskPaper.vue

@@ -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
       );