34 行
801 B
Plaintext
34 行
801 B
Plaintext
|
|
import { DatePickerView } from './compose/DatePickerView'
|
||
|
|
import { ToolsHelper } from './ToolsHelper'
|
||
|
|
|
||
|
|
export interface DateDialogOptions {
|
||
|
|
// 'YYYY-MM-DD'年月日对应的标识,随意组合
|
||
|
|
type?: string
|
||
|
|
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() {
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
static showDateDialog(options: DateDialogOptions, p: object) {
|
||
|
|
const dialogTag = ToolsHelper.getUuid()
|
||
|
|
ToolsHelper.showCustomDialog(dialogTag, dateDialogBuilder.bind(p, options, dialogTag),
|
||
|
|
DialogAlignment.Bottom)
|
||
|
|
}
|
||
|
|
}
|