From c85051e62a4c404d141f4b3fef35dac054aa3c69 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Tue, 21 May 2024 13:46:58 +0800 Subject: [PATCH] =?UTF-8?q?lm=E9=A6=96=E9=A1=B5=E5=B8=83=E5=B1=80=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 1256 +++++++++++++++++++++++++++----------------- 1 file changed, 785 insertions(+), 471 deletions(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index 76e2800..b36f6f9 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -172,12 +172,12 @@ class Home extends React.Component { super(props); this.state = { visible: false, - overDataKey:'1', + overDataKey: "1", userInfo: "", timeNow: "上午好", workData: [], workTotal: "", - workTotalData:[], + workTotalData: [], tableKey: "1", formVisible: false, noticeTitle: "", @@ -186,6 +186,8 @@ class Home extends React.Component { searchTodayVisible: false, taskSelects: [], tmpData: {}, + lmVisible: true, + lmdisplay: 24, querySearch: {}, currentpageIndex: "1", visibleStartTime: [], @@ -237,27 +239,49 @@ class Home extends React.Component { window.location.replace(config.guideH5Host); //alert('手机'); } - 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(); + if ( + storage("lacal").getItem("webOrgId")?.val == + "11111111-1111-1111-1111-111111111111" + ) { + this.setState( + { + lmVisible: false, + 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(); + } + ); + } else { + this.setState( + { + lmVisible: true, + 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(); + } + ); + } } - // getSixMonth = (number, yearString = "", monthString = "") => { - // let nowdate = new Date(); - // nowdate.setMonth(nowdate.getMonth() + number); - // let y = nowdate.getFullYear(); - // let m = nowdate.getMonth() + 1; - // // let d = nowdate.getDate(); - // let retrundate = y + yearString + m + monthString; - - // return retrundate; - // }; showTodayModal = ( dataId, formCode, @@ -298,8 +322,8 @@ class Home extends React.Component { showAll = (key) => { const { tableData } = this.state; this.setState({ - overDataKey:key - }) + overDataKey: key, + }); if (key == "2") { this.state.searchColumns = [ @@ -499,7 +523,7 @@ class Home extends React.Component { return "已办"; } } - showTableEditModal= (dataId, formCode, TaskID, title, taskCode) => { + showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => { // this.props.dispatch({ // type: "app/getDataByPost", // url: "BI/BIController/getVersion", @@ -590,9 +614,9 @@ class Home extends React.Component { this.getBaseData(1, this.state.overDataKey); this.clearData(); }; - handleTableCancel= () => { + handleTableCancel = () => { // 退出弹窗 - this.getBaseData(1, this.state.tableKey,5); + this.getBaseData(1, this.state.tableKey, 5); this.clearData(); }; closeModal = () => { @@ -639,16 +663,16 @@ class Home extends React.Component { onlyData: false, onComplete: (ret) => { if (ret && ret.IsSuccessful && ret.Data.newData) { - if(limit == 5) { + if (limit == 5) { this.setState({ workData: ret.Data.newData, // workTotal: ret.Data, }); - }else{ + } else { this.setState({ // workData: ret.Data.newData, workTotal: ret.Data, - workTotalData:ret.Data.newData, + workTotalData: ret.Data.newData, }); } // this.setState({ @@ -1628,170 +1652,171 @@ class Home extends React.Component { - - -
- {this.state.userInfo.SEX == 1 ? ( - homeuser - ) : ( - homeuser - )} -
-
+ {this.state.userInfo.SEX == 1 ? ( + homeuser + ) : ( + homeuser + )} +
+
- {this.state.userInfo.NAME},{this.state.timeNow} -
-
- { - this.setState({ visible: !this.state.visible }); +
- - - 我的资料 - - - - 修改密码 - - - - 清除缓存 - - {/* 版本号:{config.version} */} - - - 退出登录 - - - } - placement="topLeft" - trigger={["click"]} > - - + {this.state.userInfo.NAME},{this.state.timeNow} +
+
+ { + this.setState({ visible: !this.state.visible }); + }} + overlay={ + + + + 我的资料 + + + + 修改密码 + + + + 清除缓存 + + {/* 版本号:{config.version} */} + + + 退出登录 + + + } + placement="topLeft" + trigger={["click"]} + > + + +
-
-
- {/*
+ {/*
工号:{this.state.userInfo.CODE}
*/} -
- 手机号:{this.state.userInfo.PHONE} -
- {this.state.userInfo.Nav_Department ? ( -
- 部门:{this.state.userInfo.Nav_Department.NAME} +
+ 手机号:{this.state.userInfo.PHONE}
- ) : ( - "" - )} + {this.state.userInfo.Nav_Department ? ( +
+ 部门:{this.state.userInfo.Nav_Department.NAME} +
+ ) : ( + "" + )} +
-
-
- - { - this.showAll("1"); - }} - /> - - - { - this.showAll("4"); - }} - /> - - - { - this.showAll("2"); - }} - /> - - - { - this.showAll("3"); - }} - /> - -
- - {/*
*/} - - - -
- {/*
+
+ + { + this.showAll("1"); + }} + /> + + + { + this.showAll("4"); + }} + /> + + + { + this.showAll("2"); + }} + /> + + + { + this.showAll("3"); + }} + /> + +
+ + + +
+ {/*
完成率
*/} -
-
+
+
+
-
- - {/*
+ {/*
*/} -
- {/*
+
+ {/*
及时完成率
*/} +
+
+
+
+ + +
+ + +
+
+
+
我的常用功能
+
+ + {/* */} +
+
+ + { + this.navToMenu("6dc35aee-dd5e-4b31-b7ca-5f62d337d0c1"); + }} + /> + { + this.navToMenu("b3767117-f0aa-4122-97c1-2fc58fbaf934"); + }} + /> + { + this.navToMenu("7a9b51b1-3d56-4199-b450-f9f5f9cc3235"); + }} + /> + { + this.navToMenu("2beef9b3-e4b9-4b0b-9e82-238c4bf3be5d"); + }} + /> + + + { + this.navToMenu("21b685c9-d298-4a14-9700-c9ab1bb8a918"); + }} + /> + { + this.navToMenu("2e7835ef-0e5a-41b5-8bb7-ad9c64a6b2f4"); + }} + /> + { + this.navToMenu("818ab476-b29f-4db5-9393-fd13e1d2a565"); + }} + /> + { + this.navToMenu("800abe55-a2cf-4e23-a2b6-1caf2dca816c"); + }} + /> + +
+ + + ) : ( + + +
+
+ {this.state.userInfo.SEX == 1 ? ( + homeuser + ) : ( + homeuser + )} +
+
+
+
+ {this.state.userInfo.NAME},{this.state.timeNow} +
+
+ { + this.setState({ visible: !this.state.visible }); + }} + overlay={ + + + + 我的资料 + + + + 修改密码 + + + + 清除缓存 + + {/* 版本号:{config.version} */} + + + 退出登录 + + + } + placement="topLeft" + trigger={["click"]} + > + + +
+
+ +
+ {/*
+ 工号:{this.state.userInfo.CODE} +
*/} +
+ 手机号:{this.state.userInfo.PHONE} +
+ {this.state.userInfo.Nav_Department ? ( +
+ 部门:{this.state.userInfo.Nav_Department.NAME} +
+ ) : ( + "" + )} +
+
+
+
+ + { + this.showAll("1"); + }} + /> + + + { + this.showAll("4"); + }} + /> + + + { + this.showAll("2"); + }} + /> + + + { + this.showAll("3"); + }} + /> + +
+ +
+ +
+
+
+
风险等级占比
+
+
+ this.showDetailModal("BI013_RISKANALYSISMODEL") + } + > + +
+
-
- -
- -
-
-
-
我的常用功能
-
+ + + )} - {/* */} -
-
- - { - this.navToMenu("6dc35aee-dd5e-4b31-b7ca-5f62d337d0c1"); - }} - /> - { - this.navToMenu("b3767117-f0aa-4122-97c1-2fc58fbaf934"); - }} - /> - { - this.navToMenu("7a9b51b1-3d56-4199-b450-f9f5f9cc3235"); - }} - /> - { - this.navToMenu("2beef9b3-e4b9-4b0b-9e82-238c4bf3be5d"); - }} - /> - - - { - this.navToMenu("21b685c9-d298-4a14-9700-c9ab1bb8a918"); - }} - /> - { - this.navToMenu("2e7835ef-0e5a-41b5-8bb7-ad9c64a6b2f4"); - }} - /> - { - this.navToMenu("818ab476-b29f-4db5-9393-fd13e1d2a565"); - }} - /> - { - this.navToMenu("800abe55-a2cf-4e23-a2b6-1caf2dca816c"); - }} - /> - -
- -
-
- - -
-
-
-
完成率排名
-
- - {/* */} -
this.showDetailModal("BI001_HOMEDETAIL")}> - -
-
-
+ ) : null} + {this.state.lmVisible ? ( + - {this.state.completeName.map((item, index) => { - return ( -
-
- {index == 0 ? ( - 4-1 - ) : index == 1 ? ( - 4-2 - ) : index == 2 ? ( - 4-3 - ) : ( -
{index + 1}
- )} +
+
+
+
完成率排名
+
-
{item.name}
+ {/* */} +
this.showDetailModal("BI001_HOMEDETAIL")}> + +
+
+
+ {this.state.completeName.map((item, index) => { + return ( +
+
+ {index == 0 ? ( + 4-1 + ) : index == 1 ? ( + 4-2 + ) : index == 2 ? ( + 4-3 + ) : ( +
{index + 1}
+ )} + +
{item.name}
+
+ +
- - -
- ); - })} -
- + ); + })} +
+ + ) : null}
-
+ {this.state.lmVisible ? ( +
+ ) : null} - -
-
-
-
风险等级占比
+ {this.state.lmVisible ? ( + +
+
+
+
风险等级占比
+
+
+ this.showDetailModal("BI013_RISKANALYSISMODEL") + } + > + +
-
- this.showDetailModal("BI013_RISKANALYSISMODEL") - } - > - +
+
-
-
-
-
- + + ) : null}