| | |
| | | methods:{ |
| | | initOneWeekAgoTime(){ |
| | | // 给时间选择器设置默认时间为一周前 |
| | | this.time[0] = dayjs().subtract(2, 'week').format('YYYY-MM-DD HH:mm:ss'); |
| | | this.time[0] = dayjs().subtract(4, 'week').format('YYYY-MM-DD HH:mm:ss'); |
| | | this.time[1] = dayjs().format('YYYY-MM-DD HH:mm:ss'); |
| | | } |
| | | } |
| | |
| | | <el-date-picker |
| | | v-model="time" |
| | | type="datetimerange" |
| | | range-separator="To" |
| | | range-separator="~" |
| | | start-placeholder="Start date" |
| | | end-placeholder="End date" |
| | | @change="$emit('submitTime', time)" |
| | | class="pick-date" |
| | | |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | margin-left: 30px; |
| | | margin-top: 5px; |
| | | font-weight: bold; |
| | | white-space: nowrap; |
| | | } |
| | | .block { |
| | | display: flex; |
| | | justify-content: center; |
| | | /* width: 50%; */ |
| | | white-space: nowrap; |
| | | } |
| | | .pick-date { |
| | | width: 100%; |
| | | |
| | | } |
| | | </style> |