From 1716c0b78bd903b62427a1f696cef196b9ddf1fc Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 23 May 2024 16:09:45 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 109 +++++++++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index b36f6f9..f643e92 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -249,16 +249,7 @@ class Home extends React.Component { lmdisplay: 24, }, () => { - this.getBaseData(1, "1", 5); - this.getBaseData(1, "1"); - this.timeJudg(); - this.riskLevel(); - // this.homeRound(); - this.completeRate(); - this.timelyRate(); - this.safeCheck(); - this.dangerChange(); - this.getUser(); + this.willDo() } ); } else { @@ -268,20 +259,50 @@ class Home extends React.Component { lmdisplay: 17, }, () => { - this.getBaseData(1, "1", 5); - this.getBaseData(1, "1"); - this.timeJudg(); - this.riskLevel(); - // this.homeRound(); - this.completeRate(); - this.timelyRate(); - this.safeCheck(); - this.dangerChange(); - this.getUser(); + this.willDo() } ); } } + willDo = ()=>{ + this.getBaseData(1, "1", 5); + this.getBaseData(1, "1"); + this.timeJudg(); + this.riskLevel(); + // this.homeRound(); + this.completeRate(); + this.timelyRate(); + this.safeCheck(); + this.dangerChange(); + this.getUser(); + //定时器功能,暂时不开启 + this.timerID = setInterval( + () =>{this.getBaseData(1, this.state.tableKey, 5),this.getBaseData(1, this.state.overDataKey)} , + 120000 + ); + this.showModalSign(); + } + componentWillUnmount() { + this.timerID && clearTimeout(this.timerID); + } + showModalSign = () => { + var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 + var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + + let json = initFilter(orgId); + this.props.dispatch({ + type: "app/getDataByPost", + payload: json, + url: "FM/User/UserSign", //验证是否有签名照 + onComplete: (ret) => { + //返回查询结果ret + if (ret) { + //判断是否有记录 + openNotification("topRight"); + } + }, + }); + }; showTodayModal = ( dataId, formCode, @@ -524,18 +545,18 @@ class Home extends React.Component { } } showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => { - // this.props.dispatch({ - // type: "app/getDataByPost", - // url: "BI/BIController/getVersion", - // onComplete: (ret) => { - // if (ret > config.version) { - // window.localStorage.clear(); - // message.success("清除成功,即将重新加载页面", 2, () => { - // setTimeout(() => window.location.reload(true), 500); - // }); - // } - // }, - // }); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getVersion", + onComplete: (ret) => { + if (ret > config.version) { + window.localStorage.clear(); + message.success("清除成功,即将重新加载页面", 2, () => { + setTimeout(() => window.location.reload(true), 500); + }); + } + }, + }); const newtmpData = { data: { id: dataId, @@ -562,18 +583,18 @@ class Home extends React.Component { ); }; showEditModal = (dataId, formCode, TaskID, title, taskCode) => { - // this.props.dispatch({ - // type: "app/getDataByPost", - // url: "BI/BIController/getVersion", - // onComplete: (ret) => { - // if (ret > config.version) { - // window.localStorage.clear(); - // message.success("清除成功,即将重新加载页面", 2, () => { - // setTimeout(() => window.location.reload(true), 500); - // }); - // } - // }, - // }); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getVersion", + onComplete: (ret) => { + if (ret > config.version) { + window.localStorage.clear(); + message.success("清除成功,即将重新加载页面", 2, () => { + setTimeout(() => window.location.reload(true), 500); + }); + } + }, + }); const newtmpData = { data: { id: dataId, From a281990f61e4893e3346b0915620e5a734f48862 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 23 May 2024 16:16:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?modal=E5=8A=A0=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index f643e92..5726e21 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -1540,7 +1540,7 @@ class Home extends React.Component { >
- +
- + Date: Thu, 23 May 2024 16:39:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=9B=91=E5=90=AC=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B0=BA=E5=AF=B8=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/routes/Home.js b/src/routes/Home.js index 5726e21..f648c2f 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -232,6 +232,7 @@ class Home extends React.Component { }, ], }; + this.resizeRef = React.createRef(); } componentDidMount() { @@ -285,6 +286,21 @@ class Home extends React.Component { componentWillUnmount() { this.timerID && clearTimeout(this.timerID); } + useEffect = () => { + // 监听的函数 + const resize = new ResizeObserver((e) => { + if (!Array.isArray(e) || !e.length) return; + for (const ent of e) { + resizeChange(ent); + } + }); + // 传入监听对象 + resize.observe(resizeRef.current); + // 及时销毁监听函数(重要!!!) + return () => { + resize.unobserve(resizeRef?.current); + }; + }; showModalSign = () => { var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 From b05c6c9404bed11d58c22ecd86235bc654d32a99 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 23 May 2024 16:48:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index f648c2f..be8d9d3 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -703,7 +703,7 @@ class Home extends React.Component { if (limit == 5) { this.setState({ workData: ret.Data.newData, - // workTotal: ret.Data, + workTotal: ret.Data, }); } else { this.setState({ From 905fa4eb35a3084d88af2a5b05f3fc21d17061d5 Mon Sep 17 00:00:00 2001 From: wjn Date: Fri, 24 May 2024 11:28:02 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/HM/HM042ShowPrint.js | 65 +++++++++++-------- .../CustomPages/PF/PFCommonApproveView.js | 7 +- src/layout/Header.js | 3 +- src/routes/Home.js | 48 +++++++------- 4 files changed, 67 insertions(+), 56 deletions(-) diff --git a/src/components/CustomPages/HM/HM042ShowPrint.js b/src/components/CustomPages/HM/HM042ShowPrint.js index ea07c2b..44a4d63 100644 --- a/src/components/CustomPages/HM/HM042ShowPrint.js +++ b/src/components/CustomPages/HM/HM042ShowPrint.js @@ -19,6 +19,7 @@ class HM042ShowPrint extends React.Component { isAudit: 'none', tmpData: {}, DEALOPINION: '', + teamUsers: [] }; }; //审批意见 改变 @@ -83,7 +84,14 @@ class HM042ShowPrint extends React.Component { if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function') this.props.data.onCancel(); } - + removeDuplicateUser(arr) { + let obj = {}; + arr = arr.reduce((newArr, next) => { + obj[next.USER_ID] ? "" : (obj[next.USER_ID] = true && newArr.push(next)); + return newArr; + }, []); + return arr; + } loadData = (dataId) => { let json = initFilter(this.props.login.OrgId); extendRule(json, 'ID', 1, dataId); @@ -104,6 +112,7 @@ class HM042ShowPrint extends React.Component { if (this.props.data && this.props.data.loadDataDeal) { this.props.data.loadDataDeal(1); } + this.teamUsers = this.removeDuplicateUser(ret.Nav_Details); this.onClickApprove(false); if (ret.STATUS >= 4) { this.state.isFinished = "inline"; @@ -226,8 +235,8 @@ class HM042ShowPrint extends React.Component { {data.Nav_DeputyGroupLeader ? data.Nav_DeputyGroupLeader.NAME : ''} {data.Nav_GroupLeader ? data.Nav_GroupLeader.NAME : ''} { - data.Nav_Details && data.Nav_Details.map((item, i) => { - if (i == (data.Nav_Details.length - 1)) { + this.teamUsers && this.teamUsers.map((item, i) => { + if (i == (this.teamUsers.length - 1)) { if (item.DEAL_STATUS == 0) return else @@ -257,30 +266,32 @@ class HM042ShowPrint extends React.Component { - - - - - - - - - - - { - data.Nav_Details && data.Nav_Details.map((item, i) => { - return - - - - - - - - - - }) - } + + + + + + + + + + + + { + data.Nav_Details && data.Nav_Details.map((item, i) => { + return + + + + + + + + + + }) + } +
开始时间结束时间层级辨识区域类别辨识对象负责人备注
{moment(item.START_TIME).format('YYYY-MM-DD')}{moment(item.END_TIME).format('YYYY-MM-DD')}{this.renderLevel(item.LEVEL)}{this.joinArea(item.Nav_Areas)}{this.joinIdentifying(item.Nav_Identifyings)}{this.props.app.enums.HMRiskTypeEnmu.enums[item.RISK_TYPE]}{item.Nav_ChargeUser?.NAME}{item.REMARK}
开始时间结束时间层级辨识区域类别辨识对象负责人备注
{moment(item.START_TIME).format('YYYY-MM-DD')}{moment(item.END_TIME).format('YYYY-MM-DD')}{this.renderLevel(item.LEVEL)}{this.joinArea(item.Nav_Areas)}{this.joinIdentifying(item.Nav_Identifyings)}{this.props.app.enums.HMRiskTypeEnmu.enums[item.RISK_TYPE]}{item.Nav_ChargeUser?.NAME}{item.REMARK}
diff --git a/src/components/CustomPages/PF/PFCommonApproveView.js b/src/components/CustomPages/PF/PFCommonApproveView.js index 13f35e9..f0cfe17 100644 --- a/src/components/CustomPages/PF/PFCommonApproveView.js +++ b/src/components/CustomPages/PF/PFCommonApproveView.js @@ -476,22 +476,23 @@ class PFCommonApproveView extends React.Component { if (item.NODE_APPROVE_STATUS != 0) { if (item.Nav_ApproveUser != null && item.Nav_ApproveUser.Nav_UserSignFiles[0] != null) { - return
{(item.NAME? item.NAME: "")}
+ return +
{(item.NAME? item.NAME: "")}
{("审批结论:"+(item.CONTEXT===undefined?"同意":item.CONTEXT ))}
{("审核时间:"+item.NODE_APPROVE_TIME)}

{item.Nav_ApproveUser.NAME}

} else { - return {this.getBaseData(1, this.state.tableKey, 5),this.getBaseData(1, this.state.overDataKey)} , 120000 ); - this.showModalSign(); + } componentWillUnmount() { this.timerID && clearTimeout(this.timerID);
{(item.NAME? item.NAME: "")}
+ return - +
{(item.NAME? item.NAME: "")}
{("审批结论:"+(item.CONTEXT===undefined?"同意":item.CONTEXT ))}
{("审核时间:"+item.NODE_APPROVE_TIME)}



} } diff --git a/src/layout/Header.js b/src/layout/Header.js index 6e6997a..89ca841 100644 --- a/src/layout/Header.js +++ b/src/layout/Header.js @@ -392,8 +392,7 @@ function Header(props) { > 安全管理系统 (SMS) - {/* {baseConfig.SYS_NAME}{" "} */} - -宁化行洛坑 + {baseConfig.SYS_NAME}{" "} )} diff --git a/src/routes/Home.js b/src/routes/Home.js index be8d9d3..a0d858b 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -561,18 +561,18 @@ class Home extends React.Component { } } showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => { - this.props.dispatch({ - type: "app/getDataByPost", - url: "BI/BIController/getVersion", - onComplete: (ret) => { - if (ret > config.version) { - window.localStorage.clear(); - message.success("清除成功,即将重新加载页面", 2, () => { - setTimeout(() => window.location.reload(true), 500); - }); - } - }, - }); + // this.props.dispatch({ + // type: "app/getDataByPost", + // url: "BI/BIController/getVersion", + // onComplete: (ret) => { + // if (ret > config.version) { + // window.localStorage.clear(); + // message.success("清除成功,即将重新加载页面", 2, () => { + // setTimeout(() => window.location.reload(true), 500); + // }); + // } + // }, + // }); const newtmpData = { data: { id: dataId, @@ -599,18 +599,18 @@ class Home extends React.Component { ); }; showEditModal = (dataId, formCode, TaskID, title, taskCode) => { - this.props.dispatch({ - type: "app/getDataByPost", - url: "BI/BIController/getVersion", - onComplete: (ret) => { - if (ret > config.version) { - window.localStorage.clear(); - message.success("清除成功,即将重新加载页面", 2, () => { - setTimeout(() => window.location.reload(true), 500); - }); - } - }, - }); + // this.props.dispatch({ + // type: "app/getDataByPost", + // url: "BI/BIController/getVersion", + // onComplete: (ret) => { + // if (ret > config.version) { + // window.localStorage.clear(); + // message.success("清除成功,即将重新加载页面", 2, () => { + // setTimeout(() => window.location.reload(true), 500); + // }); + // } + // }, + // }); const newtmpData = { data: { id: dataId, From 1f274c5dd3a4a07a4358a91d5006ec5fd3919646 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Tue, 28 May 2024 09:42:59 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=AD=BE=E5=90=8D=E7=85=A7=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index be8d9d3..17f8707 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -31,6 +31,7 @@ import { Table, Button, DatePicker, + notification, Select, } from "antd"; import styles from "./dashboard.css"; @@ -48,6 +49,17 @@ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 }, }; + +const openNotification = (placement) => { + notification.info({ + duration: null, + top: 43, + message: `签名照上传提示:`, + description: "您还没上传自己的签名照片,请在我的资料中尽快上传您的签名照!", + placement, + }); +}; + const AllTech = (props) => { return (