lrf402788946 4 tahun lalu
induk
melakukan
1d0f2d5b11
4 mengubah file dengan 26 tambahan dan 3 penghapusan
  1. 12 0
      src/layout/index/mainData.vue
  2. 2 0
      src/store/index.js
  3. 1 1
      src/views/class/index.vue
  4. 11 2
      src/views/index.vue

+ 12 - 0
src/layout/index/mainData.vue

@@ -28,6 +28,7 @@
                 <p class="title">
                   <span @click="click(item)">{{ item.teaname }}</span>
                 </p>
+                <p>{{ getLocaltion(item) }}</p>
               </el-col>
               <el-col :span="24">
                 <p></p>
@@ -48,6 +49,8 @@ export default {
     lesson: null,
     today: null,
     arrange: null,
+    classInfo: { type: Object, default: () => {} },
+    locationList: { type: Array, default: () => [] },
   },
   components: {},
   data: () => ({}),
@@ -63,6 +66,15 @@ export default {
     click(item) {
       this.$router.push({ path: 'teacherscore/index', query: { teaid: item.teaid, lessonid: item._id } });
     },
+    getLocaltion(data) {
+      if (data.subid) {
+        return _.get(this.classInfo, 'jslocation', '');
+      } else if (data.subname.includes('报道') || data.subname.includes('开班')) {
+        return _.get(this.classInfo, 'kbyslocation', '');
+      } else if (data.subname.includes('拓展')) {
+        return _.get(this.classInfo, 'kzjhlocation', '');
+      }
+    },
   },
   filters: {
     getMD(date) {

+ 2 - 0
src/store/index.js

@@ -8,6 +8,7 @@ import questionAnswer from '@frame/store/question-answer';
 import questionnaire from '@frame/store/questionnaire';
 import completion from '@frame/store/question-completion';
 import director from '@frame/store/director';
+import location from '@frame/store/location';
 import student from '@frame/store/student';
 import lesson from '@frame/store/lesson';
 import teacher from '@frame/store/teacher';
@@ -65,6 +66,7 @@ export default new Vuex.Store({
     answerapply,
     chatroom,
     answerchat,
+    location,
     personalscore,
   },
 });

+ 1 - 1
src/views/class/index.vue

@@ -88,7 +88,7 @@ export default {
       navShow: true,
       // 班级信息
       // 头部标签
-      activeName: 'forth',
+      activeName: 'first',
       // 小组列表
       groupList: [],
       // 登陆者所在组,id

+ 11 - 2
src/views/index.vue

@@ -6,7 +6,7 @@
           <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
         </el-col>
         <el-col :span="24" class="main" v-if="view === 'arrange'">
-          <mainData :lesson="lesson" :today="today" :arrange="arrange" @getLesson="getLesson"></mainData>
+          <mainData :lesson="lesson" :today="today" :arrange="arrange" @getLesson="getLesson" :locationList="locationList" :classInfo="classInfo"></mainData>
         </el-col>
 
         <el-col :span="24" class="foot">
@@ -26,6 +26,7 @@ import { mapState, createNamespacedHelpers, mapGetters } from 'vuex';
 const { mapActions: lesson } = createNamespacedHelpers('lesson');
 const { mapActions: classes } = createNamespacedHelpers('classes');
 const { mapActions: util } = createNamespacedHelpers('util');
+const { mapActions: location } = createNamespacedHelpers('location');
 import moment from 'moment';
 
 export default {
@@ -49,8 +50,11 @@ export default {
     classid: undefined,
     classList: [],
     teaids: '',
+    classInfo: {},
+    locationList: [],
   }),
   created() {
+    this.getOtherList();
     let today = this.getDay();
     // let month = this.getMonth();
     let todate = this.getDate();
@@ -77,13 +81,14 @@ export default {
     },
   },
   methods: {
+    ...location({ getLocalList: 'query' }),
     ...lesson({ lessionInfo: 'fetch', lessionlist: 'query' }),
     ...classes({ classesInfo: 'fetch', classeslist: 'query' }),
     ...util({ uiltfetch: 'newfetch', utillist: 'query' }),
     // 查询课程详情
     async searchInfo() {
       const res = await this.classesInfo(this.classid);
-
+      if (res.errcode == '0') this.$set(this, `classInfo`, res.data);
       let classid = this.classid;
       const result = await this.lessionlist({ classid });
 
@@ -166,6 +171,10 @@ export default {
       this.searchInfo();
       this.view = 'arrange';
     },
+    async getOtherList() {
+      const res = await this.getLocalList();
+      if (this.$checkRes(res)) this.$set(this, `locationList`, res.data);
+    },
   },
 };
 </script>