|
@@ -290,7 +290,7 @@ export function DeviceTable(props) {
|
|
};
|
|
};
|
|
const handleError = async (values) => {
|
|
const handleError = async (values) => {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
- var res = await changeRecordStatus({
|
|
|
|
|
|
+ let res = await changeRecordStatus({
|
|
...values,
|
|
...values,
|
|
Id: currentItem.Id,
|
|
Id: currentItem.Id,
|
|
DeviceCode: currentItem.DeviceCode,
|
|
DeviceCode: currentItem.DeviceCode,
|
|
@@ -811,9 +811,19 @@ export function LiquidTable(props) {
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
title: '设备名称',
|
|
title: '设备名称',
|
|
- width: '20%',
|
|
|
|
|
|
+ width: '12%',
|
|
dataIndex: 'device_name',
|
|
dataIndex: 'device_name',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: '时间',
|
|
|
|
+ dataIndex: 'record_time',
|
|
|
|
+ render: (text) => {
|
|
|
|
+ if (text) {
|
|
|
|
+ return dayjs(text).format('YYYY.MM.DD HH:mm');
|
|
|
|
+ }
|
|
|
|
+ return '-';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: '类型',
|
|
title: '类型',
|
|
key: 'template_item_name',
|
|
key: 'template_item_name',
|
|
@@ -824,12 +834,12 @@ export function LiquidTable(props) {
|
|
dataIndex: 'origin_value',
|
|
dataIndex: 'origin_value',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '差值',
|
|
|
|
|
|
+ title: '差值/比值',
|
|
dataIndex: 'value',
|
|
dataIndex: 'value',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '设定值范围',
|
|
title: '设定值范围',
|
|
- width: '25%',
|
|
|
|
|
|
+ width: '18%',
|
|
render: (record) => (
|
|
render: (record) => (
|
|
<ThresholdDetail
|
|
<ThresholdDetail
|
|
current={record.value || 0}
|
|
current={record.value || 0}
|
|
@@ -906,7 +916,7 @@ function LiquidLevelCom(props) {
|
|
const [activeKey, setActiveKey] = useState('1');
|
|
const [activeKey, setActiveKey] = useState('1');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
const errorData = useMemo(() => {
|
|
- const errorData = allData?.filter((item) => item.status);
|
|
|
|
|
|
+ const errorData = allData?.filter((item) => item.status && !item.history);
|
|
return errorData;
|
|
return errorData;
|
|
}, [allData]);
|
|
}, [allData]);
|
|
|
|
|
|
@@ -929,14 +939,14 @@ function LiquidLevelCom(props) {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
key: '2',
|
|
key: '2',
|
|
- label: `全部(${allData?.length || 0})`,
|
|
|
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
children: <div></div>,
|
|
children: <div></div>,
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
></TabsContent>
|
|
></TabsContent>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- {activeKey == '1' && (
|
|
|
|
|
|
+ {activeKey === '1' && (
|
|
<LiquidTable
|
|
<LiquidTable
|
|
onClickItem={sendMessageToUnity}
|
|
onClickItem={sendMessageToUnity}
|
|
select={select}
|
|
select={select}
|
|
@@ -945,7 +955,7 @@ function LiquidLevelCom(props) {
|
|
type={type}
|
|
type={type}
|
|
/>
|
|
/>
|
|
)}
|
|
)}
|
|
- {activeKey == '2' && (
|
|
|
|
|
|
+ {activeKey === '2' && (
|
|
<LiquidTable
|
|
<LiquidTable
|
|
onClickItem={sendMessageToUnity}
|
|
onClickItem={sendMessageToUnity}
|
|
select={select}
|
|
select={select}
|
|
@@ -963,12 +973,22 @@ function DosingFlowTable(props) {
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
title: '设备名称',
|
|
title: '设备名称',
|
|
- width: '20%',
|
|
|
|
|
|
+ width: '12%',
|
|
dataIndex: 'device_name',
|
|
dataIndex: 'device_name',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: '时间',
|
|
|
|
+ dataIndex: 'record_time',
|
|
|
|
+ render: (text) => {
|
|
|
|
+ if (text) {
|
|
|
|
+ return dayjs(text).format('YYYY.MM.DD HH:mm');
|
|
|
|
+ }
|
|
|
|
+ return '-';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: '类型',
|
|
title: '类型',
|
|
- width: '1rem',
|
|
|
|
|
|
+ width: '15%',
|
|
key: 'template_item_name',
|
|
key: 'template_item_name',
|
|
dataIndex: 'template_item_name',
|
|
dataIndex: 'template_item_name',
|
|
},
|
|
},
|
|
@@ -986,7 +1006,7 @@ function DosingFlowTable(props) {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '设定值范围',
|
|
title: '设定值范围',
|
|
- width: '20%',
|
|
|
|
|
|
+ width: '18%',
|
|
render: (record) => (
|
|
render: (record) => (
|
|
<ThresholdDetail
|
|
<ThresholdDetail
|
|
current={record.value || 0}
|
|
current={record.value || 0}
|
|
@@ -1000,7 +1020,7 @@ function DosingFlowTable(props) {
|
|
{
|
|
{
|
|
title: '状态',
|
|
title: '状态',
|
|
dataIndex: 'status',
|
|
dataIndex: 'status',
|
|
- width: '1.25rem',
|
|
|
|
|
|
+ width: '20%',
|
|
render: (status) => {
|
|
render: (status) => {
|
|
switch (status) {
|
|
switch (status) {
|
|
case -1:
|
|
case -1:
|
|
@@ -1065,7 +1085,7 @@ function DosingFlowCom(props) {
|
|
const [activeKey, setActiveKey] = useState('1');
|
|
const [activeKey, setActiveKey] = useState('1');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
const errorData = useMemo(() => {
|
|
- const errorData = allData?.filter((item) => item.status);
|
|
|
|
|
|
+ const errorData = allData?.filter((item) => item.status && !item.history);
|
|
return errorData;
|
|
return errorData;
|
|
}, [allData]);
|
|
}, [allData]);
|
|
|
|
|
|
@@ -1088,7 +1108,7 @@ function DosingFlowCom(props) {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
key: '2',
|
|
key: '2',
|
|
- label: `全部(${allData?.length || 0})`,
|
|
|
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
children: <div></div>,
|
|
children: <div></div>,
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
@@ -1401,10 +1421,10 @@ function PressureGaugeTable(props) {
|
|
|
|
|
|
function PressureGaugeCom(props) {
|
|
function PressureGaugeCom(props) {
|
|
const { sendMessageToUnity, select, allData = [], title } = props;
|
|
const { sendMessageToUnity, select, allData = [], title } = props;
|
|
- const [activeKey, setActiveKey] = useState('2');
|
|
|
|
|
|
+ const [activeKey, setActiveKey] = useState('1');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
const errorData = useMemo(() => {
|
|
- const tempData = allData?.filter((item) => item.status);
|
|
|
|
|
|
+ const tempData = allData?.filter((item) => !item.history);
|
|
return tempData;
|
|
return tempData;
|
|
}, [allData]);
|
|
}, [allData]);
|
|
|
|
|
|
@@ -1416,18 +1436,30 @@ function PressureGaugeCom(props) {
|
|
<div className={styles.tableTop}>
|
|
<div className={styles.tableTop}>
|
|
{title}
|
|
{title}
|
|
<TabsContent
|
|
<TabsContent
|
|
- defaultActiveKey="2"
|
|
|
|
|
|
+ defaultActiveKey="1"
|
|
onChange={handleTabsChange}
|
|
onChange={handleTabsChange}
|
|
small
|
|
small
|
|
items={[
|
|
items={[
|
|
|
|
+ {
|
|
|
|
+ key: '1',
|
|
|
|
+ label: `异常/警告(${errorData?.length || 0})`,
|
|
|
|
+ children: <div></div>,
|
|
|
|
+ },
|
|
{
|
|
{
|
|
key: '2',
|
|
key: '2',
|
|
- label: `异常/警告(${allData?.length || 0})`,
|
|
|
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
children: <div></div>,
|
|
children: <div></div>,
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
></TabsContent>
|
|
></TabsContent>
|
|
</div>
|
|
</div>
|
|
|
|
+ {activeKey === '1' && (
|
|
|
|
+ <PressureGaugeTable
|
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ items={errorData}
|
|
|
|
+ />
|
|
|
|
+ )}
|
|
{activeKey === '2' && (
|
|
{activeKey === '2' && (
|
|
<PressureGaugeTable
|
|
<PressureGaugeTable
|
|
onClickItem={sendMessageToUnity}
|
|
onClickItem={sendMessageToUnity}
|
|
@@ -1563,10 +1595,10 @@ function WaterQualityTable(props) {
|
|
|
|
|
|
function WaterQualityCom(props) {
|
|
function WaterQualityCom(props) {
|
|
const { sendMessageToUnity, select, allData = [], title } = props;
|
|
const { sendMessageToUnity, select, allData = [], title } = props;
|
|
- const [activeKey, setActiveKey] = useState('2');
|
|
|
|
|
|
+ const [activeKey, setActiveKey] = useState('1');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
const errorData = useMemo(() => {
|
|
- const tempData = allData?.filter((item) => item.status);
|
|
|
|
|
|
+ const tempData = allData?.filter((item) => !item.history);
|
|
return tempData;
|
|
return tempData;
|
|
}, [allData]);
|
|
}, [allData]);
|
|
|
|
|
|
@@ -1578,18 +1610,30 @@ function WaterQualityCom(props) {
|
|
<div className={styles.tableTop}>
|
|
<div className={styles.tableTop}>
|
|
{title}
|
|
{title}
|
|
<TabsContent
|
|
<TabsContent
|
|
- defaultActiveKey="2"
|
|
|
|
|
|
+ defaultActiveKey="1"
|
|
onChange={handleTabsChange}
|
|
onChange={handleTabsChange}
|
|
small
|
|
small
|
|
items={[
|
|
items={[
|
|
|
|
+ {
|
|
|
|
+ key: '1',
|
|
|
|
+ label: `异常/警告(${errorData?.length || 0})`,
|
|
|
|
+ children: <div></div>,
|
|
|
|
+ },
|
|
{
|
|
{
|
|
key: '2',
|
|
key: '2',
|
|
- label: `异常/警告(${allData?.length || 0})`,
|
|
|
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
children: <div></div>,
|
|
children: <div></div>,
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
></TabsContent>
|
|
></TabsContent>
|
|
</div>
|
|
</div>
|
|
|
|
+ {activeKey === '1' && (
|
|
|
|
+ <WaterQualityTable
|
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
|
+ select={select}
|
|
|
|
+ items={errorData}
|
|
|
|
+ />
|
|
|
|
+ )}
|
|
{activeKey === '2' && (
|
|
{activeKey === '2' && (
|
|
<WaterQualityTable
|
|
<WaterQualityTable
|
|
onClickItem={sendMessageToUnity}
|
|
onClickItem={sendMessageToUnity}
|