<template>
<div
class="el-picker-panel el-date-range-picker"
:class="[{
'has-sidebar': $slots.sidebar || hasShortcuts,
'has-time': showTime
}]"
>
<div class="el-picker-panel__body-wrapper">
<slot name="sidebar" class="el-picker-panel__sidebar"></slot>
<div v-if="hasShortcuts" class="el-picker-panel__sidebar">
<button
v-for="(shortcut, key) in shortcuts"
:key="key"
type="button"
class="el-picker-panel__shortcut"
@click="handleShortcutClick(shortcut)"
>
{{ shortcut.text }}
</button>
</div>
<div class="el-picker-panel__body">
<div v-if="showTime" class="el-date-range-picker__time-header">
<span class="el-date-range-picker__editors-wrap">
<span class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
:disabled="rangeState.selecting"
:placeholder="t('el.datepicker.startDate')"
class="el-date-range-picker__editor"
:model-value="minVisibleDate"
@input="val => handleDateInput(val, 'min')"
@change="val => handleDateChange(val, 'min')"
/>
</span>
<span v-clickoutside="handleMinTimeClose" class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
class="el-date-range-picker__editor"
:disabled="rangeState.selecting"
:placeholder="t('el.datepicker.startTime')"
:model-value="minVisibleTime"
@focus="minTimePickerVisible = true"
@input="val => handleTimeInput(val, 'min')"
@change="val => handleTimeChange(val, 'min')"
/>
<time-pick-panel
:visible="minTimePickerVisible"
:format="timeFormat"
datetime-role="start"
:time-arrow-control="arrowControl"
:parsed-value="leftDate"
@pick="handleMinTimePick"
/>
</span>
</span>
<span class="el-icon-arrow-right"></span>
<span class="el-date-range-picker__editors-wrap is-right">
<span class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
class="el-date-range-picker__editor"
:disabled="rangeState.selecting"
:placeholder="t('el.datepicker.endDate')"
:model-value="maxVisibleDate"
:readonly="!minDate"
@input="val => handleDateInput(val, 'max')"
@change="val => handleDateChange(val, 'max')"
/>
</span>
<span v-clickoutside="handleMaxTimeClose" class="el-date-range-picker__time-picker-wrap">
<el-input
size="small"
class="el-date-range-picker__editor"
:disabled="rangeState.selecting"
:placeholder="t('el.datepicker.endTime')"
:model-value="maxVisibleTime"
:readonly="!minDate"
@focus="minDate && (maxTimePickerVisible = true)"
@input="val => handleTimeInput(val, 'max')"
@change="val => handleTimeChange(val, 'max')"
/>
<time-pick-panel
datetime-role="end"
:visible="maxTimePickerVisible"
:format="timeFormat"
:time-arrow-control="arrowControl"
:parsed-value="rightDate"
@pick="handleMaxTimePick"
/>
</span>
</span>
</div>
<div class="el-picker-panel__content el-date-range-picker__content is-left">
<div class="el-date-range-picker__header">
<button
type="button"
class="el-picker-panel__icon-btn el-icon-d-arrow-left"
@click="leftPrevYear"
></button>
<button
type="button"
class="el-picker-panel__icon-btn el-icon-arrow-left"
@click="leftPrevMonth"
></button>
<button
v-if="unlinkPanels"
type="button"
:disabled="!enableYearArrow"
:class="{ 'is-disabled': !enableYearArrow }"
class="el-picker-panel__icon-btn el-icon-d-arrow-right"
@click="leftNextYear"
></button>
<button
v-if="unlinkPanels"
type="button"
:disabled="!enableMonthArrow"
:class="{ 'is-disabled': !enableMonthArrow }"
class="el-picker-panel__icon-btn el-icon-arrow-right"
@click="leftNextMonth"
></button>
<div>{{ leftLabel }}</div>
</div>
<date-table
selection-mode="range"
:date="leftDate"
:min-date="minDate"
:max-date="maxDate"
:range-state="rangeState"
:disabled-date="disabledDate"
:cell-class-name="cellClassName"
@changerange="handleChangeRange"
@pick="handleRangePick"
@select="onSelect"
/>
</div>
<div class="el-picker-panel__content el-date-range-picker__content is-right">
<div class="el-date-range-picker__header">
<button
v-if="unlinkPanels"
type="button"
:disabled="!enableYearArrow"
:class="{ 'is-disabled': !enableYearArrow }"
class="el-picker-panel__icon-btn el-icon-d-arrow-left"
@click="rightPrevYear"
></button>
<button
v-if="unlinkPanels"
type="button"
:disabled="!enableMonthArrow"
:class="{ 'is-disabled': !enableMonthArrow }"
class="el-picker-panel__icon-btn el-icon-arrow-left"
@click="rightPrevMonth"
></button>
<button
type="button"
class="el-picker-panel__icon-btn el-icon-d-arrow-right"
@click="rightNextYear"
></button>
<button
type="button"
class="el-picker-panel__icon-btn el-icon-arrow-right"
@click="rightNextMonth"
></button>
<div>{{ rightLabel }}</div>
</div>
<date-table
selection-mode="range"
:date="rightDate"
:min-date="minDate"
:max-date="maxDate"
:range-state="rangeState"
:disabled-date="disabledDate"
:cell-class-name="cellClassName"
@changerange="handleChangeRange"
@pick="handleRangePick"
@select="onSelect"
/>
</div>
</div>
</div>
<div v-if="showTime" class="el-picker-panel__footer">
<el-button
v-if="clearable"
size="mini"
type="text"
class="el-picker-panel__link-btn"
@click="handleClear"
>
{{ t('el.datepicker.clear') }}
</el-button>
<el-button
plain
size="mini"
class="el-picker-panel__link-btn"
:disabled="btnDisabled"
@click="handleConfirm(false)"
>
{{ t('el.datepicker.confirm') }}
</el-button>
</div>
</div>
</template>
<script lang="ts">
import { computed, defineComponent, inject, ref, watch } from 'vue'
import dayjs from 'dayjs'
import ElButton from '@element-plus/components/button'
import { ClickOutside } from '@element-plus/directives'
import { useLocaleInject } from '@element-plus/hooks'
import ElInput from '@element-plus/components/input'
import { extractDateFormat, extractTimeFormat, TimePickPanel } from '@element-plus/components/time-picker'
import { isValidDatePickType }
element-plus-1.1.0-beta.6.zip
需积分: 0 41 浏览量
更新于2024-08-24
收藏 2.96MB ZIP 举报
一个 Vue.js 3 UI 库
a3737337
- 粉丝: 0
- 资源: 2869
最新资源
- 光伏MPPT仿真,大步长,小步长,变步长 20打包文件很多
- KNN,K近邻多特征分类预测(Matlab) 1.数据多特征分类预测,输入多个特征,分四类,代码内注释详细,直接替数据就可以使用 2.运行环境Matlab2018b及以上; 3.FITKNNC.m为主
- 基于MMC的电压源流器 控制器用于控制负载电压
- 鹈鹕优化算法POA优化GRNN做时间序列拟合预测建模 程序内注释详细直接替数据就可以使用 程序语言为matlab 程序直接运行可以出拟合预测图,迭代优化图,线性拟合预测图,多个预测评价指标 想
- 喵赞仿悬赏猫任务平台源码完美运营可直接封装APP+解密版
- 基于can总线的28377d升级方案 兼容37xs和37xd,单核双核都可以升级 上位机采用c#开发,vs2013
- HXT-SEM.zip
- Python代码:考虑需求响应的基于LSTM算法的住宅居民短期负荷预测 关键词: LSTM 负荷预测 需求响应 用电模式 居民负荷预测 编程语言:python+TensorFlow 平台 主题:基
- C# 进程间通信所需Dll
- Delphi 12 控件之gopay-1.5.107.zip
- matlab代码:【Applied Energy 顶刊复现】基于双层优化模型的大规模电动汽车时空调度 该matlab代码研究了发电机、电动汽车和风力发电的协同优化问题 从时域和空间域中,解决了
- 第五次中国城乡老年人生活状况抽样调查基本数据公报.pdf
- 2024中国数智消费社媒电商市场洞察报告-新华网.pdf
- 2024年全球消费者洞察报告-库润数据.pdf
- The+Wall+Street+Journal+-+09.01.2025.pdf
- 蝉妈妈&蝉魔方:2024年服饰发展趋势报告.pdf