|
@@ -0,0 +1,81 @@
|
|
|
+<template>
|
|
|
+ <div id="index">
|
|
|
+ <el-card header="已安排的课程">
|
|
|
+ <el-table :data="list" border stripe height="700px">
|
|
|
+ <el-table-column align="center" label="日期" prop="day"></el-table-column>
|
|
|
+ <el-table-column align="center" label="期" prop="term"></el-table-column>
|
|
|
+ <el-table-column align="center" label="班级" prop="classname"></el-table-column>
|
|
|
+ <el-table-column align="center" label="课程" prop="subname"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+const _ = require('lodash');
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions } = createNamespacedHelpers('trainplan');
|
|
|
+const { mapActions: teaplan } = createNamespacedHelpers('teaplan');
|
|
|
+const { mapActions: teacher } = createNamespacedHelpers('teacher');
|
|
|
+const { mapActions: subject } = createNamespacedHelpers('subject');
|
|
|
+const { mapActions: classtype } = createNamespacedHelpers('classtype');
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {},
|
|
|
+ components: {},
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ list: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['query', 'delete', 'fetch']),
|
|
|
+ async search() {
|
|
|
+ let { planid } = this.defaultOption;
|
|
|
+ let { userid } = this.user;
|
|
|
+ if (!planid) return;
|
|
|
+ let res = await this.fetch(planid);
|
|
|
+ if (!this.$checkRes(res)) return;
|
|
|
+ const { termnum } = res.data;
|
|
|
+ let arr = [];
|
|
|
+ termnum.map(t => {
|
|
|
+ let { term, _id: termid } = t;
|
|
|
+ let obj = { term: term * 1, termid };
|
|
|
+ t.batchnum.map(b => {
|
|
|
+ const { _id: batchid, batch, class: classes } = b;
|
|
|
+ classes.map(c => {
|
|
|
+ let { lessons, name: classname } = c;
|
|
|
+ let tealesson = lessons.filter(f => f.teaid === userid);
|
|
|
+ tealesson = tealesson.map(tl => {
|
|
|
+ if (parseInt(classname)) classname = parseInt(classname);
|
|
|
+ tl.classname = classname;
|
|
|
+ tl.termid = termid;
|
|
|
+ tl.batchid = batchid;
|
|
|
+ tl.term = term;
|
|
|
+ tl.batch = batch;
|
|
|
+ return tl;
|
|
|
+ });
|
|
|
+ arr = [...arr, ...tealesson];
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ arr = _.orderBy(arr, ['day', 'term', 'classname'], ['asc', 'asc', 'asc']);
|
|
|
+ this.$set(this, `list`, arr);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user', 'defaultOption']),
|
|
|
+ pageTitle() {
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|