Browse Source

养护删除后刷新

dev
巴林闲侠 3 years ago
parent
commit
2173cf8181
  1. 25
      web/client/src/sections/fillion/components/maintenanceTable.js

25
web/client/src/sections/fillion/components/maintenanceTable.js

@ -102,12 +102,12 @@ const DetailList = (props) => {
align: 'center', align: 'center',
render: (text, record) => { render: (text, record) => {
let day = moment(record.time).format("YYYYMMDD") let day = moment(record.time).format("YYYYMMDD")
if(!basicDate){ if (!basicDate) {
basicDate = day; basicDate = day;
counter +=1;
} else if(basicDate == day){
counter += 1; counter += 1;
} else if(basicDate != day){ } else if (basicDate == day) {
counter += 1;
} else if (basicDate != day) {
basicDate = day; basicDate = day;
counter = 1; counter = 1;
} }
@ -303,7 +303,11 @@ const MaintenanceTable = (props) => {
useEffect(() => { useEffect(() => {
if (record) { if (record) {
let query = { userId: record.id, reportType: 'conserve' , asc: true} let query = {
userId: record.id,
reportType: 'conserve',
asc: true
}
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) { if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss') query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
@ -320,7 +324,11 @@ const MaintenanceTable = (props) => {
} }
const handelRefresh = () => { const handelRefresh = () => {
let query = { userId: record.id, reportType: 'patrol', asc: true } let query = {
userId: record.id,
reportType: 'conserve',
asc: true
}
dispatch(getReportList(query)); dispatch(getReportList(query));
} }
@ -343,7 +351,10 @@ const MaintenanceTable = (props) => {
<Button style={{ marginLeft: 20 }} onClick={handleExport}>导出</Button> <Button style={{ marginLeft: 20 }} onClick={handleExport}>导出</Button>
</div> </div>
<Card style={{ flex: 1 }}> <Card style={{ flex: 1 }}>
<DetailList reportList={reportList} record={record} loading={reportListLoading} dispatch={dispatch} handleOpen={handleOpen} /> <DetailList
reportList={reportList} record={record} loading={reportListLoading} dispatch={dispatch} handleOpen={handleOpen}
handelRefresh={handelRefresh}
/>
</Card> </Card>
<DetailForm <DetailForm
visible={detailVisible} visible={detailVisible}

Loading…
Cancel
Save