|
@@ -33,18 +33,7 @@ function Detail(props) {
|
|
window.HightlightEquipment(data);
|
|
window.HightlightEquipment(data);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- const getTextColor = (status) => {
|
|
|
|
- switch (status) {
|
|
|
|
- case '警告':
|
|
|
|
- return '#FFE26D';
|
|
|
|
- case '异常':
|
|
|
|
- return '#FE5850';
|
|
|
|
- case '正常':
|
|
|
|
- return '#12CEB3';
|
|
|
|
- default:
|
|
|
|
- return '#12CEB3';
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
|
|
+
|
|
const { run: detailRun } = useRequest(getDumuDetail, {
|
|
const { run: detailRun } = useRequest(getDumuDetail, {
|
|
manual: true,
|
|
manual: true,
|
|
fetchKey: (id) => id,
|
|
fetchKey: (id) => id,
|
|
@@ -60,6 +49,26 @@ function Detail(props) {
|
|
var resultArr = [];
|
|
var resultArr = [];
|
|
var tempResult = data?.PatrolResult;
|
|
var tempResult = data?.PatrolResult;
|
|
var tempArr = tempResult?.split(';');
|
|
var tempArr = tempResult?.split(';');
|
|
|
|
+ const getTextColor = (status) => {
|
|
|
|
+ switch (status) {
|
|
|
|
+ case '警告':
|
|
|
|
+ return {
|
|
|
|
+ color: '#FFE26D',
|
|
|
|
+ className: styles.warn,
|
|
|
|
+ };
|
|
|
|
+ case '异常':
|
|
|
|
+ return {
|
|
|
|
+ color: '#FE5850',
|
|
|
|
+ className: styles.error,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ default:
|
|
|
|
+ return {
|
|
|
|
+ color: '#12CEB3',
|
|
|
|
+ className: '',
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ };
|
|
if (tempArr?.length > 0) {
|
|
if (tempArr?.length > 0) {
|
|
tempArr?.forEach((item, index) => {
|
|
tempArr?.forEach((item, index) => {
|
|
var tempItem = item;
|
|
var tempItem = item;
|
|
@@ -74,9 +83,9 @@ function Detail(props) {
|
|
value = data?.secureStatus === 0 ? '正常' : '异常';
|
|
value = data?.secureStatus === 0 ? '正常' : '异常';
|
|
}
|
|
}
|
|
resultArr.push({
|
|
resultArr.push({
|
|
|
|
+ ...getTextColor(value),
|
|
label,
|
|
label,
|
|
value,
|
|
value,
|
|
- color: getTextColor(value),
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -103,11 +112,6 @@ function Detail(props) {
|
|
return (
|
|
return (
|
|
<Spin spinning={loading} wrapperClassName="card-box">
|
|
<Spin spinning={loading} wrapperClassName="card-box">
|
|
<div className={styles.card}>
|
|
<div className={styles.card}>
|
|
- {data.Status == 0 ? (
|
|
|
|
- <div className={`${styles.orderIcon}`}>正常</div>
|
|
|
|
- ) : (
|
|
|
|
- <div className={`${styles.orderIcon} ${styles.error}`}>异常</div>
|
|
|
|
- )}
|
|
|
|
<Row>
|
|
<Row>
|
|
<Col span={24} className={styles.cardText}>
|
|
<Col span={24} className={styles.cardText}>
|
|
自检时间:{data?.CreatedTime}
|
|
自检时间:{data?.CreatedTime}
|
|
@@ -125,10 +129,12 @@ function Detail(props) {
|
|
{result?.map((item) => {
|
|
{result?.map((item) => {
|
|
return (
|
|
return (
|
|
<Col span={8} className={styles.cardText}>
|
|
<Col span={8} className={styles.cardText}>
|
|
- {item?.label}:
|
|
|
|
- <span style={{ color: item.color, fontWeight: 'bold' }}>
|
|
|
|
- {item?.value}
|
|
|
|
- </span>
|
|
|
|
|
|
+ <div className={styles.statusBox}>
|
|
|
|
+ <div className={`${styles.orderIcon} ${item.className}`}>
|
|
|
|
+ {item.value}
|
|
|
|
+ </div>
|
|
|
|
+ {item?.label}
|
|
|
|
+ </div>
|
|
</Col>
|
|
</Col>
|
|
);
|
|
);
|
|
})}
|
|
})}
|