cron表达式定时任务不支持选择年份
cron表达式正解析
getCurrentTime() {
let date = new Date();
this.currentMon = date.getMonth() + 1
this.currentDay = date.getDate()
this.currentHour = date.getHours()
this.currentMin = date.getMinutes()
this.currentSecond = date.getSeconds()
this.cron = `${this.currentSecond} ${this.currentMin} ${this.currentHour} ${this.currentDay} ${this.currentMon} ?`
},
cron表达式反解析显示到页面
this.cronArray = data.execPlanCron.split(" ")
this.currentMon = this.cronArray[4]
this.currentDay = this.cronArray[3]
this.currentHour = this.cronArray[2]
this.currentMin = this.cronArray[1]
this.currentSecond = this.cronArray[0]