|
@@ -1,4 +1,4 @@
|
|
|
-import { Button } from 'antd'
|
|
|
+import { Button, Checkbox, Space } from 'antd'
|
|
|
import React, { useEffect, useState } from 'react'
|
|
|
import { useLocation, useNavigate } from 'react-router-dom'
|
|
|
import styled from 'styled-components'
|
|
@@ -25,10 +25,13 @@ const LogWrapper = styled.div`
|
|
|
}
|
|
|
`
|
|
|
|
|
|
+// let timeout = null
|
|
|
+
|
|
|
const LogWatcher = () => {
|
|
|
const navigate = useNavigate()
|
|
|
const { state } = useLocation()
|
|
|
const [logData, setLogData] = useState(null)
|
|
|
+ // const [autoRefresh, setAutoRefresh] = useState(false)
|
|
|
|
|
|
const fetchOnceJoblog = async () => {
|
|
|
const { data } = await getOnceJoblog(state.id)
|
|
@@ -45,16 +48,36 @@ const LogWatcher = () => {
|
|
|
state: { key: '3' },
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ // const changeRefresh = e => {
|
|
|
+ // if (e.target.checked) {
|
|
|
+ // fetchOnceJoblog()
|
|
|
+ // } else {
|
|
|
+ // clearTimeout(timeout)
|
|
|
+ // }
|
|
|
+ // setAutoRefresh(e.target.checked)
|
|
|
+ // }
|
|
|
+
|
|
|
+ // const onClickRefresh = () => {
|
|
|
+ // fetchOnceJoblog()
|
|
|
+ // }
|
|
|
+
|
|
|
return (
|
|
|
<LogWrapper>
|
|
|
<div className="return">
|
|
|
- <Button
|
|
|
- type="primary"
|
|
|
- onClick={() => {
|
|
|
- returnLogTable()
|
|
|
- }}>
|
|
|
- 返回上一级
|
|
|
- </Button>
|
|
|
+ <Space>
|
|
|
+ {/* <Checkbox onChange={changeRefresh} checked={autoRefresh}>
|
|
|
+ 自动刷新
|
|
|
+ </Checkbox>
|
|
|
+ <Button onClick={onClickRefresh}>刷新</Button> */}
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ returnLogTable()
|
|
|
+ }}>
|
|
|
+ 返回上一级
|
|
|
+ </Button>
|
|
|
+ </Space>
|
|
|
</div>
|
|
|
<pre className="log">{logData}</pre>
|
|
|
</LogWrapper>
|