首页 报表、弹窗 信息 处理
This commit is contained in:
parent
3bded7145f
commit
2060805561
@ -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 = {
|
||||||
@ -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: [
|
||||||
"巡回检查",
|
"巡回检查",
|
||||||
"例行检查",
|
"例行检查",
|
||||||
@ -575,41 +575,32 @@ 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() {
|
||||||
|
|||||||
@ -1,20 +1,10 @@
|
|||||||
import React from "react";
|
import React from 'react'
|
||||||
import { connect } from "dva";
|
import { connect } from 'dva'
|
||||||
import {
|
import { initFilter, extendRule, extendInclude, getIsPC, openNotificationMobile } from "../../../utils/common"
|
||||||
initFilter,
|
import { ChartBarShow_Vertical, LineShow } from "../../../utils/commonEcharsShow"
|
||||||
extendRule,
|
import { Table, Row, Progress, Col } from 'antd';
|
||||||
extendInclude,
|
import echarts from 'echarts';
|
||||||
getIsPC,
|
import styles from '../HI/StepForm.css';
|
||||||
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";
|
|
||||||
|
|
||||||
const formItemLayout = {
|
const formItemLayout = {
|
||||||
labelCol: { span: 6 },
|
labelCol: { span: 6 },
|
||||||
@ -37,377 +27,25 @@ class BI055HomeDetail extends React.Component {
|
|||||||
|
|
||||||
componenthidMount() {
|
componenthidMount() {
|
||||||
if (!getIsPC()) {
|
if (!getIsPC()) {
|
||||||
openNotificationMobile("bottomRight", notification);
|
openNotificationMobile('bottomRight', notification)
|
||||||
this.state.displayStr = "none";
|
this.state.displayStr = 'none';
|
||||||
this.state.displayNum = 24;
|
this.state.displayNum = 24;
|
||||||
} else {
|
} else {
|
||||||
this.state.displayStr = "";
|
this.state.displayStr = '';
|
||||||
this.state.displayNum = 16;
|
this.state.displayNum = 16;
|
||||||
}
|
}
|
||||||
this.loadReal();
|
this.loadData()
|
||||||
//定时器功能,暂时不开启
|
//定时器功能,暂时不开启
|
||||||
// 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.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 = () => {
|
renderSpeedColumn = () => {
|
||||||
return { className: "redTableCell" };
|
return { className: 'redTableCell' }
|
||||||
};
|
}
|
||||||
loadData = () => {
|
loadData = () => {
|
||||||
this.state.showLoading = true;
|
this.state.showLoading = true;
|
||||||
// var mineType = ''
|
// var mineType = ''
|
||||||
@ -417,144 +55,119 @@ class BI055HomeDetail extends React.Component {
|
|||||||
// } else {
|
// } else {
|
||||||
// mineType = this.props.formParam.mineType;
|
// mineType = this.props.formParam.mineType;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
let json = initFilter(this.props.login.OrgId);
|
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({
|
this.props.dispatch({
|
||||||
type: "app/getDataByPost",
|
type: "app/getDataByPost",
|
||||||
url: "BI/BIHome/GetHomeDetailMonthRisk",
|
url: "BI/BIHome/GetHomeDetailMonthRisk",
|
||||||
payload: json,
|
payload: json,
|
||||||
onlyData: false,
|
onlyData: false,
|
||||||
onComplete: (data) => {
|
onComplete: (data) => {
|
||||||
if (
|
if (data && data.IsSuccessful && data.Data && (data.Data.ListC || data.Data.ListSafeCheckYearMonth)) {
|
||||||
data &&
|
var countTypeTitle = []
|
||||||
data.IsSuccessful &&
|
var countTypeDataIndex = []
|
||||||
data.Data &&
|
var columnsTb = []
|
||||||
(data.Data.ListC || data.Data.ListSafeCheckYearMonth)
|
if (data.Data.ListSafeCheckYearMonth != null && data.Data.ListSafeCheckYearMonth.length > 0) {
|
||||||
) {
|
countTypeTitle = data.Data.ListSafeCheckYearMonth[0].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) {
|
if (countTypeTitle.length < 1) {
|
||||||
countTypeTitle.push("按时整改隐患");
|
countTypeTitle.push('按时整改隐患')
|
||||||
countTypeTitle.push("超期整改隐患");
|
countTypeTitle.push('超期整改隐患')
|
||||||
countTypeTitle.push("未整改隐患");
|
countTypeTitle.push('未整改隐患')
|
||||||
countTypeTitle.push("隐患整改率");
|
countTypeTitle.push('隐患整改率')
|
||||||
}
|
}
|
||||||
|
|
||||||
var typeName = ["车间名称", "班组名称"];
|
var typeName = ['车间名称', '班组名称']
|
||||||
var RowCount = 0;
|
var RowCount = 0
|
||||||
for (let i = 0; i < 2; i++) {
|
for (let i = 0; i < 2; i++) {
|
||||||
for (let j = 0; j < countTypeTitle.length; j++) {
|
for (let j = 0; j < countTypeTitle.length; j++) {
|
||||||
countTypeDataIndex.push(j);
|
countTypeDataIndex.push(j)
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
//头部
|
//头部
|
||||||
columnsTb.push({
|
columnsTb.push({
|
||||||
title: typeName[i],
|
title: typeName[i],
|
||||||
onCell: () => this.renderSpeedColumn(),
|
|
||||||
dataIndex: "NUM",
|
dataIndex: "NUM",
|
||||||
key: i * 10 + j,
|
key: (i * 10 + j),
|
||||||
|
onCell: () => this.renderSpeedColumn(),
|
||||||
render: (value, record, index) => {
|
render: (value, record, index) => {
|
||||||
RowCount = record.Parent.RowCount;
|
RowCount = record.Parent.RowCount
|
||||||
if (
|
if (index > 0 && this.state.ListSafeCheckYearMonth[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
|
||||||
index > 0 &&
|
RowCount = 0
|
||||||
this.state.ListSafeCheckYearMonth[index - 1].Parent
|
|
||||||
.DepartmentName == record.Parent.DepartmentName
|
|
||||||
) {
|
|
||||||
RowCount = 0;
|
|
||||||
}
|
}
|
||||||
const obj = {
|
const obj = {
|
||||||
children: record.Parent.DepartmentName,
|
children: record.Parent.DepartmentName,
|
||||||
props: {
|
props: {
|
||||||
rowSpan: RowCount,
|
'rowSpan': RowCount
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return obj;
|
return obj;
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//非头部
|
//非头部
|
||||||
if (countTypeTitle[j].indexOf("率") > -1) {
|
if (countTypeTitle[j].indexOf('率') > -1) {
|
||||||
columnsTb.push({
|
columnsTb.push({
|
||||||
title: countTypeTitle[j],
|
title: countTypeTitle[j],
|
||||||
dataIndex: "NUM",
|
dataIndex: "NUM",
|
||||||
key: i * 10 + j,
|
key: (i * 10 + j),
|
||||||
render: (value, record, index) => {
|
render: (value, record, index) => {
|
||||||
RowCount = record.Parent.RowCount;
|
RowCount = record.Parent.RowCount
|
||||||
if (
|
if (index > 0 && this.state.ListSafeCheckYearMonth[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
|
||||||
index > 0 &&
|
RowCount = 0
|
||||||
this.state.ListSafeCheckYearMonth[index - 1].Parent
|
|
||||||
.DepartmentName == record.Parent.DepartmentName
|
|
||||||
) {
|
|
||||||
RowCount = 0;
|
|
||||||
}
|
}
|
||||||
const obj = {
|
const obj = {
|
||||||
children: (
|
children: <Progress percent={record.Parent.listCount[j] / 100} status="active" strokeColor={{ from: "#108ee9", to: "#108ee9" }} />,
|
||||||
<Progress
|
|
||||||
percent={record.Parent.listCount[j] / 100}
|
|
||||||
status="active"
|
|
||||||
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
props: {
|
props: {
|
||||||
rowSpan: RowCount,
|
'rowSpan': RowCount,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return obj;
|
return obj;
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
columnsTb.push({
|
columnsTb.push({
|
||||||
title: countTypeTitle[j],
|
title: countTypeTitle[j],
|
||||||
dataIndex: "NUM",
|
dataIndex: "NUM",
|
||||||
key: i * 10 + j,
|
key: (i * 10 + j),
|
||||||
render: (value, record, index) => {
|
render: (value, record, index) => {
|
||||||
RowCount = record.Parent.RowCount;
|
RowCount = record.Parent.RowCount
|
||||||
if (
|
if (index > 0 && this.state.ListSafeCheckYearMonth[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
|
||||||
index > 0 &&
|
RowCount = 0
|
||||||
this.state.ListSafeCheckYearMonth[index - 1].Parent
|
|
||||||
.DepartmentName == record.Parent.DepartmentName
|
|
||||||
) {
|
|
||||||
RowCount = 0;
|
|
||||||
}
|
}
|
||||||
const obj = {
|
const obj = {
|
||||||
children: record.Parent.listCount[j],
|
children: record.Parent.listCount[j],
|
||||||
props: {
|
props: {
|
||||||
rowSpan: RowCount,
|
'rowSpan': RowCount
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return obj;
|
return obj;
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//班组
|
//班组
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
columnsTb.push({
|
columnsTb.push({
|
||||||
title: typeName[i],
|
title: typeName[i],
|
||||||
|
key: (i * 10 + j),
|
||||||
onCell: () => this.renderSpeedColumn(),
|
onCell: () => this.renderSpeedColumn(),
|
||||||
key: i * 10 + j,
|
|
||||||
render: (value, record, index) => {
|
render: (value, record, index) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
children: record.DepartmentName,
|
children: record.DepartmentName,
|
||||||
};
|
};
|
||||||
return obj;
|
return obj;
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (countTypeTitle[j].indexOf("率") > -1) {
|
if (countTypeTitle[j].indexOf('率') > -1) {
|
||||||
columnsTb.push({
|
columnsTb.push({
|
||||||
title: countTypeTitle[j],
|
title: countTypeTitle[j],
|
||||||
key: i * 10 + j,
|
key: (i * 10 + j),
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Progress
|
<Progress
|
||||||
percent={record.listCount[j] / 100}
|
percent={record.listCount[j] / 100}
|
||||||
@ -562,23 +175,26 @@ class BI055HomeDetail extends React.Component {
|
|||||||
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
|
strokeColor={{ from: "#108ee9", to: "#108ee9" }}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
});
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
columnsTb.push({
|
columnsTb.push({
|
||||||
title: countTypeTitle[j],
|
title: countTypeTitle[j],
|
||||||
key: i * 10 + j,
|
key: (i * 10 + j),
|
||||||
render: (value, record, index) => {
|
render: (value, record, index) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
children: record.listCount[j],
|
children: record.listCount[j],
|
||||||
};
|
};
|
||||||
return obj;
|
return obj;
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
countTypeTitle: countTypeTitle,
|
countTypeTitle: countTypeTitle,
|
||||||
columnsTb: columnsTb,
|
columnsTb: columnsTb,
|
||||||
@ -586,7 +202,8 @@ class BI055HomeDetail extends React.Component {
|
|||||||
ListSafeCheckYearMonth: data.Data.ListSafeCheckYearMonth,
|
ListSafeCheckYearMonth: data.Data.ListSafeCheckYearMonth,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.safeChekDanger();
|
this.safeChekDanger()
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -603,39 +220,16 @@ class BI055HomeDetail extends React.Component {
|
|||||||
// 安全检查和隐患整改
|
// 安全检查和隐患整改
|
||||||
safeChekDanger = () => {
|
safeChekDanger = () => {
|
||||||
let xData = [];
|
let xData = [];
|
||||||
for (let i = 0; i < 12; i++) {
|
let ydata = [];
|
||||||
xData.unshift(getSixMonth(-i, "-", ""));
|
let sourceName = [];
|
||||||
}
|
if (this.state.ListC) {
|
||||||
let ydata = [
|
this.state.ListC.map((item) => {
|
||||||
["3", "2", "2", "3", "2", "0", "2", "5", "6", "8", "0", "5"],
|
let name = item.NAME.split(",");
|
||||||
["5", "4", "0", "1", "0", "0", "1", "7", "1", "0", "0", "2"],
|
xData.push(name);
|
||||||
["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"],
|
sourceName.push(item.SOURCENAME);
|
||||||
[
|
let valu = item.Val.split(",");
|
||||||
"100.00",
|
ydata.push(valu);
|
||||||
"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 safeInspections = document.getElementById("safeInspection2");
|
let safeInspections = document.getElementById("safeInspection2");
|
||||||
if (safeInspections) {
|
if (safeInspections) {
|
||||||
let myChart = echarts.init(safeInspections);
|
let myChart = echarts.init(safeInspections);
|
||||||
@ -677,8 +271,8 @@ class BI055HomeDetail extends React.Component {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: "5%",
|
left: "10%",
|
||||||
right: "5%",
|
// right: "10%",
|
||||||
bottom: "15%",
|
bottom: "15%",
|
||||||
top: "5%",
|
top: "5%",
|
||||||
containLabel: true,
|
containLabel: true,
|
||||||
@ -686,7 +280,7 @@ class BI055HomeDetail extends React.Component {
|
|||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "category",
|
type: "category",
|
||||||
data: xData,
|
data: xData[0],
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: "#0c3b71",
|
color: "#0c3b71",
|
||||||
@ -789,37 +383,21 @@ class BI055HomeDetail extends React.Component {
|
|||||||
// zlevel:100,
|
// zlevel:100,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
}
|
||||||
true
|
, true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div style={{ backgroundColor: "white", width: "1200px", top: "0", bottom: "0", left: "0", right: "0", margin: "auto", borderStyle: "solid", borderColor: "#ccc", borderWidth: "1px" }} >
|
||||||
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" }}>
|
<Row gutter={10} style={{ marginTop: "44px" }}>
|
||||||
<Col span={1}> </Col>
|
<Col span={1}> </Col>
|
||||||
<Col span={22}>
|
<Col span={22}>
|
||||||
<div style={{ border: "1px solid rgb(232,232,232)" }}>
|
<div style={{ border: "1px solid rgb(232,232,232)" }}>
|
||||||
<div
|
<div id="safeInspection2" style={{ width: "100%", height: "350px" }}></div>
|
||||||
id="safeInspection2"
|
|
||||||
style={{ width: "100%", height: "350px" }}
|
|
||||||
></div>
|
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={1}></Col>
|
<Col span={1}></Col>
|
||||||
@ -827,16 +405,8 @@ class BI055HomeDetail extends React.Component {
|
|||||||
<Row gutter={10} style={{ marginTop: "14px" }}>
|
<Row gutter={10} style={{ marginTop: "14px" }}>
|
||||||
<Col span={1}></Col>
|
<Col span={1}></Col>
|
||||||
<Col span={22} style={{ height: "100%" }}>
|
<Col span={22} style={{ height: "100%" }}>
|
||||||
<div className="bi001-table">
|
<div className="bi001-table" >
|
||||||
<Table
|
<Table dataSource={this.state.ListSafeCheckYearMonth} columns={this.state.columnsTb} pagination={false} bordered loading={this.state.showLoading} size="small" rowKey="1" />
|
||||||
dataSource={this.state.ListSafeCheckYearMonth}
|
|
||||||
columns={this.state.columnsTb}
|
|
||||||
pagination={false}
|
|
||||||
bordered
|
|
||||||
loading={this.state.showLoading}
|
|
||||||
size="small"
|
|
||||||
rowKey="1"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={1}></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)
|
||||||
|
|||||||
@ -243,7 +243,7 @@ class Home extends React.Component {
|
|||||||
value: 43,
|
value: 43,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
riskLevelData:[]
|
riskLevelData: []
|
||||||
};
|
};
|
||||||
this.resizeRef = React.createRef();
|
this.resizeRef = React.createRef();
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@ class Home extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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,12 +286,12 @@ 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,19 +775,56 @@ class Home extends React.Component {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
safeCheck = () => {
|
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 series = [];
|
||||||
let seriesName = ["巡回检查", "例行检查", "专业检查", "综合检查"];
|
let seriesName = listD1[0].listSOURCENAME;// ["巡回检查", "例行检查", "专业检查", "综合检查"];
|
||||||
let data3 = [
|
var CheckTypeCount = seriesName.length
|
||||||
[17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 4],
|
|
||||||
[43, 41, 43, 32, 47, 33, 57, 38, 46, 42, 49, 39],
|
// let data3 = [
|
||||||
[23, 21, 43, 12, 15, 13, 15, 16, 17, 14, 19, 24],
|
// [17, 20, 16, 20, 16, 16, 20, 16, 16, 20, 16, 4],
|
||||||
[17, 20, 23, 42, 12, 17, 13, 15, 12, 17, 19, 34],
|
// [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 = [];
|
let xData = [];
|
||||||
for (let i = 0; i < 12; i++) {
|
for (let i = 0; i < listD1.length; i++) {
|
||||||
xData.unshift(getSixMonth(-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++) {
|
for (let i = 0; i < data3.length; i++) {
|
||||||
series.push({
|
series.push({
|
||||||
name: seriesName[i],
|
name: seriesName[i],
|
||||||
@ -806,7 +843,7 @@ class Home extends React.Component {
|
|||||||
if (safeChecks) {
|
if (safeChecks) {
|
||||||
let myChart = echarts.init(safeChecks);
|
let myChart = echarts.init(safeChecks);
|
||||||
myChart.setOption({
|
myChart.setOption({
|
||||||
color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d"],
|
color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d", "#428576", "#72b876", "#c92a76", "#ffa976", "#4286F6", "#72b656", "#c92626", "#ffa646"],
|
||||||
|
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
@ -845,7 +882,7 @@ class Home extends React.Component {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ["巡回检查", "例行检查", "专业检查", "综合检查"],
|
data: seriesName,// ["巡回检查", "例行检查", "专业检查", "综合检查"],
|
||||||
left: "center",
|
left: "center",
|
||||||
align: "left",
|
align: "left",
|
||||||
bottom: "2%",
|
bottom: "2%",
|
||||||
@ -877,6 +914,311 @@ class Home extends React.Component {
|
|||||||
series: series,
|
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,
|
||||||
},
|
},
|
||||||
() => {}
|
() => { }
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
// 结束时间
|
// 结束时间
|
||||||
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user