| | |
| | | <!-- 处理数组属性,placeholder --> |
| | | |
| | | <div v-if="item.children"> |
| | | <component |
| | | v-for="(child, index) of item.children" |
| | | :key="index" |
| | | v-bind="child.componentProps" |
| | | :is="child.component" |
| | | v-model:value="formConfig.currentItem.componentProps[item.name][index]" |
| | | /> |
| | | <template v-for="(child, index) of item.children" :key="index"> |
| | | <component |
| | | v-if="child.component" |
| | | v-bind="child.componentProps" |
| | | v-model:value="formConfig.currentItem.componentProps[item.name][index]" |
| | | :is="child.component" |
| | | /> |
| | | </template> |
| | | </div> |
| | | <!-- 如果不是数组,则正常处理属性值 --> |
| | | <component |
| | | v-else |
| | | v-else-if="item.component" |
| | | class="component-prop" |
| | | v-bind="item.componentProps" |
| | | :is="item.component" |
| | |
| | | Select, |
| | | InputNumber, |
| | | RadioGroup, |
| | | Col, |
| | | Row, |
| | | } from 'ant-design-vue'; |
| | | import RadioButtonGroup from '/@/components/Form/src/components/RadioButtonGroup.vue'; |
| | | import { Col, Row } from 'ant-design-vue'; |
| | | import RadioButtonGroup from '@/components/Form/src/components/RadioButtonGroup.vue'; |
| | | import { computed, defineComponent, ref, watch } from 'vue'; |
| | | import { useFormDesignState } from '../../../hooks/useFormDesignState'; |
| | | import { |
| | |
| | | baseComponentAttrs[formConfig.value.currentItem!.component] && |
| | | baseComponentAttrs[formConfig.value.currentItem!.component].forEach(async (item) => { |
| | | if (item.component) { |
| | | if (['Switch', 'Checkbox', 'Radio'].includes(item.component)) { |
| | | if (['Switch', 'Checkbox', 'Radio'].includes(item.component as string)) { |
| | | item.category = 'control'; |
| | | allOptions.value.push(item); |
| | | } else { |
| | |
| | | // 控制性的选项 |
| | | const controlOptions = computed(() => { |
| | | return allOptions.value.filter((item) => { |
| | | return item.category == 'control'; |
| | | return item.category === 'control'; |
| | | }); |
| | | }); |
| | | |
| | | // 非控制性选择 |
| | | const inputOptions = computed(() => { |
| | | return allOptions.value.filter((item) => { |
| | | return item.category == 'input'; |
| | | return item.category === 'input'; |
| | | }); |
| | | }); |
| | | |