diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index c1fa3f1..e8623e9 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -635,7 +635,15 @@ export default class CommonComponent extends Component { /* 返回值 */ return obj; }; - + getLocalizedString = (jsonStr, language) =>{ + try { + const data = JSON.parse(jsonStr); + return data[language] || ''; + } catch (e) { + console.error('Error parsing JSON:', e); + return ''; + } + } getSelectTableProps = () => { const { currentPage, tempCurrentPage, searchValue } = this.state; const pageNum = searchValue === '' ? currentPage : tempCurrentPage; @@ -828,8 +836,13 @@ export default class CommonComponent extends Component { getSelectTableOption = () => { const { selectTableData, selectTableIndex = 0 } = this.state; - const { showConfig } = this.props; - const { sTableTitleSql } = showConfig; + const { showConfig , app} = this.props; + const { userinfo } = app; + let { sTableTitleSql } = showConfig; + /* 根据用户配置语言 设置表格标题 */ + if(commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { + sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); + } const tempColumnArr = sTableTitleSql.split(','); let scrollX = 0; const columns = tempColumnArr.map((item, index) => { diff --git a/src/components/Common/CommonNewBill.js b/src/components/Common/CommonNewBill.js index 9e8c31c..ca96a3c 100644 --- a/src/components/Common/CommonNewBill.js +++ b/src/components/Common/CommonNewBill.js @@ -2541,7 +2541,12 @@ const BillComponent = Form.create({ // 匹配数字 // eslint-disable-next-line no-unused-vars let num = item.replace(/[^\d]/g, '').trim(); - const tabName = item.replace(/\d+/g,''); + let tabName = item.replace(/\d+/g,''); + /* 从主表配置 找到控件名=tabName,否则取他的showName */ + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim()); + if(commonUtils.isNotEmptyArr(tableConfigArr)) { + tabName=tableConfigArr[0].showName; + } return (