diff --git a/src/components/CustomPages/FO/FO035ShowPrint.js b/src/components/CustomPages/FO/FO035ShowPrint.js new file mode 100644 index 0000000..a53d47d --- /dev/null +++ b/src/components/CustomPages/FO/FO035ShowPrint.js @@ -0,0 +1,158 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showUserSign } from "../../../utils/common"; +import ReactToPrint from "react-to-print"; +import stylesStep from '../HI/StepForm.css'; +import config from "../../../config"; +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +class FO035ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: null, + BtnAgreeDisplay: 'none' + }; + }; + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOTechDisclosureFromTech/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + BtnClose = () => { + if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function') + this.props.data.onCancel(); + } + + loadData = (dataId) => { + let json = initFilter(this.props.login.OrgId); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOTechDisclosureFromTech/GetEdit', + onComplete: (ret) => { + if (ret) { + if(this.props.data && this.props.data.loadDataDeal) + { + this.props.data.loadDataDeal(1); + } + this.setState({ data: ret }) + if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) { + this.setState({ BtnAgreeDisplay: 'none' }) + }else{ + this.setState({ BtnAgreeDisplay: 'inline' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + onTableBtnExport() { + let TableWrap = document.getElementById('tableId' + this.props.data.id); + let Table = TableWrap.getElementsByTagName('table')[0]; + const wb = XLSX.utils.table_to_book(Table); + XLSX.writeFile(wb, "技术交底表.xlsx") + } + + render() { + const { data } = this.state; + return
+
+ } + content={() => this.componentRef} + pageStyle=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

技术交底表

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + // {data.Nav_User?.NAME} + // :data.Nav_User?.NAME + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + // if (item.Nav_User != null && item.Nav_User.FILE_PATH != null) + // return {item.Nav_User?.NAME} + // else + // return + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO035ShowPrint) \ No newline at end of file diff --git a/src/components/CustomPages/FO/FO037ShowPrint.js b/src/components/CustomPages/FO/FO037ShowPrint.js new file mode 100644 index 0000000..73869af --- /dev/null +++ b/src/components/CustomPages/FO/FO037ShowPrint.js @@ -0,0 +1,158 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showUserSign } from "../../../utils/common"; +import ReactToPrint from "react-to-print"; +import stylesStep from '../HI/StepForm.css'; +import config from "../../../config"; +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +class FO037ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: null, + BtnAgreeDisplay: 'none' + }; + }; + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOTechDisclosureFromSafe/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + BtnClose = () => { + if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function') + this.props.data.onCancel(); + } + + loadData = (dataId) => { + let json = initFilter(this.props.login.OrgId); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOTechDisclosureFromSafe/GetEdit', + onComplete: (ret) => { + if (ret) { + if(this.props.data && this.props.data.loadDataDeal) + { + this.props.data.loadDataDeal(1); + } + this.setState({ data: ret }) + if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) { + this.setState({ BtnAgreeDisplay: 'none' }) + }else{ + this.setState({ BtnAgreeDisplay: 'inline' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + onTableBtnExport() { + let TableWrap = document.getElementById('tableId' + this.props.data.id); + let Table = TableWrap.getElementsByTagName('table')[0]; + const wb = XLSX.utils.table_to_book(Table); + XLSX.writeFile(wb, "安全交底表.xlsx") + } + + render() { + const { data } = this.state; + return
+
+ } + content={() => this.componentRef} + pageStyle=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

安全交底表

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + // {data.Nav_User?.NAME} + // :data.Nav_User?.NAME + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + // if (item.Nav_User != null && item.Nav_User.FILE_PATH != null) + // return {item.Nav_User?.NAME} + // else + // return + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO037ShowPrint) \ No newline at end of file diff --git a/src/components/CustomPages/FO/FO041ShowPrint.js b/src/components/CustomPages/FO/FO041ShowPrint.js new file mode 100644 index 0000000..b01ea89 --- /dev/null +++ b/src/components/CustomPages/FO/FO041ShowPrint.js @@ -0,0 +1,153 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showFiles, GetFileModel,showUserSign } from "../../../utils/common"; +import ReactToPrint from "react-to-print"; +import stylesStep from '../HI/StepForm.css'; +import config from "../../../config"; +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +class FO041ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: null, + BtnAgreeDisplay: 'none' + }; + }; + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOLeaderWellRecord/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + BtnClose = () => { + if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function') + this.props.data.onCancel(); + } + + loadData = (dataId) => { + let json = initFilter(this.props.login.OrgId); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOLeaderWellRecord/GetEdit', + onComplete: (ret) => { + if (ret) { + if(this.props.data && this.props.data.loadDataDeal) + { + this.props.data.loadDataDeal(1); + } + this.setState({ data: ret }) + if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) { + this.setState({ BtnAgreeDisplay: 'none' }) + }else{ + this.setState({ BtnAgreeDisplay: 'inline' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + onTableBtnExport() { + let TableWrap = document.getElementById('tableId' + this.props.data.id); + let Table = TableWrap.getElementsByTagName('table')[0]; + const wb = XLSX.utils.table_to_book(Table); + XLSX.writeFile(wb, "领导带班下井记录.xlsx") + } + + render() { + const { data } = this.state; + return
+
+ } + content={() => this.componentRef} + pageStyle=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

领导带班下井记录

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO041ShowPrint) \ No newline at end of file diff --git a/src/components/CustomPages/FO/FO043ShowPrint.js b/src/components/CustomPages/FO/FO043ShowPrint.js new file mode 100644 index 0000000..49a7819 --- /dev/null +++ b/src/components/CustomPages/FO/FO043ShowPrint.js @@ -0,0 +1,153 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showFiles, GetFileModel,showUserSign } from "../../../utils/common"; +import ReactToPrint from "react-to-print"; +import stylesStep from '../HI/StepForm.css'; +import config from "../../../config"; +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +class FO043ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: null, + BtnAgreeDisplay: 'none' + }; + }; + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOLeaderWellRecord/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + BtnClose = () => { + if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function') + this.props.data.onCancel(); + } + + loadData = (dataId) => { + let json = initFilter(this.props.login.OrgId); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOLeaderWellRecord/GetEdit', + onComplete: (ret) => { + if (ret) { + if(this.props.data && this.props.data.loadDataDeal) + { + this.props.data.loadDataDeal(1); + } + this.setState({ data: ret }) + if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) { + this.setState({ BtnAgreeDisplay: 'none' }) + }else{ + this.setState({ BtnAgreeDisplay: 'inline' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + onTableBtnExport() { + let TableWrap = document.getElementById('tableId' + this.props.data.id); + let Table = TableWrap.getElementsByTagName('table')[0]; + const wb = XLSX.utils.table_to_book(Table); + XLSX.writeFile(wb, "领导带班下井记录.xlsx") + } + + render() { + const { data } = this.state; + return
+
+ } + content={() => this.componentRef} + pageStyle=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

领导带班下井记录

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO043ShowPrint) \ No newline at end of file diff --git a/src/components/CustomPages/FO/FO045ShowPrint.js b/src/components/CustomPages/FO/FO045ShowPrint.js new file mode 100644 index 0000000..a80fc6e --- /dev/null +++ b/src/components/CustomPages/FO/FO045ShowPrint.js @@ -0,0 +1,153 @@ +import { message } from "antd/lib/index"; +import { Button,Descriptions, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude,extendIgnoreDataRule, setDataFieldValue, guid, initQueryFilter,showFiles, GetFileModel,showUserSign } from "../../../utils/common"; +import ReactToPrint from "react-to-print"; +import stylesStep from '../HI/StepForm.css'; +import config from "../../../config"; +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +class FO045ShowPrint extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + enumData: null, + BtnAgreeDisplay: 'none' + }; + }; + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'FO/FOLeaderWellRecord/PersonalAgree', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } + + BtnClose = () => { + if (typeof this.props.data.onCancel != "undefined"&&typeof this.props.data.onCancel == 'function') + this.props.data.onCancel(); + } + + loadData = (dataId) => { + let json = initFilter(this.props.login.OrgId); + extendRule(json, 'ID', 1, dataId); + extendIgnoreDataRule(json) + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'FO/FOLeaderWellRecord/GetEdit', + onComplete: (ret) => { + if (ret) { + if(this.props.data && this.props.data.loadDataDeal) + { + this.props.data.loadDataDeal(1); + } + this.setState({ data: ret }) + if (this.props.data.tableKey=="2" ||this.props.data.tableKey==undefined) { + this.setState({ BtnAgreeDisplay: 'none' }) + }else{ + this.setState({ BtnAgreeDisplay: 'inline' }) + } + } + else + { message.error('请先尝试刷新,若仍然加载失败,请联系管理员排查!');} + } + }); + } + + onTableBtnExport() { + let TableWrap = document.getElementById('tableId' + this.props.data.id); + let Table = TableWrap.getElementsByTagName('table')[0]; + const wb = XLSX.utils.table_to_book(Table); + XLSX.writeFile(wb, "领导带班下井记录.xlsx") + } + + render() { + const { data } = this.state; + return
+
+ } + content={() => this.componentRef} + pageStyle=".printDIV { padding:0 40px;} img{width :120px}" + /> + + +
+ + + {/* */} +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id} className="printDIV"> + +

领导带班下井记录

+ { + data ? +
+ + {data.CODE} + {data.NAME} + {data.DISCLOSURE_DATE} + {data.JOB_LOCATION} + {data.Nav_User ? data.Nav_User.NAME : ''} + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (i == (data.Nav_Person.length - 1)) { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + } else { + if (item.DEAL_STATUS == 0) + return + else + return item.Nav_User?.NAME + ' ' + } + }) + } + {data.DisclosureContent} + { + (data.Nav_User && data.Nav_User.FILE_PATH)? + showUserSign(data.Nav_User, config.picServerHost):null + + } + { + data.Nav_Person && data.Nav_Person.map((item, i) => { + if (item.DEAL_STATUS == 1) { + showUserSign(item.Nav_User, config.picServerHost) + } + }) + } + +
: null + } +
+
+ } + +} +export default connect(({ login }) => ({ login }))(FO045ShowPrint) \ No newline at end of file diff --git a/src/components/CustomPages/SK/OperateLog.css b/src/components/CustomPages/SK/OperateLog.css new file mode 100644 index 0000000..3356e7d --- /dev/null +++ b/src/components/CustomPages/SK/OperateLog.css @@ -0,0 +1,265 @@ +.flowchart { + display: flex; + flex-wrap: wrap; + /* 关键:内容过多时自动换行 */ + gap: 16px; + /* 项之间的间距 */ + padding: 10px 0; + width: 100%; + /* 确保容器宽度充足 */ +} + +.logListContainer { + padding-left: 30px; + /* 确保左侧始终有30px间距 */ + width: calc(100% - 180px); + /* 减去左侧步骤区域的宽度,避免溢出 */ +} + +/* 单个日志项样式 - 控制最小宽度避免过度挤压 */ + + +.step { + width: 100px; + height: 40px; + background-color: #4472C4; + /* #f0f0f0; */ + color: white; + border: 1px solid #ddd; + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; + position: relative; + border-radius: 5px; +} + +.stepno { + width: 100px; + height: 40px; + background-color: #A5A5A5; + /* #f0f0f0; */ + color: white; + border: 1px solid #ddd; + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; + position: relative; + border-radius: 5px; +} + +/* 长方形 */ +.rectangle { + width: 20px; + height: 50px; + /* margin-top: -70px; */ + margin-top: 8px; + margin-left: 45px; + position: relative; + background-color: #ADCDEA; + /* transform: rotate(-40deg); */ + /* 旋转角度 */ +} + +.rectangleno { + width: 20px; + height: 50px; + /* margin-top: -70px; */ + margin-top: 8px; + margin-left: 45px; + position: relative; + background-color: #A5A5A5; + /* transform: rotate(-40deg); */ + /* 旋转角度 */ +} + +.rectangleno::after { + content: ''; + position: absolute; + bottom: -13px; + /* 根据需要调整 */ + left: 50%; + width: 0; + height: 0; + border-left: 20px solid transparent; + border-right: 20px solid transparent; + border-top: 20px solid #A5A5A5; + /* 线条颜色 #ddd*/ + transform: translateX(-50%); +} + +/* 模拟线条 */ +/* .step:not(:last-child)::after { */ +.rectangle::after { + content: ''; + position: absolute; + bottom: -13px; + /* 根据需要调整 */ + left: 50%; + width: 0; + height: 0; + border-left: 20px solid transparent; + border-right: 20px solid transparent; + border-top: 20px solid #ADCDEA; + /* 线条颜色 #ddd*/ + transform: translateX(-50%); +} + +.step::after { + content: ''; + position: absolute; + /* bottom: -13px; */ + /* 根据需要调整 */ + /* left: 50%; */ + margin-left: 150px; + width: 0; + height: 0; + border-top: 20px solid transparent; + border-bottom: 20px solid transparent; + /* border-left: 20px solid transparent; */ + border-left: 20px solid #ADCDEA; + /* border-color: #ADCDEA; */ + /* border: 1px solid #A5A5A5; */ + + + + /* border-left: 20px solid transparent; + border-right: 20px solid transparent; */ + /* border-top: 20px solid #ADCDEA; */ + /* 线条颜色 #ddd*/ + /* transform: translateX(-50%); */ +} + + +/* #ADCDEA 天蓝*/ +/* #70AD47 绿色 */ +/* #A5A5A5 灰色 深 */ +/* #D9D9D9 灰色 */ +/* #FFC000 橙色 浅 */ +/* #ED7D31 橙色 深 */ + + + +/* 横向布局 */ +.flowchartx { + flex-direction: row; + /* justify-content: space-between; */ + /* width: 100%; */ + display: flex; + flex-wrap: wrap; + flex: 1; +} + +/* 横向item */ +.stepx { + /* margin-right: 15px; */ + width: 120px; + height: 40px; + background-color: #70AD47; + color: white; + border: 1px solid white; + /* border: 1px solid #ddd; */ + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; + position: relative; + border-radius: 50px; + margin-left: 25px; +} + +/* 超时处理 */ +.stepxOutTime { + /* margin-right: 15px; */ + width: 120px; + height: 40px; + background-color: #FFC000; + color: white; + border: 1px solid white; + /* border: 1px solid #ddd; */ + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; + position: relative; + border-radius: 50px; + margin-left: 25px; +} + +/* 未处理 */ +.stepxEnable { + /* margin-right: 15px; */ + width: 120px; + height: 40px; + background-color: #A5A5A5; + color: white; + border: 1px solid white; + /* border: 1px solid #ddd; */ + display: flex; + align-items: center; + justify-content: center; + margin-top: 20px; + position: relative; + border-radius: 50px; + margin-left: 25px; +} + +.stepxLeft50 { + margin-left: 50px; +} + +/* 横向箭头线 */ +.linex { + margin-left: 10px; + width: 60px; + height: 5px; + /* margin-top: -70px; */ + /* margin-top: 8px; */ + /* margin-left: -30px; */ + margin-top: 40px; + position: relative; + background-color: #ADCDEA; + /* transform: rotate(-40deg); */ + /* 旋转角度 */ +} + +/* 横向箭头 */ +.linex::after { + content: ''; + position: absolute; + margin-left: 30px; + margin-top: -5px; + width: 0; + height: 0; + border-top: 8px solid transparent; + border-bottom: 8px solid transparent; + border-left: 8px solid #ADCDEA; +} + +.discribeSpan { + display: flex; + width: 120px; + /* width: 100%; */ + height: 70px; + margin-top: -25px; + border-radius: 5px; + background: #D9D9D9; + flex-direction: column; + align-items: flex-start; + margin-left: 25px; +} + + +.discribeSpanUser { + margin-top: 28px; + font-size: smaller; + padding: 0 0 0 5px; +} + +.discribeSpanTime { + font-size: smaller; + padding: 0 0 0 5px; +} + +/* 横向布局 */ \ No newline at end of file diff --git a/src/components/CustomPages/SK/SK006ShowOperateLog.js b/src/components/CustomPages/SK/SK006ShowOperateLog.js index e61c864..78a8b91 100644 --- a/src/components/CustomPages/SK/SK006ShowOperateLog.js +++ b/src/components/CustomPages/SK/SK006ShowOperateLog.js @@ -1,94 +1,100 @@ import { Button, Descriptions, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; import React from 'react'; -import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, ShowDateTime } from '../../../utils/common'; +import { + initFilter, + extendRule, + extendInclude, + setDataFieldValue, + showApprove, + guid, + ShowDateTime, +} from '../../../utils/common.js'; import ReactToPrint from 'react-to-print'; -import { ExportToExcel } from '@woowalker/feui' +import { ExportToExcel } from '@woowalker/feui'; import XLSX from 'xlsx'; import { connect } from 'dva'; import moment from 'moment'; import { message } from 'antd/lib/index'; -import styles from '../../../components/CustomPages/HI/OperateLog.css'; +import styles from './OperateLog.css'; import config from '../../../config.js'; class SK006ShowOperateLog extends React.Component { - constructor(props) { - super(props); - this.state = { - data: null, - riskCount: 1, - riskHeight: 50, - opEnd: null - // dateFirst: [ - // [{ OPERATEPOINT: 10 }, { OPERATEPOINT: 20 }, { OPERATEPOINT: 30 }, { OPERATEPOINT: 40 }], - // [{ OPERATEPOINT: 48 }, { OPERATEPOINT: 50 }, { OPERATEPOINT: 60 }, { OPERATEPOINT: 70 }, { OPERATEPOINT: 80 }], - // [{ OPERATEPOINT: 130 }], - // [ - // [{ OPERATEPOINT: 140 }, { OPERATEPOINT: 150 }, { OPERATEPOINT: 160 }, { OPERATEPOINT: 180 }, { OPERATEPOINT: 190 }, { OPERATEPOINT: 200 }, { OPERATEPOINT: 210 }, { OPERATEPOINT: 220 }] - // ] - // ] - } + constructor(props) { + super(props); + this.state = { + data: null, + riskCount: 1, + riskHeight: 50, + opEnd: null, + // dateFirst: [ + // [{ OPERATEPOINT: 10 }, { OPERATEPOINT: 20 }, { OPERATEPOINT: 30 }, { OPERATEPOINT: 40 }], + // [{ OPERATEPOINT: 48 }, { OPERATEPOINT: 50 }, { OPERATEPOINT: 60 }, { OPERATEPOINT: 70 }, { OPERATEPOINT: 80 }], + // [{ OPERATEPOINT: 130 }], + // [ + // [{ OPERATEPOINT: 140 }, { OPERATEPOINT: 150 }, { OPERATEPOINT: 160 }, { OPERATEPOINT: 180 }, { OPERATEPOINT: 190 }, { OPERATEPOINT: 200 }, { OPERATEPOINT: 210 }, { OPERATEPOINT: 220 }] + // ] + // ] + }; + } + + componentDidMount() { + if (this.props.data?.id) this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); } + } - componentDidMount() { - if (this.props.data?.id) - this.loadData(this.props.data?.id); - } + loadData = (id) => { + var orgId = this.props.login ? this.props.login.OrgId : ''; + let json = initFilter(orgId, id); + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'SK/SKSecurityInspectionNotice/OperateLogView', + onComplete: (ret) => { + if (ret) { + let riskCount = 1; + riskCount = ret.length - 3; + var isEnd = false; + var opEnd = null; + if (ret[ret.length - 1].length == 1 && ret[ret.length - 1][0].OPERATEPOINT == 220) { + isEnd = true; + riskCount = riskCount - 1; + opEnd = ret[ret.length - 1][0]; + } - componentWillReceiveProps(NextProps) { - if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { - this.loadData(NextProps.data?.id); - } - } - - loadData = (id) => { - var orgId = this.props.login ? this.props.login.OrgId : ''; - let json = initFilter(orgId, id); - this.props.dispatch({ - type: 'app/getDataByPost', - payload: json, - url: 'SK/SKSecurityInspectionNotice/SKOrderEntities', - onComplete: (ret) => { - if (ret) { - let riskCount = 1 - riskCount = ret.length - 3 - var isEnd = false - var opEnd = null - if (ret[ret.length - 1].length == 1 && ret[ret.length - 1][0].OPERATEPOINT == 220) { - isEnd = true - riskCount = riskCount - 1 - opEnd = ret[ret.length - 1][0] - } - - let dataRiskMore = [] - if (riskCount > 0) { - var countOpeate = ret.length - if (isEnd) countOpeate-- - for (let i = 4; i < countOpeate; i++) { - dataRiskMore.push(ret[i]) - } - } - if (riskCount == 0) riskCount = 1 - let riskHeight = 65 * riskCount - this.setState({ - data: ret, - dataRiskMore: dataRiskMore, - riskCount: riskCount, - opEnd: opEnd, - riskHeight: riskHeight - }) - } + let dataRiskMore = []; + if (riskCount > 0) { + var countOpeate = ret.length; + if (isEnd) countOpeate--; + for (let i = 4; i < countOpeate; i++) { + dataRiskMore.push(ret[i]); } - }); - } - render() { - const { data, riskCount, dataRiskMore, opEnd, riskHeight } = this.state; - const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; - return
- - - - - {/* + } + if (riskCount == 0) riskCount = 1; + let riskHeight = 65 * riskCount; + this.setState({ + data: ret, + dataRiskMore: dataRiskMore, + riskCount: riskCount, + opEnd: opEnd, + riskHeight: riskHeight, + }); + } + }, + }); + }; + render() { + const { data, riskCount, dataRiskMore, opEnd, riskHeight } = this.state; + const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; + return ( +
+
+ + {/* @@ -96,510 +102,78 @@ class SK006ShowOperateLog extends React.Component { */} - {/* 检查任务 */} - - - - - {/* 检查任务 */} + id="step20" + > + {item1.NAME} + +
+ 用户:{item1.USER_NAME} + + {' '} + 时间:{ShowDateTime(item1.DEAL_DATE, 'MM-dd HH:mm')} + +
+ + {index1 < item.logList.length - 1 ?
: null} + + ); + } + })} + + + + ); + } + })} - {/* 检查记录 */} - - - - - {/* 检查记录 */} + {/* 检查任务 */} - {/* 检查记录汇总 */} - - - - - {/* 检查记录汇总 */} - - {/* 隐患上报 */} - - - - - {/* 隐患上报 */} - - {/* 隐患确认单 */} - - - - - {/* 隐患确认单 */} - - {/* 隐患整改通知 */} - - - - - {/* 隐患整改通知 */} - - {/* 隐患整改记录 */} - - - - - {/* 隐患整改记录 */} - -
-
安全检查通知
-
-
-
- { - data && data[0]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[0].length - 1) { - resultdiv.push( -
- ) - } + {/* 检查任务 */} + + {data && + data?.map((item, index) => { + // 判断当前item的logList中是否所有STATUS都是0 + const allStatusZero = item.logList?.every((log) => log.STATUS === 0); + { + return ( +
+
+
+ {item.FORM_NAME} +
+ {index < data.length - 1 && ( +
+ )} +
+
+
+ {item.logList && + item.logList.map((item1, index1) => { + { + return ( +
+
+
-
-
安全检查记录
-
-
-
- { - data && data[1]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[1].length - 1) { - resultdiv.push( -
- ) - } - } - return resultdiv - }) - } -
-
-
安全检查记录汇总
-
-
-
- { - data && data[2]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[2].length - 1) { - resultdiv.push( -
- ) - } - } - return resultdiv - }) - } - -
-
-
隐患上报
-
-
-
- { - data && data[3]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[3].length - 1) { - resultdiv.push( -
- ) - } - } - return resultdiv - }) - } - -
-
-
隐患确认单
-
-
-
- { - data && data[4]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[4].length - 1) { - resultdiv.push( -
- ) - } - } - return resultdiv - }) - } - -
-
-
隐患整改通知
-
-
-
- { - data && data[5]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[5].length - 1) { - resultdiv.push( -
- ) - } - } - return resultdiv - }) - } - -
-
-
隐患整改记录
- {/*
*/} -
-
- { - data && data[6]?.map((item, index) => { - let resultdiv = [] - for (let i = 0; i < 2; i++) { - if (i == 0) { - resultdiv.push( - item.OPERTETIME ? - ( - //有操作 - item.ISINTTIME ? - (//按时完成 绿色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
- ) - : - ( //超时完成 橙色 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} -
-
) - ) - : - ( - //没有操作 灰色 - item.USRTNAME ? ( - //有用户信息 写入用户 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- 用户:{item.USRTNAME} - 时间: -
-
- ) : ( - //没有用户信息 -
-
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
-
- ) - ) - ) - } else if (index != data[6].length - 1) { - resultdiv.push( -
- ) - } - } - return resultdiv - }) - } - -
-
-
- } + {/* 隐患整改记录 */} + + + + ); + } } -export default connect(({ login, app }) => ({ login, app }))(SK006ShowOperateLog) +export default connect(({ login, app }) => ({ login, app }))(SK006ShowOperateLog); diff --git a/src/components/CustomPages/SK/SK006ShowOperateLogOld.js b/src/components/CustomPages/SK/SK006ShowOperateLogOld.js new file mode 100644 index 0000000..2afc741 --- /dev/null +++ b/src/components/CustomPages/SK/SK006ShowOperateLogOld.js @@ -0,0 +1,605 @@ +import { Button, Descriptions, Badge, Popconfirm, Row, Col, Form, Input, Select, Table } from 'antd'; +import React from 'react'; +import { initFilter, extendRule, extendInclude, setDataFieldValue, showApprove, guid, ShowDateTime } from '../../../utils/common.js'; +import ReactToPrint from 'react-to-print'; +import { ExportToExcel } from '@woowalker/feui' +import XLSX from 'xlsx'; +import { connect } from 'dva'; +import moment from 'moment'; +import { message } from 'antd/lib/index'; +import styles from '../../../components/CustomPages/HI/OperateLog.css'; +import config from '../../../config.js'; + +class SK006ShowOperateLog extends React.Component { + constructor(props) { + super(props); + this.state = { + data: null, + riskCount: 1, + riskHeight: 50, + opEnd: null + // dateFirst: [ + // [{ OPERATEPOINT: 10 }, { OPERATEPOINT: 20 }, { OPERATEPOINT: 30 }, { OPERATEPOINT: 40 }], + // [{ OPERATEPOINT: 48 }, { OPERATEPOINT: 50 }, { OPERATEPOINT: 60 }, { OPERATEPOINT: 70 }, { OPERATEPOINT: 80 }], + // [{ OPERATEPOINT: 130 }], + // [ + // [{ OPERATEPOINT: 140 }, { OPERATEPOINT: 150 }, { OPERATEPOINT: 160 }, { OPERATEPOINT: 180 }, { OPERATEPOINT: 190 }, { OPERATEPOINT: 200 }, { OPERATEPOINT: 210 }, { OPERATEPOINT: 220 }] + // ] + // ] + } + } + + componentDidMount() { + if (this.props.data?.id) + this.loadData(this.props.data?.id); + } + + componentWillReceiveProps(NextProps) { + if (NextProps.data?.id && this.props.data?.id != NextProps.data?.id) { + this.loadData(NextProps.data?.id); + } + } + + loadData = (id) => { + var orgId = this.props.login ? this.props.login.OrgId : ''; + let json = initFilter(orgId, id); + this.props.dispatch({ + type: 'app/getDataByPost', + payload: json, + url: 'SK/SKSecurityInspectionNotice/SKOrderEntities', + onComplete: (ret) => { + if (ret) { + let riskCount = 1 + riskCount = ret.length - 3 + var isEnd = false + var opEnd = null + if (ret[ret.length - 1].length == 1 && ret[ret.length - 1][0].OPERATEPOINT == 220) { + isEnd = true + riskCount = riskCount - 1 + opEnd = ret[ret.length - 1][0] + } + + let dataRiskMore = [] + if (riskCount > 0) { + var countOpeate = ret.length + if (isEnd) countOpeate-- + for (let i = 4; i < countOpeate; i++) { + dataRiskMore.push(ret[i]) + } + } + if (riskCount == 0) riskCount = 1 + let riskHeight = 65 * riskCount + this.setState({ + data: ret, + dataRiskMore: dataRiskMore, + riskCount: riskCount, + opEnd: opEnd, + riskHeight: riskHeight + }) + } + } + }); + } + render() { + const { data, riskCount, dataRiskMore, opEnd, riskHeight } = this.state; + const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; + return
+ + + + + {/* + + + */} + + {/* 检查任务 */} + + + + + {/* 检查任务 */} + + {/* 检查记录 */} + + + + + {/* 检查记录 */} + + {/* 检查记录汇总 */} + + + + + {/* 检查记录汇总 */} + + {/* 隐患上报 */} + + + + + {/* 隐患上报 */} + + {/* 隐患确认单 */} + + + + + {/* 隐患确认单 */} + + {/* 隐患整改通知 */} + + + + + {/* 隐患整改通知 */} + + {/* 隐患整改记录 */} + + + + + {/* 隐患整改记录 */} + +
+
+
+
+
安全检查通知
+
+
+
+ { + data && data[0]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[0].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } +
+
+
安全检查记录
+
+
+
+ { + data && data[1]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[1].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } +
+
+
安全检查记录汇总
+
+
+
+ { + data && data[2]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[2].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } + +
+
+
隐患上报
+
+
+
+ { + data && data[3]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[3].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } + +
+
+
隐患确认单
+
+
+
+ { + data && data[4]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[4].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } + +
+
+
隐患整改通知
+
+
+
+ { + data && data[5]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[5].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } + +
+
+
隐患整改记录
+ {/*
*/} +
+
+ { + data && data[6]?.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{ShowDateTime(item.OPERTETIME, "MM-dd HH:mm")} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.SKOPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[6].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } + +
+
+
+ } +} +export default connect(({ login, app }) => ({ login, app }))(SK006ShowOperateLog) diff --git a/src/components/CustomPages/SK/SK010CheckList.js b/src/components/CustomPages/SK/SK010CheckList.js index 6e181a8..41963ed 100644 --- a/src/components/CustomPages/SK/SK010CheckList.js +++ b/src/components/CustomPages/SK/SK010CheckList.js @@ -16,7 +16,7 @@ class SK010CheckList extends React.Component { selectedRowKeys:[], taskSelects: [], dataList: [], - MineType:0, + PRODUCTION_UNIT_ID:null, CHECK_CYCLE:0, CHECK_TYPE:0, CHECK_CYCLE_ID:null, @@ -103,8 +103,8 @@ class SK010CheckList extends React.Component { }, { title: "生产单元", - dataIndex: "Nav_ProductionUnit.NAME", - key: "Nav_ProductionUnit.NAME", + dataIndex: "MINE_NAME", + key: "MINE_NAME", // render: (text, record, index) => { // return // } @@ -204,7 +204,7 @@ class SK010CheckList extends React.Component { this.setState({ showDetail: true, },()=>{ - let json = initFilter(this.props.login.OrgId,item.MineType,'','','',item.CHECK_TYPE_ID,item.CHECK_CYCLE,item.CHECK_TYPE); + let json = initFilter(this.props.login.OrgId,item.PRODUCTION_UNIT_ID,'','','',item.CHECK_TYPE_ID,item.CHECK_CYCLE,item.CHECK_TYPE); extendIgnoreDataRule(json) this.props.dispatch({ type: 'app/getDataByPost', @@ -213,7 +213,7 @@ class SK010CheckList extends React.Component { onComplete: (ret) => { if (ret) { this.setState({ Details: ret, - MineType:item.MineType, + PRODUCTION_UNIT_ID :item.PRODUCTION_UNIT_ID, CHECK_CYCLE:item.CHECK_CYCLE, CHECK_TYPE:item.CHECK_TYPE, CHECK_TYPE_ID:item.CHECK_TYPE_ID, }); diff --git a/src/components/CustomPages/SK/SK022ShowPrint.js b/src/components/CustomPages/SK/SK022ShowPrint.js index 2d717c3..62d7540 100644 --- a/src/components/CustomPages/SK/SK022ShowPrint.js +++ b/src/components/CustomPages/SK/SK022ShowPrint.js @@ -38,7 +38,23 @@ class SK022ShowPrint extends React.Component { if (typeof this.props.data.onCancel != "undefined" && typeof this.props.data.onCancel == 'function') this.props.data.onCancel(); } - + onTableBtnAgree() { + this.props.dispatch({ + type: 'app/getDataByPost', + url: 'SK/SKHiddenDangerRectifyRecord/IdentityUpdate', + payload: { + ID: this.props.data.id, + TaskID: this.props.data.TaskID, + }, + onComplete: (ret) => { + if (ret) { + message.success('确认成功!'); + this.setState({ BtnAgreeDisplay: 'none' }) + this.BtnClose(); + } + } + }) + } loadData = (dataId, taskID) => { let json = initFilter(this.props.login.OrgId); extendRule(json, 'ID', 1, dataId); @@ -108,6 +124,7 @@ class SK022ShowPrint extends React.Component { pageStyle=".printDIV { padding:0 40px;} img{width :120px}" /> +
(this.componentRef = el)} style={{ padding: '20px' }} id={'tableId' + this.props.data.id}>

隐患整改记录

diff --git a/src/components/CustomPages/SK/SK033ShowPrint.js b/src/components/CustomPages/SK/SK033ShowPrint.js index b1dd206..f57f3c6 100644 --- a/src/components/CustomPages/SK/SK033ShowPrint.js +++ b/src/components/CustomPages/SK/SK033ShowPrint.js @@ -115,11 +115,10 @@ class SK033ShowPrint extends React.Component { {data.Nav_ApplyDepartment ? data.Nav_ApplyDepartment.NAME : ''} {data.Nav_ApplyUser ? data.Nav_ApplyUser.NAME : ''} {data.YEAR} - {data.CONTENTS} {moment(data.START_DATE).format('YYYY-MM-DD')} {data.END_DATE ? moment(data.END_DATE).format('YYYY-MM-DD') : null} + {data.CONTENTS} {data.Nav_Require ? data.Nav_Require.NAME : ''} - { showFiles(data?.Nav_Files, config.picServerHost, this) } diff --git a/src/components/MainPage/GuideCanvas.js b/src/components/MainPage/GuideCanvas.js index 17c4314..357f1bd 100644 --- a/src/components/MainPage/GuideCanvas.js +++ b/src/components/MainPage/GuideCanvas.js @@ -1,70 +1,62 @@ // 核心库 -import React, { Component } from "react"; -import { connect } from "dva"; -import { withRouter } from "dva/router"; -import QRCode from "qrcode"; -import config from "../../config"; +import React, { Component } from 'react'; +import { connect } from 'dva'; +import { withRouter } from 'dva/router'; +import QRCode from 'qrcode'; +import config from '../../config'; class GuideCanvas extends Component { constructor(props) { super(props); this.state = { - visible: "none", - company: "XLK", + visible: 'none', + company: 'XLK', }; } componentDidMount() { - QRCode.toCanvas( - config.guideSeverHost, - { errorCorrectionLevel: "L", width: 140 }, - function (err, canvas) { - if (err) throw err; - let container = document.getElementById("canvas1"); - if (container) { - try { - container.appendChild(canvas); - } catch (e) { } - } + QRCode.toCanvas(config.guideSeverHost, { errorCorrectionLevel: 'L', width: 140 }, function (err, canvas) { + if (err) throw err; + let container = document.getElementById('canvas1'); + if (container) { + try { + container.appendChild(canvas); + } catch (e) {} } - ); + }); + QRCode.toCanvas(config.guideH5Host, { errorCorrectionLevel: 'L', width: 140 }, function (err, canvas) { + if (err) throw err; + let container1 = document.getElementById('canvas2'); + if (container1) { + try { + container1.appendChild(canvas); + } catch (e) {} + } + }); QRCode.toCanvas( - config.guideH5Host, - { errorCorrectionLevel: "L", width: 140 }, + config.h5Web + '#/pages/index/index?OrgId=' + this.props.login.OrgId, + { errorCorrectionLevel: 'L', width: 140 }, function (err, canvas) { if (err) throw err; - let container1 = document.getElementById("canvas2"); + let container1 = document.getElementById('canvas3'); if (container1) { try { container1.appendChild(canvas); - } catch (e) { } - } - } - ); - QRCode.toCanvas( - config.h5Web + "#/pages/index/index?OrgId=" + this.props.login.OrgId, - { errorCorrectionLevel: "L", width: 140 }, - function (err, canvas) { - if (err) throw err; - let container1 = document.getElementById("canvas3"); - if (container1) { - try { - container1.appendChild(canvas); - } catch (e) { } + } catch (e) {} } } ); // 二维码平台 QRCode.toCanvas( - config.h5Web+'?OrgId='+this.props.login.OrgId , - { errorCorrectionLevel: "L", width: 140 }, + config.h5Web + '?OrgId=' + this.props.login.OrgId, + { errorCorrectionLevel: 'L', width: 140 }, function (err, canvas) { if (err) throw err; - let container = document.getElementById("canvas5"); + let container = document.getElementById('canvas5'); if (container) { try { container.appendChild(canvas); - } catch (e) { } + } catch (e) {} } } ); @@ -73,8 +65,8 @@ class GuideCanvas extends Component { render() { return ( -
-
+ {/*
APP下载 -
+
*/}
@@ -98,16 +90,16 @@ class GuideCanvas extends Component {
新员工注册
- -
二维码平台 -
+
*/}
); diff --git a/src/feui/utils/common.js b/src/feui/utils/common.js index c9239e4..0aff521 100644 --- a/src/feui/utils/common.js +++ b/src/feui/utils/common.js @@ -546,8 +546,8 @@ export function permissionUtils (login) { if (login.rolePerm && login.rolePerm.Nav_RolePermForms && login.rolePerm.Nav_RolePermForms.length) { // 只要一个角色有权限就有权限 login.rolePerm.Nav_RolePermForms.forEach((n1, i1) => { if (n1.PermFormId === formId) { - const matchForm = n1.MenuId === currActivatedMenu.ID - if (type == 0 && matchForm) { // 表单权限 + //const matchForm = n1.MenuId === currActivatedMenu.ID + if (type == 0 && true) { // 表单权限 hasPermission = true } else if (type == 1) { // 按钮权限 if (n1.Nav_Btns && n1.Nav_Btns.length) { diff --git a/src/files/edit/FO041.js b/src/files/edit/FO041.js new file mode 100644 index 0000000..2071f7a --- /dev/null +++ b/src/files/edit/FO041.js @@ -0,0 +1,37 @@ +import { message } from "antd/lib/index"; +import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common"; +import moment from 'moment'; +/** + * @return {string} + */ +// 编辑 +export default { + onBeforeSaveHandleRecord(params) { + params.record.TaskID = params.data.TaskID //TaskID传递消息表ID + params.record.PUBLISH = params.customParams; + }, + onBeforeEdit: ({ isNew,login,record, dispatch,stateData, setFieldVisible,setFieldValue,setFieldValueByBatch }) => { + if (isNew) { + let json = initFilter(login.OrgId); + extendRule(json, "ID", 1, login.userId); + extendInclude(json, 'Nav_Department.Nav_Unit'); + dispatch({ + type: 'app/getDataByPost', + url: 'FM/User/Get', + payload: json, + onComplete: (ret) => { + if (ret) { + let temps = []; + temps.push({ field: 'APPLY_USER_ID', value: ret.ID}) + temps.push({ field: 'Nav_ApplyUser.NAME', value: ret.NAME }) + temps.push({ field: 'APPLY_DEPARTMENT_ID', value: ret.DEPARTMENT_ID}) + temps.push({ field: 'Nav_ApplyDepartment.NAME', value: ret.Nav_Department?.NAME }) + temps.push({ field: 'PRODUCTION_UNIT_ID', value: ret.Nav_Department?.PRODUCTION_UNIT_ID}) + temps.push({ field: 'Nav_ProductionUnit.NAME', value: ret.Nav_Department?.Nav_Unit?.NAME }) + setFieldValueByBatch(temps); + } + } + }); + } + } +} diff --git a/src/files/edit/FOO035.js b/src/files/edit/FOO035.js new file mode 100644 index 0000000..0efbc2a --- /dev/null +++ b/src/files/edit/FOO035.js @@ -0,0 +1,35 @@ +import { message } from "antd/lib/index"; +import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common"; +import moment from 'moment'; +/** + * @return {string} + */ +// 编辑 +export default { + onBeforeSaveHandleRecord(params) { + params.record.TaskID = params.data.TaskID //TaskID传递消息表ID + params.record.PUBLISH = params.customParams; + }, + onBeforeEdit: ({ isNew,login,record, dispatch,stateData, setFieldVisible,setFieldValue,setFieldValueByBatch }) => { + if (isNew) { + let json = initFilter(login.OrgId); + extendRule(json, "ID", 1, login.userId); + extendInclude(json, 'Nav_Department'); + dispatch({ + type: 'app/getDataByPost', + url: 'FM/User/Get', + payload: json, + onComplete: (ret) => { + if (ret) { + let temps = []; + temps.push({ field: 'USER_ID', value: ret.ID}) + temps.push({ field: 'Nav_User.NAME', value: ret.NAME }) + temps.push({ field: 'DEPARTMENT_ID', value: ret.DEPARTMENT_ID}) + temps.push({ field: 'Nav_Department.NAME', value: ret.Nav_Department?.NAME }) + setFieldValueByBatch(temps); + } + } + }); + } + } +} diff --git a/src/files/edit/SK006.js b/src/files/edit/SK006.js index a6b61cf..f45fde6 100644 --- a/src/files/edit/SK006.js +++ b/src/files/edit/SK006.js @@ -216,7 +216,12 @@ btnSubContents: ({row, srcRecord,getSelectedRecords,record,saveRowRecord,colInfo payload: stateData, onlyData: false, onComplete: (re) => { - if (re && re.IsSuccessful && re.Data) { + if(re && re.ErrorMessage) + { + message.error(re.ErrorMessage) + return + } + else if (re && re.IsSuccessful && re.Data) { stateData.Nav_CheckNoticeDetails = re.Data saveRowRecord({ record: stateData, editCode: "T_SK_SECURITY_INSPECTION_NOTICE_DETAIL" }) } diff --git a/src/files/edit/SK033.js b/src/files/edit/SK033.js index 7b7f2a3..c185586 100644 --- a/src/files/edit/SK033.js +++ b/src/files/edit/SK033.js @@ -86,7 +86,7 @@ export default { Nav_Type: item.Nav_Type, Nav_RiskName: item.Nav_RiskName, EVALUATE_LEVEL:item.EVALUATE_LEVEL, - MARK:0, + MARK:10, ENABLE_STATUS:0, Nav_ProductionUnit: item.Nav_ProductionUnit, } diff --git a/src/layout/Header.js b/src/layout/Header.js index 509a2c9..5b6681e 100644 --- a/src/layout/Header.js +++ b/src/layout/Header.js @@ -1,23 +1,18 @@ -import React, { useState, useMemo, useEffect } from "react"; -import { connect } from "dva"; -import { withRouter } from "dva/router"; -import { Dropdown, Icon, Menu, message, Button, Modal } from "antd"; -import { HeaderSearch as OPTSearch, PictureThumb } from "@woowalker/feui"; -import ModifyPassword from "../components/MainPage/ModifyPassword"; -import FoUserInfoShow from "../components/MainPage/FoUserInfoShow"; -import FeedbackQuestion from "../components/MainPage/FeedbackQuestion"; -import GuideCanvas from "../components/MainPage/GuideCanvas"; -import IconFont from "../utils/iconFont"; -import { - initFilter, - requestFullScreenMethod, - exitFullScreen, - isFullscreenElement, -} from "../utils/common"; -import config from "../config"; -import "./header.less"; -import Option from "./Option"; -import FullScreenPage from "./FullScreen"; +import React, { useState, useMemo, useEffect } from 'react'; +import { connect } from 'dva'; +import { withRouter } from 'dva/router'; +import { Dropdown, Icon, Menu, message, Button, Modal } from 'antd'; +import { HeaderSearch as OPTSearch, PictureThumb } from '@woowalker/feui'; +import ModifyPassword from '../components/MainPage/ModifyPassword'; +import FoUserInfoShow from '../components/MainPage/FoUserInfoShow'; +import FeedbackQuestion from '../components/MainPage/FeedbackQuestion'; +import GuideCanvas from '../components/MainPage/GuideCanvas'; +import IconFont from '../utils/iconFont'; +import { initFilter, requestFullScreenMethod, exitFullScreen, isFullscreenElement } from '../utils/common'; +import config from '../config'; +import './header.less'; +import Option from './Option'; +import FullScreenPage from './FullScreen'; // 投屏 const DataV = (props) => { @@ -25,10 +20,8 @@ const DataV = (props) => { const { OrgId, Tenant, baseConfig } = props.login; const preUrl = baseConfig.SCREEN_URL || config.dataVUrl; const queryStr = `OrgId=${OrgId}&Tenant=${Tenant}`; - const url = `${ - preUrl.indexOf("?") !== -1 ? preUrl : preUrl + "?" - }${queryStr}`; - window.open(url, "_blank"); + const url = `${preUrl.indexOf('?') !== -1 ? preUrl : preUrl + '?'}${queryStr}`; + window.open(url, '_blank'); }; return ( @@ -72,7 +65,7 @@ const Search = (props) => { * @param {*} e */ const handleSearchMenu = (e) => { - if (!e || e === "") { + if (!e || e === '') { setAutoCompleteData([]); return; } @@ -94,11 +87,9 @@ const Search = (props) => { * @param {*} e */ const handleSelectMenu = (e) => { - const menu = leafMenus.menuDatas.find( - (item) => item.Menu.Nav_MenuForm.ID === e - ); + const menu = leafMenus.menuDatas.find((item) => item.Menu.Nav_MenuForm.ID === e); props.dispatch({ - type: "app/updateActivatedMenu", + type: 'app/updateActivatedMenu', payload: { currActivatedTab: menu.Node.ID, currActivatedMenu: menu.Node, @@ -107,16 +98,10 @@ const Search = (props) => { props.history.push({ pathname: `/main/${menu.Node.ID}` }); }; - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { return ; } else { - return ( - - ); + return ; } //return ( // @@ -138,23 +123,23 @@ const User = (props) => { */ const handleLogout = () => { const { OrgId, userId } = props.login; - const logJson = initFilter(OrgId, userId, "", 0, 1, 0); + const logJson = initFilter(OrgId, userId, '', 0, 1, 0); props.dispatch({ - type: "app/addLoginOut", + type: 'app/addLoginOut', payload: logJson, }); - localStorage.removeItem("accessToken"); - localStorage.removeItem("currentMineTypeName"); - props.history.push({ pathname: "/login" }); + localStorage.removeItem('accessToken'); + localStorage.removeItem('currentMineTypeName'); + props.history.push({ pathname: '/login' }); }; /** * 锁屏 */ const handleLockScreen = () => { - localStorage.removeItem("accessToken"); + localStorage.removeItem('accessToken'); props.dispatch({ - type: "login/save", + type: 'login/save', payload: { screenLocked: true, }, @@ -167,15 +152,15 @@ const User = (props) => { */ const handleUserMenuClick = (evt) => { switch (evt.key) { - case "user-menu-logout": + case 'user-menu-logout': handleLogout(); break; - case "user-menu-lockscreen": + case 'user-menu-lockscreen': handleLockScreen(); break; - case "user-menu-cacheclean": + case 'user-menu-cacheclean': window.localStorage.clear(); - message.success("清除成功,即将重新加载页面", 2, () => { + message.success('清除成功,即将重新加载页面', 2, () => { setTimeout(() => window.location.reload(true), 500); }); break; @@ -192,9 +177,7 @@ const User = (props) => { onVisibleChange={setVisible} overlay={ - - 当前登录:{loginInfo.User?.NAME} - + 当前登录:{loginInfo.User?.NAME} 我的资料 @@ -219,87 +202,83 @@ const HeaderUser = withRouter(connect(({ login }) => ({ login }))(User)); // 2023-10-08 生产单元 const MineType = (props) => { const [visible, setVisible] = useState(false); - let currUserMineType = localStorage.getItem("MineType"); + let currUserMineType = localStorage.getItem('MineType'); if (currUserMineType == null || currUserMineType == undefined) { - localStorage.setItem("MineType", "30"); - localStorage.setItem("currentMineTypeName", "露天矿"); + localStorage.setItem('MineType', '30'); + localStorage.setItem('currentMineTypeName', '露天矿'); } else { - if (localStorage.getItem("currentMineTypeName") == null) { + if (localStorage.getItem('currentMineTypeName') == null) { if (currUserMineType.indexOf(30) > -1) { - localStorage.setItem("currentMineType", 30); - localStorage.setItem("currentMineTypeName", "露天矿"); + localStorage.setItem('currentMineType', 30); + localStorage.setItem('currentMineTypeName', '露天矿'); } else if (currUserMineType.indexOf(20) > -1) { - localStorage.setItem("currentMineType", 20); - localStorage.setItem("currentMineTypeName", "尾矿库"); + localStorage.setItem('currentMineType', 20); + localStorage.setItem('currentMineTypeName', '尾矿库'); } else if (currUserMineType.indexOf(10) > -1) { - localStorage.setItem("currentMineType", 10); - localStorage.setItem("currentMineTypeName", "选矿厂"); + localStorage.setItem('currentMineType', 10); + localStorage.setItem('currentMineTypeName', '选矿厂'); } else if (currUserMineType.indexOf(40) > -1) { - localStorage.setItem("currentMineType", 40); - localStorage.setItem("currentMineTypeName", "地下矿"); - } - else if (currUserMineType.indexOf(31) > -1) { - localStorage.setItem("currentMineType", 31); - localStorage.setItem("currentMineTypeName", "职能口"); - } - else if (currUserMineType.indexOf(32) > -1) { - localStorage.setItem("currentMineType", 32); - localStorage.setItem("currentMineTypeName", "非金属"); + localStorage.setItem('currentMineType', 40); + localStorage.setItem('currentMineTypeName', '地下矿'); + } else if (currUserMineType.indexOf(31) > -1) { + localStorage.setItem('currentMineType', 31); + localStorage.setItem('currentMineTypeName', '职能口'); + } else if (currUserMineType.indexOf(32) > -1) { + localStorage.setItem('currentMineType', 32); + localStorage.setItem('currentMineTypeName', '非金属'); } } else { - let currentMineType = localStorage.getItem("currentMineType"); + let currentMineType = localStorage.getItem('currentMineType'); if (currUserMineType.indexOf(currentMineType) > -1) { if (currentMineType == 30) { - localStorage.setItem("currentMineTypeName", "露天矿"); + localStorage.setItem('currentMineTypeName', '露天矿'); } else if (currUserMineType == 20) { - localStorage.setItem("currentMineTypeName", "尾矿库"); + localStorage.setItem('currentMineTypeName', '尾矿库'); } else if (currUserMineType == 10) { - localStorage.setItem("currentMineTypeName", "选矿厂"); + localStorage.setItem('currentMineTypeName', '选矿厂'); } else if (currUserMineType == 40) { - localStorage.setItem("currentMineTypeName", "地下矿"); - }else if (currUserMineType == 31) { - localStorage.setItem("currentMineTypeName", "职能口"); - }else if (currUserMineType == 32) { - localStorage.setItem("currentMineTypeName", "非金属"); + localStorage.setItem('currentMineTypeName', '地下矿'); + } else if (currUserMineType == 31) { + localStorage.setItem('currentMineTypeName', '职能口'); + } else if (currUserMineType == 32) { + localStorage.setItem('currentMineTypeName', '非金属'); } } else { if (currUserMineType.indexOf(30) > -1) { - localStorage.setItem("currentMineTypeName", "露天矿"); + localStorage.setItem('currentMineTypeName', '露天矿'); } else if (currUserMineType.indexOf(20) > -1) { - localStorage.setItem("currentMineTypeName", "尾矿库"); + localStorage.setItem('currentMineTypeName', '尾矿库'); } else if (currUserMineType.indexOf(10) > -1) { - localStorage.setItem("currentMineTypeName", "选矿厂"); + localStorage.setItem('currentMineTypeName', '选矿厂'); } else if (currUserMineType.indexOf(40) > -1) { - localStorage.setItem("currentMineTypeName", "地下矿"); - } - else if (currUserMineType.indexOf(31) > -1) { - localStorage.setItem("currentMineTypeName", "职能口"); - } - else if (currUserMineType.indexOf(32) > -1) { - localStorage.setItem("currentMineTypeName", "非金属"); + localStorage.setItem('currentMineTypeName', '地下矿'); + } else if (currUserMineType.indexOf(31) > -1) { + localStorage.setItem('currentMineTypeName', '职能口'); + } else if (currUserMineType.indexOf(32) > -1) { + localStorage.setItem('currentMineTypeName', '非金属'); } } } } let currUserMineTypeArray = []; - if (currUserMineType.indexOf("30") > -1) { - currUserMineTypeArray.push({ key: "30", label: "露天矿" }); + if (currUserMineType.indexOf('30') > -1) { + currUserMineTypeArray.push({ key: '30', label: '露天矿' }); } - if (currUserMineType.indexOf("10") > -1) { - currUserMineTypeArray.push({ key: "10", label: "选矿厂" }); + if (currUserMineType.indexOf('10') > -1) { + currUserMineTypeArray.push({ key: '10', label: '选矿厂' }); } - if (currUserMineType.indexOf("20") > -1) { - currUserMineTypeArray.push({ key: "20", label: "尾矿库" }); + if (currUserMineType.indexOf('20') > -1) { + currUserMineTypeArray.push({ key: '20', label: '尾矿库' }); } - if (currUserMineType.indexOf("40") > -1) { - currUserMineTypeArray.push({ key: "40", label: "地下矿" }); + if (currUserMineType.indexOf('40') > -1) { + currUserMineTypeArray.push({ key: '40', label: '地下矿' }); } - if (currUserMineType.indexOf("31") > -1) { - currUserMineTypeArray.push({ key: "31", label: "职能口" }); + if (currUserMineType.indexOf('31') > -1) { + currUserMineTypeArray.push({ key: '31', label: '职能口' }); } - if (currUserMineType.indexOf("32") > -1) { - currUserMineTypeArray.push({ key: "32", label: "非金属" }); + if (currUserMineType.indexOf('32') > -1) { + currUserMineTypeArray.push({ key: '32', label: '非金属' }); } const MineTypeMenu = () => { return ( @@ -315,30 +294,24 @@ const MineType = (props) => { * @param {*} evt */ const handleMineTypeClick = (evt) => { - localStorage.setItem("currentMineType", evt.key); - localStorage.setItem("currentMineTypeName", evt.item.props.children); + localStorage.setItem('currentMineType', evt.key); + localStorage.setItem('currentMineTypeName', evt.item.props.children); setVisible(false); window.location.reload(); }; - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { return
; } else { return ( - - - 生产单元:{localStorage.getItem("currentMineTypeName")} + + + 生产单元:{localStorage.getItem('currentMineTypeName')} ); } }; -const HeaderMineType = withRouter( - connect(({ login }) => ({ login }))(MineType) -); +const HeaderMineType = withRouter(connect(({ login }) => ({ login }))(MineType)); const GuideCodePage = (props) => { const [showCanvas, setshowCanvas] = useState(false); const currVans = (val) => { @@ -349,7 +322,7 @@ const GuideCodePage = (props) => { * @param {*} evt */ - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { return
; } else { return ( @@ -358,14 +331,14 @@ const GuideCodePage = (props) => { onClick={() => { currVans(); }} - style={{ margin: "0px 36px", display: "flex", alignItems: "center" }} + style={{ margin: '0px 36px', display: 'flex', alignItems: 'center' }} >
{ setshowCanvas(false); @@ -381,15 +354,13 @@ const GuideCodePage = (props) => { ); } }; -const GuideCode = withRouter( - connect(({ login }) => ({ login }))(GuideCodePage) -); +const GuideCode = withRouter(connect(({ login }) => ({ login }))(GuideCodePage)); const NavOpton = (props) => { const [showModal, setshowModal] = useState(false); const getChildCount = (val) => { setshowModal(val); }; - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { return
; } else { return ( @@ -401,10 +372,7 @@ const NavOpton = (props) => { }} > {/* */} - + { document.msFullScreen ); if (isFull) { - // / - }else{ + // / + } else { // requestFullScreenMethod(document.body); setshowModal(false); } }; useEffect(() => { // 监听退出全屏事件 --- chrome 用 esc 退出全屏并不会触发 keyup 事件 - document.addEventListener( - "webkitfullscreenchange", - escFunction - ); /* Chrome, Safari and Opera */ - document.addEventListener("mozfullscreenchange", escFunction); /* Firefox */ - document.addEventListener( - "fullscreenchange", - escFunction - ); /* Standard syntax */ - document.addEventListener( - "msfullscreenchange", - escFunction - ); /* IE / Edge */ + document.addEventListener('webkitfullscreenchange', escFunction); /* Chrome, Safari and Opera */ + document.addEventListener('mozfullscreenchange', escFunction); /* Firefox */ + document.addEventListener('fullscreenchange', escFunction); /* Standard syntax */ + document.addEventListener('msfullscreenchange', escFunction); /* IE / Edge */ return () => { //销毁时清除监听 - document.removeEventListener("webkitfullscreenchange", escFunction); - document.removeEventListener("mozfullscreenchange", escFunction); - document.removeEventListener("fullscreenchange", escFunction); - document.removeEventListener("MSFullscreenChange", escFunction); + document.removeEventListener('webkitfullscreenchange', escFunction); + document.removeEventListener('mozfullscreenchange', escFunction); + document.removeEventListener('fullscreenchange', escFunction); + document.removeEventListener('MSFullscreenChange', escFunction); }; }, []); - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { return
; } else { return ( @@ -480,10 +439,10 @@ const FullScreenOpton = (props) => { type="primary" onClick={() => { setshowModal(true); - requestFullScreenMethod(document.body); // 进入全屏 + requestFullScreenMethod(document.body); // 进入全屏 }} > - + {/* { } }; -const FullScreen = withRouter( - connect(({ login }) => ({ login }))(FullScreenOpton) -); +const FullScreen = withRouter(connect(({ login }) => ({ login }))(FullScreenOpton)); const HeaderNav = withRouter(connect(({ login }) => ({ login }))(NavOpton)); function Header(props) { const { baseConfig = {} } = props.login; - const thumbCode = baseConfig.Nav_PictureLogo - ? baseConfig.Nav_PictureLogo.CODE - : ""; + const thumbCode = baseConfig.Nav_PictureLogo ? baseConfig.Nav_PictureLogo.CODE : ''; let isMobile = false; - if (window.navigator.userAgent.indexOf("Windows") < 1) { + if (window.navigator.userAgent.indexOf('Windows') < 1) { isMobile = true; } return ( -
+
{isMobile ? ( ) : ( - + 矿山安全生产信息化平台 - - {baseConfig.SYS_NAME}{" "} + + {baseConfig.SYS_NAME}{' '} )}
diff --git a/src/utils/common.js b/src/utils/common.js index 6cba5a7..d074608 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -646,8 +646,8 @@ export function permissionUtils(login) { hasPermission = true } else { if (n1.PermFormId === formId) { - const matchForm = (n1.MenuId === currActivatedMenu.ID || !currActivatedMenu.ID) - if (type == 0 && matchForm) { //表单权限 + //const matchForm = (n1.MenuId === currActivatedMenu.ID || !currActivatedMenu.ID) + if (type == 0 && true) { // hasPermission = true; } else if (type == 1) { //按钮权限 if (n1.Nav_Btns && n1.Nav_Btns.length) { diff --git a/src/utils/customConfig.js b/src/utils/customConfig.js index 02a90b0..2c57814 100644 --- a/src/utils/customConfig.js +++ b/src/utils/customConfig.js @@ -97,6 +97,11 @@ const FO015ShowPrint = createLoadableComponent(() => import('../components/Custo const FO008ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO008ShowPrint')) const FO021EditPage = createLoadableComponent(() => import('../components/CustomPages/FO/FO021EditPage')) const FO019ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO019ShowPrint')) +const FO035ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO035ShowPrint')) +const FO037ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO037ShowPrint')) +const FO041ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO041ShowPrint')) +const FO043ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO043ShowPrint')) +const FO045ShowPrint = createLoadableComponent(() => import('../components/CustomPages/FO/FO045ShowPrint')) const PreMeetingTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreMeetingTask')) const PreOperSchTask = createLoadableComponent(() => import('../components/CustomPages/Mobile/PreOperSchTask')) @@ -301,6 +306,11 @@ export default function (componentName, formId, formParam, data, formCode, formD FO022ShowPrint: , FO021EditPage: , FO015ShowPrint: , + FO035ShowPrint: , + FO037ShowPrint: , + FO041ShowPrint: , + FO043ShowPrint: , + FO045ShowPrint: , HM104ShowPrint: , HM087ShowPrint: ,