diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index acdb1f1..a5183db 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -749,10 +749,11 @@ export default class CommonComponent extends Component { } }; getSelectTableOption = () => { - const { selectTableData } = this.state; + const { selectTableData, selectTableIndex = 0 } = this.state; const { showConfig, app } = this.props; const { userinfo } = app; let { sTableTitleSql } = showConfig; + console.log('222', sTableTitleSql); /* 根据用户配置语言 设置表格标题 */ if (commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); @@ -771,7 +772,7 @@ export default class CommonComponent extends Component { const totalStringLen = titleStr.length; const otherStrLen = titleStr.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line const chineseStrLen = totalStringLen - otherStrLen; - const defaultWidth = (chineseStrLen * 20) + (otherStrLen * 12); + const defaultWidth = (chineseStrLen * 12) + (otherStrLen * 8); const maxStrLen = selectTableData.reduce((res, pre) => { let tempValue = pre[value] !== undefined ? pre[value] : ''; if (tempValue === '') { @@ -781,7 +782,7 @@ export default class CommonComponent extends Component { const totalStringLen = tempValue.length; const otherStrLen = tempValue.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line const chineseStrLen = totalStringLen - otherStrLen; - const tempWidth = (chineseStrLen * 20) + (otherStrLen * 12); + const tempWidth = (chineseStrLen * 12) + (otherStrLen * 8); return Math.max(tempWidth, res); }, defaultWidth); width = Math.min(maxStrLen + 8, 300); @@ -812,16 +813,25 @@ export default class CommonComponent extends Component { return (