zhangjie 1 år sedan
förälder
incheckning
46082d8ef2

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

@@ -39,6 +39,13 @@
         vertical-align: middle;
       }
     }
+
+    .el-button {
+      text-align: left;
+      span {
+        white-space: normal;
+      }
+    }
   }
   .icon {
     margin-right: 8px;

+ 23 - 17
src/components/MoreText.vue

@@ -1,6 +1,5 @@
 <template>
-  <div class="more-text">
-    <span>{{ showContent }}</span>
+  <span class="more-text">
     <el-popover
       v-if="moreContent"
       placement="top"
@@ -8,25 +7,20 @@
       trigger="hover"
       :content="moreContent"
     >
-      <el-button
-        class="ml-1"
-        type="text"
-        icon="el-icon-more"
-        slot="reference"
-      ></el-button>
+      <span slot="reference">{{ showContent }}...</span>
     </el-popover>
-  </div>
+    <span v-else>{{ showContent }}</span>
+  </span>
 </template>
 
 <script>
+import { objTypeOf } from "@/plugins/utils";
 export default {
   name: "more-text",
   props: {
     data: {
-      type: Array,
-      default() {
-        return [];
-      },
+      type: [Array, String],
+      default: null,
     },
     showCount: {
       type: Number,
@@ -49,10 +43,22 @@ export default {
   },
   methods: {
     initData() {
-      this.showContent = this.data.slice(0, this.showCount).join(",");
-      this.moreContent = "";
-      if (this.data.length > this.showCount) {
-        this.moreContent = this.data.join(",");
+      if (!this.data) return;
+
+      const type = objTypeOf(this.data);
+
+      if (type === "array") {
+        this.showContent = this.data.slice(0, this.showCount).join(",");
+        this.moreContent = "";
+        if (this.data.length > this.showCount) {
+          this.moreContent = this.data.join(",");
+        }
+      } else if (type === "string") {
+        this.showContent = this.data.substring(0, this.showCount);
+        this.moreContent = "";
+        if (this.data.length > this.showCount) {
+          this.moreContent = this.data;
+        }
       }
     },
   },

+ 18 - 10
src/modules/base/components/ModifyExamStudent.vue

@@ -29,6 +29,7 @@
           v-model="modalForm.examId"
           :semester-id="modalForm.semesterId"
           placeholder="考试"
+          @change="examChange"
         ></exam-select>
       </el-form-item>
       <el-form-item prop="courseCode" label="课程:">
@@ -190,6 +191,7 @@ export default {
       isSubmit: false,
       modalForm: { ...initModalForm },
       rules: {},
+      curExam: {},
       // date-picker
       curCreateTime: [],
       createDate: "",
@@ -220,11 +222,17 @@ export default {
       const curDate = getTimeDatestamp(Date.now());
       const hour = 60 * 60 * 1000;
       this.createTime = [curDate + 8 * hour, curDate + 10 * hour];
+      this.createDate = null;
     },
     visibleChange() {
       this.initData(this.instance);
     },
+    examChange(val) {
+      this.curExam = val || {};
+      this.updateRules();
+    },
     updateRules() {
+      const paperNumberRequired = this.curExam.examModel === "MODEL4";
       this.rules = {
         semesterId: [
           {
@@ -278,7 +286,7 @@ export default {
         ],
         college: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入学院",
             trigger: "change",
           },
@@ -290,7 +298,7 @@ export default {
         ],
         major: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入专业",
             trigger: "change",
           },
@@ -314,7 +322,7 @@ export default {
         ],
         teacherName: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入任课老师名称",
             trigger: "change",
           },
@@ -326,7 +334,7 @@ export default {
         ],
         teacherCode: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入任课老师工号",
             trigger: "change",
           },
@@ -338,12 +346,12 @@ export default {
         ],
         paperNumber: [
           {
-            message: "只能由数字、字母、短横线和下划线组成",
-            pattern: /^[a-zA-Z0-9_].+$/,
+            message: "只能由数字、字母、短横线、下划线和小括号组成",
+            pattern: /^[a-zA-Z0-9_()()-]{1,30}$/,
             trigger: "change",
           },
           {
-            required: false,
+            required: paperNumberRequired,
             message: "试卷编码不能超过30个字",
             max: 30,
             trigger: "change",
@@ -351,14 +359,14 @@ export default {
         ],
         examStartTime: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入考试时间",
             trigger: "change",
           },
         ],
         examPlace: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入考点(校区)",
             trigger: "change",
           },
@@ -370,7 +378,7 @@ export default {
         ],
         examRoom: [
           {
-            required: !!this.modalForm.paperNumber,
+            required: !!this.modalForm.paperNumber || paperNumberRequired,
             message: "请输入考场(考试教室)",
             trigger: "change",
           },

+ 1 - 1
src/modules/base/views/ExamStudentManage.vue

@@ -369,7 +369,7 @@ export default {
 
       this.loading = true;
       const res = await downloadByApi(() => {
-        return exportExamStudent(this.filter);
+        return exportExamStudent({ ...this.filterSe, ...this.filter });
       }, "").catch((e) => {
         this.$message.error(e || "下载失败,请重新尝试!");
       });

+ 25 - 16
src/modules/exam/components/ApplyContent.vue

@@ -12,6 +12,11 @@
         </el-button>
       </div>
       <table class="table mb-2">
+        <colgroup>
+          <col width="80" />
+          <col width="300" />
+          <col width="300" />
+        </colgroup>
         <tr>
           <th>试卷类型</th>
           <th>试卷文件</th>
@@ -47,17 +52,18 @@
                 class="btn-primary"
                 @click="downloadPaper(attachment)"
               >
-                <i
-                  class="icon icon-download mr-1"
-                  v-if="attachment.attachmentId"
-                ></i>
-                <i
+                <div
                   :class="{
                     'color-primary':
                       auditLogCache.paper[attachment.attachmentId],
                   }"
-                  >{{ attachment.filename }}</i
                 >
+                  <i
+                    class="icon icon-download mr-1"
+                    v-if="attachment.attachmentId"
+                  ></i>
+                  {{ attachment.filename }}
+                </div>
               </el-button>
             </td>
             <td>
@@ -129,17 +135,18 @@
                 class="btn-primary"
                 @click="downloadPaper(attachment)"
               >
-                <i
-                  class="icon icon-download mr-1"
-                  v-if="attachment.attachmentId"
-                ></i>
-                <i
+                <div
                   :class="{
                     'color-primary':
                       auditLogCache.paper[attachment.attachmentId],
                   }"
-                  >{{ attachment.filename }}</i
                 >
+                  <i
+                    class="icon icon-download mr-1"
+                    v-if="attachment.attachmentId"
+                  ></i>
+                  {{ attachment.filename }}
+                </div>
               </el-button>
             </td>
             <td>
@@ -232,13 +239,15 @@
                 type="text"
                 class="btn-primary"
                 @click="toViewCard(attachment)"
-                ><i
+              >
+                <i
                   :class="{
                     'color-primary': auditLogCache.card[attachment.cardId],
                   }"
-                  >{{ attachment.cardTitle || "预览" }}</i
-                ></el-button
-              >
+                >
+                  {{ attachment.cardTitle || "预览" }}
+                </i>
+              </el-button>
             </td>
           </template>
           <td v-if="IS_APPLY" class="text-right">

+ 8 - 3
src/modules/exam/components/ModifyTaskPaper.vue

@@ -68,6 +68,11 @@
           >
         </div>
         <table class="table">
+          <colgroup>
+            <col width="100" />
+            <col width="300" />
+            <col width="300" />
+          </colgroup>
           <tr>
             <th>试卷类型</th>
             <th>试卷文件</th>
@@ -93,8 +98,8 @@
                     'icon',
                     attachment.attachmentId ? 'icon-files-act' : 'icon-files',
                   ]"
-                ></i
-                >{{
+                ></i>
+                {{
                   attachment.attachmentId
                     ? attachment.filename
                     : "点击上传试卷文件"
@@ -110,7 +115,7 @@
                   class="icon icon-download mr-1"
                   v-if="attachment.attachmentId"
                 ></i>
-                <i>{{ attachment.filename }}</i>
+                {{ attachment.filename }}
               </el-button>
             </td>
             <td>

+ 6 - 1
src/modules/print/views/PrintTaskManage.vue

@@ -634,7 +634,12 @@ export default {
         .catch(() => {});
     },
     toBatchCancelOrSubmit(type) {
-      const name = type === "submit" ? "提交" : "撤回";
+      const names = {
+        finish: "完成",
+        submit: "提交",
+        cancel: "撤回",
+      };
+      const name = names[type];
       if (!this.multipleSelection.length) {
         this.$message.error(`请选择要${name}的记录!`);
         return;