From 6fc6d8563c8bb0b252cb4cc25f8dedfb271e05c2 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Mon, 1 Apr 2024 15:15:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI001HomeDetail.js | 1 + .../CustomPages/BI/BI054HomeDetail.js | 57 +++++-------- .../CustomPages/BI/BI055HomeDetail.js | 10 +-- src/layout/Header.js | 5 +- src/layout/Sider.js | 83 ++++++++++--------- src/routes/Home.js | 73 ++++++++-------- src/routes/dashboard.css | 62 ++++++++++---- 7 files changed, 160 insertions(+), 131 deletions(-) diff --git a/src/components/CustomPages/BI/BI001HomeDetail.js b/src/components/CustomPages/BI/BI001HomeDetail.js index 3559670..15f5ffa 100644 --- a/src/components/CustomPages/BI/BI001HomeDetail.js +++ b/src/components/CustomPages/BI/BI001HomeDetail.js @@ -192,6 +192,7 @@ class BI001HomeDetail extends React.Component { { title: "车间", dataIndex: "shopName", + onCell: () => this.renderSpeedColumn(), render: (value, record, index) => { const obj = { children: value, diff --git a/src/components/CustomPages/BI/BI054HomeDetail.js b/src/components/CustomPages/BI/BI054HomeDetail.js index 6050658..2b2d9a8 100644 --- a/src/components/CustomPages/BI/BI054HomeDetail.js +++ b/src/components/CustomPages/BI/BI054HomeDetail.js @@ -72,17 +72,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "穿爆车间", RowCount: 2, - listCount: [51, 751, 0, 0, 0], + listCount: [51, 751, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 350, 0, 0, 0], + listCount: [0, 350, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -92,17 +91,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "穿爆车间", RowCount: 2, - listCount: [51, 751, 0, 0, 0], + listCount: [51, 751, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 350, 0, 0, 0], + listCount: [0, 350, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -114,17 +112,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "生产技术科", RowCount: 1, - listCount: [51, 522, 0, 0, 0], + listCount: [51, 522, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 349, 0, 0, 0], + listCount: [0, 349, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -134,17 +131,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "综合组", RowCount: 1, - listCount: [0, 349, 0, 0, 0], + listCount: [0, 349, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 349, 0, 0, 0], + listCount: [0, 349, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -154,17 +150,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "试验化验室", RowCount: 2, - listCount: [0, 0, 0, 0, 0], + listCount: [0, 0, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 0, 0, 0, 0], + listCount: [0, 0, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -176,17 +171,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "试验化验室", RowCount: 2, - listCount: [0, 0, 0, 0, 0], + listCount: [0, 0, 0, 0], }, Percent: 0, RowCount: 1, - listCount:[0, 0, 0, 0, 0], + listCount:[0, 0, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -198,17 +192,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "金宇宁化分公司", RowCount: 4, - listCount: [51, 1452, 0, 0, 0], + listCount: [51, 1452, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 351, 0, 0, 0], + listCount: [0, 351, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -220,17 +213,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "金宇宁化分公司", RowCount: 4, - listCount: [51, 1452, 0, 0, 0], + listCount: [51, 1452, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 350, 0, 0, 0], + listCount: [0, 350, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -242,17 +234,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "金宇宁化分公司", RowCount: 4, - listCount: [51, 1452, 0, 0, 0], + listCount: [51, 1452, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 350, 0, 0, 0], + listCount: [0, 350, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -264,17 +255,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "金宇宁化分公司", RowCount: 4, - listCount: [51, 1452, 0, 0, 0], + listCount: [51, 1452, 0, 0], }, Percent: 0, RowCount: 1, - listCount: [0, 350, 0, 0, 0], + listCount: [0, 350, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, { @@ -286,17 +276,16 @@ class BI054HomeDetail extends React.Component { Parent: { DepartmentName: "安环科", RowCount: 1, - listCount: [52, 400, 2, 1, 1], + listCount: [52, 400, 2, 1], }, Percent: 0, RowCount: 1, - listCount: [0, 349, 0, 0, 0], + listCount: [0, 349, 0, 0], listName: [ "巡回检查", "例行检查", "专业检查", "综合检查", - "综合检查", ], }, @@ -585,7 +574,6 @@ class BI054HomeDetail extends React.Component { [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, "-", "")); @@ -595,7 +583,6 @@ class BI054HomeDetail extends React.Component { "例行检查", "专业检查", "综合检查", - "综合检查", ]; // data.map((item) => { // if (item.MONTH>9){ diff --git a/src/components/CustomPages/BI/BI055HomeDetail.js b/src/components/CustomPages/BI/BI055HomeDetail.js index 9f1035c..b61b4d9 100644 --- a/src/components/CustomPages/BI/BI055HomeDetail.js +++ b/src/components/CustomPages/BI/BI055HomeDetail.js @@ -621,9 +621,9 @@ class BI055HomeDetail extends React.Component { "100.00", ], ]; - let sourceName = [ - ["按时整改隐患", "超期整改隐患", "未整改隐患", "隐患整改率"], - ]; + let sourceName = + ["按时整改隐患", "超期整改隐患", "未整改隐患", "隐患整改率"]; + // if (this.state.ListC) { // this.state.ListC.map((item) => { // let name = item.NAME.split(","); @@ -673,8 +673,8 @@ class BI055HomeDetail extends React.Component { }, }, grid: { - left: "10%", - // right: "10%", + left: "5%", + right: "5%", bottom: "15%", top: "5%", containLabel: true, diff --git a/src/layout/Header.js b/src/layout/Header.js index c3699ea..791f450 100644 --- a/src/layout/Header.js +++ b/src/layout/Header.js @@ -390,9 +390,10 @@ function Header(props) { : "header__left-slogan" }`} > - 矿山安全生产标准化系统 + 安全管理系统 (SMS) - {baseConfig.SYS_NAME}{" "} + {/* {baseConfig.SYS_NAME}{" "} */} + -宁化行洛坑 )} diff --git a/src/layout/Sider.js b/src/layout/Sider.js index 996313f..23c31d1 100644 --- a/src/layout/Sider.js +++ b/src/layout/Sider.js @@ -232,7 +232,9 @@ const Sider = (props) => { : "sider__shortMenuShowoverca-overc" } > -
{menu.Node.NAME}
+
+ {menu.Node.NAME} +
); })} @@ -242,7 +244,8 @@ const Sider = (props) => { className="sider__shortMenuShowovercae" onClick={() => { setMenuShow(!MenuShow); - if(mainSilder == 1){ //禁止mainsilder为1--首页状态 + if (mainSilder == 1) { + //禁止mainsilder为1--首页状态 setMainSilder(2); } // if (MenuShow) { @@ -252,10 +255,18 @@ const Sider = (props) => { // } }} > - + {MenuShow == true ? ( + + ) : ( + + )} @@ -298,32 +309,32 @@ const Sider = (props) => { })} ) : ( */} -
- {menuCUR && - menuCUR.Children.map((menu2, index2) => { - return ( -
-
- - +
+ {menuCUR && + menuCUR.Children.map((menu2, index2) => { + return ( +
+
+ + - - {menu2.Node.NAME} - -
-
- {menu2.Children.map((menu3, index3) => { + + {menu2.Node.NAME} + +
+
+ {menu2.Children.map((menu3, index3) => { return (
{
); })} -
- -
- ); - })} -
+
+ ); + })} +
{/* // )} */}
diff --git a/src/routes/Home.js b/src/routes/Home.js index eb052fc..583ba5a 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -10,7 +10,7 @@ import { extendRule, extend, extendOrder, - getSixMonth + getSixMonth, } from "../utils/common"; import "./home.less"; // 组件库 @@ -197,35 +197,35 @@ class Home extends React.Component { }, completeName: [ { - name: "张森友", + name: "运输二班", value: 100, }, { - name: "李友军", + name: "综合班组", value: 99, }, { - name: "洪虎林", + name: "生产班", value: 97, }, { - name: "李彦斌", + name: "维修班组", value: 95, }, { - name: "王志文", + name: "民爆储存库班组", value: 93, }, { - name: "黄海林", + name: "爆破班组", value: 90, }, { - name: "赵无极", + name: "运输一班", value: 67, }, { - name: "林佑君", + name: "金宇现场", value: 43, }, ], @@ -1214,8 +1214,8 @@ class Home extends React.Component { }; ExpandCancel = () => {}; showDetailModal = (formCode) => { - var titleTemp ='' - + var titleTemp = ""; + if (formCode == "BI054_HOMEDETAIL") { titleTemp += "安全检查次数统计(近12月)"; } else if (formCode == "BI055_HOMEDETAIL") { @@ -2114,39 +2114,42 @@ class Home extends React.Component { style={{ flex: 1, height: "100%", - padding: "15px 20px 15px 50px", + padding: "15px 40px 15px 40px", }} > {this.state.completeName.map((item, index) => { return (
- {index == 0 ? ( - 4-1 - ) : index == 1 ? ( - 4-2 - ) : index == 2 ? ( - 4-3 - ) : ( -
{index + 1}
- )} +
+ {index == 0 ? ( + 4-1 + ) : index == 1 ? ( + 4-2 + ) : index == 2 ? ( + 4-3 + ) : ( +
{index + 1}
+ )} + +
{item.name}
+
-
{item.name}
); diff --git a/src/routes/dashboard.css b/src/routes/dashboard.css index c2d7f1f..202f069 100644 --- a/src/routes/dashboard.css +++ b/src/routes/dashboard.css @@ -1,10 +1,32 @@ /* 工作台调整样式 */ +:global(.redTableCell) { + background: #e6f7ff; +} +:global(.redTableCell):hover { + background: #e6f7ff !important; +} +:global(.bi001-table) { + :global( + .ant-table-tbody + > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) + > td + ) { + background: #fff; + } +} +:global(.bi001-table) { + :global(.ant-table-row:hover) { + :global(.redTableCell) { + background: #e6f7ff !important; + } + } +} :global(.home-rate) { width: calc(50% - 10px); height: 100%; display: flex; flex-direction: column; - min-Width: "220px", + min-width: "220px"; } :global(.home-userInfo-tabs) { background-color: #eefff8; @@ -54,7 +76,7 @@ white-space: nowrap; /* margin-right: 20px; */ } -:global(.home-rate-divider){ +:global(.home-rate-divider) { height: 80%; } :global(.home-always-title) { @@ -104,7 +126,7 @@ background-color: #fafafa; padding: 8px; border-radius: 10px; - box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12) ; + box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); } :global(.home-tech-icon) { font-size: 30px; @@ -130,11 +152,18 @@ flex-direction: row; align-items: center; margin-bottom: 10px; + justify-content: space-between; +} +:global(.home-ranks) { + display: flex; + flex-direction: row; + align-items: center; + } :global(.home-rank-index) { width: 30px; height: 30px; - margin-right: 40px; + margin-right: 30px; color: #eac088; font-size: 12px; display: flex; @@ -151,7 +180,7 @@ object-fit: contain; width: 30px; height: 30px; - margin-right: 40px; + margin-right: 30px; } :global(.home-rank > .ant-progress .ant-progress-text) { margin-left: 30px; @@ -183,7 +212,7 @@ background: url("./../assets/home/prepare2.png"); background-size: cover; background-repeat: no-repeat; - box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); + box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); /* align-items: center; */ } :global(.home-work-wrap-overtime) { @@ -196,7 +225,7 @@ background: url("./../assets/home/overtime.png"); background-size: cover; background-repeat: no-repeat; - box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); + box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); /* align-items: center; */ } :global(.home-work-wrap-over) { @@ -209,7 +238,7 @@ background: url("./../assets/home/over.png"); background-size: cover; background-repeat: no-repeat; - box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); + box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); /* align-items: center; */ } :global(.home-work-wrap-warn) { @@ -222,7 +251,7 @@ background: url("./../assets/home/warn.png"); background-size: cover; background-repeat: no-repeat; - box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); + box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); /* align-items: center; */ } :global(.home-work-more) { @@ -230,7 +259,7 @@ flex-direction: row; padding: 10px 25px; /* background-color: #fafafa; */ - box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); + box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.12); margin-bottom: 20px; align-items: center; color: #2177d5; @@ -245,8 +274,8 @@ margin-left: 5px; } :global(.home-work-back):hover { -background-color: #eef5ff; -cursor: pointer; + background-color: #eef5ff; + cursor: pointer; } :global(.home-work-icon) { padding: 3px 5px; @@ -345,8 +374,8 @@ cursor: pointer; border-radius: 5px; } :global(.risk-chart) { -display: flex; -flex-direction: column; + display: flex; + flex-direction: column; } :global(.risk-model-tab) { display: flex; @@ -371,9 +400,8 @@ flex-direction: column; font-size: 12px; margin: 0px 5px; cursor: pointer; - background-color:#3c9cff ; + background-color: #3c9cff; color: #fff; } :global() { - -} \ No newline at end of file +} From 7c1747053d2541a280c29fe27a5c7b036937abfc Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Tue, 2 Apr 2024 11:02:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E6=A0=87=E5=87=86=E5=8C=96=E8=BF=90=E8=A1=8C=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI006FormRunAnalysis.js | 2010 ++++++++++------- 1 file changed, 1152 insertions(+), 858 deletions(-) diff --git a/src/components/CustomPages/BI/BI006FormRunAnalysis.js b/src/components/CustomPages/BI/BI006FormRunAnalysis.js index f3901b6..d593cc6 100644 --- a/src/components/CustomPages/BI/BI006FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI006FormRunAnalysis.js @@ -1,215 +1,241 @@ -import React from 'react' -import { connect } from 'dva' -import { initFilter, extendRule, extendOrder } from "../../../utils/common" -import { ChartPieShow, ChartBarShow } from "../../../utils/commonEcharsShow" -import { Table, Button, Row, Col,Modal ,Icon} from 'antd'; -import echarts from 'echarts'; -import styles from '../HI/StepForm.css'; -import moment from 'moment' -import { T } from 'antd/lib/upload/utils'; -import FormPage from '../../FormPage' +import React from "react"; +import { connect } from "dva"; +import { initFilter, extendRule, extendOrder } from "../../../utils/common"; +import { ChartPieShow, ChartBarShow } from "../../../utils/commonEcharsShow"; +import { + Table, + Button, + Row, + Col, + Modal, + Form, + DatePicker, + Icon, + Divider, +} from "antd"; +import echarts from "echarts"; +import styles from "../HI/StepForm1.css"; +import moment from "moment"; +import { T } from "antd/lib/upload/utils"; +import FormPage from "../../FormPage"; class BI006FormRunAnalysis extends React.Component { - constructor(props) { super(props); this.state = { visible: false, - noticeTitle: '', + noticeTitle: "", tmpData: {}, tableKey: "1", - // selectStartTime: moment(this.getStartDate(), 'YYYY-MM-DD 00:00:00'), - selectEndTime:moment(this.getEndDate(), 'YYYY-MM-DD 23:59:59'), + selectStartTime: moment(this.getStartDate(), "YYYY-MM-DD 00:00:00"), + selectEndTime: moment(this.getEndDate(), "YYYY-MM-DD 23:59:59"), startTime: this.getDate(), - endTime:moment(new Date()).format("YYYYMMDD"), - timeType: 5, - totalCount:0, - finishCount:0, - overtimeCount:0, - unfinishCount:0, - dtotalCount:0, - dfinishCount:0, - dovertimeCount:0, - dunfinishCount:0, - drate:'0%', - dnormalRate:'0%', - weekColor:'black', - monthColor:'orange', - threeMonthColor:'black', - sixMonthColor:'black', - yearColor:'black', - retData:[], - groupData:[], - detailData:[], - newData:[], - detailDataH:[], - displayHr:'none', - displaydetail:'none', - columns: [ - { - width: "100px", - title: '部门', - dataIndex: 'DEPARTMENT_NAME', - key: 'DEPARTMENT_NAME', - // render: (text, record) => ( - // - // this.showEditModal(record.DEPARTMENT_ID,record.DEPARTMENT_NAME)}>{record.DEPARTMENT_NAME} - // - // ), - }, - { - width: "60px", - title: '总任务数', - dataIndex: 'TOTAL_QTY', - key: 'TOTAL_QTY' - }, - { - width: "60px", - title: '正常已办', - dataIndex: 'FINISH_QTY', - key: 'FINISH_QTY' - }, - { - width: "60px", - title: '超时已办', - dataIndex: 'OVER_FINISH_QTY', - key: 'OVER_FINISH_QTY' - }, - { - width: "50px", - title: '未完成', - dataIndex: 'UNFINISH_QTY', - key: 'UNFINISH_QTY', - }, - { - width: "50px", - title: '完成率', - dataIndex: 'FINISH_RATE', - key: 'FINISH_RATE', - }, - { - width: "70px", - title: '及时完成率', - dataIndex: 'NORMAL_FINISH_RATE', - key: 'NORMAL_FINISH_RATE', - } - ], - detailColumns: [ - // { - // width: "55px", - // title: '序号', - // dataIndex: 'NUM', - // key: 'NUM', - // }, - { - width: "100px", - title: '模块名称', - dataIndex: 'MOUDLE_NAME', - key: 'MOUDLE_NAME', - // render: (text, record) => ( - // - // this.showFormModal(record.MOUDLE_NAME)}>{record.MOUDLE_NAME} - // - // ), - }, - { - width: "60px", - title: '总任务数', - dataIndex: 'TOTAL_QTY', - key: 'TOTAL_QTY' - }, - { - width: "60px", - title: '正常已办', - dataIndex: 'FINISH_QTY', - key: 'FINISH_QTY' - }, - { - width: "60px", - title: '超时已办', - dataIndex: 'OVER_FINISH_QTY', - key: 'OVER_FINISH_QTY' - }, - { - width: "50px", - title: '未完成', - dataIndex: 'UNFINISH_QTY', - key: 'UNFINISH_QTY', - }, - { - width: "50px", - title: '完成率', - dataIndex: 'FINISH_RATE', - key: 'FINISH_RATE', - }, - { - width: "70px", - title: '及时完成率', - dataIndex: 'NORMAL_FINISH_RATE', - key: 'NORMAL_FINISH_RATE', - } + endTime: moment(new Date()).format("YYYYMMDD"), + timeType: 5, + totalCount: 0, + finishCount: 0, + overtimeCount: 0, + unfinishCount: 0, + dtotalCount: 0, + dfinishCount: 0, + dovertimeCount: 0, + dunfinishCount: 0, + drate: "0%", + dnormalRate: "0%", + weekColor: "black", + monthColor: "orange", + threeMonthColor: "black", + sixMonthColor: "black", + yearColor: "black", + retData: [], + groupData: [], + detailData: [], + newData: [], + detailDataH: [], + displayHr: "none", + displaydetail: "none", + columns: [ + { + width: "100px", + title: "部门", + dataIndex: "DEPARTMENT_NAME", + key: "DEPARTMENT_NAME", + // render: (text, record) => ( + // + // this.showEditModal(record.DEPARTMENT_ID,record.DEPARTMENT_NAME)}>{record.DEPARTMENT_NAME} + // + // ), + }, + { + width: "60px", + title: "总任务数", + dataIndex: "TOTAL_QTY", + key: "TOTAL_QTY", + }, + { + width: "60px", + title: "正常已办", + dataIndex: "FINISH_QTY", + key: "FINISH_QTY", + }, + { + width: "60px", + title: "超时已办", + dataIndex: "OVER_FINISH_QTY", + key: "OVER_FINISH_QTY", + }, + { + width: "50px", + title: "未完成", + dataIndex: "UNFINISH_QTY", + key: "UNFINISH_QTY", + }, + { + width: "50px", + title: "完成率", + dataIndex: "FINISH_RATE", + key: "FINISH_RATE", + }, + { + width: "70px", + title: "及时完成率", + dataIndex: "NORMAL_FINISH_RATE", + key: "NORMAL_FINISH_RATE", + }, ], - }; + detailColumns: [ + // { + // width: "55px", + // title: '序号', + // dataIndex: 'NUM', + // key: 'NUM', + // }, + { + width: "100px", + title: "模块名称", + dataIndex: "MOUDLE_NAME", + key: "MOUDLE_NAME", + // render: (text, record) => ( + // + // this.showFormModal(record.MOUDLE_NAME)}>{record.MOUDLE_NAME} + // + // ), + }, + { + width: "60px", + title: "总任务数", + dataIndex: "TOTAL_QTY", + key: "TOTAL_QTY", + }, + { + width: "60px", + title: "正常已办", + dataIndex: "FINISH_QTY", + key: "FINISH_QTY", + }, + { + width: "60px", + title: "超时已办", + dataIndex: "OVER_FINISH_QTY", + key: "OVER_FINISH_QTY", + }, + { + width: "50px", + title: "未完成", + dataIndex: "UNFINISH_QTY", + key: "UNFINISH_QTY", + }, + { + width: "50px", + title: "完成率", + dataIndex: "FINISH_RATE", + key: "FINISH_RATE", + }, + { + width: "70px", + title: "及时完成率", + dataIndex: "NORMAL_FINISH_RATE", + key: "NORMAL_FINISH_RATE", + }, + ], + }; + } + getStartDate = () => { + let date = new Date(); + let y = date.getFullYear(); + let m = date.getMonth() + 1; + let d = date.getDate(); + // 当前日期 + let nowDate = + y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d); + let pastDate = moment(nowDate) + .add(-1, "month") + .format("YYYY-MM-DD 00:00:00"); + return pastDate; }; - getStartDate=()=>{ - let date = new Date() - let y = date.getFullYear() - let m = date.getMonth() + 1 - let d = date.getDate(); + + getEndDate = () => { + let date = new Date(); + let y = date.getFullYear(); + let m = date.getMonth() + 1; + let d = date.getDate(); // 当前日期 - let nowDate = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d); - let pastDate = moment(nowDate).add(-1, "month").format('YYYY-MM-DD 00:00:00') - return pastDate; - } - - getEndDate=()=>{ - let date = new Date() - let y = date.getFullYear() - let m = date.getMonth() + 1 - let d = date.getDate(); - // 当前日期 - let nowDate = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d); - let pastDate = moment(nowDate).format('YYYY-MM-DD 23:59:59') - return pastDate; - } + let nowDate = + y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d); + let pastDate = moment(nowDate).format("YYYY-MM-DD 23:59:59"); + return pastDate; + }; componentDidMount() { - this.loadData() - }; + this.loadData(); + } showEditModal = (departmentId, departmentName) => { const newtmpData = { data: { - id: departmentId, name: departmentName, onCancel: this.handleCancel, tableKey: this.state.tableKey, - homeReload: true + id: departmentId, + name: departmentName, + onCancel: this.handleCancel, + tableKey: this.state.tableKey, + homeReload: true, }, formCode: "BI007_RUNANALYSIS", - } - this.setState({ - id: departmentId, - name: departmentName, - noticeTitle: departmentName+"安全生产标准化运行情况", - tmpData: newtmpData, - currActivatedMenu: '' - }, () => this.setState({ - visible: true - })); - } - showFormModal=(mouldName)=>{ + }; + this.setState( + { + id: departmentId, + name: departmentName, + noticeTitle: departmentName + "安全生产标准化运行情况", + tmpData: newtmpData, + currActivatedMenu: "", + }, + () => + this.setState({ + visible: true, + }) + ); + }; + showFormModal = (mouldName) => { const newtmpData = { data: { - name: mouldName, onCancel: this.handleCancel, tableKey: this.state.tableKey, - homeReload: true + name: mouldName, + onCancel: this.handleCancel, + tableKey: this.state.tableKey, + homeReload: true, }, formCode: "BI008_RUNANALYSIS", - } - this.setState({ - name: mouldName, - noticeTitle: mouldName+"安全生产标准化运行情况", - tmpData: newtmpData, - currActivatedMenu: '' - }, () => this.setState({ - visible: true - })); - } + }; + this.setState( + { + name: mouldName, + noticeTitle: mouldName + "安全生产标准化运行情况", + tmpData: newtmpData, + currActivatedMenu: "", + }, + () => + this.setState({ + visible: true, + }) + ); + }; // showEditModal = (dataId, formCode, TaskID, title, taskCode) => { // const newtmpData = { @@ -228,705 +254,943 @@ class BI006FormRunAnalysis extends React.Component { // visible: true // })); // } - - getDate=(type)=>{ - let date = new Date() - let y = date .getFullYear() - let m = date .getMonth() + 1 - let d = date .getDate(); - // 当前日期 - let nowDate = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d); - let pastDate = moment(nowDate).add(-1, "month").format('YYYYMMDD') - let weekColor='black'; - let monthColor='orange'; - let threeMonthColor='black'; - let sixMonthColor='black'; - let yearColor='black'; - let timeType=5; - if(type==="Week") - { - pastDate=moment(nowDate).add(-7, "d").format("YYYYMMDD") - weekColor='orange'; - monthColor='black'; - threeMonthColor='black'; - sixMonthColor='black'; - yearColor='black'; - timeType=1; - } - if(type==="ThreeMonth") - { - pastDate=moment(nowDate).add(-3, "month").format("YYYYMMDD") - weekColor='black'; - monthColor='black'; - threeMonthColor='orange'; - sixMonthColor='black'; - yearColor='black'; - timeType=10; - } - if(type==="SixMonth") - { - pastDate=moment(nowDate).add(-6, "month").format("YYYYMMDD") - weekColor='black'; - monthColor='black'; - threeMonthColor='black'; - sixMonthColor='orange'; - yearColor='black'; - timeType=15; - } - if(type==="Year") - { - pastDate=moment(nowDate).add(-1, "year").format("YYYYMMDD") - weekColor='black'; - monthColor='black'; - threeMonthColor='black'; - sixMonthColor='black'; - yearColor='orange'; - timeType=20; - } - this.setState({ - startTime: pastDate, - timeType: timeType, - weekColor:weekColor, - monthColor:monthColor, - threeMonthColor:threeMonthColor, - sixMonthColor:sixMonthColor, - yearColor:yearColor - },()=>{ - if(type) - { - this.loadData(); - } - }) - return pastDate; + + getDate = (type) => { + let date = new Date(); + let y = date.getFullYear(); + let m = date.getMonth() + 1; + let d = date.getDate(); + // 当前日期 + let nowDate = + y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d); + let pastDate = moment(nowDate).add(-1, "month").format("YYYYMMDD"); + let weekColor = "black"; + let monthColor = "orange"; + let threeMonthColor = "black"; + let sixMonthColor = "black"; + let yearColor = "black"; + let timeType = 5; + if (type === "Week") { + pastDate = moment(nowDate).add(-7, "d").format("YYYYMMDD"); + weekColor = "orange"; + monthColor = "black"; + threeMonthColor = "black"; + sixMonthColor = "black"; + yearColor = "black"; + timeType = 1; } + if (type === "ThreeMonth") { + pastDate = moment(nowDate).add(-3, "month").format("YYYYMMDD"); + weekColor = "black"; + monthColor = "black"; + threeMonthColor = "orange"; + sixMonthColor = "black"; + yearColor = "black"; + timeType = 10; + } + if (type === "SixMonth") { + pastDate = moment(nowDate).add(-6, "month").format("YYYYMMDD"); + weekColor = "black"; + monthColor = "black"; + threeMonthColor = "black"; + sixMonthColor = "orange"; + yearColor = "black"; + timeType = 15; + } + if (type === "Year") { + pastDate = moment(nowDate).add(-1, "year").format("YYYYMMDD"); + weekColor = "black"; + monthColor = "black"; + threeMonthColor = "black"; + sixMonthColor = "black"; + yearColor = "orange"; + timeType = 20; + } + this.setState( + { + startTime: pastDate, + timeType: timeType, + weekColor: weekColor, + monthColor: monthColor, + threeMonthColor: threeMonthColor, + sixMonthColor: sixMonthColor, + yearColor: yearColor, + }, + () => { + if (type) { + this.loadData(); + } + } + ); + return pastDate; + }; //加载数据赋值 loadData = () => { this.ksRun(); this.xkRun(); this.getMould(); - this.getDepartment(); - } + // this.getDepartment(); + }; //矿山 ksRun = () => { - let json = initFilter(this.props.login.OrgId); - extendRule(json, 'DEPARTMENT_NAME', 1, "矿山部"); - // 1代表=,2代表不等于,3小于,4小于等于,5大于,6大于等于,7以开始的Like,8以结束的Like,9包含 - if(this.state.timeType ===1)//最近一周(显示最近一月的,最小单位为月) - { - let start=moment(new Date()).add(0, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===5)//最近一月 - { - let start=moment(new Date()).add(0, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===10)//最近三月 - { - let start=moment(new Date()).add(-2, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===15)//最近半年 - { - let start=moment(new Date()).add(-5, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===20)//最近一年 - { - let start=moment(new Date()).add(-11, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } + var orgId = this.props.login ? this.props.login.OrgId : ""; + // let startTime=this.state.selectStartTime.format('YYYY-MM-01 00:00:00'); + // let endTime=this.state.selectEndTime.format('YYYY-MM-01 00:00:00'); + //默认最近一年 + let startTime = moment(new Date()) + .add(-11, "month") + .format("YYYY-MM-01 00:00:00"); + let endTime = moment(new Date()) + .add(1, "month") + .format("YYYY-MM-01 00:00:00"); + let json = initFilter(orgId, "矿山部", "", "", "", startTime, endTime); extendOrder(json, "MONTH", 0); this.props.dispatch({ - type: 'app/getDataByPost', + type: "app/getDataByPost", url: "BI/BIStatiscialAnalysisController/GetEntities", payload: json, onlyData: false, onComplete: (data) => { - // let data = { - // "IsSuccessful": true, "Data": [{ "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-08-01 00:00:00", "MONTHStr": "2023年1月", "C_COUNT": 90, "D_COUNT":80}, - // {"DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-09-01 00:00:00", "MONTHStr": "2023年2月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-10-01 00:00:00", "MONTHStr": "2023年3月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-11-01 00:00:00", "MONTHStr": "2023年4月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-12-01 00:00:00", "MONTHStr": "2023年5月", "C_COUNT": 70, "D_COUNT": 60}, - // {"DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-09-01 00:00:00", "MONTHStr": "2023年6月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-10-01 00:00:00", "MONTHStr": "2023年7月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-11-01 00:00:00", "MONTHStr": "2023年8月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-12-01 00:00:00", "MONTHStr": "2023年9月","C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-11-01 00:00:00", "MONTHStr": "2023年10月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-12-01 00:00:00", "MONTHStr": "2023年11月", "C_COUNT": 70, "D_COUNT": 60 }, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2022-01-01 00:00:00", "MONTHStr": "2023年12月", "C_COUNT": 70, "D_COUNT": 60 }], "TotalCount": 0, "ErrorMessage": null - // } - if (data && data.IsSuccessful) { - let month = []; - let company = []; - let department = []; - data.Data.forEach(item => { - month.push(item.MONTHStr); - company.push(item.FINISH_RATE); - department.push(item.NORMAL_FINISH_RATE); - }) - let myChart = echarts.init(document.getElementById('ksRun')); - myChart.setOption({ - // title: { - // text: "矿山部-安全生产标准化运行走势图", - // left: 'center' - // }, - tooltip: { - trigger: 'axis', - // formatter: function (params) { - // let temp='' - // params.forEach(t=>{ - // temp=temp+t.seriesName +":"+t.value+"%"+'
'; - - // }) - // return temp; - // } - }, - legend: { - // data: ['部门'], - data: ['完成率', '及时完成率'], - bottom: '10px' - }, - grid: { - left: '3%', - right: '4%', - top: '3%', - containLabel: true - }, - toolbox: { - feature: { - // saveAsImage: {} - } - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: month, - axisLine: { - show: false, - // lineStyle: { - // color: 'rgba(192, 192, 102)' - // } - }, - axisTick: { - show: false - }, - axisLabel: { - color: '#000', - rotate: 40, - formatter: function (value) { // 自定义文字超出部分 ... - if (value.length > 10) { - return `${value.slice(0, 10)}...`; - } - return value; - } - } - }, - yAxis: { - axisLabel: { - formatter: function (val) { - return (val)+ '%'; - } - }, - }, - series: [ - { - name: '完成率', - type: 'line', - color: '#4b9bf3', - data: company - }, - { - name: '及时完成率', - type: 'line', - color: '#FCD149', - data: department - }, - - ] - }) - } - } + if (data && data.IsSuccessful) { + let month = []; + let company = []; + let department = []; + data.Data.forEach((item) => { + month.push(item.MONTHStr); + company.push(item.FINISH_RATE); + department.push(item.NORMAL_FINISH_RATE); + }); + let myChart = echarts.init(document.getElementById("ksRun")); + myChart.setOption({ + // title: { + // text: "矿山部-安全生产标准化运行走势图", + // left: 'center' + // }, + tooltip: { + trigger: "axis", + }, + legend: { + // data: ['部门'], + data: ["完成率", "及时完成率"], + bottom: "10px", + }, + grid: { + left: "3%", + right: "4%", + top: "3%", + containLabel: true, + }, + toolbox: { + feature: { + // saveAsImage: {} + }, + }, + xAxis: { + type: "category", + boundaryGap: false, + data: month, + axisLine: { + show: false, + // lineStyle: { + // color: 'rgba(192, 192, 102)' + // } + }, + axisTick: { + show: false, + }, + axisLabel: { + color: "#000", + rotate: 40, + formatter: function (value) { + // 自定义文字超出部分 ... + if (value.length > 10) { + return `${value.slice(0, 10)}...`; + } + return value; + }, + }, + }, + yAxis: { + axisLabel: { + formatter: function (val) { + return val + "%"; + }, + }, + }, + series: [ + { + name: "完成率", + type: "line", + color: "#4b9bf3", + data: company, + }, + { + name: "及时完成率", + type: "line", + color: "#FCD149", + data: department, + }, + ], + }); + } + }, }); - } + }; //选矿 - xkRun = () => { - let json = initFilter(this.props.login.OrgId); - extendRule(json, 'DEPARTMENT_NAME', 1, "选矿部"); - // 1代表=,2代表不等于,3小于,4小于等于,5大于,6大于等于,7以开始的Like,8以结束的Like,9包含 - if(this.state.timeType ===1)//最近一周(显示最近一月的,最小单位为月) - { - let start=moment(new Date()).add(0, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===5)//最近一月 - { - let start=moment(new Date()).add(0, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===10)//最近三月 - { - let start=moment(new Date()).add(-2, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===15)//最近半年 - { - let start=moment(new Date()).add(-5, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } - else if(this.state.timeType ===20)//最近一年 - { - let start=moment(new Date()).add(-11, "month").format('YYYY-MM-01 00:00:00') - let end=moment(new Date()).add(1, "month").format('YYYY-MM-01 00:00:00') - extendRule(json, 'MONTH', 6, start); - extendRule(json, 'MONTH', 3, end); - } + xkRun = () => { + var orgId = this.props.login ? this.props.login.OrgId : ""; + // let startTime=this.state.selectStartTime.format('YYYY-MM-01 00:00:00'); + // let endTime=this.state.selectEndTime.format('YYYY-MM-01 00:00:00'); + //默认最近一年 + let startTime = moment(new Date()) + .add(-11, "month") + .format("YYYY-MM-01 00:00:00"); + let endTime = moment(new Date()) + .add(1, "month") + .format("YYYY-MM-01 00:00:00"); + let json = initFilter(orgId, "选矿部", "", "", "", startTime, endTime); extendOrder(json, "MONTH", 0); this.props.dispatch({ - type: 'app/getDataByPost', + type: "app/getDataByPost", url: "BI/BIStatiscialAnalysisController/GetEntities", payload: json, onlyData: false, onComplete: (data) => { - // let data = { - // "IsSuccessful": true, "Data": [{ "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-08-01 00:00:00", "MONTHStr": "2023年1月", "C_COUNT": 90, "D_COUNT":80}, - // {"DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-09-01 00:00:00", "MONTHStr": "2023年2月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-10-01 00:00:00", "MONTHStr": "2023年3月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-11-01 00:00:00", "MONTHStr": "2023年4月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-12-01 00:00:00", "MONTHStr": "2023年5月", "C_COUNT": 70, "D_COUNT": 60}, - // {"DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-09-01 00:00:00", "MONTHStr": "2023年6月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-10-01 00:00:00", "MONTHStr": "2023年7月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-11-01 00:00:00", "MONTHStr": "2023年8月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-12-01 00:00:00", "MONTHStr": "2023年9月","C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-11-01 00:00:00", "MONTHStr": "2023年10月", "C_COUNT": 70, "D_COUNT": 60}, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2021-12-01 00:00:00", "MONTHStr": "2023年11月", "C_COUNT": 70, "D_COUNT": 60 }, - // { "DEPARTMENT_ID": "e3061909-1a7e-b60c-bc71-1845b79c4a11", "MONTH": "2022-01-01 00:00:00", "MONTHStr": "2023年12月", "C_COUNT": 70, "D_COUNT": 60 }], "TotalCount": 0, "ErrorMessage": null - // } - if (data && data.IsSuccessful) { - let month = []; - let company = []; - let department = []; - data.Data.forEach(item => { - month.push(item.MONTHStr); - company.push(item.FINISH_RATE); - department.push(item.NORMAL_FINISH_RATE); - }) - let myChart = echarts.init(document.getElementById('xkRun')); - myChart.setOption({ - // title: { - // text: "选矿部-安全生产标准化运行走势图", - // padding: [0,100,100,100], - // left: 'center' - // }, - tooltip: { - trigger: 'axis', - // formatter: function (params) { - // let temp='' - // params.forEach(t=>{ - // temp=temp+t.seriesName +":"+t.value+"%"+'
'; - - // }) - // return temp; - // } - }, - legend: { - // data: ['部门'], - data: ['完成率', '及时完成率'], - bottom: '10px' - }, - grid: { - left: '3%', - right: '4%', - top: '3%', - containLabel: true - }, - toolbox: { - feature: { - // saveAsImage: {} - } - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: month, - axisLine: { - show: false, - // lineStyle: { - // color: 'rgba(192, 192, 102)' - // } - }, - axisTick: { - show: false - }, - axisLabel: { - color: '#000', - rotate: 40, - formatter: function (value) { // 自定义文字超出部分 ... - if (value.length > 10) { - return `${value.slice(0, 10)}...`; - } - return value; - } - } - }, - yAxis: { - axisLabel: { - formatter: function (val) { - return (val)+ '%'; - } - }, - }, - series: [ - { - name: '完成率', - type: 'line', - color: '#4b9bf3', - data: company - }, - { - name: '及时完成率', - type: 'line', - color: '#FCD149', - data: department - }, - - ] - }) - } - } + if (data && data.IsSuccessful) { + let month = []; + let company = []; + let department = []; + data.Data.forEach((item) => { + month.push(item.MONTHStr); + company.push(item.FINISH_RATE); + department.push(item.NORMAL_FINISH_RATE); + }); + let myChart = echarts.init(document.getElementById("xkRun")); + myChart.setOption({ + // title: { + // text: "选矿部-安全生产标准化运行走势图", + // padding: [0,100,100,100], + // left: 'center' + // }, + tooltip: { + trigger: "axis", + // formatter: function (params) { + // let temp='' + // params.forEach(t=>{ + // temp=temp+t.seriesName +":"+t.value+"%"+'
'; + + // }) + // return temp; + // } + }, + legend: { + // data: ['部门'], + data: ["完成率", "及时完成率"], + bottom: "10px", + }, + grid: { + left: "3%", + right: "4%", + top: "3%", + containLabel: true, + }, + toolbox: { + feature: { + // saveAsImage: {} + }, + }, + xAxis: { + type: "category", + boundaryGap: false, + data: month, + axisLine: { + show: false, + // lineStyle: { + // color: 'rgba(192, 192, 102)' + // } + }, + axisTick: { + show: false, + }, + axisLabel: { + color: "#000", + rotate: 40, + formatter: function (value) { + // 自定义文字超出部分 ... + if (value.length > 10) { + return `${value.slice(0, 10)}...`; + } + return value; + }, + }, + }, + yAxis: { + axisLabel: { + formatter: function (val) { + return val + "%"; + }, + }, + }, + series: [ + { + name: "完成率", + type: "line", + color: "#4b9bf3", + data: company, + }, + { + name: "及时完成率", + type: "line", + color: "#FCD149", + data: department, + }, + ], + }); + } + }, }); - } - getMould=()=>{ - let allData= [{ - MOUDLE_NAME : "风险管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "安全检查", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "作业现场管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "法律法规与其他要求", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "安全教育培训", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "方针与目标管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "绩效测量与评价", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "生产工艺管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "事故事件", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "安全生产组织保障", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - },{ - MOUDLE_NAME : "安全投入、科技与工伤", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - }, - { - MOUDLE_NAME : "职业卫生", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - }, - { - MOUDLE_NAME : "应急管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - }, - { - MOUDLE_NAME : "机电安全管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - }, - { - MOUDLE_NAME : "会议管理", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - }, - { - MOUDLE_NAME : "标准化创建", - TOTAL_QTY :0, - FINISH_QTY : 0, - OVER_FINISH_QTY : 0, - UNFINISH_QTY : 0, - FINISH_RATE : 0+"%", - NORMAL_FINISH_RATE : 0+"%", - }, - ] - var orgId = this.props.login ? this.props.login.OrgId : ''; - let json = initFilter(orgId); - extendRule(json, 'TYPE', 1, this.state.timeType); + }; + getMould = () => { + let allData = [ + { + MOUDLE_NAME: "风险管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "安全检查", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "作业现场管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "法律法规与其他要求", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "安全教育培训", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "方针与目标管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "绩效测量与评价", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "生产工艺管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "事故事件", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "安全生产组织保障", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "安全投入、科技与工伤", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "职业卫生", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "应急管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "机电安全管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "会议管理", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + { + MOUDLE_NAME: "标准化创建", + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: 0 + "%", + NORMAL_FINISH_RATE: 0 + "%", + }, + ]; + var orgId = this.props.login ? this.props.login.OrgId : ""; + let startTime = this.state.selectStartTime.format("YYYY-MM-DD 00:00:00"); + let endTime = this.state.selectEndTime.format("YYYY-MM-DD 23:59:59"); + let json = initFilter(orgId, "", "", "", "", startTime, endTime); extendOrder(json, "NUM", 0); - this.props.dispatch({ - type: 'app/getDataByPost', - payload: json, - url: 'BI/MouldRunSummary/OrderEntities', - onComplete: (ret) => { - if (ret) { - let temp=[]; - allData.forEach(t=>{ - let group=ret.filter(m=>m.MOUDLE_NAME === t.MOUDLE_NAME) - if(group.length>0) - { - t.TOTAL_QTY = group[0].TOTAL_QTY; - t.FINISH_QTY = group[0].FINISH_QTY; - t.OVER_FINISH_QTY = group[0].OVER_FINISH_QTY; - t.UNFINISH_QTY = group[0].UNFINISH_QTY; - t.FINISH_RATE = group[0].FINISH_RATE+"%"; - t.NORMAL_FINISH_RATE =group[0].NORMAL_FINISH_RATE+"%"; - } - temp.push(t); - }) - this.setState({ - detailData:temp - }) - } + this.props.dispatch({ + type: "app/getDataByPost", + payload: json, + url: "BI/BIStatiscialAnalysisController/GetDepartMouldInfos", + onComplete: (ret) => { + if (ret) { + if (ret.mouldData) { + let temp = []; + allData.forEach((t) => { + let group = ret.mouldData.filter( + (m) => m.MOUDLE_NAME === t.MOUDLE_NAME + ); + if (group.length > 0) { + t.TOTAL_QTY = group[0].TOTAL_QTY; + t.FINISH_QTY = group[0].FINISH_QTY; + t.OVER_FINISH_QTY = group[0].OVER_FINISH_QTY; + t.UNFINISH_QTY = group[0].UNFINISH_QTY; + t.FINISH_RATE = group[0].FINISH_RATE + "%"; + t.NORMAL_FINISH_RATE = group[0].NORMAL_FINISH_RATE + "%"; } - }) - } - getDepartment=()=>{ - var orgId = this.props.login ? this.props.login.OrgId : ''; - const jsonTemp = initFilter(orgId) + temp.push(t); + }); + this.setState({ + detailData: temp, + }); + } + if (ret.departData) { + this.getDepartment(ret.departData); + } + } + }, + }); + }; + getDepartment = (departData) => { + var orgId = this.props.login ? this.props.login.OrgId : ""; + const jsonTemp = initFilter(orgId); extendRule(jsonTemp, "DEPARTMENT_TYPE", 1, 0); this.props.dispatch({ - type: 'app/getDataByPost', + type: "app/getDataByPost", payload: jsonTemp, - url: 'FM/Department/OrderEntities', + url: "FM/Department/OrderEntities", onComplete: (retDepart) => { - if (retDepart) { - let tempDepart=[]; - retDepart.forEach(t=>{ - let tempNow={ - DEPARTMENT_ID:t.ID, - DEPARTMENT_NAME:t.NAME, - TOTAL_QTY:0, - FINISH_QTY:0, - OVER_FINISH_QTY:0, - UNFINISH_QTY:0, - FINISH_RATE:"0%", - NORMAL_FINISH_RATE:"0%"}; - tempDepart.push(tempNow); - }) - - let json = initFilter(orgId); - extendRule(json, 'TYPE', 1, this.state.timeType); - extendRule(json, 'DEPARTMENT_TYPE', 1, 0); - this.props.dispatch({ - type: 'app/getDataByPost', - payload: json, - url: 'BI/SystemRunSummary/OrderEntities', - onComplete: (ret) => { - if (ret) { - let temp=[]; - if(ret) - { - let t1 = 0; - let t2 = 0; - let t3 = 0; - let t4 = 0; - tempDepart.forEach(t=>{ - let group=ret.filter(m=>m.DEPARTMENT_ID === t.DEPARTMENT_ID) - if(group.length>0) - { - t.TOTAL_QTY = group[0].TOTAL_QTY; - t.FINISH_QTY = group[0].FINISH_QTY; - t.OVER_FINISH_QTY = group[0].OVER_FINISH_QTY; - t.UNFINISH_QTY = group[0].UNFINISH_QTY; - t.FINISH_RATE = group[0].FINISH_RATE+"%"; - t.NORMAL_FINISH_RATE =group[0].NORMAL_FINISH_RATE+"%"; - t1 = t1 + group[0].TOTAL_QTY; - t2 = t2 + group[0].FINISH_QTY; - t3 = t3 + group[0].OVER_FINISH_QTY; - t4 = t4 + group[0].UNFINISH_QTY; - } - temp.push(t); - }) - let t5 = t1===0?"0%": ((t2+t3)/t1 *100).toFixed(0)+"%"; - let t6 = t1===0?"0%":(t2/t1 *100).toFixed(0)+"%"; - this.setState({ - retData:temp, - totalCount:t1, - finishCount:t2, - overtimeCount:t3, - unfinishCount:t4, - rate:t5, - normalRate:t6, - }) - // ret.groupData.forEach(t=>{ - // t.unDoneCount = t.TotalCount-t.doneCount -t.timeOverCount; - // t.allDoneRate = ((t.doneCount +t.timeOverCount)/t.TotalCount*100).toFixed(0)+"%"; - // t.doneRate = (t.doneCount/t.TotalCount*100).toFixed(0)+"%"; - // temp.push(t); - // }) - } - - } + if (retDepart) { + let tempDepart = []; + retDepart.forEach((t) => { + let tempNow = { + DEPARTMENT_ID: t.ID, + DEPARTMENT_NAME: t.NAME, + TOTAL_QTY: 0, + FINISH_QTY: 0, + OVER_FINISH_QTY: 0, + UNFINISH_QTY: 0, + FINISH_RATE: "0%", + NORMAL_FINISH_RATE: "0%", + }; + tempDepart.push(tempNow); + }); + if (departData) { + let temp = []; + let t1 = 0; + let t2 = 0; + let t3 = 0; + let t4 = 0; + tempDepart.forEach((t) => { + let group = departData.filter( + (m) => m.DEPARTMENT_ID === t.DEPARTMENT_ID + ); + if (group.length > 0) { + t.TOTAL_QTY = group[0].TOTAL_QTY; + t.FINISH_QTY = group[0].FINISH_QTY; + t.OVER_FINISH_QTY = group[0].OVER_FINISH_QTY; + t.UNFINISH_QTY = group[0].UNFINISH_QTY; + t.FINISH_RATE = group[0].FINISH_RATE + "%"; + t.NORMAL_FINISH_RATE = group[0].NORMAL_FINISH_RATE + "%"; + t1 = t1 + group[0].TOTAL_QTY; + t2 = t2 + group[0].FINISH_QTY; + t3 = t3 + group[0].OVER_FINISH_QTY; + t4 = t4 + group[0].UNFINISH_QTY; } - }) + temp.push(t); + }); + let t5 = + t1 === 0 ? "0%" : (((t2 + t3) / t1) * 100).toFixed(0) + "%"; + let t6 = t1 === 0 ? "0%" : ((t2 / t1) * 100).toFixed(0) + "%"; + this.setState({ + retData: temp, + totalCount: t1, + finishCount: t2, + overtimeCount: t3, + unfinishCount: t4, + rate: t5, + normalRate: t6, + }); } - } - }) - } - closeModal = () => { // 退出弹窗 + } + }, + }); + }; + startChange = (value) => { + this.setState({ + selectStartTime: value, + startTime: value.format("YYYYMMDD"), + }); + }; + endChange = (value) => { + this.setState({ + selectEndTime: value, + endTime: value.format("YYYYMMDD"), + }); + }; + closeModal = () => { + // 退出弹窗 this.clearData(); - } + }; clearData = () => { - let newtmpData = { ...this.state.tmpData } - newtmpData["data"].id = ''; + let newtmpData = { ...this.state.tmpData }; + newtmpData["data"].id = ""; newtmpData["data"].homeReload = false; - newtmpData.formCode = ''; + newtmpData.formCode = ""; this.setState({ visible: false, tmpData: newtmpData, - }) - } - handleCancel = () => { // 退出弹窗 + }); + }; + handleCancel = () => { + // 退出弹窗 this.clearData(); - } + }; render() { - const { startTime, endTime,finishCount,overtimeCount,totalCount,unfinishCount, - weekColor,monthColor,threeMonthColor,sixMonthColor,yearColor, - } = this.state; - let allFinishRate=totalCount ===0?0:((finishCount+overtimeCount)/totalCount * 100).toFixed(0); - let finishRate=totalCount ===0?0:(finishCount/totalCount * 100).toFixed(0); - return
- {/* className='route-home' ,boxShadow:'inset 0 0 10px #ccc' */} -
- + {/* className='route-home' ,boxShadow:'inset 0 0 10px #ccc' */} +
+ -

行洛坑钨矿安全生产标准化运行情况

- ({startTime}-{endTime}) -

- - - - - - - - - - - - - - +

+ 行洛坑钨矿安全生产标准化运行情况 +

+ + {" "} + + ({startTime}-{endTime}) + + +

+
+
+ {/* */} + 查询时间: + + {/* */} +
+ +
+ {/* */} + 至: + + {/* */} +
+
+ +
+
+
+
+
  • + 总任务数 +
    +
    {totalCount}
    +
  • + +
  • + 正常已办 +
    +
    {finishCount}
    +
  • + +
  • + 超时已办 +
    +
    {overtimeCount}
    +
  • + +
  • + 未完成数 +
    +
    {unfinishCount}
    + {/* */} + {/* */} +
  • + +
  • + 完成率 +
    +
    {allFinishRate}%
    + {/* */} + {/* */} +
  • + +
  • + 及时完成率 +
    +
    {finishRate}%
    +
  • +
    +
    + + {/*
    + + + + + + +
    */} + + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} {/* */} -
    -
    - - -

    部门统计分析

    - + + +

    + 矿山部-安全生产标准化运行走势图 +

    +
    + + + + +

    + 部门统计分析 +

    +
    + +
    + -

    矿山部-安全生产标准化运行走势图

    -
    - - -
    - - -

    模块统计分析

    -
    + 模块统计分析 + +
    -

    选矿部-安全生产标准化运行走势图

    -
    +

    + 选矿部-安全生产标准化运行走势图 +

    +
    - - + + - + ); } } -export default connect(({ login, app }) => ({ login, app }))(BI006FormRunAnalysis) +export default connect(({ login, app }) => ({ login, app }))( + BI006FormRunAnalysis +); From bc4a0b1a30d9c8fc2d30ad6a14564ba26656ef79 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Wed, 3 Apr 2024 10:36:04 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E6=A0=87=E5=87=86=E5=8C=96=E8=BF=90=E8=A1=8C=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI006FormRunAnalysis.js | 352 +++++++++++++++--- .../CustomPages/BI/BI051BSCompanyYearOne.js | 4 - 2 files changed, 291 insertions(+), 65 deletions(-) diff --git a/src/components/CustomPages/BI/BI006FormRunAnalysis.js b/src/components/CustomPages/BI/BI006FormRunAnalysis.js index d593cc6..0fe4599 100644 --- a/src/components/CustomPages/BI/BI006FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI006FormRunAnalysis.js @@ -372,12 +372,13 @@ class BI006FormRunAnalysis extends React.Component { legend: { // data: ['部门'], data: ["完成率", "及时完成率"], - bottom: "10px", + top: "3%", }, grid: { left: "3%", right: "4%", - top: "3%", + top: "15%", + bottom: "5%", containLabel: true, }, toolbox: { @@ -387,48 +388,127 @@ class BI006FormRunAnalysis extends React.Component { }, xAxis: { type: "category", - boundaryGap: false, + boundaryGap: false, //坐标轴两边留白 data: month, - axisLine: { - show: false, - // lineStyle: { - // color: 'rgba(192, 192, 102)' - // } + axisLabel: { + //坐标轴刻度标签的相关设置。 + interval: 0, //设置为 1,表示『隔一个标签显示一个标签』 + // margin:15, + textStyle: { + color: "#1B253A", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 12, + }, + + //rotate:50, }, axisTick: { + //坐标轴刻度相关设置。 show: false, }, - axisLabel: { - color: "#000", - rotate: 40, - formatter: function (value) { - // 自定义文字超出部分 ... - if (value.length > 10) { - return `${value.slice(0, 10)}...`; - } - return value; + axisLine: { + //坐标轴轴线相关设置 + lineStyle: { + color: "#E5E9ED", + // opacity:0.2 + }, + }, + splitLine: { + //坐标轴在 grid 区域中的分隔线。 + show: true, + lineStyle: { + color: "#E5E9ED", + // opacity:0.1 }, }, }, - yAxis: { - axisLabel: { - formatter: function (val) { - return val + "%"; + yAxis: [ + { + type: "value", + splitNumber: 5, + axisLabel: { + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 12, + }, + formatter: function (val) { + return val + "%"; + }, + }, + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: "#E5E9ED", + // opacity:0.1 + }, }, }, - }, + ], series: [ { name: "完成率", type: "line", - color: "#4b9bf3", + // color: "#4b9bf3", data: company, + smooth: true, + itemStyle: { + normal: { + color: "#3A84FF", + lineStyle: { + color: "#3A84FF", + width: 1, + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ + { + offset: 0, + color: "rgba(58,132,255,0)", + }, + { + offset: 1, + color: "rgba(58,132,255,0.35)", + }, + ]), + }, + }, + }, }, { name: "及时完成率", type: "line", - color: "#FCD149", + // color: "#FCD149", data: department, + smooth: true, + itemStyle: { + normal: { + color: "#ff99ad", + lineStyle: { + color: "#ff99ad", + width: 1, + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ + { + offset: 0, + color: "rgba(250,80,113,0)", + }, + { + offset: 1, + color: "rgba(250,80,113,0.35)", + }, + ]), + }, + }, + }, }, ], }); @@ -486,12 +566,13 @@ class BI006FormRunAnalysis extends React.Component { legend: { // data: ['部门'], data: ["完成率", "及时完成率"], - bottom: "10px", + top: "3%", }, grid: { left: "3%", right: "4%", - top: "3%", + top: "15%", + bottom: "5%", containLabel: true, }, toolbox: { @@ -501,48 +582,127 @@ class BI006FormRunAnalysis extends React.Component { }, xAxis: { type: "category", - boundaryGap: false, + boundaryGap: false, //坐标轴两边留白 data: month, - axisLine: { - show: false, - // lineStyle: { - // color: 'rgba(192, 192, 102)' - // } + axisLabel: { + //坐标轴刻度标签的相关设置。 + interval: 0, //设置为 1,表示『隔一个标签显示一个标签』 + // margin:15, + textStyle: { + color: "#1B253A", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 12, + }, + + //rotate:50, }, axisTick: { + //坐标轴刻度相关设置。 show: false, }, - axisLabel: { - color: "#000", - rotate: 40, - formatter: function (value) { - // 自定义文字超出部分 ... - if (value.length > 10) { - return `${value.slice(0, 10)}...`; - } - return value; + axisLine: { + //坐标轴轴线相关设置 + lineStyle: { + color: "#E5E9ED", + // opacity:0.2 + }, + }, + splitLine: { + //坐标轴在 grid 区域中的分隔线。 + show: true, + lineStyle: { + color: "#E5E9ED", + // opacity:0.1 }, }, }, - yAxis: { - axisLabel: { - formatter: function (val) { - return val + "%"; + yAxis: [ + { + type: "value", + splitNumber: 5, + axisLabel: { + textStyle: { + color: "#a8aab0", + fontStyle: "normal", + fontFamily: "微软雅黑", + fontSize: 12, + }, + formatter: function (val) { + return val + "%"; + }, + }, + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: "#E5E9ED", + // opacity:0.1 + }, }, }, - }, + ], series: [ { name: "完成率", type: "line", - color: "#4b9bf3", + // color: "#4b9bf3", data: company, + smooth: true, + itemStyle: { + normal: { + color: "#3A84FF", + lineStyle: { + color: "#3A84FF", + width: 1, + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ + { + offset: 0, + color: "rgba(58,132,255,0)", + }, + { + offset: 1, + color: "rgba(58,132,255,0.35)", + }, + ]), + }, + }, + }, }, { name: "及时完成率", type: "line", - color: "#FCD149", + // color: "#FCD149", data: department, + smooth: true, + itemStyle: { + normal: { + color: "#ff99ad", + lineStyle: { + color: "#ff99ad", + width: 1, + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ + { + offset: 0, + color: "rgba(250,80,113,0)", + }, + { + offset: 1, + color: "rgba(250,80,113,0.35)", + }, + ]), + }, + }, + }, }, ], }); @@ -1154,9 +1314,22 @@ class BI006FormRunAnalysis extends React.Component { marginTop: "20px", }} > - - -

    + +

    +

    矿山部-安全生产标准化运行走势图

    - +

    - 部门统计分析 + {/* */} + 部门统计分析

    - + + +

    + 选矿部-安全生产标准化运行走势图 +

    +
    + + + + +

    + {/* */} + 模块统计分析 +

    +
    + + + + {/*

    - + */} ); diff --git a/src/components/CustomPages/BI/BI051BSCompanyYearOne.js b/src/components/CustomPages/BI/BI051BSCompanyYearOne.js index 9123b18..19f46b0 100644 --- a/src/components/CustomPages/BI/BI051BSCompanyYearOne.js +++ b/src/components/CustomPages/BI/BI051BSCompanyYearOne.js @@ -151,10 +151,6 @@ class BI051BSCompanyYear extends React.Component { } }); // COUNTTOTAL - console.log( - data.listSafeCheckYear[data.listSafeCheckYear.length - 1], - "data.listSafeCheckYeardata.listSafeCheckYear" - ); var colorList = [ "#47A2FF ", "#53C8D1", From b6921577950cf39d4ac11c4fa4352632c4792848 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Wed, 3 Apr 2024 11:02:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=A3=8E=E9=99=A9=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=81=87=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI013RiskAnalysisModel.js | 595 ++++++++++-------- 1 file changed, 330 insertions(+), 265 deletions(-) diff --git a/src/components/CustomPages/BI/BI013RiskAnalysisModel.js b/src/components/CustomPages/BI/BI013RiskAnalysisModel.js index 4eccf96..2122d2a 100644 --- a/src/components/CustomPages/BI/BI013RiskAnalysisModel.js +++ b/src/components/CustomPages/BI/BI013RiskAnalysisModel.js @@ -36,9 +36,27 @@ class BI013RiskAnalysisModel extends React.Component { } else { currentMineType = localStorage.getItem("currentMineType"); } - this.getBaseInfoData(currentMineType); + // this.getBaseInfoData(currentMineType); + this.getBaseData(); } + getBaseData = () => { + this.setState({ + LEVEL1TOTAL: 0, + LEVEL2TOTAL: 82, + LEVEL3TOTAL: 381, + LEVEL4TOTAL: 2212, + HAZARDTOTALCOUNT: 50, + RISKTOTALCOUNT: 2714, + MEASURESTOTALCOUNT: 653, + },()=>{ + this.chart1(); + this.chart2(); + this.chart4(); + }); + + }; + //获取数据 getBaseInfoData = (mineType) => { const json2 = initFilter(this.props.login.OrgId); @@ -71,6 +89,7 @@ class BI013RiskAnalysisModel extends React.Component { RISKTOTALCOUNT: ret.Data.RISKTOTALCOUNT, MEASURESTOTALCOUNT: ret.Data.MEASURESTOTALCOUNT, }); + // this.state.LEVEL1TOTAL = level1all; // this.state.LEVEL2TOTAL = level2all; // this.state.LEVEL3TOTAL = level3all; @@ -108,295 +127,340 @@ class BI013RiskAnalysisModel extends React.Component { let chart1s = document.getElementById("chartone"); let myChart = echarts.init(chart1s); - myChart.setOption({ - color: color, - title: [ - { - text: "风险分级占比1", - left: "center", - top: "2%", - }, - { - text: allNum, - x: "26%", - y: "center", - textStyle: { - fontSize: 26, - fontWeight: "normal", - color: ["#333"], + myChart.setOption( + { + color: color, + title: [ + { + text: "风险分级占比1", + left: "center", + top: "2%", }, - }, - ], - tooltip: { - trigger: "item", - formatter: "{b}:({d}%)", - }, - legend: { - orient: "vartical", - x: "left", - top: "35%", - left: "65%", - bottom: "0%", - data: showData, - // itemWidth: 20, - // itemHeight: 14, - // itemGap :15, - formatter: function (name) { - //通过name获取到数组对象中的单个对象 - let singleData = showData.filter(function (item) { - return item.name == name; - }); - let countAll = 0; - showData.map((item) => { - countAll = countAll + item.value; - }); - - return ( - name + - " | " + - singleData[0].value + - " | " + - Number((singleData[0].value / countAll) * 100).toFixed(2) + - "%" - ); - }, - }, - grid: { - left: 30, - containLabel: true, - bottom: 10, - top: 10, - right: 30, - }, - series: [ - { - name: "访问来源", - type: "pie", - clockwise: false, - // minAngle: 20, - avoidLabelOverlap: false, - radius: ["45%", "65%"], - center: ["30%", "50%"], - itemStyle: { - //图形样式 - normal: { - borderColor: "#ffffff", - borderWidth: 1, - padding: "0 20px", + { + text: allNum, + x: "26%", + y: "center", + textStyle: { + fontSize: 26, + fontWeight: "normal", + color: ["#333"], }, }, - label: { - show: false, - }, - // color: color, - data: showData, - }, - ], - }, true); - }; - chart2 = (data) => { - let areaName = []; - let areaCount = []; - data.forEach((item) => { - areaName.push(item.AREANAME); - areaCount.push(item.AREACOUNT); - }); - let chart2s = document.getElementById("chart2"); - if (chart2s) { - let myChart = echarts.init(chart2s); - myChart.setOption({ - title: { - text: "风险区域统计", - left: "center", - top: "2%", - }, + ], tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", + trigger: "item", + formatter: "{b}:({d}%)", + }, + legend: { + orient: "vartical", + x: "left", + top: "35%", + left: "65%", + bottom: "0%", + data: showData, + // itemWidth: 20, + // itemHeight: 14, + // itemGap :15, + formatter: function (name) { + //通过name获取到数组对象中的单个对象 + let singleData = showData.filter(function (item) { + return item.name == name; + }); + let countAll = 0; + showData.map((item) => { + countAll = countAll + item.value; + }); + + return ( + name + + " | " + + singleData[0].value + + " | " + + Number((singleData[0].value / countAll) * 100).toFixed(2) + + "%" + ); }, }, grid: { - left: "3%", - right: "4%", - top: "10%", - bottom: "1%", + left: 30, containLabel: true, + bottom: 10, + top: 10, + right: 30, }, - xAxis: { - show: false, - }, - yAxis: [ + series: [ { - triggerEvent: true, - show: true, - inverse: false, - data: areaName, - axisLine: { + name: "访问来源", + type: "pie", + clockwise: false, + // minAngle: 20, + avoidLabelOverlap: false, + radius: ["45%", "65%"], + center: ["30%", "50%"], + itemStyle: { + //图形样式 + normal: { + borderColor: "#ffffff", + borderWidth: 1, + padding: "0 20px", + }, + }, + label: { show: false, }, - splitLine: { - show: false, + // color: color, + data: showData, + }, + ], + }, + true + ); + }; + chart2 = (data) => { + let areaName = [ + "破碎车间-粗碎单元", + "综合回收车间-精多金属仓库单元", + "磨重车间-脱泥单元", + "食堂", + "综合回收车间-精矿烘干单元", + "尾矿库截渗池回水单元", + "破碎车间-辊磨单元", + "磨重车间-中矿再磨单元", + "磨重车间-粗粒选别单元", + "加油站-采场", + "尾矿库截洪单元", + "采场道路", + "破碎车间-放矿运输单元", + "卢家边回水单元", + "钨细泥回收车间-回水单元", + "综合回收车间-硫化矿综合回收单元", + "磨重车间-细粒选别单元", + "尾矿库库区", + "磨重车间-磨矿分级单元", + "截渗池回水单元", + ]; + let areaCount = [ + 1, 2, 3, 3, 4, 4, 6, 9, 9, 11, 19, 20, 21, 22, 22, 23, 27, 31, 32, 32, + ]; + // data.forEach((item) => { + // areaName.push(item.AREANAME); + // areaCount.push(item.AREACOUNT); + // }); + let chart2s = document.getElementById("chart2"); + if (chart2s) { + let myChart = echarts.init(chart2s); + myChart.setOption( + { + title: { + text: "风险区域统计", + left: "center", + top: "2%", + }, + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", }, - axisTick: { - show: false, - }, - axisLabel: { - interval: 0, - color: "#666", - align: "right", - margin: 20, - fontSize: 13, + }, + grid: { + left: "3%", + right: "4%", + top: "10%", + bottom: "1%", + containLabel: true, + }, + xAxis: { + show: false, + }, + yAxis: [ + { + triggerEvent: true, + show: true, + inverse: false, + data: areaName, + axisLine: { + show: false, + }, + splitLine: { + show: false, + }, + axisTick: { + show: false, + }, + axisLabel: { + interval: 0, + color: "#666", + align: "right", + margin: 20, + fontSize: 13, - rich: { - idx0: { - color: "#FB375E", - backgroundColor: "#FFE8EC", - borderRadius: 100, - padding: [5, 8], - }, - idx1: { - color: "#FF9023", - backgroundColor: "#FFEACF", - borderRadius: 100, - padding: [5, 8], - }, - idx2: { - color: "#01B599", - backgroundColor: "#E1F7F3", - borderRadius: 100, - padding: [5, 8], - }, - idx: { - color: "#333", - borderRadius: 100, - padding: [5, 8], - }, - title: { - width: 165, + rich: { + idx0: { + color: "#FB375E", + backgroundColor: "#FFE8EC", + borderRadius: 100, + padding: [5, 8], + }, + idx1: { + color: "#FF9023", + backgroundColor: "#FFEACF", + borderRadius: 100, + padding: [5, 8], + }, + idx2: { + color: "#01B599", + backgroundColor: "#E1F7F3", + borderRadius: 100, + padding: [5, 8], + }, + idx: { + color: "#333", + borderRadius: 100, + padding: [5, 8], + }, + title: { + width: 165, + }, }, }, }, - }, - { - triggerEvent: true, - show: true, - inverse: false, - data: areaCount, - axisLine: { + { + triggerEvent: true, + show: true, + inverse: false, + data: areaCount, + axisLine: { + show: false, + }, + splitLine: { + show: false, + }, + axisTick: { + show: false, + }, + axisLabel: { + interval: 0, + color: "#666", + align: "left", + margin: 20, + fontSize: 12, + }, + }, + ], + series: [ + { + name: "数量", + type: "bar", + // label: { + // show: true, + // position: "insideRight", + // color: "#fff", + // formatter: "{c}", + // fontSize: "12", + // }, + barWidth: 10, + itemStyle: { + color: "#1990FF", + barBorderRadius: 30, + }, + // itemStyle: { + // color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ + // { offset: 0, color: "#01AEF6" }, + // { offset: 1, color: "#9999FF" }, + // ]), + // }, + data: areaCount, show: false, }, - splitLine: { - show: false, - }, - axisTick: { - show: false, - }, - axisLabel: { - interval: 0, - color: "#666", - align: "left", - margin: 20, - fontSize: 12, - }, - }, - ], - series: [ - { - name: "数量", - type: "bar", - // label: { - // show: true, - // position: "insideRight", - // color: "#fff", - // formatter: "{c}", - // fontSize: "12", - // }, - barWidth: 10, - itemStyle: { - color: "#1990FF", - barBorderRadius: 30, - }, - // itemStyle: { - // color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - // { offset: 0, color: "#01AEF6" }, - // { offset: 1, color: "#9999FF" }, - // ]), - // }, - data: areaCount, - show: false, - }, - ], - }, true); + ], + }, + true + ); } }; chart4 = (data) => { - let riskArr = []; - let hazardArr = []; - let dates = []; - for (let i = 0; i < data.length; i++) { - if (data[i].TYPE == 0) { - riskArr.push(data[i].COUNT); - dates.push(moment(data[i].DATE).format("YYYY/MM")); - } else { - hazardArr.push(data[i].COUNT); - } - } - let currMonth = dates.length; - for (let i = 1; i < 13 - currMonth; i++) { - dates.push( - moment(dates[dates.length]).add(i, "months").format("YYYY/MM") - ); - } + let riskArr = [2714, 2714, 2714, 2714]; + let hazardArr = [50, 50, 50, 50]; + let dates = [ + "2024/01", + "2024/02", + "2024/03", + "2024/04", + "2024/05", + "2024/06", + "2024/07", + "2024/08", + "2024/09", + "2024/10", + "2024/11", + "2024/12", + ]; + // for (let i = 0; i < data.length; i++) { + // if (data[i].TYPE == 0) { + // riskArr.push(data[i].COUNT); + // dates.push(moment(data[i].DATE).format("YYYY/MM")); + // } else { + // hazardArr.push(data[i].COUNT); + // } + // } + // let currMonth = dates.length; + // for (let i = 1; i < 13 - currMonth; i++) { + // dates.push( + // moment(dates[dates.length]).add(i, "months").format("YYYY/MM") + // ); + // } let chart4s = document.getElementById("chart4"); if (chart4s) { let myChart = echarts.init(chart4s); - myChart.setOption({ - color: ["#72b85b", "#f6841a", "#cc0404"], - grid: { - left: "5%", - right: "5%", - }, - legend: { - bottom: "0px", - }, - title: { - text: "月度风险辨识统计走势", - left: "center", - top: "2%", - }, - tooltip: { - trigger: "axis", - axisPointer: { - type: "shadow", + myChart.setOption( + { + color: ["#72b85b", "#f6841a", "#cc0404"], + grid: { + left: "5%", + right: "5%", }, - }, - xAxis: { - type: "category", - data: dates, - axisLabel: { - showMaxLabel: true, + legend: { + bottom: "0px", }, - }, - yAxis: { - type: "value", - }, - series: [ - { - name: "危险源/风险库", - data: riskArr, - type: "line", - smooth: true, + title: { + text: "月度风险辨识统计走势", + left: "center", + top: "2%", }, - { - name: "职业危害库", - data: hazardArr, - type: "line", - smooth: true, + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + }, }, - ], - }, true); + xAxis: { + type: "category", + data: dates, + axisLabel: { + showMaxLabel: true, + }, + }, + yAxis: { + type: "value", + }, + series: [ + { + name: "危险源/风险库", + data: riskArr, + type: "line", + smooth: true, + }, + { + name: "职业危害库", + data: hazardArr, + type: "line", + smooth: true, + }, + ], + }, + true + ); } }; render() { @@ -539,7 +603,10 @@ class BI013RiskAnalysisModel extends React.Component { // className="dashboard-div-style" style={{ border: "1px solid rgb(232,232,232)" }} > -
    +

    @@ -568,7 +635,7 @@ class BI013RiskAnalysisModel extends React.Component { alignItems: "center", justifyContent: "space-around", border: "1px #888 solid", - padding: "8px 0px" + padding: "8px 0px", }} >
    -
    +