Commit f5675e248c3b728efaf050388206f66326b7c4b7
1 parent
58323b2c
init
Showing
17 changed files
with
799 additions
and
290 deletions
package.json
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | "version": "1.0.5", | 3 | "version": "1.0.5", |
| 4 | "private": true, | 4 | "private": true, |
| 5 | "scripts": { | 5 | "scripts": { |
| 6 | - "start": "set port=8543&roadhog server --progress --watch --colors --profile", | 6 | + "start": "set port=9005&roadhog server --progress --watch --colors --profile", |
| 7 | "build": "roadhog build", | 7 | "build": "roadhog build", |
| 8 | "lint": "eslint --ext .js src test", | 8 | "lint": "eslint --ext .js src test", |
| 9 | "precommit": "npm run lint" | 9 | "precommit": "npm run lint" |
src/components/Common/CommonHooks/useCommonBase.js
| @@ -428,20 +428,20 @@ const useCommonBase = props => { | @@ -428,20 +428,20 @@ const useCommonBase = props => { | ||
| 428 | return {}; | 428 | return {}; |
| 429 | }; | 429 | }; |
| 430 | 430 | ||
| 431 | - const getSqlCondition = (showConfig, name, record) => { | 431 | + const getSqlCondition = (showConfig, name, record, props = state) => { |
| 432 | const conditonValues = {}; | 432 | const conditonValues = {}; |
| 433 | if (commonUtils.isNotEmptyStr(showConfig.sSqlCondition)) { | 433 | if (commonUtils.isNotEmptyStr(showConfig.sSqlCondition)) { |
| 434 | const conditon = showConfig.sSqlCondition.split(","); | 434 | const conditon = showConfig.sSqlCondition.split(","); |
| 435 | conditon.forEach(item => { | 435 | conditon.forEach(item => { |
| 436 | // 特殊处理 | 436 | // 特殊处理 |
| 437 | if (item === "sBoardNo.sBoardNo") { | 437 | if (item === "sBoardNo.sBoardNo") { |
| 438 | - if (commonUtils.isNotEmptyArr(state["qztable0Data"])) { | 438 | + if (commonUtils.isNotEmptyArr(props["qztable0Data"])) { |
| 439 | item = "qztable0.sBoardNo"; | 439 | item = "qztable0.sBoardNo"; |
| 440 | - } else if (commonUtils.isNotEmptyArr(state["jytable0Data"])) { | 440 | + } else if (commonUtils.isNotEmptyArr(props["jytable0Data"])) { |
| 441 | item = "jytable0.sBoardNo"; | 441 | item = "jytable0.sBoardNo"; |
| 442 | - } else if (commonUtils.isNotEmptyArr(state["wytable0Data"])) { | 442 | + } else if (commonUtils.isNotEmptyArr(props["wytable0Data"])) { |
| 443 | item = "wytable0.sBoardNo"; | 443 | item = "wytable0.sBoardNo"; |
| 444 | - } else if (commonUtils.isNotEmptyArr(state["wytgtable0Data"])) { | 444 | + } else if (commonUtils.isNotEmptyArr(props["wytgtable0Data"])) { |
| 445 | item = "wytgtable0.sBoardNo"; | 445 | item = "wytgtable0.sBoardNo"; |
| 446 | } | 446 | } |
| 447 | } | 447 | } |
| @@ -457,7 +457,7 @@ const useCommonBase = props => { | @@ -457,7 +457,7 @@ const useCommonBase = props => { | ||
| 457 | item.split(".").length > 2 ? item.split(".")[2] : fieldName; | 457 | item.split(".").length > 2 ? item.split(".")[2] : fieldName; |
| 458 | if (fieldName.indexOf("&Search") > -1) { | 458 | if (fieldName.indexOf("&Search") > -1) { |
| 459 | // 参数为&Search时认为是查找数据集中取数据 | 459 | // 参数为&Search时认为是查找数据集中取数据 |
| 460 | - const data = state[`${tableName}Data`]; | 460 | + const data = props[`${tableName}Data`]; |
| 461 | if (typeof data === "object" && data.constructor === Object) { | 461 | if (typeof data === "object" && data.constructor === Object) { |
| 462 | Object.keys(data).forEach(dataItem => { | 462 | Object.keys(data).forEach(dataItem => { |
| 463 | if (`&Search${data[dataItem]}` === fieldName) { | 463 | if (`&Search${data[dataItem]}` === fieldName) { |
| @@ -488,6 +488,7 @@ const useCommonBase = props => { | @@ -488,6 +488,7 @@ const useCommonBase = props => { | ||
| 488 | if ( | 488 | if ( |
| 489 | [ | 489 | [ |
| 490 | "userinfo", | 490 | "userinfo", |
| 491 | + "changeExecInfo", | ||
| 491 | "currentSelectedMachineTask", | 492 | "currentSelectedMachineTask", |
| 492 | "currentStartWorkMachineTask", | 493 | "currentStartWorkMachineTask", |
| 493 | "currentWorkOrderInfo" | 494 | "currentWorkOrderInfo" |
| @@ -500,6 +501,7 @@ const useCommonBase = props => { | @@ -500,6 +501,7 @@ const useCommonBase = props => { | ||
| 500 | ); | 501 | ); |
| 501 | const tempProps = { | 502 | const tempProps = { |
| 502 | userinfo: app.userinfo, | 503 | userinfo: app.userinfo, |
| 504 | + changeExecInfo: commonUtils.getAppData("changeExecInfo"), | ||
| 503 | currentSelectedMachineTask: | 505 | currentSelectedMachineTask: |
| 504 | globalData?.currentSelectedMachineTask, | 506 | globalData?.currentSelectedMachineTask, |
| 505 | currentStartWorkMachineTask: | 507 | currentStartWorkMachineTask: |
| @@ -511,8 +513,8 @@ const useCommonBase = props => { | @@ -511,8 +513,8 @@ const useCommonBase = props => { | ||
| 511 | const data = record; | 513 | const data = record; |
| 512 | conditonValues[fieldNameFilter] = data[fieldName]; | 514 | conditonValues[fieldNameFilter] = data[fieldName]; |
| 513 | } else { | 515 | } else { |
| 514 | - const data = state[`${tableName}Data`]; | ||
| 515 | - const selectedRowKeys = state[`${tableName}SelectedRowKeys`]; | 516 | + const data = props[`${tableName}Data`]; |
| 517 | + const selectedRowKeys = props[`${tableName}SelectedRowKeys`]; | ||
| 516 | if (typeof data === "object" && data.constructor === Object) { | 518 | if (typeof data === "object" && data.constructor === Object) { |
| 517 | conditonValues[fieldNameFilter] = data[fieldName]; | 519 | conditonValues[fieldNameFilter] = data[fieldName]; |
| 518 | } else if (commonUtils.isNotEmptyArr(selectedRowKeys)) { | 520 | } else if (commonUtils.isNotEmptyArr(selectedRowKeys)) { |
| @@ -1939,6 +1941,8 @@ const useCommonBase = props => { | @@ -1939,6 +1941,8 @@ const useCommonBase = props => { | ||
| 1939 | // 调用通用过程 | 1941 | // 调用通用过程 |
| 1940 | const handleProcedureCall = async (params, iFlag) => { | 1942 | const handleProcedureCall = async (params, iFlag) => { |
| 1941 | const { | 1943 | const { |
| 1944 | + bForemanCheck, | ||
| 1945 | + getFaceResult, | ||
| 1942 | btnConfig = {}, // 按钮配置 | 1946 | btnConfig = {}, // 按钮配置 |
| 1943 | sValue = {}, // 额外参数 | 1947 | sValue = {}, // 额外参数 |
| 1944 | tableData: tableDataSelected, // 传过来的数据 | 1948 | tableData: tableDataSelected, // 传过来的数据 |
| @@ -2013,6 +2017,7 @@ const useCommonBase = props => { | @@ -2013,6 +2017,7 @@ const useCommonBase = props => { | ||
| 2013 | if ( | 2017 | if ( |
| 2014 | [ | 2018 | [ |
| 2015 | "userinfo", | 2019 | "userinfo", |
| 2020 | + "changeExecInfo", | ||
| 2016 | "currentSelectedMachineTask", | 2021 | "currentSelectedMachineTask", |
| 2017 | "currentStartWorkMachineTask", | 2022 | "currentStartWorkMachineTask", |
| 2018 | "currentWorkOrderInfo" | 2023 | "currentWorkOrderInfo" |
| @@ -2022,6 +2027,7 @@ const useCommonBase = props => { | @@ -2022,6 +2027,7 @@ const useCommonBase = props => { | ||
| 2022 | const globalData = commonUtils.getAppData("globalData"); | 2027 | const globalData = commonUtils.getAppData("globalData"); |
| 2023 | const tempProps = { | 2028 | const tempProps = { |
| 2024 | userinfo: app.userinfo, | 2029 | userinfo: app.userinfo, |
| 2030 | + changeExecInfo: commonUtils.getAppData("changeExecInfo"), | ||
| 2025 | currentSelectedMachineTask: globalData.currentSelectedMachineTask, | 2031 | currentSelectedMachineTask: globalData.currentSelectedMachineTask, |
| 2026 | currentStartWorkMachineTask: | 2032 | currentStartWorkMachineTask: |
| 2027 | globalData.currentStartWorkMachineTask, | 2033 | globalData.currentStartWorkMachineTask, |
| @@ -2128,6 +2134,29 @@ const useCommonBase = props => { | @@ -2128,6 +2134,29 @@ const useCommonBase = props => { | ||
| 2128 | message.success(msg); | 2134 | message.success(msg); |
| 2129 | onSuccess && onSuccess(true); | 2135 | onSuccess && onSuccess(true); |
| 2130 | } else if (code === -7) { | 2136 | } else if (code === -7) { |
| 2137 | + if (bForemanCheck && getFaceResult) { | ||
| 2138 | + Modal.confirm({ | ||
| 2139 | + title: "温馨提示:", | ||
| 2140 | + content: <div>{handleGetMsg(msg)}</div>, | ||
| 2141 | + okText: "领班认证", | ||
| 2142 | + cancelText: "取消", | ||
| 2143 | + async onOk() { | ||
| 2144 | + Modal.destroyAll(); | ||
| 2145 | + const faceResult = await getFaceResult(); | ||
| 2146 | + if (!faceResult) { | ||
| 2147 | + onError && onError(); | ||
| 2148 | + return; | ||
| 2149 | + }; | ||
| 2150 | + const paramsNew = { ...params, faceData: { ...faceData, sForemanNo: faceResult.sEmployeeNo } }; | ||
| 2151 | + handleProcedureCall(paramsNew, 1); | ||
| 2152 | + }, | ||
| 2153 | + onCancel() { | ||
| 2154 | + onError && onError(); | ||
| 2155 | + } | ||
| 2156 | + }); | ||
| 2157 | + return; | ||
| 2158 | + } | ||
| 2159 | + | ||
| 2131 | Modal.confirm({ | 2160 | Modal.confirm({ |
| 2132 | title: "温馨提示:", | 2161 | title: "温馨提示:", |
| 2133 | content: <div>{handleGetMsg(msg)}</div>, | 2162 | content: <div>{handleGetMsg(msg)}</div>, |
src/components/Common/CommonInstructSet.js
| @@ -821,7 +821,7 @@ const handlePopup = (props, instruct) => { | @@ -821,7 +821,7 @@ const handlePopup = (props, instruct) => { | ||
| 821 | const record = filterData[0]; | 821 | const record = filterData[0]; |
| 822 | sParentConditions = { | 822 | sParentConditions = { |
| 823 | ...sParentConditions, | 823 | ...sParentConditions, |
| 824 | - ...props.getSqlCondition(props.btnConfig, tableName, record) | 824 | + ...props.getSqlCondition(props.btnConfig, tableName, record, props) |
| 825 | }; | 825 | }; |
| 826 | }); | 826 | }); |
| 827 | } | 827 | } |
| @@ -1514,6 +1514,12 @@ const handleOpenSql = async (props, instruct) => { | @@ -1514,6 +1514,12 @@ const handleOpenSql = async (props, instruct) => { | ||
| 1514 | ...userinfo | 1514 | ...userinfo |
| 1515 | }; | 1515 | }; |
| 1516 | } | 1516 | } |
| 1517 | + if (sSqlCondition.includes("changeExecInfo")) { | ||
| 1518 | + srcDatasetRow = { | ||
| 1519 | + ...srcDatasetRow, | ||
| 1520 | + ...commonUtils.getAppData("changeExecInfo") | ||
| 1521 | + }; | ||
| 1522 | + } | ||
| 1517 | if (sSqlCondition.includes("currentWorkOrderInfo")) { | 1523 | if (sSqlCondition.includes("currentWorkOrderInfo")) { |
| 1518 | srcDatasetRow = { | 1524 | srcDatasetRow = { |
| 1519 | ...srcDatasetRow, | 1525 | ...srcDatasetRow, |
| @@ -2277,6 +2283,7 @@ const handleComputeData = (props, str, datasetList) => { | @@ -2277,6 +2283,7 @@ const handleComputeData = (props, str, datasetList) => { | ||
| 2277 | [fordosetName]: fordosetData, | 2283 | [fordosetName]: fordosetData, |
| 2278 | ...datasetList, | 2284 | ...datasetList, |
| 2279 | userinfo, | 2285 | userinfo, |
| 2286 | + changeExecInfo: commonUtils.getAppData("changeExecInfo"), | ||
| 2280 | currentSelectedMachineTask, | 2287 | currentSelectedMachineTask, |
| 2281 | currentStartWorkMachineTask, | 2288 | currentStartWorkMachineTask, |
| 2282 | currentWorkOrderInfo | 2289 | currentWorkOrderInfo |
| @@ -2290,6 +2297,7 @@ const handleComputeData = (props, str, datasetList) => { | @@ -2290,6 +2297,7 @@ const handleComputeData = (props, str, datasetList) => { | ||
| 2290 | key.includes("@") || | 2297 | key.includes("@") || |
| 2291 | [ | 2298 | [ |
| 2292 | "userinfo", | 2299 | "userinfo", |
| 2300 | + "changeExecInfo", | ||
| 2293 | "currentSelectedMachineTask", | 2301 | "currentSelectedMachineTask", |
| 2294 | "currentStartWorkMachineTask", | 2302 | "currentStartWorkMachineTask", |
| 2295 | "currentWorkOrderInfo" | 2303 | "currentWorkOrderInfo" |
| @@ -2454,6 +2462,9 @@ const utils = { | @@ -2454,6 +2462,9 @@ const utils = { | ||
| 2454 | if (tableName === "userinfo") { | 2462 | if (tableName === "userinfo") { |
| 2455 | return [props.app.userinfo]; | 2463 | return [props.app.userinfo]; |
| 2456 | } | 2464 | } |
| 2465 | + if (tableName === "changeExecInfo") { | ||
| 2466 | + return [commonUtils.getAppData("changeExecInfo")]; | ||
| 2467 | + } | ||
| 2457 | 2468 | ||
| 2458 | let _props = props; | 2469 | let _props = props; |
| 2459 | 2470 | ||
| @@ -2799,6 +2810,7 @@ const utils = { | @@ -2799,6 +2810,7 @@ const utils = { | ||
| 2799 | [fordosetName]: fordosetData, | 2810 | [fordosetName]: fordosetData, |
| 2800 | ...datasetListExtra, | 2811 | ...datasetListExtra, |
| 2801 | userinfo, | 2812 | userinfo, |
| 2813 | + changeExecInfo: commonUtils.getAppData("changeExecInfo"), | ||
| 2802 | currentSelectedMachineTask, | 2814 | currentSelectedMachineTask, |
| 2803 | currentStartWorkMachineTask, | 2815 | currentStartWorkMachineTask, |
| 2804 | currentWorkOrderInfo | 2816 | currentWorkOrderInfo |
| @@ -2812,6 +2824,7 @@ const utils = { | @@ -2812,6 +2824,7 @@ const utils = { | ||
| 2812 | key.includes("@") || | 2824 | key.includes("@") || |
| 2813 | [ | 2825 | [ |
| 2814 | "userinfo", | 2826 | "userinfo", |
| 2827 | + "changeExecInfo", | ||
| 2815 | "currentSelectedMachineTask", | 2828 | "currentSelectedMachineTask", |
| 2816 | "currentStartWorkMachineTask", | 2829 | "currentStartWorkMachineTask", |
| 2817 | "currentWorkOrderInfo" | 2830 | "currentWorkOrderInfo" |
| @@ -3046,6 +3059,7 @@ const utils = { | @@ -3046,6 +3059,7 @@ const utils = { | ||
| 3046 | // 全局参数 | 3059 | // 全局参数 |
| 3047 | let allData = { | 3060 | let allData = { |
| 3048 | userinfo, | 3061 | userinfo, |
| 3062 | + changeExecInfo: commonUtils.getAppData("changeExecInfo"), | ||
| 3049 | currentSelectedMachineTask, | 3063 | currentSelectedMachineTask, |
| 3050 | currentStartWorkMachineTask, | 3064 | currentStartWorkMachineTask, |
| 3051 | currentWorkOrderInfo, | 3065 | currentWorkOrderInfo, |
src/components/Common/CommonTable/index.js
| @@ -4552,7 +4552,7 @@ class CommonTableRc extends React.Component { | @@ -4552,7 +4552,7 @@ class CommonTableRc extends React.Component { | ||
| 4552 | // 人检-产量上报信息-上报数量 复制第一行到全部功能 | 4552 | // 人检-产量上报信息-上报数量 复制第一行到全部功能 |
| 4553 | if ( | 4553 | if ( |
| 4554 | this.props.name === "table131" && | 4554 | this.props.name === "table131" && |
| 4555 | - ["dProcessCalQty", "dWageHour", "dTimeHour"].includes( | 4555 | + ["dProcessCalQty", "dWageHour", "dOvertimeHour", "dTimeHour"].includes( |
| 4556 | column.dataIndex | 4556 | column.dataIndex |
| 4557 | ) | 4557 | ) |
| 4558 | ) { | 4558 | ) { |
| @@ -4707,13 +4707,13 @@ class CommonTableRc extends React.Component { | @@ -4707,13 +4707,13 @@ class CommonTableRc extends React.Component { | ||
| 4707 | tableBtnsWidth = Math.max(75, tableBtnsWidth); | 4707 | tableBtnsWidth = Math.max(75, tableBtnsWidth); |
| 4708 | } | 4708 | } |
| 4709 | if ( | 4709 | if ( |
| 4710 | - ["12710101117087404588200", "12710101117260270570210"].includes( | 4710 | + (["12710101117087404588200", "12710101117260270570210"].includes( |
| 4711 | props.formId | 4711 | props.formId |
| 4712 | ) && | 4712 | ) && |
| 4713 | - props.name === "table0" | ||
| 4714 | - // || | ||
| 4715 | - // (props.formId === "12710101117087371044360" && | ||
| 4716 | - // props.name === "slave0") | 4713 | + props.name === "table0") |
| 4714 | + || | ||
| 4715 | + (props.formId === "12710101117087371044360" && | ||
| 4716 | + props.name === "slave0") | ||
| 4717 | ) { | 4717 | ) { |
| 4718 | tableBtnsWidth = Math.max(110, tableBtnsWidth); | 4718 | tableBtnsWidth = Math.max(110, tableBtnsWidth); |
| 4719 | } | 4719 | } |
| @@ -4829,15 +4829,13 @@ class CommonTableRc extends React.Component { | @@ -4829,15 +4829,13 @@ class CommonTableRc extends React.Component { | ||
| 4829 | 操作 | 4829 | 操作 |
| 4830 | <div className={styles.mesOpr}> | 4830 | <div className={styles.mesOpr}> |
| 4831 | {/* 班组报工行车记录 */} | 4831 | {/* 班组报工行车记录 */} |
| 4832 | - {["12710101117087404588200", "12710101117260270570210"].includes( | 4832 | + {(["12710101117087404588200", "12710101117260270570210"].includes( |
| 4833 | props.formId | 4833 | props.formId |
| 4834 | - ) && props.name === "table0" ? ( | ||
| 4835 | - // || | ||
| 4836 | - // (props.formId === "12710101117087371044360" && | ||
| 4837 | - // props.name === "slave0") | 4834 | + ) && props.name === "table0") || |
| 4835 | + (props.formId === "12710101117087371044360" && props.name === "slave0") ? ( | ||
| 4838 | <Button | 4836 | <Button |
| 4839 | className={styles.mesCopy} | 4837 | className={styles.mesCopy} |
| 4840 | - disabled={!props.data.length} | 4838 | + disabled={!props.data?.filter(item => props.selectedRowKeys?.includes(item.sId)).some(item => item.bCanBeCopy)} |
| 4841 | style={{ width: "auto", height: 32, fontSize: 16 }} | 4839 | style={{ width: "auto", height: 32, fontSize: 16 }} |
| 4842 | // icon={<CopyOutlined />} | 4840 | // icon={<CopyOutlined />} |
| 4843 | onClick={async e => { | 4841 | onClick={async e => { |
| @@ -4938,7 +4936,7 @@ class CommonTableRc extends React.Component { | @@ -4938,7 +4936,7 @@ class CommonTableRc extends React.Component { | ||
| 4938 | cancelText: "取消", | 4936 | cancelText: "取消", |
| 4939 | onOk() { | 4937 | onOk() { |
| 4940 | props.parentProps.onExecInstructSet({ | 4938 | props.parentProps.onExecInstructSet({ |
| 4941 | - nextProps: { ...props, table0Data: table0DataNew }, | 4939 | + nextProps: { ...props, [`${props.name}Data`]: table0DataNew }, |
| 4942 | btnConfig: { | 4940 | btnConfig: { |
| 4943 | showName: "保存", | 4941 | showName: "保存", |
| 4944 | sInstruct: JSON.stringify([ | 4942 | sInstruct: JSON.stringify([ |
| @@ -4948,7 +4946,7 @@ class CommonTableRc extends React.Component { | @@ -4948,7 +4946,7 @@ class CommonTableRc extends React.Component { | ||
| 4948 | data: [ | 4946 | data: [ |
| 4949 | { | 4947 | { |
| 4950 | tablename: "mftproductionreportslave", | 4948 | tablename: "mftproductionreportslave", |
| 4951 | - srcDataset: "table0" | 4949 | + srcDataset: props.name |
| 4952 | } | 4950 | } |
| 4953 | ] | 4951 | ] |
| 4954 | }, | 4952 | }, |
| @@ -6942,7 +6940,7 @@ class CommonTableRc extends React.Component { | @@ -6942,7 +6940,7 @@ class CommonTableRc extends React.Component { | ||
| 6942 | if ( this.props.parentProps.slaveConfig.sId == "12710101117056272345580" && tbName === "slave" ) { | 6940 | if ( this.props.parentProps.slaveConfig.sId == "12710101117056272345580" && tbName === "slave" ) { |
| 6943 | let newTableData = tableData.filter(e => e.sBoardName) || []; | 6941 | let newTableData = tableData.filter(e => e.sBoardName) || []; |
| 6944 | 6942 | ||
| 6945 | - | 6943 | + |
| 6946 | // 如果版号已存在则过滤 | 6944 | // 如果版号已存在则过滤 |
| 6947 | // const result = selectData.filter(item1 =>!newTableData.some(item2 => item2.sBoardName === item1.sBoardName)); | 6945 | // const result = selectData.filter(item1 =>!newTableData.some(item2 => item2.sBoardName === item1.sBoardName)); |
| 6948 | let newSelectData = selectData.map((item, index) => { | 6946 | let newSelectData = selectData.map((item, index) => { |
| @@ -6974,7 +6972,7 @@ class CommonTableRc extends React.Component { | @@ -6974,7 +6972,7 @@ class CommonTableRc extends React.Component { | ||
| 6974 | 6972 | ||
| 6975 | 6973 | ||
| 6976 | 6974 | ||
| 6977 | - | 6975 | + |
| 6978 | 6976 | ||
| 6979 | selectData.forEach((item, index) => { | 6977 | selectData.forEach((item, index) => { |
| 6980 | const newCopyTo = {}; | 6978 | const newCopyTo = {}; |
| @@ -8835,9 +8833,9 @@ class CommonTableRc extends React.Component { | @@ -8835,9 +8833,9 @@ class CommonTableRc extends React.Component { | ||
| 8835 | if (showTypeNewProps.enabled) { | 8833 | if (showTypeNewProps.enabled) { |
| 8836 | if ( | 8834 | if ( |
| 8837 | (props.name === "table131" && | 8835 | (props.name === "table131" && |
| 8838 | - ["dProcessCalQty", "dTimeHour"].includes(sName)) || | 8836 | + ["dProcessCalQty", "dOvertimeHour", "dTimeHour"].includes(sName)) || |
| 8839 | (props.name === "table132" && | 8837 | (props.name === "table132" && |
| 8840 | - ["dWageHour", "dTimeHour"].includes(sName)) | 8838 | + ["dWageHour", "dOvertimeHour", "dTimeHour"].includes(sName)) |
| 8841 | ) { | 8839 | ) { |
| 8842 | // 人检/包装特殊处理 | 8840 | // 人检/包装特殊处理 |
| 8843 | res = ( | 8841 | res = ( |
| @@ -11913,7 +11911,7 @@ const useCommonTableEvent = props => { | @@ -11913,7 +11911,7 @@ const useCommonTableEvent = props => { | ||
| 11913 | <div className={styles.totalDiv}> | 11911 | <div className={styles.totalDiv}> |
| 11914 | <div className="total">已报合计</div> | 11912 | <div className="total">已报合计</div> |
| 11915 | <div className="totalName">计件工时:</div> | 11913 | <div className="totalName">计件工时:</div> |
| 11916 | - <div className="totalValue">{dWageHour}</div> | 11914 | + <div className="totalValue">{dWageHour.toFixed(2)}</div> |
| 11917 | <div className="totalName">计时工时:</div> | 11915 | <div className="totalName">计时工时:</div> |
| 11918 | <div className="totalValue">{dTimeHour}</div> | 11916 | <div className="totalValue">{dTimeHour}</div> |
| 11919 | <div className="totalName">报工产量:</div> | 11917 | <div className="totalName">报工产量:</div> |
| @@ -11925,6 +11923,58 @@ const useCommonTableEvent = props => { | @@ -11925,6 +11923,58 @@ const useCommonTableEvent = props => { | ||
| 11925 | }; | 11923 | }; |
| 11926 | } | 11924 | } |
| 11927 | 11925 | ||
| 11926 | + if (["12710101117087404588200"].includes(props.formId) && props.name === "table1") { | ||
| 11927 | + | ||
| 11928 | + const headerColumn = props.headerColumn || []; | ||
| 11929 | + | ||
| 11930 | + // 获取需要合计的列配置(bSum=true的列) | ||
| 11931 | + const sumColumns = headerColumn?.filter(col => col.dataIndex.indexOf('Report') > -1 && col.bSum === true || col.bSum === 1) || []; | ||
| 11932 | + | ||
| 11933 | + addState.getTotalDiv = () => { | ||
| 11934 | + // 初始化合计对象,根据sumColumns动态生成初始值 | ||
| 11935 | + const initialValues = sumColumns.reduce((obj, col) => { | ||
| 11936 | + obj[col.dataIndex] = 0; | ||
| 11937 | + return obj; | ||
| 11938 | + }, {}); | ||
| 11939 | + | ||
| 11940 | + // 动态计算合计值 | ||
| 11941 | + const totalData = data.reduce((pre, item) => { | ||
| 11942 | + sumColumns.forEach(col => { | ||
| 11943 | + const dataIndex = col.dataIndex; | ||
| 11944 | + if (item[dataIndex] !== undefined && item[dataIndex] !== null) { | ||
| 11945 | + pre[dataIndex] += Number(item[dataIndex]) || 0; | ||
| 11946 | + } | ||
| 11947 | + }); | ||
| 11948 | + return pre; | ||
| 11949 | + }, initialValues); | ||
| 11950 | + | ||
| 11951 | + return ( | ||
| 11952 | + <div className={styles.totalDiv}> | ||
| 11953 | + <div className="total">已报合计</div> | ||
| 11954 | + {sumColumns.map((col, index) => { | ||
| 11955 | + const value = totalData[col.dataIndex]; | ||
| 11956 | + // 根据数值类型决定是否保留两位小数 | ||
| 11957 | + const displayValue = typeof value === 'number' && !Number.isInteger(value) | ||
| 11958 | + ? value.toFixed(2) | ||
| 11959 | + : value; | ||
| 11960 | + | ||
| 11961 | + return ( | ||
| 11962 | + <> | ||
| 11963 | + <div key={`totalName-${index}`} className="totalName"> | ||
| 11964 | + {col.title}: | ||
| 11965 | + </div> | ||
| 11966 | + <div key={`totalValue-${index}`} className="totalValue"> | ||
| 11967 | + {displayValue} | ||
| 11968 | + </div> | ||
| 11969 | + </> | ||
| 11970 | + ); | ||
| 11971 | + })} | ||
| 11972 | + </div> | ||
| 11973 | + ); | ||
| 11974 | + }; | ||
| 11975 | + } | ||
| 11976 | + | ||
| 11977 | + | ||
| 11928 | if ( | 11978 | if ( |
| 11929 | ["12710101117087404588200", "12710101117260270570210"].includes( | 11979 | ["12710101117087404588200", "12710101117260270570210"].includes( |
| 11930 | props.formId | 11980 | props.formId |
src/components/Common/commonFunc.js
| @@ -102,6 +102,7 @@ export function getHeaderConfig(config) { | @@ -102,6 +102,7 @@ export function getHeaderConfig(config) { | ||
| 102 | sTitleBgColor: child.sFontBgColor, /* 设置表格标题背景颜色 */ | 102 | sTitleBgColor: child.sFontBgColor, /* 设置表格标题背景颜色 */ |
| 103 | sTitleColor: child.sFontColor, /* 设置表格标题字体颜色 */ | 103 | sTitleColor: child.sFontColor, /* 设置表格标题字体颜色 */ |
| 104 | bCheckBox: child.bCheckBox, /* 是否支持表头多选 */ | 104 | bCheckBox: child.bCheckBox, /* 是否支持表头多选 */ |
| 105 | + bSum: child.bSum, /* 是否合计 */ | ||
| 105 | }); | 106 | }); |
| 106 | } | 107 | } |
| 107 | } | 108 | } |
src/indexNew.less
| @@ -372,6 +372,10 @@ | @@ -372,6 +372,10 @@ | ||
| 372 | border-radius: 5px; | 372 | border-radius: 5px; |
| 373 | height: 40px !important; | 373 | height: 40px !important; |
| 374 | } | 374 | } |
| 375 | + | ||
| 376 | + .ant-select-selection-item { | ||
| 377 | + font-size: 18px; | ||
| 378 | + } | ||
| 375 | } | 379 | } |
| 376 | 380 | ||
| 377 | .ant-btn-primary[disabled], | 381 | .ant-btn-primary[disabled], |
src/mes/common/RunningStatus/index.js
| 1 | /* | 1 | /* |
| 2 | - * @Author: Sakura | 2 | + * @Author: Sakura |
| 3 | * @LastEditors: Sakura | 3 | * @LastEditors: Sakura |
| 4 | - * @Date: 2024-02-28 9:55:04 | ||
| 5 | - * @Description: 设备状态组件 | 4 | + * @Date: 2024-02-28 9:55:04 |
| 5 | + * @Description: 设备状态组件 | ||
| 6 | */ | 6 | */ |
| 7 | -import React, { useEffect, useState } from "react"; | 7 | +import React, { useRef, useEffect, useState } from "react"; |
| 8 | import { Button, message } from "antd"; | 8 | import { Button, message } from "antd"; |
| 9 | import * as commonFunc from "@/components/Common/commonFunc"; | 9 | import * as commonFunc from "@/components/Common/commonFunc"; |
| 10 | import * as commonUtils from "@/utils/utils"; | 10 | import * as commonUtils from "@/utils/utils"; |
| 11 | import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; | 11 | import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; |
| 12 | +import * as commonBusiness from "@/components/Common/commonBusiness"; | ||
| 13 | +import CommonViewTable from "@/components/Common/CommonViewTable"; | ||
| 12 | import ShowType from "@/components/Common/CommonComponent"; | 14 | import ShowType from "@/components/Common/CommonComponent"; |
| 15 | +import ReportInfo from "@/mes/productionExec/noticeModal/reportInfoButton"; | ||
| 13 | import styles from "./index.less"; | 16 | import styles from "./index.less"; |
| 14 | import { cloneDeep } from "lodash"; | 17 | import { cloneDeep } from "lodash"; |
| 15 | 18 | ||
| @@ -56,10 +59,13 @@ const businessTier = props => { | @@ -56,10 +59,13 @@ const businessTier = props => { | ||
| 56 | for (let i = 0; i < formData.length; i++) { | 59 | for (let i = 0; i < formData.length; i++) { |
| 57 | const config = formData[i]; | 60 | const config = formData[i]; |
| 58 | const column = commonFunc.getHeaderConfig(config); | 61 | const column = commonFunc.getHeaderConfig(config); |
| 62 | + if (i === 1) { | ||
| 63 | + addState.slave2Data = [{ sId: commonUtils.createSid() }]; | ||
| 64 | + } | ||
| 59 | addState = { | 65 | addState = { |
| 60 | ...addState, | 66 | ...addState, |
| 61 | - [`slave${i}Column`]: column, | ||
| 62 | - [`slave${i}Config`]: config | 67 | + [`slave${i > 0 ? i + 1 : i}Column`]: column, |
| 68 | + [`slave${i > 0 ? i + 1 : i}Config`]: config | ||
| 63 | }; | 69 | }; |
| 64 | } | 70 | } |
| 65 | if (isWait) { | 71 | if (isWait) { |
| @@ -150,18 +156,39 @@ const RunningStatusModal = _props => { | @@ -150,18 +156,39 @@ const RunningStatusModal = _props => { | ||
| 150 | const addState = { | 156 | const addState = { |
| 151 | [`${tableName}SelectedRowKeys`]: [sId], | 157 | [`${tableName}SelectedRowKeys`]: [sId], |
| 152 | table1SelectedRowKeys: [sId], | 158 | table1SelectedRowKeys: [sId], |
| 153 | - table1Data: [data] | 159 | + table1Data: [data], |
| 160 | + slave1SelectedRowKeys: [sId], | ||
| 161 | + slave1Data: [data], | ||
| 162 | + slave2Data: [{ sId: commonUtils.createSid() }] | ||
| 154 | }; | 163 | }; |
| 155 | - props.onSaveState(addState); | 164 | + props.onSaveState(addState, (nextProps) => { |
| 165 | + // 如果配置了指令集,调用指令集 | ||
| 166 | + const btnConfig = props[ | ||
| 167 | + `${tableName}Config` | ||
| 168 | + ]?.gdsconfigformslave?.find(item => item.sControlName === "clickOpr"); | ||
| 169 | + | ||
| 170 | + if (btnConfig) { | ||
| 171 | + props.onExecInstructSet({ | ||
| 172 | + btnConfig, | ||
| 173 | + tableLineParams: { | ||
| 174 | + name: tableName, | ||
| 175 | + record: data | ||
| 176 | + }, | ||
| 177 | + nextProps | ||
| 178 | + }); | ||
| 179 | + } | ||
| 180 | + }); | ||
| 181 | + | ||
| 156 | } | 182 | } |
| 157 | }; | 183 | }; |
| 158 | 184 | ||
| 159 | const [record, setRecord] = useState({}); | 185 | const [record, setRecord] = useState({}); |
| 186 | + const [loading, setLoading] = useState(false); | ||
| 160 | const bXingchejiluClick = () => { | 187 | const bXingchejiluClick = () => { |
| 161 | - const { table1Data = [] } = props; | 188 | + const { table1Data = [], slave2Data = [] } = props; |
| 162 | const { tableS1Data = [], tableS1SelectedRowKeys = [] } = props.parentProps; | 189 | const { tableS1Data = [], tableS1SelectedRowKeys = [] } = props.parentProps; |
| 163 | 190 | ||
| 164 | - const rowData1 = { ...table1Data[0], ...record }; | 191 | + const rowData1 = { ...table1Data[0], ...slave2Data[0], ...record }; |
| 165 | const rowData2 = tableS1Data.find( | 192 | const rowData2 = tableS1Data.find( |
| 166 | item => item.sId === tableS1SelectedRowKeys[0] | 193 | item => item.sId === tableS1SelectedRowKeys[0] |
| 167 | ); | 194 | ); |
| @@ -203,16 +230,19 @@ const RunningStatusModal = _props => { | @@ -203,16 +230,19 @@ const RunningStatusModal = _props => { | ||
| 203 | item => item.sName === "sStatusNameSetting" | 230 | item => item.sName === "sStatusNameSetting" |
| 204 | ); | 231 | ); |
| 205 | if (config) { | 232 | if (config) { |
| 206 | - const { table1Data = [] } = props; | ||
| 207 | - props.onTableBtnClick({ | ||
| 208 | - name: "table1", | ||
| 209 | - record: table1Data[0], | ||
| 210 | - config, | ||
| 211 | - onSuccess: () => { | ||
| 212 | - props.parentProps.onSaveState({ refreshDeviceTargetInfo: true }); | ||
| 213 | - props.app.globalFun.onCloseCommonModal({ type: "commonModal" }); | ||
| 214 | - } | ||
| 215 | - }); | 233 | + const { table1Data = [], slave2Data = [] } = props; |
| 234 | + setLoading(true); | ||
| 235 | + setTimeout(() => { | ||
| 236 | + props.onTableBtnClick({ | ||
| 237 | + name: "table1", | ||
| 238 | + record: { ...table1Data[0], ...slave2Data[0] }, | ||
| 239 | + config, | ||
| 240 | + onSuccess: () => { | ||
| 241 | + props.parentProps.onSaveState({ refreshDeviceTargetInfo: true }); | ||
| 242 | + props.app.globalFun.onCloseCommonModal({ type: "commonModal" }); | ||
| 243 | + } | ||
| 244 | + }); | ||
| 245 | + }, 100); | ||
| 216 | } else { | 246 | } else { |
| 217 | message.info("请先配置sStatusNameSetting!"); | 247 | message.info("请先配置sStatusNameSetting!"); |
| 218 | } | 248 | } |
| @@ -222,12 +252,17 @@ const RunningStatusModal = _props => { | @@ -222,12 +252,17 @@ const RunningStatusModal = _props => { | ||
| 222 | className: styles.settingBtn, | 252 | className: styles.settingBtn, |
| 223 | type: "primary", | 253 | type: "primary", |
| 224 | size: "large", | 254 | size: "large", |
| 255 | + disabled: loading, | ||
| 225 | onClick: () => { | 256 | onClick: () => { |
| 226 | if (commonUtils.isEmptyArr(selectedRowKeys)) { | 257 | if (commonUtils.isEmptyArr(selectedRowKeys)) { |
| 227 | message.warning("请先选择一个状态!"); | 258 | message.warning("请先选择一个状态!"); |
| 228 | return; | 259 | return; |
| 229 | } | 260 | } |
| 230 | 261 | ||
| 262 | + if (!commonBusiness.validateTable(props.slave2Config, props.slave2Data, props)) { | ||
| 263 | + return; | ||
| 264 | + } | ||
| 265 | + | ||
| 231 | if (window.bXingchejiluModal) { | 266 | if (window.bXingchejiluModal) { |
| 232 | bXingchejiluClick(); | 267 | bXingchejiluClick(); |
| 233 | return; | 268 | return; |
| @@ -415,10 +450,57 @@ const RunningStatusModal = _props => { | @@ -415,10 +450,57 @@ const RunningStatusModal = _props => { | ||
| 415 | ); | 450 | ); |
| 416 | } | 451 | } |
| 417 | 452 | ||
| 453 | + const [reportInfoVisible, setReportInfoVisible] = useState(false); | ||
| 454 | + const reportRef = useRef(null); | ||
| 455 | + | ||
| 456 | + const handleReportInfo = (config = null) => { | ||
| 457 | + reportRef.current = config; | ||
| 458 | + setReportInfoVisible(!reportInfoVisible); | ||
| 459 | + }; | ||
| 460 | + | ||
| 461 | + const { slave2Config: slave2ConfigOld, slave2Data = [] } = props; | ||
| 462 | + const slave2Config = props.onMergeTableConfig(slave2ConfigOld); | ||
| 463 | + const viewConfigsOld = slave2Config?.gdsconfigformslave?.filter( | ||
| 464 | + item => | ||
| 465 | + item.sName && | ||
| 466 | + item.bControl && | ||
| 467 | + item.sControlName.indexOf("Btn") === -1 && | ||
| 468 | + item.sControlName.indexOf("_") === -1 | ||
| 469 | + ); | ||
| 470 | + | ||
| 471 | + const viewConfigs = cloneDeep(viewConfigsOld); | ||
| 472 | + | ||
| 473 | + const iIndex1 = | ||
| 474 | + viewConfigs?.findIndex(item => item.sName === "bRepairRequest") || -1; | ||
| 475 | + if (iIndex1 !== -1 && !slave2Data[0]?.sAbnormalStatusName?.startsWith("W")) { | ||
| 476 | + viewConfigs[iIndex1].iTag = 1; | ||
| 477 | + } | ||
| 478 | + | ||
| 479 | + const viewProps = { | ||
| 480 | + ...props, | ||
| 481 | + viewConfigs, | ||
| 482 | + tableConfig: slave2Config, | ||
| 483 | + iColValueView: 24, | ||
| 484 | + viewRow: slave2Data[0], | ||
| 485 | + tableName: 'slave2', | ||
| 486 | + enabled: true, | ||
| 487 | + handleReportInfo | ||
| 488 | + }; | ||
| 489 | + | ||
| 418 | return ( | 490 | return ( |
| 419 | <div className={styles.runningContent}> | 491 | <div className={styles.runningContent}> |
| 420 | <RunningContent {...contentProps} /> | 492 | <RunningContent {...contentProps} /> |
| 421 | {TimeComponent} | 493 | {TimeComponent} |
| 494 | + <div className={styles.runningForm}> | ||
| 495 | + <CommonViewTable {...viewProps} /> | ||
| 496 | + <ReportInfo | ||
| 497 | + reportInfoVisible={reportInfoVisible} | ||
| 498 | + handleReportInfo={handleReportInfo} | ||
| 499 | + {...props} | ||
| 500 | + reportRef={reportRef.current || {}} | ||
| 501 | + hasShowInfo={viewProps.viewRow} | ||
| 502 | + /> | ||
| 503 | + </div> | ||
| 422 | <Button {...btnProps}> | 504 | <Button {...btnProps}> |
| 423 | {window.deviceTargetInfoModal ? "确定" : "设置"} | 505 | {window.deviceTargetInfoModal ? "确定" : "设置"} |
| 424 | </Button> | 506 | </Button> |
| @@ -538,13 +620,16 @@ const RunningContent = props => { | @@ -538,13 +620,16 @@ const RunningContent = props => { | ||
| 538 | status: [ | 620 | status: [ |
| 539 | ...group.filter((_, index) => index >= i * 6 && index < i * 6 + 6) | 621 | ...group.filter((_, index) => index >= i * 6 && index < i * 6 + 6) |
| 540 | ].map(rowData => { | 622 | ].map(rowData => { |
| 541 | - const { sStatusName, sId } = rowData; | 623 | + const { sStatusName, sId, sResponsibilityType, sResponsibilityColor } = rowData; |
| 542 | const [name, status] = sStatusName.split(" "); | 624 | const [name, status] = sStatusName.split(" "); |
| 543 | return { | 625 | return { |
| 544 | name, | 626 | name, |
| 545 | status, | 627 | status, |
| 546 | className: selectedRowKeys.includes(sId) ? classNameTd : "", | 628 | className: selectedRowKeys.includes(sId) ? classNameTd : "", |
| 547 | - rowData: { ...rowData, sClassifyName1: title } | 629 | + rowData: { ...rowData, sClassifyName1: title }, |
| 630 | + // 添加停机原因字段 | ||
| 631 | + responsibilityType: sResponsibilityType || "", | ||
| 632 | + responsibilityColor: sResponsibilityColor || "" | ||
| 548 | }; | 633 | }; |
| 549 | }) | 634 | }) |
| 550 | }; | 635 | }; |
| @@ -563,6 +648,55 @@ const RunningContent = props => { | @@ -563,6 +648,55 @@ const RunningContent = props => { | ||
| 563 | [JSON.stringify(dataList), JSON.stringify(selectedRowKeys)] | 648 | [JSON.stringify(dataList), JSON.stringify(selectedRowKeys)] |
| 564 | ); | 649 | ); |
| 565 | 650 | ||
| 651 | + | ||
| 652 | + // 计算停机原因的rowspan | ||
| 653 | + const calculateResponsibilityRowspan = (data) => { | ||
| 654 | + const rowspans = []; | ||
| 655 | + const colors = []; // 存储每行的颜色 | ||
| 656 | + let currentValue = null; | ||
| 657 | + let currentColor = null; | ||
| 658 | + let currentCount = 0; | ||
| 659 | + let startIndex = 0; | ||
| 660 | + | ||
| 661 | + // 遍历所有行,计算连续的相同responsibilityType的行数 | ||
| 662 | + for (let i = 0; i < data.length; i++) { | ||
| 663 | + const trData = data[i]; | ||
| 664 | + const responsibilityType = trData.status[0]?.responsibilityType || ""; | ||
| 665 | + const responsibilityColor = trData.status[0]?.responsibilityColor || ""; | ||
| 666 | + | ||
| 667 | + if (responsibilityType === currentValue) { | ||
| 668 | + currentCount++; | ||
| 669 | + } else { | ||
| 670 | + // 处理前一段相同值 | ||
| 671 | + if (currentValue !== null) { | ||
| 672 | + for (let j = startIndex; j < startIndex + currentCount; j++) { | ||
| 673 | + rowspans[j] = j === startIndex ? currentCount : 0; | ||
| 674 | + colors[j] = currentColor; // 设置颜色 | ||
| 675 | + } | ||
| 676 | + } | ||
| 677 | + | ||
| 678 | + // 开始新的计数 | ||
| 679 | + currentValue = responsibilityType; | ||
| 680 | + currentColor = responsibilityColor; | ||
| 681 | + currentCount = 1; | ||
| 682 | + startIndex = i; | ||
| 683 | + } | ||
| 684 | + } | ||
| 685 | + | ||
| 686 | + // 处理最后一段 | ||
| 687 | + if (currentValue !== null) { | ||
| 688 | + for (let j = startIndex; j < startIndex + currentCount; j++) { | ||
| 689 | + rowspans[j] = j === startIndex ? currentCount : 0; | ||
| 690 | + colors[j] = currentColor; // 设置颜色 | ||
| 691 | + } | ||
| 692 | + } | ||
| 693 | + | ||
| 694 | + return { rowspans, colors }; | ||
| 695 | + }; | ||
| 696 | + | ||
| 697 | + | ||
| 698 | + | ||
| 699 | + | ||
| 566 | const pattern = title => { | 700 | const pattern = title => { |
| 567 | const regex = /(.+?)\((.+)\)/; | 701 | const regex = /(.+?)\((.+)\)/; |
| 568 | const result = title.match(regex); | 702 | const result = title.match(regex); |
| @@ -578,14 +712,31 @@ const RunningContent = props => { | @@ -578,14 +712,31 @@ const RunningContent = props => { | ||
| 578 | return title; | 712 | return title; |
| 579 | } | 713 | } |
| 580 | }; | 714 | }; |
| 715 | + // 计算停机原因的rowspan数组和颜色数组 | ||
| 716 | + const { rowspans: responsibilityRowspans, colors: responsibilityColors } = calculateResponsibilityRowspan(data); | ||
| 581 | 717 | ||
| 582 | return ( | 718 | return ( |
| 583 | <div | 719 | <div |
| 584 | className={props.bModal ? styles.runStatusTable1 : styles.runStatusTable} | 720 | className={props.bModal ? styles.runStatusTable1 : styles.runStatusTable} |
| 585 | > | 721 | > |
| 586 | <table border={"1px"}> | 722 | <table border={"1px"}> |
| 587 | - {data.map(trData => ( | 723 | + {data.map((trData, trIndex) => ( |
| 588 | <tr> | 724 | <tr> |
| 725 | + {/* 第一列:停机原因列 */} | ||
| 726 | + {responsibilityRowspans[trIndex] > 0 && ( | ||
| 727 | + <td | ||
| 728 | + className={`tdTitleContent ${trData.status[0]?.className || ""}`} | ||
| 729 | + rowspan={responsibilityRowspans[trIndex]} | ||
| 730 | + style={{ | ||
| 731 | + backgroundColor: responsibilityColors[trIndex] || 'transparent' | ||
| 732 | + }} | ||
| 733 | + | ||
| 734 | + > | ||
| 735 | + <div> | ||
| 736 | + <p>{trData.status[0]?.responsibilityType || ""}</p> | ||
| 737 | + </div> | ||
| 738 | + </td> | ||
| 739 | + )} | ||
| 589 | {trData.type === 1 && ( | 740 | {trData.type === 1 && ( |
| 590 | <td | 741 | <td |
| 591 | className={`${trData.className} tdTitle`} | 742 | className={`${trData.className} tdTitle`} |
src/mes/common/RunningStatus/index.less
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | 10 | ||
| 11 | .runningContent { | 11 | .runningContent { |
| 12 | .size(); | 12 | .size(); |
| 13 | + overflow: auto; | ||
| 13 | 14 | ||
| 14 | .showType { | 15 | .showType { |
| 15 | .size(100%, 68px); | 16 | .size(100%, 68px); |
| @@ -45,7 +46,7 @@ | @@ -45,7 +46,7 @@ | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | .input12 { | 48 | .input12 { |
| 48 | - .size(50%, auto); | 49 | + // .size(50%, auto); |
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | .mesInputBlueBg, | 52 | .mesInputBlueBg, |
| @@ -53,10 +54,14 @@ | @@ -53,10 +54,14 @@ | ||
| 53 | display: none; | 54 | display: none; |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | - .ant-form-item-control { | 57 | + .table-title-formStyle { |
| 58 | + top: 29.5px; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + .ant-form-item-control, .ant-form-item-control-input { | ||
| 57 | height: 68px !important; | 62 | height: 68px !important; |
| 58 | - flex-basis: 80% !important; | ||
| 59 | - max-width: 80% !important; | 63 | + flex-basis: calc(100% - 90px) !important; |
| 64 | + max-width: calc(100% - 90px) !important; | ||
| 60 | 65 | ||
| 61 | .ant-picker-input { | 66 | .ant-picker-input { |
| 62 | height: 60px; | 67 | height: 60px; |
src/mes/common/commonModelComponent/index.js
| @@ -262,6 +262,18 @@ const useCommonModelEvent = props => { | @@ -262,6 +262,18 @@ const useCommonModelEvent = props => { | ||
| 262 | delete tabConfigFilter[0].configList[1].children[2].configList[7]; | 262 | delete tabConfigFilter[0].configList[1].children[2].configList[7]; |
| 263 | } catch (error) {} | 263 | } catch (error) {} |
| 264 | } | 264 | } |
| 265 | + | ||
| 266 | + tabConfigFilter[0].configList[0].children[1].configList = tabConfigFilter[0].configList[0].children[1].configList.filter(item => !!item); | ||
| 267 | + | ||
| 268 | + [ | ||
| 269 | + tabConfigFilter[0].configList[0].children[1].configList[0], | ||
| 270 | + tabConfigFilter[0].configList[0].children[1].configList[1] | ||
| 271 | + ] = | ||
| 272 | + [ | ||
| 273 | + tabConfigFilter[0].configList[0].children[1].configList[1], | ||
| 274 | + tabConfigFilter[0].configList[0].children[1].configList[0] | ||
| 275 | + ]; | ||
| 276 | + | ||
| 265 | return [tableListFilter, tabConfigFilter]; | 277 | return [tableListFilter, tabConfigFilter]; |
| 266 | }; | 278 | }; |
| 267 | 279 | ||
| @@ -574,10 +586,12 @@ const useCommonModelEvent = props => { | @@ -574,10 +586,12 @@ const useCommonModelEvent = props => { | ||
| 574 | runningTime = isBefore8AM | 586 | runningTime = isBefore8AM |
| 575 | ? now.subtract(1, "days").format("YYYY-MM-DD") | 587 | ? now.subtract(1, "days").format("YYYY-MM-DD") |
| 576 | : now.format("YYYY-MM-DD"), | 588 | : now.format("YYYY-MM-DD"), |
| 577 | - runningShift = props.app?.userinfo?.sShift.toString() | 589 | + runningShift = props.app?.userinfo?.sShift.toString(), |
| 590 | + iShowType = 1 | ||
| 578 | } = props; | 591 | } = props; |
| 579 | conditonValues.tCreateTime = runningTime; | 592 | conditonValues.tCreateTime = runningTime; |
| 580 | conditonValues.sShiftNew = runningShift; | 593 | conditonValues.sShiftNew = runningShift; |
| 594 | + conditonValues.iShowType = iShowType; | ||
| 581 | } | 595 | } |
| 582 | 596 | ||
| 583 | //【班组报工特殊处理】历史日报查看详情如果班组报工没查到数据,用sSReserve1当历史日报的sId | 597 | //【班组报工特殊处理】历史日报查看详情如果班组报工没查到数据,用sSReserve1当历史日报的sId |
| @@ -698,9 +712,9 @@ const useCommonModelEvent = props => { | @@ -698,9 +712,9 @@ const useCommonModelEvent = props => { | ||
| 698 | 712 | ||
| 699 | //【班组报工特殊处理】历史日报查看详情如果班组报工没查到数据,用sSReserve1当历史日报的sId | 713 | //【班组报工特殊处理】历史日报查看详情如果班组报工没查到数据,用sSReserve1当历史日报的sId |
| 700 | if ( | 714 | if ( |
| 701 | - refreshTableList.length === 1 && | 715 | + refreshTableList?.length === 1 && |
| 702 | refreshTableList[0] === "table0" && | 716 | refreshTableList[0] === "table0" && |
| 703 | - !addState.table0Data.length && | 717 | + !addState.table0Data?.length && |
| 704 | props.sSReserve1 | 718 | props.sSReserve1 |
| 705 | ) { | 719 | ) { |
| 706 | addState.refreshTableList = ["tableS0"]; | 720 | addState.refreshTableList = ["tableS0"]; |
| @@ -1106,7 +1120,7 @@ const useComputedCommonDivHeight = props => { | @@ -1106,7 +1120,7 @@ const useComputedCommonDivHeight = props => { | ||
| 1106 | ) { | 1120 | ) { |
| 1107 | returnHeight = `calc(${returnHeight} - 40px)`; | 1121 | returnHeight = `calc(${returnHeight} - 40px)`; |
| 1108 | } | 1122 | } |
| 1109 | - | 1123 | + |
| 1110 | // 下料界面板材信息 | 1124 | // 下料界面板材信息 |
| 1111 | if(sTabName=='版材信息'){ | 1125 | if(sTabName=='版材信息'){ |
| 1112 | returnHeight = `calc(100% - 10px)`; | 1126 | returnHeight = `calc(100% - 10px)`; |
| @@ -1253,7 +1267,11 @@ const CommonModelComponent = props => { | @@ -1253,7 +1267,11 @@ const CommonModelComponent = props => { | ||
| 1253 | bFirstComponent: level === 0 && index === -1 | 1267 | bFirstComponent: level === 0 && index === -1 |
| 1254 | }; | 1268 | }; |
| 1255 | 1269 | ||
| 1256 | - const commonDivHeight = useComputedCommonDivHeight(componentProps); | 1270 | + let commonDivHeight = useComputedCommonDivHeight(componentProps); |
| 1271 | + | ||
| 1272 | + if(sName === 'table1'){ | ||
| 1273 | + commonDivHeight = "calc(calc(100% - 50px))"; | ||
| 1274 | + } | ||
| 1257 | return ( | 1275 | return ( |
| 1258 | <div | 1276 | <div |
| 1259 | className={`commonDiv ${sName}`} | 1277 | className={`commonDiv ${sName}`} |
| @@ -1478,7 +1496,7 @@ const CommonViewTableComponent = props => { | @@ -1478,7 +1496,7 @@ const CommonViewTableComponent = props => { | ||
| 1478 | const config = props.onMergeTableConfig(configOld); | 1496 | const config = props.onMergeTableConfig(configOld); |
| 1479 | 1497 | ||
| 1480 | const { gdsconfigformslave: gdsconfigformslaveOld = [] } = config; | 1498 | const { gdsconfigformslave: gdsconfigformslaveOld = [] } = config; |
| 1481 | - const gdsconfigformslave = cloneDeep(gdsconfigformslaveOld); | 1499 | + let gdsconfigformslave = cloneDeep(gdsconfigformslaveOld); |
| 1482 | 1500 | ||
| 1483 | // 展示的数据 | 1501 | // 展示的数据 |
| 1484 | let viewRow = {}; | 1502 | let viewRow = {}; |
| @@ -1538,6 +1556,8 @@ const CommonViewTableComponent = props => { | @@ -1538,6 +1556,8 @@ const CommonViewTableComponent = props => { | ||
| 1538 | }); | 1556 | }); |
| 1539 | } | 1557 | } |
| 1540 | }); | 1558 | }); |
| 1559 | + | ||
| 1560 | + gdsconfigformslave = props.onMergeTableConfig({ ...configOld, gdsconfigformslave }).gdsconfigformslave; | ||
| 1541 | } | 1561 | } |
| 1542 | } | 1562 | } |
| 1543 | 1563 | ||
| @@ -1601,7 +1621,7 @@ const CommonViewTableComponent = props => { | @@ -1601,7 +1621,7 @@ const CommonViewTableComponent = props => { | ||
| 1601 | 1621 | ||
| 1602 | if(viewProps.tableS0Data && viewProps.tableS0Data.length!==0){ | 1622 | if(viewProps.tableS0Data && viewProps.tableS0Data.length!==0){ |
| 1603 | viewProps.reportPeopleSelectedRowKeys = viewProps.tableS0Data[0].sMainAssistantTransId?.split(",") | 1623 | viewProps.reportPeopleSelectedRowKeys = viewProps.tableS0Data[0].sMainAssistantTransId?.split(",") |
| 1604 | - | 1624 | + |
| 1605 | } | 1625 | } |
| 1606 | 1626 | ||
| 1607 | if (commonUtils.isEmptyObject(viewRow)) { | 1627 | if (commonUtils.isEmptyObject(viewRow)) { |
| @@ -1619,8 +1639,8 @@ const CommonViewTableComponent = props => { | @@ -1619,8 +1639,8 @@ const CommonViewTableComponent = props => { | ||
| 1619 | reportRef={reportRef.current || {}} | 1639 | reportRef={reportRef.current || {}} |
| 1620 | hasShowInfo={viewProps.viewRow} | 1640 | hasShowInfo={viewProps.viewRow} |
| 1621 | /> | 1641 | /> |
| 1622 | - | ||
| 1623 | - | 1642 | + |
| 1643 | + | ||
| 1624 | </> | 1644 | </> |
| 1625 | ); | 1645 | ); |
| 1626 | })} | 1646 | })} |
| @@ -1926,7 +1946,15 @@ const CommonRepairComponent = props => { | @@ -1926,7 +1946,15 @@ const CommonRepairComponent = props => { | ||
| 1926 | const viewProps = { | 1946 | const viewProps = { |
| 1927 | ...props, | 1947 | ...props, |
| 1928 | enabled, | 1948 | enabled, |
| 1929 | - viewConfigs: filterConfig.map(item => ({ ...item, iColValue: 24 })), | 1949 | + viewConfigs: filterConfig.map(item => { |
| 1950 | + if (item.sName === 'dAdvanceReportQty') { | ||
| 1951 | + return { | ||
| 1952 | + ...item, | ||
| 1953 | + iTag: viewRow.bAutoReport ? 1 : 3 | ||
| 1954 | + } | ||
| 1955 | + } | ||
| 1956 | + return item; | ||
| 1957 | + }).map(item => ({ ...item, iColValue: 24 })), | ||
| 1930 | tableConfig: config, | 1958 | tableConfig: config, |
| 1931 | iColValueView: 24, | 1959 | iColValueView: 24, |
| 1932 | viewRow, | 1960 | viewRow, |
| @@ -2098,6 +2126,8 @@ const RunningStatusConditionComponent = props => { | @@ -2098,6 +2126,8 @@ const RunningStatusConditionComponent = props => { | ||
| 2098 | : now | 2126 | : now |
| 2099 | ); | 2127 | ); |
| 2100 | 2128 | ||
| 2129 | + const [iShowType, setShowType] = useState(1); | ||
| 2130 | + | ||
| 2101 | const flag = useRef(false); | 2131 | const flag = useRef(false); |
| 2102 | useEffect( | 2132 | useEffect( |
| 2103 | () => { | 2133 | () => { |
| @@ -2106,12 +2136,13 @@ const RunningStatusConditionComponent = props => { | @@ -2106,12 +2136,13 @@ const RunningStatusConditionComponent = props => { | ||
| 2106 | props.onSaveState({ | 2136 | props.onSaveState({ |
| 2107 | runningTime: dateValue.format("YYYY-MM-DD"), | 2137 | runningTime: dateValue.format("YYYY-MM-DD"), |
| 2108 | runningShift: value, | 2138 | runningShift: value, |
| 2139 | + iShowType, | ||
| 2109 | refreshTableList: ["table0"], | 2140 | refreshTableList: ["table0"], |
| 2110 | runningStatusConditionFlag: true // 行车记录修改时间标记 | 2141 | runningStatusConditionFlag: true // 行车记录修改时间标记 |
| 2111 | }); | 2142 | }); |
| 2112 | } | 2143 | } |
| 2113 | }, | 2144 | }, |
| 2114 | - [value, dateValue] | 2145 | + [value, dateValue, iShowType] |
| 2115 | ); | 2146 | ); |
| 2116 | 2147 | ||
| 2117 | const [visible, setVisible] = useState(false); | 2148 | const [visible, setVisible] = useState(false); |
| @@ -2193,9 +2224,19 @@ const RunningStatusConditionComponent = props => { | @@ -2193,9 +2224,19 @@ const RunningStatusConditionComponent = props => { | ||
| 2193 | } | 2224 | } |
| 2194 | }; | 2225 | }; |
| 2195 | 2226 | ||
| 2227 | + const handleSwitchShowType = (e) => { | ||
| 2228 | + const { value } = e.target; | ||
| 2229 | + flag.current = true; | ||
| 2230 | + setShowType(value); | ||
| 2231 | + } | ||
| 2232 | + | ||
| 2196 | return ( | 2233 | return ( |
| 2197 | <div className={styles.runningStatusCondition}> | 2234 | <div className={styles.runningStatusCondition}> |
| 2198 | <Space size={15}> | 2235 | <Space size={15}> |
| 2236 | + <Radio.Group defaultValue={0} buttonStyle="solid" size="large" onChange={handleSwitchShowType}> | ||
| 2237 | + <Radio.Button value={0}>未上报</Radio.Button> | ||
| 2238 | + <Radio.Button value={1}>全部</Radio.Button> | ||
| 2239 | + </Radio.Group> | ||
| 2199 | <DatePicker | 2240 | <DatePicker |
| 2200 | value={dateValue} | 2241 | value={dateValue} |
| 2201 | format="YYYY-MM-DD" | 2242 | format="YYYY-MM-DD" |
src/mes/common/siderInfoComponent/clockComponent/index.js
| 1 | import React, { useEffect, useRef, useState } from "react"; | 1 | import React, { useEffect, useRef, useState } from "react"; |
| 2 | import { Modal } from "antd"; | 2 | import { Modal } from "antd"; |
| 3 | import Draggable from "react-draggable"; | 3 | import Draggable from "react-draggable"; |
| 4 | +import * as commonUtils from "@/utils/utils"; | ||
| 4 | 5 | ||
| 5 | import styles from "./index.less"; | 6 | import styles from "./index.less"; |
| 6 | 7 | ||
| @@ -11,20 +12,22 @@ const ClockComponent = ({ num: numNew = 0, ...props }) => { | @@ -11,20 +12,22 @@ const ClockComponent = ({ num: numNew = 0, ...props }) => { | ||
| 11 | const [disabled, setDisabled] = useState(true); | 12 | const [disabled, setDisabled] = useState(true); |
| 12 | const [bounds, setBounds] = useState({ left: 0, top: 0, bottom: 0, right: 0 }); | 13 | const [bounds, setBounds] = useState({ left: 0, top: 0, bottom: 0, right: 0 }); |
| 13 | const draggleRef = useRef(null); | 14 | const draggleRef = useRef(null); |
| 15 | + const [freshCount, setFreshCount] = useState(0); | ||
| 14 | 16 | ||
| 15 | const [data, setData] = useState([]); | 17 | const [data, setData] = useState([]); |
| 16 | 18 | ||
| 17 | useEffect( | 19 | useEffect( |
| 18 | () => { | 20 | () => { |
| 19 | if (ModalVisible) { | 21 | if (ModalVisible) { |
| 22 | + const changeExecInfoNew = commonUtils.getAppData("changeExecInfo"); | ||
| 20 | const deviceTargetInfoDataPart = [ | 23 | const deviceTargetInfoDataPart = [ |
| 21 | - { ...(props.deviceTargetInfoData?.[0] || {}) }, | 24 | + { ...(props.deviceTargetInfoData?.[0] || {}), ...changeExecInfoNew }, |
| 22 | ...(data || []) | 25 | ...(data || []) |
| 23 | ].slice(0, 30); // 弹框展示内容 | 26 | ].slice(0, 30); // 弹框展示内容 |
| 24 | setData(deviceTargetInfoDataPart); | 27 | setData(deviceTargetInfoDataPart); |
| 25 | } | 28 | } |
| 26 | }, | 29 | }, |
| 27 | - [props.deviceTargetInfoData, ModalVisible] | 30 | + [props.deviceTargetInfoData, freshCount, ModalVisible] |
| 28 | ); | 31 | ); |
| 29 | 32 | ||
| 30 | const timer = useRef(null); | 33 | const timer = useRef(null); |
| @@ -33,6 +36,7 @@ const ClockComponent = ({ num: numNew = 0, ...props }) => { | @@ -33,6 +36,7 @@ const ClockComponent = ({ num: numNew = 0, ...props }) => { | ||
| 33 | if (numNew === 0) return; | 36 | if (numNew === 0) return; |
| 34 | if (num === numNew) return; | 37 | if (num === numNew) return; |
| 35 | 38 | ||
| 39 | + setFreshCount(pre => pre + 1); | ||
| 36 | if (num === 0 && numNew > 0) { | 40 | if (num === 0 && numNew > 0) { |
| 37 | setNum(numNew); | 41 | setNum(numNew); |
| 38 | return; | 42 | return; |
src/mes/indexMes/index.js
| @@ -22,10 +22,13 @@ import { | @@ -22,10 +22,13 @@ import { | ||
| 22 | Input, | 22 | Input, |
| 23 | Divider, | 23 | Divider, |
| 24 | message, | 24 | message, |
| 25 | - Button | 25 | + Button, |
| 26 | + Form, | ||
| 27 | + DatePicker, | ||
| 28 | + Select, | ||
| 26 | } from "antd"; | 29 | } from "antd"; |
| 27 | import { | 30 | import { |
| 28 | - UndoOutlined, | 31 | + CloseOutlined, |
| 29 | UserAddOutlined, | 32 | UserAddOutlined, |
| 30 | SwapOutlined, | 33 | SwapOutlined, |
| 31 | AppstoreOutlined | 34 | AppstoreOutlined |
| @@ -102,9 +105,8 @@ const OpenModalEditPwd = props => { | @@ -102,9 +105,8 @@ const OpenModalEditPwd = props => { | ||
| 102 | }); | 105 | }); |
| 103 | // 确认修改密码 | 106 | // 确认修改密码 |
| 104 | const handleOk = () => { | 107 | const handleOk = () => { |
| 105 | - const url = `${ | ||
| 106 | - commonConfig.server_host | ||
| 107 | - }sftlogininfo/updatePasswordUserName/update?sModelsId=${100}`; | 108 | + const url = `${commonConfig.server_host |
| 109 | + }sftlogininfo/updatePasswordUserName/update?sModelsId=${100}`; | ||
| 108 | props.dispatch({ | 110 | props.dispatch({ |
| 109 | type: "app/editPwd", | 111 | type: "app/editPwd", |
| 110 | payload: { | 112 | payload: { |
| @@ -330,26 +332,54 @@ const useIndexMesEvent = props => { | @@ -330,26 +332,54 @@ const useIndexMesEvent = props => { | ||
| 330 | [currentContent, sModelsId, sModelType] | 332 | [currentContent, sModelsId, sModelType] |
| 331 | ); | 333 | ); |
| 332 | 334 | ||
| 335 | + const { webSocket: ws } = props.app; | ||
| 336 | + const { url } = ws || {}; | ||
| 337 | + const wsRef = useRef(ws); | ||
| 338 | + useEffect(() => { | ||
| 339 | + if (url) { | ||
| 340 | + wsRef.current = ws; | ||
| 341 | + } | ||
| 342 | + }, [url]); | ||
| 343 | + | ||
| 333 | useEffect(() => { | 344 | useEffect(() => { |
| 334 | const connectWs = () => { | 345 | const connectWs = () => { |
| 335 | - if ( | ||
| 336 | - props.app.webSocket === null || | ||
| 337 | - props.app.webSocket?.readyState !== WebSocket.OPEN | ||
| 338 | - ) { | ||
| 339 | - console.log("================webSocket连接======================"); | 346 | + if (!wsRef.current) { |
| 347 | + console.log("================webSocket不存在,创建webSocket连接======================"); | ||
| 340 | props.dispatch({ | 348 | props.dispatch({ |
| 341 | type: "app/createWebSocket", | 349 | type: "app/createWebSocket", |
| 342 | payload: { reStart: true, dispatch: props.dispatch } | 350 | payload: { reStart: true, dispatch: props.dispatch } |
| 343 | }); | 351 | }); |
| 352 | + return; | ||
| 344 | } | 353 | } |
| 354 | + if (wsRef.current.readyState !== WebSocket.OPEN) return; | ||
| 355 | + const message = { | ||
| 356 | + connectTest: 'test', | ||
| 357 | + key: 'test', | ||
| 358 | + flag: 'test', | ||
| 359 | + msg: 'test', | ||
| 360 | + sId: 'test', | ||
| 361 | + showType: 'test', | ||
| 362 | + sendFrom: props.app.userinfo.sId, | ||
| 363 | + }; | ||
| 364 | + wsRef.current.send(JSON.stringify(message)); | ||
| 365 | + window.wsTimer = setTimeout(() => { | ||
| 366 | + console.log("================未收到Test返回消息,webSocket重新连接======================"); | ||
| 367 | + props.dispatch({ | ||
| 368 | + type: "app/createWebSocket", | ||
| 369 | + payload: { reStart: true, dispatch: props.dispatch } | ||
| 370 | + }); | ||
| 371 | + }, 3000); | ||
| 345 | }; | 372 | }; |
| 346 | 373 | ||
| 347 | connectWs(); | 374 | connectWs(); |
| 348 | const timer = setInterval(() => { | 375 | const timer = setInterval(() => { |
| 349 | connectWs(); | 376 | connectWs(); |
| 350 | - }, 50000); | 377 | + }, 20000); |
| 351 | 378 | ||
| 352 | - return () => clearInterval(timer); | 379 | + return () => { |
| 380 | + clearInterval(timer); | ||
| 381 | + clearTimeout(window.wsTimer); | ||
| 382 | + } | ||
| 353 | }, []); | 383 | }, []); |
| 354 | 384 | ||
| 355 | useEffect(() => { | 385 | useEffect(() => { |
| @@ -414,9 +444,8 @@ const IndexMes = baseProps => { | @@ -414,9 +444,8 @@ const IndexMes = baseProps => { | ||
| 414 | token, | 444 | token, |
| 415 | sModelsId | 445 | sModelsId |
| 416 | ) => { | 446 | ) => { |
| 417 | - const url = `${ | ||
| 418 | - commonConfig.server_host | ||
| 419 | - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | 447 | + const url = `${commonConfig.server_host |
| 448 | + }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | ||
| 420 | const returnData = (await commonServices.postValueService( | 449 | const returnData = (await commonServices.postValueService( |
| 421 | token, | 450 | token, |
| 422 | value, | 451 | value, |
| @@ -501,16 +530,16 @@ const HeaderConponent = () => { | @@ -501,16 +530,16 @@ const HeaderConponent = () => { | ||
| 501 | 530 | ||
| 502 | 531 | ||
| 503 | 532 | ||
| 504 | - const [ isModalOpen, setIsModalOpen ] = useState(false); | ||
| 505 | - const objRef = useRef({}); | ||
| 506 | - const handleCancel = () => setIsModalOpen(false); | ||
| 507 | - window.$wkcFullStatus = (item , is) =>{ | ||
| 508 | - objRef.current = { | ||
| 509 | - ...objRef.current, | ||
| 510 | - ...item | ||
| 511 | - } | ||
| 512 | - setIsModalOpen(is); | 533 | + const [isModalOpen, setIsModalOpen] = useState(false); |
| 534 | + const objRef = useRef({}); | ||
| 535 | + const handleCancel = () => setIsModalOpen(false); | ||
| 536 | + window.$wkcFullStatus = (item, is) => { | ||
| 537 | + objRef.current = { | ||
| 538 | + ...objRef.current, | ||
| 539 | + ...item | ||
| 513 | } | 540 | } |
| 541 | + setIsModalOpen(is); | ||
| 542 | + } | ||
| 514 | 543 | ||
| 515 | 544 | ||
| 516 | 545 | ||
| @@ -550,20 +579,20 @@ const HeaderConponent = () => { | @@ -550,20 +579,20 @@ const HeaderConponent = () => { | ||
| 550 | <div className="logout" onClick={logout} /> | 579 | <div className="logout" onClick={logout} /> |
| 551 | </div> | 580 | </div> |
| 552 | 581 | ||
| 553 | - <Modal | ||
| 554 | - title="Basic Modal" | ||
| 555 | - open={isModalOpen} | ||
| 556 | - width={'100vw'} | ||
| 557 | - height={'100vh'} | ||
| 558 | - onCancel={handleCancel} | ||
| 559 | - footer={null} | ||
| 560 | - mask={false} | ||
| 561 | - closable={false} | ||
| 562 | - destroyOnClose={true} | ||
| 563 | - maskClosable={false} | ||
| 564 | - wrapClassName={ styles.ztwwwww }> | ||
| 565 | - <MachineMessageComponent e={objRef.current} shutDown={handleCancel} /> | ||
| 566 | - </Modal> | 582 | + <Modal |
| 583 | + title="Basic Modal" | ||
| 584 | + open={isModalOpen} | ||
| 585 | + width={'100vw'} | ||
| 586 | + height={'100vh'} | ||
| 587 | + onCancel={handleCancel} | ||
| 588 | + footer={null} | ||
| 589 | + mask={false} | ||
| 590 | + closable={false} | ||
| 591 | + destroyOnClose={true} | ||
| 592 | + maskClosable={false} | ||
| 593 | + wrapClassName={styles.ztwwwww}> | ||
| 594 | + <MachineMessageComponent e={objRef.current} shutDown={handleCancel} /> | ||
| 595 | + </Modal> | ||
| 567 | 596 | ||
| 568 | </div> | 597 | </div> |
| 569 | ); | 598 | ); |
| @@ -571,125 +600,125 @@ const HeaderConponent = () => { | @@ -571,125 +600,125 @@ const HeaderConponent = () => { | ||
| 571 | 600 | ||
| 572 | 601 | ||
| 573 | // 停机状态栏 | 602 | // 停机状态栏 |
| 574 | -const MachineMessageComponent = ({ e , shutDown }) => { | ||
| 575 | - const value = e.item?.props?.value || {}; | ||
| 576 | - const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss")); | ||
| 577 | - const { backgroundColor, conent2, fontSize } = value; | ||
| 578 | - const [currentTime, setCurrentTime] = useState(""); | ||
| 579 | - const [diffHours, setDiffHours] = useState(0); | ||
| 580 | - const [diffMins, setDiffMins] = useState(0); | ||
| 581 | - const [diffSecs, setDiffSecs] = useState(0); | ||
| 582 | - useEffect(() => { | ||
| 583 | - const getTime = () => { | ||
| 584 | - const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss"); | ||
| 585 | - setCurrentTime(currentTimeNew); | ||
| 586 | - | ||
| 587 | - const duration = moment.duration( | ||
| 588 | - moment(currentTimeNew).diff(moment(startTime)) | ||
| 589 | - ); | ||
| 590 | - const hours = duration.asHours().toString().split(".")[0]; | ||
| 591 | - const minutes = (duration.asMinutes() % 60).toString().split(".")[0]; | ||
| 592 | - const seconds = duration.asSeconds() % 60; | ||
| 593 | - | ||
| 594 | - setDiffHours(hours<=9? `0${hours}`: hours); | ||
| 595 | - setDiffMins(minutes<=9? `0${minutes}`: minutes ); | ||
| 596 | - setDiffSecs(seconds<=9? `0${seconds}`: seconds); | ||
| 597 | - }; | ||
| 598 | - | ||
| 599 | - getTime(); | ||
| 600 | - const timer = setInterval(() => { | ||
| 601 | - console.log('定时器状态') | ||
| 602 | - getTime(); | ||
| 603 | - }, 1000); | ||
| 604 | - | ||
| 605 | - return () => { | ||
| 606 | - clearInterval(timer); | ||
| 607 | - }; | ||
| 608 | - }, []); | ||
| 609 | - | ||
| 610 | - const handleMenuClose = () => { | ||
| 611 | - Modal.confirm({ | ||
| 612 | - title: "温馨提示:", | ||
| 613 | - content: <div>确认退出该状态?</div>, | ||
| 614 | - okText: "确认", | ||
| 615 | - cancelText: "取消", | ||
| 616 | - zIndex: 2000, | ||
| 617 | - onOk() { | ||
| 618 | - shutDown() | ||
| 619 | - }, | ||
| 620 | - onCancel() {} | ||
| 621 | - }); | 603 | +const MachineMessageComponent = ({ e, shutDown }) => { |
| 604 | + const value = e.item?.props?.value || {}; | ||
| 605 | + const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss")); | ||
| 606 | + const { backgroundColor, conent2, fontSize } = value; | ||
| 607 | + const [currentTime, setCurrentTime] = useState(""); | ||
| 608 | + const [diffHours, setDiffHours] = useState(0); | ||
| 609 | + const [diffMins, setDiffMins] = useState(0); | ||
| 610 | + const [diffSecs, setDiffSecs] = useState(0); | ||
| 611 | + useEffect(() => { | ||
| 612 | + const getTime = () => { | ||
| 613 | + const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss"); | ||
| 614 | + setCurrentTime(currentTimeNew); | ||
| 615 | + | ||
| 616 | + const duration = moment.duration( | ||
| 617 | + moment(currentTimeNew).diff(moment(startTime)) | ||
| 618 | + ); | ||
| 619 | + const hours = duration.asHours().toString().split(".")[0]; | ||
| 620 | + const minutes = (duration.asMinutes() % 60).toString().split(".")[0]; | ||
| 621 | + const seconds = duration.asSeconds() % 60; | ||
| 622 | + | ||
| 623 | + setDiffHours(hours <= 9 ? `0${hours}` : hours); | ||
| 624 | + setDiffMins(minutes <= 9 ? `0${minutes}` : minutes); | ||
| 625 | + setDiffSecs(seconds <= 9 ? `0${seconds}` : seconds); | ||
| 622 | }; | 626 | }; |
| 623 | 627 | ||
| 624 | - | ||
| 625 | - const isMinMax = useRef('max'); | ||
| 626 | - const draggleRef = useRef(null); | ||
| 627 | - const [bounds, setBounds] = useState({ left: 0, top: 0, bottom: 0, right: 0 }); | ||
| 628 | - const onStart = (_event, uiData) => { | ||
| 629 | - const { clientWidth, clientHeight } = window.document.documentElement; | ||
| 630 | - const targetRect = draggleRef.current?.getBoundingClientRect(); | ||
| 631 | - if (!targetRect) { | ||
| 632 | - return; | ||
| 633 | - } | ||
| 634 | - setBounds({ | ||
| 635 | - left: -targetRect.left + uiData.x, | ||
| 636 | - right: clientWidth - (targetRect.right - uiData.x), | ||
| 637 | - top: -targetRect.top + uiData.y, | ||
| 638 | - bottom: clientHeight - (targetRect.bottom - uiData.y), | ||
| 639 | - }); | 628 | + getTime(); |
| 629 | + const timer = setInterval(() => { | ||
| 630 | + console.log('定时器状态') | ||
| 631 | + getTime(); | ||
| 632 | + }, 1000); | ||
| 633 | + | ||
| 634 | + return () => { | ||
| 635 | + clearInterval(timer); | ||
| 640 | }; | 636 | }; |
| 637 | + }, []); | ||
| 641 | 638 | ||
| 642 | - | ||
| 643 | - return ( | ||
| 644 | - <div className={`${styles.modalBoxStyle} ${isMinMax.current}`}> | ||
| 645 | - | ||
| 646 | - { | ||
| 647 | - isMinMax.current == 'min'? | ||
| 648 | - <Draggable defaultPosition={{ x: document.body.clientWidth-400-30, y: 70 }} bounds={bounds} onStart={(event, uiData) => onStart(event, uiData)}> | ||
| 649 | - <div ref={draggleRef} className={styles.maxBoxViews} style={{ '--bgColor' : backgroundColor }}> | ||
| 650 | - <div className="mixbox" onDoubleClick={()=>isMinMax.current = 'max'}> | ||
| 651 | - <h2>{conent2}</h2> | ||
| 652 | - <div className="p">开始时间 {startTime}</div> | ||
| 653 | - <div className="p">停机耗时:{diffHours}时 {diffMins}分 {diffSecs}秒</div> | ||
| 654 | - <div className="btn"> | ||
| 655 | - <Button size="large" type="primary" className={styles.btnWg} onClick={()=>isMinMax.current = 'max'} > 最大化 </Button> | ||
| 656 | - <Button size="large" type="primary" className={styles.btnWg} onClick={handleMenuClose} > 退出 </Button> | ||
| 657 | - </div> | ||
| 658 | - </div> | ||
| 659 | - </div> | ||
| 660 | - </Draggable> | ||
| 661 | - : | ||
| 662 | - <div className={styles.machineStatusContent} style={{ backgroundColor }}> | ||
| 663 | - <div className="conent1">设备停机状态告知</div> | ||
| 664 | - <div className="conent2" style={fontSize ? { fontSize } : {}}> | ||
| 665 | - {conent2} | ||
| 666 | - </div> | ||
| 667 | - <div className="conent3"> | ||
| 668 | - 停机开始时间: | ||
| 669 | - {startTime} | ||
| 670 | - </div> | ||
| 671 | - <div className="conent4"> | ||
| 672 | - 系统当前时间: | ||
| 673 | - {currentTime} | ||
| 674 | - </div> | ||
| 675 | - <div className="conent5"> | ||
| 676 | - 此次停机耗时: | ||
| 677 | - <span className="conent6"> | ||
| 678 | - 约: | ||
| 679 | - {diffHours}时 {diffMins}分 {diffSecs}秒 | ||
| 680 | - </span> | ||
| 681 | - </div> | ||
| 682 | - <div className="conent7"> | ||
| 683 | - <Button size="large" type="primary" className={styles.btnWg} onClick={()=>isMinMax.current = 'min'} > 最小化 </Button> | ||
| 684 | - <Button size="large" type="primary" className={styles.btnWg} onClick={handleMenuClose} > 退出 </Button> | ||
| 685 | - </div> | 639 | + const handleMenuClose = () => { |
| 640 | + Modal.confirm({ | ||
| 641 | + title: "温馨提示:", | ||
| 642 | + content: <div>确认退出该状态?</div>, | ||
| 643 | + okText: "确认", | ||
| 644 | + cancelText: "取消", | ||
| 645 | + zIndex: 2000, | ||
| 646 | + onOk() { | ||
| 647 | + shutDown() | ||
| 648 | + }, | ||
| 649 | + onCancel() { } | ||
| 650 | + }); | ||
| 651 | + }; | ||
| 652 | + | ||
| 653 | + | ||
| 654 | + const isMinMax = useRef('max'); | ||
| 655 | + const draggleRef = useRef(null); | ||
| 656 | + const [bounds, setBounds] = useState({ left: 0, top: 0, bottom: 0, right: 0 }); | ||
| 657 | + const onStart = (_event, uiData) => { | ||
| 658 | + const { clientWidth, clientHeight } = window.document.documentElement; | ||
| 659 | + const targetRect = draggleRef.current?.getBoundingClientRect(); | ||
| 660 | + if (!targetRect) { | ||
| 661 | + return; | ||
| 662 | + } | ||
| 663 | + setBounds({ | ||
| 664 | + left: -targetRect.left + uiData.x, | ||
| 665 | + right: clientWidth - (targetRect.right - uiData.x), | ||
| 666 | + top: -targetRect.top + uiData.y, | ||
| 667 | + bottom: clientHeight - (targetRect.bottom - uiData.y), | ||
| 668 | + }); | ||
| 669 | + }; | ||
| 670 | + | ||
| 671 | + | ||
| 672 | + return ( | ||
| 673 | + <div className={`${styles.modalBoxStyle} ${isMinMax.current}`}> | ||
| 674 | + | ||
| 675 | + { | ||
| 676 | + isMinMax.current == 'min' ? | ||
| 677 | + <Draggable defaultPosition={{ x: document.body.clientWidth - 400 - 30, y: 70 }} bounds={bounds} onStart={(event, uiData) => onStart(event, uiData)}> | ||
| 678 | + <div ref={draggleRef} className={styles.maxBoxViews} style={{ '--bgColor': backgroundColor }}> | ||
| 679 | + <div className="mixbox" onDoubleClick={() => isMinMax.current = 'max'}> | ||
| 680 | + <h2>{conent2}</h2> | ||
| 681 | + <div className="p">开始时间 {startTime}</div> | ||
| 682 | + <div className="p">停机耗时:{diffHours}时 {diffMins}分 {diffSecs}秒</div> | ||
| 683 | + <div className="btn"> | ||
| 684 | + <Button size="large" type="primary" className={styles.btnWg} onClick={() => isMinMax.current = 'max'} > 最大化 </Button> | ||
| 685 | + <Button size="large" type="primary" className={styles.btnWg} onClick={handleMenuClose} > 退出 </Button> | ||
| 686 | </div> | 686 | </div> |
| 687 | - } | 687 | + </div> |
| 688 | + </div> | ||
| 689 | + </Draggable> | ||
| 690 | + : | ||
| 691 | + <div className={styles.machineStatusContent} style={{ backgroundColor }}> | ||
| 692 | + <div className="conent1">设备停机状态告知</div> | ||
| 693 | + <div className="conent2" style={fontSize ? { fontSize } : {}}> | ||
| 694 | + {conent2} | ||
| 695 | + </div> | ||
| 696 | + <div className="conent3"> | ||
| 697 | + 停机开始时间: | ||
| 698 | + {startTime} | ||
| 699 | + </div> | ||
| 700 | + <div className="conent4"> | ||
| 701 | + 系统当前时间: | ||
| 702 | + {currentTime} | ||
| 703 | + </div> | ||
| 704 | + <div className="conent5"> | ||
| 705 | + 此次停机耗时: | ||
| 706 | + <span className="conent6"> | ||
| 707 | + 约: | ||
| 708 | + {diffHours}时 {diffMins}分 {diffSecs}秒 | ||
| 709 | + </span> | ||
| 710 | + </div> | ||
| 711 | + <div className="conent7"> | ||
| 712 | + <Button size="large" type="primary" className={styles.btnWg} onClick={() => isMinMax.current = 'min'} > 最小化 </Button> | ||
| 713 | + <Button size="large" type="primary" className={styles.btnWg} onClick={handleMenuClose} > 退出 </Button> | ||
| 714 | + </div> | ||
| 715 | + </div> | ||
| 716 | + } | ||
| 688 | 717 | ||
| 689 | - </div> | ||
| 690 | - ); | 718 | + </div> |
| 719 | + ); | ||
| 691 | }; | 720 | }; |
| 692 | - | 721 | + |
| 693 | 722 | ||
| 694 | 723 | ||
| 695 | 724 | ||
| @@ -838,28 +867,75 @@ const SystemFunComponent = () => { | @@ -838,28 +867,75 @@ const SystemFunComponent = () => { | ||
| 838 | }; | 867 | }; |
| 839 | 868 | ||
| 840 | // 调用通用过程 | 869 | // 调用通用过程 |
| 870 | + const [form] = Form.useForm(); | ||
| 841 | const handleProcedureCall = async (params, iFlag) => { | 871 | const handleProcedureCall = async (params, iFlag) => { |
| 872 | + | ||
| 873 | + const extraValues = await new Promise(resolve => { | ||
| 874 | + form.setFieldsValue({ | ||
| 875 | + tReportDate: moment(), | ||
| 876 | + sTeamType: props.app.sShift | ||
| 877 | + }); | ||
| 878 | + Modal.confirm({ | ||
| 879 | + title: "切换手动", | ||
| 880 | + content: ( | ||
| 881 | + <ConfigProvider locale={zhCN}> | ||
| 882 | + <Form layout="vertical" size="large" form={form}> | ||
| 883 | + <Form.Item label="报工日期" name="tReportDate"> | ||
| 884 | + <DatePicker | ||
| 885 | + style={{ width: "100%" }} | ||
| 886 | + placeholder="请选择" | ||
| 887 | + format="YYYY-MM-DD" | ||
| 888 | + /> | ||
| 889 | + </Form.Item> | ||
| 890 | + <Form.Item label="班次" name="sTeamType"> | ||
| 891 | + <Select placeholder="请选择"> | ||
| 892 | + <Select.Option value="1">白班</Select.Option> | ||
| 893 | + <Select.Option value="2">夜班</Select.Option> | ||
| 894 | + </Select> | ||
| 895 | + </Form.Item> | ||
| 896 | + </Form> | ||
| 897 | + </ConfigProvider> | ||
| 898 | + ), | ||
| 899 | + wrapClassName: "mesCommonModal mesLoginForm", | ||
| 900 | + cancelText: "取消", | ||
| 901 | + okText: "确定", | ||
| 902 | + onOk() { | ||
| 903 | + const values = form.getFieldsValue(); | ||
| 904 | + const tReportDate = values?.tReportDate.format("YYYY-MM-DD") || ""; | ||
| 905 | + const sTeamType = values.sTeamType; | ||
| 906 | + resolve({ tReportDate, sTeamType }); | ||
| 907 | + }, | ||
| 908 | + onCancel() { | ||
| 909 | + resolve(false); | ||
| 910 | + } | ||
| 911 | + }); | ||
| 912 | + }); | ||
| 913 | + | ||
| 914 | + if (!extraValues) return; | ||
| 915 | + | ||
| 842 | const { onSuccess } = params; | 916 | const { onSuccess } = params; |
| 843 | const { app } = props; | 917 | const { app } = props; |
| 844 | 918 | ||
| 845 | const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app; | 919 | const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app; |
| 846 | 920 | ||
| 847 | const value = { | 921 | const value = { |
| 848 | - sBtnName: "restDailyReport", | 922 | + sBtnName: "BtnEventAuto", |
| 849 | sProName: "sp_ResetDailyReport", | 923 | sProName: "sp_ResetDailyReport", |
| 850 | sProInParam: JSON.stringify({ | 924 | sProInParam: JSON.stringify({ |
| 851 | changeValue: {}, | 925 | changeValue: {}, |
| 852 | sButtonParam: { | 926 | sButtonParam: { |
| 853 | sproName: "sp_ResetDailyReport", | 927 | sproName: "sp_ResetDailyReport", |
| 854 | - inMap: "userinfo.sMachineGuid,userinfo.sTeamId" | 928 | + inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType" |
| 855 | }, | 929 | }, |
| 856 | params: [ | 930 | params: [ |
| 857 | { | 931 | { |
| 858 | key: "userinfo", | 932 | key: "userinfo", |
| 859 | value: [ | 933 | value: [ |
| 860 | { | 934 | { |
| 935 | + ...extraValues, | ||
| 861 | sMachineGuid: sMachineNameSId, | 936 | sMachineGuid: sMachineNameSId, |
| 862 | sTeamGuid: sTeamNameSId, | 937 | sTeamGuid: sTeamNameSId, |
| 938 | + tOperationDate: moment().format("YYYY-MM-DD HH:mm:ss"), | ||
| 863 | sShift, | 939 | sShift, |
| 864 | sTeamId: sTeamNameSId, | 940 | sTeamId: sTeamNameSId, |
| 865 | iFlag: iFlag | 941 | iFlag: iFlag |
| @@ -874,9 +950,8 @@ const SystemFunComponent = () => { | @@ -874,9 +950,8 @@ const SystemFunComponent = () => { | ||
| 874 | value.iFlag = iFlag; | 950 | value.iFlag = iFlag; |
| 875 | } | 951 | } |
| 876 | 952 | ||
| 877 | - const url = `${ | ||
| 878 | - commonConfig.server_host | ||
| 879 | - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | 953 | + const url = `${commonConfig.server_host |
| 954 | + }procedureCall/doGenericProcedureCall?sModelsId=12710101117241578202960`; | ||
| 880 | const returnData = (await commonServices.postValueService( | 955 | const returnData = (await commonServices.postValueService( |
| 881 | token, | 956 | token, |
| 882 | value, | 957 | value, |
| @@ -895,7 +970,7 @@ const SystemFunComponent = () => { | @@ -895,7 +970,7 @@ const SystemFunComponent = () => { | ||
| 895 | onOk() { | 970 | onOk() { |
| 896 | handleProcedureCall(params, 1); | 971 | handleProcedureCall(params, 1); |
| 897 | }, | 972 | }, |
| 898 | - onCancel() {} | 973 | + onCancel() { } |
| 899 | }); | 974 | }); |
| 900 | } else if (code === -8) { | 975 | } else if (code === -8) { |
| 901 | Modal.info({ | 976 | Modal.info({ |
| @@ -914,11 +989,53 @@ const SystemFunComponent = () => { | @@ -914,11 +989,53 @@ const SystemFunComponent = () => { | ||
| 914 | 989 | ||
| 915 | // 切换手动/切换自动 | 990 | // 切换手动/切换自动 |
| 916 | const handleProcedureCall1 = async (params = {}, iFlag) => { | 991 | const handleProcedureCall1 = async (params = {}, iFlag) => { |
| 992 | + const extraValues = await new Promise(resolve => { | ||
| 993 | + form.setFieldsValue({ | ||
| 994 | + tReportDate: moment(), | ||
| 995 | + sTeamType: props.app.sShift | ||
| 996 | + }); | ||
| 997 | + Modal.confirm({ | ||
| 998 | + title: "取消手动", | ||
| 999 | + content: ( | ||
| 1000 | + <ConfigProvider locale={zhCN}> | ||
| 1001 | + <Form layout="vertical" size="large" form={form}> | ||
| 1002 | + <Form.Item label="报工日期" name="tReportDate"> | ||
| 1003 | + <DatePicker | ||
| 1004 | + style={{ width: "100%" }} | ||
| 1005 | + placeholder="请选择" | ||
| 1006 | + format="YYYY-MM-DD" | ||
| 1007 | + /> | ||
| 1008 | + </Form.Item> | ||
| 1009 | + <Form.Item label="班次" name="sTeamType"> | ||
| 1010 | + <Select placeholder="请选择"> | ||
| 1011 | + <Select.Option value="1">白班</Select.Option> | ||
| 1012 | + <Select.Option value="2">夜班</Select.Option> | ||
| 1013 | + </Select> | ||
| 1014 | + </Form.Item> | ||
| 1015 | + </Form> | ||
| 1016 | + </ConfigProvider> | ||
| 1017 | + ), | ||
| 1018 | + wrapClassName: "mesCommonModal mesLoginForm", | ||
| 1019 | + cancelText: "取消", | ||
| 1020 | + okText: "确定", | ||
| 1021 | + onOk() { | ||
| 1022 | + const values = form.getFieldsValue(); | ||
| 1023 | + const tReportDate = values?.tReportDate.format("YYYY-MM-DD") || ""; | ||
| 1024 | + const sTeamType = values.sTeamType; | ||
| 1025 | + resolve({ tReportDate, sTeamType }); | ||
| 1026 | + }, | ||
| 1027 | + onCancel() { | ||
| 1028 | + resolve(false); | ||
| 1029 | + } | ||
| 1030 | + }); | ||
| 1031 | + }); | ||
| 1032 | + | ||
| 1033 | + if (!extraValues) return; | ||
| 1034 | + | ||
| 917 | const { onSuccess } = params; | 1035 | const { onSuccess } = params; |
| 918 | const { app } = props; | 1036 | const { app } = props; |
| 919 | 1037 | ||
| 920 | const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app; | 1038 | const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app; |
| 921 | - const userinfo = commonUtils.getAppData("userinfo"); | ||
| 922 | 1039 | ||
| 923 | const value = { | 1040 | const value = { |
| 924 | sBtnName: "switchReportType", | 1041 | sBtnName: "switchReportType", |
| @@ -927,18 +1044,19 @@ const SystemFunComponent = () => { | @@ -927,18 +1044,19 @@ const SystemFunComponent = () => { | ||
| 927 | changeValue: {}, | 1044 | changeValue: {}, |
| 928 | sButtonParam: { | 1045 | sButtonParam: { |
| 929 | sproName: "sp_SwitchReportType", | 1046 | sproName: "sp_SwitchReportType", |
| 930 | - inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.bPlcSd" | 1047 | + inMap: "userinfo.sMachineGuid,userinfo.sTeamId,userinfo.tReportDate,userinfo.sTeamType" |
| 931 | }, | 1048 | }, |
| 932 | params: [ | 1049 | params: [ |
| 933 | { | 1050 | { |
| 934 | key: "userinfo", | 1051 | key: "userinfo", |
| 935 | value: [ | 1052 | value: [ |
| 936 | { | 1053 | { |
| 1054 | + ...extraValues, | ||
| 937 | sMachineGuid: sMachineNameSId, | 1055 | sMachineGuid: sMachineNameSId, |
| 938 | sTeamGuid: sTeamNameSId, | 1056 | sTeamGuid: sTeamNameSId, |
| 1057 | + tOperationDate: moment().format("YYYY-MM-DD HH:mm:ss"), | ||
| 939 | sShift, | 1058 | sShift, |
| 940 | sTeamId: sTeamNameSId, | 1059 | sTeamId: sTeamNameSId, |
| 941 | - bPlcSd: userinfo.bPlcSd, | ||
| 942 | iFlag: iFlag | 1060 | iFlag: iFlag |
| 943 | } | 1061 | } |
| 944 | ] | 1062 | ] |
| @@ -951,9 +1069,8 @@ const SystemFunComponent = () => { | @@ -951,9 +1069,8 @@ const SystemFunComponent = () => { | ||
| 951 | value.iFlag = iFlag; | 1069 | value.iFlag = iFlag; |
| 952 | } | 1070 | } |
| 953 | 1071 | ||
| 954 | - const url = `${ | ||
| 955 | - commonConfig.server_host | ||
| 956 | - }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | 1072 | + const url = `${commonConfig.server_host |
| 1073 | + }procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`; | ||
| 957 | const returnData = (await commonServices.postValueService( | 1074 | const returnData = (await commonServices.postValueService( |
| 958 | token, | 1075 | token, |
| 959 | value, | 1076 | value, |
| @@ -970,9 +1087,9 @@ const SystemFunComponent = () => { | @@ -970,9 +1087,9 @@ const SystemFunComponent = () => { | ||
| 970 | okText: "确认", | 1087 | okText: "确认", |
| 971 | cancelText: "取消", | 1088 | cancelText: "取消", |
| 972 | onOk() { | 1089 | onOk() { |
| 973 | - handleProcedureCall1(params, 1); | 1090 | + handleProcedureCall(params, 1); |
| 974 | }, | 1091 | }, |
| 975 | - onCancel() {} | 1092 | + onCancel() { } |
| 976 | }); | 1093 | }); |
| 977 | } else if (code === -8) { | 1094 | } else if (code === -8) { |
| 978 | Modal.info({ | 1095 | Modal.info({ |
| @@ -1005,10 +1122,12 @@ const SystemFunComponent = () => { | @@ -1005,10 +1122,12 @@ const SystemFunComponent = () => { | ||
| 1005 | case "restDailyReport": | 1122 | case "restDailyReport": |
| 1006 | handleProcedureCall({ | 1123 | handleProcedureCall({ |
| 1007 | onSuccess: () => { | 1124 | onSuccess: () => { |
| 1008 | - location.reload(); | 1125 | + message.success("操作成功, 请等待页面刷新", 2); |
| 1126 | + setTimeout(() => { | ||
| 1127 | + location.reload(); | ||
| 1128 | + }, 1500); | ||
| 1009 | } | 1129 | } |
| 1010 | }); | 1130 | }); |
| 1011 | - | ||
| 1012 | break; | 1131 | break; |
| 1013 | case "faceCollection": | 1132 | case "faceCollection": |
| 1014 | dispatch(["saveState", { faceCollectionModalVisible: true }]); | 1133 | dispatch(["saveState", { faceCollectionModalVisible: true }]); |
| @@ -1016,10 +1135,10 @@ const SystemFunComponent = () => { | @@ -1016,10 +1135,10 @@ const SystemFunComponent = () => { | ||
| 1016 | case "switchStatus": | 1135 | case "switchStatus": |
| 1017 | handleProcedureCall1({ | 1136 | handleProcedureCall1({ |
| 1018 | onSuccess: () => { | 1137 | onSuccess: () => { |
| 1019 | - const userInfoNew = commonUtils.getAppData("userinfo"); | ||
| 1020 | - userInfoNew.bPlcSd = !userInfoNew.bPlcSd; | ||
| 1021 | - commonUtils.setAppData("userinfo", userInfoNew); | ||
| 1022 | - location.reload(); | 1138 | + message.success("操作成功, 请等待页面刷新", 2); |
| 1139 | + setTimeout(() => { | ||
| 1140 | + location.reload(); | ||
| 1141 | + }, 1500); | ||
| 1023 | } | 1142 | } |
| 1024 | }); | 1143 | }); |
| 1025 | break; | 1144 | break; |
| @@ -1078,8 +1197,8 @@ const SystemFunComponent = () => { | @@ -1078,8 +1197,8 @@ const SystemFunComponent = () => { | ||
| 1078 | handleSystemFunClick("restDailyReport"); | 1197 | handleSystemFunClick("restDailyReport"); |
| 1079 | }} | 1198 | }} |
| 1080 | > | 1199 | > |
| 1081 | - <UndoOutlined /> | ||
| 1082 | - <span>重置日报</span> | 1200 | + <SwapOutlined /> |
| 1201 | + <span>切换手动</span> | ||
| 1083 | </div> | 1202 | </div> |
| 1084 | <div | 1203 | <div |
| 1085 | className="restDailyReport" | 1204 | className="restDailyReport" |
| @@ -1087,8 +1206,8 @@ const SystemFunComponent = () => { | @@ -1087,8 +1206,8 @@ const SystemFunComponent = () => { | ||
| 1087 | handleSystemFunClick("switchStatus"); | 1206 | handleSystemFunClick("switchStatus"); |
| 1088 | }} | 1207 | }} |
| 1089 | > | 1208 | > |
| 1090 | - <SwapOutlined /> | ||
| 1091 | - <span>{bPlcSd ? "切换自动" : "切换手动"}</span> | 1209 | + <CloseOutlined /> |
| 1210 | + <span>取消手动</span> | ||
| 1092 | </div> | 1211 | </div> |
| 1093 | </div> | 1212 | </div> |
| 1094 | } | 1213 | } |
src/mes/productionExec/productionExecMain/index.js
| 1 | -import React, { useEffect, useState, useRef, useMemo } from "react"; | ||
| 2 | -import { Button, Spin, Row, Col } from "antd"; | ||
| 3 | -import { operationFetch } from "./operationFetch"; | 1 | +import React, {useEffect, useMemo, useRef, useState} from "react"; |
| 2 | +import {Button, Col, Input, message, Modal, Row, Select, Space, Spin} from "antd"; | ||
| 3 | +import {operationFetch} from "./operationFetch"; | ||
| 4 | 4 | ||
| 5 | import * as commonUtils from "@/utils/utils"; | 5 | import * as commonUtils from "@/utils/utils"; |
| 6 | +import * as commonConfig from "@/utils/config"; | ||
| 7 | +import * as commonServices from "@/services/services"; | ||
| 6 | import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; | 8 | import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; |
| 7 | import SiderInfoComponent from "@/mes/common/siderInfoComponent"; | 9 | import SiderInfoComponent from "@/mes/common/siderInfoComponent"; |
| 8 | import * as commonBusiness from "@/components/Common/commonBusiness"; | 10 | import * as commonBusiness from "@/components/Common/commonBusiness"; |
| @@ -12,20 +14,9 @@ import CommonViewTable from "@/components/Common/CommonViewTable"; | @@ -12,20 +14,9 @@ import CommonViewTable from "@/components/Common/CommonViewTable"; | ||
| 12 | import CommonOperationBarComponent from "@/mes/common/commonOperationBarComponent"; | 14 | import CommonOperationBarComponent from "@/mes/common/commonOperationBarComponent"; |
| 13 | 15 | ||
| 14 | import styles from "./index.less"; | 16 | import styles from "./index.less"; |
| 15 | -import { | ||
| 16 | - DoubleLeftOutlined, | ||
| 17 | - LeftOutlined, | ||
| 18 | - MinusOutlined, | ||
| 19 | - PlusOutlined, | ||
| 20 | - RightOutlined | ||
| 21 | -} from "@ant-design/icons"; | ||
| 22 | -import { Space } from "antd"; | 17 | +import {DoubleLeftOutlined, LeftOutlined, MinusOutlined, PlusOutlined, RightOutlined} from "@ant-design/icons"; |
| 23 | import CommonModelComponent from "../../common/commonModelComponent"; | 18 | import CommonModelComponent from "../../common/commonModelComponent"; |
| 24 | -import { message } from "antd"; | ||
| 25 | -import { Modal } from "antd"; | ||
| 26 | -import { Select } from "antd"; | ||
| 27 | -import { Input } from "antd"; | ||
| 28 | -import { cloneDeep } from "lodash"; | 19 | +import {cloneDeep} from "lodash"; |
| 29 | 20 | ||
| 30 | const list = [ | 21 | const list = [ |
| 31 | { sName: "qztable0", sGrd: "qztable0" }, // 切纸生产执行 | 22 | { sName: "qztable0", sGrd: "qztable0" }, // 切纸生产执行 |
| @@ -408,8 +399,20 @@ const ProductionExecMain = baseProps => { | @@ -408,8 +399,20 @@ const ProductionExecMain = baseProps => { | ||
| 408 | const getValue = () => { | 399 | const getValue = () => { |
| 409 | const changeExecInfo = commonUtils.getAppData("changeExecInfo"); | 400 | const changeExecInfo = commonUtils.getAppData("changeExecInfo"); |
| 410 | if (changeExecInfo.dReplyPalletERp === 1) { | 401 | if (changeExecInfo.dReplyPalletERp === 1) { |
| 411 | - props.onRefresh(); | ||
| 412 | - setRefreshCount(pre => pre + 1); | 402 | + try { |
| 403 | + const { sId } = changeExecInfo; | ||
| 404 | + const url = `${commonConfig.server_host}mqtt/updateFlushmes/${sId}`; | ||
| 405 | + commonServices.postValueService(null, {}, url).then(() => { | ||
| 406 | + props.onRefresh(); | ||
| 407 | + setRefreshCount(pre => pre + 1); | ||
| 408 | + }) | ||
| 409 | + } catch (error) { | ||
| 410 | + console.log("=====updateFlushmes报错", { | ||
| 411 | + error, changeExecInfo, | ||
| 412 | + }); | ||
| 413 | + props.onRefresh(); | ||
| 414 | + setRefreshCount(pre => pre + 1); | ||
| 415 | + } | ||
| 413 | } | 416 | } |
| 414 | }; | 417 | }; |
| 415 | 418 | ||
| @@ -905,19 +908,43 @@ const ProductionExecContent0 = props => { | @@ -905,19 +908,43 @@ const ProductionExecContent0 = props => { | ||
| 905 | tableProps: {} | 908 | tableProps: {} |
| 906 | }; | 909 | }; |
| 907 | 910 | ||
| 908 | - const viewConfigs = config.gdsconfigformslave | ||
| 909 | - .filter(item => item.bControl && item.sControlName.indexOf("Btn") === -1) | ||
| 910 | - // .filter((_, index) => index < 8) | ||
| 911 | - .map(item => ({ | ||
| 912 | - ...item, | ||
| 913 | - iColValue: 24 | ||
| 914 | - })); | ||
| 915 | - | ||
| 916 | const viewRow = | 911 | const viewRow = |
| 917 | (selectedRowKeys[0] | 912 | (selectedRowKeys[0] |
| 918 | ? data.find(item => item.sId === selectedRowKeys[0]) | 913 | ? data.find(item => item.sId === selectedRowKeys[0]) |
| 919 | : data[0]) || {}; | 914 | : data[0]) || {}; |
| 920 | 915 | ||
| 916 | + const viewConfigs = config.gdsconfigformslave | ||
| 917 | + .filter(item => item.bControl && item.sControlName.indexOf("Btn") === -1) | ||
| 918 | + // .filter((_, index) => index < 8) | ||
| 919 | + .map(item => { | ||
| 920 | + let iTag = item.iTag; | ||
| 921 | + if (item.sName === 'dReportQty' && (viewRow.bAutoReport || viewRow.bReport)) { | ||
| 922 | + iTag = 1; | ||
| 923 | + } | ||
| 924 | + if (['dLockUpFei', 'dMadeUpFei', 'iLaminatingPaper'].includes(item.sName) && (viewRow.bReport|| viewRow.iJobStatus != 3)) { | ||
| 925 | + iTag = 1; | ||
| 926 | + } | ||
| 927 | + if (["dAdvanceMadeUpFei", "dAdvanceLockUpFei", "iAdvanceLaminatingPaper"].includes(item.sName)) { | ||
| 928 | + if (!viewRow.bAdvanceReport && viewRow.iJobStatus && viewRow.bAdvance) { | ||
| 929 | + iTag = 3; | ||
| 930 | + } else { | ||
| 931 | + iTag = 1; | ||
| 932 | + } | ||
| 933 | + } | ||
| 934 | + if (item.sName === "dAdvanceReportQty") { | ||
| 935 | + if (!viewRow.bAdvanceReport && !viewRow.bAutoReport && viewRow.iJobStatus && viewRow.bAdvance) { | ||
| 936 | + iTag = 3; | ||
| 937 | + } else { | ||
| 938 | + iTag = 1; | ||
| 939 | + } | ||
| 940 | + } | ||
| 941 | + return { | ||
| 942 | + ...item, | ||
| 943 | + iColValue: 24, | ||
| 944 | + iTag | ||
| 945 | + } | ||
| 946 | + }); | ||
| 947 | + | ||
| 921 | const viewProps = { | 948 | const viewProps = { |
| 922 | ...props, | 949 | ...props, |
| 923 | viewConfigs, | 950 | viewConfigs, |
| @@ -939,9 +966,11 @@ const ProductionExecContent0 = props => { | @@ -939,9 +966,11 @@ const ProductionExecContent0 = props => { | ||
| 939 | config.gdsconfigformslave.find( | 966 | config.gdsconfigformslave.find( |
| 940 | item => item.sControlName === sControlName | 967 | item => item.sControlName === sControlName |
| 941 | ) || {}; | 968 | ) || {}; |
| 969 | + const { showName = '' } = btnConfig; | ||
| 942 | return { | 970 | return { |
| 943 | ...btnConfig, | 971 | ...btnConfig, |
| 944 | disabled: props.onGetBtnStatus(tableName, btnConfig), | 972 | disabled: props.onGetBtnStatus(tableName, btnConfig), |
| 973 | + style: { width: showName.length <= 4 ? 80 : showName.length * 20 }, | ||
| 945 | onClick: async () => { | 974 | onClick: async () => { |
| 946 | if (!props.onGetBtnContinue()) return; | 975 | if (!props.onGetBtnContinue()) return; |
| 947 | await props.awaitPromiseReturn(); | 976 | await props.awaitPromiseReturn(); |
| @@ -1029,7 +1058,13 @@ const ProductionExecContent0 = props => { | @@ -1029,7 +1058,13 @@ const ProductionExecContent0 = props => { | ||
| 1029 | {...btnProps} | 1058 | {...btnProps} |
| 1030 | {...getBtnConfigByControlName("BtnEventBlanking")} | 1059 | {...getBtnConfigByControlName("BtnEventBlanking")} |
| 1031 | > | 1060 | > |
| 1032 | - 下料 | 1061 | + { getBtnConfigByControlName("BtnEventBlanking").showName } |
| 1062 | + </Button> | ||
| 1063 | + <Button | ||
| 1064 | + {...btnProps} | ||
| 1065 | + {...getBtnConfigByControlName("BtnEventBlanking2")} | ||
| 1066 | + > | ||
| 1067 | + { getBtnConfigByControlName("BtnEventBlanking2").showName } | ||
| 1033 | </Button> | 1068 | </Button> |
| 1034 | </Space> | 1069 | </Space> |
| 1035 | <Space> | 1070 | <Space> |
| @@ -1056,7 +1091,13 @@ const ProductionExecContent0 = props => { | @@ -1056,7 +1091,13 @@ const ProductionExecContent0 = props => { | ||
| 1056 | {...btnProps} | 1091 | {...btnProps} |
| 1057 | {...getBtnConfigByControlName("BtnCancel")} | 1092 | {...getBtnConfigByControlName("BtnCancel")} |
| 1058 | > | 1093 | > |
| 1059 | - 撤销 | 1094 | + { getBtnConfigByControlName("BtnCancel").showName } |
| 1095 | + </Button> | ||
| 1096 | + <Button | ||
| 1097 | + {...btnProps} | ||
| 1098 | + {...getBtnConfigByControlName("BtnEventBlanking3")} | ||
| 1099 | + > | ||
| 1100 | + { getBtnConfigByControlName("BtnEventBlanking3").showName } | ||
| 1060 | </Button> | 1101 | </Button> |
| 1061 | </Space> | 1102 | </Space> |
| 1062 | <Space className="rightPart"> | 1103 | <Space className="rightPart"> |
| @@ -1166,19 +1207,44 @@ const ProductionExecContent1 = props => { | @@ -1166,19 +1207,44 @@ const ProductionExecContent1 = props => { | ||
| 1166 | tableProps: {} | 1207 | tableProps: {} |
| 1167 | }; | 1208 | }; |
| 1168 | 1209 | ||
| 1169 | - const viewConfigs = config.gdsconfigformslave | ||
| 1170 | - .filter(item => item.bControl && item.sControlName.indexOf("Btn") === -1) | ||
| 1171 | - // .filter((_, index) => index < 8) | ||
| 1172 | - .map(item => ({ | ||
| 1173 | - ...item, | ||
| 1174 | - iColValue: 24 | ||
| 1175 | - })); | ||
| 1176 | - | ||
| 1177 | const viewRow = | 1210 | const viewRow = |
| 1178 | (selectedRowKeys[0] | 1211 | (selectedRowKeys[0] |
| 1179 | ? data.find(item => item.sId === selectedRowKeys[0]) | 1212 | ? data.find(item => item.sId === selectedRowKeys[0]) |
| 1180 | : data[0]) || {}; | 1213 | : data[0]) || {}; |
| 1181 | 1214 | ||
| 1215 | + const viewConfigs = config.gdsconfigformslave | ||
| 1216 | + .filter(item => item.bControl && item.sControlName.indexOf("Btn") === -1) | ||
| 1217 | + // .filter((_, index) => index < 8) | ||
| 1218 | + .map(item => { | ||
| 1219 | + let iTag = item.iTag; | ||
| 1220 | + if (item.sName === 'dReportQty' && (viewRow.bAutoReport || viewRow.bReport)) { | ||
| 1221 | + iTag = 1; | ||
| 1222 | + } | ||
| 1223 | + if (['dLockUpFei', 'dMadeUpFei', 'iLaminatingPaper'].includes(item.sName) && (viewRow.bReport || viewRow.iJobStatus != 3)) { | ||
| 1224 | + iTag = 1; | ||
| 1225 | + } | ||
| 1226 | + if (["dAdvanceMadeUpFei", "dAdvanceLockUpFei", "iAdvanceLaminatingPaper"].includes(item.sName)) { | ||
| 1227 | + if (!viewRow.bAdvanceReport && viewRow.iJobStatus && viewRow.bAdvance) { | ||
| 1228 | + iTag = 3; | ||
| 1229 | + } else { | ||
| 1230 | + iTag = 1; | ||
| 1231 | + } | ||
| 1232 | + } | ||
| 1233 | + if (item.sName === "dAdvanceReportQty") { | ||
| 1234 | + if (!viewRow.bAdvanceReport && !viewRow.bAutoReport && viewRow.iJobStatus && viewRow.bAdvance) { | ||
| 1235 | + iTag = 3; | ||
| 1236 | + } else { | ||
| 1237 | + iTag = 1; | ||
| 1238 | + } | ||
| 1239 | + } | ||
| 1240 | + return { | ||
| 1241 | + ...item, | ||
| 1242 | + iColValue: 24, | ||
| 1243 | + iTag | ||
| 1244 | + } | ||
| 1245 | + }); | ||
| 1246 | + | ||
| 1247 | + | ||
| 1182 | const viewProps = { | 1248 | const viewProps = { |
| 1183 | ...props, | 1249 | ...props, |
| 1184 | viewConfigs, | 1250 | viewConfigs, |
| @@ -1226,7 +1292,7 @@ const ProductionExecContent1 = props => { | @@ -1226,7 +1292,7 @@ const ProductionExecContent1 = props => { | ||
| 1226 | }; | 1292 | }; |
| 1227 | 1293 | ||
| 1228 | const getBtnProps = btnConfig => { | 1294 | const getBtnProps = btnConfig => { |
| 1229 | - const { sFontColor } = btnConfig; | 1295 | + const { sFontColor, showName = '' } = btnConfig; |
| 1230 | 1296 | ||
| 1231 | const style = sFontColor | 1297 | const style = sFontColor |
| 1232 | ? { backgroundColor: sFontColor, borderColor: sFontColor } | 1298 | ? { backgroundColor: sFontColor, borderColor: sFontColor } |
| @@ -1234,7 +1300,7 @@ const ProductionExecContent1 = props => { | @@ -1234,7 +1300,7 @@ const ProductionExecContent1 = props => { | ||
| 1234 | return { | 1300 | return { |
| 1235 | type: "primary", | 1301 | type: "primary", |
| 1236 | size: "large", | 1302 | size: "large", |
| 1237 | - style: { width: 80, ...style }, | 1303 | + style: { width: showName.length <= 4 ? 80 : showName.length * 20, ...style }, |
| 1238 | disabled: props.onGetBtnStatus(tableName, btnConfig), | 1304 | disabled: props.onGetBtnStatus(tableName, btnConfig), |
| 1239 | onClick: async () => { | 1305 | onClick: async () => { |
| 1240 | if (!props.onGetBtnContinue()) return; | 1306 | if (!props.onGetBtnContinue()) return; |
src/mes/scheduledTasks/machineTasks/index.js
| @@ -733,7 +733,14 @@ | @@ -733,7 +733,14 @@ | ||
| 733 | {carouselData.map(item => ( | 733 | {carouselData.map(item => ( |
| 734 | <div key={item.id} className={`tasksCarousel`}> | 734 | <div key={item.id} className={`tasksCarousel`}> |
| 735 | <h2>{item.title}</h2> | 735 | <h2>{item.title}</h2> |
| 736 | - <p>{item.content}</p> | 736 | + <p onDoubleClick={() => { |
| 737 | + if (item.id === 999) return; | ||
| 738 | + Modal.info({ | ||
| 739 | + width: "40vw", | ||
| 740 | + title: item.title, | ||
| 741 | + content: item.content | ||
| 742 | + }); | ||
| 743 | + }}>{item.content}</p> | ||
| 737 | </div> | 744 | </div> |
| 738 | ))} | 745 | ))} |
| 739 | </Carousel> | 746 | </Carousel> |
src/mes/scheduledTasks/machineTasks/index.less
| @@ -172,7 +172,9 @@ | @@ -172,7 +172,9 @@ | ||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | .tasksCarousel { | 174 | .tasksCarousel { |
| 175 | - height: calc(100% - 8px); | 175 | + height: 100%; |
| 176 | + display: flex !important; | ||
| 177 | + flex-direction: column; | ||
| 176 | 178 | ||
| 177 | h2 { | 179 | h2 { |
| 178 | padding-left: 30px; | 180 | padding-left: 30px; |
| @@ -184,9 +186,13 @@ | @@ -184,9 +186,13 @@ | ||
| 184 | } | 186 | } |
| 185 | 187 | ||
| 186 | p { | 188 | p { |
| 187 | - margin-top: @margin-top; | 189 | + flex: 1; |
| 190 | + overflow: auto; | ||
| 191 | + margin: @margin-top 0 0 0; | ||
| 188 | line-height: 28px; | 192 | line-height: 28px; |
| 189 | font-size: 18px; | 193 | font-size: 18px; |
| 194 | + cursor: default; | ||
| 195 | + user-select: none; | ||
| 190 | } | 196 | } |
| 191 | } | 197 | } |
| 192 | } | 198 | } |
src/mes/teamInfo/index.js
| @@ -332,6 +332,8 @@ const useTeamInfoEvent = props => { | @@ -332,6 +332,8 @@ const useTeamInfoEvent = props => { | ||
| 332 | 332 | ||
| 333 | const { config, record, name } = params; | 333 | const { config, record, name } = params; |
| 334 | props.onProcedureCall({ | 334 | props.onProcedureCall({ |
| 335 | + bForemanCheck: true, | ||
| 336 | + getFaceResult, | ||
| 335 | btnConfig: config, | 337 | btnConfig: config, |
| 336 | tableData: [record], | 338 | tableData: [record], |
| 337 | faceData: { sEmployeeNo: faceResult.sEmployeeNo }, | 339 | faceData: { sEmployeeNo: faceResult.sEmployeeNo }, |
src/models/app.js
| @@ -584,7 +584,7 @@ export default { | @@ -584,7 +584,7 @@ export default { | ||
| 584 | // } | 584 | // } |
| 585 | url = `${config.ws_host}websocket/${userinfo.sId}?reStart=true`; | 585 | url = `${config.ws_host}websocket/${userinfo.sId}?reStart=true`; |
| 586 | if (userinfo.sUserLoginType) { | 586 | if (userinfo.sUserLoginType) { |
| 587 | - url = `${config.ws_host}websocket/${userinfo.sId}?reStart=true&sLoginType=${userinfo.sUserLoginType}`; | 587 | + url = `${config.ws_host}websocket/${userinfo.sId}?reStart=true&createTime=${new Date().getTime()}&sLoginType=${userinfo.sUserLoginType}`; |
| 588 | } | 588 | } |
| 589 | } | 589 | } |
| 590 | const reset = (ws, config1) => { | 590 | const reset = (ws, config1) => { |
| @@ -598,13 +598,23 @@ export default { | @@ -598,13 +598,23 @@ export default { | ||
| 598 | ws.send(JSON.stringify(message)); | 598 | ws.send(JSON.stringify(message)); |
| 599 | }, config1.timeoutServer); | 599 | }, config1.timeoutServer); |
| 600 | }; | 600 | }; |
| 601 | + const oldWebSocket = yield select(state => state.app.webSocket); | ||
| 601 | const ws = new WebSocket(url); | 602 | const ws = new WebSocket(url); |
| 602 | ws.onopen = function (e) { | 603 | ws.onopen = function (e) { |
| 603 | console.log('连接上 webscoket 服务端了', e); | 604 | console.log('连接上 webscoket 服务端了', e); |
| 604 | start(ws, config); | 605 | start(ws, config); |
| 606 | + if (oldWebSocket && oldWebSocket !== ws) { | ||
| 607 | + try { | ||
| 608 | + oldWebSocket.close(); | ||
| 609 | + console.log('================已关闭旧的WebSocket连接======================'); | ||
| 610 | + } catch (error) { | ||
| 611 | + console.log('================关闭旧WebSocket连接时出错======================', error); | ||
| 612 | + } | ||
| 613 | + } | ||
| 605 | }; | 614 | }; |
| 606 | // 全局通用的自定义onmessage的方法 | 615 | // 全局通用的自定义onmessage的方法 |
| 607 | ws.homeAction = (msg) => { | 616 | ws.homeAction = (msg) => { |
| 617 | + clearTimeout(window.wsTimer); | ||
| 608 | const rtmsg = JSON.parse(msg.data); | 618 | const rtmsg = JSON.parse(msg.data); |
| 609 | if (false && rtmsg.action === 'showImg' && location.pathname.indexOf('/indexOee') < 0) { | 619 | if (false && rtmsg.action === 'showImg' && location.pathname.indexOf('/indexOee') < 0) { |
| 610 | const msgData = JSON.parse(msg.data); | 620 | const msgData = JSON.parse(msg.data); |
src/utils/config.js
| 1 | /* eslint-disable */ | 1 | /* eslint-disable */ |
| 2 | const isDev = process.env.NODE_ENV === 'development'; | 2 | const isDev = process.env.NODE_ENV === 'development'; |
| 3 | -const bHttps = location.protocol === 'https:' ; | 3 | +const bHttps = location.protocol === 'https:'; |
| 4 | export const webSite = { | 4 | export const webSite = { |
| 5 | // ipAddress: '//t0.xlyprint.com:8000/xlyEntry/', /* 服务器地址 */ | 5 | // ipAddress: '//t0.xlyprint.com:8000/xlyEntry/', /* 服务器地址 */ |
| 6 | // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', | 6 | // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', |
| 7 | fileAddress: isDev ? '//127.0.0.1:8080/xlyEntry/' : '//' + location.host + '/xlyReport/', // 接口地址 | 7 | fileAddress: isDev ? '//127.0.0.1:8080/xlyEntry/' : '//' + location.host + '/xlyReport/', // 接口地址 |
| 8 | - faceAddress: isDev ? '//172.19.18.26:8080/xlyFace' : '//' + location.host + '/xlyFace', | ||
| 9 | - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//127.0.0.1:8080/xlyEntry/' : '//' + location.host + '/xlyMes/', | ||
| 10 | - interfaceAddress: isDev ? '//127.0.0.1:8088/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 | 8 | + faceAddress: isDev ? '//172.19.18.50:8543/xlyFace' : '//' + location.host + '/xlyFace', |
| 9 | + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//127.0.0.1:8080/xlyEntry/' : '//' + location.host + '/xlyEntry/', | ||
| 10 | + interfaceAddress: isDev ? '//172.19.18.50:8543/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 | ||
| 11 | // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', | 11 | // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', |
| 12 | // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 | 12 | // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 |
| 13 | // ipAddress: isDev ? '//192.168.11.26:8080/xlyEntry/' : '//' + location.host + '/xlyEntry/', | 13 | // ipAddress: isDev ? '//192.168.11.26:8080/xlyEntry/' : '//' + location.host + '/xlyEntry/', |
| @@ -24,7 +24,7 @@ module.exports = { | @@ -24,7 +24,7 @@ module.exports = { | ||
| 24 | hasSum: false, | 24 | hasSum: false, |
| 25 | isWeiXin: false, | 25 | isWeiXin: false, |
| 26 | server_host: bHttps && !localStorage.ipAddress ? `https:${webSite.ipAddress}` : `http:${webSite.ipAddress}`, /* 外网连内网服务器地址 */ | 26 | server_host: bHttps && !localStorage.ipAddress ? `https:${webSite.ipAddress}` : `http:${webSite.ipAddress}`, /* 外网连内网服务器地址 */ |
| 27 | -// server_host: bHttps && !localStorage.ipAddress ? `http://172.19.18.21:8543/xlyMes/` : `http://172.19.18.21:8543/xlyMes/`, /* 外网连内网服务器地址 */ | 27 | +// server_host: bHttps && !localStorage.ipAddress ? `http://172.19.18.50:8543:8543/xlyMes/` : `http://172.19.18.50:8543:8543/xlyMes/`, /* 外网连内网服务器地址 */ |
| 28 | ws_host: bHttps && !localStorage.ipAddress ? `wss:${webSite.ipAddress}` : `ws:${webSite.ipAddress}`, | 28 | ws_host: bHttps && !localStorage.ipAddress ? `wss:${webSite.ipAddress}` : `ws:${webSite.ipAddress}`, |
| 29 | file_host: bHttps ? `https:${webSite.fileAddress}` : `http:${webSite.fileAddress}`, /* 外网连内网服务器地址 */ | 29 | file_host: bHttps ? `https:${webSite.fileAddress}` : `http:${webSite.fileAddress}`, /* 外网连内网服务器地址 */ |
| 30 | face_host: bHttps ? `https:${webSite.faceAddress}` : `http:${webSite.faceAddress}`, /* 外网连内网服务器地址 */ | 30 | face_host: bHttps ? `https:${webSite.faceAddress}` : `http:${webSite.faceAddress}`, /* 外网连内网服务器地址 */ |