BasicForm 支持一行显示 (inline)
parent
0f113be77c
commit
b5eeb2a361
|
@ -52,6 +52,8 @@
|
||||||
import { useModalContext } from '/@/components/Modal';
|
import { useModalContext } from '/@/components/Modal';
|
||||||
|
|
||||||
import { basicProps } from './props';
|
import { basicProps } from './props';
|
||||||
|
import componentSetting from '/@/settings/componentSetting';
|
||||||
|
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useDebounceFn } from '@vueuse/core';
|
import { useDebounceFn } from '@vueuse/core';
|
||||||
|
@ -89,6 +91,16 @@
|
||||||
mergeProps.labelCol = undefined;
|
mergeProps.labelCol = undefined;
|
||||||
}
|
}
|
||||||
//update-end-author:sunjianlei date:20220923 for: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题
|
//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;
|
return mergeProps;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -380,5 +392,12 @@
|
||||||
margin-bottom: 8px !important;
|
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)
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
actionSpan: propTypes.number.def(6),
|
actionSpan: propTypes.number.def(6),
|
||||||
isAdvanced: propTypes.bool,
|
isAdvanced: propTypes.bool,
|
||||||
hideAdvanceBtn: propTypes.bool,
|
hideAdvanceBtn: propTypes.bool,
|
||||||
|
layout: propTypes.oneOf(['horizontal', 'vertical', 'inline']).def('horizontal'),
|
||||||
},
|
},
|
||||||
emits: ['toggle-advanced'],
|
emits: ['toggle-advanced'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
@ -76,10 +77,14 @@
|
||||||
const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {};
|
const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {};
|
||||||
const actionColOpt: Partial<ColEx> = {
|
const actionColOpt: Partial<ColEx> = {
|
||||||
style: { textAlign: 'right' },
|
style: { textAlign: 'right' },
|
||||||
span: showAdvancedButton ? 6 : 4,
|
|
||||||
...advancedSpanObj,
|
...advancedSpanObj,
|
||||||
...actionColOptions,
|
...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;
|
return actionColOpt;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue