Commit dada7c7196a20409a2dbcf234c5a4a7a72674cb0

Authored by Min
1 parent 4322876c

1.产品PBOM 工艺参数,若配置了换行 \n,则需要支持换行

src/components/Common/CommonComponent/index.js
@@ -1428,7 +1428,24 @@ export default class CommonComponent extends Component { @@ -1428,7 +1428,24 @@ export default class CommonComponent extends Component {
1428 /> 1428 />
1429 ); 1429 );
1430 } 1430 }
1431 - if ( 1431 + if ((this.props.showConfig.sDropDownType === "sql" || this.props.showConfig.sDropDownType === "const")
  1432 + && this.props.showConfig.sName?.includes('sParam') && this.props.showConfig.showDropDown?.includes('\\n')
  1433 + ) {
  1434 + const row = commonUtils.isNotEmptyNumber(this.props.showConfig.iRowValue) ? this.props.showConfig.iRowValue : 1;
  1435 + const minHeight = row * 20 + 6 + 4 + 2;
  1436 +
  1437 + const correctText = commonUtils.isNotEmptyObject(this.state?.dataValue) ? this.state.dataValue :
  1438 + commonUtils.isNotEmptyObject(this.props.showConfig?.showDropDown) ? this.props.showConfig?.showDropDown?.replace(/\\n/g, "\n") : '111';
  1439 +
  1440 + return (
  1441 + <div><TextAreaA
  1442 + disabled={!this.state.enabled}
  1443 + defaultValue={correctText}
  1444 + onChange={e => this.handleSelectOptionEvent(e)}
  1445 + style={{ minHeight }}
  1446 + /></div>
  1447 + );
  1448 + } else if (
1432 (this.props.showConfig.sDropDownType === "sql" || this.props.showConfig.sDropDownType === "const") && 1449 (this.props.showConfig.sDropDownType === "sql" || this.props.showConfig.sDropDownType === "const") &&
1433 (this.firstDataIndex === "i" || this.firstDataIndex === "d" || this.firstDataIndex === "s") 1450 (this.firstDataIndex === "i" || this.firstDataIndex === "d" || this.firstDataIndex === "s")
1434 ) { 1451 ) {
@@ -2077,7 +2094,7 @@ export default class CommonComponent extends Component { @@ -2077,7 +2094,7 @@ export default class CommonComponent extends Component {
2077 "" 2094 ""
2078 ), 2095 ),
2079 }; 2096 };
2080 - 2097 +
2081 if (this.props.showConfig.sName.toLowerCase().includes('instruct') && this.props.enabled) { 2098 if (this.props.showConfig.sName.toLowerCase().includes('instruct') && this.props.enabled) {
2082 obj.suffix = ( 2099 obj.suffix = (
2083 <span style={{ width: "8px" }} onClick={this.handleEditInstruct}> 2100 <span style={{ width: "8px" }} onClick={this.handleEditInstruct}>