123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <div id="mainData">
- <el-row>
- <el-col :span="24">
- <el-col :span="24" class="beijing">
- <el-row type="flex">
- <el-col :span="4" v-for="(i, index) in arrange" :key="index" @click.native="changeLesson(i)">
- <el-row style="text-align:center">
- <el-col :span="24">{{ i.day }}</el-col>
- <el-col :span="24">{{ i.date | getMD }}</el-col>
- </el-row>
- </el-col>
- </el-row>
- <el-col :span="24" class="top">
- <el-col :span="12" class="time">上课时间</el-col>
- <el-col :span="12" class="date">
- <el-col :span="24"> {{ today.date }}</el-col>
- <el-col :span="24">{{ today.day }}</el-col>
- </el-col>
- </el-col>
- <template v-if="lesson">
- <el-col :span="24" class="context" v-for="(item, index) in lesson" :key="index">
- <el-col :span="12" class="contexttime">
- <span>{{ item.time }}</span>
- </el-col>
- <el-col :span="12" class="contextclass">
- <p>{{ item.subname }}</p>
- <p class="title">
- <span @click="click(item)">{{ item.teaname }}</span>
- </p>
- <p>{{ getLocaltion(item) }}</p>
- </el-col>
- <el-col :span="24">
- <p></p>
- </el-col>
- </el-col>
- </template>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
- export default {
- name: 'mainData',
- props: {
- lesson: null,
- today: null,
- arrange: null,
- classInfo: { type: Object, default: () => {} },
- locationList: { type: Array, default: () => [] },
- },
- components: {},
- data: () => ({}),
- created() {},
- computed: {
- ...mapState(['user']),
- },
- methods: {
- changeLesson(date) {
- this.$emit('getLesson', date);
- },
- click(item) {
- this.$router.push({ path: '/home/teacher', 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', '');
- } else if (data.subname.includes('午餐+休息') || data.subname.includes('晚餐')) {
- return _.get(this.classInfo, 'yclocation', '');
- }
- },
- },
- filters: {
- getMD(date) {
- let arr = date.split('-');
- //${arr[1]}-
- return `${arr[1]}-${arr[2]}`;
- },
- },
- };
- </script>
- <style lang="less" scoped>
- p {
- padding: 0;
- margin: 0;
- }
- .info {
- text-align: center;
- padding: 7px 0 0 0;
- }
- .beijing {
- background-color: #f9fafc;
- }
- .top {
- margin: 10px 0 0 0;
- }
- /deep/.el-button {
- border-radius: 11px;
- padding: 10px 10px 10px 10px;
- }
- .time {
- background-color: #ffffff;
- font-size: 16px;
- color: #222222;
- text-align: center;
- padding: 15px 0;
- }
- .date {
- background-color: #ffffff;
- font-size: 16px;
- color: #222222;
- text-align: center;
- padding: 6px 0;
- }
- .context {
- background-color: #ffffff;
- width: 92%;
- margin: 15px 15px 0 15px;
- color: #bbbbbb;
- padding: 15px 0;
- }
- .contexttime {
- padding: 15px 20px 0 20px;
- }
- .contextclass {
- background-color: #ffffff;
- }
- .contextclass p {
- padding: 15px 0 0 0;
- text-align: center;
- }
- .title {
- color: blueviolet;
- }
- </style>
|