Commit f5d106174bd5264f09788a3784fa535e0a5a2e8d
1 parent
edd93ea6
1.处理MES 中文模块与英文模块 展示数量,顺序不一致问题
Showing
5 changed files
with
108 additions
and
33 deletions
src/components/Common/CommonHooks/useCommonBase.js
src/mes/common/buttonComponent/index.js
| ... | ... | @@ -104,14 +104,14 @@ const ButtonComponent = props => { |
| 104 | 104 | const newList = btnList |
| 105 | 105 | .filter( |
| 106 | 106 | item => |
| 107 | - item.sName && | |
| 107 | + item.sName?.trim() && | |
| 108 | 108 | !item.sName.includes("Modal") && |
| 109 | - item.sMenuName !== "工单物料信息" | |
| 109 | + ( item.sMenuName !== "工单物料信息" || item.sMenuName !== "Work Order Material Information") | |
| 110 | 110 | ) |
| 111 | 111 | .map(item => { |
| 112 | 112 | const { sId, sMenuName, sName } = item; |
| 113 | 113 | return { |
| 114 | - name: sMenuName, | |
| 114 | + name: sMenuName?.trim(), | |
| 115 | 115 | id: sId, |
| 116 | 116 | sName, |
| 117 | 117 | badeg: 0, |
| ... | ... | @@ -134,6 +134,27 @@ const ButtonComponent = props => { |
| 134 | 134 | }, |
| 135 | 135 | [JSON.stringify(managementData)] |
| 136 | 136 | ); |
| 137 | + const language = props.app.userinfo?.sLanguage; | |
| 138 | + | |
| 139 | + const menuOrderListEnglish1 = [ | |
| 140 | + ["Machine Task", 1], | |
| 141 | + null, | |
| 142 | + ["Label Reprint", 2], | |
| 143 | + null, | |
| 144 | + ["Work Order Information", 2, 'Label Reprint'], | |
| 145 | + ["Product Quality Record", 3, 'Label Reprint'], | |
| 146 | + ["Process Work Instructions", 4, 'Label Reprint'], | |
| 147 | + ["Related Documents", 5, 'Label Reprint'], | |
| 148 | + ["Historical Tasks", 6, 'Label Reprint'], | |
| 149 | + ["Production Rework", 2, 'Label Reprint'], | |
| 150 | + null, | |
| 151 | + null, | |
| 152 | + // ["工单物料信息", 7], | |
| 153 | + ["Pre-production Reminder Information", 7, 'Label Reprint'], | |
| 154 | + ["Work Order WIP List", 8, 'Label Reprint'], | |
| 155 | + null, | |
| 156 | + null | |
| 157 | + ]; | |
| 137 | 158 | |
| 138 | 159 | const menuOrderList1 = [ |
| 139 | 160 | ["机台任务", 1], |
| ... | ... | @@ -174,6 +195,25 @@ const ButtonComponent = props => { |
| 174 | 195 | ["工艺巡检", 20] |
| 175 | 196 | ]; |
| 176 | 197 | |
| 198 | + const menuOrderListEnglish2 = [ | |
| 199 | + ["Production Execution", 10], | |
| 200 | + ["First Approval Sample Notice", 11], | |
| 201 | + ["Exception/Assistance Reporting", 12], | |
| 202 | + ["Completion & Clearance", 13], | |
| 203 | + ["Plate Splitting/Combining", 14], | |
| 204 | + null, | |
| 205 | + null, | |
| 206 | + ["Quality Patrol Inspection List", 15], | |
| 207 | + ["Team Production Reporting", 16], | |
| 208 | + ["Sign-off/Completion", 17], | |
| 209 | + ["Team Handover", 18], | |
| 210 | + ["Work Order Change Information", 19], | |
| 211 | + ["Other Machine Daily Report", 16], | |
| 212 | + null, | |
| 213 | + null, | |
| 214 | + ["Process Inspection", 20] | |
| 215 | + ]; | |
| 216 | + | |
| 177 | 217 | const menuOrderList3 = [ |
| 178 | 218 | ["设备保养", 21], |
| 179 | 219 | ["设备点检", 22], |
| ... | ... | @@ -181,17 +221,30 @@ const ButtonComponent = props => { |
| 181 | 221 | ["设备资料", 24] |
| 182 | 222 | ]; |
| 183 | 223 | |
| 224 | + const menuOrderListEnglish3 = [ | |
| 225 | + ["Equipment Maintenance", 21], | |
| 226 | + ["Equipment Check", 22], | |
| 227 | + ["Equipment Repair", 23], | |
| 228 | + ["Equipment Documentation", 24] | |
| 229 | + ]; | |
| 230 | + | |
| 231 | + const menuOrderListLocal1 = language === 'sEnglish' ? menuOrderListEnglish1 : menuOrderList1; | |
| 232 | + | |
| 233 | + const menuOrderListLocal2 = language === 'sEnglish' ? menuOrderListEnglish2 : menuOrderList2; | |
| 234 | + | |
| 235 | + const menuOrderListLocal3 = language === 'sEnglish' ? menuOrderListEnglish3 : menuOrderList3; | |
| 236 | + | |
| 184 | 237 | const menuList = []; |
| 185 | 238 | new Array(16).fill("").forEach((_, index) => { |
| 186 | 239 | const itemName = [ |
| 187 | - menuOrderList1[index]?.[0], | |
| 188 | - menuOrderList2[index]?.[0], | |
| 189 | - menuOrderList3[index]?.[0] | |
| 240 | + menuOrderListLocal1[index]?.[0], | |
| 241 | + menuOrderListLocal2[index]?.[0], | |
| 242 | + menuOrderListLocal3[index]?.[0] | |
| 190 | 243 | ]; |
| 191 | 244 | const icon = [ |
| 192 | - menuOrderList1[index]?.[1], | |
| 193 | - menuOrderList2[index]?.[1], | |
| 194 | - menuOrderList3[index]?.[1] | |
| 245 | + menuOrderListLocal1[index]?.[1], | |
| 246 | + menuOrderListLocal2[index]?.[1], | |
| 247 | + menuOrderListLocal3[index]?.[1] | |
| 195 | 248 | ]; |
| 196 | 249 | const item = dataList.find(item => itemName.includes(item.name)); |
| 197 | 250 | let result = ""; |
| ... | ... | @@ -217,7 +270,7 @@ const ButtonComponent = props => { |
| 217 | 270 | const { id, disabled, sName } = e; |
| 218 | 271 | if (id == sModelsId || disabled) return; |
| 219 | 272 | |
| 220 | - if (e.name !== "首签样通知") { | |
| 273 | + if (e.name !== "首签样通知" || e.name !== "First Approval Sample Notice") { | |
| 221 | 274 | props.onChangeRouter({ |
| 222 | 275 | routerPath: [currentContent], |
| 223 | 276 | sModelsId: id, |
| ... | ... | @@ -243,7 +296,9 @@ const ButtonComponent = props => { |
| 243 | 296 | |
| 244 | 297 | let bHideTab = false; |
| 245 | 298 | // 【踢废,拼接,倒卷,读码】完工清场记录不可点击 |
| 246 | - if ([5, 6, 7, 8].includes(iInterface) && e.name === "完工清场/确认") { | |
| 299 | + if ([5, 6, 7, 8].includes(iInterface) && ( | |
| 300 | + e.name === "完工清场/确认" || e.name ==='Post-Completion Clearance/Confirmation' | |
| 301 | + )) { | |
| 247 | 302 | bHideTab = true; |
| 248 | 303 | } |
| 249 | 304 | |
| ... | ... | @@ -253,7 +308,8 @@ const ButtonComponent = props => { |
| 253 | 308 | if ( |
| 254 | 309 | props.currentContent === "productionExec" && |
| 255 | 310 | !bStartWork && |
| 256 | - !["生产执行", "班组报工", "其它机台日报"].includes(e.name) | |
| 311 | + ( !["生产执行", "班组报工", "其它机台日报"].includes(e.name) || | |
| 312 | + !["Production Execution", "Team Production Reporting ", "Other Machine Daily Report"].includes(e.name) ) | |
| 257 | 313 | ) { |
| 258 | 314 | bStartWorkLimit = true; |
| 259 | 315 | } |
| ... | ... | @@ -265,13 +321,13 @@ const ButtonComponent = props => { |
| 265 | 321 | } |
| 266 | 322 | |
| 267 | 323 | let count = e.disabled ? 0 : e.badeg; |
| 268 | - if (e.name === "机台任务") { | |
| 324 | + if (e.name === "机台任务" || e.name ==='Machine Task') { | |
| 269 | 325 | count = table0; |
| 270 | - } else if (e.name === "历史任务") { | |
| 326 | + } else if (e.name === "历史任务" || e.name ==='Historical Tasks') { | |
| 271 | 327 | count = table1; |
| 272 | - } else if (e.name === "工序任务") { | |
| 328 | + } else if (e.name === "工序任务" || e.name ==='Process Task') { | |
| 273 | 329 | count = table2; |
| 274 | - } else if (e.name === "其它机台日报") { | |
| 330 | + } else if (e.name === "其它机台日报" || e.name === "Other Machine Daily Report") { | |
| 275 | 331 | count = table3; |
| 276 | 332 | } |
| 277 | 333 | const workFirst = commonFunc.showLocalMessage(props, 'workFirst', '请先上班后再操作'); |
| ... | ... | @@ -327,7 +383,7 @@ const ButtonComponent = props => { |
| 327 | 383 | </div> |
| 328 | 384 | ); |
| 329 | 385 | }; |
| 330 | - console.log(menuList, '1menuList '); | |
| 386 | + console.log(menuList, '1menuLis111t '); | |
| 331 | 387 | return ( |
| 332 | 388 | <div |
| 333 | 389 | className={`${styles.buttonComponent} ${ | ... | ... |
src/mes/common/buttonComponent/index.less
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | @total-height: 130px; |
| 4 | 4 | @btns-height: 130px; |
| 5 | -@specialBtns-height: 65px; | |
| 5 | +@specialBtns-height: 128px; | |
| 6 | 6 | @btns-item-bgColor: #d2e5ff; |
| 7 | 7 | |
| 8 | 8 | .buttonComponent { |
| ... | ... | @@ -170,4 +170,4 @@ |
| 170 | 170 | .flex(center, center); |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | -} | |
| 174 | 173 | \ No newline at end of file |
| 174 | +} | ... | ... |
src/mes/common/commonModelComponent/index.js
| ... | ... | @@ -1215,6 +1215,7 @@ const CommonModelComponent = props => { |
| 1215 | 1215 | const { tabConfig = [], level, modelStyle, app } = props; |
| 1216 | 1216 | const { userinfo } = app; |
| 1217 | 1217 | const sLanguage = userinfo.sLanguage; |
| 1218 | + console.log('vvv', sLanguage); | |
| 1218 | 1219 | const getComponent = (config, index = 0) => { |
| 1219 | 1220 | const { |
| 1220 | 1221 | sName, |
| ... | ... | @@ -1280,11 +1281,13 @@ const CommonModelComponent = props => { |
| 1280 | 1281 | sEntireTabName, |
| 1281 | 1282 | sEnglishEntireTabName, |
| 1282 | 1283 | sBig5EntireTabName, |
| 1284 | + sEnglishTabName, | |
| 1283 | 1285 | mode, |
| 1284 | 1286 | width = "100%", |
| 1285 | 1287 | height = "100%" |
| 1286 | 1288 | } = item; |
| 1287 | - const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName : | |
| 1289 | + console.log('ssconfigLists', configList); | |
| 1290 | + const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName + '1111' : | |
| 1288 | 1291 | sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName; |
| 1289 | 1292 | const advancedStyle = |
| 1290 | 1293 | mode === "advanced" |
| ... | ... | @@ -1381,10 +1384,13 @@ const CommonModelComponent = props => { |
| 1381 | 1384 | ) |
| 1382 | 1385 | .map((config, index) => { |
| 1383 | 1386 | const { sName, sEnglishTabName, sBig5TabName, sTabName } = config; |
| 1384 | - const sTabNewName = sLanguage ==='sEnglish' ? sEnglishTabName : sLanguage ==='sBig5' ? | |
| 1387 | + console.log('32323', config, sLanguage); | |
| 1388 | + const sTabNewName = sLanguage === 'sEnglish' ? sEnglishTabName : sLanguage ==='sBig5' ? | |
| 1385 | 1389 | sBig5TabName : sTabName; |
| 1386 | 1390 | let disabled = false; |
| 1387 | 1391 | |
| 1392 | + console.log('32323', sTabNewName); | |
| 1393 | + | |
| 1388 | 1394 | if (sTabName === "拼接列表" && sName === "slaveWypj3") { |
| 1389 | 1395 | // 特殊处理:拼接详情可保存时,拼接列表tab不可点击 |
| 1390 | 1396 | disabled = |
| ... | ... | @@ -1476,7 +1482,7 @@ const TabTitleComponent = props => { |
| 1476 | 1482 | |
| 1477 | 1483 | // 表单组件 |
| 1478 | 1484 | const CommonViewTableComponent = props => { |
| 1479 | - const { sTabName, showType, sName } = props; | |
| 1485 | + const { sTabName, showType, sName, sEnglishTabName, } = props; | |
| 1480 | 1486 | if (showType !== "form") return ""; |
| 1481 | 1487 | |
| 1482 | 1488 | const { |
| ... | ... | @@ -1551,7 +1557,11 @@ const CommonViewTableComponent = props => { |
| 1551 | 1557 | } |
| 1552 | 1558 | } |
| 1553 | 1559 | |
| 1554 | - const groupList = sTabName.split(","); | |
| 1560 | + const sLanguage = props.app.userinfo?.sLanguage; | |
| 1561 | + | |
| 1562 | + const sTabLocalName = sLanguage === 'sEnglish' ? sEnglishTabName : sTabName; | |
| 1563 | + | |
| 1564 | + const groupList = sTabLocalName?.split(",") || []; | |
| 1555 | 1565 | const viewConfigsList = groupList.map((tabName, index) => { |
| 1556 | 1566 | if (tabName === "隐藏") { |
| 1557 | 1567 | return []; | ... | ... |
src/mes/scheduledTasks/machineTasks/index.js
| ... | ... | @@ -340,17 +340,24 @@ |
| 340 | 340 | }; |
| 341 | 341 | |
| 342 | 342 | const itemClickRef = useRef(); |
| 343 | + const finishConstruction = commonFunc.showLocalMessage(props, 'finishConstruction', '完工'); | |
| 343 | 344 | |
| 345 | + const confirmCompletion = commonFunc.showLocalMessage(props, 'confirmCompletion', '确认完工'); | |
| 346 | + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); | |
| 347 | + const btnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); | |
| 348 | + const btnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); | |
| 349 | + const pause = commonFunc.showLocalMessage(props, 'pause', '暂停'); | |
| 350 | + const pausingReason = commonFunc.showLocalMessage(props, 'pausingReason', '请选择暂停原因'); | |
| 344 | 351 | // 开工、暂停事件 |
| 345 | 352 | const handleTableBtnClick = async item => { |
| 346 | 353 | const { tableName, index, record, tableData, config, iFlag } = item; |
| 347 | - const { showName } = config; | |
| 348 | - if (showName === "完工") { | |
| 354 | + const { showName, sChinese } = config; | |
| 355 | + if (sChinese === "完工") { | |
| 349 | 356 | Modal.confirm({ |
| 350 | - title: "温馨提示:", | |
| 351 | - content: <div>确认完工?</div>, | |
| 352 | - okText: "确认", | |
| 353 | - cancelText: "取消", | |
| 357 | + title: FriendlyReminder, | |
| 358 | + content: <div>{confirmCompletion}?</div>, | |
| 359 | + okText: btnSure, | |
| 360 | + cancelText: btnCancel, | |
| 354 | 361 | onOk() { |
| 355 | 362 | handleUpdateProductionplan({ item, iFlag: 4 }); |
| 356 | 363 | } |
| ... | ... | @@ -365,10 +372,10 @@ |
| 365 | 372 | if (tableData.length === 1) { |
| 366 | 373 | const result = await new Promise(resolve => { |
| 367 | 374 | Modal.confirm({ |
| 368 | - title: "温馨提示:", | |
| 375 | + title: FriendlyReminder, | |
| 369 | 376 | content: <div>请选择要变更的状态</div>, |
| 370 | - okText: "完工", | |
| 371 | - cancelText: "暂停", | |
| 377 | + okText: finishConstruction, | |
| 378 | + cancelText: pause, | |
| 372 | 379 | onOk() { |
| 373 | 380 | resolve(true); |
| 374 | 381 | }, |
| ... | ... | @@ -387,7 +394,7 @@ |
| 387 | 394 | // 开工中,走暂停接口 |
| 388 | 395 | props.onSaveState({ |
| 389 | 396 | taskConfirmModalVisible: true, |
| 390 | - taskConfirmModalMsg: "请选择暂停原因", | |
| 397 | + taskConfirmModalMsg: pausingReason, | |
| 391 | 398 | tempTaskId: record.sId, |
| 392 | 399 | bPauseOnly: true, |
| 393 | 400 | pauseCallback: pauseValue => { | ... | ... |