Commit 25cac7884b3dd5744a7ee83029aff6a744849675
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi into main
Showing
1 changed file
with
7 additions
and
4 deletions
src/components/Common/CommonTable/colorInfo.jsx
| ... | ... | @@ -3,7 +3,8 @@ import React, { PureComponent } from "react"; |
| 3 | 3 | import styles from "./index.less"; |
| 4 | 4 | |
| 5 | 5 | export default class ColorInfo extends PureComponent { |
| 6 | - colorContentItem = item => { | |
| 6 | + colorContentItem = (item,language) => { | |
| 7 | + | |
| 7 | 8 | const title = item?.sName; |
| 8 | 9 | const info = Array.isArray(item?.sColor) ? item.sColor.filter(Boolean) : []; |
| 9 | 10 | return ( |
| ... | ... | @@ -28,7 +29,7 @@ export default class ColorInfo extends PureComponent { |
| 28 | 29 | }} |
| 29 | 30 | /> |
| 30 | 31 | <label for={index} style={{ fontSize: 10 }}> |
| 31 | - {i?.sName} | |
| 32 | + {language ==='sEnglish'? i.sEnglishName : language === 'sBig5'? i.sBig5Name: i.sName} | |
| 32 | 33 | </label> |
| 33 | 34 | </div> |
| 34 | 35 | ))} |
| ... | ... | @@ -39,11 +40,13 @@ export default class ColorInfo extends PureComponent { |
| 39 | 40 | }; |
| 40 | 41 | |
| 41 | 42 | colorContent = () => { |
| 42 | - const { masterConfig } = this.props; | |
| 43 | + const { masterConfig, app } = this.props; | |
| 44 | + const {userinfo} = app; | |
| 45 | + const language = userinfo.sLanguage; | |
| 43 | 46 | try { |
| 44 | 47 | const result = JSON.parse(masterConfig.sTableColorTs); |
| 45 | 48 | if (!Array.isArray(result)) return; |
| 46 | - return result.map(i => this.colorContentItem(i)); | |
| 49 | + return result.map(i => this.colorContentItem(i, language)); | |
| 47 | 50 | } catch (error) { |
| 48 | 51 | return []; |
| 49 | 52 | } | ... | ... |