|
@@ -39,6 +39,7 @@
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
placeholder="年/月/日 时/分/秒"
|
|
placeholder="年/月/日 时/分/秒"
|
|
:disabled-date="disabledDate"
|
|
:disabled-date="disabledDate"
|
|
|
|
+ :disabledTime="disabledDateTime"
|
|
v-model="form.releaseDate"/>
|
|
v-model="form.releaseDate"/>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
<a-form-model-item label="图片上传" prop="imgPaths">
|
|
<a-form-model-item label="图片上传" prop="imgPaths">
|
|
@@ -141,8 +142,61 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
disabledDate (current) {
|
|
disabledDate (current) {
|
|
- // Can not select days before today and today
|
|
|
|
- return current && current < moment().subtract(1, 'days')
|
|
|
|
|
|
+ return current && current < moment().startOf('day')
|
|
|
|
+ },
|
|
|
|
+ disabledDateTime (date) {
|
|
|
|
+ if (!date) {
|
|
|
|
+ date = moment()
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ disabledHours: () => this.getDisabledHours(date.format('YYYY-MM-DD HH:mm:ss')),
|
|
|
|
+ disabledMinutes: () => this.getDisabledMinutes(date.format('YYYY-MM-DD HH:mm:ss')),
|
|
|
|
+ disabledSeconds: () => this.getDisabledSeconds(date.format('YYYY-MM-DD HH:mm:ss'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 禁用时间范围 时
|
|
|
|
+ getDisabledHours (nowTime) {
|
|
|
|
+ const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
+ const time = nowTime.split(' ')
|
|
|
|
+ const times = todayDate.split(' ')
|
|
|
|
+ const timeArrs = times[1].split(':')
|
|
|
|
+ const hours = []
|
|
|
|
+ if (todayDate.split(' ')[0] == time[0]) {
|
|
|
|
+ for (var i = 0; i < parseInt(timeArrs[0]); i++) {
|
|
|
|
+ hours.push(i)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return hours
|
|
|
|
+ },
|
|
|
|
+ // 禁用时间范围 分
|
|
|
|
+ getDisabledMinutes (nowTime) {
|
|
|
|
+ const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
+ const time = nowTime.split(' ')
|
|
|
|
+ const times = todayDate.split(' ')
|
|
|
|
+ const timeArr = time[1].split(':')
|
|
|
|
+ const timeArrs = times[1].split(':')
|
|
|
|
+ const minutes = []
|
|
|
|
+ if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0]) {
|
|
|
|
+ for (var i = 0; i < parseInt(timeArrs[1]); i++) {
|
|
|
|
+ minutes.push(i)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return minutes
|
|
|
|
+ },
|
|
|
|
+ // 禁用时间范围 秒
|
|
|
|
+ getDisabledSeconds (nowTime) {
|
|
|
|
+ const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
+ const time = nowTime.split(' ')
|
|
|
|
+ const times = todayDate.split(' ')
|
|
|
|
+ const timeArr = time[1].split(':')
|
|
|
|
+ const timeArrs = times[1].split(':')
|
|
|
|
+ const second = []
|
|
|
|
+ if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0] && timeArrs[1] == timeArr[1]) {
|
|
|
|
+ for (var i = 0; i <= parseInt(timeArrs[2]); i++) {
|
|
|
|
+ second.push(i)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return second
|
|
},
|
|
},
|
|
// 详情
|
|
// 详情
|
|
getDetail () {
|
|
getDetail () {
|