|
@@ -4,7 +4,6 @@ import { changeRecordStatus, getDumuDetail } from '@/services/eqSelfInspection';
|
|
import { UnityAction } from '@/utils/utils';
|
|
import { UnityAction } from '@/utils/utils';
|
|
import { connect, useRequest } from '@umijs/max';
|
|
import { connect, useRequest } from '@umijs/max';
|
|
import {
|
|
import {
|
|
- Card,
|
|
|
|
Col,
|
|
Col,
|
|
DatePicker,
|
|
DatePicker,
|
|
Form,
|
|
Form,
|
|
@@ -29,7 +28,6 @@ function Detail(props) {
|
|
const [dumuList, setDumuList] = useState([]);
|
|
const [dumuList, setDumuList] = useState([]);
|
|
const sendMessageToUnity = (select, data) => {
|
|
const sendMessageToUnity = (select, data) => {
|
|
setSelect(select);
|
|
setSelect(select);
|
|
- // console.log(data);
|
|
|
|
if (window.HightlightEquipment) {
|
|
if (window.HightlightEquipment) {
|
|
window.HightlightEquipment(data);
|
|
window.HightlightEquipment(data);
|
|
}
|
|
}
|
|
@@ -39,11 +37,11 @@ function Detail(props) {
|
|
case '警告':
|
|
case '警告':
|
|
return '#FFE26D';
|
|
return '#FFE26D';
|
|
case '异常':
|
|
case '异常':
|
|
- return '#FF8600';
|
|
|
|
|
|
+ return '#FE5850';
|
|
case '正常':
|
|
case '正常':
|
|
- return '#60FE76';
|
|
|
|
|
|
+ return '#12CEB3';
|
|
default:
|
|
default:
|
|
- return '#60FE76';
|
|
|
|
|
|
+ return '#12CEB3';
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const { run: detailRun } = useRequest(getDumuDetail, {
|
|
const { run: detailRun } = useRequest(getDumuDetail, {
|
|
@@ -101,160 +99,122 @@ function Detail(props) {
|
|
});
|
|
});
|
|
}, [data?.dumuList]);
|
|
}, [data?.dumuList]);
|
|
|
|
|
|
- // useEffect(() => {
|
|
|
|
- // dispatch({
|
|
|
|
- // type: 'eqSelfInspection/getPatrolRecordMandateInfo',
|
|
|
|
- // payload: {
|
|
|
|
- // extend_id: data.Id,
|
|
|
|
- // project_id: projectId,
|
|
|
|
- // mandate_type: 2
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- // }, [data]);
|
|
|
|
-
|
|
|
|
return (
|
|
return (
|
|
- <Spin spinning={loading}>
|
|
|
|
|
|
+ <Spin spinning={loading} wrapperClassName="card-box">
|
|
<div className={styles.card}>
|
|
<div className={styles.card}>
|
|
- <Card title="自检报告">
|
|
|
|
- <div>
|
|
|
|
- <Row>
|
|
|
|
- <Col span={24} style={{ fontSize: 20 }}>
|
|
|
|
- 自检时间:{data?.CreatedTime}
|
|
|
|
- </Col>
|
|
|
|
- </Row>
|
|
|
|
- <Row>
|
|
|
|
- <Col span={8} style={{ fontSize: 20 }}>
|
|
|
|
- 自检路线:{data?.RouteInfo?.Name}
|
|
|
|
- </Col>
|
|
|
|
- <Col span={8} style={{ fontSize: 20 }}>
|
|
|
|
- 工艺段:{data?.RouteInfo?.GroupID}
|
|
|
|
|
|
+ <Row>
|
|
|
|
+ <Col span={24} className={styles.cardText}>
|
|
|
|
+ 自检时间:{data?.CreatedTime}
|
|
|
|
+ </Col>
|
|
|
|
+ </Row>
|
|
|
|
+ <Row>
|
|
|
|
+ <Col span={8} className={styles.cardText}>
|
|
|
|
+ 自检路线:{data?.RouteInfo?.Name}
|
|
|
|
+ </Col>
|
|
|
|
+ <Col span={8} className={styles.cardText}>
|
|
|
|
+ 工艺段:{data?.RouteInfo?.GroupID}
|
|
|
|
+ </Col>
|
|
|
|
+ </Row>
|
|
|
|
+ <Row>
|
|
|
|
+ {result?.map((item) => {
|
|
|
|
+ return (
|
|
|
|
+ <Col span={8} className={styles.cardText}>
|
|
|
|
+ {item?.label}:
|
|
|
|
+ <span style={{ color: item.color, fontWeight: 'bold' }}>
|
|
|
|
+ {item?.value}
|
|
|
|
+ </span>
|
|
</Col>
|
|
</Col>
|
|
- </Row>
|
|
|
|
- <Row>
|
|
|
|
- {result?.map((item) => {
|
|
|
|
- return (
|
|
|
|
- <Col span={8} style={{ display: 'flex', fontSize: 20 }}>
|
|
|
|
- <div>{item?.label}:</div>
|
|
|
|
- <div style={{ color: item.color }}>{item?.value}</div>
|
|
|
|
- </Col>
|
|
|
|
- );
|
|
|
|
- })}
|
|
|
|
- </Row>
|
|
|
|
- {/* <Row>
|
|
|
|
- <Col span={8} style={{ display: 'flex', fontSize: 20 }}>
|
|
|
|
- <div>任务类型:</div>
|
|
|
|
- <div style={{ color: '#7bfffb' }}>系统自检</div>
|
|
|
|
- </Col>
|
|
|
|
- <Col span={8} style={{ display: 'flex', fontSize: 20 }}>
|
|
|
|
- <div>任务负责人:</div>
|
|
|
|
- <div style={{ color: '#fff' }}>{userList.find(item => item.ID === mandateInfo?.ResponsiblePeople)?.CName || ''}</div>
|
|
|
|
- </Col>
|
|
|
|
- <Col span={8} style={{ display: 'flex', fontSize: 20 }}>
|
|
|
|
- <div>任务状态:</div>
|
|
|
|
- <div style={{ color: '#7bfffb' }}>{getStatusText(mandateInfo?.Status)}</div>
|
|
|
|
- </Col>
|
|
|
|
- </Row> */}
|
|
|
|
- </div>
|
|
|
|
- </Card>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- {/* 设备自检报告 */}
|
|
|
|
- <ReportCom
|
|
|
|
- sendMessageToUnity={sendMessageToUnity}
|
|
|
|
- select={select}
|
|
|
|
- waringData={data?.extendWarningData}
|
|
|
|
- allData={data?.extendWarningAllData}
|
|
|
|
- key="extend"
|
|
|
|
- type={'extend'}
|
|
|
|
- userList={userList}
|
|
|
|
- title={
|
|
|
|
- <>
|
|
|
|
- <div className={styles.text}>设备自检报告</div>
|
|
|
|
- </>
|
|
|
|
- }
|
|
|
|
- ></ReportCom>
|
|
|
|
-
|
|
|
|
- {/* 工艺自检报告"> */}
|
|
|
|
- <div>
|
|
|
|
- <div className={styles.tabBarExtraContent}>
|
|
|
|
- <div className={styles.text} style={{ height: 52, width: '50%' }}>
|
|
|
|
- <>
|
|
|
|
- <div>工艺自检报告</div>
|
|
|
|
- </>
|
|
|
|
- </div>
|
|
|
|
- <div className={styles.abnormal}>
|
|
|
|
- <div className={styles.text} style={{ float: 'right' }}>
|
|
|
|
- 异常({data?.FaultAnalysis?.length || 0})
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <AalysisTable
|
|
|
|
- onClickItem={sendMessageToUnity}
|
|
|
|
- select={select}
|
|
|
|
- data={data}
|
|
|
|
- />
|
|
|
|
|
|
+ );
|
|
|
|
+ })}
|
|
|
|
+ </Row>
|
|
</div>
|
|
</div>
|
|
- {/* 安全隐患自检报告"> */}
|
|
|
|
- <div>
|
|
|
|
- <div className={styles.tabBarExtraContent}>
|
|
|
|
- <div className={styles.text} style={{ height: 52, width: '50%' }}>
|
|
|
|
- <>
|
|
|
|
- <div>安全隐患自检报告</div>
|
|
|
|
- </>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- {/* 环境异常 */}
|
|
|
|
|
|
+ <div style={{ padding: 20, background: '#fff' }}>
|
|
|
|
+ {/* 设备自检报告 */}
|
|
<ReportCom
|
|
<ReportCom
|
|
sendMessageToUnity={sendMessageToUnity}
|
|
sendMessageToUnity={sendMessageToUnity}
|
|
select={select}
|
|
select={select}
|
|
- waringData={data?.sensorWaringData}
|
|
|
|
- allData={data?.sensor}
|
|
|
|
- data={data?.sensorWaringData}
|
|
|
|
- key="sensor"
|
|
|
|
- type={'sensor'}
|
|
|
|
- userList={userList}
|
|
|
|
- title={<div style={{ color: '#7bfffb', fontSize: 22 }}>环境异常</div>}
|
|
|
|
- ></ReportCom>
|
|
|
|
-
|
|
|
|
- {/* 安防检测异常 */}
|
|
|
|
- <ReportDumCom
|
|
|
|
- data={dumuList}
|
|
|
|
- title={
|
|
|
|
- <div style={{ color: '#7bfffb', fontSize: 22 }}>安防检测异常</div>
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
- {/* 电器检测异常 */}
|
|
|
|
- <ReportCom
|
|
|
|
- sendMessageToUnity={sendMessageToUnity}
|
|
|
|
- select={select}
|
|
|
|
- waringData={[]}
|
|
|
|
- allData={[]}
|
|
|
|
|
|
+ waringData={data?.extendWarningData}
|
|
|
|
+ allData={data?.extendWarningAllData}
|
|
key="extend"
|
|
key="extend"
|
|
type={'extend'}
|
|
type={'extend'}
|
|
userList={userList}
|
|
userList={userList}
|
|
title={
|
|
title={
|
|
- <div style={{ color: '#7bfffb', fontSize: 22 }}>电气检测异常</div>
|
|
|
|
- }
|
|
|
|
- ></ReportCom>
|
|
|
|
-
|
|
|
|
- {/* 密闭空间检测异常 */}
|
|
|
|
- <ReportCom
|
|
|
|
- sendMessageToUnity={sendMessageToUnity}
|
|
|
|
- select={select}
|
|
|
|
- waringData={[]}
|
|
|
|
- allData={[]}
|
|
|
|
- key="extend"
|
|
|
|
- type={'extend'}
|
|
|
|
- userList={userList}
|
|
|
|
- title={
|
|
|
|
- <div style={{ color: '#7bfffb', fontSize: 22 }}>
|
|
|
|
- 密闭空间检测异常
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <div className={styles.tableTitle}>设备自检报告</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
></ReportCom>
|
|
></ReportCom>
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
+ {/* 工艺自检报告"> */}
|
|
|
|
+ <div className={styles.content}>
|
|
|
|
+ <div className={styles.tableStatus}>
|
|
|
|
+ 异常({data?.FaultAnalysis?.length || 0})
|
|
|
|
+ </div>
|
|
|
|
+ <div className={styles.tableTitle2}>工艺自检报告</div>
|
|
|
|
+
|
|
|
|
+ <AalysisTable
|
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ data={data}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ {/* 安全隐患自检报告"> */}
|
|
|
|
+ <div className={styles.content}>
|
|
|
|
+ <div className={styles.tableTitle2}>安全隐患自检报告</div>
|
|
|
|
+ {/* 环境异常 */}
|
|
|
|
+ <ReportCom
|
|
|
|
+ sendMessageToUnity={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ waringData={data?.sensorWaringData}
|
|
|
|
+ allData={data?.sensor}
|
|
|
|
+ data={data?.sensorWaringData}
|
|
|
|
+ key="sensor"
|
|
|
|
+ type={'sensor'}
|
|
|
|
+ userList={userList}
|
|
|
|
+ title={
|
|
|
|
+ <div style={{ color: '#1677ff', fontSize: 22 }}>环境异常</div>
|
|
|
|
+ }
|
|
|
|
+ ></ReportCom>
|
|
|
|
+
|
|
|
|
+ {/* 安防检测异常 */}
|
|
|
|
+ <ReportDumCom
|
|
|
|
+ data={dumuList}
|
|
|
|
+ title={
|
|
|
|
+ <div style={{ color: '#1677ff', fontSize: 22 }}>安防检测异常</div>
|
|
|
|
+ }
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ {/* 电器检测异常 */}
|
|
|
|
+ <ReportCom
|
|
|
|
+ sendMessageToUnity={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ waringData={[]}
|
|
|
|
+ allData={[]}
|
|
|
|
+ key="extend"
|
|
|
|
+ type={'extend'}
|
|
|
|
+ userList={userList}
|
|
|
|
+ title={
|
|
|
|
+ <div style={{ color: '#1677ff', fontSize: 22 }}>电气检测异常</div>
|
|
|
|
+ }
|
|
|
|
+ ></ReportCom>
|
|
|
|
+
|
|
|
|
+ {/* 密闭空间检测异常 */}
|
|
|
|
+ <ReportCom
|
|
|
|
+ sendMessageToUnity={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ waringData={[]}
|
|
|
|
+ allData={[]}
|
|
|
|
+ key="extend"
|
|
|
|
+ type={'extend'}
|
|
|
|
+ userList={userList}
|
|
|
|
+ title={
|
|
|
|
+ <div style={{ color: '#1677ff', fontSize: 22 }}>
|
|
|
|
+ 密闭空间检测异常
|
|
|
|
+ </div>
|
|
|
|
+ }
|
|
|
|
+ ></ReportCom>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
{/* </Card> */}
|
|
{/* </Card> */}
|
|
</Spin>
|
|
</Spin>
|
|
);
|
|
);
|
|
@@ -340,7 +300,7 @@ export function DeviceTable(props) {
|
|
<div>
|
|
<div>
|
|
<i
|
|
<i
|
|
className={styles.iconStatus}
|
|
className={styles.iconStatus}
|
|
- style={{ background: '#60FE76' }}
|
|
|
|
|
|
+ style={{ background: '#12CEB3' }}
|
|
></i>
|
|
></i>
|
|
正常
|
|
正常
|
|
</div>
|
|
</div>
|
|
@@ -350,7 +310,7 @@ export function DeviceTable(props) {
|
|
<div>
|
|
<div>
|
|
<i
|
|
<i
|
|
className={styles.iconStatus}
|
|
className={styles.iconStatus}
|
|
- style={{ background: '#FF8600' }}
|
|
|
|
|
|
+ style={{ background: '#FE5850' }}
|
|
></i>
|
|
></i>
|
|
异常
|
|
异常
|
|
</div>
|
|
</div>
|
|
@@ -678,7 +638,7 @@ export function WarningTable(props) {
|
|
<div>
|
|
<div>
|
|
<i
|
|
<i
|
|
className={styles.iconStatus}
|
|
className={styles.iconStatus}
|
|
- style={{ background: '#60FE76' }}
|
|
|
|
|
|
+ style={{ background: '#12CEB3' }}
|
|
></i>
|
|
></i>
|
|
正常
|
|
正常
|
|
</div>
|
|
</div>
|
|
@@ -688,7 +648,7 @@ export function WarningTable(props) {
|
|
<div>
|
|
<div>
|
|
<i
|
|
<i
|
|
className={styles.iconStatus}
|
|
className={styles.iconStatus}
|
|
- style={{ background: '#FF8600' }}
|
|
|
|
|
|
+ style={{ background: '#FE5850' }}
|
|
></i>
|
|
></i>
|
|
异常
|
|
异常
|
|
</div>
|
|
</div>
|
|
@@ -795,40 +755,46 @@ function ReportCom(props) {
|
|
};
|
|
};
|
|
return (
|
|
return (
|
|
<div className={styles.detailCard}>
|
|
<div className={styles.detailCard}>
|
|
- <Tabs
|
|
|
|
- defaultActiveKey="1"
|
|
|
|
- tabBarExtraContent={
|
|
|
|
- <div className={styles.tabBarExtraContent}>{title} </div>
|
|
|
|
- }
|
|
|
|
- onChange={handleTabsChange}
|
|
|
|
- >
|
|
|
|
- <Tabs.TabPane tab={`异常/警告(${waringData.length || 0})`} key="1">
|
|
|
|
- {activeKey == '1' && (
|
|
|
|
- <WarningTable
|
|
|
|
- onClickItem={sendMessageToUnity}
|
|
|
|
- select={select}
|
|
|
|
- items={waringData}
|
|
|
|
- key={type}
|
|
|
|
- data={data}
|
|
|
|
- type={type}
|
|
|
|
- userList={userList}
|
|
|
|
- />
|
|
|
|
- )}
|
|
|
|
- </Tabs.TabPane>
|
|
|
|
- <Tabs.TabPane tab={`全部(${allData.length || 0})`} key="2">
|
|
|
|
- {activeKey == '2' && (
|
|
|
|
- <DeviceTable
|
|
|
|
- onClickItem={sendMessageToUnity}
|
|
|
|
- select={select}
|
|
|
|
- items={allData}
|
|
|
|
- data={data}
|
|
|
|
- key={type}
|
|
|
|
- type={type}
|
|
|
|
- userList={userList}
|
|
|
|
- />
|
|
|
|
- )}
|
|
|
|
- </Tabs.TabPane>
|
|
|
|
- </Tabs>
|
|
|
|
|
|
+ <div className={styles.tableTop}>
|
|
|
|
+ {title}
|
|
|
|
+ <Tabs
|
|
|
|
+ style={{ float: 'right' }}
|
|
|
|
+ defaultActiveKey="1"
|
|
|
|
+ onChange={handleTabsChange}
|
|
|
|
+ >
|
|
|
|
+ <Tabs.TabPane
|
|
|
|
+ tab={`异常/警告(${waringData.length || 0})`}
|
|
|
|
+ key="1"
|
|
|
|
+ ></Tabs.TabPane>
|
|
|
|
+ <Tabs.TabPane
|
|
|
|
+ tab={`全部(${allData.length || 0})`}
|
|
|
|
+ key="2"
|
|
|
|
+ ></Tabs.TabPane>
|
|
|
|
+ </Tabs>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ {activeKey == '1' && (
|
|
|
|
+ <WarningTable
|
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ items={waringData}
|
|
|
|
+ key={type}
|
|
|
|
+ data={data}
|
|
|
|
+ type={type}
|
|
|
|
+ userList={userList}
|
|
|
|
+ />
|
|
|
|
+ )}
|
|
|
|
+ {activeKey == '2' && (
|
|
|
|
+ <DeviceTable
|
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ items={allData}
|
|
|
|
+ data={data}
|
|
|
|
+ key={type}
|
|
|
|
+ type={type}
|
|
|
|
+ userList={userList}
|
|
|
|
+ />
|
|
|
|
+ )}
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|