diff --git a/src/components/Form/src/BasicForm.vue b/src/components/Form/src/BasicForm.vue index f325740..e1341da 100644 --- a/src/components/Form/src/BasicForm.vue +++ b/src/components/Form/src/BasicForm.vue @@ -52,6 +52,8 @@ import { useModalContext } from '/@/components/Modal'; import { basicProps } from './props'; + import componentSetting from '/@/settings/componentSetting'; + import { useDesign } from '/@/hooks/web/useDesign'; import dayjs from 'dayjs'; import { useDebounceFn } from '@vueuse/core'; @@ -89,6 +91,16 @@ mergeProps.labelCol = undefined; } //update-end-author:sunjianlei date:20220923 for: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题 + // update-begin--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline) + if (mergeProps.layout === 'inline') { + if (mergeProps.labelCol === componentSetting.form.labelCol) { + mergeProps.labelCol = undefined; + } + if (mergeProps.wrapperCol === componentSetting.form.wrapperCol) { + mergeProps.wrapperCol = undefined; + } + } + // update-end--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline) return mergeProps; }); @@ -380,5 +392,12 @@ margin-bottom: 8px !important; } } + // update-begin--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline) + &.ant-form-inline { + & > .ant-row { + .ant-col { width:auto !important; } + } + } + // update-end--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline) } diff --git a/src/components/Form/src/components/FormAction.vue b/src/components/Form/src/components/FormAction.vue index 4f7e721..85c43fc 100644 --- a/src/components/Form/src/components/FormAction.vue +++ b/src/components/Form/src/components/FormAction.vue @@ -65,6 +65,7 @@ actionSpan: propTypes.number.def(6), isAdvanced: propTypes.bool, hideAdvanceBtn: propTypes.bool, + layout: propTypes.oneOf(['horizontal', 'vertical', 'inline']).def('horizontal'), }, emits: ['toggle-advanced'], setup(props, { emit }) { @@ -76,10 +77,14 @@ const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {}; const actionColOpt: Partial = { style: { textAlign: 'right' }, - span: showAdvancedButton ? 6 : 4, ...advancedSpanObj, ...actionColOptions, }; + // update-begin--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline) + if (props.layout !== 'inline') { + actionColOpt['span'] = showAdvancedButton ? 6 : 4; + } + // update-end--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline) return actionColOpt; });