Commit 8618ab6d authored by zhangwenshuai's avatar zhangwenshuai

update scrollBarWidth

parent ba36eaf4
...@@ -368,8 +368,10 @@ export default class AirTable extends Component<TableProps, TableState> { ...@@ -368,8 +368,10 @@ export default class AirTable extends Component<TableProps, TableState> {
// totalHeight = tableHeight + scrollbarWidth; // totalHeight = tableHeight + scrollbarWidth;
// } // }
let realWidth = tableWidth; let realWidth = tableWidth;
let paddingRight = 0;
if (rowCount > 0 && rowCount * rowHeight > totalHeight) { if (rowCount > 0 && rowCount * rowHeight > totalHeight) {
realWidth = tableWidth + scrollbarWidth; realWidth = tableWidth + scrollbarWidth;
paddingRight = scrollbarWidth;
} }
return ( return (
<Consumer> <Consumer>
...@@ -383,6 +385,9 @@ export default class AirTable extends Component<TableProps, TableState> { ...@@ -383,6 +385,9 @@ export default class AirTable extends Component<TableProps, TableState> {
? classNames(styles.tableContainer, styles.scroll) ? classNames(styles.tableContainer, styles.scroll)
: styles.tableContainer : styles.tableContainer
} }
style={{
paddingRight: this.props.onScroll ? paddingRight : 0,
}}
> >
{totalWidth > tableWidth && leftCount > 0 && ( {totalWidth > tableWidth && leftCount > 0 && (
<div <div
......
...@@ -6,10 +6,10 @@ import { antiAssign } from '../../../../utils/utils'; ...@@ -6,10 +6,10 @@ import { antiAssign } from '../../../../utils/utils';
import s from './index.less'; import s from './index.less';
export const ApolloSearch = (props: ApolloSearchProps) => { export const ApolloSearch = (props: ApolloSearchProps) => {
const { onChange, maxCount, isMultiple, request, type } = props; const { onChange, maxCount, isMultiple, request } = props;
const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options', 'request', 'maxCount']); const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options', 'request', 'maxCount']);
const changeValue = (value) => { const changeValue = (value) => {
if (maxCount && maxCount < value.length) { if (isMultiple && maxCount && maxCount < value.length) {
message.warn(`最多选择${maxCount}个`); message.warn(`最多选择${maxCount}个`);
return; return;
} }
......
...@@ -83,6 +83,30 @@ class FormWrap extends Component { ...@@ -83,6 +83,30 @@ class FormWrap extends Component {
); );
}; };
validateRequired = (item, rule, value, callback) => {
const { columnAttrObj = {} } = item;
const { validator } = columnAttrObj;
debugger;
if (!item.requiredFlag) {
callback();
return;
}
if (!value || value.length === 0) {
callback('必填项不能为空');
return;
}
const [first] = value;
if (!first.text && first.text !== 0 && !first.value && first.value !== 0) {
callback('必填项不能为空');
return;
}
if (validator && typeof validator === 'function') {
const values = this.props.form.getFieldsValue();
callback(validator({ value, values, item }));
}
callback();
};
renderEditForm = (item) => { renderEditForm = (item) => {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const { rowData } = this.props; const { rowData } = this.props;
...@@ -117,7 +141,7 @@ class FormWrap extends Component { ...@@ -117,7 +141,7 @@ class FormWrap extends Component {
{getFieldDecorator(columnName, { {getFieldDecorator(columnName, {
validateFirst, validateFirst,
validateTrigger, validateTrigger,
rules: [{ required: !!item.requiredFlag }, ...rules], rules: [{ required: !!item.requiredFlag, message: '必填项不能为空' }, ...rules],
initialValue: getFormat(detailConfig, item, value), initialValue: getFormat(detailConfig, item, value),
})(<EditComp {...transferColumn} columnConfig={item} disabled={readOnlyFlag} />)} })(<EditComp {...transferColumn} columnConfig={item} disabled={readOnlyFlag} />)}
</FormItem> </FormItem>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment