[fix][V]:完善周次选择器

master
aiyadc 5 years ago
parent 264286510b
commit 8b24e3527f

@ -137,7 +137,8 @@
schedule: '',
remind: '无'
},
courseOption: []
courseOption: [],
booked: []
}
},
@ -148,17 +149,11 @@
return 'cursor:pointer'
}
},
f(){},
f() {
},
//
async cellClick(row, column, cell, event) {
this.form.weeks = null
this.form.day = column.index
this.form.time = row.index
this.form.year = this.$refs.timeSelection.year
this.form.semester = this.$refs.timeSelection.semester
this.ableList = await get("lb/labTime/getWeeksAbleBook", this.form)
this.aWeekValue.push(row.index, column.index)
//()使disable
// let position = this.lab.position
// let rowIndex = row.index
@ -167,13 +162,25 @@
// var weeks=[6,7,8]
//()使disablevar
if (column.label != '') {
this.perTargetValue = event.target //targettarget
this.aWeekValue.push(row.index, column.index)
this.form.weeks = null
this.form.day = column.index
this.form.time = row.index
this.form.year = this.$refs.timeSelection.year
this.form.semester = this.$refs.timeSelection.semester
new Promise((resolve, reject) => { //使weekDialog
this.weekDialog = true
resolve('打开了weekDialog')
}).then((res) => {
}).then(async (res) => {
this.ableList = await get("lb/labTime/getWeeksAbleBook", this.form)
this.$refs.weekSelection.singleVal = this.ableList.filter(elem => elem % 2 !== 0)
this.$refs.weekSelection.doubleVal = this.ableList.filter(elem => elem % 2 === 0)
this.$refs.weekSelection.allVal = this.ableList
this.$refs.weekSelection.checkedValue = this.booked[row.index - 1][column.index - 1]
this.aWeekValue.push(row.index, column.index)
this.perTargetValue = event.target //targettarget
this.aWeekValue.push(row.index, column.index)
// console.log(this.$refs.weekSelection)
// var position = this.form.position
// var rowIndex = row.index
@ -181,9 +188,7 @@
// var selectedWeeks = get('', {position, rowIndex, columnIndex}) //rowIndexcolumIndex:
// selectedWeeks = [1, 2, 3]
// this.$refs.weekSelection.disableList = selectedWeeks
// this.$refs.weekSelection.singleVal = this.$refs.weekSelection.singleVal.filter(x => !selectedWeeks.includes(x))
// this.$refs.weekSelection.doubleVal = this.$refs.weekSelection.doubleVal.filter(x => !selectedWeeks.includes(x))
// this.$refs.weekSelection.allVal = this.$refs.weekSelection.allVal.filter(x => !selectedWeeks.includes(x))
// console.log('aa', this.$refs.weekSelection.singleVal)
})
}
@ -335,6 +340,8 @@
}
const schedule = await get('lb/labTime/getLabScheduleAbleBook', params)
const booked = await get('lb/labrecord/getWeekBooked', params)
this.booked = booked
console.log(this.booked)
for (let i = 0; i < schedule.length; i++) {
this.$refs.times.tableData[i].Monday = arr2shortString(schedule[i][0]) ? '<span style="color:#1989fa">' + arr2shortString(schedule[i][0]) + '周可预约' + '</span>' : ''
this.$refs.times.tableData[i].Tuesday = arr2shortString(schedule[i][1]) ? '<span style="color:#1989fa">' + arr2shortString(schedule[i][1]) + '周可预约' + '</span>' : ''

Loading…
Cancel
Save