首页 报表、弹窗 信息 处理

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,9 +55,9 @@ 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);
@ -575,41 +575,32 @@ 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() {

View File

@ -1,20 +1,10 @@
import React from "react";
import { connect } from "dva";
import {
initFilter,
extendRule,
extendInclude,
getIsPC,
openNotificationMobile,
getSixMonth,
} from "../../../utils/common";
import {
ChartBarShow_Vertical,
LineShow,
} from "../../../utils/commonEcharsShow";
import { Table, Row, Progress, Col } from "antd";
import echarts from "echarts";
import styles from "../HI/StepForm.css";
import React from 'react'
import { connect } from 'dva'
import { initFilter, extendRule, extendInclude, getIsPC, openNotificationMobile } from "../../../utils/common"
import { ChartBarShow_Vertical, LineShow } from "../../../utils/commonEcharsShow"
import { Table, Row, Progress, Col } from 'antd';
import echarts from 'echarts';
import styles from '../HI/StepForm.css';
const formItemLayout = {
labelCol: { span: 6 },
@ -37,377 +27,25 @@ class BI055HomeDetail extends React.Component {
componenthidMount() {
if (!getIsPC()) {
openNotificationMobile("bottomRight", notification);
this.state.displayStr = "none";
openNotificationMobile('bottomRight', notification)
this.state.displayStr = 'none';
this.state.displayNum = 24;
} else {
this.state.displayStr = "";
this.state.displayStr = '';
this.state.displayNum = 16;
}
this.loadReal();
this.loadData()
//定时器功能,暂时不开启
// this.timerID = setInterval(() => this.getBaseInfoData(1, this.state.tableKey, 5), 120000);
}
};
componentDidMount() {
this.loadReal();
this.loadData();
}
loadReal = () => {
let data = {
IsSuccessful: true,
Data: {
ListC: [],
ListSafeCheckYearMonth: [
{
DepartmentName: "穿孔班组",
NUM: 1,
Parent: {
DepartmentName: "穿爆车间",
RowCount: 2,
listCount: [0, 0, 0, 10000],
},
RowCount: 1,
listCount: [0, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "爆破班组",
NUM: 2,
Parent: {
DepartmentName: "穿爆车间",
RowCount: 2,
listCount: [0, 0, 0, 10000],
},
RowCount: 1,
listCount: [0, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "生产班",
NUM: 3,
Parent: {
DepartmentName: "生产技术科",
RowCount: 1,
listCount: [6, 4, 0, 10000],
},
RowCount: 1,
listCount: [4, 1, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "综合班组",
NUM: 4,
Parent: {
DepartmentName: "综合组",
RowCount: 1,
listCount: [3, 4, 0, 10000],
},
RowCount: 1,
listCount: [3, 4, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "采制样班",
NUM: 5,
Parent: {
DepartmentName: "试验化验室",
RowCount: 2,
listCount: [0, 0, 0, 10000],
},
RowCount: 1,
listCount: [0, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "化验班",
NUM: 6,
Parent: {
DepartmentName: "试验化验室",
RowCount: 2,
listCount: [0, 0, 0, 10000],
},
RowCount: 1,
listCount: [0, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "维修班组",
NUM: 7,
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [6, 7, 0, 10000],
},
RowCount: 1,
listCount: [0, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "金宇现场",
NUM: 8,
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [6, 7, 0, 10000],
},
RowCount: 1,
listCount: [2, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "运输二班",
NUM: 9,
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [6, 7, 0, 10000],
},
RowCount: 1,
listCount: [1, 1, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "运输一班",
NUM: 10,
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [6, 7, 0, 10000],
},
RowCount: 1,
listCount: [1, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
{
DepartmentName: "民爆储存库班组",
NUM: 11,
Parent: {
DepartmentName: "安环科",
RowCount: 1,
listCount: [2, 1, 0, 10000],
},
RowCount: 1,
listCount: [0, 0, 0, 10000],
listName: [
"按时整改隐患",
"超期整改隐患",
"未整改隐患",
"隐患整改率",
],
},
],
},
};
var countTypeTitle = [];
var countTypeDataIndex = [];
var columnsTb = [];
if (
data.Data.ListSafeCheckYearMonth != null &&
data.Data.ListSafeCheckYearMonth.length > 0
) {
countTypeTitle = data.Data.ListSafeCheckYearMonth[0].listName;
}
if (countTypeTitle.length < 1) {
countTypeTitle.push("按时整改隐患");
countTypeTitle.push("超期整改隐患");
countTypeTitle.push("未整改隐患");
countTypeTitle.push("隐患整改率");
}
var typeName = ["车间名称", "班组名称"];
var RowCount = 0;
for (let i = 0; i < 2; i++) {
for (let j = 0; j < countTypeTitle.length; j++) {
countTypeDataIndex.push(j);
if (i == 0) {
if (j == 0) {
//头部
columnsTb.push({
title: typeName[i],
dataIndex: "NUM",
onCell: () => this.renderSpeedColumn(),
key: i * 10 + j,
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
this.state.ListSafeCheckYearMonth[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
}
const obj = {
children: record.Parent.DepartmentName,
props: {
rowSpan: RowCount,
},
};
return obj;
},
});
}
//非头部
if (countTypeTitle[j].indexOf("率") > -1) {
columnsTb.push({
title: countTypeTitle[j],
dataIndex: "NUM",
key: i * 10 + j,
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
this.state.ListSafeCheckYearMonth[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
}
const obj = {
children: (
<Progress
percent={record.Parent.listCount[j] / 100}
status="active"
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
/>
),
props: {
rowSpan: RowCount,
},
};
return obj;
},
});
} else {
columnsTb.push({
title: countTypeTitle[j],
dataIndex: "NUM",
key: i * 10 + j,
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
this.state.ListSafeCheckYearMonth[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
}
const obj = {
children: record.Parent.listCount[j],
props: {
rowSpan: RowCount,
},
};
return obj;
},
});
}
} else {
//班组
if (j == 0) {
columnsTb.push({
title: typeName[i],
onCell: () => this.renderSpeedColumn(),
key: i * 10 + j,
render: (value, record, index) => {
const obj = {
children: record.DepartmentName,
};
return obj;
},
});
}
if (countTypeTitle[j].indexOf("率") > -1) {
columnsTb.push({
title: countTypeTitle[j],
key: i * 10 + j,
render: (text, record) => (
<Progress
percent={record.listCount[j] / 100}
status="active"
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
/>
),
});
} else {
columnsTb.push({
title: countTypeTitle[j],
key: i * 10 + j,
render: (value, record, index) => {
const obj = {
children: record.listCount[j],
};
return obj;
},
});
}
}
}
}
this.setState({
countTypeTitle: countTypeTitle,
columnsTb: columnsTb,
ListC: data.Data.ListC,
ListSafeCheckYearMonth: data.Data.ListSafeCheckYearMonth,
});
this.safeChekDanger();
};
renderSpeedColumn = () => {
return { className: "redTableCell" };
};
return { className: 'redTableCell' }
}
loadData = () => {
this.state.showLoading = true;
// var mineType = ''
@ -417,144 +55,119 @@ class BI055HomeDetail extends React.Component {
// } else {
// mineType = this.props.formParam.mineType;
// }
let json = initFilter(this.props.login.OrgId);
// let json = initFilter(this.props.login.OrgId, (this.props.data.mineType == null ? this.props.formParam.mineType : this.props.data.mineType));
this.props.dispatch({
type: "app/getDataByPost",
url: "BI/BIHome/GetHomeDetailMonthRisk",
payload: json,
onlyData: false,
onComplete: (data) => {
if (
data &&
data.IsSuccessful &&
data.Data &&
(data.Data.ListC || data.Data.ListSafeCheckYearMonth)
) {
var countTypeTitle = [];
var countTypeDataIndex = [];
var columnsTb = [];
if (
data.Data.ListSafeCheckYearMonth != null &&
data.Data.ListSafeCheckYearMonth.length > 0
) {
countTypeTitle = data.Data.ListSafeCheckYearMonth[0].listName;
if (data && data.IsSuccessful && data.Data && (data.Data.ListC || data.Data.ListSafeCheckYearMonth)) {
var countTypeTitle = []
var countTypeDataIndex = []
var columnsTb = []
if (data.Data.ListSafeCheckYearMonth != null && data.Data.ListSafeCheckYearMonth.length > 0) {
countTypeTitle = data.Data.ListSafeCheckYearMonth[0].listName
}
if (countTypeTitle.length < 1) {
countTypeTitle.push("按时整改隐患");
countTypeTitle.push("超期整改隐患");
countTypeTitle.push("未整改隐患");
countTypeTitle.push("隐患整改率");
countTypeTitle.push('按时整改隐患')
countTypeTitle.push('超期整改隐患')
countTypeTitle.push('未整改隐患')
countTypeTitle.push('隐患整改率')
}
var typeName = ["车间名称", "班组名称"];
var RowCount = 0;
var typeName = ['车间名称', '班组名称']
var RowCount = 0
for (let i = 0; i < 2; i++) {
for (let j = 0; j < countTypeTitle.length; j++) {
countTypeDataIndex.push(j);
countTypeDataIndex.push(j)
if (i == 0) {
if (j == 0) {
//头部
columnsTb.push({
title: typeName[i],
onCell: () => this.renderSpeedColumn(),
dataIndex: "NUM",
key: i * 10 + j,
key: (i * 10 + j),
onCell: () => this.renderSpeedColumn(),
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
this.state.ListSafeCheckYearMonth[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
RowCount = record.Parent.RowCount
if (index > 0 && this.state.ListSafeCheckYearMonth[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
RowCount = 0
}
const obj = {
children: record.Parent.DepartmentName,
props: {
rowSpan: RowCount,
'rowSpan': RowCount
},
};
return obj;
},
});
}
})
}
//非头部
if (countTypeTitle[j].indexOf("率") > -1) {
if (countTypeTitle[j].indexOf('率') > -1) {
columnsTb.push({
title: countTypeTitle[j],
dataIndex: "NUM",
key: i * 10 + j,
key: (i * 10 + j),
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
this.state.ListSafeCheckYearMonth[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
RowCount = record.Parent.RowCount
if (index > 0 && this.state.ListSafeCheckYearMonth[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
RowCount = 0
}
const obj = {
children: (
<Progress
percent={record.Parent.listCount[j] / 100}
status="active"
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
/>
),
children: <Progress percent={record.Parent.listCount[j] / 100} status="active" strokeColor={{ from: "#108ee9", to: "#108ee9" }} />,
props: {
rowSpan: RowCount,
'rowSpan': RowCount,
},
};
return obj;
},
});
}
})
} else {
columnsTb.push({
title: countTypeTitle[j],
dataIndex: "NUM",
key: i * 10 + j,
key: (i * 10 + j),
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
this.state.ListSafeCheckYearMonth[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
RowCount = record.Parent.RowCount
if (index > 0 && this.state.ListSafeCheckYearMonth[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
RowCount = 0
}
const obj = {
children: record.Parent.listCount[j],
props: {
rowSpan: RowCount,
'rowSpan': RowCount
},
};
return obj;
},
});
}
})
}
} else {
//班组
if (j == 0) {
columnsTb.push({
title: typeName[i],
key: (i * 10 + j),
onCell: () => this.renderSpeedColumn(),
key: i * 10 + j,
render: (value, record, index) => {
const obj = {
children: record.DepartmentName,
};
return obj;
},
});
}
})
}
if (countTypeTitle[j].indexOf("率") > -1) {
if (countTypeTitle[j].indexOf('率') > -1) {
columnsTb.push({
title: countTypeTitle[j],
key: i * 10 + j,
key: (i * 10 + j),
render: (text, record) => (
<Progress
percent={record.listCount[j] / 100}
@ -562,23 +175,26 @@ class BI055HomeDetail extends React.Component {
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
/>
),
});
})
} else {
columnsTb.push({
title: countTypeTitle[j],
key: i * 10 + j,
key: (i * 10 + j),
render: (value, record, index) => {
const obj = {
children: record.listCount[j],
};
return obj;
},
});
}
}
})
}
}
}
}
this.setState({
countTypeTitle: countTypeTitle,
columnsTb: columnsTb,
@ -586,7 +202,8 @@ class BI055HomeDetail extends React.Component {
ListSafeCheckYearMonth: data.Data.ListSafeCheckYearMonth,
});
this.safeChekDanger();
this.safeChekDanger()
}
},
});
@ -603,39 +220,16 @@ class BI055HomeDetail extends React.Component {
// 安全检查和隐患整改
safeChekDanger = () => {
let xData = [];
for (let i = 0; i < 12; i++) {
xData.unshift(getSixMonth(-i, "-", ""));
}
let ydata = [
["3", "2", "2", "3", "2", "0", "2", "5", "6", "8", "0", "5"],
["5", "4", "0", "1", "0", "0", "1", "7", "1", "0", "0", "2"],
["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"],
[
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
"100.00",
],
];
let sourceName =
["按时整改隐患", "超期整改隐患", "未整改隐患", "隐患整改率"];
// if (this.state.ListC) {
// this.state.ListC.map((item) => {
// let name = item.NAME.split(",");
// xData.push(name);
// sourceName.push(item.SOURCENAME);
// let valu = item.Val.split(",");
// ydata.push(valu);
// });
let ydata = [];
let sourceName = [];
if (this.state.ListC) {
this.state.ListC.map((item) => {
let name = item.NAME.split(",");
xData.push(name);
sourceName.push(item.SOURCENAME);
let valu = item.Val.split(",");
ydata.push(valu);
});
let safeInspections = document.getElementById("safeInspection2");
if (safeInspections) {
let myChart = echarts.init(safeInspections);
@ -677,8 +271,8 @@ class BI055HomeDetail extends React.Component {
},
},
grid: {
left: "5%",
right: "5%",
left: "10%",
// right: "10%",
bottom: "15%",
top: "5%",
containLabel: true,
@ -686,7 +280,7 @@ class BI055HomeDetail extends React.Component {
},
xAxis: {
type: "category",
data: xData,
data: xData[0],
axisLine: {
lineStyle: {
color: "#0c3b71",
@ -789,37 +383,21 @@ class BI055HomeDetail extends React.Component {
// zlevel:100,
},
],
},
true
}
, true
);
}
// }
}
};
render() {
return (
<div
style={{
backgroundColor: "white",
width: "1200px",
top: "0",
bottom: "0",
left: "0",
right: "0",
margin: "auto",
borderStyle: "solid",
borderColor: "#ccc",
borderWidth: "1px",
}}
>
<div style={{ backgroundColor: "white", width: "1200px", top: "0", bottom: "0", left: "0", right: "0", margin: "auto", borderStyle: "solid", borderColor: "#ccc", borderWidth: "1px" }} >
<Row gutter={10} style={{ marginTop: "44px" }}>
<Col span={1}> </Col>
<Col span={22}>
<div style={{ border: "1px solid rgb(232,232,232)" }}>
<div
id="safeInspection2"
style={{ width: "100%", height: "350px" }}
></div>
<div id="safeInspection2" style={{ width: "100%", height: "350px" }}></div>
</div>
</Col>
<Col span={1}></Col>
@ -828,15 +406,7 @@ class BI055HomeDetail extends React.Component {
<Col span={1}></Col>
<Col span={22} style={{ height: "100%" }}>
<div className="bi001-table" >
<Table
dataSource={this.state.ListSafeCheckYearMonth}
columns={this.state.columnsTb}
pagination={false}
bordered
loading={this.state.showLoading}
size="small"
rowKey="1"
/>
<Table dataSource={this.state.ListSafeCheckYearMonth} columns={this.state.columnsTb} pagination={false} bordered loading={this.state.showLoading} size="small" rowKey="1" />
</div>
</Col>
<Col span={1}></Col>
@ -846,4 +416,4 @@ class BI055HomeDetail extends React.Component {
);
}
}
export default connect(({ login, app }) => ({ login, app }))(BI055HomeDetail);
export default connect(({ login, app }) => ({ login, app }))(BI055HomeDetail)

View File

@ -286,8 +286,8 @@ class Home extends React.Component {
// this.homeRound();
this.completeRate();
this.timelyRate();
this.safeCheck();
this.dangerChange();
this.safeCheck();// 安全检查次数统计 月度隐患整改情况
// this.dangerChange();// 原 月度隐患整改情况
this.getUser();
//定时器功能,暂时不开启
this.timerID = setInterval(
@ -775,19 +775,56 @@ class Home extends React.Component {
},
});
};
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 = ["巡回检查", "例行检查", "专业检查", "综合检查"];
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 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 < 12; i++) {
xData.unshift(getSixMonth(-i, "年", "月"));
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],
@ -806,7 +843,7 @@ class Home extends React.Component {
if (safeChecks) {
let myChart = echarts.init(safeChecks);
myChart.setOption({
color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d"],
color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d", "#428576", "#72b876", "#c92a76", "#ffa976", "#4286F6", "#72b656", "#c92626", "#ffa646"],
tooltip: {
trigger: "axis",
@ -845,7 +882,7 @@ class Home extends React.Component {
},
},
legend: {
data: ["巡回检查", "例行检查", "专业检查", "综合检查"],
data: seriesName,// ["巡回检查", "例行检查", "专业检查", "综合检查"],
left: "center",
align: "left",
bottom: "2%",
@ -877,6 +914,311 @@ class Home extends React.Component {
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 = [