qq 3 rokov pred
rodič
commit
260034f1ac

+ 1 - 0
src/App.vue

@@ -8,6 +8,7 @@
 export default {
   name: "App",
 };
+  
 </script>
 
 <style>

+ 15 - 0
src/components/assembly/common.vue

@@ -3,9 +3,24 @@ import {years,regions} from "@/util/api";
 const xurl = "";
 const clientHeight = document.documentElement.clientHeight
 const hurl = 'http://47.108.130.28:8000';
+function timeLogin(){
+  var time = parseInt(new Date().getTime()/1000) 
+    if(localStorage.getItem('open_tiem')){
+      var hourse = parseInt((time-localStorage.getItem('open_tiem'))/60/60)
+      console.log(hourse)
+      if(time-localStorage.getItem('open_tiem')>2){
+        
+        return 1
+      }
+    }else{
+      
+       return 2
+    }
+};
 export default {
   xurl,
   clientHeight,
   hurl,
+  timeLogin
 };
 </script>

+ 7 - 13
src/components/customer/capital.vue

@@ -238,20 +238,14 @@ export default {
   },
   created() {
     localStorage.setItem("navKey", "1");
-    var time = parseInt(new Date().getTime()/1000) 
-    // console.log(time)
-    if(localStorage.getItem('open_tiem')){
-      // console.log(localStorage.getItem('open_tiem'))
-      var hourse = parseInt((time-localStorage.getItem('open_tiem'))/60/60)
-      if(hourse>4){
-        this.$router.push('/login');
+    if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
         localStorage.setItem('open_tiem',time)
         return
-      }
-    }else{
-      localStorage.setItem('open_tiem',time)
-      this.$router.go(0);
-       return
     }
     if (localStorage.getItem("is_login") == 1) {
       localStorage.setItem("is_login", 2);
@@ -375,7 +369,7 @@ export default {
         },
         data:{ "opt":  num},
       }).then(res=>{
-        console.log(res)
+        // console.log(res)
         if(res.data.errcode == 0){
          that.tableData[i].collect =  that.tableData[i].collect==1?0:1
         }

+ 9 - 0
src/components/customer/examination.vue

@@ -201,6 +201,15 @@ export default {
   },
    created() {
     localStorage.setItem("navKey", "1");
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
      var that = this
     categories({'ctype':'exam'}).then((res)=>{
       if(res.errcode == 0){

+ 68 - 66
src/components/customer/myClass.vue

@@ -1,18 +1,19 @@
 <template>
   <div class="page scroll-x">
     <topHead></topHead>
-    <topNav @navKey='navKeys'></topNav>
+    <topNav @navKey="navKeys"></topNav>
     <div class="container d-f">
       <div class="leftMenu">
-        <li class="active" >
+        <li class="active">
           <i class="iconfont iconbanji"></i>
           <span>我的班级</span>
         </li>
-        <li  @click="jump(1)">
+        <li @click="jump(1)">
           <i class="iconfont iconyuejuan"></i> <span>阅卷任务</span>
         </li>
         <li @click="jump(2)">
-          <i class="iconfont iconzuoye1"></i><span>{{navKey==2?'作业分析':'成绩分析'}}</span>
+          <i class="iconfont iconzuoye1"></i
+          ><span>{{ navKey == 2 ? "作业分析" : "成绩分析" }}</span>
         </li>
         <li @click="jump(3)">
           <i class="iconfont iconcuoti1"></i><span>错题分析</span>
@@ -20,12 +21,17 @@
       </div>
       <div class="rightContent">
         <div class="recordTitle">
-          <span>{{navKey==2?'作业中心':'考试中心'}}> </span>
+          <span>{{ navKey == 2 ? "作业中心" : "考试中心" }}> </span>
           <span>我的班级</span>
         </div>
         <div class="d-f screen screen1">
           <span>班级:</span>
-          <el-select @change="classC" v-model="params.cid" clearable placeholder="请选择">
+          <el-select
+            @change="classC"
+            v-model="params.cid"
+            clearable
+            placeholder="请选择"
+          >
             <el-option
               :label="item.name"
               :value="item.id"
@@ -50,21 +56,21 @@
           <li>年龄</li>
           <li>手机号</li>
         </div>
-          <div class="none" v-if="tableData.length == 0">
-            <div>
-              <img src="../../assets/none.png" alt="" />
-            </div>
-            <div>暂无数据</div>
+        <div class="none" v-if="tableData.length == 0">
+          <div>
+            <img src="../../assets/none.png" alt="" />
           </div>
+          <div>暂无数据</div>
+        </div>
         <div
-        v-else
+          v-else
           class="cap_table"
           :style="{ minHeight: Common.clientHeight - 400 + 'px' }"
         >
           <li v-for="(item, i) in tableData" :key="i" class="d-f j-s">
             <div>{{ item.sno }}</div>
             <div>{{ item.name }}</div>
-            <div>{{ item.sex>0?'男':'女' }}</div>
+            <div>{{ item.sex > 0 ? "男" : "女" }}</div>
             <div>{{ item.age }}</div>
             <div>{{ item.phone }}</div>
           </li>
@@ -89,76 +95,71 @@
 import topNav from "@/components/assembly/topnav";
 import topHead from "@/components/assembly/head";
 import foot from "@/components/assembly/foot";
-import { searchClass,  classes } from "@/util/api";
+import { searchClass, classes } from "@/util/api";
 export default {
   data() {
     return {
       params: {
         page: 1,
         size: 10,
-        cid:'',
+        cid: "",
       },
       tableData: [],
       classL: [],
       total: 0,
-      navKey:2,
+      navKey: 2,
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     var that = this;
-    this.navKey = localStorage.getItem('navKey');
+    this.navKey = localStorage.getItem("navKey");
     //班级
     classes().then((res) => {
-      console.log(res.data[0])
+      console.log(res.data[0]);
       if (res.errcode == 0) {
         that.classL = res.data;
-        that.params.cid = res.total>0?res.data[0].id:'';
+        that.params.cid = res.total > 0 ? res.data[0].id : "";
         that.getList();
       }
     });
-
   },
   methods: {
-      navKeys(i){
-          this.navKey=i;
-      },
-      //导出
-      exports(){
-          var that = this;
-      searchClass({page:1,size:1000,cid:this.params.cid}).then((res) => {
+    navKeys(i) {
+      this.navKey = i;
+    },
+    //导出
+    exports() {
+      var that = this;
+      searchClass({ page: 1, size: 1000, cid: this.params.cid }).then((res) => {
         if (res.errcode == 0) {
-            res.data.forEach((item)=>{
-                item.sex = item.sex==1?'男':'女'
-            })
-            console.log(res.data)
-             //导出
+          res.data.forEach((item) => {
+            item.sex = item.sex == 1 ? "男" : "女";
+          });
+          console.log(res.data);
+          //导出
           require.ensure([], () => {
             const { export_json_to_excel } = require("@/excel/Export2Excel"); //注意这个Export2Excel路径
-            const tableHeader = [
-              "学号",
-              "姓名",
-              "性别",
-              "年龄",
-              "手机号",
-            ]; // 设置Excel表格的表头
-            const filterVal = [
-              "sno",
-              "name",
-              "sex",
-              "age",
-              "phone",
-            ]; // 跟表格表头对应的绑定的prop
+            const tableHeader = ["学号", "姓名", "性别", "年龄", "手机号"]; // 设置Excel表格的表头
+            const filterVal = ["sno", "name", "sex", "age", "phone"]; // 跟表格表头对应的绑定的prop
             let list = this.filterTableData(
               JSON.parse(JSON.stringify(res.data))
             ); // this.selectList为选中的要导出的数据,用filterTableData方法先处理一下数据格式(要进行深度拷贝,以免过滤的时候,影响页面上展示的数据),再存到list
             let data = this.formatJson(filterVal, list);
-            export_json_to_excel(tableHeader, data, '学生列表'); //最后一个是导出表格的名字
+            export_json_to_excel(tableHeader, data, "学生列表"); //最后一个是导出表格的名字
           });
         }
       });
-         
-      },
-       formatJson(filterVal, Data) {
+    },
+    formatJson(filterVal, Data) {
       return Data.map((v) => filterVal.map((j) => v[j]));
     },
 
@@ -170,20 +171,20 @@ export default {
       });
       return data;
     },
-      classC(i){
-          console.log(i)
-          this.params.page = 1
-          this.params.cid = i
-        this.getList();
-      },
+    classC(i) {
+      console.log(i);
+      this.params.page = 1;
+      this.params.cid = i;
+      this.getList();
+    },
     //重置
-    reset(){
-      this.params.page=1;
-      this.params.cid='';
+    reset() {
+      this.params.page = 1;
+      this.params.cid = "";
       this.getList();
     },
     //搜索
-    search(){
+    search() {
       this.params.page = 1;
       this.getList();
     },
@@ -211,7 +212,7 @@ export default {
           that.tableData = res.data;
           that.total = res.total;
           //关闭loading
-            load.close();
+          load.close();
         }
       });
     },
@@ -219,13 +220,14 @@ export default {
       if (id == 2) {
         //作业分析
         this.$router.push("/tk_fx");
-      }else if(id == 1){//阅卷任务
-            this.$router.push("/task1");
+      } else if (id == 1) {
+        //阅卷任务
+        this.$router.push("/task1");
       }
     },
-    tk_py(title, id,tid) {
+    tk_py(title, id, tid) {
       // console.log(title)
-      this.$router.push({ path: "/tk_yp", query: { title, id,tid } });
+      this.$router.push({ path: "/tk_yp", query: { title, id, tid } });
     },
   },
   components: { topHead, topNav, foot },
@@ -272,7 +274,7 @@ export default {
   color: #333;
 }
 .table_head li,
-.cap_table li > div{
+.cap_table li > div {
   width: 20%;
 }
 

+ 9 - 0
src/components/customer/per_err.vue

@@ -134,6 +134,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     this.name = this.$route.query.name;
     this.params.cid = this.$route.query.cid;
     this.params.sid = this.$route.query.sid;

+ 9 - 0
src/components/customer/push_err.vue

@@ -278,6 +278,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     var that = this;
     //班级
     classes().then((res) => {

+ 9 - 0
src/components/customer/see_pusherr.vue

@@ -84,6 +84,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     var that = this;
     //班级
     classes().then((res) => {

+ 9 - 0
src/components/customer/student_err.vue

@@ -105,6 +105,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     var that = this;
     //班级
     classes().then((res) => {

+ 9 - 0
src/components/customer/task1.vue

@@ -150,6 +150,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     var thta = this;
     this.navKey = localStorage.getItem('navKey');
     this.params.mtype = this.navKey==2?'work':'exam';

+ 9 - 0
src/components/customer/tk_dt_fx.vue

@@ -251,6 +251,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
      this.navKey = localStorage.getItem('navKey');
     this.title = this.$route.query.title;
     this.id = this.$route.query.id;

+ 9 - 0
src/components/customer/tk_fx.vue

@@ -131,6 +131,15 @@ export default {
     };
   },
   created(){
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
  var that = this;
  this.navKey = localStorage.getItem('navKey');
       //年份

+ 9 - 0
src/components/customer/tk_xs_fx.vue

@@ -156,6 +156,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     this.title = this.$route.query.title;
     this.names = this.$route.query.names;
     this.score = this.$route.query.score;

+ 10 - 1
src/components/customer/tk_yp.vue

@@ -32,7 +32,7 @@
         </div>
         <div class="d-f">
           <div class="tk_box" v-if="nav_id!=1">
-            <div class="d-f j-s title">
+            <div class="d-f j-s title" v-if="tk_list.length>0">
               <span
                 >第 <span class="blue">{{ num_id + 1 }}</span> 题</span
               >
@@ -356,6 +356,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
      this.navKey = localStorage.getItem('navKey');
     this.title = this.$route.query.title;
     this.id = this.$route.query.id;

+ 9 - 0
src/components/customer/topic.vue

@@ -214,6 +214,15 @@ export default {
     };
   },
   created() {
+        if(this.Common.timeLogin() ==2){
+        localStorage.setItem('open_tiem',time)
+        this.$router.go(0);
+      return
+    }else if(this.Common.timeLogin() ==1){
+      this.$router.push('/login');
+        localStorage.setItem('open_tiem',time)
+        return
+    }
     var that = this;
     //班级
     classes().then((res) => {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 1231
src/util/util.js