Commit a09989446e6733d361bb37a4f08cfcf532928774
1 parent
ae043e69
1.处理用户登录,黏贴用户名,选择用户时,用户丢失的bug
Showing
1 changed file
with
11 additions
and
6 deletions
src/components/Common/CommonComponent/index.js
| @@ -1406,7 +1406,7 @@ export default class CommonComponent extends Component { | @@ -1406,7 +1406,7 @@ export default class CommonComponent extends Component { | ||
| 1406 | obj.title = obj.value; | 1406 | obj.title = obj.value; |
| 1407 | } | 1407 | } |
| 1408 | obj.placeholder = this.props.showConfig.placeholder; | 1408 | obj.placeholder = this.props.showConfig.placeholder; |
| 1409 | - | 1409 | + |
| 1410 | if (this.props.name === "tableS0" && this.props.showConfig.sName === "sStatus") { | 1410 | if (this.props.name === "tableS0" && this.props.showConfig.sName === "sStatus") { |
| 1411 | if (this.state.dataValue === "已提交") { | 1411 | if (this.state.dataValue === "已提交") { |
| 1412 | obj.className = "sStatusSubmit"; | 1412 | obj.className = "sStatusSubmit"; |
| @@ -2425,11 +2425,16 @@ export default class CommonComponent extends Component { | @@ -2425,11 +2425,16 @@ export default class CommonComponent extends Component { | ||
| 2425 | searchPageNum: 0, searchTotalPageCount: 1, searchDropDownData: [], searchValue: '', spinState: false, | 2425 | searchPageNum: 0, searchTotalPageCount: 1, searchDropDownData: [], searchValue: '', spinState: false, |
| 2426 | }); | 2426 | }); |
| 2427 | } | 2427 | } |
| 2428 | + const bUserName = location.pathname?.includes('loginMes') && this.props.showConfig.sName?.includes('sUserName'); | ||
| 2428 | // /* 调用父组件的回带函数 */ | 2429 | // /* 调用父组件的回带函数 */ |
| 2429 | if (this.state.dataValue === returnValue[this.props.showConfig.sName]) { | 2430 | if (this.state.dataValue === returnValue[this.props.showConfig.sName]) { |
| 2430 | if (!this.completeFlag) { | 2431 | if (!this.completeFlag) { |
| 2431 | const addState = {}; | 2432 | const addState = {}; |
| 2432 | - addState[this.props.showConfig.sName] = undefined; | 2433 | + if(bUserName) { |
| 2434 | + addState[this.props.showConfig.sName] = this.state.dataValue + ' '; | ||
| 2435 | + } else{ | ||
| 2436 | + addState[this.props.showConfig.sName] = undefined; | ||
| 2437 | + } | ||
| 2433 | setTimeout(() => { | 2438 | setTimeout(() => { |
| 2434 | this.props.onChange(this.props.name, this.props.showConfig.sName, { ...returnValue, ...addState }, this.props.sId, dropDownDataNew); | 2439 | this.props.onChange(this.props.name, this.props.showConfig.sName, { ...returnValue, ...addState }, this.props.sId, dropDownDataNew); |
| 2435 | }, 0); | 2440 | }, 0); |
| @@ -2716,7 +2721,7 @@ export default class CommonComponent extends Component { | @@ -2716,7 +2721,7 @@ export default class CommonComponent extends Component { | ||
| 2716 | 2721 | ||
| 2717 | // 登记取样特殊处理 | 2722 | // 登记取样特殊处理 |
| 2718 | if(slaveConfig.sId=='12710101117346647176280'){ | 2723 | if(slaveConfig.sId=='12710101117346647176280'){ |
| 2719 | - | 2724 | + |
| 2720 | if(innerInputProps.id.includes('bReturn')){ | 2725 | if(innerInputProps.id.includes('bReturn')){ |
| 2721 | window.$xlyStorage = this.props.dataValue; | 2726 | window.$xlyStorage = this.props.dataValue; |
| 2722 | } | 2727 | } |
| @@ -2725,7 +2730,7 @@ export default class CommonComponent extends Component { | @@ -2725,7 +2730,7 @@ export default class CommonComponent extends Component { | ||
| 2725 | 2730 | ||
| 2726 | this.myRef.current.querySelector('input').addEventListener('keydown',(event)=>{ | 2731 | this.myRef.current.querySelector('input').addEventListener('keydown',(event)=>{ |
| 2727 | if (event.code === 'NumpadEnter' || event.code === 'Enter') { // 或者使用 event.keyCode === 13 | 2732 | if (event.code === 'NumpadEnter' || event.code === 'Enter') { // 或者使用 event.keyCode === 13 |
| 2728 | - | 2733 | + |
| 2729 | event.preventDefault(); // 阻止默认行为 | 2734 | event.preventDefault(); // 阻止默认行为 |
| 2730 | // console.log(this.value) | 2735 | // console.log(this.value) |
| 2731 | // const inputValue = this.value; | 2736 | // const inputValue = this.value; |
| @@ -2767,7 +2772,7 @@ export default class CommonComponent extends Component { | @@ -2767,7 +2772,7 @@ export default class CommonComponent extends Component { | ||
| 2767 | }) | 2772 | }) |
| 2768 | 2773 | ||
| 2769 | 2774 | ||
| 2770 | - | 2775 | + |
| 2771 | // debugger | 2776 | // debugger |
| 2772 | // innerInputProps.onPressEnter = (event2)=>{ | 2777 | // innerInputProps.onPressEnter = (event2)=>{ |
| 2773 | // setTimeout(()=>{ | 2778 | // setTimeout(()=>{ |
| @@ -3065,7 +3070,7 @@ export default class CommonComponent extends Component { | @@ -3065,7 +3070,7 @@ export default class CommonComponent extends Component { | ||
| 3065 | const fieldDecoratorProps = this.getFieldDecoratorProps(); | 3070 | const fieldDecoratorProps = this.getFieldDecoratorProps(); |
| 3066 | /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */ | 3071 | /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */ |
| 3067 | 3072 | ||
| 3068 | - | 3073 | + |
| 3069 | // 班组报工,产量上报信息,label文字颜色特殊处理 | 3074 | // 班组报工,产量上报信息,label文字颜色特殊处理 |
| 3070 | if(slaveConfig.sId=='17087428780006438414984564455000'){ | 3075 | if(slaveConfig.sId=='17087428780006438414984564455000'){ |
| 3071 | // 计件 | 3076 | // 计件 |