|
@@ -1,18 +1,14 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
- <el-row>
|
|
|
- {{ notice.content }}
|
|
|
- <!--<el-col :span="24">
|
|
|
- <span v-if="type == '1'">
|
|
|
- 学校
|
|
|
- </span>
|
|
|
- <span v-else-if="type == '2'">
|
|
|
- 普通
|
|
|
- </span>
|
|
|
- <span v-else-if="type == '3'">
|
|
|
+ <el-row v-loading="loading" style="height:100vh">
|
|
|
+ <el-col :span="24" v-if="!loading">
|
|
|
+ <span v-if="notice.type == '4'">
|
|
|
<class-index :dayList="dayList" :lessonList="lessonList" :classInfo="classInfo" />
|
|
|
</span>
|
|
|
- </el-col> -->
|
|
|
+ <span v-else>
|
|
|
+ {{ notice.content }}
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -22,106 +18,60 @@ import _ from 'lodash';
|
|
|
import classIndex from './worker/index.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: notice } = createNamespacedHelpers('notice');
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
+const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
- components: {}, //classIndex
|
|
|
+ components: { classIndex }, //
|
|
|
data: function() {
|
|
|
return {
|
|
|
+ loading: true,
|
|
|
notice: {},
|
|
|
- type: '3',
|
|
|
- lessonList: [
|
|
|
- { _id: '5f2a10297f40d16be433e81b', subname: '报到+开班仪式', day: '0', date: '2020-04-07', time: '13:30-16:30' },
|
|
|
- { _id: '5f2a10297f40d16be433e81c', subid: '', subname: '晚餐', date: '2020-04-07', time: '16:30-17:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e81d', subid: '', subname: '团队组建', date: '2020-04-07', time: '17:30-19:45', day: '0' },
|
|
|
- {
|
|
|
- _id: '5f2a10297f40d16be433e81e',
|
|
|
- teaid: '5ef08199fbf5d71a24881f11',
|
|
|
- teaname: '吉林大学测试科目一教师',
|
|
|
- subid: '5f27bb47dd73cc2308f7b978',
|
|
|
- subname: '测试科目1',
|
|
|
- day: '0',
|
|
|
- date: '2020-04-08',
|
|
|
- time: '08:00-11:30',
|
|
|
- },
|
|
|
- { _id: '5f2a10297f40d16be433e81f', subid: '', subname: '午餐+休息', date: '2020-04-08', time: '11:30-13:30', day: '0' },
|
|
|
- {
|
|
|
- _id: '5f2a10297f40d16be433e820',
|
|
|
- subid: '5f27bb47dd73cc2308f7b978',
|
|
|
- subname: '测试科目1',
|
|
|
- date: '2020-04-08',
|
|
|
- time: '13:30-16:30',
|
|
|
- day: '0',
|
|
|
- teaid: '5ef08199fbf5d71a24881f11',
|
|
|
- teaname: '吉林大学测试科目一教师',
|
|
|
- },
|
|
|
- { _id: '5f2a10297f40d16be433e821', subid: '', subname: '晚餐', date: '2020-04-08', time: '16:30-17:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e822', subid: '', subname: '拓展交流', date: '2020-04-08', time: '17:30-19:45', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e823', subid: '5e730d755a52a378a817ec7d', subname: '测试科目二', day: '0', date: '2020-04-09', time: '08:00-11:30' },
|
|
|
- { _id: '5f2a10297f40d16be433e824', subid: '', subname: '午餐+休息', date: '2020-04-09', time: '11:30-13:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e825', subid: '5e730d755a52a378a817ec7d', subname: '测试科目二', date: '2020-04-09', time: '13:30-16:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e826', subid: '', subname: '晚餐', date: '2020-04-09', time: '16:30-17:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e827', subid: '', subname: '课程作业小组展示\t', date: '2020-04-09', time: '17:30-19:45', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e828', subid: '5e730d7e5a52a378a817ec7e', subname: '测试科目三', day: '0', date: '2020-04-10', time: '08:00-11:30' },
|
|
|
- { _id: '5f2a10297f40d16be433e829', subid: '', subname: '午餐+休息', date: '2020-04-10', time: '11:30-13:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e82a', subid: '5e730d7e5a52a378a817ec7e', subname: '测试科目三', date: '2020-04-10', time: '13:30-16:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e82b', subid: '', subname: '晚餐', date: '2020-04-10', time: '16:30-17:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e82c', subid: '', subname: '课程作业', date: '2020-04-10', time: '17:30-19:45', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e82d', subid: '5e730d855a52a378a817ec7f', subname: '测试科目四', day: '0', date: '2020-04-11', time: '08:00-11:30' },
|
|
|
- { _id: '5f2a10297f40d16be433e82e', subid: '', subname: '午餐+休息', date: '2020-04-11', time: '11:30-13:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e82f', subid: '5e730d855a52a378a817ec7f', subname: '测试科目四', date: '2020-04-11', time: '13:30-16:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e830', subid: '', subname: '晚餐', date: '2020-04-11', time: '16:30-17:30', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e831', subid: '', subname: '礼仪课小组面试\t', date: '2020-04-11', time: '17:30-19:45', day: '0' },
|
|
|
- { _id: '5f2a10297f40d16be433e832', subname: '结业仪式', day: '0', date: '2020-04-12', time: '17:30-19:45' },
|
|
|
- ],
|
|
|
- classInfo: {
|
|
|
- meta: { state: 0, createdAt: '2020-08-01T08:12:03.344Z', updatedAt: '2020-08-05T09:23:15.928Z' },
|
|
|
- _id: '5f2523d3a0109c964c60495e',
|
|
|
- name: '2',
|
|
|
- number: '56',
|
|
|
- batchid: '5f1f8bdc26941e8a38670364',
|
|
|
- termid: '5f1f8bdc26941e8a38670363',
|
|
|
- planid: '5f110d2ee48f4e6ff461283d',
|
|
|
- type: '0',
|
|
|
- headteacherid: '5f228f3936578693741c3e78',
|
|
|
- __v: 0,
|
|
|
- jslocationid: '5e730ca35a52a378a817ec75',
|
|
|
- kbyslocationid: '5e730d535a52a378a817ec7b',
|
|
|
- kzjhlocationid: '5e730d135a52a378a817ec77',
|
|
|
- lyteacherid: '5f228f3936578693741c3e78',
|
|
|
- yclocationid: '5e730d3d5a52a378a817ec78',
|
|
|
- id: '5f2523d3a0109c964c60495e',
|
|
|
- term: '1',
|
|
|
- batch: '1',
|
|
|
- startdate: '2020-04-07',
|
|
|
- enddate: '2020-04-12',
|
|
|
- yclocation: '食堂',
|
|
|
- kzjhlocation: '室外拓展训练场地',
|
|
|
- kbyslocation: '会议室',
|
|
|
- jslocation: '第一教室',
|
|
|
- headteacher: '顾红伟2',
|
|
|
- lyteacher: '顾红伟2',
|
|
|
- },
|
|
|
+ type: '4',
|
|
|
+ lessonList: [],
|
|
|
+ classInfo: {},
|
|
|
dayList: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.dealLesson();
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
...notice(['fetch', 'lookFetch']),
|
|
|
+ ...util({ modelFetch: 'fetch' }),
|
|
|
+ ...classes({ getClass: 'fetch' }),
|
|
|
async search() {
|
|
|
if (!this.noticeid) {
|
|
|
this.$toast.fail('没有消息相关信息,无法找到消息来源');
|
|
|
return;
|
|
|
}
|
|
|
const res = await this.fetch(this.noticeid);
|
|
|
+ let notice;
|
|
|
if (res.errcode == '0') {
|
|
|
+ notice = _.get(res, `data`);
|
|
|
this.$set(this, `notice`, res.data);
|
|
|
const r = await this.lookFetch({ noticeid: this.noticeid, userid: this.userid });
|
|
|
if (r.errcode == '0') this.$toast.success('消息已确认');
|
|
|
}
|
|
|
+ if (notice) {
|
|
|
+ if (notice.type === '4') {
|
|
|
+ await this.getLesson(notice.classid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ async getLesson(classid) {
|
|
|
+ const cRes = await this.getClass(classid);
|
|
|
+ if (this.$checkRes(cRes)) {
|
|
|
+ this.$set(this, `classInfo`, cRes.data);
|
|
|
+ }
|
|
|
+ const lRes = await this.modelFetch({ model: 'lesson', classid });
|
|
|
+ if (this.$checkRes(lRes)) {
|
|
|
+ const { lessons } = lRes.data;
|
|
|
+ this.$set(this, `lessonList`, lessons);
|
|
|
+ this.dealLesson();
|
|
|
+ }
|
|
|
},
|
|
|
dealLesson() {
|
|
|
let dl = _.cloneDeep(this.lessonList);
|