代码修复、大屏隐藏
This commit is contained in:
parent
c5828259f1
commit
7149aeb4d6
@ -554,7 +554,7 @@ function Header(props) {
|
|||||||
{!props.matchLogin ? (
|
{!props.matchLogin ? (
|
||||||
<div className="header__right">
|
<div className="header__right">
|
||||||
{/* <RiskFourColor/> */}
|
{/* <RiskFourColor/> */}
|
||||||
<FullScreen />
|
{/* <FullScreen /> */}
|
||||||
{/* {window.location.host == "121.41.2.71:8001" ? <FullScreen /> : ""} */}
|
{/* {window.location.host == "121.41.2.71:8001" ? <FullScreen /> : ""} */}
|
||||||
<GuideCode />
|
<GuideCode />
|
||||||
<HeaderNav />
|
<HeaderNav />
|
||||||
|
|||||||
@ -266,6 +266,7 @@ const Sider = (props) => {
|
|||||||
<Icon type="home"></Icon>
|
<Icon type="home"></Icon>
|
||||||
<span>首页</span>
|
<span>首页</span>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
{localStorage.getItem("webOrgId") == '00300000-0000-0000-0000-000000000000'?
|
||||||
<MenuItem key="largeScreen" onClick={navToLarge} title={'可视化大屏'} >
|
<MenuItem key="largeScreen" onClick={navToLarge} title={'可视化大屏'} >
|
||||||
{/* <img
|
{/* <img
|
||||||
src={require("../assets/layout/menu-all.png")}
|
src={require("../assets/layout/menu-all.png")}
|
||||||
@ -274,7 +275,7 @@ const Sider = (props) => {
|
|||||||
/> */}
|
/> */}
|
||||||
<Icon type="alert"></Icon>
|
<Icon type="alert"></Icon>
|
||||||
<span>可视化大屏</span>
|
<span>可视化大屏</span>
|
||||||
</MenuItem>
|
</MenuItem>:null}
|
||||||
<SubMenu
|
<SubMenu
|
||||||
key="sub1"
|
key="sub1"
|
||||||
title={
|
title={
|
||||||
|
|||||||
@ -88,9 +88,16 @@ const contentStyle = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class GroupHome extends React.Component {
|
class GroupHome extends React.Component {
|
||||||
|
_isMounted = false; // 标记组件是否已挂载
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
noticeData: [], // 公告列表数据
|
||||||
|
currentNoticePage: 1, // 当前公告页码
|
||||||
|
noticePageSize: 4, // 每页公告数量(与图片一致,默认显示4条)
|
||||||
|
totalNoticeCount: 0, // 公告总数量
|
||||||
|
activeNoticeTab: "all", // 活跃公告标签(全部/集团发布/公司发布,参考图片)
|
||||||
isNaN: false,
|
isNaN: false,
|
||||||
scoreVisible: false,
|
scoreVisible: false,
|
||||||
scoreTotalVisible: false,
|
scoreTotalVisible: false,
|
||||||
@ -100,6 +107,9 @@ class GroupHome extends React.Component {
|
|||||||
standardScoreNaN: [],
|
standardScoreNaN: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
safetySloganOne: "",
|
safetySloganOne: "",
|
||||||
|
animationDuration: 20,
|
||||||
|
sliderColor: '#de4e58',
|
||||||
|
sliderSize: '24px',
|
||||||
safetySloganTwo: "",
|
safetySloganTwo: "",
|
||||||
noticeTitle: "",
|
noticeTitle: "",
|
||||||
tmpData: {},
|
tmpData: {},
|
||||||
@ -107,8 +117,8 @@ class GroupHome extends React.Component {
|
|||||||
pagination: {},
|
pagination: {},
|
||||||
retData: [],
|
retData: [],
|
||||||
chartData: [],
|
chartData: [],
|
||||||
displayStr: null,
|
displayStr: '',
|
||||||
displayNum: 24,
|
displayNum: 16,
|
||||||
columnData: [],
|
columnData: [],
|
||||||
columnFields: [],
|
columnFields: [],
|
||||||
delayData: [],
|
delayData: [],
|
||||||
@ -207,71 +217,59 @@ class GroupHome extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// if (localStorage.getItem("webOrgId") !== '00300000-0000-0000-0000-000000000000') {
|
this._isMounted = true; // 组件挂载时设为true
|
||||||
// history.replace('/home')
|
// if (localStorage.getItem("webOrgId") !== '00300000-0000-0000-0000-000000000000' && currentPath !== '/home') {
|
||||||
|
// this.props.history.replace('/home')
|
||||||
|
// return
|
||||||
// }
|
// }
|
||||||
if (window.navigator.userAgent.indexOf("Windows") < 1) {
|
if (window.navigator.userAgent.indexOf("Windows") < 1) {
|
||||||
window.location.replace(config.guideH5Host);
|
window.location.replace(config.guideH5Host);
|
||||||
openNotificationMobile("bottomRight");
|
openNotificationMobile("bottomRight");
|
||||||
this.state.displayStr = "none";
|
return; // 阻止后续代码执行
|
||||||
this.state.displayNum = 24;
|
|
||||||
//alert('手机');
|
//alert('手机');
|
||||||
} else {
|
|
||||||
this.state.displayStr = "";
|
|
||||||
this.state.displayNum = 16;
|
|
||||||
//alert('PC');
|
|
||||||
}
|
}
|
||||||
this.state.columns = [
|
this.setState({
|
||||||
{
|
columns: [
|
||||||
width: "450px",
|
{
|
||||||
title: "任务名称",
|
width: "450px",
|
||||||
dataIndex: "NOTICE_TITLE",
|
title: "任务名称",
|
||||||
key: "NOTICE_TITLE",
|
dataIndex: "NOTICE_TITLE",
|
||||||
render: (text, record) => (
|
key: "NOTICE_TITLE",
|
||||||
<span>
|
render: (text, record) => (
|
||||||
<a
|
<span>
|
||||||
onClick={() =>
|
<a
|
||||||
this.showEditModal(
|
onClick={() =>
|
||||||
record.SOURCE_DATA_ID,
|
this.showEditModal(
|
||||||
record.SOURCE_FORMCODE,
|
record.SOURCE_DATA_ID,
|
||||||
record.ID,
|
record.SOURCE_FORMCODE,
|
||||||
record.NOTICE_TITLE
|
record.ID,
|
||||||
)
|
record.NOTICE_TITLE
|
||||||
}
|
)
|
||||||
>
|
}
|
||||||
{record.NOTICE_TITLE}
|
>
|
||||||
</a>
|
{record.NOTICE_TITLE}
|
||||||
</span>
|
</a>
|
||||||
),
|
</span>
|
||||||
},
|
),
|
||||||
{
|
},
|
||||||
title: "开始时间",
|
{
|
||||||
dataIndex: "TASK_STARTDT",
|
title: "开始时间",
|
||||||
key: "TASK_STARTDT",
|
dataIndex: "TASK_STARTDT",
|
||||||
},
|
key: "TASK_STARTDT",
|
||||||
{
|
},
|
||||||
title: "结束时间",
|
{
|
||||||
dataIndex: "TASK_ENDDT",
|
title: "结束时间",
|
||||||
key: "TASK_ENDDT",
|
dataIndex: "TASK_ENDDT",
|
||||||
},
|
key: "TASK_ENDDT",
|
||||||
{
|
},
|
||||||
title: "预警状态",
|
{
|
||||||
dataIndex: "NOTICE_TYPE",
|
title: "预警状态",
|
||||||
key: "NOTICE_TYPE",
|
dataIndex: "NOTICE_TYPE",
|
||||||
render: (text, record) => this.ShowState(record),
|
key: "NOTICE_TYPE",
|
||||||
},
|
render: (text, record) => this.ShowState(record),
|
||||||
];
|
},
|
||||||
this.getTeam();
|
],
|
||||||
//定时器功能,暂时不开启
|
scoreNoneColumns: [{
|
||||||
this.timerID = setInterval(
|
|
||||||
() => this.getBaseInfoData(1, this.state.tableKey, 5),
|
|
||||||
120000
|
|
||||||
);
|
|
||||||
this.showModalSign();
|
|
||||||
this.getBaseInfoData(1, 1, 5);
|
|
||||||
this.setMessageData();
|
|
||||||
this.state.scoreNoneColumns = [
|
|
||||||
{
|
|
||||||
width: "80px",
|
width: "80px",
|
||||||
title: "生产单元",
|
title: "生产单元",
|
||||||
dataIndex: "Nav_ProductionUnit.NAME",
|
dataIndex: "Nav_ProductionUnit.NAME",
|
||||||
@ -339,149 +337,279 @@ class GroupHome extends React.Component {
|
|||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
}],
|
||||||
|
scoreColumns: [
|
||||||
|
{
|
||||||
|
width: "80px",
|
||||||
|
title: "生产单元",
|
||||||
|
dataIndex: "Nav_ProductionUnit.NAME",
|
||||||
|
key: "Nav_ProductionUnit.NAME",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "80px",
|
||||||
|
title: "一级要素",
|
||||||
|
dataIndex: "Nav_Primary.NAME",
|
||||||
|
key: "Nav_Primary.NAME",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "80px",
|
||||||
|
title: "二级要素",
|
||||||
|
dataIndex: "Nav_Second.NAME",
|
||||||
|
key: "Nav_Second.NAME",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "80px",
|
||||||
|
title: "三级要素",
|
||||||
|
dataIndex: "Nav_Three.NAME",
|
||||||
|
key: "Nav_Three.NAME",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "50px",
|
||||||
|
title: "考评项目",
|
||||||
|
dataIndex: "EVALUATION_ITEM",
|
||||||
|
key: "EVALUATION_ITEM",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
this.props.app.enums?.PEEvaluationItemEnum.enums[
|
||||||
|
record.EVALUATION_ITEM
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// width: "500px",
|
||||||
|
title: "考评内容",
|
||||||
|
dataIndex: "CONTENTS",
|
||||||
|
key: "CONTENTS",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "100px",
|
||||||
|
title: "评分办法",
|
||||||
|
dataIndex: "DESCRIPTION",
|
||||||
|
key: "DESCRIPTION",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "50px",
|
||||||
|
title: "标准分",
|
||||||
|
dataIndex: "STANDARDIZED_SCORE",
|
||||||
|
key: "STANDARDIZED_SCORE",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "50px",
|
||||||
|
title: "实得分",
|
||||||
|
dataIndex: "RESULT_SCORE",
|
||||||
|
key: "RESULT_SCORE",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "200px",
|
||||||
|
title: "不符合说明",
|
||||||
|
dataIndex: "NON_CONFORMANCE",
|
||||||
|
key: "NON_CONFORMANCE",
|
||||||
|
},
|
||||||
|
,
|
||||||
|
{
|
||||||
|
width: "80px",
|
||||||
|
title: "评价结论",
|
||||||
|
dataIndex: "EVALUATION_RESULT",
|
||||||
|
key: "EVALUATION_RESULT",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
this.props.app.enums?.PEEvaluationResultEnum.enums[
|
||||||
|
record.EVALUATION_RESULT
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: "100px",
|
||||||
|
title: "评价方法",
|
||||||
|
dataIndex: "Nav_EvaluationMethod",
|
||||||
|
key: "Nav_EvaluationMethod",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
{record.Nav_EvaluationMethod &&
|
||||||
|
record.Nav_EvaluationMethod?.map((item, i) => {
|
||||||
|
return (
|
||||||
|
<tr>
|
||||||
|
<label> {item.Nav_Method?.NAME}</label>
|
||||||
|
</tr>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
scoreTotalColumns: [
|
||||||
|
{
|
||||||
|
title: "生产单元",
|
||||||
|
dataIndex: "Nav_ProductionUnit.NAME",
|
||||||
|
key: "Nav_ProductionUnit.NAME",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "标准化得分",
|
||||||
|
dataIndex: "NON_STANDARDIZED_SCORE",
|
||||||
|
key: "NON_STANDARDIZED_SCORE",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
dataIndex: "",
|
||||||
|
key: "",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span>
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
{" "}
|
||||||
|
<Button onClick={() => this.showStandardScoreModal()}>
|
||||||
|
全部
|
||||||
|
</Button>
|
||||||
|
<Button onClick={() => this.showStandardScoreModal(1)}>
|
||||||
|
不符合项
|
||||||
|
</Button>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
this.getTeam();
|
||||||
|
this.getHomeTitle()
|
||||||
|
//定时器功能,暂时不开启
|
||||||
|
this.timerID = setInterval(
|
||||||
|
() => {
|
||||||
|
if (this._isMounted) {
|
||||||
|
this.getBaseInfoData(1, this.state.tableKey, 5)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
120000
|
||||||
this.state.scoreColumns = [
|
);
|
||||||
{
|
this.showModalSign();
|
||||||
width: "80px",
|
this.getBaseInfoData(1, 1, 5);
|
||||||
title: "生产单元",
|
this.setMessageData();
|
||||||
dataIndex: "Nav_ProductionUnit.NAME",
|
this.getNoticeData()
|
||||||
key: "Nav_ProductionUnit.NAME",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "80px",
|
|
||||||
title: "一级要素",
|
|
||||||
dataIndex: "Nav_Primary.NAME",
|
|
||||||
key: "Nav_Primary.NAME",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "80px",
|
|
||||||
title: "二级要素",
|
|
||||||
dataIndex: "Nav_Second.NAME",
|
|
||||||
key: "Nav_Second.NAME",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "80px",
|
|
||||||
title: "三级要素",
|
|
||||||
dataIndex: "Nav_Three.NAME",
|
|
||||||
key: "Nav_Three.NAME",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "50px",
|
|
||||||
title: "考评项目",
|
|
||||||
dataIndex: "EVALUATION_ITEM",
|
|
||||||
key: "EVALUATION_ITEM",
|
|
||||||
render: (text, record) => (
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
this.props.app.enums?.PEEvaluationItemEnum.enums[
|
|
||||||
record.EVALUATION_ITEM
|
|
||||||
]
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// width: "500px",
|
|
||||||
title: "考评内容",
|
|
||||||
dataIndex: "CONTENTS",
|
|
||||||
key: "CONTENTS",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "100px",
|
|
||||||
title: "评分办法",
|
|
||||||
dataIndex: "DESCRIPTION",
|
|
||||||
key: "DESCRIPTION",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "50px",
|
|
||||||
title: "标准分",
|
|
||||||
dataIndex: "STANDARDIZED_SCORE",
|
|
||||||
key: "STANDARDIZED_SCORE",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "50px",
|
|
||||||
title: "实得分",
|
|
||||||
dataIndex: "RESULT_SCORE",
|
|
||||||
key: "RESULT_SCORE",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "200px",
|
|
||||||
title: "不符合说明",
|
|
||||||
dataIndex: "NON_CONFORMANCE",
|
|
||||||
key: "NON_CONFORMANCE",
|
|
||||||
},
|
|
||||||
,
|
|
||||||
{
|
|
||||||
width: "80px",
|
|
||||||
title: "评价结论",
|
|
||||||
dataIndex: "EVALUATION_RESULT",
|
|
||||||
key: "EVALUATION_RESULT",
|
|
||||||
render: (text, record) => (
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
this.props.app.enums?.PEEvaluationResultEnum.enums[
|
|
||||||
record.EVALUATION_RESULT
|
|
||||||
]
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: "100px",
|
|
||||||
title: "评价方法",
|
|
||||||
dataIndex: "Nav_EvaluationMethod",
|
|
||||||
key: "Nav_EvaluationMethod",
|
|
||||||
render: (text, record) => (
|
|
||||||
<span>
|
|
||||||
{record.Nav_EvaluationMethod &&
|
|
||||||
record.Nav_EvaluationMethod?.map((item, i) => {
|
|
||||||
return (
|
|
||||||
<tr>
|
|
||||||
<label> {item.Nav_Method?.NAME}</label>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
this.state.scoreTotalColumns = [
|
|
||||||
{
|
|
||||||
title: "生产单元",
|
|
||||||
dataIndex: "Nav_ProductionUnit.NAME",
|
|
||||||
key: "Nav_ProductionUnit.NAME",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "标准化得分",
|
|
||||||
dataIndex: "NON_STANDARDIZED_SCORE",
|
|
||||||
key: "NON_STANDARDIZED_SCORE",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
dataIndex: "",
|
|
||||||
key: "",
|
|
||||||
render: (text, record) => (
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
<tr>
|
|
||||||
{" "}
|
|
||||||
<Button onClick={() => this.showStandardScoreModal()}>
|
|
||||||
全部
|
|
||||||
</Button>
|
|
||||||
<Button onClick={() => this.showStandardScoreModal(1)}>
|
|
||||||
不符合项
|
|
||||||
</Button>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.timerID && clearTimeout(this.timerID);
|
this._isMounted = false; // 组件卸载时设为false
|
||||||
|
if (this.timerID) {
|
||||||
|
clearInterval(this.timerID);
|
||||||
|
this.timerID = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
getNoticeData = () => {
|
||||||
|
const { currentNoticePage, noticePageSize, activeNoticeTab, mineType } = this.state;
|
||||||
|
const orgId = storage("lacal").getItem("webOrgId")?.val;
|
||||||
|
// 构建请求参数(按标签筛选:全部/集团/公司)
|
||||||
|
let json = initFilter(orgId, mineType);
|
||||||
|
extendRule(json, "pageNum", 1, currentNoticePage);
|
||||||
|
extendRule(json, "pageSize", 1, noticePageSize);
|
||||||
|
if (activeNoticeTab === "group") {
|
||||||
|
extendRule(json, "sourceType", 1, 1); // 1=集团发布
|
||||||
|
} else if (activeNoticeTab === "company") {
|
||||||
|
extendRule(json, "sourceType", 1, 2); // 2=公司发布
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
noticeData: [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
title: "为表彰先进,树立榜样,激励广大员工积极进取,集团决定开展2023年度优秀员工评选工作...",
|
||||||
|
source: "集团发布",
|
||||||
|
date: "08-30",
|
||||||
|
readStatus: "未读", // 可选:未读/已读
|
||||||
|
isImportant: true // 是否重要提醒
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...",
|
||||||
|
source: "公司发布",
|
||||||
|
date: "08-28",
|
||||||
|
readStatus: "已读",
|
||||||
|
isImportant: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...",
|
||||||
|
source: "公司发布",
|
||||||
|
date: "08-28",
|
||||||
|
readStatus: "已读",
|
||||||
|
isImportant: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "4",
|
||||||
|
title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...",
|
||||||
|
source: "公司发布",
|
||||||
|
date: "08-28",
|
||||||
|
readStatus: "已读",
|
||||||
|
isImportant: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "5",
|
||||||
|
title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...",
|
||||||
|
source: "公司发布",
|
||||||
|
date: "08-28",
|
||||||
|
readStatus: "已读",
|
||||||
|
isImportant: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "6",
|
||||||
|
title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...",
|
||||||
|
source: "公司发布",
|
||||||
|
date: "08-28",
|
||||||
|
readStatus: "已读",
|
||||||
|
isImportant: false
|
||||||
|
}
|
||||||
|
// 更多公告...
|
||||||
|
],
|
||||||
|
totalNoticeCount: 10 // 公告总数
|
||||||
|
})
|
||||||
|
|
||||||
|
// this.props.dispatch({
|
||||||
|
// type: "app/getDataByPost",
|
||||||
|
// url: "PF/Notice/GetNoticeList", // 假设的公告列表接口,需替换为实际接口
|
||||||
|
// payload: json,
|
||||||
|
// onlyData: false,
|
||||||
|
// onComplete: (data) => {
|
||||||
|
// if (data && data.IsSuccessful) {
|
||||||
|
// this.setState({
|
||||||
|
// noticeData: data.Data.list, // 公告列表
|
||||||
|
// totalNoticeCount: data.Data.total, // 公告总数
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
// 公告页码切换
|
||||||
|
changeNoticePage = (page) => {
|
||||||
|
const { totalNoticeCount, noticePageSize } = this.state;
|
||||||
|
// 边界判断:页码不能小于1,不能大于总页数
|
||||||
|
if (page < 1 || page > Math.ceil(totalNoticeCount / noticePageSize)) return;
|
||||||
|
this.setState({ currentNoticePage: page }, () => {
|
||||||
|
this.getNoticeData(); // 切换页码后重新请求数据
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 公告标签切换(全部/集团发布/公司发布)
|
||||||
|
switchNoticeTab = (tabType) => {
|
||||||
|
this.setState({
|
||||||
|
activeNoticeTab: tabType,
|
||||||
|
currentNoticePage: 1, // 切换标签时重置为第1页
|
||||||
|
}, () => {
|
||||||
|
this.getNoticeData(); // 切换标签后重新请求数据
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 查看更多公告(跳转至公告详情页或展开全部)
|
||||||
|
viewMoreNotice = () => {
|
||||||
|
// 逻辑1:跳转至独立公告页面(推荐)
|
||||||
|
this.props.history.push({ pathname: "/noticeList", state: { tab: this.state.activeNoticeTab } });
|
||||||
|
// 逻辑2:在当前页展开全部公告(备选)
|
||||||
|
// this.setState({ noticePageSize: this.state.totalNoticeCount });
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
showModalSign = () => {
|
showModalSign = () => {
|
||||||
var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息
|
var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息
|
||||||
@ -494,53 +622,38 @@ class GroupHome extends React.Component {
|
|||||||
url: "FM/User/UserSign", //验证是否有签名照
|
url: "FM/User/UserSign", //验证是否有签名照
|
||||||
onComplete: (ret) => {
|
onComplete: (ret) => {
|
||||||
//返回查询结果ret
|
//返回查询结果ret
|
||||||
if (ret) {
|
if (this._isMounted && ret) {
|
||||||
//判断是否有记录
|
//判断是否有记录
|
||||||
openNotification("topRight");
|
openNotification("topRight");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
getHomeTitle = () => {
|
||||||
|
var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息
|
||||||
|
let json = initFilter(orgId);
|
||||||
|
this.props.dispatch({
|
||||||
|
type: "app/getDataByPost",
|
||||||
|
payload: json,
|
||||||
|
url: "PF/HomeTitle/OrderPaged",
|
||||||
|
onComplete: (ret) => {
|
||||||
|
if (this._isMounted && ret) {
|
||||||
|
this.setState({
|
||||||
|
safetySloganOne: ret[0].TITLE,
|
||||||
|
// safetySloganOne: "1.安全方针:以人为本、关注健康、依法治企、安全发展。 2.安全理念:一切风险皆可控,一切事故皆可防!3.安全方针:以人为本、关注健康、依法治企、安全发展。4.安全方针:以人为本、关注健康、依法治企、安全发展。5.安全方针:以人为本、关注健康、依法治企、安全发展。 6.安全理念:一切风险皆可控,一切事故皆可防!7.安全方针:以人为本、关注健康、依法治企、安全发展。8.安全方针:以人为本、关注健康、依法治企、安全发展。",
|
||||||
|
animationDuration: ret[0].SECOND,
|
||||||
|
sliderColor: ret[0].COCOR,
|
||||||
|
sliderSize: ret[0].FONTSIZE
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getTeam = () => {
|
getTeam = () => {
|
||||||
var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息
|
var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息
|
||||||
var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息
|
var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息
|
||||||
// 龙岩稀土
|
|
||||||
if (orgId == "8f1cf418-8bf3-ea3f-7a6d-fc5d61247008") {
|
|
||||||
this.setState({
|
|
||||||
safetySloganOne: "安全方针:以人为本、关注健康、依法治企、安全发展。",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 都昌金鼎
|
|
||||||
else if (orgId == "8b3c41aa-51b1-7ce9-1879-248a038c1b5c") {
|
|
||||||
this.setState({
|
|
||||||
safetySloganOne: "安全方针:安全第一,预防为主,科学管理,持续改进。",
|
|
||||||
mineType: localStorage.getItem("currentMineType")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//洛阳豫璐
|
|
||||||
else if (orgId == "d9871ba8-0eec-9e4a-bb87-7d5a540d8913") {
|
|
||||||
this.setState({
|
|
||||||
safetySloganOne: "安全方针:科技、安全、环保、效益。",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//博柏
|
|
||||||
else if (orgId == "3efd5276-632b-e379-9ff3-7a7546591fca") {
|
|
||||||
this.setState({
|
|
||||||
safetySloganOne: "安全方针:安全第一、综合治理、控制风险、科学发展",
|
|
||||||
mineType: localStorage.getItem("currentMineType")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//行洛坑
|
|
||||||
else {
|
|
||||||
this.setState({
|
|
||||||
safetySloganOne: "安全方针:安全第一、综合治理、控制风险、科学发展",
|
|
||||||
mineType: localStorage.getItem("currentMineType")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
safetySloganTwo: "安全理念:一切风险皆可控,一切事故皆可防!",
|
|
||||||
});
|
|
||||||
let json = initFilter(orgId);
|
let json = initFilter(orgId);
|
||||||
extendRule(json, "ID", 1, userId);
|
extendRule(json, "ID", 1, userId);
|
||||||
extendInclude(json, "Nav_Department");
|
extendInclude(json, "Nav_Department");
|
||||||
@ -549,7 +662,7 @@ class GroupHome extends React.Component {
|
|||||||
payload: json,
|
payload: json,
|
||||||
url: "FM/User/Get",
|
url: "FM/User/Get",
|
||||||
onComplete: (ret) => {
|
onComplete: (ret) => {
|
||||||
if (ret && ret.Nav_Department) {
|
if (this._isMounted && ret && ret.Nav_Department) {
|
||||||
this.setState({
|
this.setState({
|
||||||
departmentName: ret.Nav_Department.NAME,
|
departmentName: ret.Nav_Department.NAME,
|
||||||
deparmentType: ret.Nav_Department.DEPARTMENT_TYPE,
|
deparmentType: ret.Nav_Department.DEPARTMENT_TYPE,
|
||||||
@ -733,7 +846,7 @@ class GroupHome extends React.Component {
|
|||||||
payload: json,
|
payload: json,
|
||||||
onlyData: false,
|
onlyData: false,
|
||||||
onComplete: (re) => {
|
onComplete: (re) => {
|
||||||
if (re && re.IsSuccessful && re.Data.newData) {
|
if (this._isMounted && re && re.IsSuccessful && re.Data.newData) {
|
||||||
this.state.tableData[0].total = re.Data.todoCount;
|
this.state.tableData[0].total = re.Data.todoCount;
|
||||||
this.state.tableData[1].total = re.Data.timeOverCount;
|
this.state.tableData[1].total = re.Data.timeOverCount;
|
||||||
this.state.tableData[2].total = re.Data.doneCount;
|
this.state.tableData[2].total = re.Data.doneCount;
|
||||||
@ -1389,9 +1502,9 @@ class GroupHome extends React.Component {
|
|||||||
? "尾矿库"
|
? "尾矿库"
|
||||||
: this.state.mineType == 10
|
: this.state.mineType == 10
|
||||||
? "选矿厂"
|
? "选矿厂"
|
||||||
:this.state.mineType == 31
|
: this.state.mineType == 31
|
||||||
? "职能口": this.state.mineType == 32?"非金属"
|
? "职能口" : this.state.mineType == 32 ? "非金属"
|
||||||
: "露天矿";
|
: "露天矿";
|
||||||
if (formCode == "BI054_HOMEDETAIL") {
|
if (formCode == "BI054_HOMEDETAIL") {
|
||||||
titleTemp += "安全检查次数统计(近12月)";
|
titleTemp += "安全检查次数统计(近12月)";
|
||||||
} else if (formCode == "BI055_HOMEDETAIL") {
|
} else if (formCode == "BI055_HOMEDETAIL") {
|
||||||
@ -1450,6 +1563,9 @@ class GroupHome extends React.Component {
|
|||||||
className: styles.slideHeight,
|
className: styles.slideHeight,
|
||||||
fade: true,
|
fade: true,
|
||||||
};
|
};
|
||||||
|
// 在render方法中添加动态样式计算
|
||||||
|
const { safetySloganOne, animationDuration, sliderColor, sliderSize } = this.state;
|
||||||
|
|
||||||
const rowSelection = {
|
const rowSelection = {
|
||||||
onChange: (selectedRowKeys, selectedRows) => {
|
onChange: (selectedRowKeys, selectedRows) => {
|
||||||
this.state.taskSelects = selectedRows;
|
this.state.taskSelects = selectedRows;
|
||||||
@ -1608,11 +1724,16 @@ class GroupHome extends React.Component {
|
|||||||
<div className="slide-icon-style">
|
<div className="slide-icon-style">
|
||||||
<Icon type="sound" style={{ fontSize: "28px" }}></Icon>
|
<Icon type="sound" style={{ fontSize: "28px" }}></Icon>
|
||||||
</div>
|
</div>
|
||||||
<div className="slide-style">
|
<div
|
||||||
|
className="slide-style"
|
||||||
|
style={{
|
||||||
|
'--animation-duration': `${animationDuration}s`, // 动态设置动画时长
|
||||||
|
'--slider-color': `${sliderColor}`, // 动态设置颜色
|
||||||
|
'--slider-size': `${sliderSize}px`, // 动态设置颜色
|
||||||
|
}}
|
||||||
|
>
|
||||||
<p className="slide-text-style">
|
<p className="slide-text-style">
|
||||||
{this.state.safetySloganOne}
|
{safetySloganOne || '暂无公告'}
|
||||||
|
|
||||||
{this.state.safetySloganTwo}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1997,7 +2118,75 @@ class GroupHome extends React.Component {
|
|||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{/* <Toggle getNum={this.getChildCount}></Toggle> */}
|
{/* 公告栏 */}
|
||||||
|
|
||||||
|
{/* <div style={{ width: "100%", height: "100%" }}>
|
||||||
|
|
||||||
|
<div className="notice-board-container">
|
||||||
|
<div className="notice-board-header">
|
||||||
|
<div className="notice-board-title">
|
||||||
|
公告栏
|
||||||
|
{this.state.noticeData.some(item => item.isImportant) && (
|
||||||
|
<span className="notice-important-tag">包含{this.state.noticeData.filter(item => item.isImportant).length}个重要提醒</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div style={{whiteSpace: "nowrap"}}>
|
||||||
|
<Button
|
||||||
|
type={this.state.activeNoticeTab === "all" ? "primary" : "default"}
|
||||||
|
size="small"
|
||||||
|
onClick={() => this.switchNoticeTab("all")}
|
||||||
|
style={{ marginRight: 8 }}
|
||||||
|
>
|
||||||
|
全部
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type={this.state.activeNoticeTab === "group" ? "primary" : "default"}
|
||||||
|
size="small"
|
||||||
|
onClick={() => this.switchNoticeTab("group")}
|
||||||
|
style={{ marginRight: 8 }}
|
||||||
|
>
|
||||||
|
集团
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type={this.state.activeNoticeTab === "company" ? "primary" : "default"}
|
||||||
|
size="small"
|
||||||
|
onClick={() => this.switchNoticeTab("company")}
|
||||||
|
>
|
||||||
|
公司
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul className="notice-list">
|
||||||
|
{this.state.noticeData.length > 0 ? (
|
||||||
|
this.state.noticeData.map(notice => (
|
||||||
|
<li
|
||||||
|
key={notice.id}
|
||||||
|
className={`notice-item ${notice.readStatus === "未读" ? "unread" : ""}`}
|
||||||
|
onClick={() => this.viewNoticeDetail(notice.id)}
|
||||||
|
>
|
||||||
|
<div className="notice-item-content">
|
||||||
|
<span className="notice-item-title">{notice.title}</span>
|
||||||
|
<span className="notice-item-date">{notice.date}</span>
|
||||||
|
</div>
|
||||||
|
<div className="notice-item-source">
|
||||||
|
{notice.source === 1 ? "集团发布" : "公司发布"}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<li style={{ textAlign: "center", padding: "20px 0", color: "#999" }}>
|
||||||
|
暂无公告数据
|
||||||
|
</li>
|
||||||
|
)}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div className="notice-pagination">
|
||||||
|
<Button onClick={this.viewMoreNotice} block>查看更多公告</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user