Commit 94834f444dace36c0aa8044664f87a3a5bfc09a8

Authored by 陈鑫涛
2 parents 86a05485 cafa9dc4

Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi into main

src/components/Common/CommonComponent/index.js
... ... @@ -635,7 +635,15 @@ export default class CommonComponent extends Component {
635 635 /* 返回值 */
636 636 return obj;
637 637 };
638   -
  638 + getLocalizedString = (jsonStr, language) =>{
  639 + try {
  640 + const data = JSON.parse(jsonStr);
  641 + return data[language] || '';
  642 + } catch (e) {
  643 + console.error('Error parsing JSON:', e);
  644 + return '';
  645 + }
  646 + }
639 647 getSelectTableProps = () => {
640 648 const { currentPage, tempCurrentPage, searchValue } = this.state;
641 649 const pageNum = searchValue === '' ? currentPage : tempCurrentPage;
... ... @@ -828,8 +836,13 @@ export default class CommonComponent extends Component {
828 836  
829 837 getSelectTableOption = () => {
830 838 const { selectTableData, selectTableIndex = 0 } = this.state;
831   - const { showConfig } = this.props;
832   - const { sTableTitleSql } = showConfig;
  839 + const { showConfig , app} = this.props;
  840 + const { userinfo } = app;
  841 + let { sTableTitleSql } = showConfig;
  842 + /* 根据用户配置语言 设置表格标题 */
  843 + if(commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) {
  844 + sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage);
  845 + }
833 846 const tempColumnArr = sTableTitleSql.split(',');
834 847 let scrollX = 0;
835 848 const columns = tempColumnArr.map((item, index) => {
... ...
src/components/Common/CommonNewBill.js
... ... @@ -2541,7 +2541,12 @@ const BillComponent = Form.create({
2541 2541 // 匹配数字
2542 2542 // eslint-disable-next-line no-unused-vars
2543 2543 let num = item.replace(/[^\d]/g, '').trim();
2544   - const tabName = item.replace(/\d+/g,'');
  2544 + let tabName = item.replace(/\d+/g,'');
  2545 + /* 从主表配置 找到控件名=tabName,否则取他的showName */
  2546 + const tableConfigArr = masterConfig?.gdsconfigformslave.filter(row => row.sControlName === item.trim());
  2547 + if(commonUtils.isNotEmptyArr(tableConfigArr)) {
  2548 + tabName=tableConfigArr[0].showName;
  2549 + }
2545 2550 return (
2546 2551 <TabPane tab={tabName} key={num} className="xly-bill-list">
2547 2552 <div>
... ...