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 | 749 | } |
| 750 | 750 | }; |
| 751 | 751 | getSelectTableOption = () => { |
| 752 | - const { selectTableData, selectTableIndex = 0 } = this.state; | |
| 752 | + const { selectTableData } = this.state; | |
| 753 | 753 | const { showConfig, app } = this.props; |
| 754 | 754 | const { userinfo } = app; |
| 755 | 755 | let { sTableTitleSql } = showConfig; |
| 756 | - console.log('222', sTableTitleSql); | |
| 757 | 756 | /* 根据用户配置语言 设置表格标题 */ |
| 758 | 757 | if (commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { |
| 759 | 758 | sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); |
| ... | ... | @@ -772,7 +771,7 @@ export default class CommonComponent extends Component { |
| 772 | 771 | const totalStringLen = titleStr.length; |
| 773 | 772 | const otherStrLen = titleStr.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line |
| 774 | 773 | const chineseStrLen = totalStringLen - otherStrLen; |
| 775 | - const defaultWidth = (chineseStrLen * 12) + (otherStrLen * 8); | |
| 774 | + const defaultWidth = (chineseStrLen * 20) + (otherStrLen * 12); | |
| 776 | 775 | const maxStrLen = selectTableData.reduce((res, pre) => { |
| 777 | 776 | let tempValue = pre[value] !== undefined ? pre[value] : ''; |
| 778 | 777 | if (tempValue === '') { |
| ... | ... | @@ -782,7 +781,7 @@ export default class CommonComponent extends Component { |
| 782 | 781 | const totalStringLen = tempValue.length; |
| 783 | 782 | const otherStrLen = tempValue.replace(/[^\x00-\xff]/g, '').length; // eslint-disable-line |
| 784 | 783 | const chineseStrLen = totalStringLen - otherStrLen; |
| 785 | - const tempWidth = (chineseStrLen * 12) + (otherStrLen * 8); | |
| 784 | + const tempWidth = (chineseStrLen * 20) + (otherStrLen * 12); | |
| 786 | 785 | return Math.max(tempWidth, res); |
| 787 | 786 | }, defaultWidth); |
| 788 | 787 | width = Math.min(maxStrLen + 8, 300); |
| ... | ... | @@ -813,25 +812,16 @@ export default class CommonComponent extends Component { |
| 813 | 812 | |
| 814 | 813 | return ( |
| 815 | 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 | 816 | <Table |
| 818 | 817 | size="small" |
| 819 | 818 | className="select-table" |
| 820 | - rowClassName={(_, index) => { | |
| 821 | - return selectTableIndex === index ? 'selected-record-row' : ''; | |
| 822 | - }} | |
| 823 | 819 | rowKey="sId" |
| 824 | - onRow={(record, index) => { | |
| 820 | + onRow={(record) => { | |
| 825 | 821 | return { |
| 826 | - index, | |
| 827 | - onMouseEnter: () => { | |
| 828 | - this.setState({ | |
| 829 | - selectTableIndex: index, | |
| 830 | - }); | |
| 831 | - }, | |
| 832 | 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 | }} | ... | ... |