|
@ -54,7 +54,7 @@ export default defineComponent({ |
|
|
vLoading: propTypes.bool.def(false), |
|
|
vLoading: propTypes.bool.def(false), |
|
|
labelPosition: propTypes.string.def('left'), |
|
|
labelPosition: propTypes.string.def('left'), |
|
|
}, |
|
|
}, |
|
|
emits: ['register','opensearchTable'], |
|
|
emits: ['register','opensearchTable', 'onChange'], |
|
|
setup(props, { slots, expose, emit }) { |
|
|
setup(props, { slots, expose, emit }) { |
|
|
// element form 实例 |
|
|
// element form 实例 |
|
|
const elFormRef = ref<ComponentRef<typeof ElForm>>() |
|
|
const elFormRef = ref<ComponentRef<typeof ElForm>>() |
|
@ -180,6 +180,14 @@ export default defineComponent({ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 监听改变事件 |
|
|
|
|
|
* @param field 当前操作字段 |
|
|
|
|
|
* @param cur 改变后值 |
|
|
|
|
|
*/ |
|
|
|
|
|
const onChange = (field, cur) => { |
|
|
|
|
|
emit('onChange', field, cur) |
|
|
|
|
|
} |
|
|
// 渲染formItem |
|
|
// 渲染formItem |
|
|
const renderFormItem = (item: FormSchema) => { |
|
|
const renderFormItem = (item: FormSchema) => { |
|
|
// 单独给只有options属性的组件做判断 |
|
|
// 单独给只有options属性的组件做判断 |
|
@ -282,6 +290,7 @@ export default defineComponent({ |
|
|
{...(autoSetPlaceholder && setTextPlaceholder(item))} |
|
|
{...(autoSetPlaceholder && setTextPlaceholder(item))} |
|
|
{...setComponentProps(item)} |
|
|
{...setComponentProps(item)} |
|
|
style={item.componentProps?.style} |
|
|
style={item.componentProps?.style} |
|
|
|
|
|
onChange={(e)=>{onChange(item.field, e)}} |
|
|
{...(notRenderOptions.includes(item?.component as string) && |
|
|
{...(notRenderOptions.includes(item?.component as string) && |
|
|
item?.componentProps?.options |
|
|
item?.componentProps?.options |
|
|
? { options: item?.componentProps?.options || [] } |
|
|
? { options: item?.componentProps?.options || [] } |
|
|