diff --git a/components/apolloTable/component/base/edit/cascader/index.tsx b/components/apolloTable/component/base/edit/cascader/index.tsx index 790a20a088a9ecc3cd2ca3d168e42ec759dd14b5..b51be006d82d76a5ef812933d14de5c833406116 100644 --- a/components/apolloTable/component/base/edit/cascader/index.tsx +++ b/components/apolloTable/component/base/edit/cascader/index.tsx @@ -17,7 +17,18 @@ export const ApolloCascader = (props: ApolloCascaderProps) => { onChange, request, } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'requestCode', 'request', 'fieldNames']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'requestCode', + 'request', + 'fieldNames', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getCalendarContainer', + 'origin', + ]); const [options, setOptions] = React.useState([]); React.useEffect(() => { const fetchData = async () => { diff --git a/components/apolloTable/component/base/edit/date/index.tsx b/components/apolloTable/component/base/edit/date/index.tsx index 07be80fe5a50734ecbe6ef9ba2bfad16c35b3578..c26cb5dbf60569390ddae709d78be7acaf708a04 100644 --- a/components/apolloTable/component/base/edit/date/index.tsx +++ b/components/apolloTable/component/base/edit/date/index.tsx @@ -6,7 +6,15 @@ import styles from './styles.less'; export const ApolloDate = (props: any) => { const { origin, onChange, showTime } = props; - const selfProps = antiAssign(props, ['onChange', 'columnConfig']); + const selfProps = antiAssign(props, [ + 'onChange', + 'columnConfig', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getPopupContainer', + 'origin', + ]); const isOpen = useRef(); const changeValue = (date, dateString) => { if (typeof onChange === 'function') { @@ -25,7 +33,7 @@ export const ApolloDate = (props: any) => { onBlurFn(props); } }; - return (origin === 'editForm' ? + return origin === 'editForm' ? ( { {...selfProps} onChange={changeValue} onOpenChange={showTime ? timeOnBlurFn : dateOnBlurFn} - /> : + /> + ) : ( { const { onChange, placeholder, showTime, beginDatePlaceholder, endDatePlaceholder, origin } = props; - const selfProps = antiAssign(props, ['onChange', 'columnConfig']); + const selfProps = antiAssign(props, [ + 'onChange', + 'columnConfig', + 'beginDatePlaceholder', + 'endDatePlaceholder', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getPopupContainer', + 'origin', + ]); const isOpen = useRef(); const changeValue = (date, dateString) => { if (typeof onChange === 'function') { @@ -26,7 +36,7 @@ export const ApolloDateRange = (props: any) => { onBlurFn(props); } }; - return (origin === 'editForm' ? + return origin === 'editForm' ? ( { placeholder={[beginDatePlaceholder || placeholder, endDatePlaceholder || placeholder]} onChange={changeValue} onOpenChange={showTime ? timeOnBlurFn : dateOnBlurFn} - /> : + /> + ) : ( { const { maxLength, onChange, value, style, origin } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'style', 'onEmitChange']); - const [inputVal, setInputVal] = useState(value) + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'style', + 'onEmitChange', + 'rowData', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getPopupContainer', + 'getCalendarContainer', + ]); + const [inputVal, setInputVal] = useState(value); useEffect(() => { setInputVal(value); }, [value]); @@ -42,8 +53,8 @@ export const ApolloInput = (props: ApolloInputProps) => { {({ locale }) => { return (
- { - origin === 'editForm' ? { onBlur={inputOnBlurFn} onChange={(e) => { changeValue(e.target.value); - setInputVal(e.target.value) + setInputVal(e.target.value); }} - /> : { - changeValue(e.target.value); - }} - /> - } + /> + ) : ( + { + changeValue(e.target.value); + }} + /> + )} {!!maxLength && ( - {`${locale.alreadyInput} ${ - (value || '').length - }/${maxLength}`} + + {`${locale.alreadyInput} ${ + (value || '').length + }/${maxLength}`} + )}
); diff --git a/components/apolloTable/component/base/edit/number/index.tsx b/components/apolloTable/component/base/edit/number/index.tsx index bba36b2335f0c5b88aee39e03c85470f9729465e..b7db3bf6bff81b86d71e19e18389df87641ccfb9 100644 --- a/components/apolloTable/component/base/edit/number/index.tsx +++ b/components/apolloTable/component/base/edit/number/index.tsx @@ -7,8 +7,17 @@ import { antiAssign } from '../../../../utils/utils'; export const ApolloNumber = (props: ApolloNumberProps) => { const { onChange, origin, value }: any = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange']); - const [inputVal, setInputVal] = useState(value) + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getCalendarContainer', + 'getCalendarContainer', + 'origin', + ]); + const [inputVal, setInputVal] = useState(value); useEffect(() => { setInputVal(value); }, [value]); @@ -28,7 +37,16 @@ export const ApolloNumber = (props: ApolloNumberProps) => { onBlurFn(props); } }; - return origin === 'editForm' ? - - : ; + return origin === 'editForm' ? ( + + ) : ( + + ); }; diff --git a/components/apolloTable/component/base/edit/rate/index.tsx b/components/apolloTable/component/base/edit/rate/index.tsx index 8b88cbf20ae9cd6f15d6912b03bad3ca6b06cbdc..50c001234a8daab8ccc7eec217d3b9d5597512df 100644 --- a/components/apolloTable/component/base/edit/rate/index.tsx +++ b/components/apolloTable/component/base/edit/rate/index.tsx @@ -6,7 +6,15 @@ import { ApolloRateProps } from '../editInterface'; export const ApolloRate = (props: ApolloRateProps) => { const { onChange } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getCalendarContainer', + 'getCalendarContainer', + ]); const changeValue = (value) => { if (typeof onChange === 'function') { diff --git a/components/apolloTable/component/base/edit/search/index.tsx b/components/apolloTable/component/base/edit/search/index.tsx index e454a328ecbde4cc6056d63a60c03c1af2fcec8d..5a66e6715e089247d1118dce2fa64db769b5d053 100644 --- a/components/apolloTable/component/base/edit/search/index.tsx +++ b/components/apolloTable/component/base/edit/search/index.tsx @@ -8,7 +8,18 @@ import s from './index.less'; export const ApolloSearch = (props: ApolloSearchProps) => { 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', + 'request', + 'tableId', + 'cellRenderProps', + 'getCalendarContainer', + ]); const isOpen: any = useRef(); if (isMultiple) { selfProps.mode = 'multiple'; diff --git a/components/apolloTable/component/base/edit/select/index.tsx b/components/apolloTable/component/base/edit/select/index.tsx index 328a9e88741579c5cd3b90c33933e5aa95f50893..c18fe116e45f5c51b584240ea0ea2ee03cfc224c 100644 --- a/components/apolloTable/component/base/edit/select/index.tsx +++ b/components/apolloTable/component/base/edit/select/index.tsx @@ -7,7 +7,17 @@ import styles from './styles.less'; export const ApolloSelect = (props: ApolloSelectProps) => { const { options = [], onChange, isMultiple, maxPopHeight } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options', 'maxPopHeight']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'isMultiple', + 'options', + 'maxPopHeight', + 'request', + 'tableId', + 'cellRenderProps', + 'getCalendarContainer', + ]); const isOpen: any = useRef(); if (isMultiple) { diff --git a/components/apolloTable/component/base/edit/text-link/index.tsx b/components/apolloTable/component/base/edit/text-link/index.tsx index 81413272b81bf9a4bee6892b0abed32386f5b432..fa236199c6733de817553a38ad0466f87397a9c0 100644 --- a/components/apolloTable/component/base/edit/text-link/index.tsx +++ b/components/apolloTable/component/base/edit/text-link/index.tsx @@ -9,7 +9,22 @@ import { Consumer } from '../../../context'; export const ApolloTextLink = (props: ApolloTextAreaProps) => { const { maxLength, onChange, value, onEmitChange, columnConfig, origin } = props; const { columnChsName } = columnConfig; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'value', 'cutLength', 'getDetail', 'rowData', 'onEmitChange']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'value', + 'cutLength', + 'getDetail', + 'rowData', + 'onEmitChange', + 'isMultiple', + 'origin', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getPopupContainer', + 'getCalendarContainer', + ]); const [curValue, setCurValue] = useState(value); const [visible, setVisible] = useState(false); useEffect(() => { @@ -18,7 +33,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { getMore(); } }, [value]); - const [inputVal, setInputVal] = useState(value) + const [inputVal, setInputVal] = useState(value); useEffect(() => { setInputVal(value); }, [value]); @@ -49,14 +64,14 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { onEmitChange(value); } setVisible(false); - } + }; const confirmChange = () => { if (typeof onEmitChange === 'function') { onEmitChange(curValue); } setVisible(false); - } + }; const getMore = async () => { setVisible(true); @@ -75,7 +90,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { onBlur={inputOnBlurFn} onChange={(e) => { changeValue(e); - setInputVal(e.target.value) + setInputVal(e.target.value); }} /> {!!maxLength && ( @@ -87,7 +102,7 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { ); }} - ) + ); } return ( @@ -96,9 +111,9 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { return (
{ const { onChange, request } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'request']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'request', + 'tableId', + 'cellRenderProps', + 'getCalendarContainer', + ]); const isOpen = useRef(); const changeValue = (value: any) => { if (typeof onChange === 'function') { diff --git a/components/apolloTable/component/base/edit/textarea/index.tsx b/components/apolloTable/component/base/edit/textarea/index.tsx index b1d2b5f8dd8cc2e496791bfe3485dcaf7ad97ea4..c6884a7be7f14ec067f65b7df5bd7335d242ca0d 100644 --- a/components/apolloTable/component/base/edit/textarea/index.tsx +++ b/components/apolloTable/component/base/edit/textarea/index.tsx @@ -9,7 +9,20 @@ import { Consumer } from '../../../context'; export const ApolloTextArea = (props: ApolloTextAreaProps) => { const { maxLength, onChange, value, getDetail, rowData, onEmitChange, columnConfig, origin } = props; const { columnChsName } = columnConfig; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'value', 'cutLength', 'getDetail', 'rowData', 'onEmitChange']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'value', + 'cutLength', + 'getDetail', + 'onEmitChange', + 'rowData', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getPopupContainer', + 'getCalendarContainer', + ]); const [curValue, setCurValue] = useState(value); const [visible, setVisible] = useState(false); useEffect(() => { @@ -18,12 +31,8 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => { getMore(); } }, [value]); - // useEffect(() => { - // if (value && value.length === cutLength) { - // getMore(); - // } - // }, []); - const [inputVal, setInputVal] = useState(value) + + const [inputVal, setInputVal] = useState(value); useEffect(() => { setInputVal(value); }, [value]); @@ -48,14 +57,14 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => { onEmitChange(value); } setVisible(false); - } + }; const confirmChange = () => { if (typeof onEmitChange === 'function') { onEmitChange(curValue); } setVisible(false); - } + }; const getMore = async () => { if (getDetail && rowData) { @@ -79,8 +88,8 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => { value={inputVal} onBlur={inputOnBlurFn} onChange={(e) => { - changeValue(e) - setInputVal(e.target.value) + changeValue(e); + setInputVal(e.target.value); }} /> @@ -93,7 +102,7 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => { ); }} - ) + ); } return ( @@ -101,11 +110,7 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => { {({ locale }) => { return (
- + { const { onChange, isMultiple } = props; - const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple']); + const selfProps = antiAssign(props, [ + 'columnConfig', + 'onChange', + 'isMultiple', + 'request', + 'tableId', + 'cellRenderProps', + 'getCalendarContainer', + ]); const changeValue = (value) => { if (typeof onChange === 'function') { diff --git a/components/apolloTable/component/base/edit/upload/index.tsx b/components/apolloTable/component/base/edit/upload/index.tsx index f4927a7a487b91333389d07879b3312286a6b3fb..5be8139da387ccce3f2ebbfd5a518ac1ba138efe 100644 --- a/components/apolloTable/component/base/edit/upload/index.tsx +++ b/components/apolloTable/component/base/edit/upload/index.tsx @@ -6,11 +6,21 @@ import { antiAssign } from '../../../../utils/utils'; import s from './index.less'; import { onBlurFn } from '../onBlurFn'; import Upload from '../../extra/upload'; -import addIcon from '../../../../assets/addIcon.png'; export const ApolloUpload = (props: ApolloUploadProps) => { const { isMultiple, onEmitChange, onChange, disabled, origin } = props; - const selfProps = antiAssign(props, ['onChange', 'value']); + const selfProps = antiAssign(props, [ + 'onChange', + 'value', + 'onEmitChange', + 'tableId', + 'cellRenderProps', + 'maxPopHeight', + 'getPopupContainer', + 'getCalendarContainer', + 'isMultiple', + 'origin', + ]); if (isMultiple) { selfProps.multiple = true; } else { @@ -22,7 +32,7 @@ export const ApolloUpload = (props: ApolloUploadProps) => { const changeValue = (value) => { setValue(value); setEmptyVal([]); - onBlurFn({ ...props, value }) + onBlurFn({ ...props, value }); }; const [visible, setVisible] = useState(false); const refHelper = useRef(visible); @@ -58,7 +68,6 @@ export const ApolloUpload = (props: ApolloUploadProps) => { onChange(value); } toggleUploadDialog(false); - }; const onCancel = () => { if (typeof onEmitChange === 'function') { @@ -83,10 +92,7 @@ export const ApolloUpload = (props: ApolloUploadProps) => { return (
- +
); @@ -106,7 +112,6 @@ export const ApolloUpload = (props: ApolloUploadProps) => { return (
-