|
|
|
|
|
|
|
|
const lineOptions = ref([]) |
|
|
const lineOptions = ref([]) |
|
|
|
|
|
|
|
|
function disableTime(ts) { |
|
|
function disableTime(ts) { |
|
|
|
|
|
/* 当前日期 */ |
|
|
const DATE = new Date().getDate() |
|
|
const DATE = new Date().getDate() |
|
|
|
|
|
/* 当前小时 */ |
|
|
const HOURS = new Date().getHours() |
|
|
const HOURS = new Date().getHours() |
|
|
|
|
|
/* 当前分钟 */ |
|
|
const MINUTES = new Date().getMinutes() |
|
|
const MINUTES = new Date().getMinutes() |
|
|
|
|
|
/* 当前秒 */ |
|
|
const SECONDS = new Date().getSeconds() |
|
|
const SECONDS = new Date().getSeconds() |
|
|
|
|
|
/* 选择日期 */ |
|
|
const tDate = new Date(ts).getDate() |
|
|
const tDate = new Date(ts).getDate() |
|
|
|
|
|
/* 选择小时 */ |
|
|
const tHours = new Date(ts).getHours() |
|
|
const tHours = new Date(ts).getHours() |
|
|
|
|
|
/* 选择分钟 */ |
|
|
const tMinutes = new Date(ts).getMinutes() |
|
|
const tMinutes = new Date(ts).getMinutes() |
|
|
return { |
|
|
return { |
|
|
|
|
|
/* 小时禁用 */ |
|
|
isHourDisabled: (hour) => { |
|
|
isHourDisabled: (hour) => { |
|
|
|
|
|
/* 选择的日期与当前日期相同,且小于当前时间 */ |
|
|
return tDate === DATE && hour < HOURS |
|
|
return tDate === DATE && hour < HOURS |
|
|
}, |
|
|
}, |
|
|
|
|
|
/* 分钟禁用 */ |
|
|
isMinuteDisabled: (minute) => { |
|
|
isMinuteDisabled: (minute) => { |
|
|
|
|
|
/* 日期相同 */ |
|
|
if (tDate === DATE) { |
|
|
if (tDate === DATE) { |
|
|
if (tHours < HOURS) { |
|
|
|
|
|
return true |
|
|
|
|
|
|
|
|
/* 选择小时大于当前小时,则可以全选 */ |
|
|
|
|
|
if (tHours > HOURS) { |
|
|
|
|
|
return false |
|
|
} else { |
|
|
} else { |
|
|
return minute < MINUTES |
|
|
return minute < MINUTES |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
isSecondDisabled: (second) => { |
|
|
isSecondDisabled: (second) => { |
|
|
|
|
|
/* 日期相同 */ |
|
|
if (tDate === DATE) { |
|
|
if (tDate === DATE) { |
|
|
if (tHours < HOURS) { |
|
|
|
|
|
return true |
|
|
|
|
|
} else if (tMinutes < MINUTES) { |
|
|
|
|
|
return true |
|
|
|
|
|
|
|
|
/* 选择小时大于当前小时,则可以全选 */ |
|
|
|
|
|
if (tHours > HOURS) { |
|
|
|
|
|
return false |
|
|
|
|
|
/* 选择分钟大于当前分钟,则可以全选 */ |
|
|
|
|
|
} else if (tMinutes > MINUTES) { |
|
|
|
|
|
return false |
|
|
} else { |
|
|
} else { |
|
|
return second < SECONDS |
|
|
return second < SECONDS |
|
|
} |
|
|
} |