diff --git a/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue b/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue index d38b47290..c1c47b5e1 100644 --- a/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue +++ b/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue @@ -39,7 +39,7 @@ /> - + @@ -55,7 +55,7 @@ :show-input-controls="false" :max="formValue.max" :min="formValue.min" - :step="formValue.step" + :step="formValue.step == 0 ? 0.1 : formValue.step" :precision="formValue.precision" /> @@ -107,7 +107,19 @@ const rander = (form_data: any) => { formValue.value.showInput = attrs['show-input'] formValue.value.default_value = form_data.default_value } - +const step_rules = [ + { + required: true, + validator: (rule: any, value: any, callback: any) => { + if (value === 0) { + callback(new Error('步长不能为0')) + return false + } + return true + }, + trigger: 'blur' + } +] defineExpose({ getData, rander }) onBeforeMount(() => { formValue.value.min = 0