|
@@ -290,7 +290,7 @@ export function DeviceTable(props) {
|
|
|
};
|
|
|
const handleError = async (values) => {
|
|
|
setLoading(true);
|
|
|
- var res = await changeRecordStatus({
|
|
|
+ let res = await changeRecordStatus({
|
|
|
...values,
|
|
|
Id: currentItem.Id,
|
|
|
DeviceCode: currentItem.DeviceCode,
|
|
@@ -314,7 +314,9 @@ export function DeviceTable(props) {
|
|
|
title: '巡检项',
|
|
|
key: 'TemplateItem.Name',
|
|
|
dataIndex: 'TemplateItem',
|
|
|
- render: (TemplateItem) => <div>{TemplateItem.Name}</div>,
|
|
|
+ render: (TemplateItem) => {
|
|
|
+ return TemplateItem?.Name || '-';
|
|
|
+ },
|
|
|
},
|
|
|
// {
|
|
|
// title: '设备位号',
|
|
@@ -629,7 +631,11 @@ export function WarningTable(props) {
|
|
|
},
|
|
|
{
|
|
|
title: '巡检项',
|
|
|
- dataIndex: 'TemplateItem.Name',
|
|
|
+ key: 'TemplateItem.Name',
|
|
|
+ dataIndex: 'TemplateItem',
|
|
|
+ render: (TemplateItem) => {
|
|
|
+ return TemplateItem?.Name || '-';
|
|
|
+ },
|
|
|
},
|
|
|
// {
|
|
|
// title: '设备位号',
|
|
@@ -821,9 +827,19 @@ export function LiquidTable(props) {
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '设备名称',
|
|
|
- width: '20%',
|
|
|
+ width: '12%',
|
|
|
dataIndex: 'device_name',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '时间',
|
|
|
+ dataIndex: 'record_time',
|
|
|
+ render: (text) => {
|
|
|
+ if (text) {
|
|
|
+ return dayjs(text).format('YYYY.MM.DD HH:mm');
|
|
|
+ }
|
|
|
+ return '-';
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
title: '类型',
|
|
|
key: 'template_item_name',
|
|
@@ -839,7 +855,7 @@ export function LiquidTable(props) {
|
|
|
},
|
|
|
{
|
|
|
title: '设定值范围',
|
|
|
- width: '25%',
|
|
|
+ width: '20%',
|
|
|
render: (record) => (
|
|
|
<ThresholdDetail
|
|
|
current={record.value || 0}
|
|
@@ -916,7 +932,7 @@ function LiquidLevelCom(props) {
|
|
|
const [activeKey, setActiveKey] = useState('1');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
|
- const errorData = allData?.filter((item) => item.status);
|
|
|
+ const errorData = allData?.filter((item) => item.status && !item.history);
|
|
|
return errorData;
|
|
|
}, [allData]);
|
|
|
|
|
@@ -939,14 +955,14 @@ function LiquidLevelCom(props) {
|
|
|
},
|
|
|
{
|
|
|
key: '2',
|
|
|
- label: `全部(${allData?.length || 0})`,
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
|
children: <div></div>,
|
|
|
},
|
|
|
]}
|
|
|
></TabsContent>
|
|
|
</div>
|
|
|
|
|
|
- {activeKey == '1' && (
|
|
|
+ {activeKey === '1' && (
|
|
|
<LiquidTable
|
|
|
onClickItem={sendMessageToUnity}
|
|
|
select={select}
|
|
@@ -955,7 +971,7 @@ function LiquidLevelCom(props) {
|
|
|
type={type}
|
|
|
/>
|
|
|
)}
|
|
|
- {activeKey == '2' && (
|
|
|
+ {activeKey === '2' && (
|
|
|
<LiquidTable
|
|
|
onClickItem={sendMessageToUnity}
|
|
|
select={select}
|
|
@@ -973,12 +989,22 @@ function DosingFlowTable(props) {
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '设备名称',
|
|
|
- width: '20%',
|
|
|
+ width: '12%',
|
|
|
dataIndex: 'device_name',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '时间',
|
|
|
+ dataIndex: 'record_time',
|
|
|
+ render: (text) => {
|
|
|
+ if (text) {
|
|
|
+ return dayjs(text).format('YYYY.MM.DD HH:mm');
|
|
|
+ }
|
|
|
+ return '-';
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
title: '类型',
|
|
|
- width: '1rem',
|
|
|
+ width: '10%',
|
|
|
key: 'template_item_name',
|
|
|
dataIndex: 'template_item_name',
|
|
|
},
|
|
@@ -996,7 +1022,7 @@ function DosingFlowTable(props) {
|
|
|
},
|
|
|
{
|
|
|
title: '设定值范围',
|
|
|
- width: '20%',
|
|
|
+ width: '18%',
|
|
|
render: (record) => (
|
|
|
<ThresholdDetail
|
|
|
current={record.value || 0}
|
|
@@ -1075,7 +1101,7 @@ function DosingFlowCom(props) {
|
|
|
const [activeKey, setActiveKey] = useState('1');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
|
- const errorData = allData?.filter((item) => item.status);
|
|
|
+ const errorData = allData?.filter((item) => item.status && !item.history);
|
|
|
return errorData;
|
|
|
}, [allData]);
|
|
|
|
|
@@ -1098,7 +1124,7 @@ function DosingFlowCom(props) {
|
|
|
},
|
|
|
{
|
|
|
key: '2',
|
|
|
- label: `全部(${allData?.length || 0})`,
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
|
children: <div></div>,
|
|
|
},
|
|
|
]}
|
|
@@ -1414,7 +1440,7 @@ function PressureGaugeCom(props) {
|
|
|
const [activeKey, setActiveKey] = useState('2');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
|
- const tempData = allData?.filter((item) => item.status);
|
|
|
+ const tempData = allData?.filter((item) => item.status && !item.history);
|
|
|
return tempData;
|
|
|
}, [allData]);
|
|
|
|
|
@@ -1426,18 +1452,30 @@ function PressureGaugeCom(props) {
|
|
|
<div className={styles.tableTop}>
|
|
|
{title}
|
|
|
<TabsContent
|
|
|
- defaultActiveKey="2"
|
|
|
+ defaultActiveKey="1"
|
|
|
onChange={handleTabsChange}
|
|
|
small
|
|
|
items={[
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ label: `异常/警告(${errorData?.length || 0})`,
|
|
|
+ children: <div></div>,
|
|
|
+ },
|
|
|
{
|
|
|
key: '2',
|
|
|
- label: `异常/警告(${allData?.length || 0})`,
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
|
children: <div></div>,
|
|
|
},
|
|
|
]}
|
|
|
></TabsContent>
|
|
|
</div>
|
|
|
+ {activeKey === '1' && (
|
|
|
+ <PressureGaugeTable
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
+ select={select}
|
|
|
+ items={errorData}
|
|
|
+ />
|
|
|
+ )}
|
|
|
{activeKey === '2' && (
|
|
|
<PressureGaugeTable
|
|
|
onClickItem={sendMessageToUnity}
|
|
@@ -1576,7 +1614,7 @@ function WaterQualityCom(props) {
|
|
|
const [activeKey, setActiveKey] = useState('2');
|
|
|
|
|
|
const errorData = useMemo(() => {
|
|
|
- const tempData = allData?.filter((item) => item.status);
|
|
|
+ const tempData = allData?.filter((item) => item.status && !item.history);
|
|
|
return tempData;
|
|
|
}, [allData]);
|
|
|
|
|
@@ -1588,18 +1626,30 @@ function WaterQualityCom(props) {
|
|
|
<div className={styles.tableTop}>
|
|
|
{title}
|
|
|
<TabsContent
|
|
|
- defaultActiveKey="2"
|
|
|
+ defaultActiveKey="1"
|
|
|
onChange={handleTabsChange}
|
|
|
small
|
|
|
items={[
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ label: `异常/警告(${errorData?.length || 0})`,
|
|
|
+ children: <div></div>,
|
|
|
+ },
|
|
|
{
|
|
|
key: '2',
|
|
|
- label: `异常/警告(${allData?.length || 0})`,
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
|
children: <div></div>,
|
|
|
},
|
|
|
]}
|
|
|
></TabsContent>
|
|
|
</div>
|
|
|
+ {activeKey === '1' && (
|
|
|
+ <WaterQualityTable
|
|
|
+ onClickItem={sendMessageToUnity}
|
|
|
+ select={select}
|
|
|
+ items={errorData}
|
|
|
+ />
|
|
|
+ )}
|
|
|
{activeKey === '2' && (
|
|
|
<WaterQualityTable
|
|
|
onClickItem={sendMessageToUnity}
|