|
@@ -15,7 +15,7 @@
|
|
|
<th :rowspan="getRowNumber(month)" class="mouthTitle" style="width:55px;">{{ month | getWord }}月</th>
|
|
|
<th class="th" v-for="(item, index) in makeCalendar(month)" :key="index">
|
|
|
<p>{{ item }}</p>
|
|
|
- <p>{{ item | getWeekDay }}</p>
|
|
|
+ <p>{{ getWeekDay(item) }}</p>
|
|
|
</th>
|
|
|
<th class="th"><p>班级数</p></th>
|
|
|
<th class="th"><p>人数</p></th>
|
|
@@ -565,20 +565,25 @@ export default {
|
|
|
toSave() {
|
|
|
this.$emit('toSave');
|
|
|
},
|
|
|
+ getWeekDay(datestr) {
|
|
|
+ if (datestr.includes('.')) {
|
|
|
+ const strs = datestr.split('.');
|
|
|
+ const dayStr = `${this.year}-${strs[0]}-${strs[1]}`;
|
|
|
+ let weekday = moment(dayStr).weekday();
|
|
|
+ if (weekday || weekday == 0) {
|
|
|
+ let arr = ['日', '一', '二', '三', '四', '五', '六'];
|
|
|
+ return `星期${arr[weekday]}`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return '';
|
|
|
+ },
|
|
|
},
|
|
|
filters: {
|
|
|
getWord(month) {
|
|
|
let arr = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'];
|
|
|
return arr[month - 1];
|
|
|
},
|
|
|
- getWeekDay(datestr) {
|
|
|
- let weekday = moment(datestr).weekday();
|
|
|
- if (weekday || weekday == 0) {
|
|
|
- let arr = ['一', '二', '三', '四', '五', '六', '日'];
|
|
|
- return `星期${arr[weekday]}`;
|
|
|
- }
|
|
|
- return '';
|
|
|
- },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|