|
@@ -233,7 +233,7 @@ function Detail(props) {
|
|
<ReportDumCom data={dumuList} title={'安防检测异常'} />
|
|
<ReportDumCom data={dumuList} title={'安防检测异常'} />
|
|
|
|
|
|
{/* 电器检测异常 */}
|
|
{/* 电器检测异常 */}
|
|
- <ReportCom
|
|
|
|
|
|
+ {/* <ReportCom
|
|
sendMessageToUnity={sendMessageToUnity}
|
|
sendMessageToUnity={sendMessageToUnity}
|
|
select={select}
|
|
select={select}
|
|
waringData={[]}
|
|
waringData={[]}
|
|
@@ -242,7 +242,7 @@ function Detail(props) {
|
|
type={'extend'}
|
|
type={'extend'}
|
|
userList={userList}
|
|
userList={userList}
|
|
title={'电气检测异常'}
|
|
title={'电气检测异常'}
|
|
- ></ReportCom>
|
|
|
|
|
|
+ ></ReportCom> */}
|
|
|
|
|
|
{/* 密闭空间检测异常 */}
|
|
{/* 密闭空间检测异常 */}
|
|
<ReportCom
|
|
<ReportCom
|
|
@@ -272,6 +272,7 @@ export function DeviceTable(props) {
|
|
userList,
|
|
userList,
|
|
type,
|
|
type,
|
|
} = props;
|
|
} = props;
|
|
|
|
+ console.log(items);
|
|
const { ProjectId, Id } = data;
|
|
const { ProjectId, Id } = data;
|
|
const [loading, setLoading] = useState(false);
|
|
const [loading, setLoading] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
const [visible, setVisible] = useState(false);
|
|
@@ -289,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,
|
|
@@ -311,7 +312,8 @@ export function DeviceTable(props) {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '巡检项',
|
|
title: '巡检项',
|
|
- dataIndex: 'TemplateItem.Name',
|
|
|
|
|
|
+ key: 'TemplateItem.Name',
|
|
|
|
+ dataIndex: ['TemplateItem', 'Name'],
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// title: '设备位号',
|
|
// title: '设备位号',
|
|
@@ -626,22 +628,13 @@ export function WarningTable(props) {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '巡检项',
|
|
title: '巡检项',
|
|
- dataIndex: 'TemplateItem.Name',
|
|
|
|
|
|
+ dataIndex: ['TemplateItem', 'Name'],
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // title: '设备位号',
|
|
|
|
- // width: '16%',
|
|
|
|
- // dataIndex: 'DeviceCode',
|
|
|
|
- // },
|
|
|
|
{
|
|
{
|
|
title: '设定值范围',
|
|
title: '设定值范围',
|
|
width: '30%',
|
|
width: '30%',
|
|
render: (record) => (
|
|
render: (record) => (
|
|
- <ThresholdDetail
|
|
|
|
- current={record.Value || 0}
|
|
|
|
- data={record || {}}
|
|
|
|
- // onClick={() => onClickThreshold(record)}
|
|
|
|
- />
|
|
|
|
|
|
+ <ThresholdDetail current={record.Value || 0} data={record || {}} />
|
|
),
|
|
),
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -818,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',
|
|
@@ -831,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}
|
|
@@ -913,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]);
|
|
|
|
|
|
@@ -936,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}
|
|
@@ -952,7 +955,7 @@ function LiquidLevelCom(props) {
|
|
type={type}
|
|
type={type}
|
|
/>
|
|
/>
|
|
)}
|
|
)}
|
|
- {activeKey == '2' && (
|
|
|
|
|
|
+ {activeKey === '2' && (
|
|
<LiquidTable
|
|
<LiquidTable
|
|
onClickItem={sendMessageToUnity}
|
|
onClickItem={sendMessageToUnity}
|
|
select={select}
|
|
select={select}
|
|
@@ -970,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',
|
|
},
|
|
},
|
|
@@ -993,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}
|
|
@@ -1007,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:
|
|
@@ -1072,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]);
|
|
|
|
|
|
@@ -1095,7 +1108,7 @@ function DosingFlowCom(props) {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
key: '2',
|
|
key: '2',
|
|
- label: `全部(${allData?.length || 0})`,
|
|
|
|
|
|
+ label: `历史记录(${allData?.length || 0})`,
|
|
children: <div></div>,
|
|
children: <div></div>,
|
|
},
|
|
},
|
|
]}
|
|
]}
|
|
@@ -1408,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]);
|
|
|
|
|
|
@@ -1423,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}
|
|
@@ -1570,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]);
|
|
|
|
|
|
@@ -1585,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}
|