Преглед на файлове

fiex:学时审核优化

Tang преди 3 години
родител
ревизия
32bdd399cc

+ 54 - 16
src/views/education/classManageMent/classHoursReview/studyTimes.vue

@@ -121,36 +121,36 @@
     <div style="max-height: 540px; overflow: auto">
       <el-table
         :default-expand-all="defaultExpand"
-        v-for="(asrt, insrt) in 3"
+        v-for="asrt in computedList(listLabel)"
         border
         v-loading="loading"
-        :key="insrt"
+        :key="asrt.value"
         :data="
           listData[
-            insrt === 0
+            asrt.value === 0
               ? 'tableData1'
-              : insrt === 1
+              : asrt.value === 1
               ? 'tableData2'
-              : insrt === 2
+              : asrt.value === 2
               ? 'tableData3'
               : ''
           ]
         "
         style="width: 100%"
         :header-cell-style="
-          insrt === 0
+          asrt.value === 0
             ? {
                 'background-color': 'skyblue',
                 padding: '8px',
                 color: '#333',
               }
-            : insrt === 1
+            : asrt.value === 1
             ? {
                 'background-color': 'rgb(255,255,204)',
                 padding: '8px',
                 color: '#333',
               }
-            : insrt === 2
+            : asrt.value === 2
             ? {
                 'background-color': '#eee',
                 padding: '8px',
@@ -162,11 +162,11 @@
         <!-- 插槽开始--------------------------------------------------------- -->
         <el-table-column
           :label="
-            insrt === 0
+            asrt.value === 0
               ? '模块'
-              : insrt === 1
+              : asrt.value === 1
               ? '章'
-              : insrt === 2
+              : asrt.value === 2
               ? '节/卷'
               : ''
           "
@@ -258,7 +258,7 @@
                   ? scope.row.classPeriodSectionList
                   : ''
               "
-              style="width: 100%"
+              style="width: 98%; margin-left: 2%"
               :default-expand-all="defaultExpand"
               :header-cell-style="
                 scope.row.type === 1
@@ -403,7 +403,7 @@
                         ? scope2.row.classPeriodSectionList
                         : ''
                     "
-                    style="width: 100%"
+                    style="width: 98%; margin-left: 2%"
                     :default-expand-all="defaultExpand"
                     :header-cell-style="
                       scope2.row.type === 2
@@ -688,11 +688,11 @@
         <!-- 插槽结束--------------------------------------------------------- -->
 
         <el-table-column
-          v-for="(item, index) in insrt === 0
+          v-for="(item, index) in asrt.value === 0
             ? tableSet1
-            : insrt === 1
+            : asrt.value === 1
             ? tableSet2
-            : insrt === 2
+            : asrt.value === 2
             ? tableSet3
             : ''"
           :width="item.width"
@@ -775,6 +775,20 @@ export default {
       recent_photos: "",
       idcard_face_photo: "",
       idcard_national_photo: "",
+      listLabel: [
+        {
+          label: "模块卷",
+          value: 0,
+        },
+        {
+          label: "章卷",
+          value: 1,
+        },
+        {
+          label: "节",
+          value: 2,
+        },
+      ],
       arr: ["tableData1", "tableData2", "tableData3"],
       listData: {
         tableData1: [],
@@ -904,6 +918,30 @@ export default {
       tableSetChild: [],
     };
   },
+  computed: {
+    computedList: function () {
+      return function (value) {
+        var arr = value.filter((item) => {
+          if (item.value === 0) {
+            if (this.listData.tableData1.length) {
+              return item;
+            }
+          }
+          if (item.value === 1) {
+            if (this.listData.tableData2.length) {
+              return item;
+            }
+          }
+          if (item.value === 2) {
+            if (this.listData.tableData3.length) {
+              return item;
+            }
+          }
+        });
+        return arr;
+      };
+    },
+  },
   mounted() {
     this.getUserInfo();
     this.search();

+ 55 - 17
src/views/education/classManageMent/learningHoursRecordList/studyTimesRecord.vue

@@ -140,19 +140,19 @@
         </div>
       </div>
     </div>
-    <div style="max-height:350px;overflow:auto;">
+    <div style="max-height: 350px; overflow: auto">
       <el-table
-        v-for="(asrt, insrt) in 3"
+        v-for="asrt in computedList(listLabel)"
         border
         v-loading="loading"
-        :key="insrt"
+        :key="asrt.value"
         :data="
           listData[
-            insrt === 0
+            asrt.value === 0
               ? 'tableData1'
-              : insrt === 1
+              : asrt.value === 1
               ? 'tableData2'
-              : insrt === 2
+              : asrt.value === 2
               ? 'tableData3'
               : ''
           ]
@@ -160,19 +160,19 @@
         style="width: 100%"
         :default-expand-all="defaultExpand"
         :header-cell-style="
-          insrt === 0
+          asrt.value === 0
             ? {
                 'background-color': 'skyblue',
                 padding: '8px',
                 color: '#333',
               }
-            : insrt === 1
+            : asrt.value === 1
             ? {
                 'background-color': 'rgb(255,255,204)',
                 padding: '8px',
                 color: '#333',
               }
-            : insrt === 2
+            : asrt.value === 2
             ? {
                 'background-color': '#eee',
                 padding: '8px',
@@ -184,11 +184,11 @@
         <!-- 插槽开始--------------------------------------------------------- -->
         <el-table-column
           :label="
-            insrt === 0
+            asrt.value === 0
               ? '模块'
-              : insrt === 1
+              : asrt.value === 1
               ? '章'
-              : insrt === 2
+              : asrt.value === 2
               ? '节/卷'
               : ''
           "
@@ -280,7 +280,7 @@
                   ? scope.row.classPeriodSectionList
                   : ''
               "
-              style="width: 100%"
+              style="width: 98%; margin-left: 2%"
               :default-expand-all="defaultExpand"
               :header-cell-style="
                 scope.row.type === 1
@@ -425,7 +425,7 @@
                         ? scope2.row.classPeriodSectionList
                         : ''
                     "
-                    style="width: 100%"
+                    style="width: 98%; margin-left: 2%"
                     :default-expand-all="defaultExpand"
                     :header-cell-style="
                       scope2.row.type === 2
@@ -710,11 +710,11 @@
         <!-- 插槽结束--------------------------------------------------------- -->
 
         <el-table-column
-          v-for="(item, index) in insrt === 0
+          v-for="(item, index) in asrt.value === 0
             ? tableSet1
-            : insrt === 1
+            : asrt.value === 1
             ? tableSet2
-            : insrt === 2
+            : asrt.value === 2
             ? tableSet3
             : ''"
           :width="item.width"
@@ -803,6 +803,20 @@ export default {
       recent_photos: "",
       idcard_face_photo: "",
       idcard_national_photo: "",
+      listLabel: [
+        {
+          label: "模块卷",
+          value: 0,
+        },
+        {
+          label: "章卷",
+          value: 1,
+        },
+        {
+          label: "节",
+          value: 2,
+        },
+      ],
       arr: ["tableData1", "tableData2", "tableData3"],
       listData: {
         tableData1: [],
@@ -933,6 +947,30 @@ export default {
       tableSetChild: [],
     };
   },
+  computed: {
+    computedList: function () {
+      return function (value) {
+        var arr = value.filter((item) => {
+          if (item.value === 0) {
+            if (this.listData.tableData1.length) {
+              return item;
+            }
+          }
+          if (item.value === 1) {
+            if (this.listData.tableData2.length) {
+              return item;
+            }
+          }
+          if (item.value === 2) {
+            if (this.listData.tableData3.length) {
+              return item;
+            }
+          }
+        });
+        return arr;
+      };
+    },
+  },
   mounted() {
     this.getUserInfo();
     this.search();