|
6 | 6 | * |
7 | 7 | * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, |
8 | 8 | * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR |
9 | | - * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. 测试e2e-action |
| 9 | + * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. |
10 | 10 | * |
11 | 11 | */ |
12 | 12 |
|
@@ -64,9 +64,9 @@ export const watchMobileVisible = |
64 | 64 | } |
65 | 65 |
|
66 | 66 | export const watchPickerVisible = |
67 | | - ({ api, vm, dispatch, emit, props, state, nextTick }) => |
| 67 | + ({ api, vm, dispatch, emit, props, state, nextTick, isPCMode }) => |
68 | 68 | (value) => { |
69 | | - if (props.readonly || state.pickerDisabled || state.isMobileScreen) return |
| 69 | + if (props.readonly || state.pickerDisabled || (state.isMobileScreen && !isPCMode)) return |
70 | 70 |
|
71 | 71 | if (value) { |
72 | 72 | api.showPicker() |
@@ -940,20 +940,27 @@ export const handleClose = |
940 | 940 | } |
941 | 941 |
|
942 | 942 | export const handleFocus = |
943 | | - ({ emit, vm, state, api, props }) => |
| 943 | + ({ emit, vm, state, api, props, isPCMode }) => |
944 | 944 | () => { |
945 | 945 | const type = state.type |
946 | 946 | if (props.readonly || state.pickerDisabled) { |
947 | 947 | return |
948 | 948 | } |
949 | 949 |
|
| 950 | + // 判断当前日期选择器类型是否在触发类型列表中 |
950 | 951 | if (DATEPICKER.TriggerTypes.includes(type)) { |
951 | | - if (state.isMobileScreen && state.isDateMobileComponent) { |
| 952 | + // 如果不是移动端屏幕或者强制使用PC端模式 |
| 953 | + if (!state.isMobileScreen || isPCMode) { |
| 954 | + // 显示PC端的日期选择弹窗 |
| 955 | + state.pickerVisible = true |
| 956 | + } else if (state.isDateMobileComponent) { |
| 957 | + // 如果是移动端日期相关组件(日期、日期时间、日期范围等) |
| 958 | + // 调用移动端日期选择器的显示方法 |
952 | 959 | api.dateMobileToggle(true) |
953 | | - } else if (state.isMobileScreen && state.isTimeMobileComponent) { |
| 960 | + } else if (state.isTimeMobileComponent) { |
| 961 | + // 如果是移动端时间相关组件(时间、时间范围等) |
| 962 | + // 调用移动端时间选择器的显示方法 |
954 | 963 | api.timeMobileToggle(true) |
955 | | - } else { |
956 | | - state.pickerVisible = true |
957 | 964 | } |
958 | 965 | } |
959 | 966 |
|
|
0 commit comments