From e9eaea5f96361472c166aacbf2e24d483653576c Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Mon, 20 Jul 2026 11:48:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E6=89=A9=E5=B1=95=E8=A1=A8=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AD=98=E5=9C=A8=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI054HomeDetail.js | 508 +++++++++--------- 1 file changed, 264 insertions(+), 244 deletions(-) diff --git a/src/components/CustomPages/BI/BI054HomeDetail.js b/src/components/CustomPages/BI/BI054HomeDetail.js index 7ea810a..bb75fd3 100644 --- a/src/components/CustomPages/BI/BI054HomeDetail.js +++ b/src/components/CustomPages/BI/BI054HomeDetail.js @@ -1,7 +1,7 @@ -import React from 'react' -import { connect } from 'dva' -import { initFilter, extendRule, extendInclude, getIsPC, openNotificationMobile } from "../../../utils/common" -import { ChartBarShow_Vertical, LineShow } from "../../../utils/commonEcharsShow" +import React from 'react'; +import { connect } from 'dva'; +import { initFilter, extendRule, extendInclude, getIsPC, openNotificationMobile } from '../../../utils/common'; +import { ChartBarShow_Vertical, LineShow } from '../../../utils/commonEcharsShow'; import { notification, Button, Descriptions, Table, Row, Col } from 'antd'; import echarts from 'echarts'; import styles from '../HI/StepForm.css'; @@ -13,7 +13,6 @@ const formItemLayout = { // 安全检查次数统计明细(首页) class BI054HomeDetail extends React.Component { - constructor(props) { super(props); this.state = { @@ -23,40 +22,46 @@ class BI054HomeDetail extends React.Component { ListSafeCheckCountDepartment: [], countTypeTitle: [], columnsTb: [], + tableData: [], showLoading: false, }, - // listSafeCheckTypeYear: [], - // listCheckTypeYear: [], }; - }; + } componenthidMount() { if (!getIsPC()) { - openNotificationMobile('bottomRight', notification) + openNotificationMobile('bottomRight', notification); this.state.displayStr = 'none'; this.state.displayNum = 24; - //alert('手机'); } else { this.state.displayStr = ''; this.state.displayNum = 16; - //alert('PC'); } - this.loadData() - //定时器功能,暂时不开启 - // this.timerID = setInterval(() => this.getBaseInfoData(1, this.state.tableKey, 5), 120000); - }; - componentDidMount() { - this.loadData() + this.loadData(); } + + componentDidMount() { + this.loadData(); + } + componentWillUnmount() { // this.timerID && clearTimeout(this.timerID); } //加载数据赋值 loadData = () => { - this.state.showLoading = true; - // let json = initFilter(this.props.login.OrgId, this.props.data.mineType, "NUM"); - let json = initFilter(this.props.login.OrgId, (this.props.data?.mineType == null ? this.props.formParam?.mineType : this.props.data?.mineType), "NUM"); + this.setState((prevState) => ({ + data: { + ...prevState.data, + showLoading: true, + }, + })); + + let json = initFilter( + this.props.login.OrgId, + this.props.data?.mineType == null ? this.props.formParam?.mineType : this.props.data?.mineType, + 'NUM' + ); this.props.dispatch({ type: 'app/getDataByPost', @@ -64,130 +69,188 @@ class BI054HomeDetail extends React.Component { url: 'BI/BIHome/GetHomeDetailMonthCheckType', onComplete: (result) => { if (result) { - // let listName = [] if (result.ListSafeCheckCountDepartment != null && result.ListSafeCheckCountDepartment.length > 0) { - // listName.push('车间名称') - // result.ListSafeCheckCountDepartment[0].listName.forEach((e, i) => { - // listName.push(e) - // }) + const rawData = result.ListSafeCheckCountDepartment; - // listName.push('班组名称') - // result.ListSafeCheckCountDepartment[0].listChild[0].listName.forEach(e => { - // listName.push(e) - // }) + // 1. 提取 listName 作为列标题 + let countTypeTitle = rawData[0]?.listName || ['计划检查次数', '实际检查次数']; - var countTypeTitle = [] - var columnsTb = [] - if (result.ListSafeCheckCountDepartment != null && result.ListSafeCheckCountDepartment.length > 0) { - countTypeTitle = result.ListSafeCheckCountDepartment[0].listName - } - - if (countTypeTitle.length < 1) { - countTypeTitle.push('巡回检查') - countTypeTitle.push('例行检查') - countTypeTitle.push('专业检查') - countTypeTitle.push('综合检查') - } - - var typeName = ['部门名称', '车间/班组'] - var RowCount = 0 - - for (let i = 0; i < 2; i++) { - for (let j = 0; j < countTypeTitle.length; j++) { - if (i == 0) { - if (j == 0) { - //头部 - columnsTb.push({ - title: typeName[i], - dataIndex: "NUM", - key: (i * 10 + j), - render: (value, record, index) => { - RowCount = record.Parent?record.Parent.RowCount:0 - if (index > 0 && result.ListSafeCheckCountDepartment[index - 1].Parent?.DepartmentName == record.Parent?.DepartmentName) { - RowCount = 0 - } - const obj = { - children: record.Parent?record.Parent.DepartmentName:record.DepartmentName, - props: { - 'rowSpan': RowCount - }, - }; - return obj; - } - }) - } - - //非头部 - - columnsTb.push({ - title: countTypeTitle[j], - dataIndex: "NUM", - key: (i * 10 + j), - render: (value, record, index) => { - RowCount = record.Parent?record.Parent.RowCount:0 - if (index > 0 && result.ListSafeCheckCountDepartment[index - 1].Parent?.DepartmentName == record.Parent?.DepartmentName) { - RowCount = 0 - } - const obj = { - children: record.Parent?record.Parent.listCount[j]:record.DepartmentName, - props: { - 'rowSpan': RowCount - }, - }; - return obj; - } - }) - - - } else { - //班组 - if (j == 0) { - columnsTb.push({ - title: typeName[i], - key: (i * 10 + j), - render: (value, record, index) => { - const obj = { - children: record.DepartmentName, - }; - return obj; - } - }) - } - - columnsTb.push({ - title: countTypeTitle[j], - key: (i * 10 + j), - render: (value, record, index) => { - const obj = { - children: record.listCount[j], - }; - return obj; - } - }) + // 2. 构建层级数据:提取父级部门(去重)和对应的子级 + const parentMap = new Map(); + const childMap = new Map(); + rawData.forEach((item) => { + if (item.Parent) { + // 有 Parent 的是子级 + const parentKey = item.Parent.Department_ID; + if (!parentMap.has(parentKey)) { + parentMap.set(parentKey, { + DepartmentName: item.Parent.DepartmentName, + Department_ID: parentKey, + RowCount: item.Parent.RowCount || 1, + listCount: item.Parent.listCount || [], + children: [], + }); + } + // 子级记录(去重) + if (!childMap.has(item.Department_ID)) { + childMap.set(item.Department_ID, { + DepartmentName: item.DepartmentName, + Department_ID: item.Department_ID, + listCount: item.listCount || [], + Parent: item.Parent, + }); + parentMap.get(parentKey).children.push(childMap.get(item.Department_ID)); + } + } else { + // 没有 Parent 的是顶级部门(去重) + const parentKey = item.Department_ID; + if (!parentMap.has(parentKey)) { + parentMap.set(parentKey, { + DepartmentName: item.DepartmentName, + Department_ID: parentKey, + RowCount: item.RowCount || 1, + listCount: item.listCount || [], + children: item.listChild || [], + }); } } - } + }); + // 转换为数组 + const parentList = Array.from(parentMap.values()); + // 3. 构建表格数据源(扁平化结构,用于 Antd Table) + const tableData = []; + parentList.forEach((parent, parentIndex) => { + if (parent.children && parent.children.length > 0) { + // 有子级:为每个子级创建一行,父级信息通过 rowSpan 合并 + parent.children.forEach((child, index) => { + tableData.push({ + key: child.Department_ID || `${parent.Department_ID}-${index}`, + // 父级信息(用于 rowSpan 合并) + parentName: parent.DepartmentName, + parentCount: parent.listCount || [], + parentRowSpan: index === 0 ? parent.children.length : 0, + // 子级信息 + childName: child.DepartmentName, + childCount: child.listCount || [], + // 标记是否为子级行 + isChild: true, + // 原始父级引用 + parentRef: parent, + }); + }); + } else { + // 无子级:单独一行,车间/班组列显示 -- + tableData.push({ + key: parent.Department_ID || `parent-${parentIndex}`, + parentName: parent.DepartmentName, + parentCount: parent.listCount || [], + parentRowSpan: 1, + childName: '--', + childCount: ['--', '--'], + isChild: false, + parentRef: parent, + }); + } + }); + + // 4. 构建 Antd Table 列 + const columnsTb = [ + { + title: '部门名称', + dataIndex: 'parentName', + key: 'department', + width: 120, + render: (text, record) => ({ + children: text, + props: { + rowSpan: record.parentRowSpan || 0, + }, + }), + }, + { + title: countTypeTitle[0] || '计划检查次数', + dataIndex: 'parentCount', + key: 'parentCount1', + width: 100, + render: (counts, record) => ({ + children: counts && counts.length > 0 ? counts[0] : '--', + props: { + rowSpan: record.parentRowSpan || 0, + }, + }), + }, + { + title: countTypeTitle[1] || '实际检查次数', + dataIndex: 'parentCount', + key: 'parentCount2', + width: 100, + render: (counts, record) => ({ + children: counts && counts.length > 1 ? counts[1] : '--', + props: { + rowSpan: record.parentRowSpan || 0, + }, + }), + }, + { + title: '车间/班组', + dataIndex: 'childName', + key: 'workshop', + width: 120, + render: (text) => text || '--', + }, + { + title: countTypeTitle[0] || '计划检查次数', + dataIndex: 'childCount', + key: 'childCount1', + width: 100, + render: (counts) => (counts && counts.length > 0 ? counts[0] : '--'), + }, + { + title: countTypeTitle[1] || '实际检查次数', + dataIndex: 'childCount', + key: 'childCount2', + width: 100, + render: (counts) => (counts && counts.length > 1 ? counts[1] : '--'), + }, + ]; + + // 5. 更新 state this.setState({ data: { + ...this.state.data, countTypeTitle: countTypeTitle, columnsTb: columnsTb, - // listName: listName, + tableData: tableData, ListSafeCheckYearMonth: result.ListSafeCheckYearMonth, - ListSafeCheckCountDepartment: result.ListSafeCheckCountDepartment,//车间 子集是 班组 - } - }) - this.hiddenDangerTotal() + ListSafeCheckCountDepartment: result.ListSafeCheckCountDepartment, + showLoading: false, + }, + }); + + this.hiddenDangerTotal(); + } else { + this.setState((prevState) => ({ + data: { + ...prevState.data, + showLoading: false, + tableData: [], + }, + })); } - + } else { + this.setState((prevState) => ({ + data: { + ...prevState.data, + showLoading: false, + }, + })); } - } - }) - - this.state.showLoading = false; - } + }, + }); + }; hiddenDangerTotal = () => { if (this.state.data.ListSafeCheckYearMonth) { @@ -198,10 +261,10 @@ class BI054HomeDetail extends React.Component { let data3 = []; let seriesName = []; data.map((item) => { - if (item.MONTH>9){ - xData.push(item.YEAR+'-'+ item.MONTH); - }else{ - xData.push(item.YEAR+'-0'+ item.MONTH); + if (item.MONTH > 9) { + xData.push(item.YEAR + '-' + item.MONTH); + } else { + xData.push(item.YEAR + '-0' + item.MONTH); } seriesName = item.listSOURCENAME; data1.push(item.listListCount); @@ -221,47 +284,46 @@ class BI054HomeDetail extends React.Component { for (let i = 0; i < data3.length; i++) { series.push({ name: seriesName[i], - type: "bar", - stack: "总量", + type: 'bar', + stack: '总量', data: data3[i], - barWidth: "40%", + barWidth: '40%', }); } //图标2 - let dangerTotals = document.getElementById("dangerTotal2"); + let dangerTotals = document.getElementById('dangerTotal2'); if (dangerTotals) { let myChart = echarts.init(dangerTotals); myChart.setOption({ - color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d"], + color: ['#4285F4', '#72b85b', '#c92a2a', '#ffa94d'], tooltip: { - trigger: "axis", + trigger: 'axis', axisPointer: { - // 坐标轴指示器,坐标轴触发有效 - type: "shadow", // 默认为直线,可选为:'line' | 'shadow' + type: 'shadow', }, transitionDuration: 0, }, grid: { - left: "5%", - right: "5%", - bottom: "15%", - top: "5%", + left: '5%', + right: '5%', + bottom: '15%', + top: '5%', containLabel: true, z: 22, }, xAxis: { - type: "category", + type: 'category', data: xData, axisLine: { lineStyle: { - color: "#0c3b71", + color: '#0c3b71', }, }, axisLabel: { show: true, - color: "rgb(170,170,170)", + color: 'rgb(170,170,170)', interval: 0, textStyle: { lineHeight: 14, @@ -270,32 +332,31 @@ class BI054HomeDetail extends React.Component { }, legend: { data: seriesName, - left: "center", - align: "left", - bottom: "2%", + left: 'center', + align: 'left', + bottom: '2%', textStyle: { - color: "#000", + color: '#000', }, itemWidth: 10, itemHeight: 10, - // itemGap: 15, }, yAxis: { - type: "value", + type: 'value', splitLine: { show: true, lineStyle: { - color: ["#f2f2f2"], + color: ['#f2f2f2'], }, }, axisLine: { lineStyle: { - color: "#0c3b71", + color: '#0c3b71', }, }, axisLabel: { - color: "rgb(170,170,170)", - formatter: "{value} ", + color: 'rgb(170,170,170)', + formatter: '{value} ', }, }, series: series, @@ -306,92 +367,51 @@ class BI054HomeDetail extends React.Component { render() { const { data } = this.state; - return
- - - -
-
-
- - -
+ return ( +
+ + + +
+
+
+ + +
- - - - -
- - - - {/*
-
- - { - data.listName ? ( - - { - data.listName.map(e => { - return - }) - } - ) - : () - } - - { - data.ListSafeCheckCountDepartment ? - data.ListSafeCheckCountDepartment.map((e) => { - return e.listChild?.map((c, i) => { - if (i == 0) { - return ( - - - { - e.listCount?.map(c => { - return - }) - } - - { - c.listCount?.map(k => { - return - }) - } - - ) - } - else { - return ( - - - { - c.listCount?.map(k => { - return - }) - } - - ) - } - }) - }) : ( - - - - ) - } - -
{e}
车间名称巡回检查例行检查 专业检查综合检查班组名称巡回检查例行检查专业检查综合检查
{e.DepartmentName}{c}{c.DepartmentName}{k}
{c.DepartmentName}{k}
暂无数据
-
*/} - - - -
-
-
+ + + +
+ + + + + +
+ + ); } } -export default connect(({ login, app }) => ({ login, app }))(BI054HomeDetail) +export default connect(({ login, app }) => ({ login, app }))(BI054HomeDetail); From 93992825ea05d3f961ed04adccee823f1ff9f392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Tue, 21 Jul 2026 15:10:48 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=8F=AD=E7=BB=84=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=94=B9=E4=B8=BA=E8=BF=91=E5=8D=8A=E5=B9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index 9096fa0..bf8d62d 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -1348,7 +1348,7 @@ class Home extends React.Component { } else if (formCode == 'BI055_HOMEDETAIL') { titleTemp += '月度隐患整改情况(近12月)'; } else if (formCode == 'BI001_HOMEDETAIL') { - titleTemp += '班组活动任务完成详情(近12月)'; + titleTemp += '班组活动任务完成详情(近半年)'; } else if (formCode == 'BI002_HOMEDETAIL') { titleTemp += '工作票完成详情(近12月)'; } else if (formCode == 'BI013_RISKANALYSISMODEL') { From 78f15fccca6d032cc01817eef5232c6b4d4c396c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Fri, 24 Jul 2026 18:00:33 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=BB=A9=E6=95=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/BI/BI001HomeDetail.js | 3 ++- .../CustomPages/BI/BI009FormRunAnalysis.js | 14 ++++++++++++-- .../CustomPages/BI/BI012FormRunAnalysis.js | 6 +++--- .../CustomPages/BI/BI064FormRunAnalysis.js | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/CustomPages/BI/BI001HomeDetail.js b/src/components/CustomPages/BI/BI001HomeDetail.js index a913609..5cbd6c8 100644 --- a/src/components/CustomPages/BI/BI001HomeDetail.js +++ b/src/components/CustomPages/BI/BI001HomeDetail.js @@ -217,9 +217,10 @@ class BI001HomeDetail extends React.Component { }; //矿山 chart1 = (mineType) => { - let json = initFilter(this.props.login.OrgId, mineType); + // let json = initFilter(this.props.login.OrgId, mineType); // extendRule(json, 'DEPARTMENT_NAME', 1, "矿山部"); // extendOrder(json, "MONTH", 0); + let json = initFilter(this.props.login.OrgId); this.props.dispatch({ type: "app/getDataByPost", url: "BI/BIStatiscialAnalysisController/GetClassCompletionSort", diff --git a/src/components/CustomPages/BI/BI009FormRunAnalysis.js b/src/components/CustomPages/BI/BI009FormRunAnalysis.js index 15c90f2..1ccc689 100644 --- a/src/components/CustomPages/BI/BI009FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI009FormRunAnalysis.js @@ -311,9 +311,18 @@ class BI009FormRunAnalysis extends React.Component { //获取数据 getBaseInfoData = () => { - let json = initFilter(this.props.login.OrgId, "", "DEPARTMENT_NAME", "asc"); 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( + this.props.login.OrgId, + "", + "DEPARTMENT_NAME", + "asc", + "", + "", + startTime, + endTime + ); // 使用 let span = this.getDiffDay(startTime, endTime); if (span <= 7) { @@ -329,12 +338,13 @@ class BI009FormRunAnalysis extends React.Component { } else { extendRule(json, "FILTER_TIME", 1, 0); } + // extendRule(json, "DEPARTMENT_NAME", 2, "宁化行洛坑钨矿有限公司"); // extendRule(json, "DEPARTMENT_NAME", 2, "都昌金鼎钨钼矿业有限公司"); // extendRule(json, "DEPARTMENT_NAME", 2, "技术管理部"); this.props.dispatch({ type: "app/getDataByPost", - url: "BI/SafetaskFinish/OrderEntities", + url: "BI/BIStatiscialAnalysisController/GetSafeEntities", payload: json, onlyData: false, onComplete: (ret) => { diff --git a/src/components/CustomPages/BI/BI012FormRunAnalysis.js b/src/components/CustomPages/BI/BI012FormRunAnalysis.js index fcefa63..805f369 100644 --- a/src/components/CustomPages/BI/BI012FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI012FormRunAnalysis.js @@ -573,7 +573,7 @@ class BI012FormRunAnalysis extends React.Component { > 选择部门: { + data={this.state.departData} onSelect={this.onSelectDepartment} value = {this.props.login.user?.Nav_Department?.NAME} onFilter={({ params }) => { params.OrderType = 1 params.OrgId = this.state.departData ? this.state.departData.ORG_ID : this.props.login.OrgId // extendRule(params, 'DEPARTMENT_TYPE', 1, 0) @@ -592,7 +592,7 @@ class BI012FormRunAnalysis extends React.Component { { inputDataApi={'FM/Organization/OrderPaged'} fieldName={'NAME'} data={this.state.depart} + value = {this.state.inputText} onSelect={this.handleSearch} onFilter={({ params }) => { params.OrderType = 1; From 77da115023b59c9d995589a6842155d05025d356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Fri, 24 Jul 2026 18:08:30 +0800 Subject: [PATCH 4/5] 1 --- src/components/CustomPages/BI/BI001HomeDetail.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/CustomPages/BI/BI001HomeDetail.js b/src/components/CustomPages/BI/BI001HomeDetail.js index 5cbd6c8..b76cbf2 100644 --- a/src/components/CustomPages/BI/BI001HomeDetail.js +++ b/src/components/CustomPages/BI/BI001HomeDetail.js @@ -220,7 +220,15 @@ class BI001HomeDetail extends React.Component { // let json = initFilter(this.props.login.OrgId, mineType); // extendRule(json, 'DEPARTMENT_NAME', 1, "矿山部"); // extendOrder(json, "MONTH", 0); - let json = initFilter(this.props.login.OrgId); + // let json = initFilter(this.props.login.OrgId); + let json = initFilter( + this.props.login.OrgId, + "", + "NUM", + "asc", + "", + 8 + ); this.props.dispatch({ type: "app/getDataByPost", url: "BI/BIStatiscialAnalysisController/GetClassCompletionSort", From 095a8ee8f9a9d44a15cb3d3a841e6afb1853f83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Mon, 27 Jul 2026 14:48:29 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI009FormRunAnalysis.js | 58 ++++++++++++------- .../CustomPages/BI/BI012FormRunAnalysis.js | 8 ++- .../CustomPages/BI/BI064FormRunAnalysis.js | 32 +++++++--- 3 files changed, 67 insertions(+), 31 deletions(-) diff --git a/src/components/CustomPages/BI/BI009FormRunAnalysis.js b/src/components/CustomPages/BI/BI009FormRunAnalysis.js index 1ccc689..e833ad0 100644 --- a/src/components/CustomPages/BI/BI009FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI009FormRunAnalysis.js @@ -356,11 +356,18 @@ class BI009FormRunAnalysis extends React.Component { }; getCount = () => { var orgId = this.props.login ? this.props.login.OrgId : ""; - const jsonTemp = initFilter(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"); - extendRule(jsonTemp, "CREATE_TIME", 6, startTime); - extendRule(jsonTemp, "CREATE_TIME", 4, endTime); + const jsonTemp = initFilter(orgId ,"", + "", + "", + "", + "", + startTime, + endTime); + // extendRule(jsonTemp, "CREATE_TIME", 6, startTime); + // extendRule(jsonTemp, "CREATE_TIME", 4, endTime); this.props.dispatch({ type: "app/getDataByPost", payload: jsonTemp, @@ -414,7 +421,7 @@ class BI009FormRunAnalysis extends React.Component { data: [ { //上层圆环,显示数据 - value: 95, + value: ret.shiftMeetingFinishRate, itemStyle: { color: "#1598FF", }, @@ -477,7 +484,7 @@ class BI009FormRunAnalysis extends React.Component { }, detail: { formatter: function (params) { - return 95 + "%"; + return ret.shiftMeetingFinishRate + "%"; }, color: "#1598FF", fontSize: 20, @@ -488,7 +495,7 @@ class BI009FormRunAnalysis extends React.Component { }, data: [ { - value: 95, + value: ret.shiftMeetingFinishRate, }, ], }, @@ -643,7 +650,7 @@ class BI009FormRunAnalysis extends React.Component { data: [ { //上层圆环,显示数据 - value: 97, + value: ret.postFinishRate, itemStyle: { color: "#f8a035", }, @@ -706,7 +713,7 @@ class BI009FormRunAnalysis extends React.Component { }, detail: { formatter: function (params) { - return 97 + "%"; + return ret.postFinishRate + "%"; }, color: "#f8a035", fontSize: 20, @@ -717,7 +724,7 @@ class BI009FormRunAnalysis extends React.Component { }, data: [ { - value: 97, + value: ret.postFinishRate, }, ], }, @@ -872,7 +879,7 @@ class BI009FormRunAnalysis extends React.Component { data: [ { //上层圆环,显示数据 - value: 99, + value: ret.postChangeFinishRate, itemStyle: { color: "#f1516d", }, @@ -935,7 +942,7 @@ class BI009FormRunAnalysis extends React.Component { }, detail: { formatter: function (params) { - return 99 + "%"; + return ret.postChangeFinishRate + "%"; }, color: "#f1516d", fontSize: 20, @@ -946,7 +953,7 @@ class BI009FormRunAnalysis extends React.Component { }, data: [ { - value: 99, + value: ret.postChangeFinishRate, }, ], }, @@ -1073,8 +1080,8 @@ class BI009FormRunAnalysis extends React.Component { let json = initFilter( this.props.login.OrgId, "10", - "NUM", - "asc", + "", + "", "", 8, startTime, @@ -1236,8 +1243,8 @@ class BI009FormRunAnalysis extends React.Component { let json = initFilter( this.props.login.OrgId, "30", - "NUM", - "asc", + "", + "", "", 8, startTime, @@ -1395,11 +1402,18 @@ class BI009FormRunAnalysis extends React.Component { }; //关键许可工作票(饼图) mainJobPie2 = () => { - let json = initFilter(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"); - extendRule(json, "CREATE_TIME", 6, startTime); - extendRule(json, "CREATE_TIME", 4, endTime); + // extendRule(json, "CREATE_TIME", 6, startTime); + // extendRule(json, "CREATE_TIME", 4, endTime); + let json = initFilter(this.props.login.OrgId, "", + "", + "", + "", + "", + startTime, + endTime); this.props.dispatch({ type: "app/getDataByPost", url: "BI/BIStatiscialAnalysisController/GetLicenseJob", @@ -1409,7 +1423,7 @@ class BI009FormRunAnalysis extends React.Component { if (data && data.IsSuccessful) { let riskLevel = []; let showData = []; - let color = ["#C00000", "#FFC000", "#006600", "#00B0F0", "#00B0C0"]; + let color = ["#C00000", "#FFC000", "#006600", "#00B0F0", "#00B0C0", "#8FBC8F", "#778899"]; let numAll = 0; data.Data.forEach((item) => { riskLevel.push(item.RISK_LEVEL); @@ -1499,9 +1513,9 @@ class BI009FormRunAnalysis extends React.Component { //图形样式 normal: { borderColor: "#ffffff", - borderWidth: 4, + borderWidth: 0,//1 padding: "0 20px", - borderRadius: 50, + borderRadius: 0,//8 }, }, label: { diff --git a/src/components/CustomPages/BI/BI012FormRunAnalysis.js b/src/components/CustomPages/BI/BI012FormRunAnalysis.js index 805f369..197bb7e 100644 --- a/src/components/CustomPages/BI/BI012FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI012FormRunAnalysis.js @@ -54,6 +54,7 @@ class BI012FormRunAnalysis extends React.Component { yearColor: "black", retData: [], departData:[], + selectDeptName: this.props.login.user?.Nav_Department?.NAME || '', DEPARTMENT_ID:null, displayHr: "none", displaydetail: "none", @@ -236,6 +237,7 @@ class BI012FormRunAnalysis extends React.Component { Nav_Department: { NAME: departData.record.NAME } }, DEPARTMENT_ID: departData.data[0], + selectDeptName: departData.record.NAME }) if(!this.state.inputText) { @@ -250,6 +252,7 @@ class BI012FormRunAnalysis extends React.Component { Nav_Department: { NAME: null }, }, DEPARTMENT_ID: null, + selectDeptName: "" }) }; } @@ -573,7 +576,10 @@ class BI012FormRunAnalysis extends React.Component { > 选择部门: { + data={this.state.departData} onSelect={this.onSelectDepartment} value = {this.state.selectDeptName} + allowClear={true} // 【关键】开启清除按钮 + showSearch={true} // 可选:支持输入框编辑搜索 + onFilter={({ params }) => { params.OrderType = 1 params.OrgId = this.state.departData ? this.state.departData.ORG_ID : this.props.login.OrgId // extendRule(params, 'DEPARTMENT_TYPE', 1, 0) diff --git a/src/components/CustomPages/BI/BI064FormRunAnalysis.js b/src/components/CustomPages/BI/BI064FormRunAnalysis.js index edcef3d..423f26e 100644 --- a/src/components/CustomPages/BI/BI064FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI064FormRunAnalysis.js @@ -127,14 +127,28 @@ getEndDate=()=>{ this.getBaseData(); }; handleSearch = ({ data, record }) => { - this.setState({ - depart: { - ...this.state.depart, - ID: data[0], - NAME: record?.NAME, - }, - inputText: record ? record?.NAME : this.state.inputText, - }); + if(record) + { + this.setState({ + depart: { + ...this.state.depart, + ID: data[0], + NAME: record?.NAME, + }, + inputText: record ? record?.NAME : this.state.inputText, + }); + } + else + { + this.setState({ + depart: { + ...this.state.depart, + ID: null, + NAME: "", + }, + inputText:"", + }); + } }; handleSearch2 = (value) => { let temps = ['安全风险辨识与评估计划','安全风险辨识表', '安全风险辨识结果表', '安全风险辨识结果汇总表', '安全风险评估表', @@ -614,6 +628,8 @@ getEndDate=()=>{ data={this.state.depart} value = {this.state.inputText} onSelect={this.handleSearch} + allowClear={true} // 【关键】开启清除按钮 + showSearch={true} // 可选:支持输入框编辑搜索 onFilter={({ params }) => { params.OrderType = 1; params.OrgId = this.props.login.OrgId;