From 1c5852b617bc483f4346e4494fe33824608a23d4 Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Fri, 12 Jul 2024 10:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=B1=A5=E8=81=8C=20?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E4=BB=BB=E5=8A=A1=E5=88=B6=E5=AE=9A=E5=8F=96?= =?UTF-8?q?=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomPages/BS/BS076ShowOperateLog.js | 510 +++++++++++++++++- src/components/CustomPages/HI/OperateLog.css | 207 +++++++ src/files/edit/BS032.js | 5 +- 3 files changed, 709 insertions(+), 13 deletions(-) create mode 100644 src/components/CustomPages/HI/OperateLog.css diff --git a/src/components/CustomPages/BS/BS076ShowOperateLog.js b/src/components/CustomPages/BS/BS076ShowOperateLog.js index 9e95721..12408c6 100644 --- a/src/components/CustomPages/BS/BS076ShowOperateLog.js +++ b/src/components/CustomPages/BS/BS076ShowOperateLog.js @@ -7,7 +7,7 @@ import XLSX from 'xlsx'; import { connect } from 'dva'; import moment from 'moment'; import { message } from 'antd/lib/index'; -import styles from '../../../components/CustomPages/HI/StepForm.css'; +import styles from '../../../components/CustomPages/HI/OperateLog.css'; import config from '../../../config.js'; class BS076ShowOperateLog extends React.Component { @@ -15,8 +15,17 @@ class BS076ShowOperateLog extends React.Component { super(props); this.state = { data: null, - btndisplay: 'none', - isCheck: false, //是否待办 审批 + 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 }] + // ] + // ] } } @@ -31,29 +40,507 @@ class BS076ShowOperateLog extends React.Component { } } - - loadData = (ids) => { + loadData = (id) => { var orgId = this.props.login ? this.props.login.OrgId : ''; - let json = initFilter(orgId, ids); + let json = initFilter(orgId, id); this.props.dispatch({ type: 'app/getDataByPost', payload: json, url: 'BS/BSOperateLog/OrderEntities', onComplete: (ret) => { - debugger 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 } = this.state; + const { data, riskCount, dataRiskMore, opEnd, riskHeight } = this.state; const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums; - return
-
(this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}> + return
+ + + + + + + + + + {/* 检查任务 */} + + + + + {/* 检查任务 */} + + {/* 检查记录 */} + + + + + {/* 检查记录 */} + + {/* 隐患上报 */} + + + + + {/* 隐患上报 */} + + {/* 隐患整改 */} + + + + + { + dataRiskMore?.map(itemR => { + 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.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.OPERATEPOINT_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.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.OPERATEPOINT_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.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[2].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } + +
+
+
隐患整改
+ { + riskCount > 1 ?
:
+ } +
+
+ { + 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.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[3].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } +
+
+
+ { + itemR.map((item, index) => { + let resultdiv = [] + for (let i = 0; i < 2; i++) { + if (i == 0) { + resultdiv.push( + item.OPERTETIME ? + ( + //有操作 + item.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
+ ) + : + ( //超时完成 橙色 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间:{item.CREATE_TIME.split(' ')[0]} +
+
) + ) + : + ( + //没有操作 灰色 + item.USRTNAME ? ( + //有用户信息 写入用户 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ 用户:{item.USRTNAME} + 时间: +
+
+ ) : ( + //没有用户信息 +
+
{enums.OPERATEPOINT_Enums.enums[item.OPERATEPOINT]}
+
+ ) + ) + ) + } else if (index != data[4].length - 1) { + resultdiv.push( +
+ ) + } + } + return resultdiv + }) + } +
+
+
结束
+
+ { + opEnd ? (opEnd.ISINTTIME ? + (//按时完成 绿色 +
+
{enums.OPERATEPOINT_Enums.enums[opEnd.OPERATEPOINT]}
+
+ 用户:{opEnd.USRTNAME} + 时间:{opEnd.CREATE_TIME.split(' ')[0]} +
+
+ ) + : + ( //超时完成 橙色 + opEnd.USRTNAME ? +
+
{enums.OPERATEPOINT_Enums.enums[opEnd.OPERATEPOINT]}
+
+ 用户:{opEnd.USRTNAME} + 时间:{opEnd.CREATE_TIME.split(' ')[0]} +
+
+ : +
{enums.OPERATEPOINT_Enums.enums[opEnd.OPERATEPOINT]}
//没有人员信息 灰色 + )) :
+ } +
+ + + {/* +
+
+
+
检查任务
+
+
检查记录
+
+
隐患上报
+
+
隐患整改
+
+
结束
+
+
+
+
+
+
任务获取
+
+ 发起人:王永文 + 时间:2024-07-10 +
+
+
+ +
检查任务制定
+
+
检查任务审批
+
+
检查任务确认
+
+
+
+
任务获取
+
+ 发起人:王永文 + 时间:2024-07-10 +
+
+
+
检查任务制定
+
+
检查任务审批
+
+
检查任务确认
+
+
*/} + + {/*
(this.componentRef = el)} style={{ padding: '20px', paddingTop: '20px' }} id={'tableId' + this.props.data.id}> + @@ -77,7 +564,8 @@ class BS076ShowOperateLog extends React.Component { }) : }
查无记录
-
+
*/} +
} } diff --git a/src/components/CustomPages/HI/OperateLog.css b/src/components/CustomPages/HI/OperateLog.css new file mode 100644 index 0000000..67eae21 --- /dev/null +++ b/src/components/CustomPages/HI/OperateLog.css @@ -0,0 +1,207 @@ +.flowchart { + display: flex; + flex-direction: column; + align-items: center; + position: relative; +} + +.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; +} + +/* 长方形 */ +.rectangle { + width: 20px; + height: 50px; + /* margin-top: -70px; */ + margin-top: 8px; + margin-left: 45px; + position: relative; + background-color: #ADCDEA; + /* transform: rotate(-40deg); */ + /* 旋转角度 */ +} + +/* 模拟线条 */ +/* .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; +} + +/* 横向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; +} + +/* 横向布局 */ diff --git a/src/files/edit/BS032.js b/src/files/edit/BS032.js index ec8baa4..50bd40c 100644 --- a/src/files/edit/BS032.js +++ b/src/files/edit/BS032.js @@ -273,7 +273,6 @@ export default { return ''; } }, - btnCancel: ({ record, onCancel, data, dispatch }) => { let json = initFilter(record.ORG_ID, record.ID, null, null, null, data.TaskID); dispatch({ @@ -282,7 +281,9 @@ export default { payload: json, onlyData: false, onComplete: (ret) => { - message.success('执行成功', null, onCancel()) + if (ret.IsSuccessful == true) { + message.success('执行成功', null, onCancel()) + } } }) },