扩展假数据

This commit is contained in:
yunkexin 2024-03-27 17:10:20 +08:00
parent c42d48ebfb
commit 44142f71f2
5 changed files with 2374 additions and 909 deletions

View File

@ -9,6 +9,7 @@ import {
extendOrder,
extend,
initQueryFilter,
getSixMonth
} from "../../../utils/common";
import {
Table,
@ -28,7 +29,161 @@ class BI001HomeDetail extends React.Component {
super(props);
this.state = {
pagination: {},
retData: [],
retData: [
{
shopDoneCount: 1541,
shopDoneRate: 99.94,
shopId: "b53266f6-2ba9-9b30-e96f-f9893a48376d",
shopName: "安环科",
shopOntimeCount: 1437,
shopOverDoneRate: 93.19,
shopTotalCount: 1542,
teamDoneCount: 1541,
teamDoneRate: 99.94,
teamId: "45aba808-c12c-b785-fa09-f9acd9922785",
teamName: "民爆储存库班组",
teamOntimeCount: 1437,
teamOverDoneRate: 93.19,
teamTotalCount: 1542,
teamUndoneCount: 1,
},
{
shopDoneCount: 2792,
shopDoneRate: 99.29,
shopId: "72e83a49-5319-0784-d1ed-025d309b87eb",
shopName: "穿爆车间",
shopOntimeCount: 2080,
shopOverDoneRate: 73.97,
shopTotalCount: 2812,
teamDoneCount: 1466,
teamDoneRate: 99.93,
teamId: "c671778d-dd76-080f-51d1-5dc5ca698419",
teamName: "爆破班组",
teamOntimeCount: 1286,
teamOverDoneRate: 87.66,
teamTotalCount: 1467,
teamUndoneCount: 1,
},
{
shopDoneCount: 2792,
shopDoneRate: 99.29,
shopId: "72e83a49-5319-0784-d1ed-025d309b87eb",
shopName: "穿爆车间",
shopOntimeCount: 2080,
shopOverDoneRate: 73.97,
shopTotalCount: 2812,
teamDoneCount: 1326,
teamDoneRate: 98.59,
teamId: "821a4fe3-5513-681e-ed3c-e61836b29638",
teamName: "穿孔班组",
teamOntimeCount: 794,
teamOverDoneRate: 59.03,
teamTotalCount: 1345,
teamUndoneCount: 19,
},
{
shopDoneCount: 15056,
shopDoneRate: 99.87,
shopId: "30ce4b63-9971-c8d3-a2b4-ca4f51cf0fab",
shopName: "金宇宁化分公司",
shopOntimeCount: 9755,
shopOverDoneRate: 64.71,
shopTotalCount: 15075,
teamDoneCount: 1768,
teamDoneRate: 100,
teamId: "bcdca284-6373-6862-083e-645030a2315d",
teamName: "维修班组",
teamOntimeCount: 1254,
teamOverDoneRate: 70.93,
teamTotalCount: 1768,
teamUndoneCount: 0,
},
{
shopDoneCount: 15056,
shopDoneRate: 99.87,
shopId: "30ce4b63-9971-c8d3-a2b4-ca4f51cf0fab",
shopName: "金宇宁化分公司",
shopOntimeCount: 9755,
shopOverDoneRate: 64.71,
shopTotalCount: 15075,
teamDoneCount: 4927,
teamDoneRate: 99.78,
teamId: "0270fa34-4849-4429-35e8-5fb8b98c9fc9",
teamName: "金宇现场",
teamOntimeCount: 3482,
teamOverDoneRate: 70.51,
teamTotalCount: 4938,
teamUndoneCount: 11,
},
{
shopDoneCount: 15056,
shopDoneRate: 99.87,
shopId: "30ce4b63-9971-c8d3-a2b4-ca4f51cf0fab",
shopName: "金宇宁化分公司",
shopOntimeCount: 9755,
shopOverDoneRate: 64.71,
shopTotalCount: 15075,
teamDoneCount: 2903,
teamDoneRate: 99.93,
teamId: "8ba1fb97-540b-d451-881a-39f632700975",
teamName: "运输二班",
teamOntimeCount: 1854,
teamOverDoneRate: 63.82,
teamTotalCount: 2905,
teamUndoneCount: 2,
},
{
shopDoneCount: 15056,
shopDoneRate: 99.87,
shopId: "30ce4b63-9971-c8d3-a2b4-ca4f51cf0fab",
shopName: "金宇宁化分公司",
shopOntimeCount: 9755,
shopOverDoneRate: 64.71,
shopTotalCount: 15075,
teamDoneCount: 5458,
teamDoneRate: 99.89,
teamId: "db1ccb4a-0ffa-63c9-9384-c3d9139e8c8f",
teamName: "运输一班",
teamOntimeCount: 3165,
teamOverDoneRate: 57.92,
teamTotalCount: 5464,
teamUndoneCount: 6,
},
{
shopDoneCount: 2066,
shopDoneRate: 100,
shopId: "4adbdf10-3cce-ac8a-4abf-104bc12f882a",
shopName: "生产技术科",
shopOntimeCount: 1969,
shopOverDoneRate: 95.3,
shopTotalCount: 2066,
teamDoneCount: 2066,
teamDoneRate: 100,
teamId: "91f40319-fd33-6b72-dfb5-b51b21abac54",
teamName: "生产班",
teamOntimeCount: 1969,
teamOverDoneRate: 95.3,
teamTotalCount: 2066,
teamUndoneCount: 0,
},
{
shopDoneCount: 2253,
shopDoneRate: 99.96,
shopId: "a144c298-17ef-e105-5cb7-34991ca7b3c2",
shopName: "综合组",
shopOntimeCount: 1488,
shopOverDoneRate: 66.02,
shopTotalCount: 2254,
teamDoneCount: 2253,
teamDoneRate: 99.96,
teamId: "9e171704-f1af-9de4-0287-476216371c16",
teamName: "综合班组",
teamOntimeCount: 1488,
teamOverDoneRate: 66.02,
teamTotalCount: 2254,
teamUndoneCount: 1,
},
],
columns1: [
// {
// title: '序号',
@ -147,7 +302,7 @@ class BI001HomeDetail extends React.Component {
{
title: "班组",
dataIndex: "teamName",
onCell:()=>this.renderSpeedColumn()
onCell: () => this.renderSpeedColumn(),
},
{
title: "总任务数",
@ -202,13 +357,119 @@ class BI001HomeDetail extends React.Component {
componentDidMount() {
this.loadData();
}
renderSpeedColumn = ()=>{
return { className: 'redTableCell'}
}
renderSpeedColumn = () => {
return { className: "redTableCell" };
};
loadData = () => {
this.state.showLoading = true;
let param = this.props?.login?.currActivatedMenu?.MENU_FORM_PARAMS;
this.chart1();
this.chartReal();
};
chartReal = () => {
let month = [];
let company = [
100, 100, 100, 99.69, 99.86, 100, 99.94, 100, 100, 99.57, 99.56, 99.17,
];
let department = [
68.79, 58.8, 56.28, 69.59, 69.03, 71.58, 71.08, 75.05, 76.26, 77.09,
77.84, 80.51,
];
for (let i = 0; i < 12; i++) {
month.unshift(getSixMonth(-i, "-", ""));
}
let myChart = echarts.init(document.getElementById("chartClass"));
myChart.setOption({
tooltip: {
trigger: "axis",
formatter: function (params) {
let temp = "";
params.forEach((t) => {
temp =
temp + t.marker + t.seriesName + ":" + t.value + "%" + "<br />";
});
return temp;
},
},
title: {
text: "班组活动任务完成走势图",
left: "center",
top: "5%",
},
// label: {
// show: true,
// position: 'top'
// },
legend: {
// data: ['部门'],
data: ["完成率", "及时完成率"],
bottom: "10px",
},
grid: {
left: "3%",
right: "4%",
top: "15%",
containLabel: true,
},
toolbox: {
feature: {
// saveAsImage: {}
},
},
xAxis: {
type: "category",
data: month,
axisLabel: {
showMaxLabel: true,
},
},
yAxis: {
type: "value",
axisLabel: {
formatter: function (val) {
return val + "%";
},
},
},
series: [
{
name: "完成率",
type: "line",
color: "#4b9bf3",
data: company,
smooth: true,
// symbol:'none',
},
{
name: "及时完成率",
type: "line",
color: "#FCD149",
data: department,
areaStyle: {},
areaStyle: {
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#FCD149", // 0% 处的颜色
},
{
offset: 1,
color: "#fff", // 100% 处的颜色
},
],
global: false,
},
},
smooth: true,
symbol: "circle",
},
],
});
};
//矿山
chart1 = () => {
@ -235,13 +496,19 @@ class BI001HomeDetail extends React.Component {
tooltip: {
trigger: "axis",
formatter: function (params) {
let temp=''
params.forEach(t=>{
temp=temp+t.marker + t.seriesName +":"+t.value+"%"+'<br />';
})
let temp = "";
params.forEach((t) => {
temp =
temp +
t.marker +
t.seriesName +
":" +
t.value +
"%" +
"<br />";
});
return temp;
}
},
},
title: {
text: "班组活动任务完成走势图",
@ -290,7 +557,7 @@ class BI001HomeDetail extends React.Component {
color: "#4b9bf3",
data: company,
smooth: true,
// symbol:'none',
// symbol:'none',
},
{
name: "及时完成率",
@ -300,21 +567,26 @@ class BI001HomeDetail extends React.Component {
areaStyle: {},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: "#FCD149" // 0% 处的颜色
}, {
offset: 1, color: '#fff' // 100% 处的颜色
}],
global: false
}
},
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#FCD149", // 0% 处的颜色
},
{
offset: 1,
color: "#fff", // 100% 处的颜色
},
],
global: false,
},
},
smooth: true,
symbol:'circle',
symbol: "circle",
},
],
});
@ -360,10 +632,13 @@ class BI001HomeDetail extends React.Component {
<div
// className="dashboard-div-style"
style={{
border: "1px solid rgb(232,232,232)"
border: "1px solid rgb(232,232,232)",
}}
>
<div id="chartClass" style={{ width: "100%", height: "350px" }}></div>
<div
id="chartClass"
style={{ width: "100%", height: "350px" }}
></div>
</div>
</Col>
<Col span={1}></Col>
@ -374,9 +649,11 @@ class BI001HomeDetail extends React.Component {
<Col span={22} style={{ height: "100%" }}>
<div
className="bi001-table"
style={{
// border: "1px solid rgb(232,232,232)"
}}
style={
{
// border: "1px solid rgb(232,232,232)"
}
}
>
<Table
dataSource={this.state.retData}

View File

@ -1,10 +1,20 @@
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 { notification, Button, Descriptions, Table, Row, 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,
getSixMonth,
} from "../../../utils/common";
import {
ChartBarShow_Vertical,
LineShow,
} from "../../../utils/commonEcharsShow";
import { notification, Button, Descriptions, Table, Row, Col } from "antd";
import echarts from "echarts";
import styles from "../HI/StepForm.css";
const formItemLayout = {
labelCol: { span: 6 },
@ -13,7 +23,6 @@ const formItemLayout = {
// 安全检查次数统计明细(首页)
class BI054HomeDetail extends React.Component {
constructor(props) {
super(props);
this.state = {
@ -28,44 +37,416 @@ class BI054HomeDetail extends React.Component {
// listSafeCheckTypeYear: [],
// listCheckTypeYear: [],
};
};
}
componenthidMount() {
if (!getIsPC()) {
openNotificationMobile('bottomRight', notification)
this.state.displayStr = 'none';
openNotificationMobile("bottomRight", notification);
this.state.displayStr = "none";
this.state.displayNum = 24;
//alert('手机');
} else {
this.state.displayStr = '';
this.state.displayStr = "";
this.state.displayNum = 16;
//alert('PC');
}
this.loadData()
this.loadData();
//定时器功能,暂时不开启
// this.timerID = setInterval(() => this.getBaseInfoData(1, this.state.tableKey, 5), 120000);
};
}
componentDidMount() {
this.loadData()
// this.loadData()
this.hiddenDangerTotal();
this.loadReal();
}
componentWillUnmount() {
// this.timerID && clearTimeout(this.timerID);
}
loadReal = () => {
let result = {
ListSafeCheckCountDepartment: [
{
DepartmentName: "穿孔班组",
DepartmentType: 2,
NUM: 1,
Parent: {
DepartmentName: "穿爆车间",
RowCount: 2,
listCount: [51, 751, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 350, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "爆破班组",
DepartmentType: 2,
NUM: 2,
Parent: {
DepartmentName: "穿爆车间",
RowCount: 2,
listCount: [51, 751, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 350, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "生产班",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 3,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "生产技术科",
RowCount: 1,
listCount: [51, 522, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 349, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "综合班组",
DepartmentType: 2,
NUM: 4,
Parent: {
DepartmentName: "综合组",
RowCount: 1,
listCount: [0, 349, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 349, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "采制样班",
DepartmentType: 2,
NUM: 5,
Parent: {
DepartmentName: "试验化验室",
RowCount: 2,
listCount: [0, 0, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 0, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "化验班",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 6,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "试验化验室",
RowCount: 2,
listCount: [0, 0, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount:[0, 0, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "维修班组",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 7,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [51, 1452, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 351, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "金宇现场",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 8,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [51, 1452, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 350, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "运输二班",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 9,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [51, 1452, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 350, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "运输一班",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 10,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "金宇宁化分公司",
RowCount: 4,
listCount: [51, 1452, 0, 0, 0],
},
Percent: 0,
RowCount: 1,
listCount: [0, 350, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
{
DepartmentName: "民爆储存库班组",
DepartmentType: 2,
Department_ID: "97ee9944-74e6-6c99-d4c3-9e48f29beb98",
NUM: 11,
PARENT_ID: "72e83a49-5319-0784-d1ed-025d309b87eb",
Parent: {
DepartmentName: "安环科",
RowCount: 1,
listCount: [52, 400, 2, 1, 1],
},
Percent: 0,
RowCount: 1,
listCount: [0, 349, 0, 0, 0],
listName: [
"巡回检查",
"例行检查",
"专业检查",
"综合检查",
"综合检查",
],
},
],
ListSafeCheckYearMonth: [],
};
if (
result.ListSafeCheckCountDepartment != null &&
result.ListSafeCheckCountDepartment.length > 0
) {
// listName.push('车间名称')
// result.ListSafeCheckCountDepartment[0].listName.forEach((e, i) => {
// listName.push(e)
// })
// listName.push('班组名称')
// result.ListSafeCheckCountDepartment[0].listChild[0].listName.forEach(e => {
// listName.push(e)
// })
var countTypeTitle = [];
var columnsTb = [];
if (
result.ListSafeCheckCountDepartment != null &&
result.ListSafeCheckCountDepartment.length > 0
) {
countTypeTitle = result.ListSafeCheckCountDepartment[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++) {
if (i == 0) {
if (j == 0) {
//头部
columnsTb.push({
title: typeName[i],
dataIndex: "NUM",
key: i * 10 + j,
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
result.ListSafeCheckCountDepartment[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
}
const obj = {
children: record.Parent.DepartmentName,
props: {
rowSpan: RowCount,
},
};
return obj;
},
});
}
//非头部
columnsTb.push({
title: countTypeTitle[j],
dataIndex: "NUM",
key: i * 10 + j,
render: (value, record, index) => {
RowCount = record.Parent.RowCount;
if (
index > 0 &&
result.ListSafeCheckCountDepartment[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],
key: i * 10 + j,
render: (value, record, index) => {
const obj = {
children: record.DepartmentName,
};
return obj;
},
});
}
columnsTb.push({
title: countTypeTitle[j],
key: i * 10 + j,
render: (value, record, index) => {
const obj = {
children: record.listCount[j],
};
return obj;
},
});
}
}
}
this.setState({
data: {
countTypeTitle: countTypeTitle,
columnsTb: columnsTb,
// listName: listName,
ListSafeCheckYearMonth: result.ListSafeCheckYearMonth,
ListSafeCheckCountDepartment: result.ListSafeCheckCountDepartment, //车间 子集是 班组
},
});
}
};
//加载数据赋值
loadData = () => {
this.state.showLoading = true;
// let json = initFilter(this.props.login.OrgId, this.props.data.mineType, "NUM");
let json = initFilter(this.props.login.OrgId,'', "NUM");
let json = initFilter(this.props.login.OrgId, "", "NUM");
this.props.dispatch({
type: 'app/getDataByPost',
type: "app/getDataByPost",
payload: json,
url: 'BI/BIHome/GetHomeDetailMonthCheckType',
url: "BI/BIHome/GetHomeDetailMonthCheckType",
onComplete: (result) => {
if (result) {
// let listName = []
if (result.ListSafeCheckCountDepartment != null && result.ListSafeCheckCountDepartment.length > 0) {
if (
result.ListSafeCheckCountDepartment != null &&
result.ListSafeCheckCountDepartment.length > 0
) {
// listName.push('车间名称')
// result.ListSafeCheckCountDepartment[0].listName.forEach((e, i) => {
// listName.push(e)
@ -76,21 +457,24 @@ class BI054HomeDetail extends React.Component {
// listName.push(e)
// })
var countTypeTitle = []
var columnsTb = []
if (result.ListSafeCheckCountDepartment != null && result.ListSafeCheckCountDepartment.length > 0) {
countTypeTitle = result.ListSafeCheckCountDepartment[0].listName
var countTypeTitle = [];
var columnsTb = [];
if (
result.ListSafeCheckCountDepartment != null &&
result.ListSafeCheckCountDepartment.length > 0
) {
countTypeTitle = result.ListSafeCheckCountDepartment[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++) {
@ -100,21 +484,25 @@ class BI054HomeDetail extends React.Component {
columnsTb.push({
title: typeName[i],
dataIndex: "NUM",
key: (i * 10 + j),
key: i * 10 + j,
render: (value, record, index) => {
RowCount = record.Parent.RowCount
if (index > 0 && result.ListSafeCheckCountDepartment[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
RowCount = 0
RowCount = record.Parent.RowCount;
if (
index > 0 &&
result.ListSafeCheckCountDepartment[index - 1].Parent
.DepartmentName == record.Parent.DepartmentName
) {
RowCount = 0;
}
const obj = {
children: record.Parent.DepartmentName,
props: {
'rowSpan': RowCount
rowSpan: RowCount,
},
};
return obj;
}
})
},
});
}
//非头部
@ -122,101 +510,112 @@ class BI054HomeDetail extends React.Component {
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 && result.ListSafeCheckCountDepartment[index - 1].Parent.DepartmentName == record.Parent.DepartmentName) {
RowCount = 0
RowCount = record.Parent.RowCount;
if (
index > 0 &&
result.ListSafeCheckCountDepartment[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),
key: i * 10 + j,
render: (value, record, index) => {
const obj = {
children: record.DepartmentName,
};
return obj;
}
})
},
});
}
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({
data: {
countTypeTitle: countTypeTitle,
columnsTb: columnsTb,
// listName: listName,
ListSafeCheckYearMonth: result.ListSafeCheckYearMonth,
ListSafeCheckCountDepartment: result.ListSafeCheckCountDepartment,//车间 子集是 班组
}
})
this.hiddenDangerTotal()
ListSafeCheckCountDepartment:
result.ListSafeCheckCountDepartment, //车间 子集是 班组
},
});
this.hiddenDangerTotal();
}
}
}
})
},
});
this.state.showLoading = false;
}
};
hiddenDangerTotal = () => {
if (this.state.data.ListSafeCheckYearMonth) {
let data = this.state.data.ListSafeCheckYearMonth;
let xData = [];
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 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],
[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 < data2.length; i += data.length) {
data3.push(data2.slice(i, i + data.length));
}
// 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({
@ -301,33 +700,55 @@ class BI054HomeDetail extends React.Component {
series: series,
});
}
}
};
render() {
const { data } = this.state;
return <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="dangerTotal2" style={{ width: "100%", height: "350px" }}></div>
</div>
</Col>
<Col span={1}></Col>
</Row>
return (
<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="dangerTotal2"
style={{ width: "100%", height: "350px" }}
></div>
</div>
</Col>
<Col span={1}></Col>
</Row>
<Row gutter={10} style={{ marginTop: "14px" }}>
<Col span={1}></Col>
<Col span={22} style={{ height: "100%" }}>
<Row gutter={10} style={{ marginTop: "14px" }}>
<Col span={1}></Col>
<Col span={22} style={{ height: "100%" }}>
<div className="bi001-table">
<Table
dataSource={this.state.data.ListSafeCheckCountDepartment}
columns={this.state.data.columnsTb}
pagination={false}
bordered
loading={this.state.data.showLoading}
size="small"
rowKey="1"
/>
</div>
<div className="bi001-table" >
<Table dataSource={this.state.data.ListSafeCheckCountDepartment} columns={this.state.data.columnsTb} pagination={false} bordered loading={this.state.data.showLoading} size="small" rowKey="1" />
</div>
{/* <div style={{ display: "flex", alignItems: "center", justifyContent: "center" }} >
{/* <div style={{ display: "flex", alignItems: "center", justifyContent: "center" }} >
<table className={styles.tableRow} style={{ width: '100%', marginLeft: '0px' }}>
<tbody>
{
@ -386,12 +807,12 @@ class BI054HomeDetail extends React.Component {
</tbody>
</table>
</div> */}
</Col>
<Col span={1}></Col>
</Row>
<br />
</div >
</Col>
<Col span={1}></Col>
</Row>
<br />
</div>
);
}
}
export default connect(({ login, app }) => ({ login, app }))(BI054HomeDetail)
export default connect(({ login, app }) => ({ login, app }))(BI054HomeDetail);

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ import {
extendRule,
extend,
extendOrder,
getSixMonth
} from "../utils/common";
import "./home.less";
// 组件库
@ -189,10 +190,6 @@ class Home extends React.Component {
currentpageIndex: "1",
visibleStartTime: [],
visibleEndTime: [],
mineType:
localStorage.getItem("currentMineType") === "20"
? "10"
: localStorage.getItem("currentMineType"),
detailForm: {
isShow: false,
formCode: "",
@ -250,16 +247,16 @@ class Home extends React.Component {
this.dangerChange();
this.getUser();
}
getSixMonth = (number, yearString = "", monthString = "") => {
let nowdate = new Date();
nowdate.setMonth(nowdate.getMonth() + number);
let y = nowdate.getFullYear();
let m = nowdate.getMonth() + 1;
// let d = nowdate.getDate();
let retrundate = y + yearString + m + monthString;
// getSixMonth = (number, yearString = "", monthString = "") => {
// let nowdate = new Date();
// nowdate.setMonth(nowdate.getMonth() + number);
// let y = nowdate.getFullYear();
// let m = nowdate.getMonth() + 1;
// // let d = nowdate.getDate();
// let retrundate = y + yearString + m + monthString;
return retrundate;
};
// return retrundate;
// };
showAll = (key) => {
const { tableData } = this.state;
@ -617,7 +614,7 @@ class Home extends React.Component {
];
let xData = [];
for (let i = 0; i < 12; i++) {
xData.unshift(this.getSixMonth(-i, "年", "月"));
xData.unshift(getSixMonth(-i, "年", "月"));
}
for (let i = 0; i < data3.length; i++) {
series.push({
@ -727,7 +724,7 @@ class Home extends React.Component {
let month = date.getMonth() + 1;
let xData = [];
for (let i = 0; i < 6; i++) {
xData.unshift(this.getSixMonth(-i, "-", ""));
xData.unshift(getSixMonth(-i, "-", ""));
}
let dangerChanges = document.getElementById("dangerChange");
if (dangerChanges) {
@ -1217,13 +1214,8 @@ class Home extends React.Component {
};
ExpandCancel = () => {};
showDetailModal = (formCode) => {
console.log(this.state.mineType,'this.state.mineType')
var titleTemp =
this.state.mineType == 20
? "尾矿库"
: this.state.mineType == 10
? "选矿厂"
: "露天矿";
var titleTemp =''
if (formCode == "BI054_HOMEDETAIL") {
titleTemp += "安全检查次数统计近12月";
} else if (formCode == "BI055_HOMEDETAIL") {
@ -1239,7 +1231,6 @@ class Home extends React.Component {
const newtmpData = {
data: {
id: guid(),
mineType: this.state.mineType,
onCancel: this.ExpandCancel,
homeReload: true,
},

File diff suppressed because it is too large Load Diff