123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import { DatePickerView } from './compose/DatePickerView'
- import { ToolsHelper } from './ToolsHelper'
- export interface DateDialogOptions {
- // 'YYYY-MM-DD'年月日对应的标识,随意组合,默认YYYY-MM-DD
- type?: string
- // 可选择的开始日期,默认1970-1-1
- startDate?: string
- // 可选择的结束日期,默认当前月最后一天
- endDate?: string
- // 当前选中的日期,默认当前日期
- currentDate?: string
- // 选择器确定按钮点击事件
- onConfirm: (date: string) => void
- // 选择器取消按钮点击事件
- onCancel?: () => void
- }
- @Builder
- function dateDialogBuilder(option: DateDialogOptions, dialogTag: string) {
- DatePickerView({
- option: option,
- dialogTag: dialogTag,
- })
- }
- /**
- * 时间选择相关工具
- */
- export class PickerDateTimeHelper {
- private constructor() {
- }
- /**
- * 显示日期选择器
- * @param options
- * @param p 调用页面直接this
- */
- static showDateDialog(options: DateDialogOptions, p: object) {
- const dialogTag = ToolsHelper.getUuid()
- ToolsHelper.showCustomDialog(dialogTag, dateDialogBuilder.bind(p, options, dialogTag),
- DialogAlignment.Bottom)
- }
- }
|