Commit 2b0ac33db3da4de2741eb49433ed44d555aea0a5
1 parent
28c7a86c
1.处理保存校验多语言
Showing
1 changed file
with
6 additions
and
1 deletions
src/components/Manufacture/WorkOrderPack/WorkOrderResearchTableTree.js
| @@ -1524,8 +1524,12 @@ class WorkOrderPack extends Component { | @@ -1524,8 +1524,12 @@ class WorkOrderPack extends Component { | ||
| 1524 | /* 验证通过与不通过走不同的流程 */ | 1524 | /* 验证通过与不通过走不同的流程 */ |
| 1525 | if (err) { /* 验证失败 */ | 1525 | if (err) { /* 验证失败 */ |
| 1526 | /* 直接渲染显示错误提示 */ | 1526 | /* 直接渲染显示错误提示 */ |
| 1527 | + const language = this.props?.app?.userinfo?.sLanguage || 'sChinese'; // 默认简体中文 | ||
| 1528 | + const requiredText = language === 'sEnglish' ? 'is Required' : | ||
| 1529 | + (language === 'sBig5' ? '為必填項' : '为必填项'); | ||
| 1527 | for (const key of Object.keys(err)) { | 1530 | for (const key of Object.keys(err)) { |
| 1528 | - message.warning(err[key].errors[0].message); | 1531 | + const sContent = err[key].errors[0].message?.replace('为必填项', requiredText); |
| 1532 | + message.warning(sContent); | ||
| 1529 | } | 1533 | } |
| 1530 | this.props.onSaveState({ | 1534 | this.props.onSaveState({ |
| 1531 | loading: false, | 1535 | loading: false, |
| @@ -1543,6 +1547,7 @@ class WorkOrderPack extends Component { | @@ -1543,6 +1547,7 @@ class WorkOrderPack extends Component { | ||
| 1543 | }); | 1547 | }); |
| 1544 | return; | 1548 | return; |
| 1545 | } | 1549 | } |
| 1550 | + console.log('3332', 1111); | ||
| 1546 | if (!commonBusiness.validateTable(slaveConfig, slaveData, this.props) || !commonBusiness.validateTable(controlConfig, controlData, this.props) || | 1551 | if (!commonBusiness.validateTable(slaveConfig, slaveData, this.props) || !commonBusiness.validateTable(controlConfig, controlData, this.props) || |
| 1547 | (!commonBusiness.validateTable(materialsConfig, materialsData, this.props)) || !commonBusiness.validateTable(processConfig, processData, this.props) || | 1552 | (!commonBusiness.validateTable(materialsConfig, materialsData, this.props)) || !commonBusiness.validateTable(processConfig, processData, this.props) || |
| 1548 | !commonBusiness.validateTable(colorConfig, colorData, this.props)) { | 1553 | !commonBusiness.validateTable(colorConfig, colorData, this.props)) { |