Commit a09989446e6733d361bb37a4f08cfcf532928774

Authored by Min
1 parent ae043e69

1.处理用户登录,黏贴用户名,选择用户时,用户丢失的bug

src/components/Common/CommonComponent/index.js
... ... @@ -1406,7 +1406,7 @@ export default class CommonComponent extends Component {
1406 1406 obj.title = obj.value;
1407 1407 }
1408 1408 obj.placeholder = this.props.showConfig.placeholder;
1409   -
  1409 +
1410 1410 if (this.props.name === "tableS0" && this.props.showConfig.sName === "sStatus") {
1411 1411 if (this.state.dataValue === "已提交") {
1412 1412 obj.className = "sStatusSubmit";
... ... @@ -2425,11 +2425,16 @@ export default class CommonComponent extends Component {
2425 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 2430 if (this.state.dataValue === returnValue[this.props.showConfig.sName]) {
2430 2431 if (!this.completeFlag) {
2431 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 2438 setTimeout(() => {
2434 2439 this.props.onChange(this.props.name, this.props.showConfig.sName, { ...returnValue, ...addState }, this.props.sId, dropDownDataNew);
2435 2440 }, 0);
... ... @@ -2716,7 +2721,7 @@ export default class CommonComponent extends Component {
2716 2721  
2717 2722 // 登记取样特殊处理
2718 2723 if(slaveConfig.sId=='12710101117346647176280'){
2719   -
  2724 +
2720 2725 if(innerInputProps.id.includes('bReturn')){
2721 2726 window.$xlyStorage = this.props.dataValue;
2722 2727 }
... ... @@ -2725,7 +2730,7 @@ export default class CommonComponent extends Component {
2725 2730  
2726 2731 this.myRef.current.querySelector('input').addEventListener('keydown',(event)=>{
2727 2732 if (event.code === 'NumpadEnter' || event.code === 'Enter') { // 或者使用 event.keyCode === 13
2728   -
  2733 +
2729 2734 event.preventDefault(); // 阻止默认行为
2730 2735 // console.log(this.value)
2731 2736 // const inputValue = this.value;
... ... @@ -2767,7 +2772,7 @@ export default class CommonComponent extends Component {
2767 2772 })
2768 2773  
2769 2774  
2770   -
  2775 +
2771 2776 // debugger
2772 2777 // innerInputProps.onPressEnter = (event2)=>{
2773 2778 // setTimeout(()=>{
... ... @@ -3065,7 +3070,7 @@ export default class CommonComponent extends Component {
3065 3070 const fieldDecoratorProps = this.getFieldDecoratorProps();
3066 3071 /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */
3067 3072  
3068   -
  3073 +
3069 3074 // 班组报工,产量上报信息,label文字颜色特殊处理
3070 3075 if(slaveConfig.sId=='17087428780006438414984564455000'){
3071 3076 // 计件
... ...