diff --git a/src/routes/GroupHome.js b/src/routes/GroupHome.js index 8fd4a45..ca57598 100644 --- a/src/routes/GroupHome.js +++ b/src/routes/GroupHome.js @@ -1,17 +1,9 @@ -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 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, @@ -31,28 +23,28 @@ import { 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"; +} 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; @@ -67,7 +59,7 @@ const openNotification = (placement) => { duration: null, top: 43, message: `签名照上传提示:`, - description: "您还没上传自己的签名照片,请在我的资料中尽快上传您的签名照!", + description: '您还没上传自己的签名照片,请在我的资料中尽快上传您的签名照!', placement, }); }; @@ -76,15 +68,15 @@ const openNotificationMobile = (placement) => { notification.info({ duration: 20, message: `友情提示:`, - description: "您当前用的是手机在访问,为有更好体验,建议使用电脑访问!", + description: '您当前用的是手机在访问,为有更好体验,建议使用电脑访问!', placement, }); }; const contentStyle = { - height: "400px", - lineHeight: "400px", - textAlign: "center", - background: "#364d79", + height: '400px', + lineHeight: '400px', + textAlign: 'center', + background: '#364d79', }; class GroupHome extends React.Component { @@ -93,11 +85,12 @@ class GroupHome extends React.Component { constructor(props) { super(props); this.state = { + isDoubleClick: false, noticeData: [], // 公告列表数据 currentNoticePage: 1, // 当前公告页码 noticePageSize: 4, // 每页公告数量(与图片一致,默认显示4条) totalNoticeCount: 0, // 公告总数量 - activeNoticeTab: "all", // 活跃公告标签(全部/集团发布/公司发布,参考图片) + activeNoticeTab: 'all', // 活跃公告标签(全部/集团发布/公司发布,参考图片) isNaN: false, scoreVisible: false, scoreTotalVisible: false, @@ -106,14 +99,14 @@ class GroupHome extends React.Component { standardScoreTemp: [], standardScoreNaN: [], visible: false, - safetySloganOne: "", + safetySloganOne: '', animationDuration: 20, sliderColor: '#de4e58', sliderSize: '24px', - safetySloganTwo: "", - noticeTitle: "", + safetySloganTwo: '', + noticeTitle: '', tmpData: {}, - tableKey: "1", + tableKey: '1', pagination: {}, retData: [], chartData: [], @@ -139,80 +132,68 @@ class GroupHome extends React.Component { tableData: [ { //工作台四个展示模块 - key: "1", + key: '1', bgImg: backlog, - title: - window.navigator.userAgent.indexOf("Windows") < 1 - ? "待办" - : "待办事项", - total: "0", + title: window.navigator.userAgent.indexOf('Windows') < 1 ? '待办' : '待办事项', + total: '0', iconImg: backlog_i, - iconDisplay: "block", + iconDisplay: 'block', }, { - key: "4", + key: '4', bgImg: remind, - title: - window.navigator.userAgent.indexOf("Windows") < 1 - ? "超时" - : "待办超时", - total: "0", + title: window.navigator.userAgent.indexOf('Windows') < 1 ? '超时' : '待办超时', + total: '0', iconImg: remind_i, - iconDisplay: "none", + iconDisplay: 'none', }, { - key: "2", + key: '2', bgImg: flow, - title: - window.navigator.userAgent.indexOf("Windows") < 1 - ? "已办" - : "已办事项", - total: "0", + title: window.navigator.userAgent.indexOf('Windows') < 1 ? '已办' : '已办事项', + total: '0', iconImg: flow_i, - iconDisplay: "none", + iconDisplay: 'none', }, { - key: "3", + key: '3', bgImg: finished, - title: "今日提醒", - total: "0", + title: '今日提醒', + total: '0', iconImg: finished_i, - iconDisplay: "none", + iconDisplay: 'none', }, ], - visibleTitle: "", //点击title + visibleTitle: '', //点击title isSearch: false, // 是否搜索 querySearch: {}, //搜索集合 visibleStartTime: [], visibleEndTime: [], - currentpageIndex: "1", - departmentName: "", - stardardScoreQty: "0", + currentpageIndex: '1', + departmentName: '', + stardardScoreQty: '0', riskLevelPage: [], departmentCompletionData: [], workTicketData: [], // 用户层级id - deparmentID: "", + deparmentID: '', deparmentType: 0, dangerList: {}, //弹窗显示参数 wyw detailForm: { isShow: false, - formCode: "", - title: "", + formCode: '', + title: '', }, taskSelects: [], - mineType: - localStorage.getItem("currentMineType") === "20" - ? "10" - : localStorage.getItem("currentMineType"), + mineType: localStorage.getItem('currentMineType') === '20' ? '10' : localStorage.getItem('currentMineType'), }; // this.enums = []; - this.reportType = ""; + this.reportType = ''; this.hiddenTop = 10; this.jobTop = 10; this.teamTop = 8; - this.tempTime = moment(new Date()).add(-3, "month").format("YYYY-MM-DD"); + this.tempTime = moment(new Date()).add(-3, 'month').format('YYYY-MM-DD'); this.resizeRef = React.createRef(); } @@ -222,19 +203,19 @@ class GroupHome extends React.Component { // this.props.history.replace('/home') // return // } - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { window.location.replace(config.guideH5Host); - openNotificationMobile("bottomRight"); + openNotificationMobile('bottomRight'); return; // 阻止后续代码执行 //alert('手机'); } this.setState({ columns: [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( this.ShowState(record), }, ], - 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 ( - - - - ); - })} - - ), - }], - scoreColumns: [ + scoreNoneColumns: [ { - width: "80px", - title: "生产单元", - dataIndex: "Nav_ProductionUnit.NAME", - key: "Nav_ProductionUnit.NAME", + 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_Primary.NAME', + key: 'Nav_Primary.NAME', }, { - width: "80px", - title: "二级要素", - dataIndex: "Nav_Second.NAME", - key: "Nav_Second.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: "50px", - title: "考评项目", - dataIndex: "EVALUATION_ITEM", - key: "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) => ( - { - this.props.app.enums?.PEEvaluationItemEnum.enums[ - record.EVALUATION_ITEM - ] - } + {record.Nav_EvaluationMethod && + record.Nav_EvaluationMethod?.map((item, i) => { + return ( + + + + ); + })} ), }, + ], + 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", + title: '考评内容', + dataIndex: 'CONTENTS', + key: 'CONTENTS', }, { - width: "100px", - title: "评分办法", - dataIndex: "DESCRIPTION", - key: "DESCRIPTION", + width: '100px', + title: '评分办法', + dataIndex: 'DESCRIPTION', + key: 'DESCRIPTION', }, { - width: "50px", - title: "标准分", - dataIndex: "STANDARDIZED_SCORE", - key: "STANDARDIZED_SCORE", + width: '50px', + title: '标准分', + dataIndex: 'STANDARDIZED_SCORE', + key: 'STANDARDIZED_SCORE', }, { - width: "50px", - title: "实得分", - dataIndex: "RESULT_SCORE", - key: "RESULT_SCORE", + width: '50px', + title: '实得分', + dataIndex: 'RESULT_SCORE', + key: 'RESULT_SCORE', }, { - width: "200px", - title: "不符合说明", - dataIndex: "NON_CONFORMANCE", - key: "NON_CONFORMANCE", + width: '200px', + title: '不符合说明', + dataIndex: 'NON_CONFORMANCE', + key: 'NON_CONFORMANCE', }, , { - width: "80px", - title: "评价结论", - dataIndex: "EVALUATION_RESULT", - key: "EVALUATION_RESULT", + width: '80px', + title: '评价结论', + dataIndex: 'EVALUATION_RESULT', + key: 'EVALUATION_RESULT', render: (text, record) => ( - - { - this.props.app.enums?.PEEvaluationResultEnum.enums[ - record.EVALUATION_RESULT - ] - } - + {this.props.app.enums?.PEEvaluationResultEnum.enums[record.EVALUATION_RESULT]} ), }, { - width: "100px", - title: "评价方法", - dataIndex: "Nav_EvaluationMethod", - key: "Nav_EvaluationMethod", + width: '100px', + title: '评价方法', + dataIndex: 'Nav_EvaluationMethod', + key: 'Nav_EvaluationMethod', render: (text, record) => ( {record.Nav_EvaluationMethod && @@ -446,52 +411,45 @@ class GroupHome extends React.Component { ], scoreTotalColumns: [ { - title: "生产单元", - dataIndex: "Nav_ProductionUnit.NAME", - key: "Nav_ProductionUnit.NAME", + title: '生产单元', + dataIndex: 'Nav_ProductionUnit.NAME', + key: 'Nav_ProductionUnit.NAME', }, { - title: "标准化得分", - dataIndex: "NON_STANDARDIZED_SCORE", - key: "NON_STANDARDIZED_SCORE", + title: '标准化得分', + dataIndex: 'NON_STANDARDIZED_SCORE', + key: 'NON_STANDARDIZED_SCORE', }, { - title: "操作", - dataIndex: "", - key: "", + title: '操作', + dataIndex: '', + key: '', render: (text, record) => ( { - {" "} - - + {' '} + + } ), }, - ] - }) + ], + }); this.getTeam(); - this.getHomeTitle() + this.getHomeTitle(); //定时器功能,暂时不开启 - this.timerID = setInterval( - () => { - if (this._isMounted) { - this.getBaseInfoData(1, this.state.tableKey, 5) - } - }, - 120000 - ); + this.timerID = setInterval(() => { + if (this._isMounted) { + this.getBaseInfoData(1, this.state.tableKey, 5); + } + }, 120000); this.showModalSign(); this.getBaseInfoData(1, 1, 5); this.setMessageData(); - this.getNoticeData() + this.getNoticeData(); } componentWillUnmount() { @@ -503,70 +461,70 @@ class GroupHome extends React.Component { } getNoticeData = () => { const { currentNoticePage, noticePageSize, activeNoticeTab, mineType } = this.state; - const orgId = storage("lacal").getItem("webOrgId")?.val; + const orgId = storage('lacal').getItem('webOrgId')?.val; // 构建请求参数(按标签筛选:全部/集团/公司) let json = initFilter(orgId, mineType); - extendRule(json, "pageNum", 1, currentNoticePage); - extendRule(json, "pageSize", 1, noticePageSize); - if (activeNoticeTab === "group") { - extendRule(json, "sourceType", 1, 1); // 1=集团发布 - } else if (activeNoticeTab === "company") { - extendRule(json, "sourceType", 1, 2); // 2=公司发布 + extendRule(json, 'pageNum', 1, currentNoticePage); + extendRule(json, 'pageSize', 1, noticePageSize); + if (activeNoticeTab === 'group') { + extendRule(json, 'sourceType', 1, 1); // 1=集团发布 + } else if (activeNoticeTab === 'company') { + extendRule(json, 'sourceType', 1, 2); // 2=公司发布 } this.setState({ noticeData: [ { - id: "1", - title: "为表彰先进,树立榜样,激励广大员工积极进取,集团决定开展2023年度优秀员工评选工作...", - source: "集团发布", - date: "08-30", - readStatus: "未读", // 可选:未读/已读 - isImportant: true // 是否重要提醒 + id: '1', + title: '为表彰先进,树立榜样,激励广大员工积极进取,集团决定开展2023年度优秀员工评选工作...', + source: '集团发布', + date: '08-30', + readStatus: '未读', // 可选:未读/已读 + isImportant: true, // 是否重要提醒 }, { - id: "2", - title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...", - source: "公司发布", - date: "08-28", - readStatus: "已读", - isImportant: false + id: '2', + title: '根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...', + source: '公司发布', + date: '08-28', + readStatus: '已读', + isImportant: false, }, { - id: "3", - title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...", - source: "公司发布", - date: "08-28", - readStatus: "已读", - isImportant: false + id: '3', + title: '根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...', + source: '公司发布', + date: '08-28', + readStatus: '已读', + isImportant: false, }, { - id: "4", - title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...", - source: "公司发布", - date: "08-28", - readStatus: "已读", - isImportant: false + id: '4', + title: '根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...', + source: '公司发布', + date: '08-28', + readStatus: '已读', + isImportant: false, }, { - id: "5", - title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...", - source: "公司发布", - date: "08-28", - readStatus: "已读", - isImportant: false + id: '5', + title: '根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...', + source: '公司发布', + date: '08-28', + readStatus: '已读', + isImportant: false, }, { - id: "6", - title: "根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...", - source: "公司发布", - date: "08-28", - readStatus: "已读", - isImportant: false - } + id: '6', + title: '根据国家法定节假日安排,结合公司实际情况,现将2023年国庆节放假安排通知如下...', + source: '公司发布', + date: '08-28', + readStatus: '已读', + isImportant: false, + }, // 更多公告... ], - totalNoticeCount: 10 // 公告总数 - }) + totalNoticeCount: 10, // 公告总数 + }); // this.props.dispatch({ // type: "app/getDataByPost", @@ -595,48 +553,50 @@ class GroupHome extends React.Component { // 公告标签切换(全部/集团发布/公司发布) switchNoticeTab = (tabType) => { - this.setState({ - activeNoticeTab: tabType, - currentNoticePage: 1, // 切换标签时重置为第1页 - }, () => { - this.getNoticeData(); // 切换标签后重新请求数据 - }); + this.setState( + { + activeNoticeTab: tabType, + currentNoticePage: 1, // 切换标签时重置为第1页 + }, + () => { + this.getNoticeData(); // 切换标签后重新请求数据 + } + ); }; // 查看更多公告(跳转至公告详情页或展开全部) viewMoreNotice = () => { // 逻辑1:跳转至独立公告页面(推荐) - this.props.history.push({ pathname: "/noticeList", state: { tab: this.state.activeNoticeTab } }); + this.props.history.push({ pathname: '/noticeList', state: { tab: this.state.activeNoticeTab } }); // 逻辑2:在当前页展开全部公告(备选) // this.setState({ noticePageSize: this.state.totalNoticeCount }); }; - showModalSign = () => { - var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + var userId = storage('lacal').getItem('userid')?.val; //登录后有存储登录信息 + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 let json = initFilter(orgId); this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "FM/User/UserSign", //验证是否有签名照 + url: 'FM/User/UserSign', //验证是否有签名照 onComplete: (ret) => { //返回查询结果ret if (this._isMounted && ret) { //判断是否有记录 - openNotification("topRight"); + openNotification('topRight'); } }, }); }; getHomeTitle = () => { - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 let json = initFilter(orgId); this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "PF/HomeTitle/OrderPaged", + url: 'PF/HomeTitle/OrderPaged', onComplete: (ret) => { if (this._isMounted && ret) { const safetySlogan = ret[0].TITLE; @@ -652,24 +612,23 @@ class GroupHome extends React.Component { // safetySloganOne: "1.安全方针:以人为本、关注健康、依法治企、安全发展。 2.安全理念:一切风险皆可控,一切事故皆可防!3.安全方针:以人为本、关注健康、依法治企、安全发展。4.安全方针:以人为本、关注健康、依法治企、安全发展。5.安全方针:以人为本、关注健康、依法治企、安全发展。 6.安全理念:一切风险皆可控,一切事故皆可防!7.安全方针:以人为本、关注健康、依法治企、安全发展。8.安全方针:以人为本、关注健康、依法治企、安全发展。", animationDuration: duration, sliderColor: ret[0].COCOR, - sliderSize: ret[0].FONTSIZE - + sliderSize: ret[0].FONTSIZE, }); } }, }); - } + }; getTeam = () => { - var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + var userId = storage('lacal').getItem('userid')?.val; //登录后有存储登录信息 + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 let json = initFilter(orgId); - extendRule(json, "ID", 1, userId); - extendInclude(json, "Nav_Department"); + extendRule(json, 'ID', 1, userId); + extendInclude(json, 'Nav_Department'); this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "FM/User/Get", + url: 'FM/User/Get', onComplete: (ret) => { if (this._isMounted && ret && ret.Nav_Department) { this.setState({ @@ -688,8 +647,8 @@ class GroupHome extends React.Component { }; getStandardScore = (MineType) => { //标准化得分 - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 - let json = ""; + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 + let json = ''; if (this.state.mineType) { json = initFilter(orgId, this.state.mineType); } else { @@ -697,17 +656,14 @@ class GroupHome extends React.Component { } this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "PE/PESafetyEvaluationRecord/HomeGet", + 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), + stardardScoreQty: ((ret.RESULT_TOTAL / ret.STAND_TOTAL) * 100).toFixed(2), }); } }, @@ -715,8 +671,8 @@ class GroupHome extends React.Component { }; getEnums = () => { this.props.dispatch({ - type: "app/getDataByGet", - url: "PF/Extend/GetAllEnum", + type: 'app/getDataByGet', + url: 'PF/Extend/GetAllEnum', onComplete: (ret) => { if (ret) { this.enums = ret; @@ -726,16 +682,11 @@ class GroupHome extends React.Component { }; //班组作业完成率前八 departmentCompletion = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; - let json = initFilter( - this.props.login.OrgId, - this.state.mineType, - "NUM", - "desc" - ); + 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", + type: 'app/getDataByPost', + url: 'BI/BIStatiscialAnalysisController/GetDepartmentCompletionSort', payload: json, onlyData: false, onComplete: (data) => { @@ -751,16 +702,11 @@ class GroupHome extends React.Component { }; //工作票完成情况统计图 workTicket = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; - let json = initFilter( - this.props.login.OrgId, - this.state.mineType, - "NUM", - "desc" - ); + 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", + type: 'app/getDataByPost', + url: 'BI/BIStatiscialAnalysisController/GetJobCompletionSort', payload: json, onlyData: false, onComplete: (data) => { @@ -776,11 +722,11 @@ class GroupHome extends React.Component { }; // hiddenDanger hiddenDanger = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; - let json = initFilter(this.props.login.OrgId, this.state.mineType, "NUM"); + 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", + type: 'app/getDataByPost', + url: 'BI/BIHome/GetHomeInfo', payload: json, onlyData: false, onComplete: (data) => { @@ -796,13 +742,13 @@ class GroupHome extends React.Component { }; //风险等级占比 riskLevel = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; + 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); + extendOrder(json, 'NUM', 0); + extendRule(json, 'COLOR', 1, this.state.mineType); this.props.dispatch({ - type: "app/getDataByPost", - url: "FM/RiskLevelProportion/OrderPaged", + type: 'app/getDataByPost', + url: 'FM/RiskLevelProportion/OrderPaged', payload: json, onlyData: false, onComplete: (data) => { @@ -819,30 +765,30 @@ class GroupHome extends React.Component { //获取数据 getBaseInfoData = (pagination, key, limit) => { const current = pagination ? pagination.current : 1; - const json = initFilter(this.props.login.OrgId, "", "CODE", 1, current); + 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 == 'searchName') { + extendRule(json, 'NOTICE_TITLE', 9, querySearch[item]); } - if (item == "searchCode") { - extendRule(json, "CODE", 9, querySearch[item]); + if (item == 'searchCode') { + extendRule(json, 'CODE', 9, querySearch[item]); } - if (item == "startTime1") { - extendRule(json, "TASK_STARTDT", 6, querySearch[item]); + if (item == 'startTime1') { + extendRule(json, 'TASK_STARTDT', 6, querySearch[item]); } - if (item == "startTime2") { - extendRule(json, "TASK_STARTDT", 4, querySearch[item]); + if (item == 'startTime2') { + extendRule(json, 'TASK_STARTDT', 4, querySearch[item]); } - if (item == "endTime1") { - extendRule(json, "TASK_ENDDT", 6, querySearch[item]); + if (item == 'endTime1') { + extendRule(json, 'TASK_ENDDT', 6, querySearch[item]); } - if (item == "endTime2") { - extendRule(json, "TASK_ENDDT", 4, querySearch[item]); + if (item == 'endTime2') { + extendRule(json, 'TASK_ENDDT', 4, querySearch[item]); } - if (item == "searchStatus") { - extendRule(json, "NOTICE_STATUS", 1, querySearch[item]); + if (item == 'searchStatus') { + extendRule(json, 'NOTICE_STATUS', 1, querySearch[item]); } } json.Limit = limit; @@ -850,8 +796,8 @@ class GroupHome extends React.Component { json.Parameter1 = key; //1待办事项2已办事项3今日新增4待办超时 this.props.dispatch({ - type: "app/getDataByPost", - url: "FM/FMNotificationTask/HomeOrderPaged", + type: 'app/getDataByPost', + url: 'FM/FMNotificationTask/HomeOrderPaged', payload: json, onlyData: false, onComplete: (re) => { @@ -881,11 +827,11 @@ class GroupHome extends React.Component { clearData = () => { let newtmpData = { ...this.state.tmpData }; - if (newtmpData["data"] != null) { - newtmpData["data"].id = ""; - newtmpData["data"].homeReload = false; + if (newtmpData['data'] != null) { + newtmpData['data'].id = ''; + newtmpData['data'].homeReload = false; } - newtmpData.formCode = ""; + newtmpData.formCode = ''; this.setState({ visible: false, tmpData: [], //newtmpData @@ -899,7 +845,11 @@ class GroupHome extends React.Component { }; handleCancel = () => { // 退出弹窗 - this.getBaseInfoData(1, this.state.tableKey, 5); + if (this.state.isDoubleClick) { + this.getBaseInfoData(1, this.state.tableKey, null); + } else { + this.getBaseInfoData(1, this.state.tableKey, 5); + } this.clearData(); }; closeModal = () => { @@ -937,7 +887,7 @@ class GroupHome extends React.Component { noticeTitle: title, taskCode: taskCode, tmpData: newtmpData, - currActivatedMenu: "", + currActivatedMenu: '', }, () => this.setState({ @@ -945,15 +895,7 @@ class GroupHome extends React.Component { }) ); }; - showTodayModal = ( - dataId, - formCode, - TaskID, - title, - taskCode, - taskStartdt, - taskStatus - ) => { + showTodayModal = (dataId, formCode, TaskID, title, taskCode, taskStartdt, taskStatus) => { const newtmpData = { data: { id: dataId, @@ -966,14 +908,14 @@ class GroupHome extends React.Component { taskStatus: taskStatus, homeReload: true, }, - formCode: "PF135", + formCode: 'PF135', }; this.setState( { - noticeTitle: "今日提醒", + noticeTitle: '今日提醒', taskCode: taskCode, tmpData: newtmpData, - currActivatedMenu: "", + currActivatedMenu: '', }, () => this.setState({ @@ -990,13 +932,13 @@ class GroupHome extends React.Component { const { tableData } = this.state; tableData.map((_item, i) => { if (_item.key == item.key) { - if (item.key == "2") { + if (item.key == '2') { this.state.columns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( ( this.ShowStatus(record), }, ]; } else { this.state.columns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( this.ShowState(record), }, ]; } - _item.iconDisplay = "block"; + _item.iconDisplay = 'block'; this.setState({ tableKey: item.key, + isDoubleClick: false, }); - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { this.getBaseInfoData(1, item.key, 10); } else { this.getBaseInfoData(1, item.key, 5); } } else { - _item.iconDisplay = "none"; + _item.iconDisplay = 'none'; } }); }; @@ -1135,13 +1078,13 @@ class GroupHome extends React.Component { const { tableData } = this.state; tableData.map((_item) => { if (_item.key == item.key) { - if (item.key == "2") { + if (item.key == '2') { this.state.searchColumns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( ( this.ShowStatus(record), }, ]; @@ -1229,10 +1172,10 @@ class GroupHome extends React.Component { } else { this.state.searchColumns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( this.ShowState(record), }, ]; @@ -1281,6 +1224,7 @@ class GroupHome extends React.Component { { tableData, currentpageIndex: item.key, + isDoubleClick: true, }, () => { this.getBaseInfoData(1, item.key); @@ -1295,7 +1239,7 @@ class GroupHome extends React.Component { { querySearch, }, - () => { } + () => {} ); }; // 开始时间 @@ -1309,17 +1253,13 @@ class GroupHome extends React.Component { 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" - ); + 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, }, - () => { } + () => {} ); }; // 结束时间 @@ -1333,12 +1273,8 @@ class GroupHome extends React.Component { 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" - ); + 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 }); }; // 搜索 @@ -1346,48 +1282,47 @@ class GroupHome extends React.Component { this.getBaseInfoData(1, item, null); }; closeTasks() { - const json = initFilter(this.props.login.OrgId, "", "CODE", 1); + const json = initFilter(this.props.login.OrgId, '', 'CODE', 1); let ids = []; let names = []; - this.state.taskSelects.forEach(element => { + this.state.taskSelects.forEach((element) => { ids.push(element.ID); - names.push( - { - title: element.NOTICE_TITLE, - startTime: element.TASK_STARTDT, - endTime: element.TASK_ENDDT, - }); + names.push({ + title: element.NOTICE_TITLE, + startTime: element.TASK_STARTDT, + endTime: element.TASK_ENDDT, + }); }); - json.Parameter1 = ids.join(","); + json.Parameter1 = ids.join(','); json.Parameter2 = JSON.stringify(names); this.props.dispatch({ - type: "app/getDataByPost", - url: "BI/BITask/CloseTask", + 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": + case 'searchName': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; - case "searchCode": + case 'searchCode': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; - case "searchType": + case 'searchType': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; - case "searchContent": + case 'searchContent': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; @@ -1400,25 +1335,24 @@ class GroupHome extends React.Component { this.setState({ searchVisible: false, searchTodayVisible: false, - querySearch: {} + querySearch: {}, }); }; ShowState(obj) { - var thisResult = - (Date.parse(obj.TASK_ENDDT) - Date.parse(Date())) / 3600 / 1000; + var thisResult = (Date.parse(obj.TASK_ENDDT) - Date.parse(Date())) / 3600 / 1000; if (thisResult > 0) { - return "正常"; + return '正常'; } else { - return 超期; + return 超期; } } ShowStatus(obj) { if (obj.NOTICE_STATUS === 0) { - return 未读; + return 未读; } else if (obj.NOTICE_STATUS === 3) { - return 已读; + return 已读; } else { - return "已办"; + return '已办'; } } handleSelect = (e) => { @@ -1426,7 +1360,7 @@ class GroupHome extends React.Component { if (e != undefined) { querySearch.status = e; } else { - querySearch.status = ""; + querySearch.status = ''; } this.setState({ querySearch }); }; @@ -1446,14 +1380,14 @@ class GroupHome extends React.Component { } if (item) { let dataTemp = this.state.standardScore.Nav_Details.filter( - (t) => t.NON_CONFORMANCE != null && t.NON_CONFORMANCE != "" + (t) => t.NON_CONFORMANCE != null && t.NON_CONFORMANCE != '' ); let tmpData = dataTemp.map((item, i) => { - item["ROW_NO"] = i + 1; + item['ROW_NO'] = i + 1; return item; }); let aa = { - CONTENTS: "合计扣分:", + CONTENTS: '合计扣分:', NON_STANDARDIZED_SCORE: this.state.standardScore.NON_STANDARDIZED_SCORE, }; tmpData.push(aa); @@ -1465,15 +1399,14 @@ class GroupHome extends React.Component { } else { let dataTemp = this.state.standardScore.Nav_Details; let tmpData = dataTemp.map((item, i) => { - item["ROW_NO"] = i + 1; + item['ROW_NO'] = i + 1; return item; }); let aa = { - DESCRIPTION: "合计:", + DESCRIPTION: '合计:', STANDARDIZED_SCORE: this.state.standardScore.STAND_TOTAL, RESULT_SCORE: this.state.standardScore.RESULT_TOTAL, - NON_CONFORMANCE: - "标准化得分:" + this.state.standardScore.STANDARDIZED_RESULT, + NON_CONFORMANCE: '标准化得分:' + this.state.standardScore.STANDARDIZED_RESULT, }; tmpData.push(aa); this.setState({ @@ -1513,22 +1446,24 @@ class GroupHome extends React.Component { 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 += "风险管理统计分析"; + ? '选矿厂' + : 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 = { @@ -1556,8 +1491,8 @@ class GroupHome extends React.Component { detailFormClose = () => { var detailForm = { isShow: false, - formCode: "", - title: "", + formCode: '', + title: '', }; this.setState({ detailForm: detailForm, @@ -1587,16 +1522,15 @@ class GroupHome extends React.Component { }; const empty = ; return ( -
-
+
@@ -1683,35 +1617,35 @@ class GroupHome extends React.Component { onClick={() => this.showStandardScoreTotalModal()} style={{ // padding: "0px", - height: "236px", - borderRadius: "10px", - padding: "10px", - cursor: "pointer", + height: '236px', + borderRadius: '10px', + padding: '10px', + cursor: 'pointer', }} className="backlog-background-style4" >
{/* {83.6} */} @@ -1721,9 +1655,9 @@ class GroupHome extends React.Component {
标准化得分 @@ -1736,7 +1670,7 @@ class GroupHome extends React.Component {
- +
-

- {safetySloganOne || '暂无公告'} -

+

{safetySloganOne || '暂无公告'}

@@ -1761,75 +1693,63 @@ class GroupHome extends React.Component {
this.totalModuleClick(item)} - onDoubleClick={() => - this.totalMoonDoubleClick(item) - } + onDoubleClick={() => this.totalMoonDoubleClick(item)} style={{ - padding: "0px", - height: "176px", - borderRadius: "10px", - cursor: "pointer", + 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" + 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}
9999 - ? "backlog-style4" - : "backlog-style" - } - > - {item.total} -
-
- {item.title} -
-
@@ -1844,55 +1764,42 @@ class GroupHome extends React.Component { {/* 通知 */} - +
- + 风险等级占比
{this.state.riskLevelPage.length > 0 ? ( -
- this.showDetailModal("BI013_RISKANALYSISMODEL") - } - > +
this.showDetailModal('BI013_RISKANALYSISMODEL')}>
) : null}
- {this.state.riskLevelPage.length > 0 ? ( - - ) : null} + {this.state.riskLevelPage.length > 0 ? : null}
@@ -1900,17 +1807,17 @@ class GroupHome extends React.Component { {/* 列表 */} - +
- +
- + - - + + - - + + @@ -1991,9 +1890,7 @@ class GroupHome extends React.Component { dataSource={this.state.retDataAll} columns={this.state.searchColumns} pagination={this.state.pagination} - onChange={(num) => - this.getBaseInfoData(num, this.state.currentpageIndex, null) - } + onChange={(num) => this.getBaseInfoData(num, this.state.currentpageIndex, null)} loading={this.state.showLoading} size="small" /> @@ -2010,19 +1907,19 @@ class GroupHome extends React.Component { >
- +
- + - + - + - + - - - ); - })} - - ), - }], - scoreColumns: [ + scoreNoneColumns: [ { - width: "80px", - title: "生产单元", - dataIndex: "Nav_ProductionUnit.NAME", - key: "Nav_ProductionUnit.NAME", + 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_Primary.NAME', + key: 'Nav_Primary.NAME', }, { - width: "80px", - title: "二级要素", - dataIndex: "Nav_Second.NAME", - key: "Nav_Second.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: "50px", - title: "考评项目", - dataIndex: "EVALUATION_ITEM", - key: "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) => ( - { - this.props.app.enums?.PEEvaluationItemEnum.enums[ - record.EVALUATION_ITEM - ] - } + {record.Nav_EvaluationMethod && + record.Nav_EvaluationMethod?.map((item, i) => { + return ( + + + + ); + })} ), }, + ], + 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", + title: '考评内容', + dataIndex: 'CONTENTS', + key: 'CONTENTS', }, { - width: "100px", - title: "评分办法", - dataIndex: "DESCRIPTION", - key: "DESCRIPTION", + width: '100px', + title: '评分办法', + dataIndex: 'DESCRIPTION', + key: 'DESCRIPTION', }, { - width: "50px", - title: "标准分", - dataIndex: "STANDARDIZED_SCORE", - key: "STANDARDIZED_SCORE", + width: '50px', + title: '标准分', + dataIndex: 'STANDARDIZED_SCORE', + key: 'STANDARDIZED_SCORE', }, { - width: "50px", - title: "实得分", - dataIndex: "RESULT_SCORE", - key: "RESULT_SCORE", + width: '50px', + title: '实得分', + dataIndex: 'RESULT_SCORE', + key: 'RESULT_SCORE', }, { - width: "200px", - title: "不符合说明", - dataIndex: "NON_CONFORMANCE", - key: "NON_CONFORMANCE", + width: '200px', + title: '不符合说明', + dataIndex: 'NON_CONFORMANCE', + key: 'NON_CONFORMANCE', }, , { - width: "80px", - title: "评价结论", - dataIndex: "EVALUATION_RESULT", - key: "EVALUATION_RESULT", + width: '80px', + title: '评价结论', + dataIndex: 'EVALUATION_RESULT', + key: 'EVALUATION_RESULT', render: (text, record) => ( - - { - this.props.app.enums?.PEEvaluationResultEnum.enums[ - record.EVALUATION_RESULT - ] - } - + {this.props.app.enums?.PEEvaluationResultEnum.enums[record.EVALUATION_RESULT]} ), }, { - width: "100px", - title: "评价方法", - dataIndex: "Nav_EvaluationMethod", - key: "Nav_EvaluationMethod", + width: '100px', + title: '评价方法', + dataIndex: 'Nav_EvaluationMethod', + key: 'Nav_EvaluationMethod', render: (text, record) => ( {record.Nav_EvaluationMethod && @@ -441,48 +401,41 @@ class Home extends React.Component { ], scoreTotalColumns: [ { - title: "生产单元", - dataIndex: "Nav_ProductionUnit.NAME", - key: "Nav_ProductionUnit.NAME", + title: '生产单元', + dataIndex: 'Nav_ProductionUnit.NAME', + key: 'Nav_ProductionUnit.NAME', }, { - title: "标准化得分", - dataIndex: "NON_STANDARDIZED_SCORE", - key: "NON_STANDARDIZED_SCORE", + title: '标准化得分', + dataIndex: 'NON_STANDARDIZED_SCORE', + key: 'NON_STANDARDIZED_SCORE', }, { - title: "操作", - dataIndex: "", - key: "", + title: '操作', + dataIndex: '', + key: '', render: (text, record) => ( { - {" "} - - + {' '} + + } ), }, - ] - }) + ], + }); this.getTeam(); - this.getHomeTitle() + this.getHomeTitle(); //定时器功能,暂时不开启 - this.timerID = setInterval( - () => { - if (this._isMounted) { - this.getBaseInfoData(1, this.state.tableKey, 5) - } - }, - 120000 - ); + this.timerID = setInterval(() => { + if (this._isMounted) { + this.getBaseInfoData(1, this.state.tableKey, 5); + } + }, 120000); this.showModalSign(); this.getBaseInfoData(1, 1, 5); this.setMessageData(); @@ -496,65 +449,64 @@ class Home extends React.Component { } showModalSign = () => { - var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + var userId = storage('lacal').getItem('userid')?.val; //登录后有存储登录信息 + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 let json = initFilter(orgId); this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "FM/User/UserSign", //验证是否有签名照 + url: 'FM/User/UserSign', //验证是否有签名照 onComplete: (ret) => { //返回查询结果ret - if (this._isMounted&&ret) { + if (this._isMounted && ret) { //判断是否有记录 - openNotification("topRight"); + openNotification('topRight'); } }, }); }; getHomeTitle = () => { - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 let json = initFilter(orgId); this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "PF/HomeTitle/OrderPaged", + url: 'PF/HomeTitle/OrderPaged', onComplete: (ret) => { - if (this._isMounted&&ret) { - const safetySlogan = ret[0].TITLE; + if (this._isMounted && ret) { + const safetySlogan = ret[0].TITLE; // 计算文本长度(中文按1个字符,英文/数字按0.5个字符计算) - const charCount = safetySlogan.replace(/[a-zA-Z0-9]/g, 'aa').length; + const charCount = safetySlogan.replace(/[a-zA-Z0-9]/g, 'aa').length; - // 设置基础速率:每4个字符需要1秒 - const baseSpeed = 4; - // 计算动画时间(最低5秒,最高60秒) - const duration = Math.max(5, Math.min(60, charCount / baseSpeed)); + // 设置基础速率:每4个字符需要1秒 + const baseSpeed = 4; + // 计算动画时间(最低5秒,最高60秒) + const duration = Math.max(5, Math.min(60, charCount / baseSpeed)); this.setState({ safetySloganOne: safetySlogan, // safetySloganOne: "1.安全方针:以人为本、关注健康、依法治企、安全发展。 2.安全理念:一切风险皆可控,一切事故皆可防!3.安全方针:以人为本、关注健康、依法治企、安全发展。4.安全方针:以人为本、关注健康、依法治企、安全发展。5.安全方针:以人为本、关注健康、依法治企、安全发展。 6.安全理念:一切风险皆可控,一切事故皆可防!7.安全方针:以人为本、关注健康、依法治企、安全发展。8.安全方针:以人为本、关注健康、依法治企、安全发展。", animationDuration: duration, sliderColor: ret[0].COCOR, - sliderSize: ret[0].FONTSIZE - + sliderSize: ret[0].FONTSIZE, }); } }, }); - } + }; getTeam = () => { - var userId = storage("lacal").getItem("userid")?.val; //登录后有存储登录信息 - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 + var userId = storage('lacal').getItem('userid')?.val; //登录后有存储登录信息 + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 let json = initFilter(orgId); - extendRule(json, "ID", 1, userId); - extendInclude(json, "Nav_Department"); + extendRule(json, 'ID', 1, userId); + extendInclude(json, 'Nav_Department'); this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "FM/User/Get", + url: 'FM/User/Get', onComplete: (ret) => { - if (this._isMounted&&ret && ret.Nav_Department) { + if (this._isMounted && ret && ret.Nav_Department) { this.setState({ departmentName: ret.Nav_Department.NAME, deparmentType: ret.Nav_Department.DEPARTMENT_TYPE, @@ -571,8 +523,8 @@ class Home extends React.Component { }; getStandardScore = (MineType) => { //标准化得分 - var orgId = storage("lacal").getItem("webOrgId")?.val; //登录后有存储登录信息 - let json = ""; + var orgId = storage('lacal').getItem('webOrgId')?.val; //登录后有存储登录信息 + let json = ''; if (this.state.mineType) { json = initFilter(orgId, this.state.mineType); } else { @@ -580,17 +532,14 @@ class Home extends React.Component { } this.props.dispatch({ - type: "app/getDataByPost", + type: 'app/getDataByPost', payload: json, - url: "PE/PESafetyEvaluationRecord/HomeGet", + 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), + stardardScoreQty: ((ret.RESULT_TOTAL / ret.STAND_TOTAL) * 100).toFixed(2), }); } }, @@ -598,8 +547,8 @@ class Home extends React.Component { }; getEnums = () => { this.props.dispatch({ - type: "app/getDataByGet", - url: "PF/Extend/GetAllEnum", + type: 'app/getDataByGet', + url: 'PF/Extend/GetAllEnum', onComplete: (ret) => { if (ret) { this.enums = ret; @@ -609,16 +558,11 @@ class Home extends React.Component { }; //班组作业完成率前八 departmentCompletion = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; - let json = initFilter( - this.props.login.OrgId, - this.state.mineType, - "NUM", - "desc" - ); + 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", + type: 'app/getDataByPost', + url: 'BI/BIStatiscialAnalysisController/GetDepartmentCompletionSort', payload: json, onlyData: false, onComplete: (data) => { @@ -634,16 +578,11 @@ class Home extends React.Component { }; //工作票完成情况统计图 workTicket = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; - let json = initFilter( - this.props.login.OrgId, - this.state.mineType, - "NUM", - "desc" - ); + 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", + type: 'app/getDataByPost', + url: 'BI/BIStatiscialAnalysisController/GetJobCompletionSort', payload: json, onlyData: false, onComplete: (data) => { @@ -659,11 +598,11 @@ class Home extends React.Component { }; // hiddenDanger hiddenDanger = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; - let json = initFilter(this.props.login.OrgId, this.state.mineType, "NUM"); + 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", + type: 'app/getDataByPost', + url: 'BI/BIHome/GetHomeInfo', payload: json, onlyData: false, onComplete: (data) => { @@ -679,13 +618,13 @@ class Home extends React.Component { }; //风险等级占比 riskLevel = () => { - const userInfo = storage("lacal").getItem("webUserInfo").val; + 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); + extendOrder(json, 'NUM', 0); + extendRule(json, 'COLOR', 1, this.state.mineType); this.props.dispatch({ - type: "app/getDataByPost", - url: "FM/RiskLevelProportion/OrderPaged", + type: 'app/getDataByPost', + url: 'FM/RiskLevelProportion/OrderPaged', payload: json, onlyData: false, onComplete: (data) => { @@ -702,30 +641,30 @@ class Home extends React.Component { //获取数据 getBaseInfoData = (pagination, key, limit) => { const current = pagination ? pagination.current : 1; - const json = initFilter(this.props.login.OrgId, "", "CODE", 1, current); + 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 == 'searchName') { + extendRule(json, 'NOTICE_TITLE', 9, querySearch[item]); } - if (item == "searchCode") { - extendRule(json, "CODE", 9, querySearch[item]); + if (item == 'searchCode') { + extendRule(json, 'CODE', 9, querySearch[item]); } - if (item == "startTime1") { - extendRule(json, "TASK_STARTDT", 6, querySearch[item]); + if (item == 'startTime1') { + extendRule(json, 'TASK_STARTDT', 6, querySearch[item]); } - if (item == "startTime2") { - extendRule(json, "TASK_STARTDT", 4, querySearch[item]); + if (item == 'startTime2') { + extendRule(json, 'TASK_STARTDT', 4, querySearch[item]); } - if (item == "endTime1") { - extendRule(json, "TASK_ENDDT", 6, querySearch[item]); + if (item == 'endTime1') { + extendRule(json, 'TASK_ENDDT', 6, querySearch[item]); } - if (item == "endTime2") { - extendRule(json, "TASK_ENDDT", 4, querySearch[item]); + if (item == 'endTime2') { + extendRule(json, 'TASK_ENDDT', 4, querySearch[item]); } - if (item == "searchStatus") { - extendRule(json, "NOTICE_STATUS", 1, querySearch[item]); + if (item == 'searchStatus') { + extendRule(json, 'NOTICE_STATUS', 1, querySearch[item]); } } json.Limit = limit; @@ -733,12 +672,12 @@ class Home extends React.Component { json.Parameter1 = key; //1待办事项2已办事项3今日新增4待办超时 this.props.dispatch({ - type: "app/getDataByPost", - url: "FM/FMNotificationTask/HomeOrderPaged", + type: 'app/getDataByPost', + url: 'FM/FMNotificationTask/HomeOrderPaged', payload: json, onlyData: false, onComplete: (re) => { - if (this._isMounted&&re && re.IsSuccessful && re.Data.newData) { + if (this._isMounted && 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; @@ -764,11 +703,11 @@ class Home extends React.Component { clearData = () => { let newtmpData = { ...this.state.tmpData }; - if (newtmpData["data"] != null) { - newtmpData["data"].id = ""; - newtmpData["data"].homeReload = false; + if (newtmpData['data'] != null) { + newtmpData['data'].id = ''; + newtmpData['data'].homeReload = false; } - newtmpData.formCode = ""; + newtmpData.formCode = ''; this.setState({ visible: false, tmpData: [], //newtmpData @@ -782,7 +721,11 @@ class Home extends React.Component { }; handleCancel = () => { // 退出弹窗 - this.getBaseInfoData(1, this.state.tableKey, 5); + if (this.state.isDoubleClick) { + this.getBaseInfoData(1, this.state.tableKey, null); + } else { + this.getBaseInfoData(1, this.state.tableKey, 5); + } this.clearData(); }; closeModal = () => { @@ -819,7 +762,7 @@ class Home extends React.Component { noticeTitle: title, taskCode: taskCode, tmpData: newtmpData, - currActivatedMenu: "", + currActivatedMenu: '', }, () => this.setState({ @@ -827,15 +770,7 @@ class Home extends React.Component { }) ); }; - showTodayModal = ( - dataId, - formCode, - TaskID, - title, - taskCode, - taskStartdt, - taskStatus - ) => { + showTodayModal = (dataId, formCode, TaskID, title, taskCode, taskStartdt, taskStatus) => { const newtmpData = { data: { id: dataId, @@ -848,14 +783,14 @@ class Home extends React.Component { taskStatus: taskStatus, homeReload: true, }, - formCode: "PF135", + formCode: 'PF135', }; this.setState( { - noticeTitle: "今日提醒", + noticeTitle: '今日提醒', taskCode: taskCode, tmpData: newtmpData, - currActivatedMenu: "", + currActivatedMenu: '', }, () => this.setState({ @@ -872,13 +807,13 @@ class Home extends React.Component { const { tableData } = this.state; tableData.map((_item, i) => { if (_item.key == item.key) { - if (item.key == "2") { + if (item.key == '2') { this.state.columns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( ( this.ShowStatus(record), }, ]; } else { this.state.columns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( this.ShowState(record), }, ]; } - _item.iconDisplay = "block"; + _item.iconDisplay = 'block'; this.setState({ tableKey: item.key, + isDoubleClick: false, }); - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { this.getBaseInfoData(1, item.key, 10); } else { this.getBaseInfoData(1, item.key, 5); } } else { - _item.iconDisplay = "none"; + _item.iconDisplay = 'none'; } }); }; @@ -1015,13 +951,13 @@ class Home extends React.Component { const { tableData } = this.state; tableData.map((_item) => { if (_item.key == item.key) { - if (item.key == "2") { + if (item.key == '2') { this.state.searchColumns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( ( this.ShowStatus(record), }, ]; @@ -1108,10 +1044,10 @@ class Home extends React.Component { } else { this.state.searchColumns = [ { - width: "450px", - title: "任务名称", - dataIndex: "NOTICE_TITLE", - key: "NOTICE_TITLE", + width: '450px', + title: '任务名称', + dataIndex: 'NOTICE_TITLE', + key: 'NOTICE_TITLE', render: (text, record) => ( this.ShowState(record), }, ]; @@ -1159,6 +1095,7 @@ class Home extends React.Component { { tableData, currentpageIndex: item.key, + isDoubleClick: true, }, () => { this.getBaseInfoData(1, item.key); @@ -1173,7 +1110,7 @@ class Home extends React.Component { { querySearch, }, - () => { } + () => {} ); }; // 开始时间 @@ -1187,17 +1124,13 @@ class Home extends React.Component { 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" - ); + 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, }, - () => { } + () => {} ); }; // 结束时间 @@ -1211,12 +1144,8 @@ class Home extends React.Component { 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" - ); + 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 }); }; // 搜索 @@ -1224,48 +1153,47 @@ class Home extends React.Component { this.getBaseInfoData(1, item, null); }; closeTasks() { - const json = initFilter(this.props.login.OrgId, "", "CODE", 1); + const json = initFilter(this.props.login.OrgId, '', 'CODE', 1); let ids = []; let names = []; - this.state.taskSelects.forEach(element => { + this.state.taskSelects.forEach((element) => { ids.push(element.ID); - names.push( - { - title: element.NOTICE_TITLE, - startTime: element.TASK_STARTDT, - endTime: element.TASK_ENDDT, - }); + names.push({ + title: element.NOTICE_TITLE, + startTime: element.TASK_STARTDT, + endTime: element.TASK_ENDDT, + }); }); - json.Parameter1 = ids.join(","); + json.Parameter1 = ids.join(','); json.Parameter2 = JSON.stringify(names); this.props.dispatch({ - type: "app/getDataByPost", - url: "BI/BITask/CloseTask", + 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": + case 'searchName': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; - case "searchCode": + case 'searchCode': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; - case "searchType": + case 'searchType': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; - case "searchContent": + case 'searchContent': querySearch[e.target.name] = e.target.value; this.setState({ querySearch }); break; @@ -1278,25 +1206,24 @@ class Home extends React.Component { this.setState({ searchVisible: false, searchTodayVisible: false, - querySearch: {} + querySearch: {}, }); }; ShowState(obj) { - var thisResult = - (Date.parse(obj.TASK_ENDDT) - Date.parse(Date())) / 3600 / 1000; + var thisResult = (Date.parse(obj.TASK_ENDDT) - Date.parse(Date())) / 3600 / 1000; if (thisResult > 0) { - return "正常"; + return '正常'; } else { - return 超期; + return 超期; } } ShowStatus(obj) { if (obj.NOTICE_STATUS === 0) { - return 未读; + return 未读; } else if (obj.NOTICE_STATUS === 3) { - return 已读; + return 已读; } else { - return "已办"; + return '已办'; } } handleSelect = (e) => { @@ -1304,7 +1231,7 @@ class Home extends React.Component { if (e != undefined) { querySearch.status = e; } else { - querySearch.status = ""; + querySearch.status = ''; } this.setState({ querySearch }); }; @@ -1324,14 +1251,14 @@ class Home extends React.Component { } if (item) { let dataTemp = this.state.standardScore.Nav_Details.filter( - (t) => t.NON_CONFORMANCE != null && t.NON_CONFORMANCE != "" + (t) => t.NON_CONFORMANCE != null && t.NON_CONFORMANCE != '' ); let tmpData = dataTemp.map((item, i) => { - item["ROW_NO"] = i + 1; + item['ROW_NO'] = i + 1; return item; }); let aa = { - CONTENTS: "合计扣分:", + CONTENTS: '合计扣分:', NON_STANDARDIZED_SCORE: this.state.standardScore.NON_STANDARDIZED_SCORE, }; tmpData.push(aa); @@ -1343,15 +1270,14 @@ class Home extends React.Component { } else { let dataTemp = this.state.standardScore.Nav_Details; let tmpData = dataTemp.map((item, i) => { - item["ROW_NO"] = i + 1; + item['ROW_NO'] = i + 1; return item; }); let aa = { - DESCRIPTION: "合计:", + DESCRIPTION: '合计:', STANDARDIZED_SCORE: this.state.standardScore.STAND_TOTAL, RESULT_SCORE: this.state.standardScore.RESULT_TOTAL, - NON_CONFORMANCE: - "标准化得分:" + this.state.standardScore.STANDARDIZED_RESULT, + NON_CONFORMANCE: '标准化得分:' + this.state.standardScore.STANDARDIZED_RESULT, }; tmpData.push(aa); this.setState({ @@ -1391,22 +1317,24 @@ class Home extends React.Component { 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 += "风险管理统计分析"; + ? '选矿厂' + : 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 = { @@ -1434,8 +1362,8 @@ class Home extends React.Component { detailFormClose = () => { var detailForm = { isShow: false, - formCode: "", - title: "", + formCode: '', + title: '', }; this.setState({ detailForm: detailForm, @@ -1465,16 +1393,15 @@ class Home extends React.Component { }; const empty = ; return ( -
-
+
@@ -1561,35 +1488,35 @@ class Home extends React.Component { onClick={() => this.showStandardScoreTotalModal()} style={{ // padding: "0px", - height: "236px", - borderRadius: "10px", - padding: "10px", - cursor: "pointer", + height: '236px', + borderRadius: '10px', + padding: '10px', + cursor: 'pointer', }} className="backlog-background-style4" >
{/* {83.6} */} @@ -1599,9 +1526,9 @@ class Home extends React.Component {
标准化得分 @@ -1614,7 +1541,7 @@ class Home extends React.Component {
@@ -1639,75 +1564,63 @@ class Home extends React.Component {
this.totalModuleClick(item)} - onDoubleClick={() => - this.totalMoonDoubleClick(item) - } + onDoubleClick={() => this.totalMoonDoubleClick(item)} style={{ - padding: "0px", - height: "176px", - borderRadius: "10px", - cursor: "pointer", + 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" + 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}
9999 - ? "backlog-style4" - : "backlog-style" - } - > - {item.total} -
-
- {item.title} -
-
@@ -1722,55 +1635,42 @@ class Home extends React.Component { {/* 通知 */} -
+ +
- + - - + + - - + + @@ -1869,9 +1761,7 @@ class Home extends React.Component { dataSource={this.state.retDataAll} columns={this.state.searchColumns} pagination={this.state.pagination} - onChange={(num) => - this.getBaseInfoData(num, this.state.currentpageIndex, null) - } + onChange={(num) => this.getBaseInfoData(num, this.state.currentpageIndex, null)} loading={this.state.showLoading} size="small" /> @@ -1888,19 +1778,19 @@ class Home extends React.Component { >
- +
- + - + - + - +