diff --git a/components/apolloTable/component/base/edit/text-link/index.tsx b/components/apolloTable/component/base/edit/text-link/index.tsx index fef924450e4724d3243f95ca957c526a312f947e..81413272b81bf9a4bee6892b0abed32386f5b432 100644 --- a/components/apolloTable/component/base/edit/text-link/index.tsx +++ b/components/apolloTable/component/base/edit/text-link/index.tsx @@ -1,12 +1,13 @@ import React, { useEffect, useState } from 'react'; import { Input, Modal } from 'antd'; import styles from './styles.less'; +import { onBlurFn } from '../onBlurFn'; import { antiAssign } from '../../../../utils/utils'; import { ApolloTextAreaProps } from '../editInterface'; import { Consumer } from '../../../context'; export const ApolloTextLink = (props: ApolloTextAreaProps) => { - const { maxLength, onChange, value, cutLength, getDetail, rowData, onEmitChange, columnConfig, origin } = props; + const { maxLength, onChange, value, onEmitChange, columnConfig, origin } = props; const { columnChsName } = columnConfig; const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'value', 'cutLength', 'getDetail', 'rowData', 'onEmitChange']); const [curValue, setCurValue] = useState(value); @@ -17,12 +18,20 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { getMore(); } }, [value]); + const [inputVal, setInputVal] = useState(value) + useEffect(() => { + setInputVal(value); + }, [value]); // useEffect(() => { // if (value && value.length === cutLength) { // getMore(); // } // }, []); - + const inputOnBlurFn = () => { + if (typeof onBlurFn === 'function') { + onBlurFn(props); + } + }; const changeValue = (e) => { if (typeof onChange === 'function') { onChange(e.target.value); @@ -62,8 +71,12 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { { + changeValue(e); + setInputVal(e.target.value) + }} /> {!!maxLength && (