diff --git a/apps/common/forms/switch_field.py b/apps/common/forms/switch_field.py new file mode 100644 index 000000000..9fa176bee --- /dev/null +++ b/apps/common/forms/switch_field.py @@ -0,0 +1,33 @@ +""" + @project: MaxKB + @Author:虎 + @file: switch_field.py + @date:2024/10/13 19:43 + @desc: +""" +from typing import Dict +from common.forms import BaseField, TriggerType, BaseLabel + + +class SwitchField(BaseField): + """ + 滑块输入框 + """ + + def __init__(self, label: str or BaseLabel, + required: bool = False, + default_value=None, + relation_show_field_dict: Dict = None, + + attrs=None, props_info=None): + """ + @param required: 是否必填 + @param default_value: 默认值 + @param relation_show_field_dict: + @param attrs: + @param props_info: + """ + + super().__init__('Switch', label, required, default_value, relation_show_field_dict, + {}, + TriggerType.OPTION_LIST, attrs, props_info) diff --git a/ui/src/components/dynamics-form/DemoConstructor.vue b/ui/src/components/dynamics-form/DemoConstructor.vue new file mode 100644 index 000000000..14ff696c7 --- /dev/null +++ b/ui/src/components/dynamics-form/DemoConstructor.vue @@ -0,0 +1,43 @@ + + + diff --git a/ui/src/components/dynamics-form/constructor/index.vue b/ui/src/components/dynamics-form/constructor/index.vue new file mode 100644 index 000000000..2eb40c0c0 --- /dev/null +++ b/ui/src/components/dynamics-form/constructor/index.vue @@ -0,0 +1,89 @@ + + + diff --git a/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue b/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue new file mode 100644 index 000000000..490a7744d --- /dev/null +++ b/ui/src/components/dynamics-form/constructor/items/SliderConstructor.vue @@ -0,0 +1,70 @@ + + + diff --git a/ui/src/components/dynamics-form/constructor/items/SwitchInputConstructor.vue b/ui/src/components/dynamics-form/constructor/items/SwitchInputConstructor.vue new file mode 100644 index 000000000..15ced36ad --- /dev/null +++ b/ui/src/components/dynamics-form/constructor/items/SwitchInputConstructor.vue @@ -0,0 +1,39 @@ + + + diff --git a/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue b/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue new file mode 100644 index 000000000..7675ceea0 --- /dev/null +++ b/ui/src/components/dynamics-form/constructor/items/TextInputConstructor.vue @@ -0,0 +1,58 @@ + + + diff --git a/ui/src/components/dynamics-form/items/switch/SwitchInput.vue b/ui/src/components/dynamics-form/items/switch/SwitchInput.vue new file mode 100644 index 000000000..c787945f3 --- /dev/null +++ b/ui/src/components/dynamics-form/items/switch/SwitchInput.vue @@ -0,0 +1,7 @@ + + + + \ No newline at end of file