|
|
|
@ -27,29 +27,30 @@ const emit = defineEmits<{ |
|
|
|
submit: [Recordable<any>]; |
|
|
|
}>(); |
|
|
|
|
|
|
|
const [Form, { resetForm, validate, getValues }] = useVbenForm( |
|
|
|
reactive({ |
|
|
|
commonConfig: { |
|
|
|
hideLabel: true, |
|
|
|
hideRequiredMark: true, |
|
|
|
}, |
|
|
|
schema: computed(() => [ |
|
|
|
{ |
|
|
|
component: 'VbenInputPassword' as const, |
|
|
|
componentProps: { |
|
|
|
placeholder: $t('ui.widgets.lockScreen.placeholder'), |
|
|
|
}, |
|
|
|
fieldName: 'lockScreenPassword', |
|
|
|
formFieldProps: { validateOnBlur: false }, |
|
|
|
label: $t('authentication.password'), |
|
|
|
rules: z |
|
|
|
.string() |
|
|
|
.min(1, { message: $t('ui.widgets.lockScreen.placeholder') }), |
|
|
|
const [Form, { resetForm, validate, getValues, getFieldComponentRef }] = |
|
|
|
useVbenForm( |
|
|
|
reactive({ |
|
|
|
commonConfig: { |
|
|
|
hideLabel: true, |
|
|
|
hideRequiredMark: true, |
|
|
|
}, |
|
|
|
]), |
|
|
|
showDefaultActions: false, |
|
|
|
}), |
|
|
|
); |
|
|
|
schema: computed(() => [ |
|
|
|
{ |
|
|
|
component: 'VbenInputPassword' as const, |
|
|
|
componentProps: { |
|
|
|
placeholder: $t('ui.widgets.lockScreen.placeholder'), |
|
|
|
}, |
|
|
|
fieldName: 'lockScreenPassword', |
|
|
|
formFieldProps: { validateOnBlur: false }, |
|
|
|
label: $t('authentication.password'), |
|
|
|
rules: z |
|
|
|
.string() |
|
|
|
.min(1, { message: $t('ui.widgets.lockScreen.placeholder') }), |
|
|
|
}, |
|
|
|
]), |
|
|
|
showDefaultActions: false, |
|
|
|
}), |
|
|
|
); |
|
|
|
|
|
|
|
const [Modal] = useVbenModal({ |
|
|
|
onConfirm() { |
|
|
|
@ -60,6 +61,13 @@ const [Modal] = useVbenModal({ |
|
|
|
resetForm(); |
|
|
|
} |
|
|
|
}, |
|
|
|
onOpened() { |
|
|
|
requestAnimationFrame(() => { |
|
|
|
getFieldComponentRef('lockScreenPassword') |
|
|
|
?.$el?.querySelector('[name="lockScreenPassword"]') |
|
|
|
?.focus(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
async function handleSubmit() { |
|
|
|
|