commit
4032c04629
@ -17,8 +17,8 @@ var courseTable = {
|
|||||||
props: ['select_c'],
|
props: ['select_c'],
|
||||||
data: function(){
|
data: function(){
|
||||||
return {
|
return {
|
||||||
'tableBody': "<tbody>",
|
|
||||||
'courses': {},
|
'courses': {},
|
||||||
|
'existWeekend': false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -38,8 +38,17 @@ var courseTable = {
|
|||||||
watch: {
|
watch: {
|
||||||
'select_c': function(){
|
'select_c': function(){
|
||||||
this.courses = {}
|
this.courses = {}
|
||||||
|
var weekendLock = false
|
||||||
|
|
||||||
for(var c of this.select_c){
|
for(var c of this.select_c){
|
||||||
this.courses[c.time] = c.name
|
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>
|
<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>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -63,8 +76,14 @@ var courseTable = {
|
|||||||
<th style='text-align: center;' scope='row'>
|
<th style='text-align: center;' scope='row'>
|
||||||
{{ hour+7 }}~{{ hour+8 }} <br> z
|
{{ hour+7 }}~{{ hour+8 }} <br> z
|
||||||
</th>
|
</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>
|
</td>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@ -72,7 +91,7 @@ var courseTable = {
|
|||||||
{{ hour+7 }} ~ {{ hour+8 }} <br>
|
{{ hour+7 }} ~ {{ hour+8 }} <br>
|
||||||
{{ String.fromCharCode(97+((hour<5)?(hour-1):(hour-2))) }}
|
{{ String.fromCharCode(97+((hour<5)?(hour-1):(hour-2))) }}
|
||||||
</th>
|
</th>
|
||||||
<td v-for='week in 5'>
|
<td v-for='week in (existWeekend)?7:5'>
|
||||||
<course-div
|
<course-div
|
||||||
v-if="exist(week+String.fromCharCode(97+((hour<5)?(hour-1):(hour-2))))"
|
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)))]"
|
v-bind:course="courses[week+String.fromCharCode(97+((hour<5)?(hour-1):(hour-2)))]"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user