Blame view

src/components/date-picker/panel/date-range.vue 17.1 KB
17e1fcf1   梁灏   init DatePicker
1
  <template>
e0cd7f90   梁灏   fixed #134
2
      <div :class="classes">
3cf7cfd1   梁灏   update DatePicker
3
4
5
6
7
8
9
          <div :class="[prefixCls + '-sidebar']" v-if="shortcuts.length">
              <div
                  :class="[prefixCls + '-shortcut']"
                  v-for="shortcut in shortcuts"
                  @click="handleShortcutClick(shortcut)">{{ shortcut.text }}</div>
          </div>
          <div :class="[prefixCls + '-body']">
2dc27713   梁灏   update DateTimePi...
10
              <div :class="[prefixCls + '-content', prefixCls + '-content-left']" v-show="!isTime">
0a5c5f41   梁灏   update DatePicker
11
                  <div :class="[datePrefixCls + '-header']" v-show="leftCurrentView !== 'time'">
3cf7cfd1   梁灏   update DatePicker
12
13
                      <span
                          :class="iconBtnCls('prev', '-double')"
0a5c5f41   梁灏   update DatePicker
14
                          @click="prevYear('left')"><Icon type="ios-arrow-left"></Icon></span>
3cf7cfd1   梁灏   update DatePicker
15
16
17
                      <span
                          :class="iconBtnCls('prev')"
                          @click="prevMonth"
0a5c5f41   梁灏   update DatePicker
18
                          v-show="leftCurrentView === 'date'"><Icon type="ios-arrow-left"></Icon></span>
3cf7cfd1   梁灏   update DatePicker
19
20
                      <span
                          :class="[datePrefixCls + '-header-label']"
0a5c5f41   梁灏   update DatePicker
21
                          @click="showYearPicker('left')">{{ leftYearLabel }}</span>
3cf7cfd1   梁灏   update DatePicker
22
23
                      <span
                          :class="[datePrefixCls + '-header-label']"
0a5c5f41   梁灏   update DatePicker
24
                          @click="showMonthPicker('left')"
4ab11811   梁灏   some component su...
25
                          v-show="leftCurrentView === 'date'">{{ leftMonthLabel }}</span>
0a5c5f41   梁灏   update DatePicker
26
27
28
29
                      <span
                          :class="iconBtnCls('next', '-double')"
                          @click="nextYear('left')"
                          v-show="leftCurrentView === 'year' || leftCurrentView === 'month'"><Icon type="ios-arrow-right"></Icon></span>
3cf7cfd1   梁灏   update DatePicker
30
31
                  </div>
                  <date-table
0a5c5f41   梁灏   update DatePicker
32
                      v-show="leftCurrentView === 'date'"
3cf7cfd1   梁灏   update DatePicker
33
34
35
36
37
38
                      :year="leftYear"
                      :month="leftMonth"
                      :date="date"
                      :min-date="minDate"
                      :max-date="maxDate"
                      :range-state="rangeState"
472b4ff1   梁灏   update DatePicker
39
                      selection-mode="range"
3cf7cfd1   梁灏   update DatePicker
40
                      :disabled-date="disabledDate"
472b4ff1   梁灏   update DatePicker
41
                      @on-changerange="handleChangeRange"
68e9b100   梁灏   update DatePicker
42
43
                      @on-pick="handleRangePick"
                      @on-pick-click="handlePickClick"></date-table>
0a5c5f41   梁灏   update DatePicker
44
                  <year-table
531cd165   梁灏   support DatePicke...
45
                      ref="leftYearTable"
0a5c5f41   梁灏   update DatePicker
46
                      v-show="leftCurrentView === 'year'"
3732707e   梁灏   update DatePicker
47
48
                      :year="leftTableYear"
                      :date="leftTableDate"
0a5c5f41   梁灏   update DatePicker
49
50
                      selection-mode="range"
                      :disabled-date="disabledDate"
68e9b100   梁灏   update DatePicker
51
52
                      @on-pick="handleLeftYearPick"
                      @on-pick-click="handlePickClick"></year-table>
0a5c5f41   梁灏   update DatePicker
53
                  <month-table
531cd165   梁灏   support DatePicke...
54
                      ref="leftMonthTable"
0a5c5f41   梁灏   update DatePicker
55
56
                      v-show="leftCurrentView === 'month'"
                      :month="leftMonth"
3732707e   梁灏   update DatePicker
57
                      :date="leftTableDate"
0a5c5f41   梁灏   update DatePicker
58
59
                      selection-mode="range"
                      :disabled-date="disabledDate"
68e9b100   梁灏   update DatePicker
60
61
                      @on-pick="handleLeftMonthPick"
                      @on-pick-click="handlePickClick"></month-table>
3cf7cfd1   梁灏   update DatePicker
62
              </div>
2dc27713   梁灏   update DateTimePi...
63
              <div :class="[prefixCls + '-content', prefixCls + '-content-right']" v-show="!isTime">
0a5c5f41   梁灏   update DatePicker
64
65
66
67
68
                  <div :class="[datePrefixCls + '-header']" v-show="rightCurrentView !== 'time'">
                       <span
                           :class="iconBtnCls('prev', '-double')"
                           @click="prevYear('right')"
                           v-show="rightCurrentView === 'year' || rightCurrentView === 'month'"><Icon type="ios-arrow-left"></Icon></span>
3cf7cfd1   梁灏   update DatePicker
69
70
                      <span
                          :class="[datePrefixCls + '-header-label']"
0a5c5f41   梁灏   update DatePicker
71
                          @click="showYearPicker('right')">{{ rightYearLabel }}</span>
3cf7cfd1   梁灏   update DatePicker
72
73
                      <span
                          :class="[datePrefixCls + '-header-label']"
0a5c5f41   梁灏   update DatePicker
74
                          @click="showMonthPicker('right')"
4ab11811   梁灏   some component su...
75
                          v-show="rightCurrentView === 'date'">{{ rightMonthLabel }}</span>
3cf7cfd1   梁灏   update DatePicker
76
77
                      <span
                          :class="iconBtnCls('next', '-double')"
0a5c5f41   梁灏   update DatePicker
78
                          @click="nextYear('right')"><Icon type="ios-arrow-right"></Icon></span>
3cf7cfd1   梁灏   update DatePicker
79
80
81
                      <span
                          :class="iconBtnCls('next')"
                          @click="nextMonth"
0a5c5f41   梁灏   update DatePicker
82
                          v-show="rightCurrentView === 'date'"><Icon type="ios-arrow-right"></Icon></span>
3cf7cfd1   梁灏   update DatePicker
83
84
                  </div>
                  <date-table
0a5c5f41   梁灏   update DatePicker
85
                      v-show="rightCurrentView === 'date'"
3cf7cfd1   梁灏   update DatePicker
86
87
88
89
90
91
                      :year="rightYear"
                      :month="rightMonth"
                      :date="rightDate"
                      :min-date="minDate"
                      :max-date="maxDate"
                      :range-state="rangeState"
472b4ff1   梁灏   update DatePicker
92
                      selection-mode="range"
3cf7cfd1   梁灏   update DatePicker
93
                      :disabled-date="disabledDate"
472b4ff1   梁灏   update DatePicker
94
                      @on-changerange="handleChangeRange"
68e9b100   梁灏   update DatePicker
95
96
                      @on-pick="handleRangePick"
                      @on-pick-click="handlePickClick"></date-table>
0a5c5f41   梁灏   update DatePicker
97
                  <year-table
531cd165   梁灏   support DatePicke...
98
                      ref="rightYearTable"
0a5c5f41   梁灏   update DatePicker
99
                      v-show="rightCurrentView === 'year'"
3732707e   梁灏   update DatePicker
100
101
                      :year="rightTableYear"
                      :date="rightTableDate"
0a5c5f41   梁灏   update DatePicker
102
103
                      selection-mode="range"
                      :disabled-date="disabledDate"
68e9b100   梁灏   update DatePicker
104
105
                      @on-pick="handleRightYearPick"
                      @on-pick-click="handlePickClick"></year-table>
0a5c5f41   梁灏   update DatePicker
106
                  <month-table
531cd165   梁灏   support DatePicke...
107
                      ref="rightMonthTable"
0a5c5f41   梁灏   update DatePicker
108
109
                      v-show="rightCurrentView === 'month'"
                      :month="rightMonth"
3732707e   梁灏   update DatePicker
110
                      :date="rightTableDate"
0a5c5f41   梁灏   update DatePicker
111
112
                      selection-mode="range"
                      :disabled-date="disabledDate"
68e9b100   梁灏   update DatePicker
113
114
                      @on-pick="handleRightMonthPick"
                      @on-pick-click="handlePickClick"></month-table>
3cf7cfd1   梁灏   update DatePicker
115
              </div>
2dc27713   梁灏   update DateTimePi...
116
117
              <div :class="[prefixCls + '-content']" v-show="isTime">
                  <time-picker
531cd165   梁灏   support DatePicke...
118
                      ref="timePicker"
2dc27713   梁灏   update DateTimePi...
119
                      v-show="isTime"
a2a78c38   梁灏   update DateTimePi...
120
121
                      @on-pick="handleTimePick"
                      @on-pick-click="handlePickClick"></time-picker>
2dc27713   梁灏   update DateTimePi...
122
              </div>
b9041a0d   梁灏   DatePicker add co...
123
124
              <Confirm
                  v-if="confirm"
2dc27713   梁灏   update DateTimePi...
125
126
127
128
                  :show-time="showTime"
                  :is-time="isTime"
                  :time-disabled="timeDisabled"
                  @on-pick-toggle-time="handleToggleTime"
b9041a0d   梁灏   DatePicker add co...
129
130
                  @on-pick-clear="handlePickClear"
                  @on-pick-success="handlePickSuccess"></Confirm>
3cf7cfd1   梁灏   update DatePicker
131
          </div>
e0cd7f90   梁灏   fixed #134
132
      </div>
17e1fcf1   梁灏   init DatePicker
133
134
  </template>
  <script>
3cf7cfd1   梁灏   update DatePicker
135
136
      import Icon from '../../icon/icon.vue';
      import DateTable from '../base/date-table.vue';
0a5c5f41   梁灏   update DatePicker
137
138
      import YearTable from '../base/year-table.vue';
      import MonthTable from '../base/month-table.vue';
2dc27713   梁灏   update DateTimePi...
139
      import TimePicker from './time-range.vue';
b9041a0d   梁灏   DatePicker add co...
140
      import Confirm from '../base/confirm.vue';
5cc9b892   梁灏   update DateTimePi...
141
      import { toDate, prevMonth, nextMonth, initTimeDate } from '../util';
3cf7cfd1   梁灏   update DatePicker
142
143
  
      import Mixin from './mixin';
4ab11811   梁灏   some component su...
144
      import Locale from '../../../mixins/locale';
3cf7cfd1   梁灏   update DatePicker
145
  
e0cd7f90   梁灏   fixed #134
146
147
148
      const prefixCls = 'ivu-picker-panel';
      const datePrefixCls = 'ivu-date-picker';
  
17e1fcf1   梁灏   init DatePicker
149
      export default {
a2a78c38   梁灏   update DateTimePi...
150
          name: 'DatePicker',
4ab11811   梁灏   some component su...
151
          mixins: [ Mixin, Locale ],
2dc27713   梁灏   update DateTimePi...
152
          components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm },
17e1fcf1   梁灏   init DatePicker
153
          data () {
3cf7cfd1   梁灏   update DatePicker
154
155
156
157
              return {
                  prefixCls: prefixCls,
                  datePrefixCls: datePrefixCls,
                  shortcuts: [],
5cc9b892   梁灏   update DateTimePi...
158
                  date: initTimeDate(),
3cf7cfd1   梁灏   update DatePicker
159
160
161
                  value: '',
                  minDate: '',
                  maxDate: '',
b9041a0d   梁灏   DatePicker add co...
162
                  confirm: false,
3cf7cfd1   梁灏   update DatePicker
163
164
165
166
167
168
                  rangeState: {
                      endDate: null,
                      selecting: false
                  },
                  showTime: false,
                  disabledDate: '',
0a5c5f41   梁灏   update DatePicker
169
170
                  leftCurrentView: 'date',
                  rightCurrentView: 'date',
3732707e   梁灏   update DatePicker
171
172
                  selectionMode: 'range',
                  leftTableYear: null,
2dc27713   梁灏   update DateTimePi...
173
174
175
                  rightTableYear: null,
                  isTime: false,
                  format: 'yyyy-MM-dd'
b0893113   jingsam   :art: add eslint
176
              };
17e1fcf1   梁灏   init DatePicker
177
          },
e0cd7f90   梁灏   fixed #134
178
179
180
181
          computed: {
              classes () {
                  return [
                      `${prefixCls}-body-wrapper`,
3cf7cfd1   梁灏   update DatePicker
182
                      `${datePrefixCls}-with-range`,
e0cd7f90   梁灏   fixed #134
183
184
185
                      {
                          [`${prefixCls}-with-sidebar`]: this.shortcuts.length
                      }
b0893113   jingsam   :art: add eslint
186
                  ];
3cf7cfd1   梁灏   update DatePicker
187
              },
3732707e   梁灏   update DatePicker
188
              leftYear () {
3cf7cfd1   梁灏   update DatePicker
189
190
                  return this.date.getFullYear();
              },
3732707e   梁灏   update DatePicker
191
192
193
194
195
196
197
              leftTableDate () {
                  if (this.leftCurrentView === 'year' || this.leftCurrentView === 'month') {
                      return new Date(this.leftTableYear);
                  } else {
                      return this.date;
                  }
              },
0a5c5f41   梁灏   update DatePicker
198
              leftYearLabel () {
4ab11811   梁灏   some component su...
199
                  const tYear = this.t('i.datepicker.year');
0a5c5f41   梁灏   update DatePicker
200
                  if (this.leftCurrentView === 'year') {
3732707e   梁灏   update DatePicker
201
202
                      const year = this.leftTableYear;
                      if (!year) return '';
0a5c5f41   梁灏   update DatePicker
203
                      const startYear = Math.floor(year / 10) * 10;
4ab11811   梁灏   some component su...
204
                      return `${startYear}${tYear} - ${startYear + 9}${tYear}`;
3732707e   梁灏   update DatePicker
205
206
207
                  } else {
                      const year = this.leftCurrentView === 'month' ? this.leftTableYear : this.leftYear;
                      if (!year) return '';
4ab11811   梁灏   some component su...
208
                      return `${year}${tYear}`;
0a5c5f41   梁灏   update DatePicker
209
                  }
0a5c5f41   梁灏   update DatePicker
210
              },
3732707e   梁灏   update DatePicker
211
              leftMonth () {
3cf7cfd1   梁灏   update DatePicker
212
213
                  return this.date.getMonth();
              },
4ab11811   梁灏   some component su...
214
215
216
217
              leftMonthLabel () {
                  const month = this.leftMonth + 1;
                  return this.t(`i.datepicker.month${month}`);
              },
3732707e   梁灏   update DatePicker
218
              rightYear () {
3cf7cfd1   梁灏   update DatePicker
219
220
                  return this.rightDate.getFullYear();
              },
3732707e   梁灏   update DatePicker
221
222
223
224
225
226
227
              rightTableDate () {
                  if (this.rightCurrentView === 'year' || this.rightCurrentView === 'month') {
                      return new Date(this.rightTableYear);
                  } else {
                      return this.date;
                  }
              },
0a5c5f41   梁灏   update DatePicker
228
              rightYearLabel () {
4ab11811   梁灏   some component su...
229
                  const tYear = this.t('i.datepicker.year');
0a5c5f41   梁灏   update DatePicker
230
                  if (this.rightCurrentView === 'year') {
3732707e   梁灏   update DatePicker
231
232
                      const year = this.rightTableYear;
                      if (!year) return '';
0a5c5f41   梁灏   update DatePicker
233
                      const startYear = Math.floor(year / 10) * 10;
4ab11811   梁灏   some component su...
234
                      return `${startYear}${tYear} - ${startYear + 9}${tYear}`;
3732707e   梁灏   update DatePicker
235
236
237
                  } else {
                      const year = this.rightCurrentView === 'month' ? this.rightTableYear : this.rightYear;
                      if (!year) return '';
4ab11811   梁灏   some component su...
238
                      return `${year}${tYear}`;
0a5c5f41   梁灏   update DatePicker
239
                  }
0a5c5f41   梁灏   update DatePicker
240
              },
3732707e   梁灏   update DatePicker
241
              rightMonth () {
3cf7cfd1   梁灏   update DatePicker
242
243
                  return this.rightDate.getMonth();
              },
4ab11811   梁灏   some component su...
244
245
246
247
              rightMonthLabel () {
                  const month = this.rightMonth + 1;
                  return this.t(`i.datepicker.month${month}`);
              },
3732707e   梁灏   update DatePicker
248
              rightDate () {
3cf7cfd1   梁灏   update DatePicker
249
250
251
252
253
254
255
256
257
258
259
                  const newDate = new Date(this.date);
                  const month = newDate.getMonth();
                  newDate.setDate(1);
  
                  if (month === 11) {
                      newDate.setFullYear(newDate.getFullYear() + 1);
                      newDate.setMonth(0);
                  } else {
                      newDate.setMonth(month + 1);
                  }
                  return newDate;
2dc27713   梁灏   update DateTimePi...
260
261
262
              },
              timeDisabled () {
                  return !(this.minDate && this.maxDate);
3cf7cfd1   梁灏   update DatePicker
263
264
265
266
267
268
269
270
271
272
273
              }
          },
          watch: {
              value(newVal) {
                  if (!newVal) {
                      this.minDate = null;
                      this.maxDate = null;
                  } else if (Array.isArray(newVal)) {
                      this.minDate = newVal[0] ? toDate(newVal[0]) : null;
                      this.maxDate = newVal[1] ? toDate(newVal[1]) : null;
                      if (this.minDate) this.date = new Date(this.minDate);
3cf7cfd1   梁灏   update DatePicker
274
                  }
2dc27713   梁灏   update DateTimePi...
275
276
277
278
279
280
281
282
283
284
285
286
287
                  if (this.showTime) this.$refs.timePicker.value = newVal;
              },
              minDate (val) {
                  if (this.showTime) this.$refs.timePicker.date = val;
              },
              maxDate (val) {
                  if (this.showTime) this.$refs.timePicker.dateEnd = val;
              },
              format (val) {
                  if (this.showTime) this.$refs.timePicker.format = val;
              },
              isTime (val) {
                  if (val) this.$refs.timePicker.updateScroll();
e0cd7f90   梁灏   fixed #134
288
289
              }
          },
3cf7cfd1   梁灏   update DatePicker
290
          methods: {
f92ef70f   梁灏   update DatePicker
291
292
293
294
295
              resetDate () {
                  this.date = new Date(this.date);
                  this.leftTableYear = this.date.getFullYear();
                  this.rightTableYear = this.rightDate.getFullYear();
              },
472b4ff1   梁灏   update DatePicker
296
297
298
              handleClear() {
                  this.minDate = null;
                  this.maxDate = null;
f92ef70f   梁灏   update DatePicker
299
                  this.date = new Date();
472b4ff1   梁灏   update DatePicker
300
                  this.handleConfirm();
2dc27713   梁灏   update DateTimePi...
301
                  if (this.showTime) this.$refs.timePicker.handleClear();
472b4ff1   梁灏   update DatePicker
302
              },
a2a78c38   梁灏   update DateTimePi...
303
              resetView(reset = false) {
f92ef70f   梁灏   update DatePicker
304
305
306
307
308
                  this.leftCurrentView = 'date';
                  this.rightCurrentView = 'date';
  
                  this.leftTableYear = this.leftYear;
                  this.rightTableYear = this.rightYear;
a2a78c38   梁灏   update DateTimePi...
309
310
  
                  if (reset) this.isTime = false;
f92ef70f   梁灏   update DatePicker
311
              },
0a5c5f41   梁灏   update DatePicker
312
313
314
              prevYear (direction) {
                  if (this[`${direction}CurrentView`] === 'year') {
                      this.$refs[`${direction}YearTable`].prevTenYear();
f92ef70f   梁灏   update DatePicker
315
316
                  } else if (this[`${direction}CurrentView`] === 'month') {
                      this[`${direction}TableYear`]--;
0a5c5f41   梁灏   update DatePicker
317
318
319
320
321
                  } else {
                      const date = this.date;
                      date.setFullYear(date.getFullYear() - 1);
                      this.resetDate();
                  }
3cf7cfd1   梁灏   update DatePicker
322
              },
0a5c5f41   梁灏   update DatePicker
323
324
325
              nextYear (direction) {
                  if (this[`${direction}CurrentView`] === 'year') {
                      this.$refs[`${direction}YearTable`].nextTenYear();
f92ef70f   梁灏   update DatePicker
326
327
                  } else if (this[`${direction}CurrentView`] === 'month') {
                      this[`${direction}TableYear`]--;
0a5c5f41   梁灏   update DatePicker
328
329
330
331
332
                  } else {
                      const date = this.date;
                      date.setFullYear(date.getFullYear() + 1);
                      this.resetDate();
                  }
3cf7cfd1   梁灏   update DatePicker
333
334
              },
              prevMonth () {
0a5c5f41   梁灏   update DatePicker
335
                  this.date = prevMonth(this.date);
3cf7cfd1   梁灏   update DatePicker
336
337
              },
              nextMonth () {
0a5c5f41   梁灏   update DatePicker
338
                  this.date = nextMonth(this.date);
3cf7cfd1   梁灏   update DatePicker
339
              },
0a5c5f41   梁灏   update DatePicker
340
341
342
343
344
              handleLeftYearPick (year, close = true) {
                  this.handleYearPick(year, close, 'left');
              },
              handleRightYearPick (year, close = true) {
                  this.handleYearPick(year, close, 'right');
3cf7cfd1   梁灏   update DatePicker
345
              },
0a5c5f41   梁灏   update DatePicker
346
              handleYearPick (year, close, direction) {
3732707e   梁灏   update DatePicker
347
                  this[`${direction}TableYear`] = year;
0a5c5f41   梁灏   update DatePicker
348
                  if (!close) return;
3cf7cfd1   梁灏   update DatePicker
349
  
0a5c5f41   梁灏   update DatePicker
350
351
352
353
354
355
356
357
358
                  this[`${direction}CurrentView`] = 'month';
              },
              handleLeftMonthPick (month) {
                  this.handleMonthPick(month, 'left');
              },
              handleRightMonthPick (month) {
                  this.handleMonthPick(month, 'right');
              },
              handleMonthPick (month, direction) {
3732707e   梁灏   update DatePicker
359
360
361
362
363
364
365
366
367
368
369
                  let year = this[`${direction}TableYear`];
                  if (direction === 'right') {
                      if (month === 0) {
                          month = 11;
                          year--;
                      } else {
                          month--;
                      }
                  }
  
                  this.date.setYear(year);
0a5c5f41   梁灏   update DatePicker
370
371
372
373
374
375
                  this.date.setMonth(month);
                  this[`${direction}CurrentView`] = 'date';
                  this.resetDate();
              },
              showYearPicker (direction) {
                  this[`${direction}CurrentView`] = 'year';
3732707e   梁灏   update DatePicker
376
                  this[`${direction}TableYear`] = this[`${direction}Year`];
0a5c5f41   梁灏   update DatePicker
377
378
379
              },
              showMonthPicker (direction) {
                  this[`${direction}CurrentView`] = 'month';
3cf7cfd1   梁灏   update DatePicker
380
              },
3cf7cfd1   梁灏   update DatePicker
381
382
              handleConfirm(visible) {
                  this.$emit('on-pick', [this.minDate, this.maxDate], visible);
472b4ff1   梁灏   update DatePicker
383
384
385
386
387
388
389
390
              },
              handleRangePick (val, close = true) {
                  if (this.maxDate === val.maxDate && this.minDate === val.minDate) return;
  
                  this.minDate = val.minDate;
                  this.maxDate = val.maxDate;
  
                  if (!close) return;
2dc27713   梁灏   update DateTimePi...
391
392
393
394
  //                if (!this.showTime) {
  //                    this.handleConfirm(false);
  //                }
                  this.handleConfirm(false);
472b4ff1   梁灏   update DatePicker
395
396
397
398
399
              },
              handleChangeRange (val) {
                  this.minDate = val.minDate;
                  this.maxDate = val.maxDate;
                  this.rangeState = val.rangeState;
2dc27713   梁灏   update DateTimePi...
400
401
402
403
404
405
406
407
408
409
              },
              handleToggleTime () {
                  this.isTime = !this.isTime;
              },
              handleTimePick (date) {
                  this.minDate = date[0];
                  this.maxDate = date[1];
                  this.handleConfirm(false);
              }
          },
531cd165   梁灏   support DatePicke...
410
          mounted () {
2dc27713   梁灏   update DateTimePi...
411
              if (this.showTime) {
a2a78c38   梁灏   update DateTimePi...
412
                  // todo 这里也到不了
2dc27713   梁灏   update DateTimePi...
413
414
415
416
417
                  this.$refs.timePicker.date = this.minDate;
                  this.$refs.timePicker.dateEnd = this.maxDate;
                  this.$refs.timePicker.value = this.value;
                  this.$refs.timePicker.format = this.format;
                  this.$refs.timePicker.showDate = true;
3cf7cfd1   梁灏   update DatePicker
418
419
              }
          }
b0893113   jingsam   :art: add eslint
420
421
      };
  </script>