Browse Source

bug修改

zhangjie 3 năm trước cách đây
mục cha
commit
1c228f2a5f

+ 12 - 13
src/components/base/ClazzSelect.vue

@@ -41,10 +41,7 @@ export default {
     clearable: { type: Boolean, default: true },
     multiple: { type: Boolean, default: false },
     datas: {
-      type: Array,
-      default() {
-        return [];
-      }
+      type: Array
     }
   },
   data() {
@@ -61,21 +58,23 @@ export default {
       handler(val) {
         this.selected = val;
       }
+    },
+    datas: {
+      immediate: true,
+      handler(val) {
+        if (!val) return;
+        this.optionList = val.map(item => {
+          return { ...item };
+        });
+        this.labelChange();
+      }
     }
   },
   created() {
-    this.search();
+    if (!this.datas) this.search();
   },
   methods: {
     async search() {
-      if (this.datas && this.datas.length) {
-        this.optionList = this.datas.map(item => {
-          return { ...item };
-        });
-        this.labelChange();
-        return;
-      }
-
       const res = await clazzQuery();
       this.optionList = res || [];
       this.labelChange();

+ 5 - 5
src/constants/navs.js

@@ -182,6 +182,11 @@ const navs = [
             url: "CampusManage",
             isRouter: true
           },
+          {
+            name: "班级管理",
+            url: "ClazzManage",
+            isRouter: true
+          },
           {
             name: "学生基本信息管理",
             url: "StudentManage",
@@ -191,11 +196,6 @@ const navs = [
             name: "课程管理",
             url: "CourseManage",
             isRouter: true
-          },
-          {
-            name: "班级管理",
-            url: "ClazzManage",
-            isRouter: true
           }
         ]
       }

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

@@ -16,7 +16,7 @@
       <el-table ref="TableList" :data="dataList">
         <el-table-column prop="campusName" label="校区名称"></el-table-column>
         <el-table-column prop="campusCode" label="校区编码"></el-table-column>
-        <el-table-column prop="printHouseName" label="教研室"></el-table-column>
+        <el-table-column prop="printHouseName" label="印刷室"></el-table-column>
         <el-table-column label="操作" width="120px">
           <template slot-scope="scope">
             <el-button

+ 2 - 5
src/modules/exam/components/CreatePrintTask.vue

@@ -39,7 +39,6 @@
       </el-form-item>
       <el-form-item prop="classId" label="考试对象:">
         <clazz-select
-          v-if="classList.length"
           v-model="classIds"
           placeholder="请选择"
           multiple
@@ -240,16 +239,14 @@ export default {
       this.printRooms = await listTaskPrintHouse();
     },
     async getClazzs() {
+      this.classList = [];
       const data = await listTaskPrintClass({
         printPlanId: this.instance.printPlanId,
         courseCode: this.instance.courseCode,
         paperNumber: this.instance.paperNumber,
         examTaskPrintId: this.instance.id
       });
-      if (!data) {
-        this.classList = [];
-        return;
-      }
+      if (!data) return;
 
       this.classList = data.map(item => {
         return {