|
@ -171,7 +171,7 @@ const Network = props => { |
|
|
? deviceListAlarms?.find(v => v.deviceId == p.sensorId) |
|
|
? deviceListAlarms?.find(v => v.deviceId == p.sensorId) |
|
|
? '异常' |
|
|
? '异常' |
|
|
: '正常' |
|
|
: '正常' |
|
|
: '正常', |
|
|
: '--', |
|
|
option: objRslt ? objRslt.option : p.option, |
|
|
option: objRslt ? objRslt.option : p.option, |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -190,22 +190,24 @@ const Network = props => { |
|
|
// const lastDataCopy=useMemo(()=>{ |
|
|
// const lastDataCopy=useMemo(()=>{ |
|
|
// return lastData |
|
|
// return lastData |
|
|
// },[thingId]) |
|
|
// },[thingId]) |
|
|
// const scroll = useMemo(() => ({ y: 400 }), []) |
|
|
const scroll = useMemo(() => ({ y:clientHeight-600+175 }), []) |
|
|
//名称回调事件 |
|
|
//名称回调事件 |
|
|
const inputChange = e => { |
|
|
const inputChange = e => { |
|
|
setSearchName(e) |
|
|
setSearchName(e) |
|
|
} |
|
|
} |
|
|
//选择设备类型下拉框回调 |
|
|
//选择设备类型下拉框回调 |
|
|
const selectChange = e => { |
|
|
const selectChange = e => { |
|
|
setSearchType(typeList.find(f => f.value == e)?.label) |
|
|
let rslt=typeList.find(f => f.value == e) |
|
|
|
|
|
setSearchType(rslt?rslt.label:undefined) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//查询事件回调 |
|
|
//查询事件回调 |
|
|
const searchHandler = () => { |
|
|
const searchHandler = () => { |
|
|
setLastData( |
|
|
setLastData( |
|
|
searchName || searchType |
|
|
lastDataCopy.filter(f => |
|
|
? lastDataCopy.filter(f => f.sensorName.includes(searchName) && f.deviceType.includes(searchType)) |
|
|
(searchName === undefined || f.sensorName.includes(searchName)) && |
|
|
: lastDataCopy |
|
|
(searchType === undefined || f.deviceType===searchType) |
|
|
|
|
|
) |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -213,7 +215,7 @@ const Network = props => { |
|
|
{ |
|
|
{ |
|
|
title: '设备名称', |
|
|
title: '设备名称', |
|
|
dataIndex: 'sensorName', |
|
|
dataIndex: 'sensorName', |
|
|
width: 200, |
|
|
width: '20%', |
|
|
key: 'sensorName', |
|
|
key: 'sensorName', |
|
|
render: (_, r) => { |
|
|
render: (_, r) => { |
|
|
return ( |
|
|
return ( |
|
@ -228,19 +230,19 @@ const Network = props => { |
|
|
{ |
|
|
{ |
|
|
title: '设备类型', |
|
|
title: '设备类型', |
|
|
dataIndex: 'deviceType', |
|
|
dataIndex: 'deviceType', |
|
|
width: 200, |
|
|
width: '15%', |
|
|
key: 'deviceType', |
|
|
key: 'deviceType', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '最后采集时间', |
|
|
title: '最后采集时间', |
|
|
dataIndex: 'collectTime', |
|
|
dataIndex: 'collectTime', |
|
|
width: 200, |
|
|
width: '15%', |
|
|
key: 'collectTime', |
|
|
key: 'collectTime', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '数据', |
|
|
title: '数据', |
|
|
dataIndex: 'data', |
|
|
dataIndex: 'data', |
|
|
width: 200, |
|
|
width: '20%', |
|
|
key: 'data', |
|
|
key: 'data', |
|
|
render: (_, r) => { |
|
|
render: (_, r) => { |
|
|
return ( |
|
|
return ( |
|
@ -254,19 +256,19 @@ const Network = props => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '物联网卡状态', |
|
|
title: '物联网卡状态', |
|
|
width: 200, |
|
|
width: '15%', |
|
|
dataIndex: 'iotCardStatus', |
|
|
dataIndex: 'iotCardStatus', |
|
|
key: 'iotCardStatus', |
|
|
key: 'iotCardStatus', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '状态', |
|
|
title: '状态', |
|
|
width: 200, |
|
|
width: '10%', |
|
|
dataIndex: 'status', |
|
|
dataIndex: 'status', |
|
|
key: 'status', |
|
|
key: 'status', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '操作', |
|
|
title: '操作', |
|
|
width: 200, |
|
|
width: '10%', |
|
|
dataIndex: 'option', |
|
|
dataIndex: 'option', |
|
|
key: 'option', |
|
|
key: 'option', |
|
|
}, |
|
|
}, |
|
@ -318,7 +320,7 @@ const Network = props => { |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<Table |
|
|
<Table |
|
|
// scroll={scroll} |
|
|
scroll={scroll} |
|
|
columns={columns} |
|
|
columns={columns} |
|
|
dataSource={lastData}></Table> |
|
|
dataSource={lastData}></Table> |
|
|
</> |
|
|
</> |
|
|