diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 1302953..eb97465 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -1,6 +1,7 @@ import moment from 'moment'; import React, { Component, createRef } from 'react'; import reactComponentDebounce from '@/components/Common/ReactDebounce'; +import * as commonFunc from '@/components/Common//commonFunc';/* 通用单据方法 */ /* 通用单据方法 */ // import '@ant-design/compatible/assets/index.css'; import { InputNumber, @@ -1010,10 +1011,14 @@ export default class CommonComponent extends Component { }; getSearchProps = () => { + let chooseTitle = '选择'; + if(commonUtils.isNotEmptyObject(this.props.app) && commonUtils.isNotEmptyObject(this.props.app.commonConst)) { + chooseTitle = commonFunc.showMessage(this.props.app.commonConst, 'choose') ; + } const obj = { onKeyDown: this.onKeyDown, onChange: e => this.handleSelectOptionEvent(e.target.value), /* 数据改变回带到父组件 */ - value: commonUtils.isUndefined(this.state.dataValue) ? '选择' : commonUtils.strUndefinedToEmpty(this.state.dataValue), /* 数据值 */ + value: commonUtils.isUndefined(this.state.dataValue) ? chooseTitle : commonUtils.strUndefinedToEmpty(this.state.dataValue), /* 数据值 */ }; return obj; } @@ -1113,6 +1118,10 @@ export default class CommonComponent extends Component { const { sTableTitleSql, iVisCount, sName, sDateFormat, } = this.props.showConfig; + let chooseTitle = '选择'; + if(commonUtils.isNotEmptyObject(this.props.app) && commonUtils.isNotEmptyObject(this.props.app.commonConst)) { + chooseTitle = commonFunc.showMessage(this.props.app.commonConst, 'choose') ; + } if (commonUtils.isNotEmptyStr(sTableTitleSql) && iVisCount > 1) { return ; } @@ -1251,7 +1260,7 @@ export default class CommonComponent extends Component { return ; } } else if (this.state.enabled && commonUtils.isNotEmptyObject(this.props.showConfig.sName) && this.props.showConfig.sDropDownType === 'popup') { /* 通用弹窗 */ - return (); + return (); } else if (this.firstDataIndex === 'i' || this.firstDataIndex === 'd') { /* 数字输入框(整形i和浮点型d) */ return innerInputProps.readOnly ? : location.pathname.includes('quotationPackTableTree') && this.props.name === 'control' && this.props.showConfig.sName === 'dSinglePQty' ? : ; diff --git a/src/components/Common/CommonListSelectTree/index.js b/src/components/Common/CommonListSelectTree/index.js index 4032e6e..52a4ec1 100644 --- a/src/components/Common/CommonListSelectTree/index.js +++ b/src/components/Common/CommonListSelectTree/index.js @@ -627,7 +627,8 @@ const CommonListComponent = Form.create({ enabled: true, }; } - + const BtnSure =commonFunc.showMessage(app.commonConst, 'BtnSure') || '确认'; + const BtnCancel =commonFunc.showMessage(app.commonConst, 'BtnCancel') || '取消'; if (commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.name) && app.currentPane.bEdit) { tableFilterProps = { ...tableFilterProps, @@ -747,8 +748,8 @@ const CommonListComponent = Form.create({ width: '50%', textAlign: 'right', marginRight: '9px', marginBottom: '9px', }} > - - + + diff --git a/src/components/Common/CommonListTreeSelect/index.js b/src/components/Common/CommonListTreeSelect/index.js index 9e9be41..752acea 100644 --- a/src/components/Common/CommonListTreeSelect/index.js +++ b/src/components/Common/CommonListTreeSelect/index.js @@ -534,7 +534,10 @@ const CommonListComponent = Form.create({ rowSelection: props.rowSelection, }; } - + + const BtnSure =commonFunc.showMessage(app.commonConst, 'BtnSure') || '确认'; + const BtnCancel =commonFunc.showMessage(app.commonConst, 'BtnCancel') || '取消'; + const realizeHeight = commonUtils.isNotEmptyNumber(props.realizeHeight) ? props.realizeHeight : 0; const btnClick = (btn) => { const { sControlName } = btn; @@ -566,7 +569,7 @@ const CommonListComponent = Form.create({ }; return ( -
+
@@ -609,8 +612,8 @@ const CommonListComponent = Form.create({ }
- - + +
: '' } diff --git a/src/components/Common/CommonView/index.js b/src/components/Common/CommonView/index.js index 7a35b3f..35597c8 100644 --- a/src/components/Common/CommonView/index.js +++ b/src/components/Common/CommonView/index.js @@ -9,6 +9,7 @@ import ShowType from '@/components/Common/CommonComponent'; import AntdDraggableModal from '@/components/Common/AntdDraggableModal'; import CommonListSelectTree from '@/components/Common/CommonListSelectTree'; import * as commonUtils from '@/utils/utils';/* 通用方法 */ +import * as commonFunc from '@/components/Common/commonFunc';/* 单据业务功能 */ const FormItem = Form.Item; // const EachInputHeight = 32; @@ -291,6 +292,8 @@ export default class CommonView extends Component { expanded: true, }); } + const afterSave = commonFunc.showMessage(this.props.app.commonConst, 'afterSave') || + '保存后自动生成';/* 保存后自动生成 */ return ( @@ -475,7 +478,7 @@ export default class CommonView extends Component { ].includes(child.sName) ) ? - {sModelsType !== 'smg/sendMailMsg' ? '保存后自动生成' : '发送消息无需生成单据号'} + {sModelsType !== 'smg/sendMailMsg' ? afterSave : afterSave} : '' } ); diff --git a/src/components/Common/PersonCenter/PersonCenter.js b/src/components/Common/PersonCenter/PersonCenter.js index 627826c..92ee6a1 100644 --- a/src/components/Common/PersonCenter/PersonCenter.js +++ b/src/components/Common/PersonCenter/PersonCenter.js @@ -862,6 +862,8 @@ const PersonCenterOnlineUser = Form.create({ app, } = props; const { userinfo } = app; + const BtnSure =commonFunc.showMessage(app.commonConst, 'BtnSure') || '确认'; + const BtnCancel =commonFunc.showMessage(app.commonConst, 'BtnCancel') || '取消'; const OnlineUsers = commonFunc.showMessage(props.app.commonConst, 'OnlineUsers');/* 在线用户 */ const Website = commonFunc.showMessage(props.app.commonConst, 'Website');/* 站点数 */ @@ -937,39 +939,36 @@ const PersonCenterOnlineUser = Form.create({ const title = `${OnlineUserName}${commonUtils.isNotEmptyObject(onlineUserDataNew) ? `【 ${Website}:${onlineUserDataNew.consumerCount}\xa0\xa0\xa0\xa0\xa0${ExpirationDate}:${onlineUserDataNew.afterTime}` : ''} 】`; return (
- { - onlineUserVisible ? - +
{ + if (ref) { + ref.querySelector(".ant-table-container").style.height = tableHeight + "px"; + ref.querySelector(".ant-table-body").style.height = tableHeight - 30 + "px"; + // ref.querySelectorAll('.ant-table-cell-fix-right').forEach(item => { + // if (item.previousSibling) { + // item.previousSibling.style.display = 'none'; + // } + // }); + } + }} > -
{ - if (ref) { - ref.querySelector('.ant-table-container').style.height = tableHeight + 'px'; - ref.querySelector('.ant-table-body').style.height = tableHeight - 30 + 'px'; - // ref.querySelectorAll('.ant-table-cell-fix-right').forEach(item => { - // if (item.previousSibling) { - // item.previousSibling.style.display = 'none'; - // } - // }); - } - }} - > - -
-
- - -
- - : '' - } + +
+
+ + +
+
+ ) : ( + "" + )}
); }); diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index b2d244f..2095272 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -23,6 +23,8 @@ import imgCheckingEnglish from '../../assets/hasChecking_english.png'; /* 审核 import imgCheckPerson from '../../assets/personChecked1.png'; /* 审核中 */ import imgSubmit from '../../assets/haveSubmited.svg'; /* 已提交 */ +import imgSubmitBig5 from '../../assets/haveSubmit_sBig5.png'; /* 审核中-繁体 */ +import imgSubmitEnglish from '../../assets/haveSubmit_english.png'; /* 审核中-英文 */ import { cloneDeep } from 'lodash'; // ----------------------------------------------------------------------- @@ -174,7 +176,7 @@ export function handleAddIcon(masterData, sModelsType, app = {}) { } else if (sStatus === '2') { imgSrc = isEnglish ? imgCheckingEnglish : (isTraditionalChinese ? imgCheckingBig5 : imgChecking); } else if (bSubmit) { - imgSrc = imgSubmit; + imgSrc = isEnglish ? imgSubmitEnglish : (isTraditionalChinese ? imgSubmitBig5 : imgSubmit); } } return imgSrc; diff --git a/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js b/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js index aa588b7..722b3f1 100644 --- a/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js +++ b/src/components/Manufacture/ProcessCardPackTableTreeNew/index.js @@ -3581,7 +3581,7 @@ const ToolBarComponent = props => { // 审核状态 const AvatarComponent = props => { - const { masterData, sModelsType, app } = this.props; + const { masterData, sModelsType, app } = props; const imgSrc = commonBusiness.handleAddIcon(masterData, sModelsType, app); if (!imgSrc) return ""; return ( diff --git a/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js b/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js index 955aff5..a9b360d 100644 --- a/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js +++ b/src/components/Manufacture/WorkOrderPackTableTreeNew/index.js @@ -4048,7 +4048,7 @@ const ToolBarComponent = props => { // 审核状态 const AvatarComponent = props => { - const { masterData, sModelsType, app } = this.props; + const { masterData, sModelsType, app } = props; const imgSrc = commonBusiness.handleAddIcon(masterData, sModelsType, app); if (!imgSrc) return ""; return ( diff --git a/src/utils/common/message.js b/src/utils/common/message.js index e02e027..17d76f7 100644 --- a/src/utils/common/message.js +++ b/src/utils/common/message.js @@ -1,6 +1,7 @@ /* eslint-disable */ import { Modal, message as antdMessage } from 'antd-v4'; import { Modal as mobileModal } from 'antd-mobile-v2'; +import commonConfig from '../config'; const { warning } = Modal; const antdMobileAlert = mobileModal.alert; @@ -24,15 +25,22 @@ const openConfirm = (config) => { }; const fn = () => { + const userinfo = JSON.parse(localStorage.getItem(`${commonConfig.prefix}userinfo`)) || {}; + const language = userinfo.sLanguage || 'sChinese'; // 默认简体中文 + const isEnglish = language === 'sEnglish'; + + // 使用语言设置 + const sTitle = isEnglish ? 'Reminder' : language === 'sBig5' ? '溫馨提示' : '温馨提示'; + const okText = language === 'sEnglish' ? 'Confirm' : language === 'sBig5' ? '確認': '确认'; if (location.pathname.toLocaleLowerCase().includes('mobile')) { - antdMobileAlert('温馨提示', secondContent || '出错了', [ + antdMobileAlert(sTitle, secondContent || '出错了', [ { text: '确认', }, ]) } else { warning({ - title: '温馨提示', + title: sTitle, content:
{secondContent || '出错了'}
, - okText: '确认', + okText: okText, zIndex: 1000, width, ...rest, @@ -52,6 +60,11 @@ const openConfirm = (config) => { export const message = { ...antdMessage, error: (content, ...rest) => { - openConfirm({ message: content, ...rest }); + const userinfo = JSON.parse(localStorage.getItem(`${commonConfig.prefix}userinfo`)) || {}; + const language = userinfo.sLanguage || 'sChinese'; // 默认简体中文 + const requiredText = language === 'sEnglish' ? 'is Required' : + (language === 'sBig5' ? '為必填項' : '为必填项'); + const sContent = content?.replace('为必填项', requiredText); + openConfirm({ message: sContent, ...rest }); }, };