Commit a7340844f928f4c03f31c665c68286eb650517c4
1 parent
c0a874e8
1.补充各类翻译
Showing
1 changed file
with
7 additions
and
17 deletions
src/components/Common/CommonComponent/index.js
| @@ -749,11 +749,10 @@ export default class CommonComponent extends Component { | @@ -749,11 +749,10 @@ export default class CommonComponent extends Component { | ||
| 749 | } | 749 | } |
| 750 | }; | 750 | }; |
| 751 | getSelectTableOption = () => { | 751 | getSelectTableOption = () => { |
| 752 | - const { selectTableData, selectTableIndex = 0 } = this.state; | 752 | + const { selectTableData } = this.state; |
| 753 | const { showConfig, app } = this.props; | 753 | const { showConfig, app } = this.props; |
| 754 | const { userinfo } = app; | 754 | const { userinfo } = app; |
| 755 | let { sTableTitleSql } = showConfig; | 755 | let { sTableTitleSql } = showConfig; |
| 756 | - console.log('222', sTableTitleSql); | ||
| 757 | /* 根据用户配置语言 设置表格标题 */ | 756 | /* 根据用户配置语言 设置表格标题 */ |
| 758 | if (commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { | 757 | if (commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { |
| 759 | sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); | 758 | sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); |
| @@ -772,7 +771,7 @@ export default class CommonComponent extends Component { | @@ -772,7 +771,7 @@ export default class CommonComponent extends Component { | ||
| 772 | const totalStringLen = titleStr.length; | 771 | const totalStringLen = titleStr.length; |
| 773 | const otherStrLen = titleStr.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line | 772 | const otherStrLen = titleStr.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line |
| 774 | const chineseStrLen = totalStringLen - otherStrLen; | 773 | const chineseStrLen = totalStringLen - otherStrLen; |
| 775 | - const defaultWidth = (chineseStrLen * 12) + (otherStrLen * 8); | 774 | + const defaultWidth = (chineseStrLen * 20) + (otherStrLen * 12); |
| 776 | const maxStrLen = selectTableData.reduce((res, pre) => { | 775 | const maxStrLen = selectTableData.reduce((res, pre) => { |
| 777 | let tempValue = pre[value] !== undefined ? pre[value] : ''; | 776 | let tempValue = pre[value] !== undefined ? pre[value] : ''; |
| 778 | if (tempValue === '') { | 777 | if (tempValue === '') { |
| @@ -782,7 +781,7 @@ export default class CommonComponent extends Component { | @@ -782,7 +781,7 @@ export default class CommonComponent extends Component { | ||
| 782 | const totalStringLen = tempValue.length; | 781 | const totalStringLen = tempValue.length; |
| 783 | const otherStrLen = tempValue.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line | 782 | const otherStrLen = tempValue.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line |
| 784 | const chineseStrLen = totalStringLen - otherStrLen; | 783 | const chineseStrLen = totalStringLen - otherStrLen; |
| 785 | - const tempWidth = (chineseStrLen * 12) + (otherStrLen * 8); | 784 | + const tempWidth = (chineseStrLen * 20) + (otherStrLen * 12); |
| 786 | return Math.max(tempWidth, res); | 785 | return Math.max(tempWidth, res); |
| 787 | }, defaultWidth); | 786 | }, defaultWidth); |
| 788 | width = Math.min(maxStrLen + 8, 300); | 787 | width = Math.min(maxStrLen + 8, 300); |
| @@ -813,25 +812,16 @@ export default class CommonComponent extends Component { | @@ -813,25 +812,16 @@ export default class CommonComponent extends Component { | ||
| 813 | 812 | ||
| 814 | return ( | 813 | return ( |
| 815 | <Option key="" className="select-table-option"> | 814 | <Option key="" className="select-table-option"> |
| 816 | - <div style={{ width: scrollX + 8, maxWidth: 'calc(100vw - 16px)', minWidth: '100%' }} ref={(ref) => { this.selectTableRef1 = ref; }}> | 815 | + <div style={{ width: scrollX + 8, maxWidth: 'calc(100vw - 16px)', minWidth: '100%' }}> |
| 817 | <Table | 816 | <Table |
| 818 | size="small" | 817 | size="small" |
| 819 | className="select-table" | 818 | className="select-table" |
| 820 | - rowClassName={(_, index) => { | ||
| 821 | - return selectTableIndex === index ? 'selected-record-row' : ''; | ||
| 822 | - }} | ||
| 823 | rowKey="sId" | 819 | rowKey="sId" |
| 824 | - onRow={(record, index) => { | 820 | + onRow={(record) => { |
| 825 | return { | 821 | return { |
| 826 | - index, | ||
| 827 | - onMouseEnter: () => { | ||
| 828 | - this.setState({ | ||
| 829 | - selectTableIndex: index, | ||
| 830 | - }); | ||
| 831 | - }, | ||
| 832 | onClick: () => { | 822 | onClick: () => { |
| 833 | - this.setState({ tempCurrentPage: null, bDropDownOpen: false, bNotFirstEnter: true }); | ||
| 834 | - this.handleSelectOptionEvent(record.sSlaveId || record.sId); | 823 | + this.setState({ tempCurrentPage: null }); |
| 824 | + this.handleSelectOptionEvent(record.sId); | ||
| 835 | }, | 825 | }, |
| 836 | }; | 826 | }; |
| 837 | }} | 827 | }} |