diff --git a/element-vue/src/pages/teacher/myCourseTable.vue b/element-vue/src/pages/teacher/myCourseTable.vue index 917b894..c5ef8fe 100644 --- a/element-vue/src/pages/teacher/myCourseTable.vue +++ b/element-vue/src/pages/teacher/myCourseTable.vue @@ -1,11 +1,11 @@ @@ -14,38 +14,46 @@ import tb_course from "~/components/tb_course"; import navBar from "~/components/teacher/navBar"; import timeSelect from "~/components/timeSelect"; + import {get} from "~/utils"; + import {item2html} from "~/utils/converter"; + export default { name: "myCourse1", - components:{ + components: { tb_course, navBar, timeSelect }, - data(){ + data() { return { - tableData:[] + tableData: [] } }, - methods:{ - cellClick(){ - console.log('click the cell') + methods: { + async load(){ + this.tableData = await get('lb/labrecord/getUserScheduleBySelf',{ + year: this.$refs.timeSelect.year, + semester: this.$refs.timeSelect.semester + }) //发送地址,请求该实验室地址的所有课程 + for (let i = 0; i < this.tableData.length; i++) { + this.$refs.tbCourse.tableData[i].Monday = item2html(this.tableData[i][0]) + this.$refs.tbCourse.tableData[i].Tuesday = item2html(this.tableData[i][1]) + this.$refs.tbCourse.tableData[i].Wednesday = item2html(this.tableData[i][2]) + this.$refs.tbCourse.tableData[i].Thursday = item2html(this.tableData[i][3]) + this.$refs.tbCourse.tableData[i].Friday = item2html(this.tableData[i][4]) + this.$refs.tbCourse.tableData[i].Saturday = item2html(this.tableData[i][5]) + this.$refs.tbCourse.tableData[i].Sunday = item2html(this.tableData[i][6]) + } + }, + cellClick() { + }, - tableStyle(){ + tableStyle() { } }, - mounted() { - console.log(this.$refs.tbCourse) - this.tableData=get('') //发送地址,请求该实验室地址的所有课程 - for (let i = 0; i < this.tableData.length; i++) { - this.$refs.tbCourse.tableData[i].Monday = this.tableData[i][0] - this.$refs.tbCourse.tableData[i].Tuesday = this.tableData[i][1] - this.$refs.tbCourse.tableData[i].Wednesday = this.tableData[i][2] - this.$refs.tbCourse.tableData[i].Thursday = this.tableData[i][3] - this.$refs.tbCourse.tableData[i].Friday = this.tableData[i][4] - this.$refs.tbCourse.tableData[i].Saturday = this.tableData[i][5] - this.$refs.tbCourse.tableData[i].Sunday = this.tableData[i][6] - } + async mounted() { + await this.load() } }