From 15c9a8a574896e0c8ea8a32d39104658cd22834b Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Fri, 19 Apr 2024 15:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=A3=80=E6=9F=A5=E7=BB=A9?= =?UTF-8?q?=E6=95=88=E6=8A=A5=E8=A1=A8=20=E9=9D=99=E6=80=81=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/BI/BI056Dilg1_1.js | 722 +++++------------- .../CustomPages/BI/BI056Dilg1_1_qi.js | 355 +++++++++ src/components/CustomPages/BI/BI056Dilg1_2.js | 159 ++++ src/components/CustomPages/BI/BI056Dilg2_1.js | 299 ++++++++ src/components/CustomPages/BI/BI056Dilg2_2.js | 160 ++++ src/components/CustomPages/BI/BI056Dilg3_1.js | 209 +++++ src/components/CustomPages/BI/BI056Dilg3_2.js | 209 +++++ .../CustomPages/BI/BI056Performance.js | 80 +- src/files/edit/SC030.js | 54 +- src/utils/customConfig.js | 29 +- src/utils/customConfig1.js | 25 + 11 files changed, 1715 insertions(+), 586 deletions(-) create mode 100644 src/components/CustomPages/BI/BI056Dilg1_1_qi.js create mode 100644 src/components/CustomPages/BI/BI056Dilg1_2.js create mode 100644 src/components/CustomPages/BI/BI056Dilg2_1.js create mode 100644 src/components/CustomPages/BI/BI056Dilg2_2.js create mode 100644 src/components/CustomPages/BI/BI056Dilg3_1.js create mode 100644 src/components/CustomPages/BI/BI056Dilg3_2.js diff --git a/src/components/CustomPages/BI/BI056Dilg1_1.js b/src/components/CustomPages/BI/BI056Dilg1_1.js index 1d7e0f0..38310cb 100644 --- a/src/components/CustomPages/BI/BI056Dilg1_1.js +++ b/src/components/CustomPages/BI/BI056Dilg1_1.js @@ -1,20 +1,51 @@ import React, { useState, useEffect, useRef, Component } from "react"; import { connect } from "dva"; import { initFilter, extendOrder, guid } from "../../../utils/common"; -import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import { Row, Col, Select, Modal, Table, Button, DatePicker, message } from "antd"; import echarts from "echarts"; -import moment from "moment"; -import IconFont from "../../../utils/iconFont"; -import { T } from "antd/lib/upload/utils"; // 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 class BI056Dilg1_1 extends React.Component { constructor(props) { super(props); + var month = (new Date()).getMonth() + 1 + var selectSeason = 1 + var isShowbtn2 = false + var isShowbtn3 = false + var isShowbtn4 = false + + switch (month) { + case 4: + case 5: + case 6: + selectSeason = 2 + isShowbtn2 = true + break; + case 7: + case 8: + case 9: + selectSeason = 3 + isShowbtn2 = true + isShowbtn3 = true + break; + case 10: + case 11: + case 12: + selectSeason = 4 + isShowbtn2 = true + isShowbtn3 = true + isShowbtn4 = true + break; + } + this.state = { ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], - isShow1: false, - isShow2: false, + month: month, + barWidth: this.props.data.barWidth, + seasonIndex: selectSeason, + isShowbtn2: isShowbtn2, + isShowbtn3: isShowbtn3, + isShowbtn4: isShowbtn4, dtStart: null,//开始时间 dtEnd: null,//结束时间 mineType: 0,//生产单元 @@ -25,73 +56,45 @@ class BI056Dilg1_1 extends React.Component { ret: { IsSuccessful: true, Data: { - checkMineType1_1: { - mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + checkMineType: { legendName: ["公司级", "部门级", "车间级", "班组级"], axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + + mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], checkCountMonth: [ - //公司级 各生产单元mineTypeName 1月~12月 - [[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]], - //部门级 各生产单元mineTypeName 1月~12月 - [[6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6], [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]], - //车间级 各生产单元mineTypeName 1月~12月 - [[9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9], [9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9]], - //班组级 各生产单元mineTypeName 1月~12月 - [[12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]], - ], + //有几月的数据就统计到几月 时间不到不统计 也不能放入0 + // 公司级 、 部门级 车间级 班组级 各一个数组 + // [公司级露天矿1月数据,公司级选矿厂1月数据,公司级尾矿库1月数据,公司级职能部门1月数据 ,公司级露天矿2月数据,公司级选矿厂2月数据,公司级尾矿库2月数据,公司级职能部门2月数据] + + // 公司级 + [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12], + // 部门级 + [4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], + // 车间级 + [28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], + // 班组级 + [55, 56, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60] + + // // 2个月的数据如下图 + // [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4], + // // 部门级 + // [5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 8, 8, 8, 8], + // // 车间级 + // [30, 30, 30, 30, 30, 30, 30, 30, 9, 9, 9, 9, 4, 4, 4, 4], + // // 班组级 + // [60, 60, 60, 60, 60, 60, 60, 60, 10, 10, 10, 10, 11, 11, 10, 11] - checkCount: [ - [[1, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - [[2, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - [[3, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - [[4, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]] - // , - // [[5, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - // [[6, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]] - // [[7, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - // [[8, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - // [[9, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - // [[10, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - // [[11, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], - // [[12, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], ] - , - // axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], - // checkCount: [[3, 3, 3, 3,3, 3, 3, 3,3, 3, 3, 3], [12, 12, 12, 6,12, 12, 12, 6,12, 12, 12, 6], [24, 24, 24, 12,24, 24, 24, 12,24, 24, 24, 12], [90, 90, 120, 36,90, 90, 120, 36,90, 90, 120, 36]], - // checkCount: [[3, 3, 3, 3], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36], [90, 90, 120, 36], [90, 90, 120, 36], [90, 90, 120, 36], [90, 90, 120, 36], [90, 90, 120, 36], [90, 90, 120, 36], [90, 90, 120, 36]], - }, - - // riskMineType1_2: { - // legendName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], - // riskCount: [16, 23, 8, 1], - // }, - // riskDealMonth2_1: { - // legendName: ['已整改', '未整改', '整改率'], - // xAxisName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], - // countDeal: [5, 10, 8, 5, 12, 15, 10, 9, 8, 10, 11, 6], - // countNotDeal: [0, 1, 1, 2, 3, 2, 0, 1, 3, 3, 3, 2], - // linePercent: [100.00, 90.00, 87.5, 60.00, 75.00, 86.67, 100.00, 88.89, 62.50, 70.00, 72.73, 66.67] - // }, - // riskTop2_2: { - // yAxisName: ["隐患名称", "电机车轨道枕木下沉", "电机车刹车闸瓦磨损", "电机车导线线夹断裂", "电机车轨道断裂", "电机车刹车泵漏气"], - // count: [31, 22, 19, 15, 8, 5], - // }, - // checkTypeMineType3_1: { - // legendName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], - // xAxisName: ["巡回检查", "例行检查", "专业检查", "综合检查", "日常巡检", "防洪安全检查", "坝体安全检查", "库区安全检查", "重大事故隐患专项排查"], - // arrayCount: [[1200, 1200, 300, 500, 0, 0, 0, 0, 100], [500, 1500, 300, 500, 0, 0, 0, 0, 0], [0, 0, 100, 10, 800, 800, 800, 500, 100], [30, 30, 60, 50, 20, 10, 0, 0, 0]], - // }, - // checkTypeRiskMineType3_2: { - // legendName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], - // xAxisName: ["巡回检查", "例行检查", "专业检查", "综合检查", "日常巡检", "防洪安全检查", "坝体安全检查", "库区安全检查", "重大事故隐患专项排查"], - // arrayCount: [[10, 10, 3, 5, 0, 0, 0, 0, 1], [15, 15, 3, 5, 0, 0, 0, 0, 0], [0, 0, 1, 10, 20, 10, 9, 5, 1], [1, 2, 3, 2, 0, 0, 0, 0, 0]] - // } } } } } + componenthidMount() { + this.getBaseInfoData(); + } + componentDidMount() { this.getBaseInfoData(); } @@ -107,168 +110,145 @@ class BI056Dilg1_1 extends React.Component { payload: json2, onlyData: false, onComplete: (ret) => { - this.CheckCount1_1(ret?.Data.checkMineType1_1); - // this.RiskCount1_2(ret?.Data.riskMineType1_2, this.state.ColorShow); - // this.RiskCount1_22(ret?.Data.riskMineType1_2, this.state.ColorShow); - // this.RiskTop2_2(ret?.Data.riskTop2_2, this.state.ColorShow); - // this.CheckTypeCount3(ret?.Data.checkTypeMineType3_1, "divCheckTypeCount3_1"); - // this.CheckTypeCount3(ret?.Data.checkTypeRiskMineType3_2, "divCheckTypeRiskCount3_2"); + this.this.state.CheckCount(ret?.Data.checkMineType); }, }); }; + getBaseInfoData = (mineType) => { - // this.CheckCount1_1(this.state.ret.Data.checkMineType1_1); - this.CheckCount(this.state.ret.Data.checkMineType1_1); - // this.RiskCount1_2(this.state.ret.Data.riskMineType1_2, this.state.ColorShow); - // this.RiskCount1_22(this.state.ret.Data.riskMineType1_2, this.state.ColorShow); - - // //动态处理数据 - // var countDeal = [] - // var countNotDeal = [] - // var linePercent = [] - // var month = (new Date()).getMonth() + 1//取当前月 - // for (var i = 0; i < month; i++) { - // countDeal.push(this.state.ret.Data.riskDealMonth2_1.countDeal[i]) - // countNotDeal.push(this.state.ret.Data.riskDealMonth2_1.countNotDeal[i]) - // linePercent.push(this.state.ret.Data.riskDealMonth2_1.linePercent[i]) - // } - // this.state.ret.Data.riskDealMonth2_1.countDeal = countDeal - // this.state.ret.Data.riskDealMonth2_1.countNotDeal = countNotDeal - // this.state.ret.Data.riskDealMonth2_1.linePercent = linePercent - // this.RiskDeal2_1(this.state.ret.Data.riskDealMonth2_1); - // //动态处理数据 - - // this.RiskTop2_2(this.state.ret.Data.riskTop2_2, this.state.ColorShow); - // this.CheckTypeCount3(this.state.ret.Data.checkTypeMineType3_1, "divCheckTypeCount3_1"); - // this.CheckTypeCount3(this.state.ret.Data.checkTypeRiskMineType3_2, "divCheckTypeRiskCount3_2"); + this.CheckCount(this.state.ret.Data.checkMineType, this.state.seasonIndex - 1); }; - CheckCount1_1 = (Data) => { - let divCheckCount = document.getElementById("divCheckCount"); - if (divCheckCount) { - let myChart = echarts.init(divCheckCount); + onSelectChange(seasonIndex) { + this.CheckCount(this.state.ret.Data.checkMineType, seasonIndex - 1); + }; - var seriesShow = [] - var month = 4 - var legendNameCount = Data.legendName.length + // seasonIndex 从0开始 + CheckCount = (Data, seasonIndex) => { + let divShow = document.getElementById("divShow"); + if (divShow) { + let myChart = echarts.init(divShow); + + // 3 一个季度 3个月 var axisLabelMonth = [] - for (var i = 0; i < month; i++) { - axisLabelMonth.push(Data.axisLabelMonth[i]) + for (let i = 0; i < 3; i++) { + axisLabelMonth.push((i + 1 + seasonIndex * 3) + '月'); } - debugger - - for (var i = 0; i < month; i++) { - - for (var j = 0; j < legendNameCount; j++) { - - series.push({ - name: Data.legendName[i], - type: "bar", - stack: "总量", - label: { - show: true, - position: "insideRight", - }, - data: Data.arrayCount[i],//.slice(0, 10), - itemStyle: { color: this.state.ColorShow[i] }, - barWidth: 30 - }) - - // seriesShow.push({ - // name: Data.legendName[j], - // type: "bar", - // data: Data.checkCount[i][j], - // itemStyle: { color: this.state.ColorShow[j] }, - // barWidth: 25,//横轴的柱状图宽度 - // label: { - // normal: { - // show: true, - // position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 - // formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 - // textStyle: { - // fontSize: 12, // 字体大小 - // color: '#333', // 字体颜色 - // }, - // }, - // }, - // }) + var xAxisName = [] + for (let i = 0; i < 3; i++) { + for (let j = 0; j < Data.mineTypeName.length; j++) { + xAxisName.push((i + 1 + seasonIndex * 3) + '月 ' + Data.mineTypeName[i])//3个月一图表 } } + + const labelOption = { + show: true, + position: 'top', + formatter: '{c}', + textStyle: { + fontSize: 12, // 字体大小 + color: '#333', // 字体颜色 + } + }; + + + var month = this.state.month + var seriesShow = [] + for (let i = 0; i < Data.mineTypeName.length; i++) { + var seriesData = []//数据 在每组数据中获取 Data.checkCountMonth[i] + + var dateIndexMin = 0 + var dateIndexMax = 0 + + if ((seasonIndex * 3) < month) { + dateIndexMin = (seasonIndex * 3) * Data.mineTypeName.length + // 12 = 3*Data.mineTypeName.length + dateIndexMax = (dateIndexMin + 12) > (month * Data.mineTypeName.length) ? (month * Data.mineTypeName.length) : (dateIndexMin + 12) + } else { + dateIndexMin = (seasonIndex * 3) * Data.mineTypeName.length + dateIndexMax = month * Data.mineTypeName.length + + if (dateIndexMin > dateIndexMax) { + dateIndexMin = dateIndexMax + } + } + + for (let j = dateIndexMin; j < dateIndexMax; j++) { + if (Data.checkCountMonth[i].length > j) { + seriesData.push(Data.checkCountMonth[i][j]) + } + } + + seriesShow.push({ + name: Data.legendName[i], + barWidth: this.state.barWidth, + type: 'bar', + barGap: 0, + label: labelOption, + emphasis: { + focus: 'series' + }, + data: seriesData, + itemStyle: { color: this.state.ColorShow[i] }, + }) + } + myChart.setOption( { - // title: { - // text: "生产单元", - // left: "center", - // }, tooltip: { - trigger: "axis", + trigger: 'axis', axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + type: 'shadow' }, - - - formatter: function (value) { - var tooltipShow = '' - if (value.length > 0) { - tooltipShow += value[0].axisValueLabel + '
' - for (var i = 0; i < value.length; i++) { - tooltipShow += value[i].marker + value[i].seriesName + ":" + value[i].value - if (i > 0 && (i + 1) % 4 == 0) - tooltipShow += "
" - else - tooltipShow += "  " - // if (value[i].componentSubType == "bar") { - // tooltipShow += value[i].marker + value[i].seriesName + ":" + value[i].value + "
" - // } else { - // tooltipShow += value[i].marker + value[i].seriesName + ":" + value[i].value + "%" - // } - } - } - return tooltipShow - } - - - }, legend: { left: "center", align: "left", - bottom: "2%", + bottom: "-2%", textStyle: { color: "#000", }, itemWidth: 10, itemHeight: 10, - data: Data.legendName, - }, - grid: { - left: "3%", - right: "3%", - bottom: "12%", - top: "10%", - containLabel: true, + data: Data.legendName }, xAxis: [ { - type: "category", - data: Data.mineTypeName, - } - , { + type: 'category', + axisTick: { show: false }, + data: xAxisName, + axisLine: { + lineStyle: { + color: "#0c3b71", + }, + }, + axisLabel: { + show: true, + color: "rgb(170,170,170)", + interval: 0, + textStyle: { + lineHeight: 14, + }, + formatter: function (param) { + return param.split("月")[1];//X轴显示 把月份去除 加是以为 鼠标事件要显示月份 + }, + }, + }, + { + type: 'category', position: 'bottom', // 将分组x轴位置定至底部,不然默认在顶部 - offset: 70, // 向下偏移,使分组文字显示位置不与原x轴重叠 + offset: 40, // 向下偏移,使分组文字显示位置不与原x轴重叠 axisLine: { show: false // 隐藏分组x轴的轴线 }, axisTick: { - show: false, - length: 55, // 延长刻度线做分组线 + show: true, + length: 40, // 延长刻度线做分组线 inside: true, // 使刻度线相对轴线在上面与原x轴相接,默认在轴线下方 - lineStyle: { - color: '#ff9800' - }, // 非必须,仅为了演示,明显标示出分组刻度线 - + // lineStyle: { + // color: '#ff9800' + // }, // 非必须,仅为了演示,明显标示出分组刻度线 }, axisLabel: { inside: true, // 使刻度名称相对轴线在上面与原x轴相接,默认在轴线下方 @@ -279,375 +259,41 @@ class BI056Dilg1_1 extends React.Component { return ' ' + val // 这儿可以根据 返回 空字符串,来调整 第二个 x 轴值出现的位置。 } }, - data: axisLabelMonth// ['20日', '21日', '22日', '23日'] + data: axisLabelMonth// ['1月', '2月','3月'] } ], yAxis: [ { - type: "value", - }, + type: 'value' + } ], series: seriesShow - // [ - // { - // // name: "公司级", - // type: "bar", - // data: Data.checkCount[0], - // itemStyle: { color: this.state.ColorShow[0] }, - // barWidth: 15,//横轴的柱状图宽度 - // label: { - // normal: { - // show: true, - // position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 - // formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 - // textStyle: { - // fontSize: 12, // 字体大小 - // color: '#333', // 字体颜色 - // }, - // }, - // }, - // // barWidth: 30 - // }, - // { - // // name: "部门级", - // type: "bar", - // data: Data.checkCount[1], - // barWidth: 15,//横轴的柱状图宽度 - // itemStyle: { color: this.state.ColorShow[1] }, - // label: { - // normal: { - // show: true, - // position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 - // formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 - // textStyle: { - // fontSize: 12, // 字体大小 - // color: '#333', // 字体颜色 - // }, - // }, - // }, - // }, - // { - // // name: "车间级", - // type: "bar", - // data: Data.checkCount[2], - // barWidth: 15,//横轴的柱状图宽度 - // itemStyle: { color: this.state.ColorShow[2] }, - // label: { - // normal: { - // show: true, - // position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 - // formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 - // textStyle: { - // fontSize: 12, // 字体大小 - // color: '#333', // 字体颜色 - // }, - // }, - // }, - // }, - // { - // // name: "班组级", - // type: "bar", - // data: Data.checkCount[3], - // barWidth: 15,//横轴的柱状图宽度 - // itemStyle: { color: this.state.ColorShow[3] }, - // label: { - // normal: { - // show: true, - // position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 - // formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 - // textStyle: { - // fontSize: 12, // 字体大小 - // color: '#333', // 字体颜色 - // }, - // }, - // }, - // }, - // ], }, true ); } }; - - CheckCount = (Data) => { - let divShow = document.getElementById("divCheckCount"); - if (divShow) { - let myChart = echarts.init(divShow); - - - - - var series = [] - for (let i = 0; i < Data.legendName.length; i++) { - series.push({ - name: Data.legendName[i], - type: "bar", - stack: "总量", - label: { - show: true, - position: "insideRight", - }, - data: Data.checkCountMonth[i],//.slice(0, 10), - itemStyle: { color: this.state.ColorShow[i] }, - barWidth: 30 - }) - } - - myChart.setOption( - { - tooltip: { - trigger: "axis", - axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' - }, - }, - legend: { - left: "center", - align: "left", - bottom: "2%", - textStyle: { - color: "#000", - }, - itemWidth: 10, - itemHeight: 10, - data: Data.legendName, - }, - grid: { - left: "3%", - right: "5%", - bottom: "12%", - top: "10%", - containLabel: true, - }, - xAxis: { - type: "category", - data: Data.xAxisName,//.slice(0, 10), - axisLabel: { - interval: 0, - rotate: 20, - formatter: function (value) { - return value - } - } - }, - yAxis: { - type: "value", - }, - series: series - }, - true - ); - } - }; - - - - - - - - - - // https://echarts.apache.org/examples/zh/editor.html?c=bar-label-rotation - // const posList = [ - // 'left', - // 'right', - // 'top', - // 'bottom', - // 'inside', - // 'insideTop', - // 'insideLeft', - // 'insideRight', - // 'insideBottom', - // 'insideTopLeft', - // 'insideTopRight', - // 'insideBottomLeft', - // 'insideBottomRight' - // ]; - // app.configParameters = { - // rotate: { - // min: -90, - // max: 90 - // }, - // align: { - // options: { - // left: 'left', - // center: 'center', - // right: 'right' - // } - // }, - // verticalAlign: { - // options: { - // top: 'top', - // middle: 'middle', - // bottom: 'bottom' - // } - // }, - // position: { - // options: posList.reduce(function (map, pos) { - // map[pos] = pos; - // return map; - // }, {}) - // }, - // distance: { - // min: 0, - // max: 100 - // } - // }; - // app.config = { - // rotate: 90, - // align: 'left', - // verticalAlign: 'middle', - // position: 'insideBottom', - // distance: 15, - // onChange: function () { - // const labelOption = { - // rotate: app.config.rotate, - // align: app.config.align, - // verticalAlign: app.config.verticalAlign, - // position: app.config.position, - // distance: app.config.distance - // }; - // myChart.setOption({ - // series: [ - // { - // label: labelOption - // }, - // { - // label: labelOption - // }, - // { - // label: labelOption - // }, - // { - // label: labelOption - // } - // ] - // }); - // } - // }; - // const labelOption = { - // show: true, - // position: app.config.position, - // distance: app.config.distance, - // align: app.config.align, - // verticalAlign: app.config.verticalAlign, - // rotate: app.config.rotate, - // formatter: '{c} {name|{a}}', - // fontSize: 16, - // rich: { - // name: {} - // } - // }; - // option = { - // tooltip: { - // trigger: 'axis', - // axisPointer: { - // type: 'shadow' - // } - // }, - // legend: { - // data: ['Forest', 'Steppe', 'Desert', 'Wetland']//, 'Forest2', 'Steppe2', 'Desert2', 'Wetland2' - // }, - // toolbox: { - // show: true, - // orient: 'vertical', - // left: 'right', - // top: 'center', - // feature: { - // mark: { show: true }, - // dataView: { show: true, readOnly: false }, - // magicType: { show: true, type: ['line', 'bar', 'stack'] }, - // restore: { show: true }, - // saveAsImage: { show: true } - // } - // }, - // xAxis: [ - // { - // type: 'category', - // axisTick: { show: false }, - // data: ['2012', '2013', '2014', '2015' , '2016' ,'2022', '2023', '2024', '2025', '2026']//'2012', '2013', '2014', '2015' - // } - // ], - // yAxis: [ - // { - // type: 'value' - // } - // ], - // series: [ - // { - // name: 'Forest', - // type: 'bar', - // barGap: 0, - // label: labelOption, - // emphasis: { - // focus: 'series' - // }, - // data: [320, 332, 301, 334, 390 ,320, 332, 301, 334, 390] - // }, - // { - // name: 'Steppe', - // type: 'bar', - // label: labelOption, - // emphasis: { - // focus: 'series' - // }, - // data: [220, 182, 191, 234, 290 ,220, 182, 191, 234, 290] - // }, - // { - // name: 'Desert', - // type: 'bar', - // label: labelOption, - // emphasis: { - // focus: 'series' - // }, - // data: [150, 232, 201, 154, 190 ,150, 232, 201, 154, 190] - // }, - // { - // name: 'Wetland', - // type: 'bar', - // label: labelOption, - // emphasis: { - // focus: 'series' - // }, - // data: [98, 77, 101, 99, 40 ,98, 77, 101, 99, 40] - // }, - // ] - // }; - - - render() { return ( -
+
{/* 第一行 */} - -
-
-
-
安全检查次数统计
-
+ + +
+
-
+
+ -
); diff --git a/src/components/CustomPages/BI/BI056Dilg1_1_qi.js b/src/components/CustomPages/BI/BI056Dilg1_1_qi.js new file mode 100644 index 0000000..7939994 --- /dev/null +++ b/src/components/CustomPages/BI/BI056Dilg1_1_qi.js @@ -0,0 +1,355 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { initFilter, extendOrder, guid } from "../../../utils/common"; +import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import echarts from "echarts"; +// import moment from "moment"; +// import IconFont from "../../../utils/iconFont"; +// import { T } from "antd/lib/upload/utils"; +// import { float } from "html2canvas/dist/types/css/property-descriptors/float"; + +// 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 +class BI056Dilg1_1 extends React.Component { + constructor(props) { + super(props); + this.state = { + ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + barWidth: this.props.barWidth, + isShow1: false, + isShow2: false, + isShowbtn1: true, + isShowbtn2: true, + isShowbtn3: true, + isShowbtn4: true, + dtStart: null,//开始时间 + dtEnd: null,//结束时间 + mineType: 0,//生产单元 + detailForm: { + formCode: "", + title: "", + }, + ret: { + IsSuccessful: true, + Data: { + checkMineType: { + legendName: ["公司级", "部门级", "车间级", "班组级"], + axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + + mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + checkCountMonth: [ + //有几月的数据就统计到几月 时间不到不统计 也不能放入0 + // 公司级 、 部门级 车间级 班组级 各一个数组 + // [公司级露天矿1月数据,公司级选矿厂1月数据,公司级尾矿库1月数据,公司级职能部门1月数据 ,公司级露天矿2月数据,公司级选矿厂2月数据,公司级尾矿库2月数据,公司级职能部门2月数据] + + // 公司级 + [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12], + // 部门级 + [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], + // 车间级 + [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], + // 班组级 + [60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60] + + // // 2个月的数据如下图 + // [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4], + // // 部门级 + // [5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 8, 8, 8, 8], + // // 车间级 + // [30, 30, 30, 30, 30, 30, 30, 30, 9, 9, 9, 9, 4, 4, 4, 4], + // // 班组级 + // [60, 60, 60, 60, 60, 60, 60, 60, 10, 10, 10, 10, 11, 11, 10, 11] + + ] + }, + } + } + } + } + + + componenthidMount() { + this.getBaseInfoData(); + } + + componentDidMount() { + this.getBaseInfoData(); + } + + //获取数据 + getBaseInfoDataOnline = (mineType) => { + const json2 = initFilter(this.props.login.OrgId); + extendOrder(json2, "CREATE_TIME", 1); + json2.Parameter1 = mineType; + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getRiskPerformanceData", + payload: json2, + onlyData: false, + onComplete: (ret) => { + this.this.state.CheckCount(ret?.Data.checkMineType, "divCheckCount1"); + }, + }); + }; + + getBaseInfoData = (mineType) => { + + // var month = (new Date()).getMonth() + 1 + // if ((i + 1 + seasonIndex * 3) <= month) + + this.CheckCount(this.state.ret.Data.checkMineType, "divCheckCount1", 0); + + // this.CheckCount(this.state.ret.Data.checkMineType, "divCheckCount2", 1); + // this.CheckCount(this.state.ret.Data.checkMineType, "divCheckCount3", 2); + // this.CheckCount(this.state.ret.Data.checkMineType, "divCheckCount4", 3); + }; + + // seasonIndex 从0开始 + CheckCount = (Data, divId, seasonIndex) => { + let divShow = document.getElementById(divId); + if (divShow) { + let myChart = echarts.init(divShow); + + // 3 一个季度 3个月 + var axisLabelMonth = [] + for (let i = 0; i < 3; i++) { + axisLabelMonth.push((i + 1 + seasonIndex * 3) + '月'); + } + + var xAxisName = [] + for (let i = 0; i < 3; i++) { + for (let j = 0; j < Data.mineTypeName.length; j++) { + xAxisName.push((i + 1 + seasonIndex * 3) + '月 ' + Data.mineTypeName[i])//3个月一图表 + } + } + + const labelOption = { + show: true, + position: 'top', + formatter: '{c}', + textStyle: { + fontSize: 12, // 字体大小 + color: '#333', // 字体颜色 + } + }; + + + var month = (new Date()).getMonth() + 1//取当前月 + + var seriesShow = [] + for (let i = 0; i < Data.mineTypeName.length; i++) { + var seriesData = []//数据 在每组数据中获取 Data.checkCountMonth[i] + + var dateIndexMin = 0 + var dateIndexMax = 0 + + if ((seasonIndex * 3) < month) { + dateIndexMin = (seasonIndex * 3) * Data.mineTypeName.length + // 12 = 3*Data.mineTypeName.length + dateIndexMax = (dateIndexMin + 12) > (month * Data.mineTypeName.length) ? (month * Data.mineTypeName.length) : (dateIndexMin + 12) + } else { + dateIndexMin = (seasonIndex * 3) * Data.mineTypeName.length + dateIndexMax = month * Data.mineTypeName.length + + if (dateIndexMin > dateIndexMax) { + dateIndexMin = dateIndexMax + } + } + + for (let j = dateIndexMin; j < dateIndexMax; j++) { + if (Data.checkCountMonth[i].length > j) { + seriesData.push(Data.checkCountMonth[i][j]) + } + } + + seriesShow.push({ + name: Data.legendName[i], + barWidth: this.state.barWidth, + type: 'bar', + barGap: 0, + label: labelOption, + emphasis: { + focus: 'series' + }, + data: seriesData, + itemStyle: { color: this.state.ColorShow[i] }, + }) + } + + myChart.setOption( + { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + }, + legend: { + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, + data: Data.legendName + }, + // toolbox: { + // show: true, + // orient: 'vertical', + // left: 'right', + // top: 'center', + // feature: { + // mark: { show: true }, + // dataView: { show: true, readOnly: false }, + // magicType: { show: true, type: ['line', 'bar', 'stack'] }, + // restore: { show: true }, + // saveAsImage: { show: true } + // } + // }, + + xAxis: [ + { + type: 'category', + axisTick: { show: false }, + data: xAxisName, + axisLine: { + lineStyle: { + color: "#0c3b71", + }, + }, + axisLabel: { + show: true, + color: "rgb(170,170,170)", + interval: 0, + textStyle: { + lineHeight: 14, + }, + formatter: function (param) { + return param.split("月")[1];//X轴显示 把月份去除 加是以为 鼠标事件要显示月份 + }, + }, + }, + { + type: 'category', + position: 'bottom', // 将分组x轴位置定至底部,不然默认在顶部 + offset: 50, // 向下偏移,使分组文字显示位置不与原x轴重叠 + axisLine: { + show: false // 隐藏分组x轴的轴线 + }, + axisTick: { + show: true, + length: 50, // 延长刻度线做分组线 + inside: true, // 使刻度线相对轴线在上面与原x轴相接,默认在轴线下方 + // lineStyle: { + // color: '#ff9800' + // }, // 非必须,仅为了演示,明显标示出分组刻度线 + }, + axisLabel: { + inside: true, // 使刻度名称相对轴线在上面与原x轴相接,默认在轴线下方 + interval: 0, // 强制显示全部刻度名 + formatter: function (val, index) { + // console.log('测试999 val--- ', val); + // console.log('测试999 index--- ', index); + return ' ' + val // 这儿可以根据 返回 空字符串,来调整 第二个 x 轴值出现的位置。 + } + }, + data: axisLabelMonth// ['1月', '2月','3月'] + } + ], + yAxis: [ + { + type: 'value' + } + ], + series: seriesShow + }, + true + ); + } + }; + + render() { + const { isShowbtn1, isShowbtn2, isShowbtn3, isShowbtn4 } = this.state; + return ( +
+ + {/* 第一行 */} + + + +
+
+
+
安全检查次数统计(第一季度)
+
+
+ +
+ { + isShowbtn1 ? : null + } + { + isShowbtn2 ? : null + } + { + isShowbtn3 ? : null + } + { + isShowbtn4 ? : null + } +
+
+ + + + {/* +
+
+
+
安全检查次数统计(第二季度)
+
+
+
+ */} +
+ {/* + + +
+
+
+
安全检查次数统计(第三季度)
+
+
+
+ + + +
+
+
+
安全检查次数统计(第四季度)
+
+
+
+ +
*/} +
+
+ ); + } +} +export default connect(({ login, app }) => ({ login, app }))(BI056Dilg1_1); \ No newline at end of file diff --git a/src/components/CustomPages/BI/BI056Dilg1_2.js b/src/components/CustomPages/BI/BI056Dilg1_2.js new file mode 100644 index 0000000..327800a --- /dev/null +++ b/src/components/CustomPages/BI/BI056Dilg1_2.js @@ -0,0 +1,159 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { initFilter, extendOrder, guid } from "../../../utils/common"; +import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import echarts from "echarts"; +import moment from "moment"; + +// 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 +class BI056Dilg1_2 extends React.Component { + constructor(props) { + super(props); + this.state = { + ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + barWidth: this.props.barWidth, + isShow1: false, + isShow2: false, + dtStart: null,//开始时间 + dtEnd: null,//结束时间 + mineType: 0,//生产单元 + detailForm: { + formCode: "", + title: "", + }, + ret: { + IsSuccessful: true, + Data: { + axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + legendName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + //各生产单元 1~12 月数量 时间未到为空 没有数量就为0 + checkrisk: [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], [12, 12, 12, 6], [24, 24, 24, 12], [90, 90, 120, 36]], + } + } + } + } + + + componenthidMount() { + this.getBaseInfoData(); + } + + componentDidMount() { + this.getBaseInfoData(); + } + + //获取数据 + getBaseInfoDataOnline = (mineType) => { + const json2 = initFilter(this.props.login.OrgId); + extendOrder(json2, "CREATE_TIME", 1); + json2.Parameter1 = mineType; + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getRiskPerformanceData", + payload: json2, + onlyData: false, + onComplete: (ret) => { + this.CheckCount(this.state.ret.Data) + }, + }); + }; + + getBaseInfoData = (mineType) => { + this.CheckCount(this.state.ret.Data) + }; + + CheckCount = (Data) => { + let divRiskCount = document.getElementById("divRiskCount"); + if (divRiskCount) { + let myChart = echarts.init(divRiskCount); + var listSeries = [] + for (var i = 0; i < Data.legendName.length; i++) { + listSeries.push({ + name: Data.legendName[i], + data: Data.checkrisk[i], + type: "bar", + itemStyle: { color: this.state.ColorShow[i] }, + barWidth: this.state.barWidth,//横轴的柱状图宽度 + label: { + normal: { + show: true, + position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 + formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 + textStyle: { + fontSize: 12, // 字体大小 + color: '#333', // 字体颜色 + }, + }, + }, + }) + } + + myChart.setOption( + { + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + }, + legend: { + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, + data: Data.legendName, + }, + grid: { + left: "3%", + right: "3%", + bottom: "12%", + top: "10%", + containLabel: true, + }, + xAxis: [ + { + type: "category", + data: Data.axisLabelMonth, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: listSeries + }, + true + ); + } + }; + + render() { + return ( +
+ + {/* 第一行 */} + + + + {/*
+
+
+
隐患数量统计
+
+
*/} +
+ + +
+
+
+ ); + } +} +export default connect(({ login, app }) => ({ login, app }))(BI056Dilg1_2); \ No newline at end of file diff --git a/src/components/CustomPages/BI/BI056Dilg2_1.js b/src/components/CustomPages/BI/BI056Dilg2_1.js new file mode 100644 index 0000000..82f7d56 --- /dev/null +++ b/src/components/CustomPages/BI/BI056Dilg2_1.js @@ -0,0 +1,299 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { initFilter, extendOrder, guid } from "../../../utils/common"; +import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import echarts from "echarts"; +import moment from "moment"; + +// 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 +class BI056Dilg2_1 extends React.Component { + constructor(props) { + super(props); + this.state = { + ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + barWidth: this.props.barWidth, + isShow1: false, + isShow2: false, + dtStart: null,//开始时间 + dtEnd: null,//结束时间 + mineType: 0,//生产单元 + detailForm: { + formCode: "", + title: "", + }, + ret: { + IsSuccessful: true, + Data: { + legendName: ['已整改', '未整改', '整改率'], + titleMineType: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + xAxisName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + countDeal: [[5, 10, 8, 5, 12, 15, 10, 9, 8, 10, 11, 6], [7, 10, 8, 5, 12, 15, 10, 9, 8, 10, 11, 6], [13, 10, 8, 5, 12, 15, 10, 9, 8, 10, 11, 6], [15, 10, 8, 5, 12, 15, 10, 9, 8, 10, 11, 6]], + countNotDeal: [[1, 1, 1, 2, 3, 2, 0, 1, 3, 3, 3, 2], [2, 1, 1, 2, 3, 2, 0, 1, 3, 3, 3, 2], [3, 1, 1, 2, 3, 2, 0, 1, 3, 3, 3, 2], [4, 1, 1, 2, 3, 2, 0, 1, 3, 3, 3, 2]], + linePercent: [[100.00, 90.00, 87.5, 60.00, 75.00, 86.67, 100.00, 88.89, 62.50, 70.00, 72.73, 66.67], [70.00, 90.00, 87.5, 60.00, 75.00, 86.67, 100.00, 88.89, 62.50, 70.00, 72.73, 66.67], [80.00, 90.00, 87.5, 60.00, 75.00, 86.67, 100.00, 88.89, 62.50, 70.00, 72.73, 90], [90.00, 90.00, 87.5, 60.00, 75.00, 86.67, 100.00, 88.89, 62.50, 70.00, 72.73, 80]], + } + } + } + } + + componenthidMount() { + this.getBaseInfoData(); + } + + componentDidMount() { + this.getBaseInfoData(); + } + + //获取数据 + getBaseInfoDataOnline = (mineType) => { + const json2 = initFilter(this.props.login.OrgId); + extendOrder(json2, "CREATE_TIME", 1); + json2.Parameter1 = mineType; + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getRiskPerformanceData", + payload: json2, + onlyData: false, + onComplete: (ret) => { + this.CheckCount(this.state.ret.Data) + }, + }); + }; + + getBaseInfoData = (mineType) => { + this.RiskDeal(this.state.ret.Data, 1) + this.RiskDeal(this.state.ret.Data, 2) + this.RiskDeal(this.state.ret.Data, 3) + this.RiskDeal(this.state.ret.Data, 4) + }; + + + RiskDeal = (Data, index) => { + let divID = document.getElementById("div" + index) + if (divID) { + let myChart = echarts.init(divID); + var listseries = [] + + var title = Data.titleMineType[index - 1] + "隐患整改情况" + for (let i = 0; i < Data.legendName.length; i++) { + if (i < 2) { + + listseries.push({ + name: Data.legendName[i], + type: "bar", + stack: "总量", + label: { + show: true, + position: "insideRight", + }, + data: i == 0 ? Data.countDeal[index - 1] : (i == 1 ? Data.countNotDeal[index - 1] : Data.linePercent[index - 1]), + itemStyle: { color: this.state.ColorShow[i] }, + barWidth: 30,// this.state.barWidth + + }) + } else { + listseries.push( + { + name: Data.legendName[i], + type: "line", + label: { + show: true, + position: "top", + formatter: "{c}%" + }, + lineStyle: { + color: "#ffb122" + }, + data: Data.linePercent[index - 1], + itemStyle: { color: this.state.ColorShow[i] }, + yAxisIndex: 1 + }) + } + } + + myChart.setOption( + { + title: { + text: title, + left: "center", + }, + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + formatter: function (value) { + var tooltipShow = '' + if (value.length > 0) { + tooltipShow += value[0].axisValueLabel + '
' + for (var i = 0; i < value.length; i++) { + if (value[i].componentSubType == "bar") { + tooltipShow += value[i].marker + value[i].seriesName + ":" + value[i].value + "
" + } else { + tooltipShow += value[i].marker + value[i].seriesName + ":" + value[i].value + "%" + } + } + } + return tooltipShow + } + }, + legend: { + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, + data: Data.legendName, + }, + grid: { + left: "3%", + right: "3%", + bottom: "12%", + top: "10%", + containLabel: true, + }, + xAxis: { + type: "category", + data: Data.xAxisName, + axisLabel: { + interval: 0, + rotate: 20, + formatter: function (value) { + return value + } + } + }, + yAxis: [ + { + name: '整改情况', + type: 'value', + }, { + name: "完成率(%)", + type: "value", + min: 0, + max: 70, + position: "middle",// "right", + formatter: "{value}%", + min: 0, + max: 100, + axisLabel: { + // textStyle: { fontSize: 20 }, + formatter: '{value} %', // 给坐标轴标签加单位 + }, + splitLine: { //网格线 + show: false + } + } + ], + series: listseries + }, + true + ); + } + }; + + CheckCount = (Data) => { + let divRiskCount = document.getElementById("divRiskCount"); + if (divRiskCount) { + let myChart = echarts.init(divRiskCount); + var listSeries = [] + for (var i = 0; i < Data.legendName.length; i++) { + listSeries.push({ + name: Data.legendName[i], + data: Data.checkrisk[i], + type: "bar", + itemStyle: { color: this.state.ColorShow[i] }, + barWidth: this.state.barWidth,//横轴的柱状图宽度 + label: { + normal: { + show: true, + position: 'top', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 + formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 + textStyle: { + fontSize: 12, // 字体大小 + color: '#333', // 字体颜色 + }, + }, + }, + }) + } + myChart.setOption( + { + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + }, + legend: { + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, + data: Data.legendName, + }, + grid: { + left: "3%", + right: "3%", + bottom: "12%", + top: "10%", + containLabel: true, + }, + xAxis: [ + { + type: "category", + data: Data.axisLabelMonth, + }, + ], + yAxis: [ + { + type: "value", + }, + ], + series: listSeries + }, + true + ); + } + }; + + render() { + return ( +
+ + {/* 第一行 */} + + + +
+ + + +
+ +
+ + + + +
+ + + +
+ +
+
+
+ ); + } +} +export default connect(({ login, app }) => ({ login, app }))(BI056Dilg2_1); \ No newline at end of file diff --git a/src/components/CustomPages/BI/BI056Dilg2_2.js b/src/components/CustomPages/BI/BI056Dilg2_2.js new file mode 100644 index 0000000..bbdac93 --- /dev/null +++ b/src/components/CustomPages/BI/BI056Dilg2_2.js @@ -0,0 +1,160 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { initFilter, extendOrder, guid } from "../../../utils/common"; +import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import echarts from "echarts"; +import moment from "moment"; +import IconFont from "../../../utils/iconFont"; +import { T } from "antd/lib/upload/utils"; + +// 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 +class BI056Dilg2_2 extends React.Component { + constructor(props) { + super(props); + this.state = { + ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + barWidth: this.props.barWidth, + isShow1: false, + isShow2: false, + dtStart: null,//开始时间 + dtEnd: null,//结束时间 + mineType: 0,//生产单元 + detailForm: { + formCode: "", + title: "", + }, + Data: { + mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + riskTop: { + yAxisName: [ + ["露天矿 隐患名称", "电机车轨道枕木下沉", "电机车刹车闸瓦磨损", "电机车导线线夹断裂", "电机车轨道断裂", "电机车刹车泵漏气"], + ["选矿厂 隐患名称", "电车车轨道枕木下沉", "电机车刹车闸瓦磨损", "电机车导线线夹断裂", "电机车轨道断裂", "电机车刹车泵漏气"], + ["尾矿库 隐患名称", "电机车轨道枕木下沉", "电机车刹车闸瓦磨损", "电机车导线线夹断裂", "电机车轨道断裂", "电机车刹车泵漏气"], + ["职能部门 隐患名称", "电机车轨道枕木下沉", "电机车刹车闸瓦磨损", "电机车导线线夹断裂", "电机车轨道断裂", "电机车刹车泵漏气"] + ], + count: [ + [31, 22, 18, 15, 8, 5], + [29, 20, 17, 16, 8, 5], + [26, 21, 15, 13, 3, 2], + [25, 21, 13, 10, 3, 1] + ] + } + } + } + } + + componenthidMount() { + this.getBaseInfoData(); + } + + componentDidMount() { + this.getBaseInfoData(); + } + + getBaseInfoData = (mineType) => { + this.RiskTop(this.state.Data.riskTop, 0); + this.RiskTop(this.state.Data.riskTop, 1); + this.RiskTop(this.state.Data.riskTop, 2); + this.RiskTop(this.state.Data.riskTop, 3); + } + + RiskTop = (Data, idIndex) => { + let divShow = document.getElementById('divShow' + idIndex); //0-3 + if (divShow) { + var count = Data.count + let myChart = echarts.init(divShow); + var title = this.state.Data.mineTypeName[idIndex] + var yAxisName = Data.yAxisName[idIndex] + var seriesData = Data.count[idIndex] + var ColorShow = this.state.ColorShow + debugger + myChart.setOption( + { + title: { + text: title, + left: "center", + }, + tooltip: { + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + }, + }, + grid: { + left: "3%", + right: "3%", + bottom: "12%", + top: "10%", + containLabel: true, + }, + xAxis: [ + { + type: "value", + }, + ], + yAxis: [ + { + type: "category", + data: yAxisName,//Data.yAxisName, + }, + ], + series: [ + { + type: "bar", + data: seriesData,// count, + itemStyle: { + color: function (params) { + return ColorShow[params.dataIndex] + } + }, + barWidth: 25,//横轴的柱状图宽度 + label: { + normal: { + show: true, + // position: 'insideRight', // 或者 'inside'(内部)、'insideLeft'、'insideRight' 等其他位置 + formatter: '{c}', // 使用变量 {c} 表示数值,也可以自定义格式化函数 + textStyle: { + fontSize: 12, // 字体大小 + // color: '#333', // 字体颜色 + }, + }, + }, + }, + ], + }, + true + ); + } + }; + + render() { + return ( +
+ {/* 第一行 */} + + + +
+ + + +
+ +
+ + + +
+ + + +
+ +
+
+
+ ); + } +} +export default connect(({ login, app }) => ({ login, app }))(BI056Dilg2_2); \ No newline at end of file diff --git a/src/components/CustomPages/BI/BI056Dilg3_1.js b/src/components/CustomPages/BI/BI056Dilg3_1.js new file mode 100644 index 0000000..323a468 --- /dev/null +++ b/src/components/CustomPages/BI/BI056Dilg3_1.js @@ -0,0 +1,209 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { initFilter, extendOrder, guid } from "../../../utils/common"; +import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import echarts from "echarts"; +import moment from "moment"; +import IconFont from "../../../utils/iconFont"; +import { T } from "antd/lib/upload/utils"; + +// 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 +class BI056Dilg3_1 extends React.Component { + constructor(props) { + super(props); + this.state = { + ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + barWidth: this.props.barWidth, + isShow1: false, + isShow2: false, + dtStart: null,//开始时间 + dtEnd: null,//结束时间 + mineType: 0,//生产单元 + detailForm: { + formCode: "", + title: "", + }, + Data: { + axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + checkTypeInfo: { + mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + listLegendName: [ + ['巡回检查', '例行检查', '专业检查', '综合检查', '重大事故隐患专项排查'], + ['巡回检查', '例行检查', '专业检查', '综合检查'], + ['日常巡检', '防洪安全检查', '坝体安全检查', '库区安全检查', '重大事故隐患专项排查'], + ['巡回检查', '例行检查', '专业检查', '综合检查', '重大事故隐患专项排查'] + ], + //每个生产单元 每种检查类型 1-12 月数量 + checkTypeCount1: [[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], + checkTypeCount2: [[120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]], + checkTypeCount3: [[30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], [30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], + checkTypeCount4: [[4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], + }, + } + } + } + + componenthidMount() { + this.getBaseInfoData(); + } + + componentDidMount() { + this.getBaseInfoData(); + } + + //获取数据 + getBaseInfoDataOnline = (mineType) => { + const json2 = initFilter(this.props.login.OrgId); + extendOrder(json2, "CREATE_TIME", 1); + json2.Parameter1 = mineType; + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getRiskPerformanceData", + payload: json2, + onlyData: false, + onComplete: (ret) => { + this.this.state.CheckCount(ret?.Data.checkMineType, "divCheckCount1"); + }, + }); + }; + + getBaseInfoData = (mineType) => { + this.CheckCount(this.state.Data, "div1", 1); + this.CheckCount(this.state.Data, "div2", 2); + this.CheckCount(this.state.Data, "div3", 3); + this.CheckCount(this.state.Data, "div4", 4); + }; + + // index 从1开始 + CheckCount = (Data, divId, index) => { + let divShow = document.getElementById(divId); + if (divShow) { + let myChart = echarts.init(divShow); + + const labelOption = { + show: true, + position: 'top', + formatter: '{c}', + textStyle: { + fontSize: 12, // 字体大小 + color: '#333', // 字体颜色 + } + }; + var title = Data.checkTypeInfo.mineTypeName[index - 1] + var month = (new Date()).getMonth() + 1//取当前月 + // checkTypeInfo.mineTypeName[] mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + var dataList = [] + switch (index) { + case 1: dataList = Data.checkTypeInfo.checkTypeCount1 + break; + case 2: dataList = Data.checkTypeInfo.checkTypeCount2 + break; + case 3: dataList = Data.checkTypeInfo.checkTypeCount3 + break; + case 4: dataList = Data.checkTypeInfo.checkTypeCount4 + break; + } + + var LegendName = Data.checkTypeInfo.listLegendName[index - 1] + var seriesShow = [] + for (let i = 0; i < LegendName.length; i++) { + debugger + seriesShow.push({ + name: LegendName[i], + barWidth: this.state.barWidth, + type: 'bar', + barGap: 0, + label: labelOption, + emphasis: { + focus: 'series' + }, + data: dataList[i].slice(0, month), + itemStyle: { color: this.state.ColorShow[i] }, + }) + } + + myChart.setOption( + { + // 检查类型次数统计 + title: { + text: title, + left: "center", + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + }, + legend: { + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, + data: Data.legendName + }, + xAxis: [ + { + type: 'category', + axisTick: { show: false }, + data: Data.axisLabelMonth, + axisLine: { + lineStyle: { + color: "#0c3b71", + }, + }, + axisLabel: { + show: true, + color: "rgb(170,170,170)", + interval: 0, + textStyle: { + lineHeight: 14, + }, + }, + }, + ], + yAxis: [ + { + type: 'value' + } + ], + series: seriesShow + }, + true + ); + } + }; + + render() { + return ( +
+ + + +
+ + + +
+ +
+ + + +
+ + + +
+ +
+
+
+ ); + } +} +export default connect(({ login, app }) => ({ login, app }))(BI056Dilg3_1); \ No newline at end of file diff --git a/src/components/CustomPages/BI/BI056Dilg3_2.js b/src/components/CustomPages/BI/BI056Dilg3_2.js new file mode 100644 index 0000000..a385b29 --- /dev/null +++ b/src/components/CustomPages/BI/BI056Dilg3_2.js @@ -0,0 +1,209 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { initFilter, extendOrder, guid } from "../../../utils/common"; +import { Row, Col, Modal, Table, Button, Select, DatePicker, message } from "antd"; +import echarts from "echarts"; +import moment from "moment"; +import IconFont from "../../../utils/iconFont"; +import { T } from "antd/lib/upload/utils"; + +// 年度安全检查统计 弹窗 年度安全检查统计 按月 按生产单元 +class BI056Dilg3_2 extends React.Component { + constructor(props) { + super(props); + this.state = { + ColorShow: ["#c02e30", "#f7aa52", "#fbe06a", "#5185f3", "#EF9494", "#51b5f3"], + barWidth: this.props.barWidth, + isShow1: false, + isShow2: false, + dtStart: null,//开始时间 + dtEnd: null,//结束时间 + mineType: 0,//生产单元 + detailForm: { + formCode: "", + title: "", + }, + Data: { + axisLabelMonth: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], + checkTypeInfo: { + mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + listLegendName: [ + ['巡回检查', '例行检查', '专业检查', '综合检查', '重大事故隐患专项排查'], + ['巡回检查', '例行检查', '专业检查', '综合检查'], + ['日常巡检', '防洪安全检查', '坝体安全检查', '库区安全检查', '重大事故隐患专项排查'], + ['巡回检查', '例行检查', '专业检查', '综合检查', '重大事故隐患专项排查'] + ], + //每个生产单元 每种检查类型 1-12 月数量 + checkTypeCount1: [[2, 3, 3, 5, 3, 2, 6, 2, 1, 0, 1, 2], [1, 2, 3, 3, 2, 4, 5, 3, 1, 0, 9, 8], [1, 2, 3, 4, 5, 3, 2, 4, 1, 1, 4, 0], [2, 1, 1, 0, 0, 3, 3, 2, 2, 0, 0, 1], [1, 1, 1, 3, 3, 1, 3, 1, 2, 2, 3, 4]], + checkTypeCount2: [[2, 3, 6, 6, 3, 2, 6, 3, 8, 0, 1, 2], [1, 2, 7, 3, 5, 4, 5, 4, 1, 4, 9, 2], [1, 2, 8, 4, 5, 3, 2, 4, 3, 4, 0, 6], [2, 3, 1, 0, 3, 3, 3, 6, 3, 4, 6, 1]], + checkTypeCount3: [[0, 0, 3, 3, 5, 5, 7, 7, 3, 4, 7, 1], [5, 7, 0, 0, 1, 1, 2, 1, 4, 0, 3, 6], [2, 2, 5, 7, 4, 0, 0, 4, 4, 0, 0, 4], [1, 5, 4, 2, 4, 0, 2, 0, 4, 0, 0, 4], [1, 1, 1, 0, 1, 0, 0, 5, 0, 0, 1, 0]], + checkTypeCount4: [[4, 2, 2, 5, 4, 0, 2, 5, 0, 2, 4, 4], [4, 0, 4, 0, 0, 4, 0, 0, 4, 0, 4, 0], [1, 0, 3, 0, 1, 3, 0, 7, 2, 0, 3, 0], [1, 0, 3, 1, 1, 3, 3, 3, 2, 0, 3, 0], [1, 0, 3, 0, 1, 3, 0, 2, 2, 1, 0, 2]], + }, + } + } + } + + componenthidMount() { + this.getBaseInfoData(); + } + + componentDidMount() { + this.getBaseInfoData(); + } + + //获取数据 + getBaseInfoDataOnline = (mineType) => { + const json2 = initFilter(this.props.login.OrgId); + extendOrder(json2, "CREATE_TIME", 1); + json2.Parameter1 = mineType; + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIController/getRiskPerformanceData", + payload: json2, + onlyData: false, + onComplete: (ret) => { + this.this.state.CheckCount(ret?.Data.checkMineType, "divCheckCount1"); + }, + }); + }; + + getBaseInfoData = (mineType) => { + this.CheckCount(this.state.Data, "div1", 1); + this.CheckCount(this.state.Data, "div2", 2); + this.CheckCount(this.state.Data, "div3", 3); + this.CheckCount(this.state.Data, "div4", 4); + }; + + // index 从1开始 + CheckCount = (Data, divId, index) => { + let divShow = document.getElementById(divId); + if (divShow) { + let myChart = echarts.init(divShow); + + const labelOption = { + show: true, + position: 'top', + formatter: '{c}', + textStyle: { + fontSize: 12, // 字体大小 + color: '#333', // 字体颜色 + } + }; + var title = Data.checkTypeInfo.mineTypeName[index - 1] + var month = (new Date()).getMonth() + 1//取当前月 + // checkTypeInfo.mineTypeName[] mineTypeName: ["露天矿", "选矿厂", "尾矿库", "职能部门"], + var dataList = [] + switch (index) { + case 1: dataList = Data.checkTypeInfo.checkTypeCount1 + break; + case 2: dataList = Data.checkTypeInfo.checkTypeCount2 + break; + case 3: dataList = Data.checkTypeInfo.checkTypeCount3 + break; + case 4: dataList = Data.checkTypeInfo.checkTypeCount4 + break; + } + + var LegendName = Data.checkTypeInfo.listLegendName[index - 1] + var seriesShow = [] + for (let i = 0; i < LegendName.length; i++) { + debugger + seriesShow.push({ + name: LegendName[i], + barWidth: this.state.barWidth, + type: 'bar', + barGap: 0, + label: labelOption, + emphasis: { + focus: 'series' + }, + data: dataList[i],//.slice(0, month), + itemStyle: { color: this.state.ColorShow[i] }, + }) + } + + myChart.setOption( + { + // 检查类型次数统计 + title: { + text: title, + left: "center", + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + }, + legend: { + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, + data: Data.legendName + }, + xAxis: [ + { + type: 'category', + axisTick: { show: false }, + data: Data.axisLabelMonth, + axisLine: { + lineStyle: { + color: "#0c3b71", + }, + }, + axisLabel: { + show: true, + color: "rgb(170,170,170)", + interval: 0, + textStyle: { + lineHeight: 14, + }, + }, + }, + ], + yAxis: [ + { + type: 'value' + } + ], + series: seriesShow + }, + true + ); + } + }; + + render() { + return ( +
+ + + +
+ + + +
+ +
+ + + +
+ + + +
+ +
+
+
+ ); + } +} +export default connect(({ login, app }) => ({ login, app }))(BI056Dilg3_2); \ No newline at end of file diff --git a/src/components/CustomPages/BI/BI056Performance.js b/src/components/CustomPages/BI/BI056Performance.js index ef2c036..8621aa7 100644 --- a/src/components/CustomPages/BI/BI056Performance.js +++ b/src/components/CustomPages/BI/BI056Performance.js @@ -19,6 +19,7 @@ class BI056Performance extends React.Component { formCode: "", title: "", isShow: false, + dilgWith: "90%" }, ret: { IsSuccessful: true, @@ -179,6 +180,7 @@ class BI056Performance extends React.Component { type: "bar", data: Data.checkCount[1], itemStyle: { color: this.state.ColorShow[1] }, + barWidth: 30,//横轴的柱状图宽度 label: { normal: { show: true, @@ -196,6 +198,7 @@ class BI056Performance extends React.Component { type: "bar", data: Data.checkCount[2], itemStyle: { color: this.state.ColorShow[2] }, + barWidth: 30,//横轴的柱状图宽度 label: { normal: { show: true, @@ -212,6 +215,7 @@ class BI056Performance extends React.Component { name: "班组级", type: "bar", data: Data.checkCount[3], + barWidth: 30,//横轴的柱状图宽度 itemStyle: { color: this.state.ColorShow[3] }, label: { normal: { @@ -708,7 +712,36 @@ class BI056Performance extends React.Component { //显示详情弹窗 参考 BS064ShowPrint showDetailModal = (formCode) => { - var titleTemp = "年度安全检查明细" + var barWidth = 30 + + // var windowWith = window.innerWidth; + // if (windowWith <= 1250) { + // barWidth = 5 + // } else if (windowWith >= 2300) { + // barWidth = 15 + // }else{ + // barWidth = 10 + // } + + var dilgWith = "90%" + var titleTemp = "" + switch (formCode) { + case 'BI056_DILG1_1': titleTemp = "安全检查次数季度统计" + dilgWith = "80%" + break; + case 'BI056_DILG1_2': titleTemp = "年度隐患数量统计" + dilgWith = "75%" + break; + case 'BI056_DILG2_1': titleTemp = "隐患整改情况" + break; + case 'BI056_DILG2_2': titleTemp = "Top隐患" + break; + case 'BI056_DILG3_1': titleTemp = "检查类型次数统计" + break; + case 'BI056_DILG3_2': titleTemp = "检查类型隐患统计" + break; + } + // debugger const newtmpData = { data: { id: guid(), @@ -716,13 +749,16 @@ class BI056Performance extends React.Component { dtStart: this.state.dtStart, dtEnd: this.state.dtEnd, homeReload: true, + barWidth: barWidth, + // ColorShow: this.state.ColorShow }, formCode: formCode, }; this.setState({ tmpData: newtmpData }, () => { var detailForm = { title: titleTemp, - isShow: true + isShow: true, + dilgWith: dilgWith }; this.setState({ detailForm: detailForm, @@ -779,38 +815,18 @@ class BI056Performance extends React.Component { }} >
- {/* - - -
-
- - -
-
- -
-
*/} - +
@@ -837,7 +853,7 @@ class BI056Performance extends React.Component {
年度隐患数量统计
-
this.showDetailModal("年度隐患数量统计")}> +
this.showDetailModal("BI056_DILG1_2")}>
@@ -856,7 +872,7 @@ class BI056Performance extends React.Component {
隐患整改情况
-
this.showDetailModal("隐患整改情况")}> +
this.showDetailModal("BI056_DILG2_1")}>
@@ -869,7 +885,7 @@ class BI056Performance extends React.Component {
隐患top6
-
this.showDetailModal("隐患top6")}> +
this.showDetailModal("BI056_DILG2_2")}>
@@ -889,7 +905,7 @@ class BI056Performance extends React.Component {
检查类型次数统计
-
this.showDetailModal("检查类型次数统计")}> +
this.showDetailModal("BI056_DILG3_1")}>
@@ -904,7 +920,7 @@ class BI056Performance extends React.Component {
检查类型隐患统计
-
this.showDetailModal("检查类型隐患统计")}> +
this.showDetailModal("BI056_DILG3_2")}>
diff --git a/src/files/edit/SC030.js b/src/files/edit/SC030.js index 2881c2e..714f1be 100644 --- a/src/files/edit/SC030.js +++ b/src/files/edit/SC030.js @@ -15,26 +15,52 @@ export default { // STATUS onBeforeEdit: ({ isNew, dispatch, stateData, setFieldVisible, editConfig, setEditConfig, setFieldValue, getFieldValue, setFieldValueByBatch, setFieldEditable, login }) => { // 文件评审会 30 文件审核会议 20 //会议决议、 审核意见、评审意见 - if (stateData?.Nav_Meeting?.MEETINGTYPE != '30') { - setFieldVisible("Nav_ListPReview", false); - if (editConfig.columns.length > 0) { - for (let i = 0; i < editConfig.columns.length; i++) { - if (editConfig.columns[i].field == 'RESOLUTION') { - editConfig.columns[i].label = '评审意见'; - editConfig.columns[i].promptInfo = '评审意见'; + // Nav_ListPReview 审批人员 + if (stateData?.Nav_Meeting?.MEETINGTYPE) { + if (stateData.Nav_Meeting.MEETINGTYPE == '30') { // 文件评审会 30 评审意见 + if (editConfig.columns.length > 0) { + for (let i = 0; i < editConfig.columns.length; i++) { + if (editConfig.columns[i].field == 'RESOLUTION') { + editConfig.columns[i].label = '评审意见'; + editConfig.columns[i].promptInfo = '评审意见'; + } } } - } - } else if (stateData?.Nav_Meeting?.MEETINGTYPE != '20') { - if (editConfig.columns.length > 0) { - for (let i = 0; i < editConfig.columns.length; i++) { - if (editConfig.columns[i].field == 'RESOLUTION') { - editConfig.columns[i].label = '审核意见'; - editConfig.columns[i].promptInfo = '审核意见'; + } else { + setFieldVisible("Nav_ListPReview", false); + if (stateData.Nav_Meeting.MEETINGTYPE == '20') { //文件审核会议 20 审核意见 + if (editConfig.columns.length > 0) { + for (let i = 0; i < editConfig.columns.length; i++) { + if (editConfig.columns[i].field == 'RESOLUTION') { + editConfig.columns[i].label = '审核意见'; + editConfig.columns[i].promptInfo = '审核意见'; + } + } } } } } + + // if (stateData?.Nav_Meeting?.MEETINGTYPE != '30') { + // setFieldVisible("Nav_ListPReview", false); + // if (editConfig.columns.length > 0) { + // for (let i = 0; i < editConfig.columns.length; i++) { + // if (editConfig.columns[i].field == 'RESOLUTION') { + // editConfig.columns[i].label = '评审意见'; + // editConfig.columns[i].promptInfo = '评审意见'; + // } + // } + // } + // } else if (stateData?.Nav_Meeting?.MEETINGTYPE != '20') { + // if (editConfig.columns.length > 0) { + // for (let i = 0; i < editConfig.columns.length; i++) { + // if (editConfig.columns[i].field == 'RESOLUTION') { + // editConfig.columns[i].label = '审核意见'; + // editConfig.columns[i].promptInfo = '审核意见'; + // } + // } + // } + // } }, // STATUS // onBeforeEdit: (params) => { diff --git a/src/utils/customConfig.js b/src/utils/customConfig.js index 70e0bcf..10cb3a8 100644 --- a/src/utils/customConfig.js +++ b/src/utils/customConfig.js @@ -675,6 +675,26 @@ const BI056Dilg1_1 = Loadable({ loader: () => import('../components/CustomPages/BI/BI056Dilg1_1'), loading: () =>
}) +const BI056Dilg1_2 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg1_2'), + loading: () =>
+}) +const BI056Dilg2_1 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg2_1'), + loading: () =>
+}) +const BI056Dilg2_2 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg2_2'), + loading: () =>
+}) +const BI056Dilg3_1 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg3_1'), + loading: () =>
+}) +const BI056Dilg3_2 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg3_2'), + loading: () =>
+}) const BI003StatiscialAnalysis = Loadable({ loader: () => import('../components/CustomPages/BI/BI003StatiscialAnalysis'), loading: () =>
@@ -891,7 +911,7 @@ export default function (componentName, formId, formParam, data, formCode, formD OG018Check: , OG020Edit: , - + SC046ShowPrint: , SC052ShowPrint: , @@ -930,6 +950,11 @@ export default function (componentName, formId, formParam, data, formCode, formD BI055HomeDetail: , BI056Performance: , BI056Dilg1_1: , + BI056Dilg1_2: , + BI056Dilg2_1: , + BI056Dilg2_2: , + BI056Dilg3_1: , + BI056Dilg3_2: , BI003StatiscialAnalysis: , BI001HomeDetail: , BI002HomeDetail: , @@ -948,7 +973,7 @@ export default function (componentName, formId, formParam, data, formCode, formD PF136FormRunAnalysis: , BI009FormRunAnalysis: , FO025ShowPrint: , - + BI020ApproveAnalysis: , BI014RiskPerformanceModel: , }[componentName] diff --git a/src/utils/customConfig1.js b/src/utils/customConfig1.js index 0567072..7656667 100644 --- a/src/utils/customConfig1.js +++ b/src/utils/customConfig1.js @@ -33,6 +33,26 @@ const BI056Dilg1_1 = Loadable({ loader: () => import('../components/CustomPages/BI/BI056Dilg1_1'), loading: () =>
}) +const BI056Dilg1_2 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg1_2'), + loading: () =>
+}) +const BI056Dilg2_1 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg2_1'), + loading: () =>
+}) +const BI056Dilg2_2 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg2_2'), + loading: () =>
+}) +const BI056Dilg3_1 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg3_1'), + loading: () =>
+}) +const BI056Dilg3_2 = Loadable({ + loader: () => import('../components/CustomPages/BI/BI056Dilg3_2'), + loading: () =>
+}) const SC028ShowPrint = Loadable({ loader: () => import('../components/CustomPages/SC/SC028ShowPrint'), @@ -258,6 +278,11 @@ export default function (componentName, formId, formParam, data, formCode, formD BI055HomeDetail: , BI056Performance: , BI056Dilg1_1: , + BI056Dilg1_2: , + BI056Dilg2_1: , + BI056Dilg2_2: , + BI056Dilg3_1: , + BI056Dilg3_2: , SC028ShowPrint: , SC022Import: ,