Browse Source

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-student

wuhongyuq 5 years ago
parent
commit
9bd66bbaa3

BIN
src/assets/question.png


+ 1 - 1
src/layout/common/topInfo.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col :span="24" class="topInfos">
         <!-- <van-nav-bar title="日程安排" left-text="返回" left-arrow fixed @click-left="onClickLeft" /> -->
-        <van-nav-bar :title="title" :left-arrow="isleftarrow" @click-left="onClickLeft" />
+        <van-nav-bar :title="title" :left-arrow="isleftarrow" @click-left="onClickLeft" fixed />
       </el-col>
     </el-row>
   </div>

+ 11 - 18
src/layout/index/mainData.vue

@@ -1,25 +1,20 @@
-6<template>
+<template>
   <div id="mainData">
-    <el-row v-for="(item, index) in lessionclassInfo.lessons" :key="index">
+    <el-row v-for="(item, index) in lessons" :key="index">
       <el-col :span="24">
-        <!-- <el-col :span="24" class="info">
-          <el-button type="primary">教师评分</el-button>
-        </el-col> -->
         <el-col :span="24" class="beijing">
           <el-col :span="24" class="top">
-            <el-col :span="12" class="time">时间</el-col
-            ><el-col :span="6" class="date"
-              ><el-col :span="24"> {{ item.date }}</el-col
-              ><el-col :span="24">{{ week }}</el-col>
+            <el-col :span="12" class="time">时间</el-col>
+            <el-col :span="6" class="date">
+              <el-col :span="24"> {{ item.date }}</el-col>
+              <el-col :span="24">{{ week }}</el-col>
             </el-col>
-            <el-col :span="6" class="date"
-              ><el-col :span="24" class="info">
-                <el-button
-                  type="primary"
-                  @click="$router.push({ path: 'teacherscore/index', query: { id: item.teaid, lessonid: item._id, subid: item.subid } })"
+            <el-col :span="6" class="date">
+              <el-col :span="24" class="info">
+                <el-button type="primary" @click="$router.push({ path: 'teacherscore/index', query: { teaid: item.teaid, lessonid: item._id } })"
                   >教师评分</el-button
-                ></el-col
-              >
+                >
+              </el-col>
             </el-col>
           </el-col>
           <el-col :span="24" class="context">
@@ -32,7 +27,6 @@
               <p></p>
             </el-col>
           </el-col>
-
           <el-col :span="24" class="context">
             <el-col :span="12" class="contexttime"><span>11:30—13:30</span></el-col
             ><el-col :span="12" class="contextclass"><p>午餐+休息</p> </el-col>
@@ -67,7 +61,6 @@
 export default {
   name: 'mainData',
   props: {
-    lessionclassInfo: null,
     lessons: null,
     week: null,
   },

+ 52 - 0
src/layout/question/teaClass.vue

@@ -0,0 +1,52 @@
+<template>
+  <div id="teaClass">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="list" v-for="(item, index) in classList" :key="index">
+          <el-col :span="17" class="mess">
+            <p>班级:{{ item.name }}</p>
+            <p>班级人数:{{ item.number }}</p>
+          </el-col>
+          <el-col :span="7" class="btn">
+            <el-link :underline="false" @click="$router.push({ path: '/question/progress', query: { classid: item.id } })">班级问卷进度</el-link>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'teaClass',
+  props: {
+    classList: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.list {
+  background: #fff;
+  margin: 10px;
+  width: 94%;
+  padding: 10px;
+  border-radius: 20px;
+}
+.list .mess p {
+  padding: 5px 0;
+}
+.list .btn {
+  padding: 20px 0;
+  text-align: center;
+}
+</style>

+ 4 - 7
src/layout/teacherscore/mainData.vue

@@ -15,8 +15,8 @@
           </el-col>
           <el-col :span="24">
             <el-col :span="16" class="title">工作量</el-col>
-            <el-col :span="8" class="fenshu">评分:{{ grade }}</el-col>
-            <el-col :span="24" class="work">本周工作饱满</el-col>
+            <el-col :span="8" class="fenshu">评分:{{ xsscore }}分</el-col>
+            <el-col :span="24" class="work">{{ xsscore > 5 ? '本月工作量饱满' : '本月工作量干枯' }}</el-col>
           </el-col>
           <el-col :span="24" class="beizhu">
             <span>备注</span>
@@ -37,7 +37,7 @@
 <script>
 export default {
   name: 'mainData',
-  props: { teacherinfo: null, form: null, grade: null },
+  props: { teacherinfo: null, xsscore: null, form: null },
   components: {},
   data: () => ({
     srcurl: require('@/assets/circle.png'),
@@ -80,17 +80,14 @@ export default {
   padding: 10px 0 0 20px;
 }
 .beizhu {
-  margin: 20px;
+  padding: 10px 20px 0 20px;
 }
 /deep/.beizhu .el-textarea__inner {
   background-color: #f5f5f5;
-  width: 90%;
   margin: 20px 0 0 0;
   height: 100px;
 }
-
 .anniu {
-  padding: 20px 0 0 0;
   text-align: center;
 }
 </style>

+ 0 - 42
src/layout/teacherscore/topInfo.vue

@@ -1,42 +0,0 @@
-<template>
-  <div id="topInfo">
-    <el-row>
-      <el-col :span="24" class="topInfos">
-        <van-nav-bar title="教师评分" left-text="返回" left-arrow fixed @click-left="onClickLeft" />
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'topInfo',
-  props: {},
-  components: {},
-  data: () => ({}),
-  created() {},
-  computed: {},
-  methods: {
-    onClickLeft() {
-      Toast('返回');
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.topInfos {
-}
-/deep/.van-nav-bar {
-  background: #2c69fe;
-}
-/deep/.van-nav-bar__title {
-  color: #fff;
-}
-/deep/.van-nav-bar__text {
-  color: #fff;
-}
-/deep/.van-nav-bar .van-icon {
-  color: #fff;
-}
-</style>

+ 13 - 5
src/layout/user/clickBtn.vue

@@ -2,13 +2,16 @@
   <div id="clickBtn">
     <el-row>
       <el-col :span="24">
-        <el-col :span="24" class="native">
+        <el-col :span="24" class="native" v-if="this.user.type === '1'">
+          <van-cell is-link @click="$router.push({ path: '/user/teaLeave' })">请假管理</van-cell>
+        </el-col>
+        <el-col :span="24" class="native" v-if="this.user.type === '4'">
           <van-cell is-link @click="$router.push({ path: '/user/leave' })">请假</van-cell>
         </el-col>
-        <el-col :span="24" class="native">
+        <el-col :span="24" class="native" v-if="this.user.type === '4'">
           <van-cell is-link @click="$router.push({ path: '/user/checkWork' })">考勤</van-cell>
         </el-col>
-        <el-col :span="24" class="native">
+        <el-col :span="24" class="native" v-if="this.user.type === '4'">
           <van-cell is-link @click="$router.push({ path: '/user/homework' })">作业管理</van-cell>
         </el-col>
       </el-col>
@@ -17,13 +20,18 @@
 </template>
 
 <script>
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
 export default {
   name: 'clickBtn',
   props: {},
   components: {},
   data: () => ({}),
-  created() {},
-  computed: {},
+  created() {
+    console.log(this.user.type);
+  },
+  computed: {
+    ...mapState(['user']),
+  },
   methods: {},
 };
 </script>

+ 24 - 2
src/layout/user/messageInfo.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="messageInfo">
     <el-row>
-      <el-col :span="24" class="message" @click.native="$router.push({ path: '/user/personalDetail', query: { id: info.id } })">
+      <el-col :span="24" class="message" @click.native="$router.push({ path: '/user/personalDetail', query: { id: info.id } })" v-if="this.user.type === '4'">
         <el-col :span="7" class="name">
           {{ info.name }}
         </el-col>
@@ -11,20 +11,39 @@
           <p>民族:{{ info.nation }}&nbsp;性别:{{ info.gender }}</p>
         </el-col>
       </el-col>
+      <el-col
+        :span="24"
+        class="message"
+        @click.native="$router.push({ path: '/user/personalDetail', query: { id: teainfo.id } })"
+        v-if="this.user.type === '1'"
+      >
+        <el-col :span="7" class="name">
+          {{ teainfo.name }}
+        </el-col>
+        <el-col :span="17" class="mess">
+          <p>年龄:{{ teainfo.age }}&nbsp;&nbsp;性别:{{ teainfo.gender }}</p>
+          <p>手机号:{{ teainfo.phone }}</p>
+          <p>所在部门:{{ teainfo.department }}</p>
+        </el-col>
+      </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
 export default {
   name: 'messageInfo',
   props: {
     info: null,
+    teainfo: null,
   },
   components: {},
   data: () => ({}),
   created() {},
-  computed: {},
+  computed: {
+    ...mapState(['user']),
+  },
   methods: {},
 };
 </script>
@@ -49,4 +68,7 @@ p {
   font-size: 16px;
   color: #333;
 }
+.tea {
+  padding: 10px 0;
+}
 </style>

+ 177 - 106
src/layout/user/studentInfo.vue

@@ -7,149 +7,220 @@
             <div class="block"><el-avatar :size="163" :src="circleUrl"></el-avatar></div>
           </div>
         </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">姓名</p>
-            <p class="name">{{ messInfo.name }}</p>
+        <span v-if="this.user.type === '4'">
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">姓名</p>
+              <p class="name">{{ messInfo.name }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">身份证号</p>
+              <p class="name">{{ messInfo.id_number }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">身份证号</p>
-            <p class="name">{{ messInfo.id_number }}</p>
-          </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">性别</p>
-            <p class="name">{{ messInfo.gender }}</p>
-          </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">民族</p>
-            <p class="name">{{ messInfo.nation }}</p>
-          </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
-          </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">手机号</p>
-            <p class="name">{{ messInfo.phone }}</p>
-          </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">性别</p>
+              <p class="name">{{ messInfo.gender }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">QQ</p>
-            <p class="name">{{ messInfo.qq }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">民族</p>
+              <p class="name">{{ messInfo.nation }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">手机号</p>
+              <p class="name">{{ messInfo.phone }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">学校</p>
-            <p class="name">{{ messInfo.school_name }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">QQ</p>
+              <p class="name">{{ messInfo.qq }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">学校</p>
+              <p class="name">{{ messInfo.school_name }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">所在院系</p>
-            <p class="name">{{ messInfo.faculty }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">所在院系</p>
+              <p class="name">{{ messInfo.faculty }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">所在专业</p>
+              <p class="name">{{ messInfo.major }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">所在专业</p>
-            <p class="name">{{ messInfo.major }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">入学年份</p>
+              <p class="name">{{ messInfo.entry_year }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">毕业年份</p>
+              <p class="name">{{ messInfo.finish_year }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">入学年份</p>
-            <p class="name">{{ messInfo.entry_year }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">在校所担当职务</p>
+              <p class="name">{{ messInfo.school_job }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">e-mail</p>
+              <p class="name">{{ messInfo.email }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">毕业年份</p>
-            <p class="name">{{ messInfo.finish_year }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">户口所在地</p>
+              <p class="name">{{ messInfo.family_place }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+        </span>
+        <span v-else>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">姓名</p>
+              <p class="name">{{ teainfo.name }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">在校所担当职务</p>
-            <p class="name">{{ messInfo.school_job }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">性别</p>
+              <p class="name">{{ teainfo.gender }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">年龄</p>
+              <p class="name">{{ teainfo.age }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">e-mail</p>
-            <p class="name">{{ messInfo.email }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">出生年月</p>
+              <p class="name">{{ teainfo.birthday }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">手机号</p>
+              <p class="name">{{ teainfo.phone }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
-        <el-col :span="24" class="mess">
-          <el-col :span="22" class="info">
-            <p class="title">户口所在地</p>
-            <p class="name">{{ messInfo.family_place }}</p>
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">所在部门</p>
+              <p class="name">{{ teainfo.department }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-          <el-col :span="2" class="icon">
-            <van-icon name="arrow" />
+          <el-col :span="24" class="mess">
+            <el-col :span="22" class="info">
+              <p class="title">是否可讲礼仪课</p>
+              <p class="name">{{ teainfo.is_etiquette_teacher === 0 ? '否' : '是' }}</p>
+            </el-col>
+            <el-col :span="2" class="icon">
+              <van-icon name="arrow" />
+            </el-col>
           </el-col>
-        </el-col>
+        </span>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
 export default {
   name: 'studentInfo',
   props: {
     messInfo: null,
+    teainfo: null,
   },
   components: {},
   data: () => ({
     circleUrl: require('@/assets/circle.png'),
   }),
   created() {},
-  computed: {},
+  computed: {
+    ...mapState(['user']),
+  },
   methods: {},
 };
 </script>

+ 99 - 0
src/layout/user/stuleaveList.vue

@@ -0,0 +1,99 @@
+<template>
+  <div id="stuleaveList">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="list" v-for="(item, index) in stuleaveList" :key="index">
+          <el-col :span="18" class="name">
+            <p>{{ item.name }}</p>
+          </el-col>
+          <el-col :span="6" class="btn">
+            <el-link :underline="false" @click="clickShow(item.id)">请假信息</el-link>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+    <van-overlay :show="show" @click="clickDown">
+      <div class="wrapper" @click="clickDown">
+        <el-col :span="24" class="leaveInfo">
+          <p class="jilu">请假记录</p>
+          <el-col :span="24" class="leavelist" v-for="(item, index) in leaveInfo" :key="index">
+            <el-col :span="14" class="date">
+              <p>开始时间:{{ item.starttime }}</p>
+              <p>结束时间:{{ item.endtime }}</p>
+            </el-col>
+            <el-col :span="10" class="status"> 审核结果:{{ item.status == 0 ? '审核中' : item.status == 1 ? '通过' : '未通过' }} </el-col>
+          </el-col>
+        </el-col>
+      </div>
+    </van-overlay>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'stuleaveList',
+  props: {
+    stuleaveList: null,
+    leaveInfo: null,
+    show: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    clickShow(id) {
+      this.$emit('clickShow', id);
+    },
+    clickDown() {
+      this.$emit('clickDown');
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.list {
+  margin: 10px 10px 0 10px;
+  background: #fff;
+  width: 95%;
+  padding: 10px;
+  border-radius: 10px;
+}
+.list .name {
+  padding: 5px 0;
+}
+.list .btn {
+  padding: 5px 0;
+  text-align: center;
+}
+.wrapper {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+}
+.leaveInfo {
+  width: 90%;
+  background: #ffffff;
+  padding: 0 0 10px 0;
+  border-radius: 10px;
+}
+.jilu {
+  text-align: center;
+  padding: 10px 0;
+}
+.leavelist {
+  padding: 10px 10px 0 10px;
+}
+.leavelist .date p {
+  padding: 0;
+}
+.leavelist .status {
+  padding: 10px 0;
+}
+</style>

+ 54 - 0
src/layout/user/teaLeaveList.vue

@@ -0,0 +1,54 @@
+<template>
+  <div id="teaLeaveList">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="list" v-for="(item, index) in classList" :key="index">
+          <el-col :span="18" class="mess">
+            <p>班级:{{ item.name }}</p>
+            <p>班级人数:{{ item.number }}</p>
+          </el-col>
+          <el-col :span="6" class="btn">
+            <el-link :underline="false" @click="$router.push({ path: '/user/stuLeave', query: { id: item.id } })">请假管理</el-link>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'teaLeaveList',
+  props: {
+    classList: null,
+  },
+  components: {},
+  data: () => ({
+    openCollapse: [],
+  }),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.list {
+  background: #fff;
+  margin: 10px;
+  width: 94%;
+  padding: 10px;
+  border-radius: 20px;
+}
+.list .mess p {
+  padding: 5px 0;
+}
+.list .btn {
+  padding: 20px 0;
+  text-align: center;
+}
+</style>

+ 3 - 0
src/main.js

@@ -9,6 +9,8 @@ import '@/plugins/check-res';
 import '@/plugins/meta';
 import '@/plugins/filters';
 import '@/plugins/loading';
+import '@/plugins/setting';
+import InitStomp from '@/plugins/stomp';
 
 Vue.config.productionTip = false;
 
@@ -17,3 +19,4 @@ new Vue({
   store,
   render: h => h(App),
 }).$mount('#app');
+InitStomp();

+ 20 - 0
src/plugins/setting.js

@@ -0,0 +1,20 @@
+import Vue from 'vue';
+Vue.config.weixin = {
+  // baseUrl: process.env.BASE_URL + 'weixin',
+  baseUrl: 'http://free.liaoningdoupo.com',
+  target: process.env.NODE_ENV === 'development' ? 'http://10.16.10.7:8001' : 'http://free.liaoningdoupo.com/mobile',
+};
+
+Vue.config.stomp = {
+  // brokerURL: 'ws://192.168.1.190:15674/ws',
+  brokerURL: '/ws', // ws://${location.host}/ws
+  connectHeaders: {
+    host: 'train',
+    login: 'visit',
+    passcode: 'visit',
+  },
+  // debug: true,
+  reconnectDelay: 5000,
+  heartbeatIncoming: 4000,
+  heartbeatOutgoing: 4000,
+};

+ 25 - 2
src/router/index.js

@@ -12,7 +12,12 @@ const routes = [
     meta: { title: '日程安排', isleftarrow: true },
     component: () => import('../views/index.vue'),
   },
-
+  {
+    path: '/confirm',
+    name: 'confirm',
+    meta: { title: '测试页', isleftarrow: true },
+    component: () => import('../views/bind/confirm.vue'),
+  },
   // 班级信息
   {
     path: '/classinfo',
@@ -22,7 +27,7 @@ const routes = [
   {
     path: '/bind',
     meta: { title: '填写信息', isleftarrow: true },
-    component: () => import('../views/bind.vue'),
+    component: () => import('../views/bind/bind.vue'),
   },
   // 班级名单
   {
@@ -65,6 +70,12 @@ const routes = [
     meta: { title: '填写答案', isleftarrow: true },
     component: () => import('../views/question/question.vue'),
   },
+  // 班主任查看班级问卷调查答题进度
+  {
+    path: '/question/progress',
+    meta: { title: '问卷调查-问卷进度', isleftarrow: true },
+    component: () => import('../views/question/progress.vue'),
+  },
   // 个人信息
   {
     path: '/user/index',
@@ -101,6 +112,18 @@ const routes = [
     meta: { title: '考勤管理', isleftarrow: true },
     component: () => import('../views/user/checkWork.vue'),
   },
+  // 个人信息(班主任)-请假管理
+  {
+    path: '/user/teaLeave',
+    meta: { title: '请假管理-班级列表', isleftarrow: true },
+    component: () => import('../views/user/teaLeave.vue'),
+  },
+  // 个人信息(班主任)-学生请假列表
+  {
+    path: '/user/stuLeave',
+    meta: { title: '请假管理-学生请假列表', isleftarrow: true },
+    component: () => import('../views/user/stuLeave.vue'),
+  },
   //作业管理
   {
     path: '/user/homework',

+ 4 - 0
src/store/index.js

@@ -6,6 +6,7 @@ import group from '@frame/store/group';
 import question from '@frame/store/question';
 import questionAnswer from '@frame/store/question-answer';
 import questionnaire from '@frame/store/questionnaire';
+import director from '@frame/store/director';
 import student from '@frame/store/student';
 import lesson from '@frame/store/lesson';
 import teacher from '@frame/store/teacher';
@@ -15,6 +16,7 @@ import uploadtask from '@frame/store/uploadtask';
 import score from '@frame/store/score';
 import termquest from '@frame/store/termquest';
 import task from '@frame/store/task';
+import dept from '@frame/store/dept';
 import login from '@frame/store/login';
 import * as ustate from '@frame/store/user/state';
 import * as umutations from '@frame/store/user/mutations';
@@ -32,6 +34,7 @@ export default new Vuex.Store({
     question,
     questionAnswer,
     questionnaire,
+    director,
     student,
     lesson,
     teacher,
@@ -42,5 +45,6 @@ export default new Vuex.Store({
     uploadtask,
     subject,
     task,
+    dept,
   },
 });

src/views/bind.vue → src/views/bind/bind.vue


+ 79 - 0
src/views/bind/confirm.vue

@@ -0,0 +1,79 @@
+<template>
+  <div id="index">
+    <el-row style="padding:10px;height:100vh">
+      <el-col :span="24" class="icon">
+        <el-image :src="question"></el-image>
+      </el-col>
+      <el-col :span="24" style="height:10vh;text-align:center">
+        {{ type == '1' ? '您确定将您的微信号与本平台账号绑定吗?' : '您确定登陆本平台' }}
+      </el-col>
+      <el-col :span="24" style="height:4rem">
+        <van-button type="info" style="width:100%" round @click="confirm()">确定</van-button>
+      </el-col>
+      <el-col :span="24">
+        <van-button plain style="width:100%" round @click="cancel()">取消</van-button>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { createNamespacedHelpers } from 'vuex';
+const { mapActions: login } = createNamespacedHelpers('login');
+export default {
+  metaInfo: { title: '培训会手机确认' },
+  name: 'index',
+  props: {},
+  components: {},
+  data: () => ({
+    question: require('@/assets/question.png'),
+  }),
+  created() {},
+  computed: {
+    openid() {
+      return this.$route.query.openid;
+    },
+    uid() {
+      return this.$route.query.uid;
+    },
+    qrcode() {
+      return this.$route.query.qrcode;
+    },
+    type() {
+      return this.$route.query.type;
+    },
+  },
+  methods: {
+    ...login(['userBind', 'wxCheck']),
+    confirm() {
+      if (this.type == '1') this.toBind();
+      if (this.type == '2') this.toWxLogin();
+    },
+    async toBind() {
+      const res = await this.userBind({ uid: this.uid, openid: this.openid, qrcode: this.qrcode, type: this.type });
+      if (res.errcode === 0) {
+        this.$toast({ type: 'success', message: '绑定成功' });
+      } else {
+        this.$toast({ type: 'fail', message: res.errmsg });
+      }
+    },
+    async toWxLogin() {
+      let res = await this.wxCheck({ openid: this.openid, qrcode: this.qrcode });
+    },
+    cancel() {
+      window.history.go(-1);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.icon {
+  height: 30vh;
+  text-align: center;
+}
+.icon .el-image {
+  width: 100px;
+  margin: 40px 0;
+}
+</style>

+ 24 - 30
src/views/index.vue

@@ -3,11 +3,10 @@
     <el-row>
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
-          <!-- <topInfo></topInfo> -->
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <mainData :lessionclassInfo="lessionclassInfo" :week="week"></mainData>
+          <mainData :lessons="lessons" :week="week"></mainData>
         </el-col>
         <el-col :span="24" class="foot">
           <footInfo></footInfo>
@@ -21,8 +20,9 @@
 import NavBar from '@/layout/common/topInfo.vue';
 import footInfo from '@/layout/common/footInfo.vue';
 import mainData from '@/layout/index/mainData.vue';
-const { mapActions: lesson } = createNamespacedHelpers('lesson');
 import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: lesson } = createNamespacedHelpers('lesson');
+const { mapActions: classes } = createNamespacedHelpers('classes');
 
 export default {
   name: 'index',
@@ -33,12 +33,11 @@ export default {
     mainData, //课程安排主体
   },
   data: () => ({
-    lessionclassInfo: { lessons: [] },
+    lessons: [],
     dates: '',
     week: '',
     title: '日程安排',
     isleftarrow: '',
-    transitionName: 'fade',
     navShow: true,
   }),
   created() {
@@ -60,38 +59,33 @@ export default {
   },
   methods: {
     ...lesson({ lessionInfo: 'fetch', lessionlist: 'query' }),
-    async searchInfo({ ...info } = {}) {
-      const res = await this.lessionlist({ ...info });
-      for (const val of res.data) {
-        console.log(this.user.classid);
-        var arr = res.data.filter(item => item.class === this.user.classid);
-        console.log(arr);
-        var aff = res.data[0].lessons;
-        console.log(aff);
-        var ahh = aff.map((i, index) => {
-          let word = '';
-          if (index == 1) word = '拓展交流';
-          if (index == 2) word = '课程作业小组展示';
-          if (index == 3) word = '课程作业';
-          if (index == 4) word = '礼仪课小组面试';
-          if (index == 5) word = '结业仪式';
-          i.lastLesson = word;
-          return i;
-        });
-        for (const aqq of aff) {
-          var aee = aff.filter(item => item.date === '2020-01-04');
-          this.$set(this.lessionclassInfo, `lessons`, aee);
-          console.log(aee);
-        }
-      }
+    ...classes({ classesInfo: 'fetch', classeslist: 'query' }),
+    // 查询课程详情
+    async searchInfo() {
+      const res = await this.classesInfo(this.user.classid);
+      console.log(res.data);
+      const result = await this.lessionInfo(res.data.lessonid);
+      console.log(result.data);
+      var ahh = result.data.lessons.map((i, index) => {
+        let word = '';
+        if (index == 1) word = '拓展交流';
+        if (index == 2) word = '课程作业小组展示';
+        if (index == 3) word = '课程作业';
+        if (index == 4) word = '礼仪课小组面试';
+        if (index == 5) word = '结业仪式';
+        i.lastLesson = word;
+        return i;
+      });
+      var aee = result.data.lessons.filter(item => item.date === '2020-01-02');
+      this.$set(this, `lessons`, aee);
     },
+    // 获取时间
     getDate() {
       var adate = new Date();
       this.value = adate.getFullYear() + '-' + (adate.getMonth() + 1) + '-' + adate.getDate();
       this.$set(this, `dates`, this.value);
       var str = '星期' + '日一二三四五六'.charAt(new Date().getDay());
       this.$set(this, `week`, str);
-      console.log(str);
     },
   },
 };

+ 21 - 3
src/views/question/index.vue

@@ -3,11 +3,15 @@
     <el-row>
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
-          <!-- <topInfo></topInfo> -->
           <nav-bar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </nav-bar>
         </el-col>
         <el-col :span="24" class="main">
-          <questionnaire-info :questionnaireList="questionnaireList"></questionnaire-info>
+          <span v-if="this.user.type === '1'">
+            <teaClass :classList="classList"></teaClass>
+          </span>
+          <span v-else>
+            <questionnaire-info :questionnaireList="questionnaireList"></questionnaire-info>
+          </span>
         </el-col>
         <el-col :span="24" class="foot">
           <footInfo></footInfo>
@@ -20,10 +24,13 @@
 <script>
 import NavBar from '@/layout/common/topInfo.vue';
 import footInfo from '@/layout/common/footInfo.vue';
+import teaClass from '@/layout/question/teaClass.vue';
 import questionnaireInfo from '@question/src/views/index.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: termquest } = createNamespacedHelpers('termquest');
 const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
+const { mapActions: mapClass } = createNamespacedHelpers('classes');
+const { mapActions: mapStudent } = createNamespacedHelpers('student');
 export default {
   name: 'index',
   props: {},
@@ -31,16 +38,18 @@ export default {
     NavBar, //头部导航
     footInfo, //底部导航
     questionnaireInfo, //问卷调查
+    teaClass, //班主任班级名单
   },
   data: () => ({
     questionnaireList: [],
+    classList: [],
     title: '',
     isleftarrow: '',
-    transitionName: 'fade',
     navShow: true,
   }),
   created() {
     this.search();
+    this.searchInfo();
   },
   computed: {
     ...mapState(['user']),
@@ -58,6 +67,9 @@ export default {
   methods: {
     ...termquest(['query']),
     ...questionnaire({ getQuestList: 'query', getQuestMerge: 'mergeRequest' }),
+    ...mapClass({ classinfo: 'query' }),
+    ...mapStudent({ stuQuery: 'query', stuFetch: 'fetch' }),
+    // 查询问卷调查列表
     async search() {
       let res = await this.query({ termid: this.user.termid });
       if (this.$checkRes(res)) {
@@ -66,6 +78,12 @@ export default {
         this.$set(this, `questionnaireList`, quest);
       }
     },
+    // 班主任查询管理班级列表
+    async searchInfo({ ...info } = {}) {
+      const res = await this.classinfo({ ...info });
+      var result = res.data.filter(item => item.headteacherid === this.user.userid);
+      this.$set(this, `classList`, result);
+    },
   },
 };
 </script>

+ 65 - 0
src/views/question/progress.vue

@@ -0,0 +1,65 @@
+<template>
+  <div id="progress">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          问卷调查
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import teaLeaveList from '@/layout/user/teaLeaveList.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+export default {
+  name: 'progress',
+  props: {},
+  components: {
+    NavBar, //头部导航
+  },
+  data: () => ({
+    title: '',
+    isleftarrow: '',
+    navShow: true,
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {
+    $route(to, from) {
+      this.title = to.meta.title;
+      this.isleftarrow = to.meta.isleftarrow;
+    },
+  },
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+</style>

+ 2 - 1
src/views/question/question.vue

@@ -3,7 +3,6 @@
     <el-row>
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
-          <!-- <topInfo></topInfo> -->
           <nav-bar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </nav-bar>
         </el-col>
         <el-col :span="24" class="main" v-if="info">
@@ -64,6 +63,7 @@ export default {
   methods: {
     ...mapQuestion(['query', 'fetch', 'update']),
     ...questionAnswer({ getAnswer: 'query', sendAnswer: 'create', updateAnswer: 'update' }),
+    // 查询问卷题
     async searchInfo({ ...info } = {}) {
       let answer = await this.getAnswer({ questionnaireid: this.id, studentid: this.user.userid });
       let asArr = [];
@@ -85,6 +85,7 @@ export default {
       });
       this.$set(this, `info`, { ...result.data, ...asObject });
     },
+    // 提交答案
     async submit(task) {
       let { answerid } = task;
       let { termid, batchid, classid, userid: studentid } = this.user;

+ 15 - 22
src/views/teacherscore/index.vue

@@ -3,11 +3,10 @@
     <el-row>
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
-          <!-- <topInfo></topInfo> -->
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <mainData :teacherinfo="teacherinfo" :grade="grade" :form="form" @onsave="onsave"></mainData>
+          <mainData :teacherinfo="teacherinfo" :xsscore="xsscore" :form="form" @onsave="onsave"></mainData>
         </el-col>
         <el-col :span="24" class="foot">
           <footInfo></footInfo>
@@ -18,12 +17,11 @@
 </template>
 
 <script>
-import NavBar from '@/layout/teacherscore/topInfo.vue';
+import NavBar from '@/layout/common/topInfo.vue';
 import footInfo from '@/layout/common/footInfo.vue';
 import mainData from '@/layout/teacherscore/mainData.vue';
-const { mapActions: teacher } = createNamespacedHelpers('teacher');
-// import { createNamespacedHelpers, mapGetters } from 'vuex';
 import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: teacher } = createNamespacedHelpers('teacher');
 const { mapActions: mapScore } = createNamespacedHelpers('score');
 export default {
   name: 'index',
@@ -35,11 +33,10 @@ export default {
   },
   data: () => ({
     teacherinfo: {},
+    xsscore: '',
     form: {},
-    grade: {},
     title: '',
     isleftarrow: '',
-    transitionName: 'fade',
     navShow: true,
   }),
   created() {
@@ -47,15 +44,12 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    teaid() {
+      return this.$route.query.teaid;
     },
     lessonid() {
       return this.$route.query.lessonid;
     },
-    subid() {
-      return this.$route.query.subid;
-    },
   },
   mounted() {
     this.title = this.$route.meta.title;
@@ -70,26 +64,25 @@ export default {
   methods: {
     ...teacher({ columnList: 'query', teacherInfo: 'fetch' }),
     ...mapScore(['fetch', 'create', 'update']),
-
+    // 查询教师详情
     async searchInfo() {
-      const res = await this.teacherInfo(this.id);
-      let b = parseInt(res.data.xsscore);
+      const res = await this.teacherInfo(this.teaid);
+      let xsscore = parseFloat(res.data.xsscore).toFixed(2);
       this.$set(this, `teacherinfo`, res.data);
-      this.$set(this, `grade`, b);
+      this.$set(this, `xsscore`, xsscore);
     },
+    // 为教师打分
     async onsave(form) {
-      this.form.teacherid = this.id;
-      this.form.lessonid = this.lessonid;
-      console.log(this.user.id);
       this.form.stuid = this.user.id;
+      this.form.lessonid = this.lessonid;
+      this.form.teacherid = this.teaid;
       let data = this.form;
-      let res = await this.create(data);
-      console.log(res);
-
+      const res = await this.create(data);
       this.$message({
         message: '评分成功',
         type: 'success',
       });
+      this.searchInfo();
     },
   },
 };

+ 18 - 13
src/views/user/index.vue

@@ -7,7 +7,7 @@
         </el-col>
         <el-col :span="24" class="main">
           <el-col :span="24" class="message">
-            <messageInfo :info="info"></messageInfo>
+            <messageInfo :info="info" :teainfo="teainfo"></messageInfo>
           </el-col>
           <el-col :span="24" class="clickBtn">
             <clickBtn></clickBtn>
@@ -27,7 +27,10 @@ import footInfo from '@/layout/common/footInfo.vue';
 import messageInfo from '@/layout/user/messageInfo.vue';
 import clickBtn from '@/layout/user/clickBtn.vue';
 import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapDirectors } = createNamespacedHelpers('director');
 const { mapActions: mapStudent } = createNamespacedHelpers('student');
+const { mapActions: mapDept } = createNamespacedHelpers('dept');
+
 export default {
   name: 'index',
   props: {},
@@ -39,9 +42,9 @@ export default {
   },
   data: () => ({
     info: {},
+    teainfo: {},
     title: '',
     isleftarrow: '',
-    transitionName: 'fade',
     navShow: true,
   }),
   created() {
@@ -61,18 +64,20 @@ export default {
     },
   },
   methods: {
-    ...mapStudent(['fetch']),
+    ...mapDirectors({ directorQuery: 'query', directorFetch: 'fetch' }),
+    ...mapStudent({ studentQuery: 'query', studentFetch: 'fetch' }),
+    ...mapDept({ deptFetch: 'fetch' }),
+    // 查询登录用户信息
     async searchSite() {
-      let site = sessionStorage.getItem('site');
-      if (site) {
-        this.$set(this, `info`, JSON.parse(site));
-      } else {
-        const res = await this.fetch(this.user.userid);
-        console.log(this.user.userid);
-        if (res.errcode === 0) {
-          sessionStorage.setItem('site', JSON.stringify(res.data));
-          this.$set(this, `info`, res.data);
-        }
+      // 1:班主任,4:学生
+      if (this.user.type === '1') {
+        const res = await this.directorFetch(this.user.userid);
+        const arr = await this.deptFetch(res.data.department);
+        res.data.department = arr.data.name;
+        this.$set(this, `teainfo`, res.data);
+      } else if (this.user.type === '4') {
+        const res = await this.studentFetch(this.user.userid);
+        this.$set(this, `info`, res.data);
       }
     },
   },

+ 18 - 26
src/views/user/personalDetail.vue

@@ -3,11 +3,10 @@
     <el-row>
       <el-col :span="24" class="style">
         <el-col :span="24" class="top">
-          <!-- <topInfo></topInfo> -->
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main">
-          <studentInfo :messInfo="messInfo"></studentInfo>
+          <studentInfo :messInfo="messInfo" :teainfo="teainfo"></studentInfo>
         </el-col>
       </el-col>
     </el-row>
@@ -17,8 +16,10 @@
 <script>
 import NavBar from '@/layout/common/topInfo.vue';
 import studentInfo from '@/layout/user/studentInfo.vue';
-import { createNamespacedHelpers, mapGetters } from 'vuex';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapDirectors } = createNamespacedHelpers('director');
 const { mapActions: mapStudent } = createNamespacedHelpers('student');
+const { mapActions: mapDept } = createNamespacedHelpers('dept');
 export default {
   name: 'personalDetail',
   props: {},
@@ -27,28 +28,10 @@ export default {
     studentInfo, //学生详细信息
   },
   data: () => ({
-    messInfo: {
-      name: '测试学生',
-      id_number: '220182199603257019',
-      phone: '17319450324',
-      gender: '男',
-      nation: '汉族',
-      school_name: '吉林大学',
-      faculty: '计算机学院',
-      major: '应用软件技术专业',
-      entry_year: '2016',
-      finish_year: '2020',
-      school_job: '班长',
-      qq: '1345526645',
-      email: 'guhongwei0324@163.com',
-      family_place: '吉林省长春市朝阳区力旺广场B座16楼',
-      family_is_hard: '1',
-      have_grant: '1',
-      job: '班长',
-    },
+    messInfo: {},
+    teainfo: {},
     title: '',
     isleftarrow: '',
-    transitionName: 'fade',
     navShow: true,
   }),
   created() {
@@ -58,6 +41,7 @@ export default {
     id() {
       return this.$route.query.id;
     },
+    ...mapState(['user']),
   },
   mounted() {
     this.title = this.$route.meta.title;
@@ -70,10 +54,18 @@ export default {
     },
   },
   methods: {
-    ...mapStudent(['fetch']),
+    ...mapDirectors({ directorQuery: 'query', directorFetch: 'fetch' }),
+    ...mapStudent({ studentQuery: 'query', studentFetch: 'fetch' }),
+    ...mapDept({ deptFetch: 'fetch' }),
+    // 1:班主任,4:学生
     async searchInfo() {
-      const res = await this.fetch(this.id);
-      if (res.errcode === 0) {
+      if (this.user.type === '1') {
+        const res = await this.directorFetch(this.id);
+        const arr = await this.deptFetch(res.data.department);
+        res.data.department = arr.data.name;
+        this.$set(this, `teainfo`, res.data);
+      } else if (this.user.type === '4') {
+        const res = await this.studentFetch(this.id);
         this.$set(this, `messInfo`, res.data);
       }
     },

+ 99 - 0
src/views/user/stuLeave.vue

@@ -0,0 +1,99 @@
+<template>
+  <div id="stuLeave">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <stuleaveList :stuleaveList="stuleaveList" @clickShow="clickShow" @clickDown="clickDown" :leaveInfo="leaveInfo" :show="show"></stuleaveList>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import stuleaveList from '@/layout/user/stuleaveList.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapClass } = createNamespacedHelpers('classes');
+const { mapActions: mapStudent } = createNamespacedHelpers('student');
+const { mapActions: mapLeave } = createNamespacedHelpers('leave');
+export default {
+  name: 'stuLeave',
+  props: {},
+  components: {
+    NavBar, //头部导航
+    stuleaveList, //学生請假列表
+  },
+  data: () => ({
+    stuleaveList: [],
+    leaveInfo: [
+      {
+        name: '你好',
+      },
+    ],
+    show: false,
+    title: '',
+    isleftarrow: '',
+    navShow: true,
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    id() {
+      return this.$route.query.id;
+    },
+    ...mapState(['user']),
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {
+    $route(to, from) {
+      this.title = to.meta.title;
+      this.isleftarrow = to.meta.isleftarrow;
+    },
+  },
+  methods: {
+    ...mapClass({ classinfo: 'query', classFetch: 'fetch' }),
+    ...mapStudent({ list: 'query', add: 'create', fet: 'fetch', updates: 'update' }),
+    ...mapLeave({ leaveinfo: 'query', leaveFetch: 'fetch' }),
+    // 查询学生列表
+    async searchInfo({ ...info } = {}) {
+      let classid = this.id;
+      const stu = await this.list({ classid });
+      console.log(stu);
+      this.$set(this, `stuleaveList`, stu.data);
+    },
+    async clickShow(id) {
+      this.show = true;
+      const leaveList = await this.leaveinfo(id);
+      var result = leaveList.data.filter(item => item.studentid === id);
+      this.$set(this, `leaveInfo`, result);
+    },
+    clickDown() {
+      this.show = false;
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+</style>

+ 77 - 0
src/views/user/teaLeave.vue

@@ -0,0 +1,77 @@
+<template>
+  <div id="teaLeave">
+    <el-row>
+      <el-col :span="24" class="style">
+        <el-col :span="24" class="top">
+          <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
+        </el-col>
+        <el-col :span="24" class="main">
+          <teaLeaveList :classList="classList"></teaLeaveList>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import NavBar from '@/layout/common/topInfo.vue';
+import teaLeaveList from '@/layout/user/teaLeaveList.vue';
+import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapClass } = createNamespacedHelpers('classes');
+const { mapActions: mapStudent } = createNamespacedHelpers('student');
+export default {
+  name: 'leave',
+  props: {},
+  components: {
+    NavBar, //头部导航
+    teaLeaveList, //班主任学生请假列表
+  },
+  data: () => ({
+    classList: [],
+    title: '',
+    isleftarrow: '',
+    navShow: true,
+  }),
+  created() {
+    this.searchInfo();
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  mounted() {
+    this.title = this.$route.meta.title;
+    this.isleftarrow = this.$route.meta.isleftarrow;
+  },
+  watch: {
+    $route(to, from) {
+      this.title = to.meta.title;
+      this.isleftarrow = to.meta.isleftarrow;
+    },
+  },
+  methods: {
+    ...mapClass({ classinfo: 'query' }),
+    ...mapStudent({ stuQuery: 'query', stuFetch: 'fetch' }),
+    async searchInfo({ ...info } = {}) {
+      const res = await this.classinfo({ ...info });
+      var result = res.data.filter(item => item.headteacherid === this.user.userid);
+      this.$set(this, `classList`, result);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.style {
+  width: 100%;
+  min-height: 667px;
+  position: relative;
+  background-color: #f9fafc;
+}
+.top {
+  height: 46px;
+  overflow: hidden;
+}
+.main {
+  min-height: 570px;
+}
+</style>

+ 1 - 1
vue.config.js

@@ -28,7 +28,7 @@ module.exports = {
         ws: true,
       },
       '/ws': {
-        target: 'http://smart.cc-lotus.info',
+        target: 'http://free.liaoningdoupo.com',
         ws: true,
       },
       '/weixin': {