| | |
| | | return disabled; |
| | | }); |
| | | |
| | | const getReadonly = computed(() => { |
| | | const { readonly: globReadonly } = props.formProps; |
| | | const { dynamicReadonly } = props.schema; |
| | | const { readonly: itemReadonly = false } = unref(getComponentsProps); |
| | | |
| | | let readonly = globReadonly || itemReadonly; |
| | | if (isBoolean(dynamicReadonly)) { |
| | | readonly = dynamicReadonly; |
| | | } |
| | | if (isFunction(dynamicReadonly)) { |
| | | readonly = dynamicReadonly(unref(getValues)); |
| | | } |
| | | return readonly; |
| | | }); |
| | | |
| | | function getShow(): { isShow: boolean; isIfShow: boolean } { |
| | | const { show, ifShow } = props.schema; |
| | | const { showAdvancedButton } = props.formProps; |
| | |
| | | size, |
| | | ...unref(getComponentsProps), |
| | | disabled: unref(getDisable), |
| | | readonly: unref(getReadonly), |
| | | }; |
| | | |
| | | const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder; |
| | |
| | | return <Comp {...compAttr} />; |
| | | } |
| | | const compSlot = isFunction(renderComponentContent) |
| | | ? { ...renderComponentContent(unref(getValues), { disabled: unref(getDisable) }) } |
| | | ? { |
| | | ...renderComponentContent(unref(getValues), { |
| | | disabled: unref(getDisable), |
| | | readonly: unref(getReadonly), |
| | | }), |
| | | } |
| | | : { |
| | | default: () => renderComponentContent, |
| | | }; |
| | |
| | | const { itemProps, slot, render, field, suffix, component } = props.schema; |
| | | const { labelCol, wrapperCol } = unref(itemLabelWidthProp); |
| | | const { colon } = props.formProps; |
| | | const opts = { disabled: unref(getDisable) }; |
| | | const opts = { disabled: unref(getDisable), readonly: unref(getReadonly) }; |
| | | if (component === 'Divider') { |
| | | return ( |
| | | <Col span={24}> |
| | |
| | | const realColProps = { ...baseColProps, ...colProps }; |
| | | const { isIfShow, isShow } = getShow(); |
| | | const values = unref(getValues); |
| | | const opts = { disabled: unref(getDisable) }; |
| | | const opts = { disabled: unref(getDisable), readonly: unref(getReadonly) }; |
| | | |
| | | const getContent = () => { |
| | | return colSlot |