|
@@ -3,10 +3,11 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="style">
|
|
|
<el-col :span="24" class="top">
|
|
|
- <topInfo></topInfo>
|
|
|
+ <!-- <topInfo></topInfo> -->
|
|
|
+ <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="main">
|
|
|
- <mainData></mainData>
|
|
|
+ <mainData :lessionclassInfo="lessionclassInfo" :week="week"></mainData>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="foot">
|
|
|
<footInfo></footInfo>
|
|
@@ -17,30 +18,81 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import topInfo from '@/layout/common/topInfo.vue';
|
|
|
+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 { createNamespacedHelpers, mapGetters } from 'vuex';
|
|
|
const { mapActions: mapStudent } = createNamespacedHelpers('student');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
components: {
|
|
|
- topInfo, //头部导航
|
|
|
+ NavBar, //头部导航
|
|
|
footInfo, //底部导航
|
|
|
mainData, //课程安排主体
|
|
|
},
|
|
|
- data: () => ({}),
|
|
|
+ data: () => ({
|
|
|
+ lessionclassInfo: { lessons: [] },
|
|
|
+ dates: '',
|
|
|
+ week: '',
|
|
|
+ title: '日程安排',
|
|
|
+ isleftarrow: '',
|
|
|
+ transitionName: 'fade',
|
|
|
+ navShow: true,
|
|
|
+ }),
|
|
|
created() {
|
|
|
+ this.getDate();
|
|
|
+ this.searchInfo();
|
|
|
this.searchSite();
|
|
|
},
|
|
|
computed: {},
|
|
|
+ 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: {
|
|
|
+ ...lesson({ lessionInfo: 'fetch', lessionlist: 'query' }),
|
|
|
...mapStudent(['fetch']),
|
|
|
async searchSite() {
|
|
|
const res = await this.fetch('5e4f3d096a90e861b0f30871');
|
|
|
sessionStorage.setItem('site', JSON.stringify(res.data));
|
|
|
},
|
|
|
+ async searchInfo({ ...info } = {}) {
|
|
|
+ const res = await this.lessionlist({ ...info });
|
|
|
+ for (const val of res.data) {
|
|
|
+ var arr = res.data.filter(item => item.class === '5e4df0c93ffa245d6065f526');
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|