首页 报表、弹窗 信息 处理

This commit is contained in:
wyw 2024-09-06 15:01:29 +08:00
parent 3bded7145f
commit 2060805561
3 changed files with 767 additions and 818 deletions

View File

@ -55,15 +55,15 @@ class BI054HomeDetail extends React.Component {
// this.timerID = setInterval(() => this.getBaseInfoData(1, this.state.tableKey, 5), 120000); // this.timerID = setInterval(() => this.getBaseInfoData(1, this.state.tableKey, 5), 120000);
} }
componentDidMount() { componentDidMount() {
// this.loadData() this.loadData()
this.hiddenDangerTotal(); this.hiddenDangerTotal();
this.loadReal(); // this.loadReal();
} }
componentWillUnmount() { componentWillUnmount() {
// this.timerID && clearTimeout(this.timerID); // this.timerID && clearTimeout(this.timerID);
} }
renderSpeedColumn = ()=>{ renderSpeedColumn = () => {
return { className: 'redTableCell'} return { className: 'redTableCell' }
} }
loadReal = () => { loadReal = () => {
let result = { let result = {
@ -119,7 +119,7 @@ class BI054HomeDetail extends React.Component {
}, },
Percent: 0, Percent: 0,
RowCount: 1, RowCount: 1,
listCount: [0, 349, 0, 0], listCount: [0, 349, 0, 0],
listName: [ listName: [
"巡回检查", "巡回检查",
"例行检查", "例行检查",
@ -138,7 +138,7 @@ class BI054HomeDetail extends React.Component {
}, },
Percent: 0, Percent: 0,
RowCount: 1, RowCount: 1,
listCount: [0, 349, 0, 0], listCount: [0, 349, 0, 0],
listName: [ listName: [
"巡回检查", "巡回检查",
"例行检查", "例行检查",
@ -178,7 +178,7 @@ class BI054HomeDetail extends React.Component {
}, },
Percent: 0, Percent: 0,
RowCount: 1, RowCount: 1,
listCount:[0, 0, 0, 0], listCount: [0, 0, 0, 0],
listName: [ listName: [
"巡回检查", "巡回检查",
"例行检查", "例行检查",
@ -291,7 +291,7 @@ class BI054HomeDetail extends React.Component {
"综合检查", "综合检查",
], ],
}, },
], ],
ListSafeCheckYearMonth: [], ListSafeCheckYearMonth: [],
}; };
@ -574,42 +574,33 @@ class BI054HomeDetail extends React.Component {
}; };
hiddenDangerTotal = () => { hiddenDangerTotal = () => {
if (this.state.data.ListSafeCheckYearMonth && this.state.data.ListSafeCheckYearMonth.length > 0) {
let data = this.state.data.ListSafeCheckYearMonth;
let xData = []; let xData = [];
let data3 = [ let data1 = [];
[17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 12], let data2 = [];
[317, 330, 316, 330, 292, 286, 299, 286, 295, 299, 223, 201], let data3 = [];
[0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0], let seriesName = [];
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], data.map((item) => {
]; if (item.MONTH > 9) {
for (let i = 0; i < 12; i++) { xData.push(item.YEAR + '-' + item.MONTH);
xData.unshift(getSixMonth(-i, "-", "")); } else {
xData.push(item.YEAR + '-0' + item.MONTH);
}
seriesName = item.listSOURCENAME;
data1.push(item.listListCount);
});
for (var i = 0; i < data[0].listListCount.length; i++) {
for (var j = 0; j < data.length; j++) {
data2.push(data1[j][i]);
}
} }
let seriesName = [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
];
// data.map((item) => {
// if (item.MONTH>9){
// xData.push(item.YEAR+'-'+ item.MONTH);
// }else{
// xData.push(item.YEAR+'-0'+ item.MONTH);
// }
// seriesName = item.listSOURCENAME;
// data1.push(item.listListCount);
// });
// for (var i = 0; i < data[0].listListCount.length; i++) { for (var i = 0; i < data2.length; i += data.length) {
// for (var j = 0; j < data.length; j++) { data3.push(data2.slice(i, i + data.length));
// data2.push(data1[j][i]); }
// }
// }
// for (var i = 0; i < data2.length; i += data.length) {
// data3.push(data2.slice(i, i + data.length));
// }
let series = []; let series = [];
for (let i = 0; i < data3.length; i++) { for (let i = 0; i < data3.length; i++) {
series.push({ series.push({
@ -621,6 +612,52 @@ class BI054HomeDetail extends React.Component {
}); });
} }
// let xData = [];
// let data3 = [
// [17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 12],
// [317, 330, 316, 330, 292, 286, 299, 286, 295, 299, 223, 201],
// [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0],
// [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
// ];
// for (let i = 0; i < 12; i++) {
// xData.unshift(getSixMonth(-i, "-", ""));
// }
// let seriesName = [
// "巡回检查",
// "例行检查",
// "专业检查",
// "综合检查",
// ];
// // data.map((item) => {
// // if (item.MONTH>9){
// // xData.push(item.YEAR+'-'+ item.MONTH);
// // }else{
// // xData.push(item.YEAR+'-0'+ item.MONTH);
// // }
// // seriesName = item.listSOURCENAME;
// // data1.push(item.listListCount);
// // });
// // for (var i = 0; i < data[0].listListCount.length; i++) {
// // for (var j = 0; j < data.length; j++) {
// // data2.push(data1[j][i]);
// // }
// // }
// // for (var i = 0; i < data2.length; i += data.length) {
// // data3.push(data2.slice(i, i + data.length));
// // }
// let series = [];
// for (let i = 0; i < data3.length; i++) {
// series.push({
// name: seriesName[i],
// type: "bar",
// stack: "总量",
// data: data3[i],
// barWidth: "40%",
// });
// }
//图标2 //图标2
let dangerTotals = document.getElementById("dangerTotal2"); let dangerTotals = document.getElementById("dangerTotal2");
@ -694,7 +731,7 @@ class BI054HomeDetail extends React.Component {
series: series, series: series,
}); });
} }
}
}; };
render() { render() {

File diff suppressed because it is too large Load Diff

View File

@ -87,8 +87,8 @@ const WorkBench = (props) => {
item.NOTICE_STATUS == 0 item.NOTICE_STATUS == 0
? "未读" ? "未读"
: item.NOTICE_STATUS == 3 : item.NOTICE_STATUS == 3
? "已读" ? "已读"
: "已办"; : "已办";
const type = props.index == 1 || props.index == 2 ? prepare : warning; const type = props.index == 1 || props.index == 2 ? prepare : warning;
return ( return (
@ -112,10 +112,10 @@ const WorkBench = (props) => {
type == "超期" type == "超期"
? "home-work-type-red" ? "home-work-type-red"
: type == "未办" || type == "未读" : type == "未办" || type == "未读"
? "home-work-type-yellow" ? "home-work-type-yellow"
: type == "已办" : type == "已办"
? "home-work-type-green" ? "home-work-type-green"
: "home-work-type-black" : "home-work-type-black"
} }
style={{ style={{
marginLeft: "20px", marginLeft: "20px",
@ -243,7 +243,7 @@ class Home extends React.Component {
value: 43, value: 43,
}, },
], ],
riskLevelData:[] riskLevelData: []
}; };
this.resizeRef = React.createRef(); this.resizeRef = React.createRef();
} }
@ -273,12 +273,12 @@ class Home extends React.Component {
lmdisplay: 17, lmdisplay: 17,
}, },
() => { () => {
this.willDo() this.willDo()
} }
); );
} }
} }
willDo = ()=>{ willDo = () => {
this.getBaseData(1, "1", 5); this.getBaseData(1, "1", 5);
this.getBaseData(1, "1"); this.getBaseData(1, "1");
this.timeJudg(); this.timeJudg();
@ -286,13 +286,13 @@ class Home extends React.Component {
// this.homeRound(); // this.homeRound();
this.completeRate(); this.completeRate();
this.timelyRate(); this.timelyRate();
this.safeCheck(); this.safeCheck();// 安全检查次数统计 月度隐患整改情况
this.dangerChange(); // this.dangerChange();// 原 月度隐患整改情况
this.getUser(); this.getUser();
//定时器功能,暂时不开启 //定时器功能,暂时不开启
this.timerID = setInterval( this.timerID = setInterval(
() =>{this.getBaseData(1, this.state.tableKey, 5),this.getBaseData(1, this.state.overDataKey)} , () => { this.getBaseData(1, this.state.tableKey, 5), this.getBaseData(1, this.state.overDataKey) },
120000 120000
); );
this.showModalSign(); this.showModalSign();
} }
@ -775,108 +775,450 @@ class Home extends React.Component {
}, },
}); });
}; };
safeCheck = () => {
let series = [];
let seriesName = ["巡回检查", "例行检查", "专业检查", "综合检查"];
let data3 = [
[17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 4],
[43, 41, 43, 32, 47, 33, 57, 38, 46, 42, 49, 39],
[23, 21, 43, 12, 15, 13, 15, 16, 17, 14, 19, 24],
[17, 20, 23, 42, 12, 17, 13, 15, 12, 17, 19, 34],
];
let xData = [];
for (let i = 0; i < 12; i++) {
xData.unshift(getSixMonth(-i, "年", "月"));
}
for (let i = 0; i < data3.length; i++) {
series.push({
name: seriesName[i],
type: "bar",
stack: "总量",
data: data3[i],
barWidth: "20%",
// itemStyle:{
// borderWidth:2,
// borderColor:'#fff',
// barBorderRadius:5,
// }
});
}
let safeChecks = document.getElementById("safeCheck");
if (safeChecks) {
let myChart = echarts.init(safeChecks);
myChart.setOption({
color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d"],
tooltip: { safeCheck = () => {
trigger: "axis", const userInfo = storage("lacal").getItem("webUserInfo").val;
axisPointer: { let json = initFilter(this.props.login.OrgId, this.state.mineType, "NUM");
// 坐标轴指示器,坐标轴触发有效 this.props.dispatch({
type: "shadow", // 默认为直线,可选为:'line' | 'shadow' type: "app/getDataByPost",
}, url: "BI/BIHome/GetHomeInfo",
transitionDuration: 0, payload: json,
}, onlyData: false,
grid: { onComplete: (data) => {
left: "5%", if (data && data.IsSuccessful) {
right: "5%", //安全检查次数统计
bottom: "15%", if (data.Data.ListSafeCheckYearMonth && data.Data.ListSafeCheckYearMonth.length > 0) {
top: "10%",
containLabel: true, // this.hiddenTop = data.Data.length;
z: 22, // this.setState({
}, // dangerList: data.Data,
xAxis: { // });
type: "category", // //图标2
data: xData, var listD1 = data.Data.ListSafeCheckYearMonth
axisLine: { let series = [];
lineStyle: { let seriesName = listD1[0].listSOURCENAME;// ["巡回检查", "例行检查", "专业检查", "综合检查"];
color: "#0c3b71", var CheckTypeCount = seriesName.length
},
}, // let data3 = [
axisLabel: { // [17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 4],
show: true, // [43, 41, 43, 32, 47, 33, 57, 38, 46, 42, 49, 39],
color: "rgb(170,170,170)", // [23, 21, 43, 12, 15, 13, 15, 16, 17, 14, 19, 24],
interval: 0, // [17, 20, 23, 42, 12, 17, 13, 15, 12, 17, 19, 34]
textStyle: { // ];
lineHeight: 14,
},
formatter: function (param) { let xData = [];
return param.split("年")[1]; for (let i = 0; i < listD1.length; i++) {
}, xData.push(listD1[i].YEAR + "年" + listD1[i].MONTH + "月");
}, }
}, let data3 = []
legend: { // data3 组合
data: ["巡回检查", "例行检查", "专业检查", "综合检查"], for (let i = 0; i < CheckTypeCount; i++) {
left: "center", let dataT = []
align: "left", for (let j = 0; j < xData.length; j++) {
bottom: "2%", dataT.push(listD1[j].listListCount[i])
textStyle: { }
color: "#000", data3.push(dataT)
}, }
itemWidth: 10,
itemHeight: 10,
// itemGap: 15, // for (let i = 0; i < 12; i++) {
}, // xData.unshift(getSixMonth(-i, "年", "月"));
yAxis: { // }
type: "value", for (let i = 0; i < data3.length; i++) {
splitLine: { series.push({
show: true, name: seriesName[i],
lineStyle: { type: "bar",
color: ["#f2f2f2"], stack: "总量",
}, data: data3[i],
}, barWidth: "20%",
axisLine: { // itemStyle:{
lineStyle: { // borderWidth:2,
color: "#0c3b71", // borderColor:'#fff',
}, // barBorderRadius:5,
}, // }
axisLabel: { });
color: "rgb(170,170,170)", }
formatter: "{value} ", let safeChecks = document.getElementById("safeCheck");
}, if (safeChecks) {
}, let myChart = echarts.init(safeChecks);
series: series, myChart.setOption({
}); color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d", "#428576", "#72b876", "#c92a76", "#ffa976", "#4286F6", "#72b656", "#c92626", "#ffa646"],
}
tooltip: {
trigger: "axis",
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
},
transitionDuration: 0,
},
grid: {
left: "5%",
right: "5%",
bottom: "15%",
top: "10%",
containLabel: true,
z: 22,
},
xAxis: {
type: "category",
data: xData,
axisLine: {
lineStyle: {
color: "#0c3b71",
},
},
axisLabel: {
show: true,
color: "rgb(170,170,170)",
interval: 0,
textStyle: {
lineHeight: 14,
},
formatter: function (param) {
return param.split("年")[1];
},
},
},
legend: {
data: seriesName,// ["巡回检查", "例行检查", "专业检查", "综合检查"],
left: "center",
align: "left",
bottom: "2%",
textStyle: {
color: "#000",
},
itemWidth: 10,
itemHeight: 10,
// itemGap: 15,
},
yAxis: {
type: "value",
splitLine: {
show: true,
lineStyle: {
color: ["#f2f2f2"],
},
},
axisLine: {
lineStyle: {
color: "#0c3b71",
},
},
axisLabel: {
color: "rgb(170,170,170)",
formatter: "{value} ",
},
},
series: series,
});
}
}
//月度隐患整改情况
if (data.Data.ListC && data.Data.ListC.length > 0) {
let sourceName = []
let ydata = []
// let sourceName = [
// "按时整改隐患",
// "超期整改隐患",
// "未整改隐患",
// "隐患整改率",
// ];
// let ydata = [
// ["2", "5", "6", "8", "10", "9"],
// ["1", "7", "1", "2", "5", "4"],
// ["0", "1", "0", "3", "0", "1"],
// ["100.00", "92.31", "100.00", "76.92", "100.00", "92.86"],
// ];
var ListC = data.Data.ListC;
// SOURCENAME
let xData = ListC[0].NAME.split(',');
for (let i = 0; i < ListC.length; i++) {
sourceName.push(ListC[i].SOURCENAME)
let ydataT = []
for (let j = 0; j < xData.length; j++) {
ydataT.push(ListC[i].Val.split(',')[j])
}
ydata.push(ydataT)
}
// let date = new Date();
// let year = date.getFullYear();
// let month = date.getMonth() + 1;
// let xData = [];
// for (let i = 0; i < 6; i++) {
// xData.unshift(getSixMonth(-i, "-", ""));
// }
let dangerChanges = document.getElementById("dangerChange");
if (dangerChanges) {
let myChart = echarts.init(dangerChanges);
myChart.setOption({
color: ["#72b85b", "#f6841a", "#cc0404", "#4285F4"],
tooltip: {
trigger: "axis",
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
},
transitionDuration: 0,
formatter: function (params) {
return (
params[0].name +
"</br>" +
params[0].marker +
params[0].seriesName +
" : " +
params[0].value +
"</br>" +
params[1].marker +
params[1].seriesName +
" : " +
params[1].value +
"</br>" +
params[2].marker +
params[2].seriesName +
" : " +
params[2].value +
"</br>" +
params[3].marker +
params[3].seriesName +
" : " +
params[3].value +
"%"
);
},
},
grid: {
left: "5%",
right: "5%",
bottom: "15%",
top: "10%",
containLabel: true,
z: 22,
},
xAxis: {
type: "category",
data: xData,
axisLine: {
lineStyle: {
color: "#0c3b71",
},
},
axisLabel: {
show: true,
color: "rgb(170,170,170)",
interval: 0,
textStyle: {
lineHeight: 14,
},
},
},
legend: {
data: sourceName,
left: "center",
align: "left",
bottom: "2%",
textStyle: {
color: "#000",
},
itemWidth: 10,
itemHeight: 10,
// itemGap: 35,
},
yAxis: [
{
type: "value",
position: "left",
splitLine: {
show: true,
lineStyle: {
color: ["#f2f2f2"],
// opacity:0.2
// zlevel: -1,
},
},
axisLine: {
lineStyle: {
color: "#0c3b71",
},
},
axisLabel: {
color: "rgb(170,170,170)",
formatter: "{value} ",
},
},
{
type: "value",
position: "right",
splitLine: {
show: false,
lineStyle: {
color: ["#f2f2f2"],
},
},
axisLine: {
lineStyle: {
color: "#f2f2f2",
},
},
axisLabel: {
color: "rgb(170,170,170)",
formatter: "{value} %",
},
},
],
series: [
{
name: sourceName[0],
type: "bar",
data: ydata[0],
barWidth: "10%",
barGap: "10%",
stack: null,
},
{
name: sourceName[1],
type: "bar",
data: ydata[1],
barWidth: "10%",
barGap: "10%",
stack: null,
},
{
name: sourceName[2],
type: "bar",
data: ydata[2],
barWidth: "10%",
barGap: "10%",
stack: null,
// zlevel: 99,
},
{
name: sourceName[3],
type: "line",
smooth: false,
data: ydata[3],
yAxisIndex: 1,
itemStyle: {
normal: {
lineStyle: {
type: "dotted",
},
},
},
// zlevel:100,
},
],
});
}
}
}
},
});
// let series = [];
// let seriesName = ["巡回检查", "例行检查", "专业检查", "综合检查"];
// let data3 = [
// [17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 4],
// [43, 41, 43, 32, 47, 33, 57, 38, 46, 42, 49, 39],
// [23, 21, 43, 12, 15, 13, 15, 16, 17, 14, 19, 24],
// [17, 20, 23, 42, 12, 17, 13, 15, 12, 17, 19, 34],
// ];
// let xData = [];
// for (let i = 0; i < 12; i++) {
// xData.unshift(getSixMonth(-i, "年", "月"));
// }
// for (let i = 0; i < data3.length; i++) {
// series.push({
// name: seriesName[i],
// type: "bar",
// stack: "总量",
// data: data3[i],
// barWidth: "20%",
// // itemStyle:{
// // borderWidth:2,
// // borderColor:'#fff',
// // barBorderRadius:5,
// // }
// });
// }
// let safeChecks = document.getElementById("safeCheck");
// if (safeChecks) {
// let myChart = echarts.init(safeChecks);
// myChart.setOption({
// color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d"],
// tooltip: {
// trigger: "axis",
// axisPointer: {
// // 坐标轴指示器,坐标轴触发有效
// type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
// },
// transitionDuration: 0,
// },
// grid: {
// left: "5%",
// right: "5%",
// bottom: "15%",
// top: "10%",
// containLabel: true,
// z: 22,
// },
// xAxis: {
// type: "category",
// data: xData,
// axisLine: {
// lineStyle: {
// color: "#0c3b71",
// },
// },
// axisLabel: {
// show: true,
// color: "rgb(170,170,170)",
// interval: 0,
// textStyle: {
// lineHeight: 14,
// },
// formatter: function (param) {
// return param.split("年")[1];
// },
// },
// },
// legend: {
// data: ["巡回检查", "例行检查", "专业检查", "综合检查"],
// left: "center",
// align: "left",
// bottom: "2%",
// textStyle: {
// color: "#000",
// },
// itemWidth: 10,
// itemHeight: 10,
// // itemGap: 15,
// },
// yAxis: {
// type: "value",
// splitLine: {
// show: true,
// lineStyle: {
// color: ["#f2f2f2"],
// },
// },
// axisLine: {
// lineStyle: {
// color: "#0c3b71",
// },
// },
// axisLabel: {
// color: "rgb(170,170,170)",
// formatter: "{value} ",
// },
// },
// series: series,
// });
// }
}; };
dangerChange = () => { dangerChange = () => {
let sourceName = [ let sourceName = [
@ -1258,7 +1600,7 @@ class Home extends React.Component {
if (data.Data && data.Data.length > 0) { if (data.Data && data.Data.length > 0) {
this.setState({ this.setState({
riskLevelData: data.Data, riskLevelData: data.Data,
},()=>{ }, () => {
this.riskLevel() this.riskLevel()
}); });
} }
@ -1314,7 +1656,7 @@ class Home extends React.Component {
orient: "vartical", orient: "vartical",
// x: "right", // x: "right",
// top: "18%", // top: "18%",
y:'center', y: 'center',
right: "15%", right: "15%",
// bottom: "20%", // bottom: "20%",
data: showData, data: showData,
@ -1411,7 +1753,7 @@ class Home extends React.Component {
visible: false, visible: false,
}); });
}; };
ExpandCancel = () => {}; ExpandCancel = () => { };
showDetailModal = (formCode) => { showDetailModal = (formCode) => {
var titleTemp = ""; var titleTemp = "";
@ -1490,7 +1832,7 @@ class Home extends React.Component {
{ {
querySearch, querySearch,
}, },
() => {} () => { }
); );
}; };
// 开始时间 // 开始时间
@ -1514,7 +1856,7 @@ class Home extends React.Component {
{ {
querySearch, querySearch,
}, },
() => {} () => { }
); );
}; };
// 结束时间 // 结束时间
@ -1572,7 +1914,7 @@ class Home extends React.Component {
footer={null} footer={null}
className="antd-modal-fullscreen" className="antd-modal-fullscreen"
closeModal={this.closeModal} closeModal={this.closeModal}
// forceRender={true} // forceRender={true}
> >
<FormPage {...this.state.tmpData} /> <FormPage {...this.state.tmpData} />
</Modal> </Modal>
@ -1598,7 +1940,7 @@ class Home extends React.Component {
> >
<div> <div>
<Form> <Form>
<Row style={{margin:'50px 50px 0px 50px'}}> <Row style={{ margin: '50px 50px 0px 50px' }}>
<Col span={5}> <Col span={5}>
<Form.Item label={"名称"} {...formItemLayout}> <Form.Item label={"名称"} {...formItemLayout}>
<Input <Input
@ -1662,7 +2004,7 @@ class Home extends React.Component {
> >
<div> <div>
<Form> <Form>
<Row style={{margin:'50px 50px 0px 50px'}}> <Row style={{ margin: '50px 50px 0px 50px' }}>
<Col span={5}> <Col span={5}>
<Form.Item label={"提醒内容"} {...formItemLayout}> <Form.Item label={"提醒内容"} {...formItemLayout}>
<Input <Input