首页 报表、弹窗 信息 处理

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);
}
componentDidMount() {
// this.loadData()
this.loadData()
this.hiddenDangerTotal();
this.loadReal();
// this.loadReal();
}
componentWillUnmount() {
// this.timerID && clearTimeout(this.timerID);
}
renderSpeedColumn = ()=>{
return { className: 'redTableCell'}
renderSpeedColumn = () => {
return { className: 'redTableCell' }
}
loadReal = () => {
let result = {
@ -119,7 +119,7 @@ class BI054HomeDetail extends React.Component {
},
Percent: 0,
RowCount: 1,
listCount: [0, 349, 0, 0],
listCount: [0, 349, 0, 0],
listName: [
"巡回检查",
"例行检查",
@ -138,7 +138,7 @@ class BI054HomeDetail extends React.Component {
},
Percent: 0,
RowCount: 1,
listCount: [0, 349, 0, 0],
listCount: [0, 349, 0, 0],
listName: [
"巡回检查",
"例行检查",
@ -178,7 +178,7 @@ class BI054HomeDetail extends React.Component {
},
Percent: 0,
RowCount: 1,
listCount:[0, 0, 0, 0],
listCount: [0, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
@ -291,7 +291,7 @@ class BI054HomeDetail extends React.Component {
"综合检查",
],
},
],
ListSafeCheckYearMonth: [],
};
@ -574,42 +574,33 @@ class BI054HomeDetail extends React.Component {
};
hiddenDangerTotal = () => {
if (this.state.data.ListSafeCheckYearMonth && this.state.data.ListSafeCheckYearMonth.length > 0) {
let data = this.state.data.ListSafeCheckYearMonth;
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 data1 = [];
let data2 = [];
let data3 = [];
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]);
}
}
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));
}
// 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({
@ -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
let dangerTotals = document.getElementById("dangerTotal2");
@ -694,7 +731,7 @@ class BI054HomeDetail extends React.Component {
series: series,
});
}
}
};
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 == 3
? "已读"
: "已办";
? "已读"
: "已办";
const type = props.index == 1 || props.index == 2 ? prepare : warning;
return (
@ -112,10 +112,10 @@ const WorkBench = (props) => {
type == "超期"
? "home-work-type-red"
: type == "未办" || type == "未读"
? "home-work-type-yellow"
: type == "已办"
? "home-work-type-green"
: "home-work-type-black"
? "home-work-type-yellow"
: type == "已办"
? "home-work-type-green"
: "home-work-type-black"
}
style={{
marginLeft: "20px",
@ -243,7 +243,7 @@ class Home extends React.Component {
value: 43,
},
],
riskLevelData:[]
riskLevelData: []
};
this.resizeRef = React.createRef();
}
@ -273,12 +273,12 @@ class Home extends React.Component {
lmdisplay: 17,
},
() => {
this.willDo()
this.willDo()
}
);
}
}
willDo = ()=>{
willDo = () => {
this.getBaseData(1, "1", 5);
this.getBaseData(1, "1");
this.timeJudg();
@ -286,13 +286,13 @@ class Home extends React.Component {
// this.homeRound();
this.completeRate();
this.timelyRate();
this.safeCheck();
this.dangerChange();
this.safeCheck();// 安全检查次数统计 月度隐患整改情况
// this.dangerChange();// 原 月度隐患整改情况
this.getUser();
//定时器功能,暂时不开启
this.timerID = setInterval(
() =>{this.getBaseData(1, this.state.tableKey, 5),this.getBaseData(1, this.state.overDataKey)} ,
120000
() => { this.getBaseData(1, this.state.tableKey, 5), this.getBaseData(1, this.state.overDataKey) },
120000
);
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: {
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,
});
}
safeCheck = () => {
const userInfo = storage("lacal").getItem("webUserInfo").val;
let json = initFilter(this.props.login.OrgId, this.state.mineType, "NUM");
this.props.dispatch({
type: "app/getDataByPost",
url: "BI/BIHome/GetHomeInfo",
payload: json,
onlyData: false,
onComplete: (data) => {
if (data && data.IsSuccessful) {
//安全检查次数统计
if (data.Data.ListSafeCheckYearMonth && data.Data.ListSafeCheckYearMonth.length > 0) {
// this.hiddenTop = data.Data.length;
// this.setState({
// dangerList: data.Data,
// });
// //图标2
var listD1 = data.Data.ListSafeCheckYearMonth
let series = [];
let seriesName = listD1[0].listSOURCENAME;// ["巡回检查", "例行检查", "专业检查", "综合检查"];
var CheckTypeCount = seriesName.length
// 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 < listD1.length; i++) {
xData.push(listD1[i].YEAR + "年" + listD1[i].MONTH + "月");
}
let data3 = []
// data3 组合
for (let i = 0; i < CheckTypeCount; i++) {
let dataT = []
for (let j = 0; j < xData.length; j++) {
dataT.push(listD1[j].listListCount[i])
}
data3.push(dataT)
}
// 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", "#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 = () => {
let sourceName = [
@ -1258,7 +1600,7 @@ class Home extends React.Component {
if (data.Data && data.Data.length > 0) {
this.setState({
riskLevelData: data.Data,
},()=>{
}, () => {
this.riskLevel()
});
}
@ -1314,7 +1656,7 @@ class Home extends React.Component {
orient: "vartical",
// x: "right",
// top: "18%",
y:'center',
y: 'center',
right: "15%",
// bottom: "20%",
data: showData,
@ -1411,7 +1753,7 @@ class Home extends React.Component {
visible: false,
});
};
ExpandCancel = () => {};
ExpandCancel = () => { };
showDetailModal = (formCode) => {
var titleTemp = "";
@ -1490,7 +1832,7 @@ class Home extends React.Component {
{
querySearch,
},
() => {}
() => { }
);
};
// 开始时间
@ -1514,7 +1856,7 @@ class Home extends React.Component {
{
querySearch,
},
() => {}
() => { }
);
};
// 结束时间
@ -1572,7 +1914,7 @@ class Home extends React.Component {
footer={null}
className="antd-modal-fullscreen"
closeModal={this.closeModal}
// forceRender={true}
// forceRender={true}
>
<FormPage {...this.state.tmpData} />
</Modal>
@ -1598,7 +1940,7 @@ class Home extends React.Component {
>
<div>
<Form>
<Row style={{margin:'50px 50px 0px 50px'}}>
<Row style={{ margin: '50px 50px 0px 50px' }}>
<Col span={5}>
<Form.Item label={"名称"} {...formItemLayout}>
<Input
@ -1662,7 +2004,7 @@ class Home extends React.Component {
>
<div>
<Form>
<Row style={{margin:'50px 50px 0px 50px'}}>
<Row style={{ margin: '50px 50px 0px 50px' }}>
<Col span={5}>
<Form.Item label={"提醒内容"} {...formItemLayout}>
<Input