quanyawei
2024-11-15 f752f50a484f63fc3786ab1c7ad563f3b17cce77
src/components/Form/HourPicker1.vue
@@ -10,7 +10,7 @@
    type="datetimerange"
    range-separator="至"
    start-placeholder="开始日期"
    value-format="yyyy-MM-dd HH"
    value-format="yyyy-MM-dd HH:mm:ss"
    end-placeholder="结束日期"
    :picker-options="pickerOptions"
  >
@@ -40,11 +40,12 @@
          this.timeOne = minDate.getTime() // 当选一个日期时 就是最小日期
          // // 如何你选择了两个日期了,就把那个变量置空
           if (maxDate) this.timeOne = ''
        },
        disabledDate: time => {
          if (this.timeOne) {
            const WEEK = 7 * 24 * 3600 * 1000 -1 // 这里乘以6相当于 限制7天以内
            const minTime = this.timeOne  // 七天之前
            const WEEK = 7 * 24 * 3600 * 1000 - 1 // 这里乘以6相当于 限制7天以内
            const minTime = this.timeOne // 七天之前
            const maxTime = this.timeOne + WEEK // 七天之后
            return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date()
          } else {