Commit cab86592d6ad973b0008bbabc166463df21e2024
1 parent
56d3c42f
1.处理登录界面的多语言翻译
Showing
1 changed file
with
15 additions
and
23 deletions
src/components/login/Login.js
| ... | ... | @@ -287,6 +287,8 @@ class LoginForm extends Component { |
| 287 | 287 | ? "Please select branch name" |
| 288 | 288 | : "請選擇分公司名稱"; /* 请选择分公司名称 */ |
| 289 | 289 | let btnLogin = sLanguage === "sChinese" ? "登 录" : sLanguage === "sEnglish" ? "Login" : "登 錄"; /* 登 陆 */ |
| 290 | + let btnRegister = sLanguage === "sChinese" ? "用户注册" : sLanguage === "sEnglish" ? "Register" : "用戶註冊"; /* 登 陆 */ | |
| 291 | + let btnFaceLogin = sLanguage === 'sChinese' ? '人脸登录' : (sLanguage === 'sEnglish' ? 'Face Login' : '人臉登錄');/* 人脸 登 陆 */ | |
| 290 | 292 | let Copyright = "Copyright"; /* Copyright */ |
| 291 | 293 | let AddrOne = sLanguage === "sChinese" ? "小羚羊软件" : sLanguage === "sEnglish" ? "XiaoLingYangSoft" : "小羚羊軟件"; /* 小羚羊软件 */ |
| 292 | 294 | let AddrTwo = sLanguage === "sChinese" ? "印刷智慧工厂" : sLanguage === "sEnglish" ? "PrintingSmartFactory" : "印刷智慧工廠"; /* 印刷智慧工厂 */ |
| ... | ... | @@ -330,8 +332,15 @@ class LoginForm extends Component { |
| 330 | 332 | const ChooseBranchCompanyData = loginInfo.filter(item => item.sControlName === "ChooseBranchCompany"); |
| 331 | 333 | chooseBranchCompany = commonUtils.isNotEmptyArr(ChooseBranchCompanyData) ? ChooseBranchCompanyData[0].showName : chooseBranchCompany; |
| 332 | 334 | |
| 333 | - const BtnLoginData = loginInfo.filter(item => item.sControlName === "BtnLogin"); | |
| 334 | - btnLogin = commonUtils.isNotEmptyArr(BtnLoginData) ? BtnLoginData[0].showName : btnLogin; | |
| 335 | + const BtnLoginDataArr = loginInfo.filter(item => item.sControlName === "BtnLogin"); | |
| 336 | + btnLogin = commonUtils.isNotEmptyArr(BtnLoginDataArr) ? BtnLoginDataArr[0].showName : btnLogin; | |
| 337 | + | |
| 338 | + const BtnLoginDataRegister = loginInfo.filter(item => item.sControlName === "BtnRegister"); | |
| 339 | + btnRegister = commonUtils.isNotEmptyArr(BtnLoginDataRegister) ? BtnLoginDataRegister[0].showName : btnRegister; | |
| 340 | + | |
| 341 | + | |
| 342 | + let BtnFaceLoginArr = loginInfo.filter(item => item.sControlName === "BtnFaceLogin"); | |
| 343 | + btnFaceLogin = commonUtils.isNotEmptyArr(BtnFaceLoginArr) ? BtnFaceLoginArr[0].showName : btnFaceLogin; | |
| 335 | 344 | |
| 336 | 345 | const CopyrightData = loginInfo.filter(item => item.sControlName === "Copyright"); |
| 337 | 346 | Copyright = commonUtils.isNotEmptyArr(CopyrightData) ? CopyrightData[0].showName : Copyright; |
| ... | ... | @@ -447,24 +456,7 @@ class LoginForm extends Component { |
| 447 | 456 | </FormItem> |
| 448 | 457 | </> |
| 449 | 458 | )} |
| 450 | - {/*<FormItem className={styles.loginTip}>*/} | |
| 451 | - {/* {getFieldDecorator('username', {*/} | |
| 452 | - {/* rules: [{ required: true, message: pleaseInputUserName }],*/} | |
| 453 | - {/* })(<Input className={styles.loginInput} size="large" prefix={<UserOutlined className={styles.loginIcon} />} placeholder={pleaseInputUserName} />)}*/} | |
| 454 | - {/*</FormItem>*/} | |
| 455 | - {/*<FormItem className={styles.loginTip}>*/} | |
| 456 | - {/* {getFieldDecorator('password', {*/} | |
| 457 | - {/* rules: [{ required: true, message: pleaseInputPassword }],*/} | |
| 458 | - {/* })(<Input className={styles.loginInput} size="large" prefix={<LockOutlined className={styles.loginIcon} />} type="password" placeholder={pleaseInputPassword} />)}*/} | |
| 459 | - {/*</FormItem>*/} | |
| 460 | - {/* <FormItem className={styles.loginTip}> | |
| 461 | - <div className={styles.loginSelect}> | |
| 462 | - {getFieldDecorator('companys', { | |
| 463 | - initialValue: companysId, | |
| 464 | - rules: [{ required: true, message: chooseBranchCompany }], | |
| 465 | - })(<Select placeholder={chooseBranchCompany} size="large" dropdownStyle={dropdownStyle} onSelect={this.handleSelect}>{options}</Select>)} | |
| 466 | - </div> | |
| 467 | - </FormItem> */} | |
| 459 | + | |
| 468 | 460 | </div> |
| 469 | 461 | <FormItem className={styles.loginBottom}> |
| 470 | 462 | <Button type="primary" htmlType="submit" className={styles.loginButton} loading={loginLoading}> |
| ... | ... | @@ -475,12 +467,12 @@ class LoginForm extends Component { |
| 475 | 467 | <div style={{ textAlign: "right", position: "relative" }}> |
| 476 | 468 | { ['project.xlyprint.cn', 'localhost'].includes(location.hostname) ? ( |
| 477 | 469 | <Button type="link" size="large" className={styles.userRegister} onClick={() => { this.setState({ userRegisterMode: true }); }}> |
| 478 | - 用户注册 | |
| 470 | + {btnRegister} | |
| 479 | 471 | </Button> |
| 480 | 472 | ) : "" } |
| 481 | 473 | <Radio.Group onChange={this.onLoginTypeChange} value={this.state.loginType} buttonStyle="solid"> |
| 482 | - <Radio.Button value="normal">普通登录</Radio.Button> | |
| 483 | - <Radio.Button value="face">扫脸登录</Radio.Button> | |
| 474 | + <Radio.Button value="normal">{btnLogin}</Radio.Button> | |
| 475 | + <Radio.Button value="face">{btnFaceLogin}</Radio.Button> | |
| 484 | 476 | </Radio.Group> |
| 485 | 477 | </div> |
| 486 | 478 | </Form> | ... | ... |