From fa569a579b791723b3bdde86d02dab7ee29e09b9 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Tue, 16 Apr 2024 13:47:33 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/routes/Home.js b/src/routes/Home.js index 583ba5a..043c39f 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -257,6 +257,43 @@ class Home extends React.Component { // return retrundate; // }; + showTodayModal = ( + dataId, + formCode, + TaskID, + title, + taskCode, + taskStartdt, + taskStatus + ) => { + const newtmpData = { + data: { + id: dataId, + TaskID: TaskID, + onCancel: this.handleCancel, + taskCode: taskCode, + tableKey: this.state.tableKey, + noticeTitle: title, + taskStartdt: taskStartdt, + taskStatus: taskStatus, + homeReload: true, + }, + formCode: "PF135", + }; + this.setState( + { + noticeTitle: "今日提醒", + taskCode: taskCode, + tmpData: newtmpData, + currActivatedMenu: "", + }, + () => + this.setState({ + formVisible: true, + }) + ); + }; + showAll = (key) => { const { tableData } = this.state; @@ -508,7 +545,7 @@ class Home extends React.Component { }; handleCancel = () => { // 退出弹窗 - this.getBaseData(1, this.state.tableKey, 5); + // this.getBaseData(1, this.state.tableKey, 5); this.clearData(); }; closeModal = () => { From 6451bbfd05c8ae4ba17b422719b75bfdedfcd014 Mon Sep 17 00:00:00 2001 From: wjn Date: Tue, 16 Apr 2024 14:31:26 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/HM/HM042ShowPrint.js | 1 - src/components/CustomPages/SE/SE018PaperPage.js | 2 +- src/components/CustomPages/SE/SESafeSurveyTest.js | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/CustomPages/HM/HM042ShowPrint.js b/src/components/CustomPages/HM/HM042ShowPrint.js index ec027b7..ea07c2b 100644 --- a/src/components/CustomPages/HM/HM042ShowPrint.js +++ b/src/components/CustomPages/HM/HM042ShowPrint.js @@ -112,7 +112,6 @@ class HM042ShowPrint extends React.Component { this.state.isAudit = "inline"; } this.setState({ data: ret }) - this.state.data.Nav_Details = this.removeDuplicateObj(this.state.data.Nav_Details); if (ret.ID) { this.props.dispatch({ type: 'app/getDataByPost', diff --git a/src/components/CustomPages/SE/SE018PaperPage.js b/src/components/CustomPages/SE/SE018PaperPage.js index 4613b96..383d6bc 100644 --- a/src/components/CustomPages/SE/SE018PaperPage.js +++ b/src/components/CustomPages/SE/SE018PaperPage.js @@ -482,7 +482,7 @@ class SE018PaperPage extends React.Component { } { - it.Nav_Test.TYPE !== 0 && + it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_D != "" && it.Nav_Test.OPTION_D != undefined && { diff --git a/src/components/CustomPages/SE/SESafeSurveyTest.js b/src/components/CustomPages/SE/SESafeSurveyTest.js index b379c28..7089df9 100644 --- a/src/components/CustomPages/SE/SESafeSurveyTest.js +++ b/src/components/CustomPages/SE/SESafeSurveyTest.js @@ -128,7 +128,7 @@ class SESafeSurveyTest extends React.Component { NAME = ret.Nav_Papers[0].Nav_Safe.NAME; END_TIME = ret.Nav_Papers[0].Nav_Safe.END_TIME; } - if (moment().format("YYYY-MM-DD HH:mm:ss") > END_TIME) { + if (moment().format("YYYY-MM-DD HH:mm:ss") < END_TIME) { message.error('已过答题截止时间!'); this.props.dispatch({ type: 'app/getDataByPost', @@ -457,7 +457,7 @@ class SESafeSurveyTest extends React.Component { } { - it.Nav_Test.TYPE !== 0 && + it.Nav_Test.TYPE !== 0 && it.Nav_Test.OPTION_D != "" && it.Nav_Test.OPTION_D != undefined && { From 77c90278fa778dbc62bef2a72b0fcfdea9df5097 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Thu, 18 Apr 2024 14:10:11 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=8E=B0=E5=9C=BA?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=AE=8C=E6=88=90=E6=8A=A5=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=BB=9F=E8=AE=A1=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/BI001.js | 921 ++++++--- .../CustomPages/BI/BI005LoginRecord.js | 1657 ++++++++--------- 2 files changed, 1357 insertions(+), 1221 deletions(-) diff --git a/src/components/CustomPages/BI/BI001.js b/src/components/CustomPages/BI/BI001.js index 79869e7..b8cf74a 100644 --- a/src/components/CustomPages/BI/BI001.js +++ b/src/components/CustomPages/BI/BI001.js @@ -1,9 +1,18 @@ -import React, { useState, useEffect, useRef, Component } from 'react' -import { connect } from 'dva' -import { initFilter, addRuleAndGroups, guid, extendInclude, extendRule, extendOrder, extend } from "../../../utils/common" -import { Table, Row, Col, Button, Select } from 'antd'; -import echarts from 'echarts'; -import moment from 'moment' +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { + initFilter, + addRuleAndGroups, + guid, + extendInclude, + extendRule, + extendOrder, + extend, +} from "../../../utils/common"; +import { Table, Row, Col, Button, Select, Divider } from "antd"; +import echarts from "echarts"; +import styles from "../HI/StepForm1.css"; +import moment from "moment"; const { Option } = Select; class BI001 extends React.Component { constructor(props) { @@ -20,7 +29,7 @@ class BI001 extends React.Component { timeRange: "", departmentType: "", }; - }; + } componentDidMount() { if (this.props.app.currActivatedMenu.NAME == "现场任务完成分析(矿山部)") { @@ -30,245 +39,329 @@ class BI001 extends React.Component { } this.state.columns1 = [ { - title: '班组名称', - dataIndex: 'Nav_Team.NAME', + title: "班组名称", + dataIndex: "Nav_Team.NAME", }, { - title: '负责人', - dataIndex: 'Nav_Team.Nav_ChargePerson.NAME', + title: "负责人", + dataIndex: "Nav_Team.Nav_ChargePerson.NAME", }, { - title: '班前会议', + title: "班前会议", children: [ { - title: '总记录数', - dataIndex: 'FO01_TOTAL', + title: "总记录数", + dataIndex: "FO01_TOTAL", }, { - title: '正常已办', - dataIndex: 'FO01_FINISH', + title: "正常已办", + dataIndex: "FO01_FINISH", }, { - title: '未完成', - dataIndex: 'FO01_UNFINISH', + title: "未完成", + dataIndex: "FO01_UNFINISH", }, { - title: '超时已办', - dataIndex: 'FO01_OVERTIME', + title: "超时已办", + dataIndex: "FO01_OVERTIME", }, { - title: '完成率', - render: (text, record) => ({(((record.FO01_FINISH +record.FO01_OVERTIME)/ record.FO01_TOTAL)*100).toFixed(0)+"%"}) + title: "完成率", + render: (text, record) => ( + + {( + ((record.FO01_FINISH + record.FO01_OVERTIME) / + record.FO01_TOTAL) * + 100 + ).toFixed(0) + "%"} + + ), }, { - title: '完成及时率', - render: (text, record) => ({((record.FO01_FINISH / record.FO01_TOTAL)*100).toFixed(0)+"%"}) + title: "完成及时率", + render: (text, record) => ( + + {((record.FO01_FINISH / record.FO01_TOTAL) * 100).toFixed(0) + + "%"} + + ), }, - ], }, { - title: '当班工作记录', + title: "当班工作记录", children: [ { - title: '总记录数', - dataIndex: 'FO02_TOTAL', + title: "总记录数", + dataIndex: "FO02_TOTAL", }, { - title: '正常已办', - dataIndex: 'FO02_FINISH', + title: "正常已办", + dataIndex: "FO02_FINISH", }, { - title: '未完成', - dataIndex: 'FO02_UNFINISH', + title: "未完成", + dataIndex: "FO02_UNFINISH", }, { - title: '超时已办', - dataIndex: 'FO02_OVERTIME', + title: "超时已办", + dataIndex: "FO02_OVERTIME", }, { - title: '完成率', - render: (text, record) => ({(((record.FO02_FINISH +record.FO02_OVERTIME)/ record.FO02_TOTAL)*100).toFixed(0)+"%"}) + title: "完成率", + render: (text, record) => ( + + {( + ((record.FO02_FINISH + record.FO02_OVERTIME) / + record.FO02_TOTAL) * + 100 + ).toFixed(0) + "%"} + + ), }, { - title: '完成及时率', - render: (text, record) => ({((record.FO02_FINISH / record.FO02_TOTAL)*100).toFixed(0)+"%"}) + title: "完成及时率", + render: (text, record) => ( + + {((record.FO02_FINISH / record.FO02_TOTAL) * 100).toFixed(0) + + "%"} + + ), }, ], }, - ] + ]; this.state.columns2 = [ { - title: '班组名称', - dataIndex: 'Nav_Team.NAME', + title: "班组名称", + dataIndex: "Nav_Team.NAME", }, { - title: '负责人', - dataIndex: 'Nav_Team.Nav_ChargePerson.NAME', + title: "负责人", + dataIndex: "Nav_Team.Nav_ChargePerson.NAME", }, { - title: '岗位交接班', + title: "岗位交接班", children: [ { - title: '总记录数', - dataIndex: 'FO03_TOTAL', + title: "总记录数", + dataIndex: "FO03_TOTAL", }, { - title: '正常已办', - dataIndex: 'FO03_FINISH', + title: "正常已办", + dataIndex: "FO03_FINISH", }, { - title: '未完成', - dataIndex: 'FO03_UNFINISH', + title: "未完成", + dataIndex: "FO03_UNFINISH", }, { - title: '超时已办', - dataIndex: 'FO03_OVERTIME', + title: "超时已办", + dataIndex: "FO03_OVERTIME", }, { - title: '完成率', - render: (text, record) => ({(((record.FO03_FINISH +record.FO03_OVERTIME)/ record.FO03_TOTAL)*100).toFixed(0)+"%"}) + title: "完成率", + render: (text, record) => ( + + {( + ((record.FO03_FINISH + record.FO03_OVERTIME) / + record.FO03_TOTAL) * + 100 + ).toFixed(0) + "%"} + + ), }, { - title: '完成及时率', - render: (text, record) => ({((record.FO03_FINISH / record.FO03_TOTAL)*100).toFixed(0)+"%"}) + title: "完成及时率", + render: (text, record) => ( + + {((record.FO03_FINISH / record.FO03_TOTAL) * 100).toFixed(0) + + "%"} + + ), }, ], - }, { - title: '班组安全活动', + }, + { + title: "班组安全活动", children: [ { - title: '总记录数', - dataIndex: 'FO04_TOTAL', + title: "总记录数", + dataIndex: "FO04_TOTAL", }, { - title: '正常已办', - dataIndex: 'FO04_FINISH', + title: "正常已办", + dataIndex: "FO04_FINISH", }, { - title: '未完成', - dataIndex: 'FO04_UNFINISH', + title: "未完成", + dataIndex: "FO04_UNFINISH", }, { - title: '超时已办', - dataIndex: 'FO04_OVERTIME', + title: "超时已办", + dataIndex: "FO04_OVERTIME", }, { - title: '完成率', - render: (text, record) => ({(((record.FO04_FINISH +record.FO04_OVERTIME)/ record.FO04_TOTAL)*100).toFixed(0)+"%"}) + title: "完成率", + render: (text, record) => ( + + {( + ((record.FO04_FINISH + record.FO04_OVERTIME) / + record.FO04_TOTAL) * + 100 + ).toFixed(0) + "%"} + + ), }, { - title: '完成及时率', - render: (text, record) => ({((record.FO04_FINISH / record.FO04_TOTAL)*100).toFixed(0)+"%"}) + title: "完成及时率", + render: (text, record) => ( + + {((record.FO04_FINISH / record.FO04_TOTAL) * 100).toFixed(0) + + "%"} + + ), }, ], - } - ] + }, + ]; this.getBaseInfoData(); - - }; + } handleChange = (value) => { this.state.departmentType = value; this.getBaseInfoData(); - } + }; handleClick = (value) => { this.state.filterType = value; this.getBaseInfoData(); - } + }; chart1 = (data) => { if (data && data.IsSuccessful) { let teamName = []; let totalQty = []; - data.Data.forEach(item => { + data.Data.forEach((item) => { teamName.push(item.Nav_Team.NAME); - let totalTemp = item.FO01_TOTAL + item.FO02_TOTAL + item.FO03_TOTAL + item.FO04_TOTAL; + let totalTemp = + item.FO01_TOTAL + item.FO02_TOTAL + item.FO03_TOTAL + item.FO04_TOTAL; totalQty.push(totalTemp); - }) - let chart1s = document.getElementById('chart1'); + }); + let chart1s = document.getElementById("chart1"); if (chart1s) { let myChart = echarts.init(chart1s); myChart.setOption({ + title: { + text: "总任务数", + x: "center", + top: "2%", + }, tooltip: { - trigger: 'axis', + trigger: "axis", axisPointer: { - type: 'shadow' + type: "shadow", }, }, grid: { - left: '3%', - right: '4%', - top: '10%', - bottom: '10%', - containLabel: true + left: "3%", + right: "4%", + top: "10%", + bottom: "10%", + containLabel: true, }, xAxis: { - type: 'value', - splitLine: { - show: false, - lineStyle: { - color: '#172749' - } - }, - axisLine: { - show: false - }, - axisTick: { - show: false - }, - axisLabel: { + show: false, + }, + yAxis: [ + { + triggerEvent: true, show: true, - interval: 0, - formatter: '{value}', // 给每个数值添加% + inverse: false, + data: teamName, + 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, + }, + }, + }, }, - }, - legend: { - data: ['完成率', '未完成'], - bottom: '00px' - }, - yAxis: { - type: 'category', - axisTick: { - show: false + { + triggerEvent: true, + show: true, + inverse: false, + data: totalQty, + axisLine: { + show: false, + }, + splitLine: { + show: false, + }, + axisTick: { + show: false, + }, + axisLabel: { + interval: 0, + color: "#666", + align: "left", + margin: 20, + fontSize: 12, + }, }, - axisLine: { - show: false - }, - splitLine: { - show: false, - lineStyle: { - color: '#172749' - } - }, - data: teamName, - }, + ], series: [ { - name: '总任务数', - type: 'bar', - stack: '总量', - label: { - show: true, - position: 'inside', - color: '#fff', - formatter: '{c}', - fontSize: '12' - }, + name: "总任务数", + type: "bar", + barWidth: 10, itemStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "#01AEF6" }, - { offset: 1, color: "#9999FF" },//rgba(16,36,95,0.6) - ]), + color: "#1990FF", + barBorderRadius: 30, }, data: totalQty, - show: false - + show: false, }, ], }); } } - - } + }; //隐患整改完成情况统计图 chart2 = (data) => { @@ -278,166 +371,209 @@ class BI001 extends React.Component { let overFinishQty = []; let totalQty = []; let dataList = []; - data.Data.forEach(item => { + data.Data.forEach((item) => { teamName.push(item.Nav_Team.NAME); - wattingQty.push(item.FO01_UNFINISH+item.FO02_UNFINISH+item.FO03_UNFINISH+item.FO04_UNFINISH); - finishQty.push(item.FO01_FINISH + item.FO02_FINISH + item.FO03_FINISH + item.FO04_FINISH); - overFinishQty.push(item.FO01_OVERTIME+item.FO02_OVERTIME+item.FO03_OVERTIME+item.FO04_OVERTIME); - totalQty.push(item.FO01_TOTAL + item.FO02_TOTAL + item.FO03_TOTAL + item.FO04_TOTAL); - dataList.push({ value: item.FO01_FINISH + item.FO02_FINISH + item.FO03_FINISH + item.FO04_FINISH, name: item.Nav_Team.NAME }) - }) + wattingQty.push( + item.FO01_UNFINISH + + item.FO02_UNFINISH + + item.FO03_UNFINISH + + item.FO04_UNFINISH + ); + finishQty.push( + item.FO01_FINISH + + item.FO02_FINISH + + item.FO03_FINISH + + item.FO04_FINISH + ); + overFinishQty.push( + item.FO01_OVERTIME + + item.FO02_OVERTIME + + item.FO03_OVERTIME + + item.FO04_OVERTIME + ); + totalQty.push( + item.FO01_TOTAL + item.FO02_TOTAL + item.FO03_TOTAL + item.FO04_TOTAL + ); + dataList.push({ + value: + item.FO01_FINISH + + item.FO02_FINISH + + item.FO03_FINISH + + item.FO04_FINISH, + name: item.Nav_Team.NAME, + }); + }); //图标2 - let chart2s = document.getElementById('chart2'); + let chart2s = document.getElementById("chart2"); if (chart2s) { let myChart = echarts.init(chart2s); myChart.setOption({ + color: ["#4285F4", "#72b85b", "#c92a2a", "#ffa94d"], + title: { + text: "完成及时率统计", + x: "center", + top: "2%", + }, + + legend: { + orient: "vertical", + x: "left", + data: ["总数", "正常已办", "超时已办"], + itemWidth: 10, + itemHeight: 10, + textStyle: { + color: "#000", + }, + }, tooltip: { - trigger: 'axis', - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + trigger: "axis", + axisPointer: { + // 坐标轴指示器,坐标轴触发有效 + type: "shadow", // 默认为直线,可选为:'line' | 'shadow' }, }, grid: { - left: '3%', - right: '4%', - top: '10%', - bottom: '10%', - containLabel: true + left: "3%", + right: "4%", + top: "10%", + bottom: "10%", + containLabel: true, }, xAxis: { - type: 'category', + type: "category", data: teamName, axisLine: { - show: false, - }, - axisTick: { - show: false + lineStyle: { + color: "#0c3b71", + }, }, axisLabel: { - color: '#000', + show: true, + color: "rgb(170,170,170)", + interval: 0, + textStyle: { + lineHeight: 14, + }, rotate: 40, - formatter: function (value) { // 自定义文字超出部分 ... + formatter: function (value) { + // 自定义文字超出部分 ... if (value.length > 5) { return `${value.slice(0, 5)}...`; } return value; - } - } + }, + }, }, legend: { - data: ['正常已办', '超时已办'], - bottom: '0px' + data: ["正常已办", "超时已办"], + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, }, yAxis: { - type: 'value', + type: "value", splitLine: { - show: false, + show: true, lineStyle: { - color: '#172749' - } + color: ["#f2f2f2"], + }, }, axisLine: { - show: false, + lineStyle: { + color: "#0c3b71", + }, }, - axisTick: { - show: false + axisLabel: { + color: "rgb(170,170,170)", + formatter: "{value} ", }, }, series: [ { - name: '总数', - type: 'bar', - stack: '', - label: { - show: true, - position: 'top', - color: '#000', - }, + name: "总数", + type: "bar", + stack: "", data: totalQty, + barWidth: "60%", barGap: '-100%', z: -1, - itemStyle: { - normal: { - color: '#CCCCCC'//rgba(128, 128, 128, 0.3) - } - }, + }, { - name: '正常已办', - type: 'bar', - stack: '总量', - label: { - show: true, - position: 'inside', - color: '#000', - }, - emphasis: {//折线图的高亮状态。 - focus: "series",//聚焦当前高亮的数据所在的系列的所有图形。 - }, + name: "正常已办", + type: "bar", + stack: "总量", + barWidth: "60%", data: finishQty, barGap: '-100%', z: -1, - itemStyle: { - // 渐变色 1、指明颜色渐变的方向 2、指明不同百分比之下颜色的值 - color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "#99FF99" },//rgba(128,255,128) - { offset: 1, color: "#333366" },//rgba(16,36,95,0.6) - ]), - }, }, { - name: '超时已办', - type: 'bar', - stack: '总量', - label: { - show: true, - position: 'inside', - color: '#000', - }, - emphasis: {//折线图的高亮状态。 - focus: "series",//聚焦当前高亮的数据所在的系列的所有图形。 - }, + name: "超时已办", + type: "bar", + stack: "总量", + barWidth: "60%", data: overFinishQty, barGap: '-100%', z: -1, - itemStyle: { - // 渐变色 1、指明颜色渐变的方向 2、指明不同百分比之下颜色的值 - color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ - { offset: 0, color: "#ED7D31" }, - { offset: 1, color: "#FFFF33" },//rgba(255,255,0,0.6) - ]), - }, }, ], }); } - - } + }; //获取数据 getBaseInfoData = () => { - const json = initFilter(this.props.login.OrgId) + const json = initFilter(this.props.login.OrgId); extendRule(json, "FILTER_TIME", 1, this.state.filterType); extendRule(json, "DEPARTMENT_NAME", 1, this.state.departmentType); - extendInclude(json, 'Nav_Team.Nav_ChargePerson') + extendInclude(json, "Nav_Team.Nav_ChargePerson"); extendOrder(json, "Nav_Team.NAME", 0); this.props.dispatch({ - type: 'app/getDataByPost', - url: 'BI/SafetaskFinish/OrderEntities', + type: "app/getDataByPost", + url: "BI/SafetaskFinish/OrderEntities", payload: json, onlyData: false, onComplete: (ret) => { - this.state.timeRange = moment(ret.Data[0].STARTTIME).format("YYYY-MM-DD") + "~" + moment(ret.Data[0].ENDTIME).format("YYYY-MM-DD"); + this.state.timeRange = + moment(ret.Data[0].STARTTIME).format("YYYY-MM-DD") + + "~" + + moment(ret.Data[0].ENDTIME).format("YYYY-MM-DD"); this.state.retData = ret.Data; let t1 = 0; let t2 = 0; let t3 = 0; let t4 = 0; for (let i = 0; i < ret.Data.length; i++) { - t1 = t1 + ret.Data[i].FO01_TOTAL + ret.Data[i].FO02_TOTAL + ret.Data[i].FO03_TOTAL + ret.Data[i].FO04_TOTAL; - t2 = t2 + ret.Data[i].FO01_FINISH + ret.Data[i].FO02_FINISH + ret.Data[i].FO03_FINISH + ret.Data[i].FO04_FINISH; - t3 = t2 + ret.Data[i].FO01_UNFINISH + ret.Data[i].FO02_UNFINISH + ret.Data[i].FO03_UNFINISH + ret.Data[i].FO04_UNFINISH; - t4 = t2 + ret.Data[i].FO01_OVERTIME + ret.Data[i].FO02_OVERTIME + ret.Data[i].FO03_OVERTIME + ret.Data[i].FO04_OVERTIME; + t1 = + t1 + + ret.Data[i].FO01_TOTAL + + ret.Data[i].FO02_TOTAL + + ret.Data[i].FO03_TOTAL + + ret.Data[i].FO04_TOTAL; + t2 = + t2 + + ret.Data[i].FO01_FINISH + + ret.Data[i].FO02_FINISH + + ret.Data[i].FO03_FINISH + + ret.Data[i].FO04_FINISH; + t3 = + t2 + + ret.Data[i].FO01_UNFINISH + + ret.Data[i].FO02_UNFINISH + + ret.Data[i].FO03_UNFINISH + + ret.Data[i].FO04_UNFINISH; + t4 = + t2 + + ret.Data[i].FO01_OVERTIME + + ret.Data[i].FO02_OVERTIME + + ret.Data[i].FO03_OVERTIME + + ret.Data[i].FO04_OVERTIME; } this.state.totalCount = t1; this.state.finishCount = t2; @@ -445,55 +581,236 @@ class BI001 extends React.Component { this.state.unfinishCount = t4; this.chart1(ret); this.chart2(ret); - } - }) + }, + }); }; render() { return ( -
-

{this.state.departmentType} 现场任务执行情况综合统计分析
{this.state.timeRange}

- - - - - - - - - - - - - - - - - {/* 班组作业完成率TOP */} - -
-
总任务数 -
-
-
- - {/* 隐患整改情况 */} - -
-
完成及时率统计 -
-
-
- +
+

+ {this.state.departmentType} 现场任务执行情况综合统计分析 +
+ {this.state.timeRange} +

+ + + + + + + + + + - {/* 列表 */} - +
+
+
  • + 总任务数 +
    +
    {this.state.totalCount}
    +
  • + +
  • + 正常已办数 +
    +
    {this.state.finishCount}
    +
  • + +
  • + 超时完成数 +
    +
    + {this.state.overtimeCount} +
    +
  • + +
  • + 未完成数 +
    +
    + {this.state.unfinishCount} +
    + {/* */} + {/* */} +
  • +
    +
    - -
    - +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    - - + + + - - -
    -
    +
    +
    +
    +
    - - + + + - - ) + ); } } -export default connect(({ login, app }) => ({ login, app }))(BI001) +export default connect(({ login, app }) => ({ login, app }))(BI001); diff --git a/src/components/CustomPages/BI/BI005LoginRecord.js b/src/components/CustomPages/BI/BI005LoginRecord.js index a9e7f8e..cd8ad79 100644 --- a/src/components/CustomPages/BI/BI005LoginRecord.js +++ b/src/components/CustomPages/BI/BI005LoginRecord.js @@ -1,9 +1,28 @@ -import React, { useState, useEffect, useRef, Component } from 'react' -import { connect } from 'dva' -import { initFilter, addRuleAndGroups, guid, extendInclude, extendRule, extendOrder, extend, initQueryFilter } from "../../../utils/common" -import { Table, Row, Col, Button, Select, DatePicker, message } from 'antd'; -import echarts from 'echarts'; -import moment from 'moment' +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import { + initFilter, + addRuleAndGroups, + guid, + extendInclude, + extendRule, + extendOrder, + extend, + initQueryFilter, +} from "../../../utils/common"; +import { + Table, + Row, + Col, + Button, + Select, + DatePicker, + message, + Divider, +} from "antd"; +import echarts from "echarts"; +import moment from "moment"; +import styles from "../HI/StepForm1.css"; const { Option } = Select; class BI005LoginRecord extends React.Component { constructor(props) { @@ -13,77 +32,83 @@ class BI005LoginRecord extends React.Component { retData: [], totalUsers: 0, totalActiveUsers: 0, - maxTime: moment().format('YYYY-MM-DD'), - minTime: moment().add(-1, "month").format('YYYY-MM-DD'), - searchMaxTime: moment().add(1, "day").format('YYYY-MM-DD'), - searchMinTime: moment().format('YYYY-MM-DD'), + maxTime: moment().format("YYYY-MM-DD"), + minTime: moment().add(-1, "month").format("YYYY-MM-DD"), + searchMaxTime: moment().add(1, "day").format("YYYY-MM-DD"), + searchMinTime: moment().format("YYYY-MM-DD"), selectUser: "", selectDepartment: "", dates: [], activeNums: [], loginNums: [], todayCount: 0, - showLoading: false + showLoading: false, }; - }; + } componentDidMount() { this.state.columns1 = [ { - title: '序号', - render: (text, record, index) => `${index + 1}` + title: "序号", + render: (text, record, index) => `${index + 1}`, }, { - title: '姓名', - dataIndex: 'Nav_User.NAME', + title: "姓名", + dataIndex: "Nav_User.NAME", }, { - title: '组织', - dataIndex: 'Nav_Department.NAME', + title: "组织", + dataIndex: "Nav_Department.NAME", }, { - title: '登陆时间', - dataIndex: 'CREATE_TIME', + title: "登陆时间", + dataIndex: "CREATE_TIME", }, - ] + ]; const json = initFilter(this.props.login.OrgId); this.props.dispatch({ - type: 'app/getDataByPost', - url: 'BI/BIController/userCount', + type: "app/getDataByPost", + url: "BI/BIController/userCount", payload: json, onlyData: false, onComplete: (ret) => { - this.state.totalUsers = ret.Data + this.state.totalUsers = ret.Data; this.getBaseInfoData(); - } - }) - }; - handleClick = (value) => { - if (moment(this.state.searchMaxTime).diff(this.state.searchMinTime, 'day') >= 7) { - message.error("查询时间请勿大于等于7天"); - return - } - this.getBaseInfoData() + }, + }); } + handleClick = (value) => { + if ( + moment(this.state.searchMaxTime).diff(this.state.searchMinTime, "day") >= + 7 + ) { + message.error("查询时间请勿大于等于7天"); + return; + } + this.getBaseInfoData(); + }; //获取数据 getBaseInfoData = () => { this.state.showLoading = true; - const json2 = initFilter(this.props.login.OrgId) - extendInclude(json2, 'Nav_User') - extendInclude(json2, 'Nav_Department') - extendRule(json2, 'CREATE_TIME', 6, this.state.searchMinTime) - extendRule(json2, 'CREATE_TIME', 4, this.state.searchMaxTime) + const json2 = initFilter(this.props.login.OrgId); + extendInclude(json2, "Nav_User"); + extendInclude(json2, "Nav_Department"); + extendRule(json2, "CREATE_TIME", 6, this.state.searchMinTime); + extendRule(json2, "CREATE_TIME", 4, this.state.searchMaxTime); if (this.state.selectUser != "" && this.state.selectUser != undefined) { - extendRule(json2, 'USER_ID', 1, this.state.selectUser) + extendRule(json2, "USER_ID", 1, this.state.selectUser); } - if (this.state.selectDepartment != "" && this.state.selectDepartment != undefined) { - extendRule(json2, 'DEPARTMENT_ID', 1, this.state.selectDepartment) + if ( + this.state.selectDepartment != "" && + this.state.selectDepartment != undefined + ) { + extendRule(json2, "DEPARTMENT_ID", 1, this.state.selectDepartment); } extendOrder(json2, "CREATE_TIME", 1); json2.Limit = 100; this.props.dispatch({ - type: 'app/getDataByPost', - url: 'BI/LoginRecord/OrderEntities', + type: "app/getDataByPost", + url: "BI/LoginRecord/OrderEntities", payload: json2, onlyData: false, onComplete: (ret) => { @@ -100,18 +125,17 @@ class BI005LoginRecord extends React.Component { this.chart1(this.state.todayCount); this.state.showLoading = false; } - - } - }) + }, + }); }; chart1 = (todayCount) => { - const json1 = initFilter(this.props.login.OrgId) - extendRule(json1, 'DATE', 5, moment().subtract(30, 'days')) + const json1 = initFilter(this.props.login.OrgId); + extendRule(json1, "DATE", 5, moment().subtract(30, "days")); extendOrder(json1, "DATE", 0); json1.Limit = 60; this.props.dispatch({ - type: 'app/getDataByPost', - url: 'BI/ActiveUserRecord/OrderPaged', + type: "app/getDataByPost", + url: "BI/ActiveUserRecord/OrderPaged", payload: json1, onlyData: false, onComplete: (ret) => { @@ -122,1083 +146,824 @@ class BI005LoginRecord extends React.Component { if (ret.Data.length == 0) { ret.Data = [ { - "COUNT": 315, - "DATE": "2024-03-14 00:00:00", - "type": 1, - "ID": "b7670e5a-3ca5-4c86-a639-5961c6d992bb", - + COUNT: 315, + DATE: "2024-03-14 00:00:00", + type: 1, + ID: "b7670e5a-3ca5-4c86-a639-5961c6d992bb", }, { - "COUNT": 197, - "DATE": "2024-03-14 00:00:00", - "type": 0, - "ID": "8d8943ca-2576-4ab1-ad9b-98570d29278f", + COUNT: 197, + DATE: "2024-03-14 00:00:00", + type: 0, + ID: "8d8943ca-2576-4ab1-ad9b-98570d29278f", }, { - "COUNT": 175, - "DATE": "2024-03-15 00:00:00", - "type": 0, - "ID": "d5427cfa-7981-4e31-9669-2ed4b62dc44b", + COUNT: 175, + DATE: "2024-03-15 00:00:00", + type: 0, + ID: "d5427cfa-7981-4e31-9669-2ed4b62dc44b", }, { - "COUNT": 257, - "DATE": "2024-03-15 00:00:00", - "type": 1, - "ID": "422b45a8-51ab-4b74-8107-fbd2f441dfca", + COUNT: 257, + DATE: "2024-03-15 00:00:00", + type: 1, + ID: "422b45a8-51ab-4b74-8107-fbd2f441dfca", }, { - "COUNT": 113, - "DATE": "2024-03-16 00:00:00", - "type": 0, - "ID": "a739f9fd-f380-4bf8-9d66-0e383b6dc147", - - - - - - - - "CREATE_TIME": "2024-03-17 15:54:52", - "MODIFY_TIME": "2024-03-17 15:54:52", - - + COUNT: 113, + DATE: "2024-03-16 00:00:00", + type: 0, + ID: "a739f9fd-f380-4bf8-9d66-0e383b6dc147", + CREATE_TIME: "2024-03-17 15:54:52", + MODIFY_TIME: "2024-03-17 15:54:52", }, { - "COUNT": 178, - "DATE": "2024-03-16 00:00:00", - "type": 1, - "ID": "4f6b0218-5f83-4391-bcda-187216717970", - - - - - - - - "CREATE_TIME": "2024-03-17 15:54:52", - "MODIFY_TIME": "2024-03-17 15:54:52", - - + COUNT: 178, + DATE: "2024-03-16 00:00:00", + type: 1, + ID: "4f6b0218-5f83-4391-bcda-187216717970", + CREATE_TIME: "2024-03-17 15:54:52", + MODIFY_TIME: "2024-03-17 15:54:52", }, { - "COUNT": 81, - "DATE": "2024-03-17 00:00:00", - "type": 0, - "ID": "3e52996e-29c8-4b43-8760-42ea711ebaad", - - - - - - - - "CREATE_TIME": "2024-03-18 15:54:52", - "MODIFY_TIME": "2024-03-18 15:54:52", - - + COUNT: 81, + DATE: "2024-03-17 00:00:00", + type: 0, + ID: "3e52996e-29c8-4b43-8760-42ea711ebaad", + CREATE_TIME: "2024-03-18 15:54:52", + MODIFY_TIME: "2024-03-18 15:54:52", }, { - "COUNT": 152, - "DATE": "2024-03-17 00:00:00", - "type": 1, - "ID": "7d3fd40b-bdf2-4119-ac5c-6fa827275283", - - - - - - - - "CREATE_TIME": "2024-03-18 15:54:52", - "MODIFY_TIME": "2024-03-18 15:54:52", - - + COUNT: 152, + DATE: "2024-03-17 00:00:00", + type: 1, + ID: "7d3fd40b-bdf2-4119-ac5c-6fa827275283", + CREATE_TIME: "2024-03-18 15:54:52", + MODIFY_TIME: "2024-03-18 15:54:52", }, { - "COUNT": 173, - "DATE": "2024-03-18 00:00:00", - "type": 1, - "ID": "be9a0dc1-1ce6-4723-82a9-a959fc8101fc", - - - - - - - - "CREATE_TIME": "2024-03-19 15:54:53", - "MODIFY_TIME": "2024-03-19 15:54:53", - - + COUNT: 173, + DATE: "2024-03-18 00:00:00", + type: 1, + ID: "be9a0dc1-1ce6-4723-82a9-a959fc8101fc", + CREATE_TIME: "2024-03-19 15:54:53", + MODIFY_TIME: "2024-03-19 15:54:53", }, { - "COUNT": 80, - "DATE": "2024-03-18 00:00:00", - "type": 0, - "ID": "902f5e01-2cb0-4439-ab0f-b63cc367d570", - - - - - - - - "CREATE_TIME": "2024-03-19 15:54:53", - "MODIFY_TIME": "2024-03-19 15:54:53", - - + COUNT: 80, + DATE: "2024-03-18 00:00:00", + type: 0, + ID: "902f5e01-2cb0-4439-ab0f-b63cc367d570", + CREATE_TIME: "2024-03-19 15:54:53", + MODIFY_TIME: "2024-03-19 15:54:53", }, { - "COUNT": 206, - "DATE": "2024-03-19 00:00:00", - "type": 1, - "ID": "c117274e-1d2b-44ec-ae9e-b3196b9e13ce", - - - - - - - - "CREATE_TIME": "2024-03-20 15:54:52", - "MODIFY_TIME": "2024-03-20 15:54:52", - - + COUNT: 206, + DATE: "2024-03-19 00:00:00", + type: 1, + ID: "c117274e-1d2b-44ec-ae9e-b3196b9e13ce", + CREATE_TIME: "2024-03-20 15:54:52", + MODIFY_TIME: "2024-03-20 15:54:52", }, { - "COUNT": 83, - "DATE": "2024-03-19 00:00:00", - "type": 0, - "ID": "649b29c2-f251-4fd6-8589-349a260767b7", - - - - - - - - "CREATE_TIME": "2024-03-20 15:54:52", - "MODIFY_TIME": "2024-03-20 15:54:52", - - + COUNT: 83, + DATE: "2024-03-19 00:00:00", + type: 0, + ID: "649b29c2-f251-4fd6-8589-349a260767b7", + CREATE_TIME: "2024-03-20 15:54:52", + MODIFY_TIME: "2024-03-20 15:54:52", }, { - "COUNT": 86, - "DATE": "2024-03-20 00:00:00", - "type": 0, - "ID": "5ce8ec42-3578-45ca-bc2d-22944d625cde", - - - - - - - - "CREATE_TIME": "2024-03-21 15:54:53", - "MODIFY_TIME": "2024-03-21 15:54:53", - - + COUNT: 86, + DATE: "2024-03-20 00:00:00", + type: 0, + ID: "5ce8ec42-3578-45ca-bc2d-22944d625cde", + CREATE_TIME: "2024-03-21 15:54:53", + MODIFY_TIME: "2024-03-21 15:54:53", }, { - "COUNT": 263, - "DATE": "2024-03-20 00:00:00", - "type": 1, - "ID": "aa22675f-6538-4a54-a199-d425441d5254", - - - - - - - - "CREATE_TIME": "2024-03-21 15:54:53", - "MODIFY_TIME": "2024-03-21 15:54:53", - - + COUNT: 263, + DATE: "2024-03-20 00:00:00", + type: 1, + ID: "aa22675f-6538-4a54-a199-d425441d5254", + CREATE_TIME: "2024-03-21 15:54:53", + MODIFY_TIME: "2024-03-21 15:54:53", }, { - "COUNT": 124, - "DATE": "2024-03-21 00:00:00", - "type": 0, - "ID": "d7170de9-31ee-43ce-995f-2d623db98906", - - - - - - - - "CREATE_TIME": "2024-03-22 15:54:53", - "MODIFY_TIME": "2024-03-22 15:54:53", - - + COUNT: 124, + DATE: "2024-03-21 00:00:00", + type: 0, + ID: "d7170de9-31ee-43ce-995f-2d623db98906", + CREATE_TIME: "2024-03-22 15:54:53", + MODIFY_TIME: "2024-03-22 15:54:53", }, { - "COUNT": 349, - "DATE": "2024-03-21 00:00:00", - "type": 1, - "ID": "550d4690-06dc-423d-a984-4328cf69c3e1", - - - - - - - - "CREATE_TIME": "2024-03-22 15:54:53", - "MODIFY_TIME": "2024-03-22 15:54:53", - - + COUNT: 349, + DATE: "2024-03-21 00:00:00", + type: 1, + ID: "550d4690-06dc-423d-a984-4328cf69c3e1", + CREATE_TIME: "2024-03-22 15:54:53", + MODIFY_TIME: "2024-03-22 15:54:53", }, { - "COUNT": 204, - "DATE": "2024-03-22 00:00:00", - "type": 0, - "ID": "572a463e-3e40-4374-b9de-e0616d2c7602", - - - - - - - - "CREATE_TIME": "2024-03-23 15:54:54", - "MODIFY_TIME": "2024-03-23 15:54:54", - - + COUNT: 204, + DATE: "2024-03-22 00:00:00", + type: 0, + ID: "572a463e-3e40-4374-b9de-e0616d2c7602", + CREATE_TIME: "2024-03-23 15:54:54", + MODIFY_TIME: "2024-03-23 15:54:54", }, { - "COUNT": 307, - "DATE": "2024-03-22 00:00:00", - "type": 1, - "ID": "d9208912-e8d2-4295-a4fb-92fe6ebd1144", - - - - - - - - "CREATE_TIME": "2024-03-23 15:54:54", - "MODIFY_TIME": "2024-03-23 15:54:54", - - + COUNT: 307, + DATE: "2024-03-22 00:00:00", + type: 1, + ID: "d9208912-e8d2-4295-a4fb-92fe6ebd1144", + CREATE_TIME: "2024-03-23 15:54:54", + MODIFY_TIME: "2024-03-23 15:54:54", }, { - "COUNT": 196, - "DATE": "2024-03-23 00:00:00", - "type": 0, - "ID": "eeb04ad5-11e4-4853-b07b-d406f1d1bdcf", - - - - - - - - "CREATE_TIME": "2024-03-24 15:54:53", - "MODIFY_TIME": "2024-03-24 15:54:53", - - + COUNT: 196, + DATE: "2024-03-23 00:00:00", + type: 0, + ID: "eeb04ad5-11e4-4853-b07b-d406f1d1bdcf", + CREATE_TIME: "2024-03-24 15:54:53", + MODIFY_TIME: "2024-03-24 15:54:53", }, { - "COUNT": 270, - "DATE": "2024-03-23 00:00:00", - "type": 1, - "ID": "08df6b62-c7ff-4c24-9eb4-2db3335dc6b5", - - - - - - - - "CREATE_TIME": "2024-03-24 15:54:53", - "MODIFY_TIME": "2024-03-24 15:54:53", - - + COUNT: 270, + DATE: "2024-03-23 00:00:00", + type: 1, + ID: "08df6b62-c7ff-4c24-9eb4-2db3335dc6b5", + CREATE_TIME: "2024-03-24 15:54:53", + MODIFY_TIME: "2024-03-24 15:54:53", }, { - "COUNT": 265, - "DATE": "2024-03-24 00:00:00", - "type": 1, - "ID": "ad5e8ec3-d2eb-4b6e-a23b-225d57868a74", - - - - - - - - "CREATE_TIME": "2024-03-25 15:54:54", - "MODIFY_TIME": "2024-03-25 15:54:54", - - + COUNT: 265, + DATE: "2024-03-24 00:00:00", + type: 1, + ID: "ad5e8ec3-d2eb-4b6e-a23b-225d57868a74", + CREATE_TIME: "2024-03-25 15:54:54", + MODIFY_TIME: "2024-03-25 15:54:54", }, { - "COUNT": 183, - "DATE": "2024-03-24 00:00:00", - "type": 0, - "ID": "d306b920-41d4-4877-a597-cf76aaf11209", - - - - - - - - "CREATE_TIME": "2024-03-25 15:54:54", - "MODIFY_TIME": "2024-03-25 15:54:54", - - + COUNT: 183, + DATE: "2024-03-24 00:00:00", + type: 0, + ID: "d306b920-41d4-4877-a597-cf76aaf11209", + CREATE_TIME: "2024-03-25 15:54:54", + MODIFY_TIME: "2024-03-25 15:54:54", }, { - "COUNT": 307, - "DATE": "2024-03-25 00:00:00", - "type": 1, - "ID": "0fed3ab1-b153-4f2d-813b-32d79d1a2f75", - - - - - - - - "CREATE_TIME": "2024-03-26 15:54:53", - "MODIFY_TIME": "2024-03-26 15:54:53", - - + COUNT: 307, + DATE: "2024-03-25 00:00:00", + type: 1, + ID: "0fed3ab1-b153-4f2d-813b-32d79d1a2f75", + CREATE_TIME: "2024-03-26 15:54:53", + MODIFY_TIME: "2024-03-26 15:54:53", }, { - "COUNT": 185, - "DATE": "2024-03-25 00:00:00", - "type": 0, - "ID": "103028e8-bcaf-4f4d-82b3-53908ad80086", - - - - - - - - "CREATE_TIME": "2024-03-26 15:54:53", - "MODIFY_TIME": "2024-03-26 15:54:53", - - + COUNT: 185, + DATE: "2024-03-25 00:00:00", + type: 0, + ID: "103028e8-bcaf-4f4d-82b3-53908ad80086", + CREATE_TIME: "2024-03-26 15:54:53", + MODIFY_TIME: "2024-03-26 15:54:53", }, { - "COUNT": 186, - "DATE": "2024-03-26 00:00:00", - "type": 0, - "ID": "18a9775e-6f9c-4e07-9528-80a30284e7e8", - - - - - - - - "CREATE_TIME": "2024-03-27 15:54:53", - "MODIFY_TIME": "2024-03-27 15:54:53", - - + COUNT: 186, + DATE: "2024-03-26 00:00:00", + type: 0, + ID: "18a9775e-6f9c-4e07-9528-80a30284e7e8", + CREATE_TIME: "2024-03-27 15:54:53", + MODIFY_TIME: "2024-03-27 15:54:53", }, { - "COUNT": 304, - "DATE": "2024-03-26 00:00:00", - "type": 1, - "ID": "1a865fec-6e16-4f05-bb92-d91ecf7ec113", - - - - - - - - "CREATE_TIME": "2024-03-27 15:54:53", - "MODIFY_TIME": "2024-03-27 15:54:53", - - + COUNT: 304, + DATE: "2024-03-26 00:00:00", + type: 1, + ID: "1a865fec-6e16-4f05-bb92-d91ecf7ec113", + CREATE_TIME: "2024-03-27 15:54:53", + MODIFY_TIME: "2024-03-27 15:54:53", }, { - "COUNT": 207, - "DATE": "2024-03-27 00:00:00", - "type": 0, - "ID": "d6178a36-3d88-4c9b-914e-e15099d14585", - - - - - - - - "CREATE_TIME": "2024-03-28 15:54:53", - "MODIFY_TIME": "2024-03-28 15:54:53", - - + COUNT: 207, + DATE: "2024-03-27 00:00:00", + type: 0, + ID: "d6178a36-3d88-4c9b-914e-e15099d14585", + CREATE_TIME: "2024-03-28 15:54:53", + MODIFY_TIME: "2024-03-28 15:54:53", }, { - "COUNT": 294, - "DATE": "2024-03-27 00:00:00", - "type": 1, - "ID": "6fe4b031-140f-4b07-b260-7448ccc221ef", - - - - - - - - "CREATE_TIME": "2024-03-28 15:54:53", - "MODIFY_TIME": "2024-03-28 15:54:53", - - + COUNT: 294, + DATE: "2024-03-27 00:00:00", + type: 1, + ID: "6fe4b031-140f-4b07-b260-7448ccc221ef", + CREATE_TIME: "2024-03-28 15:54:53", + MODIFY_TIME: "2024-03-28 15:54:53", }, { - "COUNT": 202, - "DATE": "2024-03-28 00:00:00", - "type": 0, - "ID": "261bd85b-409e-4270-a5a0-428179af465b", - - - - - - - - "CREATE_TIME": "2024-03-29 15:54:54", - "MODIFY_TIME": "2024-03-29 15:54:54", - - + COUNT: 202, + DATE: "2024-03-28 00:00:00", + type: 0, + ID: "261bd85b-409e-4270-a5a0-428179af465b", + CREATE_TIME: "2024-03-29 15:54:54", + MODIFY_TIME: "2024-03-29 15:54:54", }, { - "COUNT": 301, - "DATE": "2024-03-28 00:00:00", - "type": 1, - "ID": "bc62a9da-6ba4-415f-80dd-3098b683acd0", - - - - - - - - "CREATE_TIME": "2024-03-29 15:54:54", - "MODIFY_TIME": "2024-03-29 15:54:54", - - + COUNT: 301, + DATE: "2024-03-28 00:00:00", + type: 1, + ID: "bc62a9da-6ba4-415f-80dd-3098b683acd0", + CREATE_TIME: "2024-03-29 15:54:54", + MODIFY_TIME: "2024-03-29 15:54:54", }, { - "COUNT": 188, - "DATE": "2024-03-29 00:00:00", - "type": 0, - "ID": "c2ce0ab6-e886-4949-b9e1-03e372327626", - - - - - - - - "CREATE_TIME": "2024-03-30 15:54:54", - "MODIFY_TIME": "2024-03-30 15:54:54", - - + COUNT: 188, + DATE: "2024-03-29 00:00:00", + type: 0, + ID: "c2ce0ab6-e886-4949-b9e1-03e372327626", + CREATE_TIME: "2024-03-30 15:54:54", + MODIFY_TIME: "2024-03-30 15:54:54", }, { - "COUNT": 292, - "DATE": "2024-03-29 00:00:00", - "type": 1, - "ID": "2908af15-44dd-4638-ad8b-5b52aa124bec", - - - - - - - - "CREATE_TIME": "2024-03-30 15:54:54", - "MODIFY_TIME": "2024-03-30 15:54:54", - - + COUNT: 292, + DATE: "2024-03-29 00:00:00", + type: 1, + ID: "2908af15-44dd-4638-ad8b-5b52aa124bec", + CREATE_TIME: "2024-03-30 15:54:54", + MODIFY_TIME: "2024-03-30 15:54:54", }, { - "COUNT": 191, - "DATE": "2024-03-30 00:00:00", - "type": 0, - "ID": "176bb95d-ff69-456c-b513-40b7f366d5bd", - - - - - - - - "CREATE_TIME": "2024-03-31 15:54:54", - "MODIFY_TIME": "2024-03-31 15:54:54", - - + COUNT: 191, + DATE: "2024-03-30 00:00:00", + type: 0, + ID: "176bb95d-ff69-456c-b513-40b7f366d5bd", + CREATE_TIME: "2024-03-31 15:54:54", + MODIFY_TIME: "2024-03-31 15:54:54", }, { - "COUNT": 294, - "DATE": "2024-03-30 00:00:00", - "type": 1, - "ID": "345b369c-b972-4e67-b29d-b5f213f4d587", - - - - - - - - "CREATE_TIME": "2024-03-31 15:54:54", - "MODIFY_TIME": "2024-03-31 15:54:54", - - + COUNT: 294, + DATE: "2024-03-30 00:00:00", + type: 1, + ID: "345b369c-b972-4e67-b29d-b5f213f4d587", + CREATE_TIME: "2024-03-31 15:54:54", + MODIFY_TIME: "2024-03-31 15:54:54", }, { - "COUNT": 191, - "DATE": "2024-03-31 00:00:00", - "type": 0, - "ID": "bfd345e2-3927-4cb6-96eb-e65f5344fe82", - - - - - - - - "CREATE_TIME": "2024-04-01 15:54:54", - "MODIFY_TIME": "2024-04-01 15:54:54", - - + COUNT: 191, + DATE: "2024-03-31 00:00:00", + type: 0, + ID: "bfd345e2-3927-4cb6-96eb-e65f5344fe82", + CREATE_TIME: "2024-04-01 15:54:54", + MODIFY_TIME: "2024-04-01 15:54:54", }, { - "COUNT": 288, - "DATE": "2024-03-31 00:00:00", - "type": 1, - "ID": "590f5ef6-08c7-4523-8f98-5afec6c02c72", - - - - - - - - "CREATE_TIME": "2024-04-01 15:54:54", - "MODIFY_TIME": "2024-04-01 15:54:54", - - + COUNT: 288, + DATE: "2024-03-31 00:00:00", + type: 1, + ID: "590f5ef6-08c7-4523-8f98-5afec6c02c72", + CREATE_TIME: "2024-04-01 15:54:54", + MODIFY_TIME: "2024-04-01 15:54:54", }, { - "COUNT": 399, - "DATE": "2024-04-01 00:00:00", - "type": 1, - "ID": "80eb33a7-a811-49ea-aaae-b560e9b5d861", - - - - - - - - "CREATE_TIME": "2024-04-02 15:54:55", - "MODIFY_TIME": "2024-04-02 15:54:55", - - + COUNT: 399, + DATE: "2024-04-01 00:00:00", + type: 1, + ID: "80eb33a7-a811-49ea-aaae-b560e9b5d861", + CREATE_TIME: "2024-04-02 15:54:55", + MODIFY_TIME: "2024-04-02 15:54:55", }, { - "COUNT": 198, - "DATE": "2024-04-01 00:00:00", - "type": 0, - "ID": "7f595016-1fc9-4be0-b0b1-ccaadf400f4a", - - - - - - - - "CREATE_TIME": "2024-04-02 15:54:55", - "MODIFY_TIME": "2024-04-02 15:54:55", - - + COUNT: 198, + DATE: "2024-04-01 00:00:00", + type: 0, + ID: "7f595016-1fc9-4be0-b0b1-ccaadf400f4a", + CREATE_TIME: "2024-04-02 15:54:55", + MODIFY_TIME: "2024-04-02 15:54:55", }, { - "COUNT": 390, - "DATE": "2024-04-02 00:00:00", - "type": 1, - "ID": "410bae9f-8811-48bc-b063-6b50c6b7988c", - - - - - - - - "CREATE_TIME": "2024-04-03 15:54:55", - "MODIFY_TIME": "2024-04-03 15:54:55", - - + COUNT: 390, + DATE: "2024-04-02 00:00:00", + type: 1, + ID: "410bae9f-8811-48bc-b063-6b50c6b7988c", + CREATE_TIME: "2024-04-03 15:54:55", + MODIFY_TIME: "2024-04-03 15:54:55", }, { - "COUNT": 214, - "DATE": "2024-04-02 00:00:00", - "type": 0, - "ID": "ba28acd4-f7b6-4fc8-b37e-a09c272dda92", - - - - - - - - "CREATE_TIME": "2024-04-03 15:54:55", - "MODIFY_TIME": "2024-04-03 15:54:55", - - + COUNT: 214, + DATE: "2024-04-02 00:00:00", + type: 0, + ID: "ba28acd4-f7b6-4fc8-b37e-a09c272dda92", + CREATE_TIME: "2024-04-03 15:54:55", + MODIFY_TIME: "2024-04-03 15:54:55", }, { - "COUNT": 237, - "DATE": "2024-04-03 00:00:00", - "type": 0, - "ID": "7c9e488e-9d76-439d-bf4a-892e9997b425", - - - - - - - - "CREATE_TIME": "2024-04-04 15:54:55", - "MODIFY_TIME": "2024-04-04 15:54:55", - - + COUNT: 237, + DATE: "2024-04-03 00:00:00", + type: 0, + ID: "7c9e488e-9d76-439d-bf4a-892e9997b425", + CREATE_TIME: "2024-04-04 15:54:55", + MODIFY_TIME: "2024-04-04 15:54:55", }, { - "COUNT": 312, - "DATE": "2024-04-03 00:00:00", - "type": 1, - "ID": "45b9f8ae-e0c0-4113-b822-b7f0ecdcd8ce", - - - - - - - - "CREATE_TIME": "2024-04-04 15:54:55", - "MODIFY_TIME": "2024-04-04 15:54:55", - - + COUNT: 312, + DATE: "2024-04-03 00:00:00", + type: 1, + ID: "45b9f8ae-e0c0-4113-b822-b7f0ecdcd8ce", + CREATE_TIME: "2024-04-04 15:54:55", + MODIFY_TIME: "2024-04-04 15:54:55", }, { - "COUNT": 197, - "DATE": "2024-04-04 00:00:00", - "type": 0, - "ID": "b37526da-3461-4e2a-a79d-eadb9a523512", - - - - - - - - "CREATE_TIME": "2024-04-05 15:54:55", - "MODIFY_TIME": "2024-04-05 15:54:55", - - + COUNT: 197, + DATE: "2024-04-04 00:00:00", + type: 0, + ID: "b37526da-3461-4e2a-a79d-eadb9a523512", + CREATE_TIME: "2024-04-05 15:54:55", + MODIFY_TIME: "2024-04-05 15:54:55", }, { - "COUNT": 254, - "DATE": "2024-04-04 00:00:00", - "type": 1, - "ID": "03e3017c-b5c0-4e1a-8b32-ebd8fd28dcf0", - - - - - - - - "CREATE_TIME": "2024-04-05 15:54:55", - "MODIFY_TIME": "2024-04-05 15:54:55", - - + COUNT: 254, + DATE: "2024-04-04 00:00:00", + type: 1, + ID: "03e3017c-b5c0-4e1a-8b32-ebd8fd28dcf0", + CREATE_TIME: "2024-04-05 15:54:55", + MODIFY_TIME: "2024-04-05 15:54:55", }, { - "COUNT": 266, - "DATE": "2024-04-05 00:00:00", - "type": 1, - "ID": "d8ea24f9-3697-4af3-b406-4f5ae3c44586", - - - - - - - - - - - - + COUNT: 266, + DATE: "2024-04-05 00:00:00", + type: 1, + ID: "d8ea24f9-3697-4af3-b406-4f5ae3c44586", }, { - "COUNT": 174, - "DATE": "2024-04-05 00:00:00", - "type": 0, - "ID": "14a421a8-6485-4e1e-9ca0-1e40c32b0579", - - - - - - - - - - - - + COUNT: 174, + DATE: "2024-04-05 00:00:00", + type: 0, + ID: "14a421a8-6485-4e1e-9ca0-1e40c32b0579", }, { - "COUNT": 168, - "DATE": "2024-04-06 00:00:00", - "type": 0, - "ID": "0208eb4a-4da5-4229-af0b-27c1dfc66102", - - - - - - - - "CREATE_TIME": "2024-04-07 15:54:55", - "MODIFY_TIME": "2024-04-07 15:54:55", - - + COUNT: 168, + DATE: "2024-04-06 00:00:00", + type: 0, + ID: "0208eb4a-4da5-4229-af0b-27c1dfc66102", + CREATE_TIME: "2024-04-07 15:54:55", + MODIFY_TIME: "2024-04-07 15:54:55", }, { - "COUNT": 292, - "DATE": "2024-04-06 00:00:00", - "type": 1, - "ID": "4849991c-cb1e-4780-a558-669fb92ed16e", - - - - - - - - "CREATE_TIME": "2024-04-07 15:54:55", - "MODIFY_TIME": "2024-04-07 15:54:55", - - + COUNT: 292, + DATE: "2024-04-06 00:00:00", + type: 1, + ID: "4849991c-cb1e-4780-a558-669fb92ed16e", + CREATE_TIME: "2024-04-07 15:54:55", + MODIFY_TIME: "2024-04-07 15:54:55", }, { - "COUNT": 171, - "DATE": "2024-04-07 00:00:00", - "type": 0, - "ID": "69efae5a-9ac8-4627-a6da-a786706e1b63", - - - - - - - - "CREATE_TIME": "2024-04-08 15:54:55", - "MODIFY_TIME": "2024-04-08 15:54:55", - - + COUNT: 171, + DATE: "2024-04-07 00:00:00", + type: 0, + ID: "69efae5a-9ac8-4627-a6da-a786706e1b63", + CREATE_TIME: "2024-04-08 15:54:55", + MODIFY_TIME: "2024-04-08 15:54:55", }, { - "COUNT": 318, - "DATE": "2024-04-07 00:00:00", - "type": 1, - "ID": "3cb6beb3-6bd9-4b39-84ab-420f407b3b8d", - - - - - - - - "CREATE_TIME": "2024-04-08 15:54:55", - "MODIFY_TIME": "2024-04-08 15:54:55", - - + COUNT: 318, + DATE: "2024-04-07 00:00:00", + type: 1, + ID: "3cb6beb3-6bd9-4b39-84ab-420f407b3b8d", + CREATE_TIME: "2024-04-08 15:54:55", + MODIFY_TIME: "2024-04-08 15:54:55", }, { - "COUNT": 314, - "DATE": "2024-04-08 00:00:00", - "type": 1, - "ID": "ac34c873-2b7b-43a2-9243-9935817a45db", - - - - - - - - "CREATE_TIME": "2024-04-09 15:54:55", - "MODIFY_TIME": "2024-04-09 15:54:55", - - + COUNT: 314, + DATE: "2024-04-08 00:00:00", + type: 1, + ID: "ac34c873-2b7b-43a2-9243-9935817a45db", + CREATE_TIME: "2024-04-09 15:54:55", + MODIFY_TIME: "2024-04-09 15:54:55", }, { - "COUNT": 186, - "DATE": "2024-04-08 00:00:00", - "type": 0, - "ID": "c5d4e5fc-9f0b-4726-a739-7aa487c82174", - - - - - - - - "CREATE_TIME": "2024-04-09 15:54:55", - "MODIFY_TIME": "2024-04-09 15:54:55", - - + COUNT: 186, + DATE: "2024-04-08 00:00:00", + type: 0, + ID: "c5d4e5fc-9f0b-4726-a739-7aa487c82174", + CREATE_TIME: "2024-04-09 15:54:55", + MODIFY_TIME: "2024-04-09 15:54:55", }, { - "COUNT": 307, - "DATE": "2024-04-09 00:00:00", - "type": 1, - "ID": "bc75f415-bacb-45a1-814b-ac28f4f7cb2e", - - - - - - - - "CREATE_TIME": "2024-04-10 15:54:56", - "MODIFY_TIME": "2024-04-10 15:54:56", - - + COUNT: 307, + DATE: "2024-04-09 00:00:00", + type: 1, + ID: "bc75f415-bacb-45a1-814b-ac28f4f7cb2e", + CREATE_TIME: "2024-04-10 15:54:56", + MODIFY_TIME: "2024-04-10 15:54:56", }, { - "COUNT": 207, - "DATE": "2024-04-09 00:00:00", - "type": 0, - "ID": "2590bf04-f29a-4450-be5b-e1995bae8b6d", - - - - - - - - "CREATE_TIME": "2024-04-10 15:54:56", - "MODIFY_TIME": "2024-04-10 15:54:56", - - + COUNT: 207, + DATE: "2024-04-09 00:00:00", + type: 0, + ID: "2590bf04-f29a-4450-be5b-e1995bae8b6d", + CREATE_TIME: "2024-04-10 15:54:56", + MODIFY_TIME: "2024-04-10 15:54:56", }, { - "COUNT": 199, - "DATE": "2024-04-10 00:00:00", - "type": 0, - "ID": "43fe7ecc-b588-4f50-987b-f58efbc8b455", - - - - - - - - "CREATE_TIME": "2024-04-11 15:54:56", - "MODIFY_TIME": "2024-04-11 15:54:56", - - + COUNT: 199, + DATE: "2024-04-10 00:00:00", + type: 0, + ID: "43fe7ecc-b588-4f50-987b-f58efbc8b455", + CREATE_TIME: "2024-04-11 15:54:56", + MODIFY_TIME: "2024-04-11 15:54:56", }, { - "COUNT": 281, - "DATE": "2024-04-10 00:00:00", - "type": 1, - "ID": "f503a544-4f3d-4c60-8b49-8fc90ec9359c", + COUNT: 281, + DATE: "2024-04-10 00:00:00", + type: 1, + ID: "f503a544-4f3d-4c60-8b49-8fc90ec9359c", - - - - - - - "CREATE_TIME": "2024-04-11 15:54:56", - "MODIFY_TIME": "2024-04-11 15:54:56", - - - - } + CREATE_TIME: "2024-04-11 15:54:56", + MODIFY_TIME: "2024-04-11 15:54:56", + }, ]; - } for (let i = 0; i < ret.Data.length; i++) { if (ret.Data[i].type == 0) { this.state.activeNums.push(ret.Data[i].COUNT); - this.state.dates.push(moment(ret.Data[i].DATE).format('MM-DD')); + this.state.dates.push(moment(ret.Data[i].DATE).format("MM-DD")); } else { this.state.loginNums.push(ret.Data[i].COUNT); } } if (this.state.totalActiveUsers == 0) { - this.state.totalActiveUsers = ret.Data.reverse().find(item => item.type === 0)?.COUNT; + this.state.totalActiveUsers = ret.Data.reverse().find( + (item) => item.type === 0 + )?.COUNT; //this.state.totalActiveUsers = 326; - } - this.state.dates.push(moment().format('MM/DD')); + this.state.dates.push(moment().format("MM/DD")); this.state.loginNums.push(todayCount); - let chart1s = document.getElementById('chart1'); + let chart1s = document.getElementById("chart1"); console.log(this.state.dates); if (chart1s) { let myChart = echarts.init(chart1s); - myChart.on('click', (params) => { - this.state.searchMinTime = moment().format('YYYY') + "-" + params.name + " 00:00:00"; - this.state.searchMaxTime = moment(this.state.searchMinTime).add(1, "day").format('YYYY-MM-DD 00:00:00'); + myChart.on("click", (params) => { + this.state.searchMinTime = + moment().format("YYYY") + "-" + params.name + " 00:00:00"; + this.state.searchMaxTime = moment(this.state.searchMinTime) + .add(1, "day") + .format("YYYY-MM-DD 00:00:00"); if (params.seriesName == "活跃用户数") { this.state.totalActiveUsers = params.value; } else { - this.state.totalActiveUsers = ret.Data.find(item => item.DATE == this.state.searchMinTime && item.type == 0).COUNT; + this.state.totalActiveUsers = ret.Data.find( + (item) => + item.DATE == this.state.searchMinTime && item.type == 0 + ).COUNT; } - this.getBaseInfoData() + this.getBaseInfoData(); }); + let color = [ + "#36CE9E", + "#0090FF", + "#FFC005", + "#FF515A", + "#8B5CFF", + "#00CA69", + ]; + const hexToRgba = (hex, opacity) => { + let rgbaColor = ""; + let reg = /^#[\da-f]{6}$/i; + if (reg.test(hex)) { + rgbaColor = `rgba(${parseInt( + "0x" + hex.slice(1, 3) + )},${parseInt("0x" + hex.slice(3, 5))},${parseInt( + "0x" + hex.slice(5, 7) + )},${opacity})`; + } + return rgbaColor; + }; myChart.setOption({ + color: color, grid: { - left: '5%', - right: '5%', + left: "5%", + right: "5%", }, legend: { - bottom: '0px' + left: "center", + align: "left", + bottom: "2%", + textStyle: { + color: "#000", + }, + itemWidth: 10, + itemHeight: 10, }, title: { text: "系统活跃用户数走势分析", - left: 'center' + left: "center", + top: "2%", }, tooltip: { - trigger: 'axis', + trigger: "axis", axisPointer: { - type: 'shadow' + type: "shadow", }, }, xAxis: { - type: 'category', + type: "category", data: this.state.dates, + boundaryGap: false, axisLabel: { - showMaxLabel: true - } + textStyle: { + color: "#333", + }, + }, + axisLine: { + lineStyle: { + color: "#D9D9D9", + }, + }, }, yAxis: { - type: 'value', + type: "value", + axisLabel: { + textStyle: { + color: "#666", + }, + }, + nameTextStyle: { + color: "#666", + fontSize: 12, + lineHeight: 40, + }, + splitLine: { + lineStyle: { + type: "dashed", + color: "#E9E9E9", + }, + }, + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, }, series: [ { - name: '活跃用户数', + name: "活跃用户数", data: this.state.activeNums, - type: 'line', - }, { - name: '登录用户数', + type: "line", + smooth: true, + symbolSize: 8, + zlevel: 3, + lineStyle: { + normal: { + color: color[0], + shadowBlur: 3, + shadowColor: hexToRgba(color[0], 0.5), + shadowOffsetY: 8, + }, + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: hexToRgba(color[0], 0.3), + }, + { + offset: 1, + color: hexToRgba(color[0], 0.1), + }, + ], + false + ), + shadowColor: hexToRgba(color[0], 0.1), + shadowBlur: 10, + }, + }, + }, + { + name: "登录用户数", data: this.state.loginNums, - type: 'line', - } - ] + type: "line", + smooth: true, + symbolSize: 8, + zlevel: 3, + lineStyle: { + normal: { + color: color[1], + shadowBlur: 3, + shadowColor: hexToRgba(color[1], 0.5), + shadowOffsetY: 8, + }, + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient( + 0, + 0, + 0, + 1, + [ + { + offset: 0, + color: hexToRgba(color[1], 0.3), + }, + { + offset: 1, + color: hexToRgba(color[1], 0.1), + }, + ], + false + ), + shadowColor: hexToRgba(color[1], 0.1), + shadowBlur: 10, + }, + }, + }, + ], }); } } - } - }) - } + }, + }); + }; onChange = (type, value) => { this.setState({ - [type]: value - }) - } + [type]: value, + }); + }; render() { return ( -
    -

    用户登录系统统计分析

    -
    - - - +
    +

    + 用户登录系统统计分析 +

    +
    +
    +
  • + 总用户数 +
    +
    {this.state.totalUsers}
    +
  • + +
  • + 活跃用户数 +
    +
    + {this.state.totalActiveUsers} +
    +
  • + +
  • + 用户活跃度 +
    +
    + {( + (this.state.totalActiveUsers / this.state.totalUsers) * + 100 + ).toFixed(0) + "%"} +
    +
  • +
    + -
    - + -
    -
    +
    +
    -
    - + -
    - - - +
    + + this.onChange('searchMinTime', ds)} - style={{ width: '90%', padding: '10px' }} + value={moment(this.state.searchMinTime, "YYYY-MM-DD")} + onChange={(evt, ds) => this.onChange("searchMinTime", ds)} + style={{ width: "70%", padding: "10px" }} /> + - this.onChange('searchMaxTime', ds)} - style={{ width: '90%', padding: '10px' }} + value={moment(this.state.searchMaxTime, "YYYY-MM-DD")} + onChange={(evt, ds) => this.onChange("searchMaxTime", ds)} + style={{ width: "70%", padding: "10px" ,marginRight:'20px'}} /> {/* 组织: */} - this.setState({ selectUser: value })} filterOption={(input, option) => - option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 + option.props.children + .toLowerCase() + .indexOf(input.toLowerCase()) >= 0 } > - { - this.state.assessUserList ? this.state.assessUserList.map(d => ( - - )) : '' - } - - + {this.state.assessUserList + ? this.state.assessUserList.map((d) => ( + + )) + : ""} + */} + - -
    -
    - + + + +

    - ) + ); } } -export default connect(({ login, app }) => ({ login, app }))(BI005LoginRecord) +export default connect(({ login, app }) => ({ login, app }))(BI005LoginRecord); From 354e0569305934c00176595be71beac8ce2ed06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <991152047@qq.com> Date: Thu, 18 Apr 2024 15:12:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=8A=A5=E8=A1=A8BI008?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BI/BI008FormRunAnalysis.js | 92 ++++++++++++++++--- 1 file changed, 80 insertions(+), 12 deletions(-) diff --git a/src/components/CustomPages/BI/BI008FormRunAnalysis.js b/src/components/CustomPages/BI/BI008FormRunAnalysis.js index 954b9ba..395369c 100644 --- a/src/components/CustomPages/BI/BI008FormRunAnalysis.js +++ b/src/components/CustomPages/BI/BI008FormRunAnalysis.js @@ -2,7 +2,7 @@ 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 { Table, Button, Row, Col,Modal,Form ,DatePicker,Icon} from 'antd'; import echarts from 'echarts'; import styles from '../HI/StepForm.css'; import moment from 'moment' @@ -22,6 +22,8 @@ class BI008FormRunAnalysis extends React.Component { constructor(props) { super(props); this.state = { + selectStartTime: moment(this.getStartDate(), 'YYYY-MM-DD 00:00:00'), + selectEndTime:moment(this.getEndDate(), 'YYYY-MM-DD 23:59:59'), visible: false, noticeTitle: '', tmpData: {}, @@ -300,7 +302,27 @@ class BI008FormRunAnalysis extends React.Component { // visible: true // })); // } - + 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; + } + + 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; + } getDate=(type)=>{ let date = new Date() let y = date .getFullYear() @@ -587,6 +609,18 @@ class BI008FormRunAnalysis extends React.Component { } }) } + startChange=(value)=>{ + this.setState({ + selectStartTime:value, + startTime:value.format("YYYYMMDD") + }) +}; +endChange=(value)=>{ + this.setState({ + selectEndTime:value, + endTime:value.format("YYYYMMDD") + }) +}; closeModal = () => { // 退出弹窗 this.clearData(); } @@ -607,6 +641,10 @@ class BI008FormRunAnalysis extends React.Component { const { startTime, endTime,finishCount,overtimeCount,totalCount,unfinishCount, weekColor,monthColor,threeMonthColor,sixMonthColor,yearColor, } = this.state; + const formItemLayout = { + labelCol: { span: 10 }, + wrapperCol: { span: 14 }, + } let allFinishRate=totalCount ===0?0:((finishCount+overtimeCount)/totalCount * 100).toFixed(0); let finishRate=totalCount ===0?0:(finishCount/totalCount * 100).toFixed(0); return
    @@ -615,22 +653,52 @@ class BI008FormRunAnalysis extends React.Component {

    {this.props?.login?.currActivatedMenu?.MENU_FORM_PARAMS}安全生产标准化运行情况

    ({startTime}-{endTime})

    - - + +
    + - - - - - - - + + + + + + + + + + + + + + + + + + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} {/* */} - +
    From ad4e4503a9446510655756c13ce8a4b1cecf697b Mon Sep 17 00:00:00 2001 From: wjn Date: Thu, 18 Apr 2024 15:41:39 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/SE/SESafeSurveyTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CustomPages/SE/SESafeSurveyTest.js b/src/components/CustomPages/SE/SESafeSurveyTest.js index 7089df9..410ee78 100644 --- a/src/components/CustomPages/SE/SESafeSurveyTest.js +++ b/src/components/CustomPages/SE/SESafeSurveyTest.js @@ -128,7 +128,7 @@ class SESafeSurveyTest extends React.Component { NAME = ret.Nav_Papers[0].Nav_Safe.NAME; END_TIME = ret.Nav_Papers[0].Nav_Safe.END_TIME; } - if (moment().format("YYYY-MM-DD HH:mm:ss") < END_TIME) { + if (moment().format("YYYY-MM-DD HH:mm:ss") < END_TIME && this.props.data.tableKey != undefined) { message.error('已过答题截止时间!'); this.props.dispatch({ type: 'app/getDataByPost', From bd00a98f0a1722d3324c7e1b14d4bf7c8c6e22c8 Mon Sep 17 00:00:00 2001 From: wjn Date: Fri, 19 Apr 2024 14:58:34 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=B9=B4=E4=BB=BD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/SE/SEConfigPage.js | 118 +++++++++--------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/src/components/CustomPages/SE/SEConfigPage.js b/src/components/CustomPages/SE/SEConfigPage.js index 271200d..82a8eb0 100644 --- a/src/components/CustomPages/SE/SEConfigPage.js +++ b/src/components/CustomPages/SE/SEConfigPage.js @@ -1,8 +1,8 @@ import { message } from "antd/lib/index"; -import { Button, Popconfirm, Row, Col, Form, Input,InputNumber, DatePicker,Select, Table } from 'antd'; +import { Button, Popconfirm, Row, Col, Form, Input, InputNumber, DatePicker, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common"; -import styles from '../../CustomPages/HI/StepForm.css'; +import styles from '../../CustomPages/HI/StepForm.css'; import { connect } from 'dva'; import moment from 'moment'; @@ -10,7 +10,7 @@ class SEConfigPage extends React.Component { constructor(props) { super(props); this.state = { - isLoading:false, + isLoading: false, data: { ID: null, SAFE_SERVEY_TRIGGER_TIME: null, @@ -38,7 +38,7 @@ class SEConfigPage extends React.Component { this.props.closeFn(); else if (typeof this.props.data.closeTab == 'function') { this.props.data.closeTab(this.props.data.id) - } else if (typeof this.props.onCancel === "function"){ + } else if (typeof this.props.onCancel === "function") { this.props.onCancel(); } } @@ -50,30 +50,30 @@ class SEConfigPage extends React.Component { url: 'SE/SEConfig/Entities', onComplete: (ret) => { if (ret && ret.length > 0) { - this.setState({ data: ret[0] }); + this.setState({ data: ret[0] }); } } }); } - fmtEnum(name,value){ + fmtEnum(name, value) { const enums = this.props.app.enums; if (!enums || !enums[name]) return ''; - return enums[name].enums[value] || ''; + return enums[name].enums[value] || ''; } - onSave = () =>{ + onSave = () => { let data = JSON.parse(JSON.stringify(this.state.data)); - if (data.DEP_TRAIN_PLAN_END_TIME && data.DEP_TRAIN_PLAN_START_TIME){ + if (data.DEP_TRAIN_PLAN_END_TIME && data.DEP_TRAIN_PLAN_START_TIME) { let s = new Date(data.DEP_TRAIN_PLAN_START_TIME); let e = new Date(data.DEP_TRAIN_PLAN_END_TIME); - if (e.getTime() - s.getTime() < 1 * 24 * 60 * 60 * 1000){ + if (e.getTime() - s.getTime() < 1 * 24 * 60 * 60 * 1000) { message.error('截止时间至少比开始时间大一天'); return; } } - if (!data.ID){ + if (!data.ID) { data.ID = guid(); } - this.setState({isLoading:true}); + this.setState({ isLoading: true }); this.props.dispatch({ type: 'app/getDataByPost', payload: data, @@ -81,19 +81,19 @@ class SEConfigPage extends React.Component { onComplete: (ret) => { if (ret) { message.success('保存成功!'); - this.setState({isLoading:false}); + this.setState({ isLoading: false }); } } }); } render() { const { data } = this.state; - const dateFormat = 'YYYY/MM/DD'; + const dateFormat = 'MM-DD'; return <>
    - -
    -
    (this.componentRef = el)} style={{ padding: '20px',backgroundColor:'FFF' }} id={'tableId' + this.props.data.id}> + +
    +
    (this.componentRef = el)} style={{ padding: '20px', backgroundColor: 'FFF' }} id={'tableId' + this.props.data.id}>

    安全教育培训基础设置

    @@ -102,27 +102,27 @@ class SEConfigPage extends React.Component { @@ -132,27 +132,27 @@ class SEConfigPage extends React.Component { @@ -162,27 +162,27 @@ class SEConfigPage extends React.Component { @@ -191,7 +191,7 @@ class SEConfigPage extends React.Component { - @@ -199,10 +199,11 @@ class SEConfigPage extends React.Component { - - - +
    是非题数目 - { + { let data = this.state.data; data.C_TEST_COUNT = value; this.setState(data) - } - } + } + } > 是非题分值 - { + { let data = this.state.data; data.C_TEST_SCORE = value; this.setState(data) - } - } + } + } >
    单选题数目 - { + { let data = this.state.data; data.S_TEST_COUNT = value; this.setState(data) - } - } + } + } > 单选题分值 - { + { let data = this.state.data; data.S_TEST_SCORE = value; this.setState(data) - } - } + } + } >
    多选题数目 - { + { let data = this.state.data; data.M_TEST_COUNT = value; this.setState(data) - } - } + } + } > 多选题分值 - { + { let data = this.state.data; data.M_TEST_SCORE = value; this.setState(data) - } - } + } + } >
    试题总分 { data.C_TEST_COUNT * data.C_TEST_SCORE + data.S_TEST_COUNT * data.S_TEST_SCORE + data.M_TEST_COUNT * data.M_TEST_SCORE} + {data.C_TEST_COUNT * data.C_TEST_SCORE + data.S_TEST_COUNT * data.S_TEST_SCORE + data.M_TEST_COUNT * data.M_TEST_SCORE}
    安全意识调查触发时间 + { + onChange={value => { let data = this.state.data; data.SAFE_SERVEY_TRIGGER_TIME = value; this.setState(data) @@ -214,8 +215,9 @@ class SEConfigPage extends React.Component { 培训需求调查触发时间 { + format={dateFormat} + value={data.TRAIN_SURVEY_TRIGGER_TIME ? moment(data.TRAIN_SURVEY_TRIGGER_TIME) : null} + onChange={value => { let data = this.state.data; data.TRAIN_SURVEY_TRIGGER_TIME = value; this.setState(data) @@ -225,10 +227,11 @@ class SEConfigPage extends React.Component {
    部门培训计划发起时间 + { + onChange={value => { let data = this.state.data; data.DEP_TRAIN_PLAN_START_TIME = value; this.setState(data) @@ -240,8 +243,9 @@ class SEConfigPage extends React.Component { 部门培训计划截至时间 { + format={dateFormat} + value={data.DEP_TRAIN_PLAN_END_TIME ? moment(data.DEP_TRAIN_PLAN_END_TIME) : null} + onChange={value => { let data = this.state.data; data.DEP_TRAIN_PLAN_END_TIME = value; this.setState(data) @@ -249,7 +253,7 @@ class SEConfigPage extends React.Component { />