diff --git a/package-lock.json b/package-lock.json index 83024bd..b0ba776 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,7 @@ "react-loadable": "5.5.0", "react-orgchart": "^1.0.5", "react-resizable": "^1.10.1", + "react-router-dom": "^5.2.0", "react-to-print": "^2.0.0-alpha-2", "react-umeditor": "1.0.12", "react-websocket": "2.0.1", @@ -7411,6 +7412,22 @@ "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", "hasInstallScript": true }, + "node_modules/dva/node_modules/react-router-dom": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-4.3.1.tgz", + "integrity": "sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==", + "dependencies": { + "history": "^4.7.2", + "invariant": "^2.2.4", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.1", + "react-router": "^4.3.1", + "warning": "^4.0.1" + }, + "peerDependencies": { + "react": ">=15" + } + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmmirror.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -15845,6 +15862,20 @@ "dom-walk": "^0.1.0" } }, + "node_modules/mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dependencies": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + }, + "peerDependencies": { + "prop-types": "^15.0.0", + "react": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, "node_modules/mini-store": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mini-store/-/mini-store-2.0.0.tgz", @@ -20932,17 +20963,37 @@ } }, "node_modules/react-router-dom": { - "version": "4.3.1", - "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-4.3.1.tgz", - "integrity": "sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==", - "license": "MIT", + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", "dependencies": { - "history": "^4.7.2", - "invariant": "^2.2.4", + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", "loose-envify": "^1.3.1", - "prop-types": "^15.6.1", - "react-router": "^4.3.1", - "warning": "^4.0.1" + "prop-types": "^15.6.2", + "react-router": "5.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router-dom/node_modules/react-router": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" }, "peerDependencies": { "react": ">=15" @@ -32253,6 +32304,19 @@ "version": "2.6.12", "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz", "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, + "react-router-dom": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-4.3.1.tgz", + "integrity": "sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==", + "requires": { + "history": "^4.7.2", + "invariant": "^2.2.4", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.1", + "react-router": "^4.3.1", + "warning": "^4.0.1" + } } } }, @@ -38796,6 +38860,15 @@ "dom-walk": "^0.1.0" } }, + "mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "requires": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + } + }, "mini-store": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mini-store/-/mini-store-2.0.0.tgz", @@ -42741,16 +42814,36 @@ } }, "react-router-dom": { - "version": "4.3.1", - "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-4.3.1.tgz", - "integrity": "sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==", + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", "requires": { - "history": "^4.7.2", - "invariant": "^2.2.4", + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", "loose-envify": "^1.3.1", - "prop-types": "^15.6.1", - "react-router": "^4.3.1", - "warning": "^4.0.1" + "prop-types": "^15.6.2", + "react-router": "5.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "react-router": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + } + } } }, "react-router-redux": { diff --git a/package.json b/package.json index a0981db..b8121e4 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "react-loadable": "5.5.0", "react-orgchart": "^1.0.5", "react-resizable": "^1.10.1", + "react-router-dom": "^5.2.0", "react-to-print": "^2.0.0-alpha-2", "react-umeditor": "1.0.12", "react-websocket": "2.0.1", diff --git a/src/plugins/consts/services/route.ts b/src/plugins/consts/services/route.ts index f410ccf..db21b45 100644 --- a/src/plugins/consts/services/route.ts +++ b/src/plugins/consts/services/route.ts @@ -7,6 +7,10 @@ export default [ name: 'HOME', value: '/home' }, + { + name: 'GROUPHOME', + value: '/grouphome' + }, { name: 'MAIN', value: '/main/:menuId' diff --git a/src/router.js b/src/router.js index b355213..42e6f55 100644 --- a/src/router.js +++ b/src/router.js @@ -4,6 +4,7 @@ import { Router, Route, Switch } from 'dva/router' import MainLayout from './layout/Main' import Login from './routes/Login' import Home from './routes/Home' +import GroupHome from './routes/GroupHome' import Main from './routes/Main' import Backend from './routes/Backend' import HomeMobileNew from './routes/HomeMobileNew' @@ -19,6 +20,7 @@ function RouterConfig ({ history }) { + {/* */} diff --git a/src/routes/GroupHome.js b/src/routes/GroupHome.js new file mode 100644 index 0000000..a870d72 --- /dev/null +++ b/src/routes/GroupHome.js @@ -0,0 +1,2171 @@ +import React, { useState, useEffect, useRef, Component } from "react"; +import { connect } from "dva"; +import storage from "../utils/storage"; +import IconFont from "../utils/iconFont"; +import { + initFilter, + addRuleAndGroups, + guid, + extendInclude, + extendRule, + extend, + extendOrder, +} from "../utils/common"; +import "./home.less"; +// 组件库 +import { + Table, + Modal, + Row, + Col, + Icon, + Button, + Input, + DatePicker, + Form, + Select, + notification, + Popconfirm, + Divider, + Space, + Descriptions, + message, + Carousel, +} from "antd"; +import FormPage from "../components/FormPage"; +import backlog from "../assets/home/backlog.png"; +import backlog_i from "../assets/home/backlog_icon.png"; +import styles from "./dashboard.css"; +import "slick-carousel/slick/slick.css"; +import "slick-carousel/slick/slick-theme.css"; +import moment from "moment"; +import flow from "../assets/home/flow.png"; +import flow_i from "../assets/home/remind_icon.png"; +import finished from "../assets/home/finished.png"; +import finished_i from "../assets/home/finished_icon.png"; +import remind from "../assets/home/remind.png"; +import remind_i from "../assets/home/red-err.png"; +import echarts from "echarts"; +import config from "../config"; +import Toggle from "./toggle"; +import RisiLevel from "../components/MainPage/RiskLevel"; +import ClassCompletion from "../components/MainPage/ClassCompletion"; +import WorkTicket from "../components/MainPage/WorkTicket"; +import MonthDanger from "../components/MainPage/MonthDanger"; +import SafeCheck from "../components/MainPage/SafeCheck"; + +const Option = Select.Option; +const RangePicker = DatePicker.RangePicker; + +const formItemLayout = { + labelCol: { span: 6 }, + wrapperCol: { span: 14 }, +}; + +const openNotification = (placement) => { + notification.info({ + duration: null, + top: 43, + message: `签名照上传提示:`, + description: "您还没上传自己的签名照片,请在我的资料中尽快上传您的签名照!", + placement, + }); +}; + +const openNotificationMobile = (placement) => { + notification.info({ + duration: 20, + message: `友情提示:`, + description: "您当前用的是手机在访问,为有更好体验,建议使用电脑访问!", + placement, + }); +}; +const contentStyle = { + height: "400px", + lineHeight: "400px", + textAlign: "center", + background: "#364d79", +}; + +class GroupHome extends React.Component { + constructor(props) { + super(props); + this.state = { + isNaN: false, + scoreVisible: false, + scoreTotalVisible: false, + scoreNaVisible: false, + standardScore: [], + standardScoreTemp: [], + standardScoreNaN: [], + visible: false, + safetySloganOne: "", + safetySloganTwo: "", + noticeTitle: "", + tmpData: {}, + tableKey: "1", + pagination: {}, + retData: [], + chartData: [], + displayStr: null, + displayNum: 24, + columnData: [], + columnFields: [], + delayData: [], + Workbench: { + StockDetail: [], + ApprovalCount: 0, + InComingCount: 0, + OutingCount: 0, + ProductingCount: 0, + }, //工作台模型 + showLoading: false, //待办事项数据刷新提示 + searchVisible: false, //弹窗显示 + searchTodayVisible: false, //弹窗显示 + columns: [], + searchColumns: [], + scoreColumns: [], + scoreTotalColumns: [], + tableData: [ + { + //工作台四个展示模块 + key: "1", + bgImg: backlog, + title: + window.navigator.userAgent.indexOf("Windows") < 1 + ? "待办" + : "待办事项", + total: "0", + iconImg: backlog_i, + iconDisplay: "block", + }, + { + key: "4", + bgImg: remind, + title: + window.navigator.userAgent.indexOf("Windows") < 1 + ? "超时" + : "待办超时", + total: "0", + iconImg: remind_i, + iconDisplay: "none", + }, + { + key: "2", + bgImg: flow, + title: + window.navigator.userAgent.indexOf("Windows") < 1 + ? "已办" + : "已办事项", + total: "0", + iconImg: flow_i, + iconDisplay: "none", + }, + { + key: "3", + bgImg: finished, + title: "今日提醒", + total: "0", + iconImg: finished_i, + iconDisplay: "none", + }, + ], + visibleTitle: "", //点击title + isSearch: false, // 是否搜索 + querySearch: {}, //搜索集合 + visibleStartTime: [], + visibleEndTime: [], + currentpageIndex: "1", + departmentName: "", + stardardScoreQty: "0", + riskLevelPage: [], + departmentCompletionData: [], + workTicketData: [], + // 用户层级id + deparmentID: "", + deparmentType: 0, + dangerList: {}, + //弹窗显示参数 wyw + detailForm: { + isShow: false, + formCode: "", + title: "", + }, + taskSelects: [], + mineType: + localStorage.getItem("currentMineType") === "20" + ? "10" + : localStorage.getItem("currentMineType"), + }; + // this.enums = []; + this.reportType = ""; + this.hiddenTop = 10; + this.jobTop = 10; + this.teamTop = 8; + this.tempTime = moment(new Date()).add(-3, "month").format("YYYY-MM-DD"); + this.resizeRef = React.createRef(); + } + + componentDidMount() { + if (localStorage.getItem("webOrgId") !== '00300000-0000-0000-0000-000000000000') { + history.replace('/home') + // props.history.push({ pathname: "/grouphome" }); + } + if (window.navigator.userAgent.indexOf("Windows") < 1) { + window.location.replace(config.guideH5Host); + openNotificationMobile("bottomRight"); + this.state.displayStr = "none"; + this.state.displayNum = 24; + //alert('手机'); + } else { + this.state.displayStr = ""; + this.state.displayNum = 16; + //alert('PC'); + } + this.state.columns = [ + { + width: "450px", + title: "任务名称", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showEditModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + title: "开始时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + title: "结束时间", + dataIndex: "TASK_ENDDT", + key: "TASK_ENDDT", + }, + { + title: "预警状态", + dataIndex: "NOTICE_TYPE", + key: "NOTICE_TYPE", + render: (text, record) => this.ShowState(record), + }, + ]; + this.getTeam(); + //定时器功能,暂时不开启 + this.timerID = setInterval( + () => this.getBaseInfoData(1, this.state.tableKey, 5), + 120000 + ); + this.showModalSign(); + this.getBaseInfoData(1, 1, 5); + this.setMessageData(); + this.state.scoreNoneColumns = [ + { + width: "80px", + title: "生产单元", + dataIndex: "Nav_ProductionUnit.NAME", + key: "Nav_ProductionUnit.NAME", + }, + { + width: "80px", + title: "一级要素", + dataIndex: "Nav_Primary.NAME", + key: "Nav_Primary.NAME", + }, + { + width: "80px", + title: "二级要素", + dataIndex: "Nav_Second.NAME", + key: "Nav_Second.NAME", + }, + { + width: "50px", + title: "考评项目", + dataIndex: "EVALUATION_ITEM", + key: "EVALUATION_ITEM", + render: (text, record) => ( + + { + this.props.app.enums?.PEEvaluationItemEnum.enums[ + record.EVALUATION_ITEM + ] + } + + ), + }, + { + // width: "450px", + title: "考评内容", + dataIndex: "CONTENTS", + key: "CONTENTS", + }, + { + width: "50px", + title: "扣分分值", + dataIndex: "NON_STANDARDIZED_SCORE", + key: "NON_STANDARDIZED_SCORE", + }, + { + width: "400px", + title: "不符合说明", + dataIndex: "NON_CONFORMANCE", + key: "NON_CONFORMANCE", + }, + { + width: "100px", + title: "评价方法", + dataIndex: "Nav_EvaluationMethod", + key: "Nav_EvaluationMethod", + render: (text, record) => ( + + {record.Nav_EvaluationMethod && + record.Nav_EvaluationMethod?.map((item, i) => { + return ( + + + + ); + })} + + ), + }, + ]; + this.state.scoreColumns = [ + { + width: "80px", + title: "生产单元", + dataIndex: "Nav_ProductionUnit.NAME", + key: "Nav_ProductionUnit.NAME", + }, + { + width: "80px", + title: "一级要素", + dataIndex: "Nav_Primary.NAME", + key: "Nav_Primary.NAME", + }, + { + width: "80px", + title: "二级要素", + dataIndex: "Nav_Second.NAME", + key: "Nav_Second.NAME", + }, + { + width: "80px", + title: "三级要素", + dataIndex: "Nav_Three.NAME", + key: "Nav_Three.NAME", + }, + { + width: "50px", + title: "考评项目", + dataIndex: "EVALUATION_ITEM", + key: "EVALUATION_ITEM", + render: (text, record) => ( + + { + this.props.app.enums?.PEEvaluationItemEnum.enums[ + record.EVALUATION_ITEM + ] + } + + ), + }, + { + // width: "500px", + title: "考评内容", + dataIndex: "CONTENTS", + key: "CONTENTS", + }, + { + width: "100px", + title: "评分办法", + dataIndex: "DESCRIPTION", + key: "DESCRIPTION", + }, + { + width: "50px", + title: "标准分", + dataIndex: "STANDARDIZED_SCORE", + key: "STANDARDIZED_SCORE", + }, + { + width: "50px", + title: "实得分", + dataIndex: "RESULT_SCORE", + key: "RESULT_SCORE", + }, + { + width: "200px", + title: "不符合说明", + dataIndex: "NON_CONFORMANCE", + key: "NON_CONFORMANCE", + }, + , + { + width: "80px", + title: "评价结论", + dataIndex: "EVALUATION_RESULT", + key: "EVALUATION_RESULT", + render: (text, record) => ( + + { + this.props.app.enums?.PEEvaluationResultEnum.enums[ + record.EVALUATION_RESULT + ] + } + + ), + }, + { + width: "100px", + title: "评价方法", + dataIndex: "Nav_EvaluationMethod", + key: "Nav_EvaluationMethod", + render: (text, record) => ( + + {record.Nav_EvaluationMethod && + record.Nav_EvaluationMethod?.map((item, i) => { + return ( + + + + ); + })} + + ), + }, + ]; + this.state.scoreTotalColumns = [ + { + title: "生产单元", + dataIndex: "Nav_ProductionUnit.NAME", + key: "Nav_ProductionUnit.NAME", + }, + { + title: "标准化得分", + dataIndex: "NON_STANDARDIZED_SCORE", + key: "NON_STANDARDIZED_SCORE", + }, + { + title: "操作", + dataIndex: "", + key: "", + render: (text, record) => ( + + { + + {" "} + + + + } + + ), + }, + ]; + } + componentWillUnmount() { + this.timerID && clearTimeout(this.timerID); + } + + showModalSign = () => { + var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 + var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + + let json = initFilter(orgId); + this.props.dispatch({ + type: "app/getDataByPost", + payload: json, + url: "FM/User/UserSign", //验证是否有签名照 + onComplete: (ret) => { + //返回查询结果ret + if (ret) { + //判断是否有记录 + openNotification("topRight"); + } + }, + }); + }; + + getTeam = () => { + var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 + var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + // 龙岩稀土 + if (orgId == "8f1cf418-8bf3-ea3f-7a6d-fc5d61247008") { + this.setState({ + safetySloganOne: "安全方针:以人为本、关注健康、依法治企、安全发展。", + }); + } + // 都昌金鼎 + else if (orgId == "8b3c41aa-51b1-7ce9-1879-248a038c1b5c") { + this.setState({ + safetySloganOne: "安全方针:安全第一,预防为主,科学管理,持续改进。", + mineType: localStorage.getItem("currentMineType") + }); + } + //洛阳豫璐 + else if (orgId == "d9871ba8-0eec-9e4a-bb87-7d5a540d8913") { + this.setState({ + safetySloganOne: "安全方针:科技、安全、环保、效益。", + }); + } + //博柏 + else if (orgId == "3efd5276-632b-e379-9ff3-7a7546591fca") { + this.setState({ + safetySloganOne: "安全方针:安全第一、综合治理、控制风险、科学发展", + mineType: localStorage.getItem("currentMineType") + }); + } + //行洛坑 + else { + this.setState({ + safetySloganOne: "安全方针:安全第一、综合治理、控制风险、科学发展", + mineType: localStorage.getItem("currentMineType") + }); + } + this.setState({ + safetySloganTwo: "安全理念:一切风险皆可控,一切事故皆可防!", + }); + let json = initFilter(orgId); + extendRule(json, "ID", 1, userId); + extendInclude(json, "Nav_Department"); + this.props.dispatch({ + type: "app/getDataByPost", + payload: json, + url: "FM/User/Get", + onComplete: (ret) => { + if (ret && ret.Nav_Department) { + this.setState({ + departmentName: ret.Nav_Department.NAME, + deparmentType: ret.Nav_Department.DEPARTMENT_TYPE, + deparmentID: ret.DEPARTMENT_ID, + }); + this.departmentCompletion(); + this.workTicket(); //工作票完成率前十(统计图) + this.riskLevel(); //岗位风险等级(饼图) + this.getStandardScore(ret.MineType); //获取标准化评分 + this.hiddenDanger(); + } + }, + }); + }; + getStandardScore = (MineType) => { + //标准化得分 + var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + let json = ""; + if (this.state.mineType) { + json = initFilter(orgId, this.state.mineType); + } else { + json = initFilter(orgId, MineType); + } + + this.props.dispatch({ + type: "app/getDataByPost", + payload: json, + url: "PE/PESafetyEvaluationRecord/HomeGet", + onComplete: (ret) => { + if (ret && ret.Nav_Details) { + this.setState({ + standardScore: ret, + stardardScoreQty: ( + (ret.RESULT_TOTAL / ret.STAND_TOTAL) * + 100 + ).toFixed(2), + }); + } + }, + }); + }; + getEnums = () => { + this.props.dispatch({ + type: "app/getDataByGet", + url: "PF/Extend/GetAllEnum", + onComplete: (ret) => { + if (ret) { + this.enums = ret; + } + }, + }); + }; + //班组作业完成率前八 + departmentCompletion = () => { + const userInfo = storage("lacal").getItem("webUserInfo").val; + let json = initFilter( + this.props.login.OrgId, + this.state.mineType, + "NUM", + "desc" + ); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIStatiscialAnalysisController/GetDepartmentCompletionSort", + payload: json, + onlyData: false, + onComplete: (data) => { + if (data && data.IsSuccessful) { + if (data.Data && data.Data.length > 0) { + this.setState({ + departmentCompletionData: data.Data, + }); + } + } + }, + }); + }; + //工作票完成情况统计图 + workTicket = () => { + const userInfo = storage("lacal").getItem("webUserInfo").val; + let json = initFilter( + this.props.login.OrgId, + this.state.mineType, + "NUM", + "desc" + ); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIStatiscialAnalysisController/GetJobCompletionSort", + payload: json, + onlyData: false, + onComplete: (data) => { + if (data && data.IsSuccessful) { + if (data.Data && data.Data.length > 0) { + this.setState({ + workTicketData: data.Data, + }); + } + } + }, + }); + }; + // hiddenDanger + hiddenDanger = () => { + const userInfo = storage("lacal").getItem("webUserInfo").val; + let json = initFilter(this.props.login.OrgId, this.state.mineType, "NUM"); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BIHome/GetHomeInfo", + payload: json, + onlyData: false, + onComplete: (data) => { + if (data && data.IsSuccessful) { + this.hiddenTop = data.Data.length; + this.setState({ + dangerList: data.Data, + }); + //图标2 + } + }, + }); + }; + //风险等级占比 + riskLevel = () => { + const userInfo = storage("lacal").getItem("webUserInfo").val; + let json = initFilter(this.props.login.OrgId); + extendOrder(json, "NUM", 0); + extendRule(json, "COLOR", 1, this.state.mineType); + this.props.dispatch({ + type: "app/getDataByPost", + url: "FM/RiskLevelProportion/OrderPaged", + payload: json, + onlyData: false, + onComplete: (data) => { + if (data && data.IsSuccessful) { + if (data.Data && data.Data.length > 0) { + this.setState({ + riskLevelPage: data.Data, + }); + } + } + }, + }); + }; + //获取数据 + getBaseInfoData = (pagination, key, limit) => { + const current = pagination ? pagination.current : 1; + const json = initFilter(this.props.login.OrgId, "", "CODE", 1, current); + //extendRule(json, "NOTICE_STATUS", 1, 0); + const querySearch = this.state.querySearch; + for (var item in querySearch) { + if (item == "searchName") { + extendRule(json, "NOTICE_TITLE", 9, querySearch[item]); + } + if (item == "searchCode") { + extendRule(json, "CODE", 9, querySearch[item]); + } + if (item == "startTime1") { + extendRule(json, "TASK_STARTDT", 6, querySearch[item]); + } + if (item == "startTime2") { + extendRule(json, "TASK_STARTDT", 4, querySearch[item]); + } + if (item == "endTime1") { + extendRule(json, "TASK_ENDDT", 6, querySearch[item]); + } + if (item == "endTime2") { + extendRule(json, "TASK_ENDDT", 4, querySearch[item]); + } + if (item == "searchStatus") { + extendRule(json, "NOTICE_STATUS", 1, querySearch[item]); + } + } + json.Limit = limit; + //json.Limit = 10; + json.Parameter1 = key; //1待办事项2已办事项3今日新增4待办超时 + + this.props.dispatch({ + type: "app/getDataByPost", + url: "FM/FMNotificationTask/HomeOrderPaged", + payload: json, + onlyData: false, + onComplete: (re) => { + if (re && re.IsSuccessful && re.Data.newData) { + this.state.tableData[0].total = re.Data.todoCount; + this.state.tableData[1].total = re.Data.timeOverCount; + this.state.tableData[2].total = re.Data.doneCount; + this.state.tableData[3].total = re.Data.todayNewCount; + + if (limit != null || limit != undefined) { + this.setState({ + retData: re.Data.newData, + }); + } else { + var pageInfo = {}; + pageInfo.current = current; + pageInfo.total = Math.ceil(re.Data.TotalCount, 10); + this.setState({ + retDataAll: re.Data.newData, + pagination: pageInfo, + }); + } + } + }, + }); + }; + + clearData = () => { + let newtmpData = { ...this.state.tmpData }; + if (newtmpData["data"] != null) { + newtmpData["data"].id = ""; + newtmpData["data"].homeReload = false; + } + newtmpData.formCode = ""; + this.setState({ + visible: false, + tmpData: [], //newtmpData + }); + }; + clearScoreData = () => { + this.setState({ + scoreVisible: false, + // standardScore: [],//newtmpData + }); + }; + handleCancel = () => { + // 退出弹窗 + this.getBaseInfoData(1, this.state.tableKey, 5); + this.clearData(); + }; + closeModal = () => { + // 退出弹窗 + this.clearData(); + }; + + showEditModal = (dataId, formCode, TaskID, title, taskCode) => { + // this.props.dispatch({ + // type: "app/getDataByPost", + // url: "BI/BIController/getVersion", + // onComplete: (ret) => { + // if (ret > config.version) { + // window.localStorage.clear(); + // message.success("清除成功,即将重新加载页面", 2, () => { + // setTimeout(() => window.location.reload(true), 500); + // }); + // } + // }, + // }); + const newtmpData = { + data: { + id: dataId, + TaskID: TaskID, + onCancel: this.handleCancel, + taskCode: taskCode, + tableKey: this.state.tableKey, + homeReload: true, + }, + formCode: formCode, + }; + this.setState( + { + noticeTitle: title, + taskCode: taskCode, + tmpData: newtmpData, + currActivatedMenu: "", + }, + () => + this.setState({ + visible: true, + }) + ); + }; + 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({ + visible: true, + }) + ); + }; + + setMessageData = (dataSource) => { + const data = dataSource ? dataSource : this.props.taskData; + }; + //点击切换四个统计模块更改列表数据 + totalModuleClick = (item) => { + const { tableData } = this.state; + tableData.map((_item, i) => { + if (_item.key == item.key) { + if (item.key == "2") { + this.state.columns = [ + { + width: "450px", + title: "任务名称", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showEditModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE, + record.CODE + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + title: "开始时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + title: "结束时间", + dataIndex: "TASK_ENDDT", + key: "TASK_ENDDT", + }, + { + title: "办结时间", + dataIndex: "TASK_DT", + key: "TASK_DT", + }, + ]; + } else if (item.key == "3") { + this.state.columns = [ + { + title: "提醒内容", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showTodayModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE, + record.CODE, + record.TASK_STARTDT, + record.NOTICE_STATUS + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + width: "150px", + title: "提醒时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + width: "150px", + title: "状态", + dataIndex: "NOTICE_STATUS", + key: "NOTICE_STATUS", + render: (text, record) => this.ShowStatus(record), + }, + ]; + } else { + this.state.columns = [ + { + width: "450px", + title: "任务名称", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showEditModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE, + record.CODE + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + title: "开始时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + title: "结束时间", + dataIndex: "TASK_ENDDT", + key: "TASK_ENDDT", + }, + { + title: "预警状态", + dataIndex: "NOTICE_TYPE", + key: "NOTICE_TYPE", + render: (text, record) => this.ShowState(record), + }, + ]; + } + _item.iconDisplay = "block"; + this.setState({ + tableKey: item.key, + }); + if (window.navigator.userAgent.indexOf("Windows") < 1) { + this.getBaseInfoData(1, item.key, 10); + } else { + this.getBaseInfoData(1, item.key, 5); + } + } else { + _item.iconDisplay = "none"; + } + }); + }; + // 双击切换四个统计模块获取全部信息 + totalMoonDoubleClick = (item) => { + const { tableData } = this.state; + tableData.map((_item) => { + if (_item.key == item.key) { + if (item.key == "2") { + this.state.searchColumns = [ + { + width: "450px", + title: "任务名称", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showEditModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE, + record.CODE + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + title: "开始时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + title: "结束时间", + dataIndex: "TASK_ENDDT", + key: "TASK_ENDDT", + }, + { + title: "办结时间", + dataIndex: "TASK_DT", + key: "TASK_DT", + }, + ]; + this.setState({ + searchVisible: true, + searchTodayVisible: false, + querySearch: {}, + }); + } else if (item.key === "3") { + this.state.searchColumns = [ + { + width: "450px", + title: "提醒内容", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showTodayModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE, + record.CODE, + record.TASK_STARTDT, + record.NOTICE_STATUS + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + title: "提醒时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + title: "状态", + dataIndex: "NOTICE_STATUS", + key: "NOTICE_STATUS", + render: (text, record) => this.ShowStatus(record), + }, + ]; + this.setState({ + searchVisible: false, + searchTodayVisible: true, + querySearch: {}, + }); + } else { + this.state.searchColumns = [ + { + width: "450px", + title: "任务名称", + dataIndex: "NOTICE_TITLE", + key: "NOTICE_TITLE", + render: (text, record) => ( + + + this.showEditModal( + record.SOURCE_DATA_ID, + record.SOURCE_FORMCODE, + record.ID, + record.NOTICE_TITLE, + record.CODE + ) + } + > + {record.NOTICE_TITLE} + + + ), + }, + { + title: "开始时间", + dataIndex: "TASK_STARTDT", + key: "TASK_STARTDT", + }, + { + title: "结束时间", + dataIndex: "TASK_ENDDT", + key: "TASK_ENDDT", + }, + { + title: "预警状态", + dataIndex: "NOTICE_TYPE", + key: "NOTICE_TYPE", + render: (text, record) => this.ShowState(record), + }, + ]; + this.setState({ + searchVisible: true, + searchTodayVisible: false, + querySearch: {}, + }); + } + } + }); + this.setState( + { + tableData, + currentpageIndex: item.key, + }, + () => { + this.getBaseInfoData(1, item.key); + } + ); + }; + // 开始时间 + selectChange = (value) => { + const { querySearch } = this.state; + querySearch.searchStatus = value; + this.setState( + { + querySearch, + }, + () => { } + ); + }; + // 开始时间 + startChange = (dates, dateStr) => { + const { querySearch } = this.state; + if (dates.length != 2) { + this.setState({ + visibleStartTime: [], + querySearch: {}, + }); + return; + } + this.state.visibleStartTime = dates; + querySearch.startTime1 = this.state.visibleStartTime[0].format( + "YYYY-MM-DD HH:mm:ss" + ); + querySearch.startTime2 = this.state.visibleStartTime[1].format( + "YYYY-MM-DD HH:mm:ss" + ); + this.setState( + { + querySearch, + }, + () => { } + ); + }; + // 结束时间 + endChange = (dates, dateStr) => { + const { querySearch } = this.state; + if (dates.length != 2) { + this.setState({ + visibleEndTime: [], + querySearch: {}, + }); + return; + } + this.state.visibleEndTime = dates; + querySearch.endTime1 = this.state.visibleEndTime[0].format( + "YYYY-MM-DD HH:mm:ss" + ); + querySearch.endTime2 = this.state.visibleEndTime[1].format( + "YYYY-MM-DD HH:mm:ss" + ); + this.setState({ querySearch }); + }; + // 搜索 + handleSearch = (item) => { + this.getBaseInfoData(1, item, null); + }; + closeTasks() { + const json = initFilter(this.props.login.OrgId, "", "CODE", 1); + let ids = []; + let names = []; + this.state.taskSelects.forEach(element => { + ids.push(element.ID); + names.push( + { + title: element.NOTICE_TITLE, + startTime: element.TASK_STARTDT, + endTime: element.TASK_ENDDT, + }); + }); + json.Parameter1 = ids.join(","); + json.Parameter2 = JSON.stringify(names); + this.props.dispatch({ + type: "app/getDataByPost", + url: "BI/BITask/CloseTask", + payload: json, + onlyData: false, + onComplete: (ret) => { + message.success('申请成功!'); + }, + }); + }; + // input输入 + vauleChange = (e) => { + const { querySearch } = this.state; + if (e.target.value) { + switch (e.target.name) { + case "searchName": + querySearch[e.target.name] = e.target.value; + this.setState({ querySearch }); + break; + case "searchCode": + querySearch[e.target.name] = e.target.value; + this.setState({ querySearch }); + break; + case "searchType": + querySearch[e.target.name] = e.target.value; + this.setState({ querySearch }); + break; + case "searchContent": + querySearch[e.target.name] = e.target.value; + this.setState({ querySearch }); + break; + } + } else { + this.setState({ querySearch: {} }); + } + }; + closeModal = () => { + this.setState({ + searchVisible: false, + searchTodayVisible: false, + querySearch: {} + }); + }; + ShowState(obj) { + var thisResult = + (Date.parse(obj.TASK_ENDDT) - Date.parse(Date())) / 3600 / 1000; + if (thisResult > 0) { + return "正常"; + } else { + return 超期; + } + } + ShowStatus(obj) { + if (obj.NOTICE_STATUS === 0) { + return 未读; + } else if (obj.NOTICE_STATUS === 3) { + return 已读; + } else { + return "已办"; + } + } + handleSelect = (e) => { + const { querySearch } = this.state; + if (e != undefined) { + querySearch.status = e; + } else { + querySearch.status = ""; + } + this.setState({ querySearch }); + }; + showStandardScoreTotalModal = () => { + this.setState({ + scoreTotalVisible: true, + }); + }; + showStandardScoreModal = (item) => { + let temp = false; + if (this.state.standardScore && this.state.standardScore.Nav_Details) { + this.state.standardScore.Nav_Details.forEach((t) => { + if (t.THREE_ELEMENTS_ID) { + temp = true; + } + }); + } + if (item) { + let dataTemp = this.state.standardScore.Nav_Details.filter( + (t) => t.NON_CONFORMANCE != null && t.NON_CONFORMANCE != "" + ); + let tmpData = dataTemp.map((item, i) => { + item["ROW_NO"] = i + 1; + return item; + }); + let aa = { + CONTENTS: "合计扣分:", + NON_STANDARDIZED_SCORE: this.state.standardScore.NON_STANDARDIZED_SCORE, + }; + tmpData.push(aa); + this.setState({ + isNaN: temp, + standardScoreNaN: tmpData, + scoreNaVisible: true, + }); + } else { + let dataTemp = this.state.standardScore.Nav_Details; + let tmpData = dataTemp.map((item, i) => { + item["ROW_NO"] = i + 1; + return item; + }); + let aa = { + DESCRIPTION: "合计:", + STANDARDIZED_SCORE: this.state.standardScore.STAND_TOTAL, + RESULT_SCORE: this.state.standardScore.RESULT_TOTAL, + NON_CONFORMANCE: + "标准化得分:" + this.state.standardScore.STANDARDIZED_RESULT, + }; + tmpData.push(aa); + this.setState({ + isNaN: temp, + standardScoreTemp: tmpData, + scoreVisible: true, + }); + } + }; + clearScoreTotalData = () => { + this.setState({ + scoreTotalVisible: false, + }); + }; + clearScoreNaData = () => { + this.setState({ + scoreNaVisible: false, + }); + }; + useEffect = () => { + // 监听的函数 + const resize = new ResizeObserver((e) => { + if (!Array.isArray(e) || !e.length) return; + for (const ent of e) { + resizeChange(ent); + } + }); + // 传入监听对象 + resize.observe(resizeRef.current); + // 及时销毁监听函数(重要!!!) + return () => { + resize.unobserve(resizeRef?.current); + }; + }; + + //显示详情弹窗 + showDetailModal = (formCode) => { + var titleTemp = + this.state.mineType == 20 + ? "尾矿库" + : this.state.mineType == 10 + ? "选矿厂" + :this.state.mineType == 31 + ? "职能口": this.state.mineType == 32?"非金属" + : "露天矿"; + if (formCode == "BI054_HOMEDETAIL") { + titleTemp += "安全检查次数统计(近12月)"; + } else if (formCode == "BI055_HOMEDETAIL") { + titleTemp += "月度隐患整改情况(近12月)"; + } else if (formCode == "BI001_HOMEDETAIL") { + titleTemp += "班组活动任务完成详情(近12月)"; + } else if (formCode == "BI002_HOMEDETAIL") { + titleTemp += "工作票完成详情(近12月)"; + } else if (formCode == "BI013_RISKANALYSISMODEL") { + titleTemp += "风险管理统计分析"; + } + + const newtmpData = { + data: { + id: guid(), + mineType: this.state.mineType, + onCancel: this.handleCancel, + homeReload: true, + }, + formCode: formCode, + }; + this.setState({ tmpData: newtmpData }, () => { + var detailForm = { + isShow: true, + formCode: formCode, + title: titleTemp, + }; + this.setState({ + detailForm: detailForm, + }); + }); + }; + + //详情弹窗关闭(隐藏) + detailFormClose = () => { + var detailForm = { + isShow: false, + formCode: "", + title: "", + }; + this.setState({ + detailForm: detailForm, + }); + }; + + render() { + const { tableData } = this.state; + const thingsData = this.state.delayData; + const settings = { + dots: false, + autoplay: false, + infinite: true, + speed: 500, + slidesToShow: 1, + slidesToScroll: 1, + className: styles.slideHeight, + fade: true, + }; + const rowSelection = { + onChange: (selectedRowKeys, selectedRows) => { + this.state.taskSelects = selectedRows; + }, + }; + const empty = ; + return ( + +
+
+ + + + + + + +
+ + +
+ + + + + + + {/* 五个图标模块 */} + + +
this.showStandardScoreTotalModal()} + style={{ + // padding: "0px", + height: "236px", + borderRadius: "10px", + padding: "10px", + cursor: "pointer", + }} + className="backlog-background-style4" + > + +
+
+ {/* {83.6} */} + {this.state.stardardScoreQty} + {/* {this.state.uitem} */} +
+
+ 标准化得分 +
+
+
+ + + + +
+
+ +
+
+

+ {this.state.safetySloganOne} +                    + {this.state.safetySloganTwo} +

+
+
+ + + + + + {tableData.map((item) => { + return ( + +
this.totalModuleClick(item)} + onDoubleClick={() => + this.totalMoonDoubleClick(item) + } + style={{ + padding: "0px", + height: "176px", + borderRadius: "10px", + cursor: "pointer", + }} + className={ + item.title === "待办事项" + ? "backlog-background-style" + : item.title === "待办超时" + ? "backlog-background-style1" + : item.title === "已办事项" + ? "backlog-background-style2" + : item.title === "今日提醒" + ? "backlog-background-style3" + : "backlog-background-style4" + } + > + + +
9999 + ? "backlog-style4" + : "backlog-style" + } + > + {item.total} +
+
+ {item.title} +
+
+
+ + ); + })} + + + + + + + {/* 通知 */} + +
+
+
+
+ + 风险等级占比 +
+ {this.state.riskLevelPage.length > 0 ? ( + +
+ this.showDetailModal("BI013_RISKANALYSISMODEL") + } + > + +
+
+ ) : null} +
+ {this.state.riskLevelPage.length > 0 ? ( + + ) : null} +
+
+ + + + {/* 列表 */} + +
+
+ + + +
+
+ +
+ + + + + + + + + + + + + + + + + + {/* + { + this.closeTasks() + }} + okText="确认" + cancelText="取消" + > + + + */} + + +
+ this.getBaseInfoData(num, this.state.currentpageIndex, null) + } + loading={this.state.showLoading} + size="small" + /> + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ this.getBaseInfoData(num, this.state.currentpageIndex, null) + } + loading={this.state.showLoading} + size="small" + /> + + + {/* 岗位风险类别 */} + +
+
+
+ + 班组活动完成率 +
+ {this.state.departmentCompletionData.length > 0 ? ( + +
this.showDetailModal("BI001_HOMEDETAIL")} + > + +
+
+ ) : null} +
+
+
+ {this.state.departmentCompletionData.length > 0 ? ( + + ) : null} +
+ {/* */} +
+ + + + {/* 工作票完成情况前十 */} + {/* 隐患整改完成情况排名前十 */} + +
+
+
+ + 工作票完成数 +
+ {this.state.workTicketData.length > 0 ? ( + +
this.showDetailModal("BI002_HOMEDETAIL")} + > + +
+
+ ) : null} +
+
+ {this.state.workTicketData.length > 0 ? ( + + ) : null} +
+ + {/* 隐患整改情况 */} + +
+
+
+ + 月度隐患整改情况 +
+ {this.state.dangerList.ListC && + this.state.dangerList.ListC.length > 0 ? ( + +
this.showDetailModal("BI055_HOMEDETAIL")} + > + +
+
+ ) : null} +
+
+ {this.state.dangerList.ListC && + this.state.dangerList.ListC.length > 0 ? ( + + ) : null} + {/* */} +
+ + {/* 风险类别占比、风险等级占比 */} + +
+
+ {/* {this.state.departmentName}作业完成情况 */} +
+ + 安全检查次数统计 +
+ {this.state.dangerList.ListSafeCheckYearMonth && + this.state.dangerList.ListSafeCheckYearMonth.length > 0 ? ( + +
this.showDetailModal("BI054_HOMEDETAIL")} + > + +
+
+ ) : null} +
+
+ {this.state.dangerList.ListSafeCheckYearMonth && this.state.dangerList.ListSafeCheckYearMonth.length > 0 ? ( + + ) : null} +
+ + + + ); + } +} +export default connect(({ login, app }) => ({ login, app }))(GroupHome); diff --git a/src/routes/Home.js b/src/routes/Home.js index 526313b..03fabfb 100644 --- a/src/routes/Home.js +++ b/src/routes/Home.js @@ -87,6 +87,7 @@ const contentStyle = { background: "#364d79", }; + class Home extends React.Component { constructor(props) { super(props); @@ -207,6 +208,11 @@ class Home extends React.Component { } componentDidMount() { + + if (localStorage.getItem("webOrgId") == '00300000-0000-0000-0000-000000000000') { + this.props.history.replace('/grouphome') + // props.history.push({ pathname: "/grouphome" }); + } if (window.navigator.userAgent.indexOf("Windows") < 1) { window.location.replace(config.guideH5Host); openNotificationMobile("bottomRight"); @@ -1386,9 +1392,9 @@ class Home extends React.Component { ? "尾矿库" : this.state.mineType == 10 ? "选矿厂" - :this.state.mineType == 31 - ? "职能口": this.state.mineType == 32?"非金属" - : "露天矿"; + : this.state.mineType == 31 + ? "职能口" : this.state.mineType == 32 ? "非金属" + : "露天矿"; if (formCode == "BI054_HOMEDETAIL") { titleTemp += "安全检查次数统计(近12月)"; } else if (formCode == "BI055_HOMEDETAIL") { diff --git a/yarn.lock b/yarn.lock index e98f760..2e202fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -992,7 +992,7 @@ "pirates" "^4.0.0" "source-map-support" "^0.5.16" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.4.2", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.18.3", "@babel/runtime@^7.4.2", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3": "integrity" "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==" "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.1.tgz" "version" "7.23.1" @@ -6047,7 +6047,7 @@ "resolved" "https://registry.npmmirror.com/highlight-words-core/-/highlight-words-core-1.2.2.tgz" "version" "1.2.2" -"history@^4.6.3", "history@^4.7.2": +"history@^4.6.3", "history@^4.7.2", "history@^4.9.0": "integrity" "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==" "resolved" "https://registry.npmmirror.com/history/-/history-4.10.1.tgz" "version" "4.10.1" @@ -6088,7 +6088,7 @@ "resolved" "https://registry.npmmirror.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz" "version" "2.5.5" -"hoist-non-react-statics@^3.3.0": +"hoist-non-react-statics@^3.1.0", "hoist-non-react-statics@^3.3.0": "integrity" "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==" "resolved" "https://registry.npmmirror.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz" "version" "3.3.2" @@ -8382,6 +8382,14 @@ dependencies: "dom-walk" "^0.1.0" +"mini-create-react-context@^0.4.0": + "integrity" "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==" + "resolved" "https://registry.npmmirror.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz" + "version" "0.4.1" + dependencies: + "@babel/runtime" "^7.12.1" + "tiny-warning" "^1.0.3" + "mini-store@^2.0.0": "integrity" "sha512-EG0CuwpQmX+XL4QVS0kxNwHW5ftSbhygu1qxQH0pipugjnPkbvkalCdQbEihMwtQY6d3MTN+MS0q+aurs+RfLQ==" "resolved" "https://registry.npmjs.org/mini-store/-/mini-store-2.0.0.tgz" @@ -10647,7 +10655,7 @@ "memoize-one" "^4.0.0" "prop-types" "^15.5.8" -"react-is@^16.12.0", "react-is@^16.7.0", "react-is@^16.8.1", "react-is@^16.8.6", "react-is@^16.9.0": +"react-is@^16.12.0", "react-is@^16.6.0", "react-is@^16.7.0", "react-is@^16.8.1", "react-is@^16.8.6", "react-is@^16.9.0": "integrity" "sha1-LMD+D7p0LZf9UnxCoTvsTusGJBw=" "version" "16.12.0" @@ -10713,6 +10721,19 @@ "react-router" "^4.3.1" "warning" "^4.0.1" +"react-router-dom@^5.2.0": + "integrity" "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==" + "resolved" "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-5.2.0.tgz" + "version" "5.2.0" + dependencies: + "@babel/runtime" "^7.1.2" + "history" "^4.9.0" + "loose-envify" "^1.3.1" + "prop-types" "^15.6.2" + "react-router" "5.2.0" + "tiny-invariant" "^1.0.2" + "tiny-warning" "^1.0.0" + "react-router-redux@5.0.0-alpha.9": "integrity" "sha512-euSgNIANnRXr4GydIuwA7RZCefrLQzIw5WdXspS8NPYbV+FxrKSS9MKG7U9vb6vsKHONnA4VxrVNWfnMUnUQAw==" "resolved" "https://registry.npmmirror.com/react-router-redux/-/react-router-redux-5.0.0-alpha.9.tgz" @@ -10735,6 +10756,22 @@ "prop-types" "^15.6.1" "warning" "^4.0.1" +"react-router@5.2.0": + "integrity" "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==" + "resolved" "https://registry.npmmirror.com/react-router/-/react-router-5.2.0.tgz" + "version" "5.2.0" + dependencies: + "@babel/runtime" "^7.1.2" + "history" "^4.9.0" + "hoist-non-react-statics" "^3.1.0" + "loose-envify" "^1.3.1" + "mini-create-react-context" "^0.4.0" + "path-to-regexp" "^1.7.0" + "prop-types" "^15.6.2" + "react-is" "^16.6.0" + "tiny-invariant" "^1.0.2" + "tiny-warning" "^1.0.0" + "react-slick@~0.25.2": "integrity" "sha512-8MNH/NFX/R7zF6W/w+FS5VXNyDusF+XDW1OU0SzODEU7wqYB+ZTGAiNJ++zVNAVqCAHdyCybScaUB+FCZOmBBw==" "resolved" "https://registry.npmjs.org/react-slick/-/react-slick-0.25.2.tgz" @@ -10780,7 +10817,7 @@ "resolved" "https://registry.npmmirror.com/react-websocket/-/react-websocket-2.0.1.tgz" "version" "2.0.1" -"react@*", "react@^0.14 || ^15.0.0 || ^16.0.0-alpha", "react@^0.14.0 || ^15.0.0 || ^16.0.0", "react@^0.14.0 || ^15.0.0 || ^16.0.0-0", "react@^0.14.0 || ^15.0.0 || ^16.0.0-beta || ^16.0.0", "react@^0.14.0 || ^15.0.0-0 || ^16.0.0", "react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0", "react@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0", "react@^0.14.0 || ^15.0.1 || ^16.0.0", "react@^15.0.0 || ^16.0.0", "react@^16.0.0", "react@^16.0.0-0", "react@^16.3.0", "react@^16.6.3", "react@^16.8.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@>= 16.3", "react@>=0.13.2 || ^0.14 || ^15.0.0 || >=16.0.0", "react@>=15", "react@>=15.0.0", "react@>=15.x", "react@>=16.0.0", "react@>=16.9.0", "react@>0.14.5", "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0", "react@0.14.x || 15.x || 16.x", "react@15.x || ^16.0.0-0", "react@16.8.2", "react@16.x": +"react@*", "react@^0.14 || ^15.0.0 || ^16.0.0-alpha", "react@^0.14.0 || ^15.0.0 || ^16.0.0", "react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0", "react@^0.14.0 || ^15.0.0 || ^16.0.0-0", "react@^0.14.0 || ^15.0.0 || ^16.0.0-beta || ^16.0.0", "react@^0.14.0 || ^15.0.0-0 || ^16.0.0", "react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0", "react@^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0", "react@^0.14.0 || ^15.0.1 || ^16.0.0", "react@^15.0.0 || ^16.0.0", "react@^16.0.0", "react@^16.0.0-0", "react@^16.3.0", "react@^16.6.3", "react@^16.8.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@>= 16.3", "react@>=0.13.2 || ^0.14 || ^15.0.0 || >=16.0.0", "react@>=15", "react@>=15.0.0", "react@>=15.x", "react@>=16.0.0", "react@>=16.9.0", "react@>0.14.5", "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0", "react@0.14.x || 15.x || 16.x", "react@15.x || ^16.0.0-0", "react@16.8.2", "react@16.x": "integrity" "sha512-aB2ctx9uQ9vo09HVknqv3DGRpI7OIGJhCx3Bt0QqoRluEjHSaObJl+nG12GDdYH6sTgE7YiPJ6ZUyMx9kICdXw==" "resolved" "https://registry.npmmirror.com/react/-/react-16.8.2.tgz" "version" "16.8.2" @@ -12503,7 +12540,7 @@ "integrity" "sha1-s/mziDXjakHIQ6OwkHpaezdV3nM=" "version" "1.0.6" -"tiny-warning@^1.0.0": +"tiny-warning@^1.0.0", "tiny-warning@^1.0.3": "integrity" "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" "resolved" "https://registry.npmmirror.com/tiny-warning/-/tiny-warning-1.0.3.tgz" "version" "1.0.3"