Commit 54000886 authored by zhangwenshuai's avatar zhangwenshuai

弹框类组件修改为不同步数据

parent 6705ef2e
...@@ -22,15 +22,16 @@ export default function CellContainer<P extends Props>(Comp) { ...@@ -22,15 +22,16 @@ export default function CellContainer<P extends Props>(Comp) {
}; };
this.container = React.createRef(); this.container = React.createRef();
} }
static getDerivedStateFromProps(nextProps: any, prevState: any) { // 编辑单元格实时更新
if (JSON.stringify(prevState.propsValue) !== JSON.stringify(nextProps.value)) { // static getDerivedStateFromProps(nextProps: any, prevState: any) {
return { // if (JSON.stringify(prevState.propsValue) !== JSON.stringify(nextProps.value)) {
propsValue: nextProps.value, // return {
value: nextProps.value, // propsValue: nextProps.value,
}; // value: nextProps.value,
} // };
return null; // }
} // return null;
// }
componentDidMount(): void { componentDidMount(): void {
document.addEventListener('click', this.onBlur, false); document.addEventListener('click', this.onBlur, false);
} }
......
...@@ -19,6 +19,7 @@ export const ApolloInput = (props: ApolloInputProps) => { ...@@ -19,6 +19,7 @@ export const ApolloInput = (props: ApolloInputProps) => {
'maxPopHeight', 'maxPopHeight',
'getPopupContainer', 'getPopupContainer',
'getCalendarContainer', 'getCalendarContainer',
'origin',
]); ]);
const [inputVal, setInputVal] = useState(value); const [inputVal, setInputVal] = useState(value);
useEffect(() => { useEffect(() => {
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
:global(.ant-select-selection__rendered) { :global(.ant-select-selection__rendered) {
width: 100%; width: 100%;
} }
:global(.ant-select-dropdown-menu) {
max-height: none;
}
} }
.searchDropdown { .searchDropdown {
overflow: auto; overflow: auto;
......
...@@ -29,10 +29,9 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => { ...@@ -29,10 +29,9 @@ export const ApolloTextLink = (props: ApolloTextAreaProps) => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
useEffect(() => { useEffect(() => {
if (origin !== 'editForm') { if (origin !== 'editForm') {
setCurValue(value);
getMore(); getMore();
} }
}, [value]); }, []);
const [inputVal, setInputVal] = useState(value); const [inputVal, setInputVal] = useState(value);
useEffect(() => { useEffect(() => {
setInputVal(value); setInputVal(value);
......
...@@ -22,15 +22,15 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => { ...@@ -22,15 +22,15 @@ export const ApolloTextArea = (props: ApolloTextAreaProps) => {
'maxPopHeight', 'maxPopHeight',
'getPopupContainer', 'getPopupContainer',
'getCalendarContainer', 'getCalendarContainer',
'origin',
]); ]);
const [curValue, setCurValue] = useState(value); const [curValue, setCurValue] = useState(value);
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
useEffect(() => { useEffect(() => {
if (origin !== 'editForm') { if (origin !== 'editForm') {
setCurValue(value);
getMore(); getMore();
} }
}, [value]); }, []);
const [inputVal, setInputVal] = useState(value); const [inputVal, setInputVal] = useState(value);
useEffect(() => { useEffect(() => {
......
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