|
@@ -0,0 +1,39 @@
|
|
|
+import React, { useEffect, useState } from 'react'
|
|
|
+import { useLocation } from 'react-router-dom'
|
|
|
+import styled from 'styled-components'
|
|
|
+import { getOnceJoblog } from '../services/index'
|
|
|
+
|
|
|
+const LogWrapper = styled.div`
|
|
|
+ padding: 30px;
|
|
|
+ width: 100%;
|
|
|
+ height: 800px;
|
|
|
+ background-color: #fff;
|
|
|
+ .log {
|
|
|
+ background-color: #012b36;
|
|
|
+ height: 100%;
|
|
|
+ overflow-y: scroll;
|
|
|
+ color: #638691;
|
|
|
+ }
|
|
|
+`
|
|
|
+
|
|
|
+const LogWatcher = () => {
|
|
|
+ const { state } = useLocation()
|
|
|
+ const [logData, setLogData] = useState(null)
|
|
|
+
|
|
|
+ const fetchOnceJoblog = async () => {
|
|
|
+ const { data } = await getOnceJoblog(state.id)
|
|
|
+ if (data.code === 200) {
|
|
|
+ setLogData(data.data.handle_msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ useEffect(() => {
|
|
|
+ fetchOnceJoblog()
|
|
|
+ }, [state])
|
|
|
+ return (
|
|
|
+ <LogWrapper>
|
|
|
+ <pre className="log">{logData}</pre>
|
|
|
+ </LogWrapper>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
+export default LogWatcher
|