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);
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,6 +239,16 @@ class Home extends React.Component {
window.location.replace(config.guideH5Host);
//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");
this.timeJudg();
@ -248,16 +260,28 @@ class Home extends React.Component {
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;
// };
);
} 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();
}
);
}
}
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,6 +1652,7 @@ class Home extends React.Component {
</Modal>
<Col span={24} style={{ width: "100%", height: "100%" }}>
{this.state.lmVisible ? (
<Row
gutter={12}
style={{
@ -1860,8 +1885,6 @@ class Home extends React.Component {
</Col>
</div>
</Col>
{/* <div style={{ width: "30px" }}></div> */}
<Col
span={7}
style={{
@ -1931,7 +1954,9 @@ class Home extends React.Component {
</div>
</div>
</Col>
<div style={{ width: "30px", minWidth: "30px" }}></div>
<Col
span={6}
style={{
@ -2016,6 +2041,288 @@ class Home extends React.Component {
</div>
</Col>
</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
gutter={12}
style={{
@ -2027,7 +2334,7 @@ class Home extends React.Component {
// justifyContent: "space-between",
alignItems: "center",
minHeight: "388px",
overflow:'hidden',
overflow: "hidden",
// minWidth: "1204px",
minWidth: "1136px",
// backgroundColor: "#fff",
@ -2042,7 +2349,7 @@ class Home extends React.Component {
flexDirection: "column",
padding: "0px",
borderRadius: "5px",
overflow:'hidden',
overflow: "hidden",
flex: 1,
// minWidth: "768px",
}}
@ -2184,8 +2491,10 @@ class Home extends React.Component {
</Tabs>
</div>
</Col>
{this.state.lmVisible ? (
<div style={{ width: "30px", minWidth: "30px" }}></div>
) : null}
{this.state.lmVisible ? (
<Col
span={6}
style={{
@ -2263,6 +2572,7 @@ class Home extends React.Component {
})}
</div>
</Col>
) : null}
</Row>
<Row
gutter={12}
@ -2275,7 +2585,7 @@ class Home extends React.Component {
}}
>
<Col
span={17}
span={this.state.lmdisplay}
style={{
height: "100%",
display: "flex",
@ -2345,8 +2655,11 @@ class Home extends React.Component {
</div>
</div>
</Col>
{this.state.lmVisible ? (
<div style={{ width: "30px", minWidth: "30px" }}></div>
) : null}
{this.state.lmVisible ? (
<Col
span={6}
style={{
@ -2391,6 +2704,7 @@ class Home extends React.Component {
></div>
</div>
</Col>
) : null}
</Row>
</Col>
</div>