diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 8e5e91abbb..94e154753b 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3487,7 +3487,6 @@ "【MongoDB】实例视图": "【MongoDB】实例视图", "【MongoDB】副本集集群管理": "【MongoDB】副本集集群管理", "【MongoDB】分片集群管理": "【MongoDB】分片集群管理", - "任意 N 种, N 必须 >= 1 。且 <= 密码组成的种类": "任意 N 种, N 必须 >= 1 。且 <= 密码组成的种类", - "密码组成至少要选 1 种": "密码组成至少要选 1 种", + "请至少选择一种类型": "请至少选择一种类型", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue b/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue index 804c4692e3..03bb990bd7 100644 --- a/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue +++ b/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue @@ -88,7 +88,7 @@ v-model="formData.number_of_types" class="password-policy-number ml-6 mr-6" :max="typeMaxCount" - :min="0" + :min="1" type="number" /> {{ t('种类型') }} @@ -175,17 +175,10 @@ include_rule: [ { trigger: 'change', - message: t('密码组成至少要选 1 种'), + message: t('请至少选择一种类型'), validator: () => Object.values(formData.include_rule).some((checked) => checked), }, ], - number_of_types: [ - { - trigger: 'change', - message: t('任意 N 种, N 必须 >= 1 。且 <= 密码组成的种类'), - validator: () => formData.number_of_types >= 1 && formData.number_of_types <= typeMaxCount.value, - }, - ], }; const defaultConfig = reactive(initData()); @@ -245,9 +238,9 @@ }, ); - const handleChangeIncludeRule = async () => { - await formRef.value.validate(); - formData.number_of_types = Math.min(formData.number_of_types, typeMaxCount.value); + const handleChangeIncludeRule = () => { + formData.number_of_types = typeMaxCount.value; + formRef.value.validate(); }; const handleInputChange = (value: string) => {