学习是最好的投资!
[ {time: '',activity: '早读', monday: '', tuesday: '', Wednesday: '', Thursday: '', Friday: ''}, {time: '',activity: '...', monday: '', tuesday: '', Wednesday: '', Thursday: '', Friday: ''}, ... ]
activity
td
colspan="5"
保证数据完整性的一种结构:
{ "classId" : "1", "className" : "五年级一班", "semesterId" : "1", "semester" : "2015年第一学期", "courses" : [ { "day" : "monday", "course" : [ { "startTime" : "7:40", "endTime" : "8:00", "subject" : "早读", "teacher" : "-" }, { "startTime" : "8:00", "endTime" : "8:45", "subject" : "数学", "teacher" : "张红" }, { "startTime" : "8:55", "endTime" : "9:40", "subject" : "语言E", "teacher" : "李晓军" }, { "startTime" : "9:40", "endTime" : "10:10", "subject" : "课堂操", "teacher" : "-" }, { "startTime" : "10:00", "endTime" : "10:45", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "10:45", "endTime" : "11:05", "subject" : "眼保健操", "teacher" : "-" }, { "startTime" : "11:05", "endTime" : "11:50", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "11:50", "endTime" : "14:00", "subject" : "午休", "teacher" : "-" }, { "startTime" : "14:00", "endTime" : "14:45", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "14:55", "endTime" : "15:40", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "15:50", "endTime" : "16:35", "subject" : "语文", "teacher" : "李晓军" } ] }, { "day" : "tuesday", "course" : [ { "startTime" : "7:40", "endTime" : "8:00", "subject" : "早读", "teacher" : "-" }, { "startTime" : "8:00", "endTime" : "8:45", "subject" : "数学", "teacher" : "张红" }, { "startTime" : "8:55", "endTime" : "9:40", "subject" : "语言E", "teacher" : "李晓军" }, { "startTime" : "9:40", "endTime" : "10:10", "subject" : "课堂操", "teacher" : "-" }, { "startTime" : "10:00", "endTime" : "10:45", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "10:45", "endTime" : "11:05", "subject" : "眼保健操", "teacher" : "-" }, { "startTime" : "11:05", "endTime" : "11:50", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "11:50", "endTime" : "14:00", "subject" : "午休", "teacher" : "-" }, { "startTime" : "14:00", "endTime" : "14:45", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "14:55", "endTime" : "15:40", "subject" : "语文", "teacher" : "李晓军" }, { "startTime" : "15:50", "endTime" : "16:35", "subject" : "语文", "teacher" : "李晓军" } ] } ] }
后来想想,若我们想要标注出不同的课程类型的话,可以给每一节课再加一个标识:
type
比如:
{ "startTime" : "7:40", "endTime" : "8:00", "subject" : "早读", "teacher" : "-", "type" : "common" },
[ {name: '早读', teacher: '张红', number:0, time:'7:40-8:00',week: 1, dailyCourse:true}, {name: '数学', teacher: '张红', number:1, time:'8:10-8:50', week: 1, dailyCourse:false}, ... ]
activity
属性值不为空字符串,则设置td
标签colspan="5"
;否则,生成6个td
标签,按时间段,星期一,...,星期五分别赋值保证数据完整性的一种结构:
后来想想,若我们想要标注出不同的课程类型的话,可以给每一节课再加一个标识:
比如: