Commit e2294523ff4d5a77fea588788eb5f0132dc9018e
1 parent
f57bc259
登录缓存
Showing
6 changed files
with
145 additions
and
94 deletions
package.json
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -271,7 +271,7 @@ export default class CommonComponent extends Component { |
| 271 | 271 | const { sOnChangeInstruct } = this.props.showConfig; |
| 272 | 272 | const sInstruct = commonUtils.convertStrToObj(sOnChangeInstruct, {}); |
| 273 | 273 | if (sInstruct.blur) { |
| 274 | - this.props.app.globalFun.onSetMask(true); | |
| 274 | + this.props.app?.globalFun?.onSetMask(true); | |
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | clearTimeout(this.leaveTimer); |
| ... | ... | @@ -310,7 +310,7 @@ export default class CommonComponent extends Component { |
| 310 | 310 | onBlurText = (event, timeout = 0) => { |
| 311 | 311 | const currentValue = event?.target?.value; |
| 312 | 312 | if (currentValue == this.lastValue) { |
| 313 | - this.props.app.globalFun?.onSetMask(false); | |
| 313 | + this.props.app?.globalFun?.onSetMask(false); | |
| 314 | 314 | return; |
| 315 | 315 | } |
| 316 | 316 | if (this.onExecInstructSet('blur')) { |
| ... | ... | @@ -1649,6 +1649,7 @@ export default class CommonComponent extends Component { |
| 1649 | 1649 | if (this.props.bPassWord) { |
| 1650 | 1650 | obj.type = 'password'; /* 文本密码类型 */ |
| 1651 | 1651 | obj.autocomplete = 'off'; /* 禁止浏览器自动填充到表单 */ |
| 1652 | + obj.value = this.props.dataValue | |
| 1652 | 1653 | } |
| 1653 | 1654 | /* 最大值最小值 */ |
| 1654 | 1655 | if (typeof commonUtils.convertStrToNumber(this.max) === 'number' && commonUtils.convertStrToNumber(this.max) !== 0 && this.max.indexOf('.d') === -1 && this.max.indexOf('.i') === -1) { |
| ... | ... | @@ -2958,10 +2959,10 @@ export default class CommonComponent extends Component { |
| 2958 | 2959 | } |
| 2959 | 2960 | /* 获取outformitem控件参数 */ |
| 2960 | 2961 | const outFormItemProps = this.getOutFormItemProps(); |
| 2962 | + | |
| 2961 | 2963 | /* 获取fieldDecorator参数 */ |
| 2962 | 2964 | const fieldDecoratorProps = this.getFieldDecoratorProps(); |
| 2963 | 2965 | /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */ |
| 2964 | - | |
| 2965 | 2966 | const commonAssembly = this.props.bNewForm ? innerInput: ( |
| 2966 | 2967 | <FormItem {...outFormItemProps}> |
| 2967 | 2968 | {viewInfo} | ... | ... |
src/mes/common/commonOperationBarComponent/MesToolbar.js
| 1 | +/* eslint-disable */ | |
| 1 | 2 | import { message } from "antd"; |
| 2 | 3 | import * as commonUtils from "@/utils/utils"; |
| 3 | 4 | |
| ... | ... | @@ -46,21 +47,32 @@ const handleAdd = (props) => { |
| 46 | 47 | return result; |
| 47 | 48 | }, []); |
| 48 | 49 | |
| 49 | - const menu = menuList.find(item => item.sId === sActiveId); | |
| 50 | - if (!menu) { | |
| 51 | - message.error('弹窗界面不在MES菜单中'); | |
| 52 | - return; | |
| 53 | - } | |
| 54 | - | |
| 55 | - app.globalFun.onChangeRouter({ | |
| 56 | - type: "id", | |
| 57 | - path: [menu.sParentId, menu.sId], | |
| 58 | - sModelType: menu.sName, | |
| 59 | - // sParentConditions, | |
| 60 | - copyTo: { | |
| 61 | - master: { maxBillNo: 'sBillNo' } | |
| 50 | + // const menu = menuList.find(item => item.sId === sActiveId); | |
| 51 | + // if (!menu) { | |
| 52 | + // message.error('弹窗界面不在MES菜单中'); | |
| 53 | + // return; | |
| 54 | + // } | |
| 55 | + props.onOpenCommonModal({ | |
| 56 | + type: "commonModal", | |
| 57 | + sActiveId, | |
| 58 | + title: props?.btnConfig?.showName, | |
| 59 | + parentProps: props, | |
| 60 | + onOk: data => { | |
| 61 | + window.debugger && console.log("=====onOk", data); | |
| 62 | + }, | |
| 63 | + onCancel: () => { | |
| 64 | + window.debugger && console.log("=====onCancel"); | |
| 62 | 65 | } |
| 63 | 66 | }); |
| 67 | + // app.globalFun.onChangeRouter({ | |
| 68 | + // type: "id", | |
| 69 | + // path: [menu.sParentId, menu.sId], | |
| 70 | + // sModelType: menu.sName, | |
| 71 | + // // sParentConditions, | |
| 72 | + // copyTo: { | |
| 73 | + // master: { maxBillNo: 'sBillNo' } | |
| 74 | + // } | |
| 75 | + // }); | |
| 64 | 76 | } |
| 65 | 77 | |
| 66 | 78 | // 保存 | ... | ... |
src/mes/common/routerComponent/index.js
src/mes/indexMes/index.js
| ... | ... | @@ -103,12 +103,11 @@ const OpenModalEditPwd = props => { |
| 103 | 103 | const oldPassword = commonFunc.showLocalMessage(props, 'oldPassword', '请输入原密码'); |
| 104 | 104 | const newPassword = commonFunc.showLocalMessage(props, 'newPassword', '请输入新密码'); |
| 105 | 105 | const passswordAgain = commonFunc.showLocalMessage(props, 'passswordAgain', '请再次输入密码'); |
| 106 | - const ModifyPassword = commonFunc.showLocalMessage(props, 'ModifyPassword','修改密码');/* 修改 */ | |
| 106 | + const ModifyPassword = commonFunc.showLocalMessage(props, 'ModifyPassword', '修改密码');/* 修改 */ | |
| 107 | 107 | // 确认修改密码 |
| 108 | 108 | const handleOk = () => { |
| 109 | - const url = `${ | |
| 110 | - commonConfig.server_host | |
| 111 | - }sftlogininfo/updatePasswordUserName/update?sModelsId=${100}`; | |
| 109 | + const url = `${commonConfig.server_host | |
| 110 | + }sftlogininfo/updatePasswordUserName/update?sModelsId=${100}`; | |
| 112 | 111 | props.dispatch({ |
| 113 | 112 | type: "app/editPwd", |
| 114 | 113 | payload: { |
| ... | ... | @@ -411,7 +410,6 @@ const IndexMes = baseProps => { |
| 411 | 410 | const handleColseOee = () => { |
| 412 | 411 | const { app, sModelsId } = props; |
| 413 | 412 | const { sId } = app.userinfo; |
| 414 | - | |
| 415 | 413 | const iPlcNo = commonUtils.isNotEmptyObject(app.iPlcNo) |
| 416 | 414 | ? commonUtils.convertStrToNumber(app.iPlcNo) |
| 417 | 415 | : 0; |
| ... | ... | @@ -442,9 +440,8 @@ const IndexMes = baseProps => { |
| 442 | 440 | token, |
| 443 | 441 | sModelsId |
| 444 | 442 | ) => { |
| 445 | - const url = `${ | |
| 446 | - commonConfig.server_host | |
| 447 | - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | |
| 443 | + const url = `${commonConfig.server_host | |
| 444 | + }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | |
| 448 | 445 | const returnData = (await commonServices.postValueService( |
| 449 | 446 | token, |
| 450 | 447 | value, |
| ... | ... | @@ -461,16 +458,16 @@ const IndexMes = baseProps => { |
| 461 | 458 | }; |
| 462 | 459 | const currentLanguage = props?.app?.userinfo?.sLanguage || 'zhCN'; // 默认为中文 |
| 463 | 460 | const getLocale = () => { |
| 464 | - switch(currentLanguage) { | |
| 461 | + switch (currentLanguage) { | |
| 465 | 462 | case 'sEnglish': |
| 466 | 463 | return enUS; |
| 467 | 464 | case 'sBig5': |
| 468 | 465 | return zhTW; |
| 469 | 466 | default: |
| 470 | - { | |
| 471 | - moment.locale('zh-cn'); | |
| 472 | - return zhCN; | |
| 473 | - } | |
| 467 | + { | |
| 468 | + moment.locale('zh-cn'); | |
| 469 | + return zhCN; | |
| 470 | + } | |
| 474 | 471 | } |
| 475 | 472 | }; |
| 476 | 473 | const bExsitLogin = commonFunc.showLocalMessage(props, 'bExsitLogin', '是否退出登录'); |
| ... | ... | @@ -522,7 +519,7 @@ const HeaderConponent = () => { |
| 522 | 519 | const { sUserNameBak: sUserName, sShift } = userinfo; |
| 523 | 520 | const sLanguage = userinfo.sLanguage; |
| 524 | 521 | let weekday = ["日", "一", "二", "三", "四", "五", "六"]; |
| 525 | - const sunTitle = sLanguage ==='sChinese' ? '星期' : ''; | |
| 522 | + const sunTitle = sLanguage === 'sChinese' ? '星期' : ''; | |
| 526 | 523 | const [time, setTime] = useState("0000-00-00 00:00:00"); |
| 527 | 524 | const { logout } = useContext(myContext); |
| 528 | 525 | useEffect(() => { |
| ... | ... | @@ -544,8 +541,8 @@ const HeaderConponent = () => { |
| 544 | 541 | |
| 545 | 542 | |
| 546 | 543 | const logoTitle = commonFunc.showLocalMessage(props, 'EBC-MES', '小羚羊生产执行系统'); |
| 547 | - const account= commonFunc.showLocalMessage(props, 'account', '账号'); | |
| 548 | - const machine= commonFunc.showLocalMessage(props, 'machine', '机台'); | |
| 544 | + const account = commonFunc.showLocalMessage(props, 'account', '账号'); | |
| 545 | + const machine = commonFunc.showLocalMessage(props, 'machine', '机台'); | |
| 549 | 546 | const classGroup = commonFunc.showLocalMessage(props, 'classGroup', '班组'); |
| 550 | 547 | const dayShift = commonFunc.showLocalMessage(props, 'dayShift', '白班'); |
| 551 | 548 | const nightShift = commonFunc.showLocalMessage(props, 'nightShift', '夜班'); |
| ... | ... | @@ -628,19 +625,19 @@ const HeaderConponent = () => { |
| 628 | 625 | // 左侧侧边栏 |
| 629 | 626 | const SiderComponent = () => { |
| 630 | 627 | const { dispatch, hooksProps, props, ...rest } = useContext(myContext); |
| 631 | - const { currentContent, menuMap } = hooksProps; | |
| 628 | + const { currentContent, menuMap, menuMapOpposite } = hooksProps; | |
| 632 | 629 | |
| 633 | - const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息'); | |
| 630 | + const teamInformation = commonFunc.showLocalMessage(props, 'teamInformation', '班组信息'); | |
| 634 | 631 | |
| 635 | - const scheduledTask= commonFunc.showLocalMessage(props, 'scheduledTask', '计划任务'); | |
| 632 | + const scheduledTask = commonFunc.showLocalMessage(props, 'scheduledTask', '计划任务'); | |
| 636 | 633 | |
| 637 | - const productionExecution= commonFunc.showLocalMessage(props, 'productionExecution', '生产执行'); | |
| 634 | + const productionExecution = commonFunc.showLocalMessage(props, 'productionExecution', '生产执行'); | |
| 638 | 635 | |
| 639 | - const maintenanceRepair= commonFunc.showLocalMessage(props, 'maintenanceRepair', '维修保养'); | |
| 636 | + const maintenanceRepair = commonFunc.showLocalMessage(props, 'maintenanceRepair', '维修保养'); | |
| 640 | 637 | |
| 641 | - const queryTracing= commonFunc.showLocalMessage(props, 'queryTracing', '查询追踪'); | |
| 638 | + const queryTracing = commonFunc.showLocalMessage(props, 'queryTracing', '查询追踪'); | |
| 642 | 639 | |
| 643 | - const operationGuide= commonFunc.showLocalMessage(props, 'teamInformation', '操作指南'); | |
| 640 | + const operationGuide = commonFunc.showLocalMessage(props, 'teamInformation', '操作指南'); | |
| 644 | 641 | |
| 645 | 642 | const menuList = [ |
| 646 | 643 | { |
| ... | ... | @@ -686,12 +683,24 @@ const SiderComponent = () => { |
| 686 | 683 | c_icon: c_guideIcon |
| 687 | 684 | } |
| 688 | 685 | ]; |
| 686 | + const allowedIds = new Set(Object.values(menuMapOpposite)); | |
| 687 | + const filteredMenuList = [ | |
| 688 | + ...menuList.filter(item => allowedIds.has(item.id)), | |
| 689 | + { | |
| 690 | + id: "operationGuide", | |
| 691 | + title: operationGuide, | |
| 692 | + path: "/indexMes/operationGuide", | |
| 693 | + icon: guideIcon, | |
| 694 | + c_icon: c_guideIcon | |
| 695 | + } | |
| 696 | + ]; | |
| 697 | + console.log(filteredMenuList, 'menuList'); | |
| 689 | 698 | |
| 690 | 699 | let [hoverState, setHoverState] = useState(null); |
| 691 | 700 | |
| 692 | 701 | return ( |
| 693 | 702 | <div className="sider"> |
| 694 | - {menuList.map(item => ( | |
| 703 | + {filteredMenuList.map(item => ( | |
| 695 | 704 | <div |
| 696 | 705 | className={`menu ${item.id === currentContent ? "checked" : ""}`} |
| 697 | 706 | key={item.id} |
| ... | ... | @@ -820,9 +829,8 @@ const SystemFunComponent = () => { |
| 820 | 829 | value.iFlag = iFlag; |
| 821 | 830 | } |
| 822 | 831 | |
| 823 | - const url = `${ | |
| 824 | - commonConfig.server_host | |
| 825 | - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | |
| 832 | + const url = `${commonConfig.server_host | |
| 833 | + }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | |
| 826 | 834 | const returnData = (await commonServices.postValueService( |
| 827 | 835 | token, |
| 828 | 836 | value, |
| ... | ... | @@ -839,7 +847,7 @@ const SystemFunComponent = () => { |
| 839 | 847 | onOk() { |
| 840 | 848 | handleProcedureCall(params, 1); |
| 841 | 849 | }, |
| 842 | - onCancel() {} | |
| 850 | + onCancel() { } | |
| 843 | 851 | }); |
| 844 | 852 | } else if (code === -8) { |
| 845 | 853 | Modal.info({ |
| ... | ... | @@ -896,9 +904,8 @@ const SystemFunComponent = () => { |
| 896 | 904 | value.iFlag = iFlag; |
| 897 | 905 | } |
| 898 | 906 | |
| 899 | - const url = `${ | |
| 900 | - commonConfig.server_host | |
| 901 | - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | |
| 907 | + const url = `${commonConfig.server_host | |
| 908 | + }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | |
| 902 | 909 | const returnData = (await commonServices.postValueService( |
| 903 | 910 | token, |
| 904 | 911 | value, |
| ... | ... | @@ -915,7 +922,7 @@ const SystemFunComponent = () => { |
| 915 | 922 | onOk() { |
| 916 | 923 | handleProcedureCall1(params, 1); |
| 917 | 924 | }, |
| 918 | - onCancel() {} | |
| 925 | + onCancel() { } | |
| 919 | 926 | }); |
| 920 | 927 | } else if (code === -8) { |
| 921 | 928 | Modal.info({ |
| ... | ... | @@ -973,14 +980,14 @@ const SystemFunComponent = () => { |
| 973 | 980 | |
| 974 | 981 | const getSystemFunContent = () => { |
| 975 | 982 | const userinfo = commonUtils.getAppData("userinfo"); |
| 976 | - const ModifyPassword = commonFunc.showLocalMessage(props, 'ModifyPassword','修改密码');/* 修改密码 */ | |
| 983 | + const ModifyPassword = commonFunc.showLocalMessage(props, 'ModifyPassword', '修改密码');/* 修改密码 */ | |
| 977 | 984 | const faceCollection = commonFunc.showLocalMessage(props, 'faceCollection', '人脸采集'); |
| 978 | 985 | const moreFunctions = commonFunc.showLocalMessage(props, 'moreFunctions', '更多功能'); |
| 979 | 986 | const Logout = commonFunc.showLocalMessage(props, 'Logout', '退出登录'); |
| 980 | - const shutDown= commonFunc.showLocalMessage(props, 'shutDown', '关机'); | |
| 981 | - const resetDailyReport= commonFunc.showLocalMessage(props, 'resetDailyReport', '关机'); | |
| 982 | - const switchToManual= commonFunc.showLocalMessage(props, 'switchToManual', '切换手动'); | |
| 983 | - const SwitchAuto= commonFunc.showLocalMessage(props, 'SwitchAuto', '切换自动'); | |
| 987 | + const shutDown = commonFunc.showLocalMessage(props, 'shutDown', '关机'); | |
| 988 | + const resetDailyReport = commonFunc.showLocalMessage(props, 'resetDailyReport', '关机'); | |
| 989 | + const switchToManual = commonFunc.showLocalMessage(props, 'switchToManual', '切换手动'); | |
| 990 | + const SwitchAuto = commonFunc.showLocalMessage(props, 'SwitchAuto', '切换自动'); | |
| 984 | 991 | |
| 985 | 992 | |
| 986 | 993 | const { bPlcSd } = userinfo; | ... | ... |
src/mes/login/index.js
| 1 | -import React, { useEffect, useState } from "react"; | |
| 1 | +import React, { useEffect, useState, useMemo, useRef } from "react"; | |
| 2 | 2 | import { cloneDeep } from "lodash"; |
| 3 | 3 | import { Form, Button, message } from "antd"; |
| 4 | 4 | |
| ... | ... | @@ -29,18 +29,20 @@ const useLoginEvent = props => { |
| 29 | 29 | payload: {} |
| 30 | 30 | }); |
| 31 | 31 | sessionStorage.clear(); |
| 32 | + // localStorage.clear(); | |
| 33 | + const masterValue = localStorage.getItem(`${commonConfig.prefix}masterData`); | |
| 32 | 34 | localStorage.clear(); |
| 35 | + localStorage.setItem(`${commonConfig.prefix}masterData`, masterValue); | |
| 36 | + | |
| 33 | 37 | ipAddress && localStorage.setItem("ipAddress", ipAddress); |
| 34 | 38 | tempFaceData && localStorage.setItem("tempFaceData", tempFaceData); |
| 35 | 39 | }, []); |
| 36 | - | |
| 37 | 40 | // 获取登录配置 |
| 38 | 41 | const [loginConfig, setLoginConfig] = useState([]); |
| 39 | 42 | useEffect(async () => { |
| 40 | 43 | const { sModelsId } = initValue; |
| 41 | - const configUrl = `${ | |
| 42 | - commonConfig.server_host | |
| 43 | - }business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}&sName=/commonAuto`; | |
| 44 | + const configUrl = `${commonConfig.server_host | |
| 45 | + }business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}&sName=/commonAuto`; | |
| 44 | 46 | const configReturn = (await commonServices.getService("", configUrl)).data; |
| 45 | 47 | if (configReturn.code === 1) { |
| 46 | 48 | const dataReturn = configReturn.dataset.rows; |
| ... | ... | @@ -78,9 +80,8 @@ const useLoginEvent = props => { |
| 78 | 80 | |
| 79 | 81 | // 获取公司信息 |
| 80 | 82 | useEffect(async () => { |
| 81 | - const companysConfigUrl = `${ | |
| 82 | - commonConfig.server_host | |
| 83 | - }sysbrands/getSysbrands`; | |
| 83 | + const companysConfigUrl = `${commonConfig.server_host | |
| 84 | + }sysbrands/getSysbrands`; | |
| 84 | 85 | const companysConfigReturn = (await commonServices.getService( |
| 85 | 86 | null, |
| 86 | 87 | companysConfigUrl |
| ... | ... | @@ -108,9 +109,8 @@ const useLoginEvent = props => { |
| 108 | 109 | |
| 109 | 110 | // 获取开工人员信息 |
| 110 | 111 | const handleGetTeamEmployee = async (sTeamId, token) => { |
| 111 | - const url = `${ | |
| 112 | - commonConfig.server_host | |
| 113 | - }oee/getTeamEmployee/${sTeamId}?sModelsId=100`; | |
| 112 | + const url = `${commonConfig.server_host | |
| 113 | + }oee/getTeamEmployee/${sTeamId}?sModelsId=100`; | |
| 114 | 114 | const dataReturn = (await commonServices.getService(token, url)).data; |
| 115 | 115 | if (dataReturn.code === 1) { |
| 116 | 116 | const returnData = dataReturn.dataset.rows; |
| ... | ... | @@ -134,29 +134,42 @@ const useLoginEvent = props => { |
| 134 | 134 | // 登录事件 |
| 135 | 135 | const handleSubmit = async ({ faceLoginValue = {}, sEmployeeNo } = {}, configsData) => { |
| 136 | 136 | const bFaceLogin = commonUtils.isNotEmptyObject(faceLoginValue); |
| 137 | - | |
| 137 | + let masterNewData = {} | |
| 138 | 138 | let dataReturn = {}; |
| 139 | 139 | if (!bFaceLogin) { |
| 140 | 140 | // 账号密码登录 |
| 141 | 141 | const { masterData, companys } = props; |
| 142 | + const masterLocal = commonUtils.convertStrToObj( | |
| 143 | + localStorage.getItem(`${commonConfig.prefix}masterData`) | |
| 144 | + ) | |
| 145 | + if (masterLocal) { | |
| 146 | + masterNewData = { | |
| 147 | + ...masterLocal, | |
| 148 | + ...masterData, | |
| 149 | + } | |
| 150 | + }else { | |
| 151 | + masterNewData = { | |
| 152 | + ...masterData | |
| 153 | + } | |
| 154 | + } | |
| 142 | 155 | // 新增方法:根据sName过滤configs |
| 143 | 156 | const getConfigByName = (name, configs, sLanguage) => { |
| 144 | 157 | const configObj = configs?.find(item => item.sName === name) || {}; |
| 145 | - const showName = sLanguage === 'sChinese' ? configObj.sChinese : sLanguage ==='sEnglish' ? configObj.sEnglish : | |
| 158 | + const showName = sLanguage === 'sChinese' ? configObj.sChinese : sLanguage === 'sEnglish' ? configObj.sEnglish : | |
| 146 | 159 | sLanguage === 'sBig5' ? configObj.sBig5 : configObj.sChinese; |
| 147 | 160 | return showName; |
| 148 | 161 | }; |
| 149 | 162 | const sLanguage = commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'sEnglish'; |
| 150 | 163 | |
| 151 | - const pleaseSelectUser = getConfigByName('pleaseSelectUser', configsData, sLanguage); | |
| 164 | + const pleaseSelectUser = getConfigByName('pleaseSelectUser', configsData, sLanguage); | |
| 152 | 165 | |
| 153 | - const pleaseInputPassword = getConfigByName('pleaseInputPassword', configsData, sLanguage); | |
| 166 | + const pleaseInputPassword = getConfigByName('pleaseInputPassword', configsData, sLanguage); | |
| 154 | 167 | |
| 155 | - const pleaseSelectTeam = getConfigByName('pleaseSelectTeam', configsData, sLanguage); | |
| 168 | + const pleaseSelectTeam = getConfigByName('pleaseSelectTeam', configsData, sLanguage); | |
| 156 | 169 | |
| 157 | - const pleaseselectShift = getConfigByName('pleaseselectShift', configsData, sLanguage); | |
| 170 | + const pleaseselectShift = getConfigByName('pleaseselectShift', configsData, sLanguage); | |
| 158 | 171 | |
| 159 | - const pleaseSelectMachine = getConfigByName('pleaseSelectMachine', configsData, sLanguage); | |
| 172 | + const pleaseSelectMachine = getConfigByName('pleaseSelectMachine', configsData, sLanguage); | |
| 160 | 173 | |
| 161 | 174 | |
| 162 | 175 | const { |
| ... | ... | @@ -172,7 +185,7 @@ const useLoginEvent = props => { |
| 172 | 185 | sMachineName, |
| 173 | 186 | iPlcNo, |
| 174 | 187 | sShift |
| 175 | - } = masterData; | |
| 188 | + } = masterNewData; | |
| 176 | 189 | |
| 177 | 190 | const value = { |
| 178 | 191 | userId, |
| ... | ... | @@ -215,17 +228,15 @@ const useLoginEvent = props => { |
| 215 | 228 | return; |
| 216 | 229 | } |
| 217 | 230 | |
| 218 | - const url = `${ | |
| 219 | - commonConfig.server_host | |
| 220 | - }userOeelogin/${sParentId}/${sId}/${sTeamId}/${sMachineId}`; | |
| 231 | + const url = `${commonConfig.server_host | |
| 232 | + }userOeelogin/${sParentId}/${sId}/${sTeamId}/${sMachineId}`; | |
| 221 | 233 | dataReturn = (await commonServices.postValueService(null, value, url)) |
| 222 | 234 | .data; |
| 223 | 235 | } else { |
| 224 | 236 | // 人脸登录 |
| 225 | 237 | const { sBrandsId, sSubsidiaryId, sEmployeeNo } = faceLoginValue; |
| 226 | - const url = `${ | |
| 227 | - commonConfig.server_host | |
| 228 | - }userOeelogin/${sBrandsId}/${sSubsidiaryId}`; | |
| 238 | + const url = `${commonConfig.server_host | |
| 239 | + }userOeelogin/${sBrandsId}/${sSubsidiaryId}`; | |
| 229 | 240 | const value = { sEmployeeNo, sParentId: sBrandsId, sId: sSubsidiaryId }; |
| 230 | 241 | dataReturn = (await commonServices.postValueService(null, value, url)) |
| 231 | 242 | .data; |
| ... | ... | @@ -306,6 +317,11 @@ const useLoginEvent = props => { |
| 306 | 317 | `${commonConfig.prefix}statusData_${sMachineId}`, |
| 307 | 318 | JSON.stringify(statusData) |
| 308 | 319 | ); |
| 320 | + const { masterData = {} } = props; | |
| 321 | + localStorage.setItem( | |
| 322 | + `${commonConfig.prefix}masterData`, | |
| 323 | + JSON.stringify(masterNewData) | |
| 324 | + ) | |
| 309 | 325 | |
| 310 | 326 | handleUserlogin({ |
| 311 | 327 | token, |
| ... | ... | @@ -346,7 +362,7 @@ const useLoginEvent = props => { |
| 346 | 362 | |
| 347 | 363 | return { |
| 348 | 364 | ...props, |
| 349 | - companys, // 确保返回companys | |
| 365 | + companys, // 确保返回companys | |
| 350 | 366 | configs, |
| 351 | 367 | onSubmit: handleSubmit, |
| 352 | 368 | onFaceLogin: handleFaceLogin, |
| ... | ... | @@ -359,9 +375,22 @@ const handleGetFormItem = (props, item) => { |
| 359 | 375 | |
| 360 | 376 | const { sModelsId } = initValue; |
| 361 | 377 | const { masterData = {}, companys } = props; |
| 378 | + | |
| 379 | + const userInfo = commonUtils.convertStrToObj( | |
| 380 | + localStorage.getItem(`${commonConfig.prefix}masterData`) | |
| 381 | + ); | |
| 382 | + let masterNewData = masterData | |
| 383 | + if (userInfo) { | |
| 384 | + masterNewData = { | |
| 385 | + ...userInfo, | |
| 386 | + ...masterData, | |
| 387 | + } | |
| 388 | + } | |
| 389 | + | |
| 390 | + | |
| 362 | 391 | const sLanguage = commonUtils.isNotEmptyArr(companys) && companys[0].sLanguage || 'sEnglish'; |
| 363 | 392 | let enabledNew = true; |
| 364 | - if(item.sName?.includes('please') || item.sName?.includes('请')) { | |
| 393 | + if (item.sName?.includes('please') || item.sName?.includes('请')) { | |
| 365 | 394 | return; |
| 366 | 395 | } |
| 367 | 396 | if (item.iTag === 1) { |
| ... | ... | @@ -369,10 +398,11 @@ const handleGetFormItem = (props, item) => { |
| 369 | 398 | } else if (item.iTag === 3) { |
| 370 | 399 | enabledNew = true; |
| 371 | 400 | } |
| 401 | + | |
| 372 | 402 | const showTypeProps = { |
| 373 | 403 | bNewForm: true, |
| 374 | 404 | iColValue: 24, |
| 375 | - record: masterData, | |
| 405 | + record: masterNewData, | |
| 376 | 406 | name: "master", |
| 377 | 407 | formId: sModelsId, |
| 378 | 408 | getSqlDropDownData: props.getSqlDropDownData, |
| ... | ... | @@ -397,7 +427,7 @@ const handleGetFormItem = (props, item) => { |
| 397 | 427 | formItemLayout: { labelCol: { span: 0 }, wrapperCol: { span: 24 } }, |
| 398 | 428 | textArea: false, |
| 399 | 429 | enabled: enabledNew, |
| 400 | - dataValue: masterData[item.sName], | |
| 430 | + dataValue: masterNewData[item.sName], | |
| 401 | 431 | bTable: item.sName !== "sPassWord", |
| 402 | 432 | bViewTable: true, |
| 403 | 433 | onFilterDropDownData: props.onFilterDropDownData, |
| ... | ... | @@ -405,7 +435,9 @@ const handleGetFormItem = (props, item) => { |
| 405 | 435 | bPassWord: item.sName === "sPassWord", |
| 406 | 436 | style: { backgroundColor: "#eaeaea" } |
| 407 | 437 | }; |
| 408 | - const showName = sLanguage === 'sChinese' ? item.sChinese : sLanguage ==='sEnglish' ? item.sEnglish | |
| 438 | + console.log(showTypeProps, 'showTypeProps'); | |
| 439 | + | |
| 440 | + const showName = sLanguage === 'sChinese' ? item.sChinese : sLanguage === 'sEnglish' ? item.sEnglish | |
| 409 | 441 | : item.sBig5; |
| 410 | 442 | return ( |
| 411 | 443 | <Form.Item label={showName} key={item.sName}> |
| ... | ... | @@ -417,9 +449,8 @@ const handleGetFormItem = (props, item) => { |
| 417 | 449 | // 主入口 |
| 418 | 450 | const login = baseProps => { |
| 419 | 451 | const props = useLoginEvent(useCommonBase(baseProps)); |
| 420 | - const { configs , app, companys } = props; | |
| 421 | - const sysObj = commonUtils.isNotEmptyArr(companys) ? companys[0] : []; | |
| 422 | - console.log('222', sysObj); | |
| 452 | + const { configs, app, companys } = props; | |
| 453 | + const sysObj = commonUtils.isNotEmptyArr(companys) ? companys[0] : []; | |
| 423 | 454 | const sLanguage = sysObj?.sLanguage || 'sEnglish'; |
| 424 | 455 | |
| 425 | 456 | const oeeTitle = |
| ... | ... | @@ -464,7 +495,7 @@ const login = baseProps => { |
| 464 | 495 | : sLanguage === "sEnglish" |
| 465 | 496 | ? "Close" |
| 466 | 497 | : "關 閉"; /* 关 闭 */ |
| 467 | - const btnFace = sLanguage === "sChinese"? "人 脸 登 录" : sLanguage === "sEnglish" ? "FaceLogin" : "人 臉 登 錄"; /* 人 脸 */ | |
| 498 | + const btnFace = sLanguage === "sChinese" ? "人 脸 登 录" : sLanguage === "sEnglish" ? "FaceLogin" : "人 臉 登 錄"; /* 人 脸 */ | |
| 468 | 499 | |
| 469 | 500 | const btnNormal = |
| 470 | 501 | sLanguage === "sChinese" |
| ... | ... | @@ -539,7 +570,7 @@ const FaceLoginModal = props => { |
| 539 | 570 | if (!faceLoginModalVisible) return ""; |
| 540 | 571 | const { companys } = props; |
| 541 | 572 | const sLanguage = commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'English'; |
| 542 | - const btnFace = sLanguage === "sChinese"? "人 脸 登 录" : sLanguage === "sEnglish" ? "FaceLogin" : "人 臉 登 錄"; /* 人 脸 */ | |
| 573 | + const btnFace = sLanguage === "sChinese" ? "人 脸 登 录" : sLanguage === "sEnglish" ? "FaceLogin" : "人 臉 登 錄"; /* 人 脸 */ | |
| 543 | 574 | |
| 544 | 575 | return ( |
| 545 | 576 | <Modal |
| ... | ... | @@ -571,13 +602,13 @@ const FaceLoginModal = props => { |
| 571 | 602 | |
| 572 | 603 | // 人脸弹窗后选择其他内容 |
| 573 | 604 | const FaceLoginAfterModal = props => { |
| 574 | - const { faceLoginAfterModalVisible , companys } = props; | |
| 605 | + const { faceLoginAfterModalVisible, companys } = props; | |
| 575 | 606 | |
| 576 | 607 | if (!faceLoginAfterModalVisible) return ""; |
| 577 | 608 | const sLanguage = commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'English'; |
| 578 | - const sLoginConfirm = sLanguage === "sChinese"? "登陆信息确认" : sLanguage === "sEnglish" ? "Login Information Confirmation" : "登陸信息確認"; /* 人 脸 */ | |
| 579 | - const btnConfirm = sLanguage === "sChinese"? "确认" : sLanguage === "sEnglish" ? "Confirm" : "確認"; /* 人 脸 */ | |
| 580 | - const btnCancel = sLanguage === "sChinese"? "取消" : sLanguage === "sEnglish" ? "Cancel" : "取消"; /* 取消 */ | |
| 609 | + const sLoginConfirm = sLanguage === "sChinese" ? "登陆信息确认" : sLanguage === "sEnglish" ? "Login Information Confirmation" : "登陸信息確認"; /* 人 脸 */ | |
| 610 | + const btnConfirm = sLanguage === "sChinese" ? "确认" : sLanguage === "sEnglish" ? "Confirm" : "確認"; /* 人 脸 */ | |
| 611 | + const btnCancel = sLanguage === "sChinese" ? "取消" : sLanguage === "sEnglish" ? "Cancel" : "取消"; /* 取消 */ | |
| 581 | 612 | |
| 582 | 613 | |
| 583 | 614 | const { | ... | ... |