added batch delete schedules

This commit is contained in:
marvzhang
2020-07-18 12:48:09 +08:00
parent 04757bfe06
commit ed86ff4582
2 changed files with 51 additions and 9 deletions

View File

@@ -26,14 +26,13 @@ const actions = {
getScheduleList({ state, commit }) {
request.get('/schedules')
.then(response => {
if (response.data.data) {
commit('SET_SCHEDULE_LIST', response.data.data.map(d => {
const arr = d.cron.split(' ')
arr.splice(0, 1)
d.cron = arr.join(' ')
return d
}))
}
if (!response.data.data) response.data.data = []
commit('SET_SCHEDULE_LIST', response.data.data.map(d => {
const arr = d.cron.split(' ')
arr.splice(0, 1)
d.cron = arr.join(' ')
return d
}))
})
},
addSchedule({ state }) {