|
@@ -10,8 +10,8 @@
|
|
<div class="time-line-content">
|
|
<div class="time-line-content">
|
|
<vuescroll>
|
|
<vuescroll>
|
|
<Timeline style="margin-top:5px;">
|
|
<Timeline style="margin-top:5px;">
|
|
- <TimelineItem :color="index > 5 ? 'green':'aqua'" v-for="(item,index) in schoolInfo.timetable">
|
|
|
|
- <Icon :type="index > 5 ? 'md-alarm':'ios-book'" slot="dot"></Icon>
|
|
|
|
|
|
+ <TimelineItem :color="item.type == 1 ? 'aqua':'green'" v-for="(item,index) in schoolInfo.timetable">
|
|
|
|
+ <Icon :type="item.type == 1 ? 'ios-book':'md-alarm'" slot="dot"></Icon>
|
|
<div :class="index == curTmIndex ? 'time-line-item time-line-item-active':'time-line-item'" @click="selectTimeNode(index)">
|
|
<div :class="index == curTmIndex ? 'time-line-item time-line-item-active':'time-line-item'" @click="selectTimeNode(index)">
|
|
<div class="time-setting-item">
|
|
<div class="time-setting-item">
|
|
<span class="time">{{item.time}}</span>
|
|
<span class="time">{{item.time}}</span>
|
|
@@ -26,7 +26,7 @@
|
|
<div class="time-table-wrap dark-iview-table">
|
|
<div class="time-table-wrap dark-iview-table">
|
|
<vuescroll>
|
|
<vuescroll>
|
|
<h1 class="sch-title">课程表预览</h1>
|
|
<h1 class="sch-title">课程表预览</h1>
|
|
- <Table :columns="timeColumns" disabled-hover :data="schoolInfo.timetable" border :span-method="handleSpan" style="width:90%;margin:auto;margin-top:10px;">
|
|
|
|
|
|
+ <Table :columns="timeColumns" disabled-hover :data="tableData" border :span-method="handleSpan" style="width:90%;margin:auto;margin-top:10px;">
|
|
<!--上午/下午-->
|
|
<!--上午/下午-->
|
|
<template slot-scope="{ row, index }" slot="sub">
|
|
<template slot-scope="{ row, index }" slot="sub">
|
|
<p style="padding:10px 0px 4px 0px;font-size: 20px;">
|
|
<p style="padding:10px 0px 4px 0px;font-size: 20px;">
|
|
@@ -44,52 +44,45 @@
|
|
</template>
|
|
</template>
|
|
<!--星期一-->
|
|
<!--星期一-->
|
|
<template slot-scope="{ row, index }" slot="MON">
|
|
<template slot-scope="{ row, index }" slot="MON">
|
|
- <div class="week-day-cell">
|
|
|
|
- <!--<span v-if="index >= 5">- -</span>-->
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status"/>
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status"/>
|
|
|
|
|
|
+ <div :class="row.weeklies.MON.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <!--<Icon type="md-checkmark" class="cell-status" title="上课"/>-->
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'MON')" ghost type="default">{{row.weeklies.MON.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期二-->
|
|
<!--星期二-->
|
|
<template slot-scope="{ row, index }" slot="TUE">
|
|
<template slot-scope="{ row, index }" slot="TUE">
|
|
- <div class="week-day-cell">
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status" />
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status" />
|
|
|
|
|
|
+ <div :class="row.weeklies.TUE.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'TUE')" ghost type="default">{{row.weeklies.TUE.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期三-->
|
|
<!--星期三-->
|
|
<template slot-scope="{ row, index }" slot="WED">
|
|
<template slot-scope="{ row, index }" slot="WED">
|
|
- <div class="week-day-cell">
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status" />
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status" />
|
|
|
|
|
|
+ <div :class="row.weeklies.WED.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'WED')" ghost type="default">{{row.weeklies.WED.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期四-->
|
|
<!--星期四-->
|
|
<template slot-scope="{ row, index }" slot="THU">
|
|
<template slot-scope="{ row, index }" slot="THU">
|
|
- <div class="week-day-cell">
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status" />
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status" />
|
|
|
|
|
|
+ <div :class="row.weeklies.THU.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'THU')" ghost type="default">{{row.weeklies.THU.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期五-->
|
|
<!--星期五-->
|
|
<template slot-scope="{ row, index }" slot="FRI">
|
|
<template slot-scope="{ row, index }" slot="FRI">
|
|
- <div class="week-day-cell">
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status" />
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status" />
|
|
|
|
|
|
+ <div :class="row.weeklies.FRI.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'FRI')" ghost type="default">{{row.weeklies.FRI.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期六-->
|
|
<!--星期六-->
|
|
<template slot-scope="{ row, index }" slot="SAT">
|
|
<template slot-scope="{ row, index }" slot="SAT">
|
|
- <div class="week-day-cell">
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status" />
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status" />
|
|
|
|
|
|
+ <div :class="row.weeklies.SAT.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'SAT')" ghost type="default">{{row.weeklies.SAT.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期日-->
|
|
<!--星期日-->
|
|
<template slot-scope="{ row, index }" slot="SUN">
|
|
<template slot-scope="{ row, index }" slot="SUN">
|
|
- <div class="week-day-cell">
|
|
|
|
- <Icon v-if="index < 5" type="md-checkmark" class="cell-status" />
|
|
|
|
- <Icon v-else type="md-close" color="red" class="cell-status" />
|
|
|
|
|
|
+ <div :class="row.weeklies.SUN.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
|
+ <Button class="toggle-status-btn" @click="confirmSetVact(row,'SUN')" ghost type="default">{{row.weeklies.SUN.status == 1 ? '设为休假':'设为上课'}}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</Table>
|
|
</Table>
|
|
@@ -116,7 +109,7 @@
|
|
<span>上课时间</span>
|
|
<span>上课时间</span>
|
|
</Radio>
|
|
</Radio>
|
|
<Radio label="0" style="margin-left:20px;">
|
|
<Radio label="0" style="margin-left:20px;">
|
|
- <span>其他时间</span>
|
|
|
|
|
|
+ <span>休息/其他时间</span>
|
|
</Radio>
|
|
</Radio>
|
|
</RadioGroup>
|
|
</RadioGroup>
|
|
</FormItem>
|
|
</FormItem>
|
|
@@ -146,12 +139,35 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
subIndex: undefined,
|
|
subIndex: undefined,
|
|
- weekDay:'',
|
|
|
|
|
|
+ weekDay: '',
|
|
curTmIndex: 0,
|
|
curTmIndex: 0,
|
|
isVact: undefined,
|
|
isVact: undefined,
|
|
addTimeStatus: false,
|
|
addTimeStatus: false,
|
|
setVactStatus: false,
|
|
setVactStatus: false,
|
|
schoolInfo: {},
|
|
schoolInfo: {},
|
|
|
|
+ defVact: {
|
|
|
|
+ 'MON': {
|
|
|
|
+ status:1
|
|
|
|
+ },
|
|
|
|
+ 'TUE': {
|
|
|
|
+ status:1
|
|
|
|
+ },
|
|
|
|
+ 'WED': {
|
|
|
|
+ status:1
|
|
|
|
+ },
|
|
|
|
+ 'THU': {
|
|
|
|
+ status:1
|
|
|
|
+ },
|
|
|
|
+ 'FRI': {
|
|
|
|
+ status:1
|
|
|
|
+ },
|
|
|
|
+ 'SAT': {
|
|
|
|
+ status:0
|
|
|
|
+ },
|
|
|
|
+ 'SUN':{
|
|
|
|
+ status:0
|
|
|
|
+ }
|
|
|
|
+ },
|
|
timeColumns: [
|
|
timeColumns: [
|
|
{
|
|
{
|
|
title: ' ',
|
|
title: ' ',
|
|
@@ -194,34 +210,7 @@
|
|
{
|
|
{
|
|
title:'星期六',
|
|
title:'星期六',
|
|
slot: 'SAT',
|
|
slot: 'SAT',
|
|
- align:'center',
|
|
|
|
- //renderHeader: (h,obj) => {
|
|
|
|
- // return h(
|
|
|
|
- // 'span',
|
|
|
|
- // [
|
|
|
|
- // '星期六',
|
|
|
|
- // h(
|
|
|
|
- // 'Icon',
|
|
|
|
- // {
|
|
|
|
- // props: {
|
|
|
|
- // type: 'ios-settings'
|
|
|
|
- // },
|
|
|
|
- // style: {
|
|
|
|
- // fontSize: '18px', // 改变icon的样式
|
|
|
|
- // color: '#559DF9',
|
|
|
|
- // cursor: 'pointer'
|
|
|
|
- // },
|
|
|
|
- // on: {
|
|
|
|
- // click: () => {
|
|
|
|
- // this.setVactStatus = true
|
|
|
|
- // this.weekDay = 'SAT'
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // )
|
|
|
|
- // ]
|
|
|
|
- // )
|
|
|
|
- //}
|
|
|
|
|
|
+ align:'center'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'星期日',
|
|
title:'星期日',
|
|
@@ -259,7 +248,9 @@
|
|
timeNode: {
|
|
timeNode: {
|
|
label: '',
|
|
label: '',
|
|
start: '',
|
|
start: '',
|
|
- end:''
|
|
|
|
|
|
+ end: '',
|
|
|
|
+ type: '',
|
|
|
|
+ weeklies: {}
|
|
},
|
|
},
|
|
ruleValidate: {
|
|
ruleValidate: {
|
|
label: [
|
|
label: [
|
|
@@ -277,6 +268,10 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //显示设置休假
|
|
|
|
+ showSetVact(row,index,weekDay) {
|
|
|
|
+
|
|
|
|
+ },
|
|
//根据上下午合并单元格
|
|
//根据上下午合并单元格
|
|
handleSpan({ row, column, rowIndex, columnIndex }) {
|
|
handleSpan({ row, column, rowIndex, columnIndex }) {
|
|
this.getSubIndex()
|
|
this.getSubIndex()
|
|
@@ -294,33 +289,29 @@
|
|
|
|
|
|
getSubIndex() {
|
|
getSubIndex() {
|
|
for (let index in this.schoolInfo.timetable) {
|
|
for (let index in this.schoolInfo.timetable) {
|
|
- if (parseInt(this.schoolInfo.timetable[index].time.substr(0, 2)) > 12) {
|
|
|
|
|
|
+ if (parseInt(this.tableData[index].time.substr(0, 2)) > 12) {
|
|
this.subIndex = parseInt(index)
|
|
this.subIndex = parseInt(index)
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //设置周六周日休假
|
|
|
|
- confirmSetVact() {
|
|
|
|
- if (this.isVact == 1) {
|
|
|
|
- if (this.weekDay == 'SUN') {
|
|
|
|
- for (let index in this.schoolInfo.timetable) {
|
|
|
|
- this.$set(this.schoolInfo.timetable[index], 'SUN', '- -')
|
|
|
|
- }
|
|
|
|
- } else if (this.weekDay == 'SAT') {
|
|
|
|
- for (let index in this.schoolInfo.timetable) {
|
|
|
|
- this.$set(this.schoolInfo.timetable[index], 'SAT', '- -')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else if (this.isVact == 0) {
|
|
|
|
- if (this.weekDay == 'SUN') {
|
|
|
|
- for (let index in this.schoolInfo.timetable) {
|
|
|
|
- this.$set(this.schoolInfo.timetable[index], 'SUN', '')
|
|
|
|
- }
|
|
|
|
- } else if (this.weekDay == 'SAT') {
|
|
|
|
- for (let index in this.schoolInfo.timetable) {
|
|
|
|
- this.$set(this.schoolInfo.timetable[index], 'SAT', '')
|
|
|
|
- }
|
|
|
|
|
|
+ //设置休假/上课
|
|
|
|
+ confirmSetVact(row, key) {
|
|
|
|
+ console.log(row)
|
|
|
|
+ for (let index in this.schoolInfo.timetable) {
|
|
|
|
+ if (this.schoolInfo.timetable[index].time == row.time) {
|
|
|
|
+ this.schoolInfo.timetable[index].weeklies[key].status = 1 - parseInt(this.schoolInfo.timetable[index].weeklies[key].status)
|
|
|
|
+ this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolInfo).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (res.error == null) {
|
|
|
|
+ this.$Message.success(this.$t('schoolBaseInfo.ssTips3'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ this.$Message.error("设置失败!")
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -336,6 +327,8 @@
|
|
this.timeNode.label = ''
|
|
this.timeNode.label = ''
|
|
this.timeNode.start = ''
|
|
this.timeNode.start = ''
|
|
this.timeNode.end = ''
|
|
this.timeNode.end = ''
|
|
|
|
+ this.timeNode.type = ''
|
|
|
|
+ this.timeNode.weeklies = []
|
|
},
|
|
},
|
|
//编辑时间节点
|
|
//编辑时间节点
|
|
editTimeNode(index) {
|
|
editTimeNode(index) {
|
|
@@ -343,6 +336,7 @@
|
|
this.timeNodeIndex = index
|
|
this.timeNodeIndex = index
|
|
let times = this.schoolInfo.timetable[index].time.split(' - ')
|
|
let times = this.schoolInfo.timetable[index].time.split(' - ')
|
|
this.timeNode.label = this.schoolInfo.timetable[index].label
|
|
this.timeNode.label = this.schoolInfo.timetable[index].label
|
|
|
|
+ this.timeNode.type = this.schoolInfo.timetable[index].type
|
|
this.timeNode.start = times[0]
|
|
this.timeNode.start = times[0]
|
|
if (times.length > 1) {
|
|
if (times.length > 1) {
|
|
this.timeNode.end = times[1]
|
|
this.timeNode.end = times[1]
|
|
@@ -380,7 +374,9 @@
|
|
}
|
|
}
|
|
this.schoolInfo.timetable.splice(this.timeNodeIndex + 1, 0, {
|
|
this.schoolInfo.timetable.splice(this.timeNodeIndex + 1, 0, {
|
|
label: this.timeNode.label,
|
|
label: this.timeNode.label,
|
|
- time: time
|
|
|
|
|
|
+ time: time,
|
|
|
|
+ type: this.timeNode.type,
|
|
|
|
+ weeklies: {...this.defVact}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
let time = this.timeNode.start
|
|
let time = this.timeNode.start
|
|
@@ -389,6 +385,10 @@
|
|
}
|
|
}
|
|
this.schoolInfo.timetable[this.timeNodeIndex].label = this.timeNode.label
|
|
this.schoolInfo.timetable[this.timeNodeIndex].label = this.timeNode.label
|
|
this.schoolInfo.timetable[this.timeNodeIndex].time = time
|
|
this.schoolInfo.timetable[this.timeNodeIndex].time = time
|
|
|
|
+ this.schoolInfo.timetable[this.timeNodeIndex].type = this.timeNode.type
|
|
|
|
+ if (!this.schoolInfo.timetable[this.timeNodeIndex].weeklies) {
|
|
|
|
+ this.schoolInfo.timetable[this.timeNodeIndex].weeklies = {...this.defVact}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolInfo).then(
|
|
this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolInfo).then(
|
|
(res) => {
|
|
(res) => {
|
|
@@ -409,6 +409,14 @@
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
|
|
this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ tableData(){
|
|
|
|
+ let arr = this.schoolInfo.timetable.filter((item, index) => {
|
|
|
|
+ return item.type == 1
|
|
|
|
+ })
|
|
|
|
+ return arr
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|