Browse Source

最新代码

TheLittlePrince 6 years ago
parent
commit
1868b67026

+ 2 - 2
src/api/index.js

@@ -20,8 +20,8 @@ const TeacherHomeworkList = urlFn('/api/kmt/correctSys/teacherHomeworkList')
 const TeacherAllotList = urlFn('/api/kmt/correctSys/teacherAllotList')
 //分配老师
 const TeacherAllot = urlFn('/api/kmt/correctSys/teacherAllot')
-// 分配作业列表
-const UnallotHomeworkList = urlFn('/api/kmt/correctSys/unallotHomeworkList')
+// 分配未批改作业列表
+const UnallotHomeworkList = urlFn('/api/kmt/correctSys/uncorrectHomeworkList')
 // 查看老师详情
 const GetTeacherDetail = urlFn('/api/kmt/correctSys/getTeacherDetail')
 //  查看学生详情

+ 79 - 79
src/axios/index.js

@@ -20,91 +20,91 @@ axios.interceptors.request.use(resquest => {
 
 // 网络响应后拦截器
 // 响应拦截器
-// axios.interceptors.response.use(
-//     response => {
-//         if (response.status === 200) {
-//             return Promise.resolve(response);
-//         } else {
-//             return Promise.reject(response);
-//         }
-//     },
-//     // 服务器状态码不是200的情况
-//     error => {
-//         if (error.response.status) {
-//             switch (error.response.status) {
-//                 // 401: 未登录
-//                 // 未登录则跳转登录页面,并携带当前页面的路径
-//                 // 在登录成功后返回当前页面,这一步需要在登录页操作。
-//                 case 401:
-//                 Message.error('登陆失效,请重新登录')
-//                    localStorage.removeItem("accessToken")
-//                     router.replace({
-//                         path: '/',
-//                         query: { redirect: router.currentRoute.fullPath }
-//                     });
-//                     break;
-//                 // 403 token过期
-//                 // 登录过期对用户进行提示
-//                 // 清除本地token和清空vuex中token对象
-//                 // 跳转登录页面
-//                 case 403:
-//                 Message.error('登陆失效,请重新登录')
-//                     // 清除token
-//                     localStorage.removeItem("accessToken")
-//                     // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
-//                     setTimeout(() => {
-//                         router.replace({
-//                             path: '/',
-//                             query: {
-//                                 redirect: router.currentRoute.fullPath
-//                             }
-//                         });
-//                     }, 1000);
-//                     break;
-//                 // 404请求不存在
-//                 case 404:
-//                 Message.error('404 Not Found')
-//                 break;
-//                 // 其他错误,直接抛出错误提示
-//                 default:
-//                 Message.error('网络错误')
-//             }
-//             return Promise.reject(error.response);
-//         }
-//     }
-// );
+axios.interceptors.response.use(
+    response => {
+        if (response && response.status === 200 || response && response.status === 304) {
+            return Promise.resolve(response);
+        } else {
+            return Promise.reject(response);
+        }
+    },
+    // 服务器状态码不是200的情况
+    error => {
+        if (error.response.status) {
+            switch (error.response.status) {
+                // 401: 未登录
+                // 未登录则跳转登录页面,并携带当前页面的路径
+                // 在登录成功后返回当前页面,这一步需要在登录页操作。
+                case 401:
+                Message.error('登陆失效,请重新登录')
+                   localStorage.removeItem("accessToken")
+                    router.replace({
+                        path: '/',
+                        query: { redirect: router.currentRoute.fullPath }
+                    });
+                    break;
+                // 403 token过期
+                // 登录过期对用户进行提示
+                // 清除本地token和清空vuex中token对象
+                // 跳转登录页面
+                case 403:
+                Message.error('登陆失效,请重新登录')
+                    // 清除token
+                    localStorage.removeItem("accessToken")
+                    // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
+                    setTimeout(() => {
+                        router.replace({
+                            path: '/',
+                            query: {
+                                redirect: router.currentRoute.fullPath
+                            }
+                        });
+                    }, 1000);
+                    break;
+                // 404请求不存在
+                case 404:
+                Message.error('404 Not Found')
+                break;
+                // 其他错误,直接抛出错误提示
+                default:
+                Message.error('网络错误')
+            }
+            return Promise.reject(error.response);
+        }
+    }
+);
 // 数据统一处理来自网络及服务器的错误
 function checkStatus (response) {
     if (response && response.status === 200 || response && response.status === 304){
         // Message.success('请求成功')
         return response.data
     }
-    if (response && response.status === 401){
-        localStorage.removeItem("accessToken")
-        router.replace({
-            path: '/' // 到登录页重新获取token
-        })
-        Message.error('登陆失效,请重新登录')
-    }  
-    if (response && response.status === 404){
-        router.replace({
-            path: '*' // 到登录页重新获取token
-        })
-        Message.error('404 Not Found')
-    }
-    if (response && response.status === 500){
-        router.replace({
-            path: '*' // 到登录页重新获取token
-        })
-        Message.error('服务器问题')
-    } else {
-        Message.error('登陆失效,请重新登录')
-        localStorage.removeItem("accessToken")
-        router.replace({
-            path: '/' // 到登录页重新获取token
-        })
-        return response && response.statusText || '网络错误'
-    }
+    // if (response && response.status === 401){
+    //     localStorage.removeItem("accessToken")
+    //     router.replace({
+    //         path: '/' // 到登录页重新获取token
+    //     })
+    //     Message.error('登陆失效,请重新登录')
+    // }  
+    // if (response && response.status === 404){
+    //     router.replace({
+    //         path: '*' // 到登录页重新获取token
+    //     })
+    //     Message.error('404 Not Found')
+    // }
+    // if (response && response.status === 500){
+    //     router.replace({
+    //         path: '*' // 到登录页重新获取token
+    //     })
+    //     Message.error('服务器问题')
+    // } else {
+    //     Message.error('登陆失效,请重新登录')
+    //     localStorage.removeItem("accessToken")
+    //     router.replace({
+    //         path: '/' // 到登录页重新获取token
+    //     })
+    //     return response && response.statusText || '网络错误'
+    // }
 }
 
 // 处理来自程序的异常

+ 6 - 6
src/pages/Login.vue

@@ -31,12 +31,12 @@ export default {
   },
   methods: {
     WxLoginCtl() {
-      // this.$router.push({
-      //   path: "/aikmt/Redirect_uri",
-      //   query: {
-      //     unionid: "oPHg8wXraekgH5YKVHvD3H7Ujynw"
-      //   }
-      // });
+      this.$router.push({
+        path: "/aikmt/Redirect_uri",
+        query: {
+          unionid: "oPHg8wXraekgH5YKVHvD3H7Ujynw"
+        }
+      });
     },
     async getTKByUnionid() {
       if (window.location.href.indexOf("unionid") >= 0) {

+ 155 - 34
src/pages/home/SchoolManager.vue

@@ -94,10 +94,10 @@
                     <img :src="BASE_URL + v.imgUrl" alt class="table-img"  @click="isShow(v,3)">
                   </div>
                   <div>{{v.name}}</div>
-                  <div>{{v.waitCount}}份</div>
+                  <div>{{v.waitCount}}/份</div>
                   <div class="tr-active">{{v.maxWaitTime}}</div>
-                  <div>{{v.totalCorrectTime}}</div>
-                  <div>{{v.respSpeed}}/份</div>
+                  <div>{{v.totalCorrectTime}}/时</div>
+                  <div>{{v.respSpeed}}</div>
                   <div>在线</div>
                 </div>
                 <!-- 离线 -->
@@ -112,8 +112,8 @@
                   <div>{{v.name}}</div>
                   <div>{{v.waitCount}}份</div>
                   <div>{{v.maxWaitTime}}</div>
-                  <div>{{v.totalCorrectTime}}</div>
-                  <div>{{v.respSpeed}}/份</div>
+                  <div>{{v.totalCorrectTime}}/时</div>
+                  <div>{{v.respSpeed}}</div>
                   <div>离线</div>
                 </div>
                 <!-- 封号 -->
@@ -128,8 +128,8 @@
                   <div>{{v.name}}</div>
                   <div>{{v.waitCount}}份</div>
                   <div>{{v.maxWaitTime}}</div>
-                  <div>{{v.totalCorrectTime}}</div>
-                  <div>{{v.respSpeed}}/份</div>
+                  <div>{{v.totalCorrectTime}}/时</div>
+                  <div>{{v.respSpeed}}</div>
                   <div>已封号</div>
                 </div>
                 <div class="tr-setNo" v-if="isDownindex === k && isDown && TeacherHomeworkList.list.length == 0">
@@ -153,12 +153,11 @@
                       <el-button @click="isShow(v,1)" type="success">去分配</el-button>
                     </div>
                     <div class="tr-sw180" v-if="v.status === 3 && v.isCheck ===1">
-                      <el-button type="info" plain>已检查</el-button>
+                      <el-button type="info" plain><a style="text-decoration:none;color:#52cc60;" :href="'http://120.77.207.0:8081/kmt/index.html?homeworkId='+v.homeworkId+'&unionid='+unionid+'&teacherId='+homeworkLIst.teacherId+'&state='+2">已检查</a></el-button>
                       <span style="color:red;font-size:12px;">报错{{v.wrongCount}}</span>
                     </div>
                     <div class="tr-sw180" v-if="v.status === 3 && v.isCheck ===0">
-                      <el-button type="" plain @click="ToAppovalOline(v)">去批改</el-button>
-                     <!-- <el-button type="warning" plain><a style="text-decoration:none;color:#52cc60;" :href="'http://120.77.207.0:8081/kmt/index.html?homeworkId='+v.homeworkId+'&unionid='+unionid+'&teacherId='+homeworkLIst.teacherId+'&state='+2">去检查</a></el-button> -->
+                     <el-button type="warning" plain><a style="text-decoration:none;color:#52cc60;" :href="'http://120.77.207.0:8081/kmt/index.html?homeworkId='+v.homeworkId+'&unionid='+unionid+'&teacherId='+homeworkLIst.teacherId+'&state='+2">去检查</a></el-button>
                     </div>
                   </div>
                      <!-- 分页显示 -->
@@ -175,7 +174,6 @@
               </div>
             </div>
             <!-- 分页显示 -->
-            <div v-if="parseInt(monitorTeacherList.pages) > 10">
               <el-pagination
                 background
                 @size-change="handleSizeChange"
@@ -184,7 +182,6 @@
                 layout="total, sizes, prev, pager, next, jumper"
                 :total= parseInt(monitorTeacherList.pages)
               ></el-pagination>
-            </div>
             <div style="clear:both;"></div>
           </el-col>
         </el-row>
@@ -193,7 +190,7 @@
       <el-col :span="18" class="main" v-if="modelindex == 1">
         <el-row :gutter="20" class="main-header">
           <el-col :span="5">
-            <div class="main-header-item" @click="isShow(1)">今日报错总次数:{{DayTeacherList.wrongCount}}人</div>
+            <div class="main-header-item">今日报错总次数:{{DayTeacherList.wrongCount}}人</div>
           </el-col>
           <el-col :span="10" :offset="5">
             <el-input placeholder="请输入老师名字" v-model="filters1.inputValue" class="input-with-select">
@@ -233,7 +230,7 @@
               <el-date-picker
                @change="InfoWatchDay"
                 v-model="filters1.MaxtimeValue"
-                value-format="yyyy-MM-dd HH:mm:ss"
+                value-format="yyyy-MM-dd"
                 type="date"
                 placeholder="选择日期"
               ></el-date-picker>
@@ -291,7 +288,7 @@
       <el-col :span="18" class="main" v-if="modelindex == 2">
         <el-row :gutter="20" class="main-header">
           <el-col :span="5">
-            <div class="main-header-item" @click="isShow(1)">当月报错总次数:{{MothTeacherList.wrongCount}}人</div>
+            <div class="main-header-item">当月报错总次数:{{MothTeacherList.wrongCount}}人</div>
           </el-col>
           <el-col :span="10" :offset="5">
             <el-input placeholder="请输入老师名字" v-model="filters2.inputValue" class="input-with-select">
@@ -331,31 +328,31 @@
               <el-date-picker
                @change="InfoWatchMoth"
                 v-model="filters2.MaxtimeValue"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                type="date"
-                placeholder="选择日期"
+                type="month"
+                 value-format="yyyy-MM"
+                placeholder="选择"
               ></el-date-picker>
             </div>
           </el-col>
         </el-row>
          <el-row :gutter="20" class="main-header">
           <el-col :span="3" :offset="1">
-            <div class="main-header-item" @click="isShow(1)">月出勤率:{{MothTeacherList.attendanceRate}}</div>
+            <div class="main-header-item">月出勤率:{{MothTeacherList.attendanceRate}}</div>
           </el-col>
            <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">批改总份数:{{MothTeacherList.homeworkCount}}</div>
+            <div class="main-header-item">批改总份数:{{MothTeacherList.homeworkCount}}</div>
           </el-col>
            <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">批改总张数:{{MothTeacherList.homeworkPicCount}}</div>
+            <div class="main-header-item">批改总张数:{{MothTeacherList.homeworkPicCount}}</div>
           </el-col>
            <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">批改平均时间:{{MothTeacherList.avgTime}}</div>
+            <div class="main-header-item">批改平均时间:{{MothTeacherList.avgTime}}</div>
           </el-col>
            <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">平均满意度:{{MothTeacherList.satisfactionDegree}}</div>
+            <div class="main-header-item">平均满意度:{{MothTeacherList.satisfactionDegree}}</div>
           </el-col>
            <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">正确率:{{MothTeacherList.accuracyRate}}</div>
+            <div class="main-header-item">正确率:{{MothTeacherList.accuracyRate}}</div>
           </el-col>
         </el-row>
           <el-row :gutter="20" class="main-header">
@@ -414,16 +411,16 @@
 
     <!--可分配老师-->
     <div class="showModel" @click="allShowModel(1)" v-if="hiddenModel"></div>
-    <div class="model" style="width:40%" v-if="hiddenModel">
-      <div class="model-text">
+    <div class="model" style="width:30%; height:40%;top:5%" v-if="hiddenModel">
+      <div class="model-text" >
         <div class="model-text-head">
           <div>可分配老师</div>
           <div>{{allotList.Allotgarde}}{{allotList.Allotsubjct}}</div>
         </div>
-          <div class="tr-setNo"  v-if="TeacherAllotList.list.length == 0">
+          <!-- <div class="tr-setNo"  v-if="TeacherAllotList.list.length == 0">
             暂无数据!
-          </div>
-        <div class="model-items" v-for="(v, k) in TeacherAllotList.list" :key="k">
+          </div> -->
+        <div class="model-itemss" style="margin:10px;" v-for="(v, k) in TeacherAllotList.list" :key="k">
           <div class="model-items-left">
             <div class="model-items-left-top">
               <div>
@@ -477,9 +474,9 @@
         </div>
         <div>
           <!-- UnallotHomeworkInfo -->
-          <div class="tr-setNo"  v-if="UnallotHomeworkInfo.list.length == 0">
+          <!-- <div class="tr-setNo"  v-if="UnallotHomeworkInfo.list.length == 0">
             暂无数据!
-          </div>
+          </div> -->
           <div class="tr-set" v-for="(v, k) of UnallotHomeworkInfo.list" :key="k">
             <div class="tr-secon">{{k+1}}</div>
             <div class="tr-secon" style="width:50px;">
@@ -491,9 +488,9 @@
             <div v-if="v.status === 1" class="tr-secon">未批改</div>
             <div v-if="v.status === 2" class="tr-secon">批改中</div>
             <div v-if="v.status === 3" class="tr-secon">已批改</div>
-            <div class="tr-s">
+            <div class="">
               <el-button type="success" plain><a style="text-decoration:none;color:#52cc60;" :href="'http://120.77.207.0:8081/kmt/index.html?homeworkId='+v.homeworkId+'&unionid='+unionid+'&teacherId='+homeworkLIst.teacherId+'&state='+1">去批改</a></el-button>
-              <el-button type="success">去分配</el-button>
+              <el-button type="success" @click="isShow(v,5)">去分配</el-button>
             </div>
           </div>
           <div v-if="parseInt(UnallotHomeworkInfo.pages) > 10">
@@ -511,6 +508,58 @@
   
       </div>
     </div>
+         <!--所有未批改可分配老师列表弹框-->
+    <div class="showModel" @click="allShowModel(5)" v-if="NoAllotManagerModel"></div>
+    <div class="model" style="width:40%" v-if="NoAllotManagerModel">
+      <div class="model-text" style="padding: 0 10px">
+        <div class="model-manager">
+          <div>作业可分配老师</div>
+          <div>
+            <img src="../../assets/img/del@2x.png" alt @click="allShowModel(5)">
+          </div>
+        </div>
+        <div class="allocation-items" v-for="(v, k) in TeacherAllotList.list" :key="k" >
+          <div class="model-items-left">
+            <div class="model-items-left-top">
+              <div>
+                <img
+                  :src="BASE_URL + v.imgUrl"
+                  v-if="v.imgUrl"
+                  alt
+                  class="model-items-left-top-img"
+                >
+                <img
+                  src="../../assets/img/user.jpg"
+                  v-if="!v.imgUrl"
+                  alt
+                  class="model-items-left-top-img"
+                >
+                <div style="display: inline-block;text-align: left;">
+                  <div style="font-size: 24px;margin-left: 10px">{{v.name}}</div>
+                  <div class="model-items-left-top-number">老师数量:{{v.teacherCount}}</div>
+                </div>
+              </div>
+              <div>
+                <el-button v-show="v.type && v.type === 1" disabled type="info">已分配</el-button>
+                <el-button
+                  v-show="!v.type || v.type !== 1"
+                  @click="GOtoTeacherAllotAppovar(v,k)"
+                  type="success"
+                >分配</el-button>
+              </div>
+            </div>
+          </div>
+        </div>
+          <el-pagination
+            background
+            @size-change="handleSizeChange6"
+            @current-change="pageChange6"
+            :page-sizes="[10]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="parseInt(TeacherAllotList.pages)"
+          ></el-pagination>
+      </div>
+    </div>
     <!-- 老师详情弹框 -->
     <div class="showModel" @click="allShowModel(3)" v-if="ModelAppor"></div>
     <div class="model" style="width:35%;left: 32.5%" v-if="ModelAppor">
@@ -595,6 +644,7 @@ export default {
       modelindex: 0,
       values: [],
       arrGrade:[],
+      NoAllotManagerModel:false, //未批改作业可分配老师弹框
       hiddenModel: false, //分配老师弹框
       isPigai: false,//未批改作业弹框
       ModelAppor:false,//批改老师详情信息弹框
@@ -717,6 +767,13 @@ export default {
         pageSize: 10,
         homeworkId: ""
       },
+        allNoapprovalList:{
+        Allotgarde: "",
+        Allotsubjct: "",
+        pageNo: 1,
+        pageSize: 10,
+        homeworkId: ""
+      },
       AllotButton: ""
     };
   },
@@ -755,7 +812,7 @@ export default {
       let ApporhomeworkId = v.homeworkId
       this.ApporhomeworkId = ApporhomeworkId
       this.$store.dispatch("BeforetoTeacherAllot", {
-        teacherId: localStorage.getItem("unionid"),
+        teacherId: localStorage.getItem("userId"),
         homeworkId: v.homeworkId
       });
     },
@@ -862,6 +919,18 @@ export default {
         pageSize: this.homeworkLIst.pageSize
       });
     },
+    // 未批改作业分配老师
+    async GOtoTeacherAllotAppovar(v, k) {
+      this.$store.dispatch("toTeacherAllot", {
+        teacherId: v.teacherId,
+        homeworkId: this.allNoapprovalList.homeworkId
+      });
+      v.type = 1;
+      this.$set(this.TeacherAllotList.list, k, v);
+       this.NoAllotManagerModel = false
+       this.UnallotHomework()
+      this.isPigai = true;
+    },
     // 分配老师
     async GOtoTeacherAllot(v, k) {
       this.$store.dispatch("toTeacherAllot", {
@@ -931,6 +1000,35 @@ export default {
         _this.ModelStudet = true;
         this.GetStudentInfo(v)
       }
+       else if (str == 5) {
+           this.allNoapprovalList.Allotgarde = v.grade;
+        this.allNoapprovalList.Allotsubjct = v.subject;
+          this.allNoapprovalList.homeworkId = v.homeworkId;
+        _this.NoAllotManagerModel = true;
+        _this.isPigai = false;
+         this.NoapporvalTeacherAllot(v);
+        // this.GetAllotManagerInfo()
+      }
+    },
+    // 未批改作业可分配老师列表
+    async NoapporvalTeacherAllot(v) {
+      this.$store.dispatch("TeacherAllotList", {
+        grade: v.grade || this.allNoapprovalList.Allotgarde, 
+        subject: v.subject || this.allNoapprovalList.Allotsubjct,
+        maxCreateTime: this.filters.MaxtimeValue,
+        pageNo: this.allNoapprovalList.pageNo,
+        pageSize: this.allNoapprovalList.pageSize
+      });
+    },
+       // 未批改作业可分配老师分页列表
+    async NoapporvalTeacherAllotfy() {
+      this.$store.dispatch("TeacherAllotList", {
+        grade: this.allNoapprovalList.Allotgarde, 
+        subject: this.allNoapprovalList.Allotsubjct,
+        maxCreateTime: this.filters.MaxtimeValue,
+        pageNo: this.allNoapprovalList.pageNo,
+        pageSize: this.allNoapprovalList.pageSize
+      });
     },
     // 去分配
     allocation(){
@@ -960,6 +1058,9 @@ export default {
         else if (str == 4) {
         _this.ModelStudet = false;
       }
+      else if (str == 5) {
+        _this.NoAllotManagerModel = false;
+      }
     },
       // 数组去重
       uniq(array){
@@ -1027,6 +1128,10 @@ export default {
       this.allotList.pageSize = val;
       this.TeacherAllotfy();
     },
+    handleSizeChange6(val) {
+      this.allNoapprovalList.pageSize = val;
+      this.NoapporvalTeacherAllotfy();
+    },
       // 分页
     pageChange(val) {
       this.filters.pageNo = val;
@@ -1048,6 +1153,10 @@ export default {
       this.allotList.pageNo = val;
       this.TeacherAllotfy();
     },
+       pageChange6(val) {
+      this.allNoapprovalList.pageNo = val;
+      this.NoapporvalTeacherAllotfy();
+    },
     // 排序
     sortChange(sort) {
       this.filters.orderField = sort.prop;
@@ -1337,6 +1446,12 @@ width: 60px;
   display: inline-block;
   width: 100%;
 }
+.model-itemss{
+  padding: 10px 0;
+  display: flex;
+  justify-content: space-between;
+  display: inline-block;
+}
 .model-items-left-top-img {
   width: 68px;
   height: 68px;
@@ -1380,4 +1495,10 @@ padding:30px;
     width: 226px;
     height: 203px;
   }
+    .allocation-items{
+    width: 40%;
+    display: inline-block;
+    margin-right: 20px;
+    margin-bottom:30px;
+  }
 </style>

+ 140 - 30
src/pages/super/SchoolManager.vue

@@ -95,8 +95,8 @@
                   <div>{{v.name}}</div>
                   <div>{{v.waitCount}}份</div>
                   <div class="tr-active">{{v.maxWaitTime}}</div>
-                  <div>{{v.totalCorrectTime}}</div>
-                  <div>{{v.respSpeed}}/份</div>
+                  <div>{{v.totalCorrectTime}}/时</div>
+                  <div>{{v.respSpeed}}</div>
                   <div>在线</div>
                 </div>
                 <!-- 离线 -->
@@ -111,8 +111,8 @@
                   <div>{{v.name}}</div>
                   <div>{{v.waitCount}}份</div>
                   <div>{{v.maxWaitTime}}</div>
-                  <div>{{v.totalCorrectTime}}</div>
-                  <div>{{v.respSpeed}}/份</div>
+                  <div>{{v.totalCorrectTime}}/时</div>
+                  <div>{{v.respSpeed}}</div>
                   <div>离线</div>
                 </div>
                 <!-- 封号 -->
@@ -127,8 +127,8 @@
                   <div>{{v.name}}</div>
                   <div>{{v.waitCount}}份</div>
                   <div>{{v.maxWaitTime}}</div>
-                  <div>{{v.totalCorrectTime}}</div>
-                  <div>{{v.respSpeed}}/份</div>
+                  <div>{{v.totalCorrectTime}}</div>
+                  <div>{{v.respSpeed}}</div>
                   <div>已封号</div>
                 </div>
                   <div class="tr-setNo" v-if="isDownindex === k && isDown && TeacherHomeworkList.list.length == 0">
@@ -152,7 +152,7 @@
                       <el-button @click="isShow(v,1)" type="success">去分配</el-button>
                     </div>
                     <div class="tr-sw180" v-if="v.status === 3 && v.isCheck ===1">
-                      <el-button type="info" plain>已检查</el-button>
+                       <el-button type="info" plain><a style="text-decoration:none;color:#52cc60;" :href="'http://120.77.207.0:8081/kmt/index.html?homeworkId='+v.homeworkId+'&unionid='+unionid+'&teacherId='+homeworkLIst.teacherId+'&state='+2">已检查</a></el-button>
                       <span style="color:red;font-size:12px;">报错{{v.wrongCount}}</span>
                     </div>
                     <div class="tr-sw180" v-if="v.status === 3 && v.isCheck ===0">
@@ -295,7 +295,7 @@
       <el-col :span="18" class="main" v-if="modelindex == 2">
         <el-row :gutter="20" class="main-header">
           <el-col :span="5">
-            <div class="main-header-item" @click="isShow(1)">当月报错总次数:{{MothTeacherList.wrongCount}}人</div>
+            <div class="main-header-item">当月报错总次数:{{MothTeacherList.wrongCount}}人</div>
           </el-col>
           <el-col :span="10" :offset="5">
             <el-input placeholder="请输入老师名字" v-model="filters2.inputValue" class="input-with-select">
@@ -335,37 +335,35 @@
               <el-date-picker
                 @change="InfoWatchMoth"
                 v-model="filters2.MaxtimeValue"
-                value-format="yyyy-MM-dd HH:mm:ss"
-                type="date"
-                placeholder="选择日期"
+                 type="month"
+                 value-format="yyyy-MM"
+                placeholder="选择"
               ></el-date-picker>
             </div>
           </el-col>
         </el-row>
         <el-row :gutter="20" class="main-header">
           <el-col :span="3" :offset="1">
-            <div class="main-header-item" @click="isShow(1)">月出勤率:{{MothTeacherList.attendanceRate}}</div>
+            <div class="main-header-item" >月出勤率:{{MothTeacherList.attendanceRate}}</div>
           </el-col>
           <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">批改总份数:{{MothTeacherList.homeworkCount}}</div>
+            <div class="main-header-item" >批改总份数:{{MothTeacherList.homeworkCount}}</div>
           </el-col>
           <el-col :span="4">
             <div
               class="main-header-item"
-              @click="isShow(1)"
             >批改总张数:{{MothTeacherList.homeworkPicCount}}</div>
           </el-col>
           <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">批改平均时间:{{MothTeacherList.avgTime}}</div>
+            <div class="main-header-item">批改平均时间:{{MothTeacherList.avgTime}}</div>
           </el-col>
           <el-col :span="4">
             <div
               class="main-header-item"
-              @click="isShow(1)"
             >平均满意度:{{MothTeacherList.satisfactionDegree}}</div>
           </el-col>
           <el-col :span="4">
-            <div class="main-header-item" @click="isShow(1)">正确率:{{MothTeacherList.accuracyRate}}</div>
+            <div class="main-header-item">正确率:{{MothTeacherList.accuracyRate}}</div>
           </el-col>
         </el-row>
         <el-row :gutter="20" class="main-header">
@@ -424,13 +422,13 @@
     </el-row>
     <!--可分配老师-->
     <div class="showModel" @click="allShowModel(1)" v-if="hiddenModel"></div>
-    <div class="model" style="width:40%" v-if="hiddenModel">
+    <div class="model" style="width:30%; height:40%;top:5%" v-if="hiddenModel">
       <div class="model-text">
         <div class="model-text-head">
           <div>可分配老师</div>
           <div>{{allotList.Allotgarde}}{{allotList.Allotsubjct}}</div>
         </div>
-        <div class="model-items" v-for="(v, k) in TeacherAllotList.list" :key="k">
+        <div class="model-itemss" style="margin:10px;" v-for="(v, k) in TeacherAllotList.list" :key="k">
           <div class="model-items-left">
             <div class="model-items-left-top">
               <div>
@@ -462,7 +460,6 @@
             </div>
           </div>
         </div>
-        <div v-if="parseInt(TeacherAllotList.pages) > 10">
           <el-pagination
             background
             @size-change="handleSizeChange4"
@@ -471,7 +468,6 @@
             layout="total, sizes, prev, pager, next, jumper"
             :total="parseInt(TeacherAllotList.pages)"
           ></el-pagination>
-        </div>
       </div>
     </div>
     <!-- 无未批改作业 v-if="monitorTeacherList.unCorrectCount==0"-->
@@ -488,9 +484,9 @@
         </div>
         <div>
           <!-- UnallotHomeworkInfo -->
-            <div class="tr-setNo"  v-if="UnallotHomeworkInfo.list.length == 0">
+            <!-- <div class="tr-setNo"  v-if="UnallotHomeworkInfo.list.length == 0">
             暂无数据!
-          </div>
+          </div> -->
           <div class="tr-set" v-for="(v, k) of UnallotHomeworkInfo.list" :key="k">
             <div class="tr-secon">{{k+1}}</div>
             <div class="tr-secon" style="width:50px;">
@@ -504,7 +500,7 @@
             <div v-if="v.status === 3" class="tr-secon">已批改</div>
             <div class="tr-s">
                  <el-button type="success" plain><a style="text-decoration:none;color:#52cc60;" :href="'http://120.77.207.0:8081/kmt/index.html?homeworkId='+v.homeworkId+'&unionid='+unionid+'&teacherId='+homeworkLIst.teacherId+'&state='+1">去批改</a></el-button>
-              <el-button type="success">去分配</el-button>
+              <el-button type="success" @click="isShow(v,9)">去分配</el-button>
             </div>
           </div>
           <el-pagination
@@ -514,7 +510,6 @@
             :page-sizes="[10]"
             layout="total, sizes, prev, pager, next, jumper"
             :total="parseInt(UnallotHomeworkInfo.pages)"
-             :hide-on-single-page=true
           ></el-pagination>
         </div>
       </div>
@@ -693,7 +688,6 @@
             </div>
           </div>
         </div>
-        <div v-if="parseInt(getAllotManagerList.pages) > 10">
           <el-pagination
             background
             @size-change="handleSizeChange5"
@@ -702,7 +696,58 @@
             layout="total, sizes, prev, pager, next, jumper"
             :total="parseInt(getAllotManagerList.pages)"
           ></el-pagination>
+      </div>
+    </div>
+        <!--所有未批改可分配老师列表弹框-->
+    <div class="showModel" @click="allShowModel(9)" v-if="NoAllotManagerModel"></div>
+    <div class="model" style="width:50%" v-if="NoAllotManagerModel">
+      <div class="model-text" style="padding: 0 30px">
+        <div class="model-manager">
+          <div>作业可分配老师</div>
+          <div>
+            <img src="../../assets/img/del@2x.png" alt @click="allShowModel(9)">
+          </div>
+        </div>
+        <div class="allocation-items" v-for="(v, k) in TeacherAllotList.list" :key="k" >
+          <div class="model-items-left">
+            <div class="model-items-left-top">
+              <div>
+                <img
+                  :src="BASE_URL + v.imgUrl"
+                  v-if="v.imgUrl"
+                  alt
+                  class="model-items-left-top-img"
+                >
+                <img
+                  src="../../assets/img/user.jpg"
+                  v-if="!v.imgUrl"
+                  alt
+                  class="model-items-left-top-img"
+                >
+                <div style="display: inline-block;text-align: left;">
+                  <div style="font-size: 24px;margin-left: 10px">{{v.name}}</div>
+                  <div class="model-items-left-top-number">老师数量:{{v.teacherCount}}</div>
+                </div>
+              </div>
+              <div>
+                <el-button v-show="v.type && v.type === 1" disabled type="info">已分配</el-button>
+                <el-button
+                  v-show="!v.type || v.type !== 1"
+                  @click="GOtoTeacherAllotAppovar(v,k)"
+                  type="success"
+                >分配</el-button>
+              </div>
+            </div>
+          </div>
         </div>
+          <el-pagination
+            background
+            @size-change="handleSizeChange6"
+            @current-change="pageChange6"
+            :page-sizes="[10]"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="parseInt(TeacherAllotList.pages)"
+          ></el-pagination>
       </div>
     </div>
   </div>
@@ -737,6 +782,7 @@ export default {
       isPigai: false, //未批改作业弹框
       ModelAppor: false, //批改老师详情信息弹框
       AllotManagerModel:false, //可分配小组管理员列表弹框
+      NoAllotManagerModel:false, //所有未批改可分配老师列表弹框
       ModelStudet: false, //学生详情弹框
       isNocheck:false,//没有未批改作业
       isDown: false,
@@ -856,6 +902,13 @@ export default {
         pageSize: 10,
         homeworkId: ""
       },
+      allNoapprovalList:{
+        Allotgarde: "",
+        Allotsubjct: "",
+        pageNo: 1,
+        pageSize: 10,
+        homeworkId: ""
+      },
       AllotManagerList:{
         pageNo: 1,
         pageSize: 10,
@@ -986,7 +1039,28 @@ export default {
       this.$store.dispatch("UnallotHomeworkList", {
         maxCreateTime: this.filters.MaxtimeValue,
         pageNo: this.homeworkLIst.pageNo,
-        pageSize: this.homeworkLIst.pageSize
+        pageSize: this.homeworkLIst.pageSize,
+       managerId: this.managerId
+      });
+    },
+      // 未批改作业可分配老师列表
+    async NoapporvalTeacherAllot(v) {
+      this.$store.dispatch("TeacherAllotList", {
+        grade: v.grade || this.allNoapprovalList.Allotgarde, 
+        subject: v.subject || this.allNoapprovalList.Allotsubjct,
+        maxCreateTime: this.filters.MaxtimeValue,
+        pageNo: this.allNoapprovalList.pageNo,
+        pageSize: this.allNoapprovalList.pageSize
+      });
+    },
+       // 未批改作业可分配老师分页列表
+    async NoapporvalTeacherAllotfy() {
+      this.$store.dispatch("TeacherAllotList", {
+        grade: this.allNoapprovalList.Allotgarde, 
+        subject: this.allNoapprovalList.Allotsubjct,
+        maxCreateTime: this.filters.MaxtimeValue,
+        pageNo: this.allNoapprovalList.pageNo,
+        pageSize: this.allNoapprovalList.pageSize
       });
     },
     // 分配老师
@@ -997,6 +1071,19 @@ export default {
       });
       v.type = 1;
       this.$set(this.TeacherAllotList.list, k, v);
+       this.hiddenModel = false
+    },
+     // 未批改作业分配老师
+    async GOtoTeacherAllotAppovar(v, k) {
+      this.$store.dispatch("toTeacherAllot", {
+        teacherId: v.teacherId,
+        homeworkId: this.allNoapprovalList.homeworkId
+      });
+      v.type = 1;
+      this.$set(this.TeacherAllotList.list, k, v);
+       this.NoAllotManagerModel = false
+       this.UnallotHomework()
+      this.isPigai = true;
     },
        // 封号
     async CloseTeacherId() {
@@ -1118,6 +1205,15 @@ export default {
         _this.ModelAppor = false;
         this.GetAllotManagerInfo()
       }
+        else if (str == 9) {
+           this.allNoapprovalList.Allotgarde = v.grade;
+        this.allNoapprovalList.Allotsubjct = v.subject;
+          this.allNoapprovalList.homeworkId = v.homeworkId;
+        _this.NoAllotManagerModel = true;
+        _this.isPigai = false;
+         this.NoapporvalTeacherAllot(v);
+        // this.GetAllotManagerInfo()
+      }
     },
     // 去分配
     allocation(){
@@ -1156,6 +1252,9 @@ export default {
        else if (str == 8) {
         _this.AllotManagerModel = false;
       }
+       else if (str == 9) {
+        _this.NoAllotManagerModel = false;
+      }
     },
     // 数组去重
     uniq(array) {
@@ -1231,6 +1330,10 @@ export default {
       this.AllotManagerList.pageSize = val;
       this.GetAllotManagerInfo();
     },
+      handleSizeChange6(val) {
+      this.allNoapprovalList.pageSize = val;
+      this.NoapporvalTeacherAllotfy();
+    },
     // 分页
     pageChange(val) {
       this.filters.pageNo = val;
@@ -1256,6 +1359,10 @@ export default {
       this.AllotManagerList.pageNo = val;
       this.GetAllotManagerInfo();
     },
+        pageChange6(val) {
+      this.allNoapprovalList.pageNo = val;
+      this.NoapporvalTeacherAllotfy();
+    },
     // 排序
     sortChange(sort) {
       this.filters.orderField = sort.prop;
@@ -1553,6 +1660,12 @@ width: 60px;
   display: inline-block;
   width: 100%;
 }
+.model-itemss {
+  padding: 10px 0;
+  display: flex;
+  justify-content: space-between;
+  display: inline-block;
+}
 .model-items-left-top-img {
   width: 68px;
   height: 68px;
@@ -1607,9 +1720,6 @@ width: 60px;
   font-size: 18px;
   margin: 0 20px;
 }
-.el-pagination {
-  padding: 30px;
-}
 .no-homework{
   width:16.5%;
   height:328px;

+ 13 - 13
src/store/getters.js

@@ -4,25 +4,25 @@ const getters = {
   name: state => state.user.name,
   avatar: state => state.user.avatar,
   routers: state => state.permission.routers,
-  addRouters: state => state.permission.addRouters,
+  addRouters: state => state.permission.addRouters  || {},
   roles: state => state.user.roles,
   monitorTeacherList: state => state.user.monitorTeacherList || {},
   TeacherHomeworkList: state => state.user.TeacherHomeworkList || {},
-  TeacherAllotList: state => state.user.TeacherAllotList,
-  TeacherAllotstatus: state => state.user.TeacherAllotstatus,
+  TeacherAllotList: state => state.user.TeacherAllotList  || {},
+  TeacherAllotstatus: state => state.user.TeacherAllotstatus  || {},
   DayTeacherList: state => state.user.dayTeacherList || {},
   MothTeacherList: state => state.user.mothTeacherList || {},
-  UnallotHomeworkInfo: state => state.user.UnallotHomeworkList,
-  GetTeacherDetail: state => state.user.GetTeacherDetail,
-  GetStudentDetail: state => state.user.GetStudentDetail,
-  getManagerList: state => state.user.getManagerList,
-  getManagerDetail: state => state.user.getManagerDetail,
-  downgrade: state => state.user.downgrade,
-  applyTeacherList: state => state.user.applyTeacherList,
-  applyOperate: state => state.user.applyOperate,
-  getTeacherSalaryList: state => state.user.getTeacherSalaryList,
+  UnallotHomeworkInfo: state => state.user.UnallotHomeworkList  || {},
+  GetTeacherDetail: state => state.user.GetTeacherDetail  || {},
+  GetStudentDetail: state => state.user.GetStudentDetail  || {},
+  getManagerList: state => state.user.getManagerList  || {},
+  getManagerDetail: state => state.user.getManagerDetail  || {},
+  downgrade: state => state.user.downgrade || {},
+  applyTeacherList: state => state.user.applyTeacherList  || {},
+  applyOperate: state => state.user.applyOperate  || {},
+  getTeacherSalaryList: state => state.user.getTeacherSalaryList  || {},
   getTeacherIdStatus: state => state.user.getTeacherIdStatus,
-  getAllotManagerList: state => state.user.getAllotManagerList,
+  getAllotManagerList: state => state.user.getAllotManagerList  || {},
   BeforetoTeacherAllotCode: state => state.user.BeforetoTeacherAllotCode,
   SuperBeforetoTeacherAllotCode :state => state.user.SuperBeforetoTeacherAllotCode,
   

+ 42 - 28
src/store/modules/user.js

@@ -116,22 +116,28 @@ const user = {
             localStorage.setItem("accessToken",data.accessToken)
                    dispatch('GetInfo').then(res => { // 拉取用户信息
                         const roles = res.data.role
+                        const isBanned = res.data.isBanned
                         const userId = res.data.userId 
                         localStorage.setItem("userId",userId)
-                        if (roles == 0) {
-                          Message.error('无用户角色')
-                        }
-                        if (roles == 1) {
-                          Message.success('在线批改老师角色登录成功')
-                          window.open('http://120.77.207.0:8081/kmt/index.html?unionid=' + unionid);
-                        }
-                        if (roles == 2) {
-                          Message.success('校区管理员角色登录成功')
-                          router.push("/home");
-                        }
-                        if (roles == 3) {
-                          Message.success('超级管理员角色登录成功')
-                          router.push("/super");
+                        if (isBanned == 0) {
+                          if (roles == 0) {
+                            Message.error('无用户角色')
+                          }
+                          if (roles == 1) {
+                            Message.success('在线批改老师角色登录成功')
+                            window.open('http://120.77.207.0:8081/kmt/index.html?unionid=' + unionid);
+                          }
+                          if (roles == 2) {
+                            Message.success('校区管理员角色登录成功')
+                            router.push("/home");
+                          }
+                          if (roles == 3) {
+                            Message.success('超级管理员角色登录成功')
+                            router.push("/super");
+                          }
+                        } if (isBanned == 1) {
+                          Message.error('您已被封号')
+                          router.push("/");
                         }
                       }).catch(() => {
                           Message.error('用户信息验证失败,请重新登录')
@@ -156,20 +162,28 @@ const user = {
             localStorage.setItem("accessToken",data.accessToken)
                    dispatch('GetInfo').then(res => { // 拉取用户信息
                         const roles = res.data.role
-                        if (roles == 0) {
-                          Message.error('无用户角色')
-                        }
-                        if (roles == 1) {
-                          Message.success('在线批改老师角色登录成功')
-                          window.open('http://120.77.207.0:8081/kmt/index.html?unionid=' + unionid);
-                        }
-                        if (roles == 2) {
-                          Message.success('校区管理员角色登录成功')
-                          router.push("/home");
-                        }
-                        if (roles == 3) {
-                          Message.success('超级管理员角色登录成功')
-                          router.push("/super");
+                        const userId = res.data.userId
+                        const isBanned = res.data.isBanned
+                        localStorage.setItem("userId",userId)
+                        if (isBanned == 0) {
+                          if (roles == 0) {
+                            Message.error('无用户角色')
+                          }
+                          if (roles == 1) {
+                            Message.success('在线批改老师角色登录成功')
+                            window.open('http://120.77.207.0:8081/kmt/index.html?unionid=' + unionid);
+                          }
+                          if (roles == 2) {
+                            Message.success('校区管理员角色登录成功')
+                            router.push("/home");
+                          }
+                          if (roles == 3) {
+                            Message.success('超级管理员角色登录成功')
+                            router.push("/super");
+                          }
+                        } if (isBanned == 1) {
+                          Message.error('您已被封号')
+                          router.push("/");
                         }
                       }).catch(() => {
                           Message.error('用户信息验证失败,请重新登录')