From 1605130f9189d6715693d9e8775e88bc8cf754d2 Mon Sep 17 00:00:00 2001 From: Amy Date: Thu, 5 May 2022 13:18:11 +0800 Subject: [PATCH] [Feature][UI Next][V1.0.0-Beta] Add hints to the password repeat. --- .../src/views/password/index.tsx | 17 ++++++-- .../src/views/password/use-form.ts | 40 +++++++++++-------- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/password/index.tsx b/dolphinscheduler-ui-next/src/views/password/index.tsx index a2eaf8fb593c..44621c46ab13 100644 --- a/dolphinscheduler-ui-next/src/views/password/index.tsx +++ b/dolphinscheduler-ui-next/src/views/password/index.tsx @@ -24,10 +24,10 @@ import Card from '@/components/card' const password = defineComponent({ name: 'password', setup() { - const { state, t } = useForm() + const { state, rules, t } = useForm() const { handleUpdate } = useUpdate(state) - return { ...toRefs(state), t, handleUpdate } + return { ...toRefs(state), t, handleUpdate, rules } }, render() { const { t } = this @@ -37,17 +37,28 @@ const password = defineComponent({ {{ default: () => (
- + { + this.rPasswordFormItemRef.validate({ + trigger: 'password-input' + }) + }} /> { + if (value) { + return state.passwordForm.password === value } + return true } } - } as FormRules - }) + ] + } as FormRules - return { state, t } + return { state, rules, t } }