commit
4032c04629
@ -17,8 +17,8 @@ var courseTable = {
|
||||
props: ['select_c'],
|
||||
data: function(){
|
||||
return {
|
||||
'tableBody': "<tbody>",
|
||||
'courses': {},
|
||||
'existWeekend': false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -38,8 +38,17 @@ var courseTable = {
|
||||
watch: {
|
||||
'select_c': function(){
|
||||
this.courses = {}
|
||||
var weekendLock = false
|
||||
|
||||
for(var c of this.select_c){
|
||||
this.courses[c.time] = c.name
|
||||
|
||||
if(c.time[0]==6 || c.time[0]==7){
|
||||
weekendLock = true
|
||||
}
|
||||
}
|
||||
if(weekendLock){
|
||||
this.existWeekend = true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -55,6 +64,10 @@ var courseTable = {
|
||||
<th scope="col" class="col-md-2">三</th>
|
||||
<th scope="col" class="col-md-2">四</th>
|
||||
<th scope="col" class="col-md-2">五</th>
|
||||
<template v-if='existWeekend'>
|
||||
<th scope="col" class="col-md-1">六</th>
|
||||
<th scope="col" class="col-md-1">日</th>
|
||||
</template>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -63,8 +76,14 @@ var courseTable = {
|
||||
<th style='text-align: center;' scope='row'>
|
||||
{{ hour+7 }}~{{ hour+8 }} <br> z
|
||||
</th>
|
||||
<td style='text-align: center; background-color: #1abc9c;' colspan='5'>
|
||||
中午休息時間
|
||||
|
||||
<td style='text-align: center; background-color: #1abc9c;'
|
||||
v-for="week in (existWeekend)?7:5">
|
||||
<course-div
|
||||
v-if="exist(week+'z')"
|
||||
v-bind:course="courses[week+'z']"
|
||||
v-on:remove-course="removeCourseHandler"
|
||||
></course-div>
|
||||
</td>
|
||||
</template>
|
||||
<template v-else>
|
||||
@ -72,7 +91,7 @@ var courseTable = {
|
||||
{{ hour+7 }} ~ {{ hour+8 }} <br>
|
||||
{{ String.fromCharCode(97+((hour<5)?(hour-1):(hour-2))) }}
|
||||
</th>
|
||||
<td v-for='week in 5'>
|
||||
<td v-for='week in (existWeekend)?7:5'>
|
||||
<course-div
|
||||
v-if="exist(week+String.fromCharCode(97+((hour<5)?(hour-1):(hour-2))))"
|
||||
v-bind:course="courses[week+String.fromCharCode(97+((hour<5)?(hour-1):(hour-2)))]"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user