|
@ -17,6 +17,7 @@ function YujingGuanli (props) { |
|
|
const [visible, setVisible] = useState(false); |
|
|
const [visible, setVisible] = useState(false); |
|
|
const [type, setType] = useState(); |
|
|
const [type, setType] = useState(); |
|
|
const [curRecord, setCurRecord] = useState(); |
|
|
const [curRecord, setCurRecord] = useState(); |
|
|
|
|
|
const [tabs,settabs] = useState(1) |
|
|
const [data,setdata]= useState([]) |
|
|
const [data,setdata]= useState([]) |
|
|
const [tableList, settableList] = useState([]) |
|
|
const [tableList, settableList] = useState([]) |
|
|
const [name, setName] = useState(''); |
|
|
const [name, setName] = useState(''); |
|
@ -25,7 +26,7 @@ function YujingGuanli (props) { |
|
|
const [search, setSearch] = useState({ name: null, time: [times[0], times[1]], state: 'null' }) |
|
|
const [search, setSearch] = useState({ name: null, time: [times[0], times[1]], state: 'null' }) |
|
|
const STATE_TEXT = { 1: '待制定计划', 2: '待审核', 3: '计划驳回', 4: '待维修', 5: '待验收', 6: '验收通过', 7: '验收不通过', } |
|
|
const STATE_TEXT = { 1: '待制定计划', 2: '待审核', 3: '计划驳回', 4: '待维修', 5: '待验收', 6: '验收通过', 7: '验收不通过', } |
|
|
const onChange = (key) => { |
|
|
const onChange = (key) => { |
|
|
console.log(key); |
|
|
settabs(key) |
|
|
}; |
|
|
}; |
|
|
const renderOptionText = (currentState) => { |
|
|
const renderOptionText = (currentState) => { |
|
|
let text = '待制定计划' |
|
|
let text = '待制定计划' |
|
@ -176,13 +177,13 @@ function YujingGuanli (props) { |
|
|
return ( |
|
|
return ( |
|
|
<> |
|
|
<> |
|
|
<Tabs |
|
|
<Tabs |
|
|
defaultActiveKey="1" |
|
|
activeKey={tabs} |
|
|
onChange={onChange} |
|
|
onChange={onChange} |
|
|
style={{marginLeft:'20px',marginRight:'20px'}} |
|
|
style={{marginLeft:'20px',marginRight:'20px'}} |
|
|
items={[ |
|
|
items={[ |
|
|
{ |
|
|
{ |
|
|
label: `未告警`, |
|
|
label: `未告警`, |
|
|
key: '1', |
|
|
key: 1, |
|
|
children: <ProTable |
|
|
children: <ProTable |
|
|
columns={columns} |
|
|
columns={columns} |
|
|
actionRef={tableRef} |
|
|
actionRef={tableRef} |
|
@ -199,14 +200,16 @@ function YujingGuanli (props) { |
|
|
// }
|
|
|
// }
|
|
|
// })
|
|
|
// })
|
|
|
const res = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)); |
|
|
const res = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)); |
|
|
const data = res?.payload?.data?.filter(i=>{ |
|
|
const data = res?.payload?.data?.filter(i=>{ |
|
|
return i?.patrolRecordIssueHandles[0]?.yanshoucishu>2&&i?.patrolRecordIssueHandles[0]?.isgaojing!==true |
|
|
return i?.patrolRecordIssueHandles[0]?.yanshoucishu>2&&i?.patrolRecordIssueHandles[0]?.isgaojing!==true |
|
|
&&res?.payload?.data?.filter(j=>j?.pointId===i?.pointId |
|
|
&&res?.payload?.data?.filter(j=>j?.pointId===i?.pointId&&j?.points?.project?.id===i?.points?.project?.id |
|
|
&&j?.points?.project?.id===i?.points?.project?.id&& |
|
|
&&j?.patrolRecordIssueHandles[0]?.yujingshijian |
|
|
parseInt(moment(i?.patrolRecordIssueHandles[0].yujingshijian).format('YYYYMMDD'))<parseInt(moment(j?.patrolRecordIssueHandles[0]?.yujingshijian).format('YYYYMMDD')) |
|
|
&&i?.patrolRecordIssueHandles[0]?.yujingshijian&& |
|
|
).length===0 |
|
|
parseInt(moment(i?.patrolRecordIssueHandles[0].yujingshijian).format('YYYYMMDDHHMMSS'))<parseInt(moment(j?.patrolRecordIssueHandles[0]?.yujingshijian).format('YYYYMMDDHHMMSS')) |
|
|
|
|
|
).length===0 |
|
|
}) |
|
|
}) |
|
|
console.log(res,'res') |
|
|
console.log(res,'res') |
|
|
|
|
|
console.log(data,'data') |
|
|
// setDataSource(res?.payload?.data.filter(i=>i?.points?.project?.name.match(params.name)));
|
|
|
// setDataSource(res?.payload?.data.filter(i=>i?.points?.project?.name.match(params.name)));
|
|
|
setDataSource(data.filter(i=>i?.points?.project?.name.match(params.name))); |
|
|
setDataSource(data.filter(i=>i?.points?.project?.name.match(params.name))); |
|
|
}} |
|
|
}} |
|
@ -214,7 +217,7 @@ function YujingGuanli (props) { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: `已告警`, |
|
|
label: `已告警`, |
|
|
key: '2', |
|
|
key: 2, |
|
|
children: <ProTable |
|
|
children: <ProTable |
|
|
columns={columns1} |
|
|
columns={columns1} |
|
|
actionRef={tableRef} |
|
|
actionRef={tableRef} |
|
@ -226,12 +229,15 @@ function YujingGuanli (props) { |
|
|
request={async (params = {}) => { |
|
|
request={async (params = {}) => { |
|
|
const res = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)); |
|
|
const res = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)); |
|
|
const data = res?.payload?.data?.filter(i=>{ |
|
|
const data = res?.payload?.data?.filter(i=>{ |
|
|
return i?.patrolRecordIssueHandles[0]?.isgaojing===true&& |
|
|
return i?.patrolRecordIssueHandles[0]?.isgaojing===true&&i?.patrolRecordIssueHandles[0]?.yujingafchishu===null |
|
|
res?.payload?.data?.filter(j=>j?.pointId===i?.pointId |
|
|
// &&res?.payload?.data?.filter(j=>
|
|
|
&&j?.points?.project?.id===i?.points?.project?.id&& |
|
|
// {
|
|
|
parseInt(moment(i?.patrolRecordIssueHandles[0].yujingshijian).format('YYYYMMDD'))<=parseInt(moment(j?.patrolRecordIssueHandles[0]?.yujingshijian).format('YYYYMMDD')) |
|
|
// return j?.pointId===i?.pointId
|
|
|
).length===0 |
|
|
// &&j?.points?.project?.id===i?.points?.project?.id&&i?.patrolRecordIssueHandles[0]?.yujingshijian&&
|
|
|
}) |
|
|
// parseInt(moment(i?.patrolRecordIssueHandles[0].yujingshijian).format('YYYYMMDDHHMMSS'))<parseInt(moment(j?.patrolRecordIssueHandles[0]?.yujingshijian).format('YYYYMMDDHHMMSS'))
|
|
|
|
|
|
// }).length===0
|
|
|
|
|
|
}) |
|
|
|
|
|
console.log(data,'data') |
|
|
setDataSource2(data.filter(i=>i?.points?.project?.name.match(params.name))); |
|
|
setDataSource2(data.filter(i=>i?.points?.project?.name.match(params.name))); |
|
|
|
|
|
|
|
|
}} |
|
|
}} |
|
@ -253,12 +259,15 @@ function YujingGuanli (props) { |
|
|
onHandle={async ()=>{ |
|
|
onHandle={async ()=>{ |
|
|
const res = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)); |
|
|
const res = await dispatch(patrolManage.records(`patrolRecord/all/${times[0]}/${times[1]}/true/null`)); |
|
|
const data2 = res?.payload?.data?.filter(i=>{ |
|
|
const data2 = res?.payload?.data?.filter(i=>{ |
|
|
return i?.patrolRecordIssueHandles[0]?.isgaojing===true&& |
|
|
return i?.patrolRecordIssueHandles[0]?.isgaojing===true&&i?.patrolRecordIssueHandles[0]?.yujingafchishu===null |
|
|
res?.payload?.data?.filter(j=>j?.pointId===i?.pointId |
|
|
// &&res?.payload?.data?.filter(j=>
|
|
|
&&j?.points?.project?.id===i?.points?.project?.id&& |
|
|
// {
|
|
|
parseInt(i?.patrolRecordIssueHandles[0].yujingshijian)<parseInt(j?.patrolRecordIssueHandles[0]?.yujingshijian) |
|
|
// return j?.pointId===i?.pointId
|
|
|
).length===0 |
|
|
// &&j?.points?.project?.id===i?.points?.project?.id&&i?.patrolRecordIssueHandles[0]?.yujingshijian&&
|
|
|
}) |
|
|
// parseInt(moment(i?.patrolRecordIssueHandles[0].yujingshijian).format('YYYYMMDDHHMMSS'))<parseInt(moment(j?.patrolRecordIssueHandles[0]?.yujingshijian).format('YYYYMMDDHHMMSS'))
|
|
|
|
|
|
// }).length===0
|
|
|
|
|
|
}) |
|
|
|
|
|
console.log(data,'data') |
|
|
const data = res?.payload?.data?.filter(i=>{ |
|
|
const data = res?.payload?.data?.filter(i=>{ |
|
|
return i?.patrolRecordIssueHandles[0]?.yanshoucishu>2&&i?.patrolRecordIssueHandles[0]?.isgaojing!==true |
|
|
return i?.patrolRecordIssueHandles[0]?.yanshoucishu>2&&i?.patrolRecordIssueHandles[0]?.isgaojing!==true |
|
|
&&res?.payload?.data?.filter(j=>j?.pointId===i?.pointId |
|
|
&&res?.payload?.data?.filter(j=>j?.pointId===i?.pointId |
|
@ -268,8 +277,9 @@ function YujingGuanli (props) { |
|
|
}) |
|
|
}) |
|
|
console.log(res,'res') |
|
|
console.log(res,'res') |
|
|
// setDataSource(res?.payload?.data.filter(i=>i?.points?.project?.name.match(params.name)));
|
|
|
// setDataSource(res?.payload?.data.filter(i=>i?.points?.project?.name.match(params.name)));
|
|
|
setDataSource(data.filter(i=>i?.points?.project?.name.match())); |
|
|
setDataSource(data); |
|
|
setDataSource2(data2.filter(i=>i?.points?.project?.name.match())); |
|
|
setDataSource2(data2); |
|
|
|
|
|
settabs(2) |
|
|
}} |
|
|
}} |
|
|
tableRef={tableRef} |
|
|
tableRef={tableRef} |
|
|
/> : null |
|
|
/> : null |
|
|