This commit is contained in:
wyw 2024-05-23 13:58:13 +08:00
commit 5a0cc9d31c

View File

@ -172,12 +172,12 @@ class Home extends React.Component {
super(props); super(props);
this.state = { this.state = {
visible: false, visible: false,
overDataKey:'1', overDataKey: "1",
userInfo: "", userInfo: "",
timeNow: "上午好", timeNow: "上午好",
workData: [], workData: [],
workTotal: "", workTotal: "",
workTotalData:[], workTotalData: [],
tableKey: "1", tableKey: "1",
formVisible: false, formVisible: false,
noticeTitle: "", noticeTitle: "",
@ -186,6 +186,8 @@ class Home extends React.Component {
searchTodayVisible: false, searchTodayVisible: false,
taskSelects: [], taskSelects: [],
tmpData: {}, tmpData: {},
lmVisible: true,
lmdisplay: 24,
querySearch: {}, querySearch: {},
currentpageIndex: "1", currentpageIndex: "1",
visibleStartTime: [], visibleStartTime: [],
@ -237,6 +239,16 @@ class Home extends React.Component {
window.location.replace(config.guideH5Host); window.location.replace(config.guideH5Host);
//alert('手机'); //alert('手机');
} }
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", 5);
this.getBaseData(1, "1"); this.getBaseData(1, "1");
this.timeJudg(); this.timeJudg();
@ -248,16 +260,28 @@ class Home extends React.Component {
this.dangerChange(); this.dangerChange();
this.getUser(); this.getUser();
} }
// getSixMonth = (number, yearString = "", monthString = "") => { );
// let nowdate = new Date(); } else {
// nowdate.setMonth(nowdate.getMonth() + number); this.setState(
// let y = nowdate.getFullYear(); {
// let m = nowdate.getMonth() + 1; lmVisible: true,
// // let d = nowdate.getDate(); lmdisplay: 17,
// let retrundate = y + yearString + m + monthString; },
() => {
// return retrundate; 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();
}
);
}
}
showTodayModal = ( showTodayModal = (
dataId, dataId,
formCode, formCode,
@ -298,8 +322,8 @@ class Home extends React.Component {
showAll = (key) => { showAll = (key) => {
const { tableData } = this.state; const { tableData } = this.state;
this.setState({ this.setState({
overDataKey:key overDataKey: key,
}) });
if (key == "2") { if (key == "2") {
this.state.searchColumns = [ this.state.searchColumns = [
@ -499,7 +523,7 @@ class Home extends React.Component {
return "已办"; return "已办";
} }
} }
showTableEditModal= (dataId, formCode, TaskID, title, taskCode) => { showTableEditModal = (dataId, formCode, TaskID, title, taskCode) => {
// this.props.dispatch({ // this.props.dispatch({
// type: "app/getDataByPost", // type: "app/getDataByPost",
// url: "BI/BIController/getVersion", // url: "BI/BIController/getVersion",
@ -590,9 +614,9 @@ class Home extends React.Component {
this.getBaseData(1, this.state.overDataKey); this.getBaseData(1, this.state.overDataKey);
this.clearData(); this.clearData();
}; };
handleTableCancel= () => { handleTableCancel = () => {
// 退出弹窗 // 退出弹窗
this.getBaseData(1, this.state.tableKey,5); this.getBaseData(1, this.state.tableKey, 5);
this.clearData(); this.clearData();
}; };
closeModal = () => { closeModal = () => {
@ -639,16 +663,16 @@ class Home extends React.Component {
onlyData: false, onlyData: false,
onComplete: (ret) => { onComplete: (ret) => {
if (ret && ret.IsSuccessful && ret.Data.newData) { if (ret && ret.IsSuccessful && ret.Data.newData) {
if(limit == 5) { if (limit == 5) {
this.setState({ this.setState({
workData: ret.Data.newData, workData: ret.Data.newData,
// workTotal: ret.Data, // workTotal: ret.Data,
}); });
}else{ } else {
this.setState({ this.setState({
// workData: ret.Data.newData, // workData: ret.Data.newData,
workTotal: ret.Data, workTotal: ret.Data,
workTotalData:ret.Data.newData, workTotalData: ret.Data.newData,
}); });
} }
// this.setState({ // this.setState({
@ -1628,6 +1652,7 @@ class Home extends React.Component {
</Modal> </Modal>
<Col span={24} style={{ width: "100%", height: "100%" }}> <Col span={24} style={{ width: "100%", height: "100%" }}>
{this.state.lmVisible ? (
<Row <Row
gutter={12} gutter={12}
style={{ style={{
@ -1860,8 +1885,6 @@ class Home extends React.Component {
</Col> </Col>
</div> </div>
</Col> </Col>
{/* <div style={{ width: "30px" }}></div> */}
<Col <Col
span={7} span={7}
style={{ style={{
@ -1931,7 +1954,9 @@ class Home extends React.Component {
</div> </div>
</div> </div>
</Col> </Col>
<div style={{ width: "30px", minWidth: "30px" }}></div> <div style={{ width: "30px", minWidth: "30px" }}></div>
<Col <Col
span={6} span={6}
style={{ style={{
@ -2016,6 +2041,288 @@ class Home extends React.Component {
</div> </div>
</Col> </Col>
</Row> </Row>
) : (
<Row
gutter={12}
style={{
width: "100%",
height: "25%",
display: "flex",
// padding: "0px 20px",
margin: "0px",
minHeight: "242px",
minWidth: "1136px",
// justifyContent: "space-between",
// backgroundColor: "#fff",
}}
>
<Col
span={13}
style={{
backgroundColor: "#fff",
height: "100%",
display: "flex",
flexDirection: "column",
padding: "0px 20px",
borderRadius: "5px 5px 5px 5px",
minWidth: "453px",
flex: 1,
}}
>
<div
style={{
height: "50%",
width: "100%",
display: "flex",
flexDirection: "row",
alignItems: "center",
borderBottom: "2px solid #f6f6f6",
}}
>
<div
style={{
width: "80px",
height: "80px",
borderRadius: "40px",
backgroundColor: "#fafafa",
fontSize: "18px",
display: "flex",
alignItems: "center",
justifyContent: "center",
marginRight: "10px",
}}
>
{this.state.userInfo.SEX == 1 ? (
<img
src={require("../assets/home/avaB.png")}
style={{
height: "60px",
width: "60px",
alignItems: "center",
objectFit: "contain",
}}
alt="homeuser"
/>
) : (
<img
src={require("../assets/home/avaG.png")}
style={{
height: "60px",
width: "auto",
alignItems: "center",
objectFit: "contain",
}}
alt="homeuser"
/>
)}
</div>
<div
style={{
display: "flex",
flexDirection: "column",
height: "60px",
justifyContent: "space-between",
flex: 1,
}}
>
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
}}
>
<div
style={{
color: "#303133",
fontSize: "16px",
marginLeft: "5px",
fontWeight: "bold",
}}
>
{this.state.userInfo.NAME}{this.state.timeNow}
</div>
<div>
<Dropdown
visible={this.state.visible}
onVisibleChange={() => {
this.setState({ visible: !this.state.visible });
}}
overlay={
<Menu onClick={this.handleUserMenuClick}>
<Menu.Item
key="user-menu-UserInfoShow"
className="home-setting"
>
<Icon
type="pushpin"
style={{ fontSize: "14px", color: "" }}
></Icon>
<FoUserInfoShow>我的资料</FoUserInfoShow>
</Menu.Item>
<Menu.Item
key="user-menu-updatepwd"
className="home-setting"
>
<Icon
type="edit"
style={{ fontSize: "14px" }}
></Icon>
<ModifyPassword>修改密码</ModifyPassword>
</Menu.Item>
<Menu.Item
key="user-menu-cacheclean"
className="home-setting"
>
<Icon
type="tool"
style={{ fontSize: "14px" }}
></Icon>
清除缓存
</Menu.Item>
{/* <Menu.Item>版本号:{config.version}</Menu.Item> */}
<Menu.Item
key="user-menu-logout"
className="home-setting"
>
<Icon
type="poweroff"
style={{ fontSize: "14px" }}
></Icon>
退出登录
</Menu.Item>
</Menu>
}
placement="topLeft"
trigger={["click"]}
>
<Icon
type="setting"
className="home-setting-icon"
></Icon>
</Dropdown>
</div>
</div>
<div style={{ display: "flex", flexDirection: "row" }}>
{/* <div
className="home-userInfo-tabs"
style={{
marginRight: "10px",
}}
>
工号{this.state.userInfo.CODE}
</div> */}
<div
className="home-userInfo-tabs"
style={{
marginRight: "10px",
}}
>
手机号{this.state.userInfo.PHONE}
</div>
{this.state.userInfo.Nav_Department ? (
<div className="home-userInfo-tabs">
部门{this.state.userInfo.Nav_Department.NAME}
</div>
) : (
""
)}
</div>
</div>
</div>
<div className="home-userInfo-card">
<Col span={6}>
<UserInfo
data={this.state.workTotal.todoCount}
title="待办事项"
color="#2177d5"
showAll={() => {
this.showAll("1");
}}
/>
</Col>
<Col span={6}>
<UserInfo
data={this.state.workTotal.timeOverCount}
title="待办超时"
color="#f76707"
showAll={() => {
this.showAll("4");
}}
/>
</Col>
<Col span={6}>
<UserInfo
data={this.state.workTotal.doneCount}
title="已办事项"
color="#48a447"
showAll={() => {
this.showAll("2");
}}
/>
</Col>
<Col span={6}>
<UserInfo
data={this.state.workTotal.todayNewCount}
title="今日提醒"
color="#fcc419"
showAll={() => {
this.showAll("3");
}}
/>
</Col>
</div>
</Col>
<div style={{ width: "20px", minWidth: "20px" }}></div>
<Col
span={10}
style={{
backgroundColor: "#fff",
height: "100%",
padding: "0px",
borderRadius: "5px",
display: "flex",
flexDirection: "column",
minWidth: "344px",
}}
>
<div className="home-always-title">
<div className="home-always-left">
<div className="home-always-badge"></div>
<div className="home-always-name">风险等级占比</div>
</div>
<div
onClick={() =>
this.showDetailModal("BI013_RISKANALYSISMODEL")
}
>
<IconFont
type="icon-24gl-expand2"
// style={{
// fontSize: "18px",
// color: "#333333",
// cursor: "pointer",
// }}
className="home-always-icon"
></IconFont>
</div>
</div>
<div style={{ flex: 1, height: "100%", padding: "0px" }}>
<div
id="riskLevel"
style={{
width: "100%",
height: "100%",
// minHeight: "180px",
}}
></div>
</div>
</Col>
</Row>
)}
<Row <Row
gutter={12} gutter={12}
style={{ style={{
@ -2027,7 +2334,7 @@ class Home extends React.Component {
// justifyContent: "space-between", // justifyContent: "space-between",
alignItems: "center", alignItems: "center",
minHeight: "388px", minHeight: "388px",
overflow:'hidden', overflow: "hidden",
// minWidth: "1204px", // minWidth: "1204px",
minWidth: "1136px", minWidth: "1136px",
// backgroundColor: "#fff", // backgroundColor: "#fff",
@ -2042,7 +2349,7 @@ class Home extends React.Component {
flexDirection: "column", flexDirection: "column",
padding: "0px", padding: "0px",
borderRadius: "5px", borderRadius: "5px",
overflow:'hidden', overflow: "hidden",
flex: 1, flex: 1,
// minWidth: "768px", // minWidth: "768px",
}} }}
@ -2184,8 +2491,10 @@ class Home extends React.Component {
</Tabs> </Tabs>
</div> </div>
</Col> </Col>
{this.state.lmVisible ? (
<div style={{ width: "30px", minWidth: "30px" }}></div> <div style={{ width: "30px", minWidth: "30px" }}></div>
) : null}
{this.state.lmVisible ? (
<Col <Col
span={6} span={6}
style={{ style={{
@ -2263,6 +2572,7 @@ class Home extends React.Component {
})} })}
</div> </div>
</Col> </Col>
) : null}
</Row> </Row>
<Row <Row
gutter={12} gutter={12}
@ -2275,7 +2585,7 @@ class Home extends React.Component {
}} }}
> >
<Col <Col
span={17} span={this.state.lmdisplay}
style={{ style={{
height: "100%", height: "100%",
display: "flex", display: "flex",
@ -2345,8 +2655,11 @@ class Home extends React.Component {
</div> </div>
</div> </div>
</Col> </Col>
{this.state.lmVisible ? (
<div style={{ width: "30px", minWidth: "30px" }}></div> <div style={{ width: "30px", minWidth: "30px" }}></div>
) : null}
{this.state.lmVisible ? (
<Col <Col
span={6} span={6}
style={{ style={{
@ -2391,6 +2704,7 @@ class Home extends React.Component {
></div> ></div>
</div> </div>
</Col> </Col>
) : null}
</Row> </Row>
</Col> </Col>
</div> </div>