Browse Source

页面调整

name 6 years atrás
parent
commit
5bd9c1aa35
2 changed files with 82 additions and 23 deletions
  1. 64 16
      src/pages/super/CheckTeacherAudit.vue
  2. 18 7
      src/pages/super/SuperAdmin.vue

+ 64 - 16
src/pages/super/CheckTeacherAudit.vue

@@ -8,7 +8,7 @@
       <el-col :span="20" class="main" :offset="2">
 
         <el-table
-          :data="applyTeacherList.list"
+          :data="list"
           highlight-current-row
           size="medium"
           border
@@ -19,9 +19,11 @@
             header-align="center"
           >
             <template scope="scope">
-              <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
-              <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
-              <span class="scope-name">{{scope.row.name}}</span>
+              <div class="scope-list">
+                <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
+                <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
+                <span class="scope-name">{{scope.row.name}}</span>
+              </div>
             </template>
           </el-table-column>
           <el-table-column
@@ -36,9 +38,12 @@
             header-align="center"
           ></el-table-column>
           <el-table-column
-            prop="grade"
+            prop=""
             label="批改年级"
             header-align="center">
+              <template scope="scope">
+                <span v-for="(v, k) of scope.row.gradeList" :key=k v-if="v">{{v}}</span>
+              </template>
           </el-table-column>
           <el-table-column
             prop=""
@@ -46,7 +51,7 @@
             header-align="center"
           >
             <template scope="scope">
-              <el-button type="info" round>{{scope.row.period}}</el-button>
+              <el-button type="info" round v-for="(v, k) of scope.row.periodList" :key=k v-if="v">{{v}}</el-button>
             </template>
           </el-table-column>
 
@@ -116,6 +121,7 @@
         hiddenModel:false,
         applicantId:'',
         operate:'',
+        list:[],
         isPigai:false,
             options: [
         {
@@ -222,6 +228,22 @@
           pageNo: this.filters.pageNo,
           pageSize: this.filters.pageSize
         });
+        this.applyTeacherList.list = (res => {
+          const d = []
+          for (let i in res) {
+            d.push( {
+              gradeList: this.gradeBag(i),
+              periodList: res[i].period.split(';'),
+              imgUrl: res[i].imgUrl,
+              name: res[i].name,
+              school:res[i].school,
+              teacherId:res[i].teacherId,
+              subject:res[i].subject
+            })
+          }
+          return d
+        })(this.applyTeacherList.list)
+        this.list = this.applyTeacherList.list;
       },
       //申请审批操作
       async ApplyOperate() {
@@ -247,6 +269,36 @@
         s = s < 10 ? ('0' + s) : s;
         return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
       },
+      // 数组去重
+      uniq(array){
+        var temp = []; //一个新的临时数组
+        for (var i = 0; i < array.length; i++){
+          if (temp.indexOf(array[i]) == -1) {
+            temp.push(array[i]);
+          }
+        }
+        return temp;
+      },
+      //年级封装
+      gradeBag:function (res) {
+        var arr = [];
+        if (this.applyTeacherList.list[res].grade) {
+          arr = this.applyTeacherList.list[res].grade.split(',');
+        } else {
+          arr = []
+        }
+        var arrList = [];
+        for (var i in arr) {
+          if (arr[i] == '一年级' || arr[i] == '二年级') {
+            arrList.push('1-2年级')
+          } else if (arr[i] == '三年级' || arr[i] == "四年级") {
+            arrList.push('3-4年级')
+          } else if (arr[i] == '五年级' || arr[i] == "六年级") {
+            arrList.push('5-6年级')
+          }
+        }
+        return this.uniq(arrList);
+      },
       // 分页
       pageChange(val) {
         this.filters.pageNo = val;
@@ -300,16 +352,8 @@
     },
     mounted() {
       this.SuperApplyTeacherList();
-      // for (let j in applyTeacherList) {
-      //   applyTeacherList[j] = (res => {
-      //     const d = []
-      //     console.log(res)
-      //     // for (let i in res) {
-      //     //   d.push({ gradeList: res[i].homeworkPictureUrl, isVague: res[i].isVague})
-      //     // }
-      //     return d
-      //   })(applyTeacherList)
-      // }
+
+      console.log(this.list)
     }
   };
 </script>
@@ -415,6 +459,10 @@
     text-align: center;
     margin-top: 15px;
   }
+  .scope-list{
+    margin-left: 18px;
+    text-align: left;
+  }
   /*.all_pagination{*/
     /*text-align: center !important;*/
   /*}*/

+ 18 - 7
src/pages/super/SuperAdmin.vue

@@ -24,9 +24,11 @@
             header-align="center"
           >
             <template scope="scope">
-              <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
-              <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
-              <span class="scope-name">{{scope.row.name}}</span>
+              <div class="scope-list">
+                <img :src='BASE_URL+scope.row.imgUrl' alt="" class="table-img" v-if="scope.row.imgUrl">
+                <img src="../../assets/img/user.jpg" alt="" v-if="!scope.row.imgUrl" class="table-img">
+                <span class="scope-name">{{scope.row.name}}</span>
+              </div>
             </template>
           </el-table-column>
           <el-table-column
@@ -60,13 +62,18 @@
             label="家长平均评分"
             header-align="center"></el-table-column>
           <el-table-column
-            prop="status"
+            prop=""
             label="是否在线"
-            header-align="center"></el-table-column>
+            header-align="center">
+            <template scope="scope">
+                <span v-if="scope.$index==0">自己</span>
+                <span v-if="scope.$index>0">{{scope.row.status}}</span>
+            </template>
+          </el-table-column>
           <el-table-column prop="status" label="" header-align="center" width="250">
             <template scope="scope">
-              <el-button type="success"  @click="groupDetail(scope.row.managerId)">小组详情</el-button>
-              <el-button type="success" plain @click="isShow(1,scope.row.managerId)">管理员详情</el-button>
+              <el-button type="success"  @click="groupDetail(scope.row.managerId)" >小组详情</el-button>
+              <el-button type="success" plain @click="isShow(1,scope.row.managerId)" v-if="scope.$index>0">管理员详情</el-button>
             </template>
           </el-table-column>
 
@@ -493,4 +500,8 @@
     text-align: center !important;
     margin-top: 15px;
   }
+  .scope-list{
+    margin-left: 18px;
+    text-align: left;
+  }
 </style>