Commit b2661ce947c527293a74a5408248866dafe03117
1 parent
d8a4a150
处理不需要防抖时多次刷新问题;
Showing
1 changed file
with
10 additions
and
15 deletions
src/components/Common/CommonComponent/index.js
| @@ -38,10 +38,10 @@ const FormItem = Form.Item; | @@ -38,10 +38,10 @@ const FormItem = Form.Item; | ||
| 38 | const { Option } = Select; | 38 | const { Option } = Select; |
| 39 | const { TextArea } = Input; | 39 | const { TextArea } = Input; |
| 40 | const { Search } = Input; | 40 | const { Search } = Input; |
| 41 | -let InputNumberA = reactComponentDebounce(300)(InputNumber); | ||
| 42 | -let InputA = reactComponentDebounce(300)(Input); | ||
| 43 | -let AutoCompleteA = reactComponentDebounce(300)(AutoComplete); /* 处理快速选择产品后离开 产品无法赋值问题s */ | ||
| 44 | -let TextAreaA = reactComponentDebounce(500)(TextArea); | 41 | +const InputNumberA1 = reactComponentDebounce(300)(InputNumber); |
| 42 | +const InputA1 = reactComponentDebounce(300)(Input); | ||
| 43 | +const AutoCompleteA1 = reactComponentDebounce(300)(AutoComplete); /* 处理快速选择产品后离开 产品无法赋值问题s */ | ||
| 44 | +const TextAreaA1 = reactComponentDebounce(500)(TextArea); | ||
| 45 | // const InputNumberA = InputNumber; | 45 | // const InputNumberA = InputNumber; |
| 46 | // const InputA = Input; | 46 | // const InputA = Input; |
| 47 | // const AutoCompleteA = AutoComplete; | 47 | // const AutoCompleteA = AutoComplete; |
| @@ -96,17 +96,6 @@ export default class CommonComponent extends Component { | @@ -96,17 +96,6 @@ export default class CommonComponent extends Component { | ||
| 96 | this.myRef = createRef(); | 96 | this.myRef = createRef(); |
| 97 | this.dropDownCount = 0; | 97 | this.dropDownCount = 0; |
| 98 | this.bSpecial = location.pathname?.includes("ResearchTableTree") && props.showConfig.sName === "sProductName"; | 98 | this.bSpecial = location.pathname?.includes("ResearchTableTree") && props.showConfig.sName === "sProductName"; |
| 99 | - // if (props.noDebounce) { | ||
| 100 | - // InputNumberA = InputNumber; | ||
| 101 | - // InputA = Input; | ||
| 102 | - // AutoCompleteA = AutoComplete; | ||
| 103 | - // TextAreaA = TextArea; | ||
| 104 | - // } else { | ||
| 105 | - // InputNumberA = reactComponentDebounce(300)(InputNumber); | ||
| 106 | - // InputA = reactComponentDebounce(300)(Input); | ||
| 107 | - // AutoCompleteA = reactComponentDebounce(300)(AutoComplete); | ||
| 108 | - // TextAreaA = reactComponentDebounce(500)(TextArea); | ||
| 109 | - // } | ||
| 110 | } | 99 | } |
| 111 | 100 | ||
| 112 | /** 渲染前只执行一次 */ | 101 | /** 渲染前只执行一次 */ |
| @@ -1229,6 +1218,12 @@ export default class CommonComponent extends Component { | @@ -1229,6 +1218,12 @@ export default class CommonComponent extends Component { | ||
| 1229 | }; | 1218 | }; |
| 1230 | /** 获取innerinput控件1 */ | 1219 | /** 获取innerinput控件1 */ |
| 1231 | getInnerInput = innerInputProps => { | 1220 | getInnerInput = innerInputProps => { |
| 1221 | + const { noDebounce } = this.props; | ||
| 1222 | + const InputNumberA = noDebounce ? InputNumber : InputNumberA1; | ||
| 1223 | + const InputA = noDebounce ? Input : InputA1; | ||
| 1224 | + const AutoCompleteA = noDebounce ? AutoComplete : AutoCompleteA1; | ||
| 1225 | + const TextAreaA = noDebounce ? TextArea : TextAreaA1; | ||
| 1226 | + | ||
| 1232 | const { sTableTitleSql, iVisCount, sName, sDateFormat } = this.props.showConfig; | 1227 | const { sTableTitleSql, iVisCount, sName, sDateFormat } = this.props.showConfig; |
| 1233 | let chooseTitle = "选择"; | 1228 | let chooseTitle = "选择"; |
| 1234 | if (commonUtils.isNotEmptyObject(this.props.app) && commonUtils.isNotEmptyObject(this.props.app.commonConst)) { | 1229 | if (commonUtils.isNotEmptyObject(this.props.app) && commonUtils.isNotEmptyObject(this.props.app.commonConst)) { |