|
@@ -1,15 +1,18 @@
|
|
|
-import React, { useState } from 'react'
|
|
|
|
|
|
|
+import React, { useEffect, useState } from 'react'
|
|
|
import './home.scss'
|
|
import './home.scss'
|
|
|
|
|
+//弹窗
|
|
|
import Alert from './public/alert-view/alert-view.jsx'
|
|
import Alert from './public/alert-view/alert-view.jsx'
|
|
|
-import Hint from './public/hint-view/hint-view.jsx'
|
|
|
|
|
-import Comfirm from './public/comfirm-view/comfirm-view.jsx'
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+import HintView from './public/hint-view/hint-view.jsx'
|
|
|
|
|
+import ComfirmView from './public/comfirm-view/comfirm-view.jsx'
|
|
|
|
|
+import alertView from './public/alert-view/alert-view.js'
|
|
|
|
|
+import hintView from './public/hint-view/hint-view.js'
|
|
|
|
|
+import comfirmView from './public/comfirm-view/comfirm-view.js'
|
|
|
|
|
+//子view
|
|
|
import Device from './device/device.jsx'
|
|
import Device from './device/device.jsx'
|
|
|
import ScreenShot from './screenshot/screenshot.jsx'
|
|
import ScreenShot from './screenshot/screenshot.jsx'
|
|
|
import AiChat from './ai-chat/ai-chat.jsx'
|
|
import AiChat from './ai-chat/ai-chat.jsx'
|
|
|
import Process from './process/process.jsx'
|
|
import Process from './process/process.jsx'
|
|
|
-import { createHandleClose } from './home.js'
|
|
|
|
|
|
|
+import { createHandleClose, createHintViewProps, createAlertProps, createComfirmViewProps } from './home.js'
|
|
|
|
|
|
|
|
function Home() {
|
|
function Home() {
|
|
|
const [showAlert, setShowAlert] = useState(false)
|
|
const [showAlert, setShowAlert] = useState(false)
|
|
@@ -20,6 +23,12 @@ function Home() {
|
|
|
const [showScreenShot, setShowScreenShot] = useState(true)
|
|
const [showScreenShot, setShowScreenShot] = useState(true)
|
|
|
const [showAiChat, setShowAiChat] = useState(true)
|
|
const [showAiChat, setShowAiChat] = useState(true)
|
|
|
const [showProcess, setShowProcess] = useState(true)
|
|
const [showProcess, setShowProcess] = useState(true)
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ hintView.setShowCallback(setShowHint)
|
|
|
|
|
+ alertView.setShowCallback(setShowAlert)
|
|
|
|
|
+ comfirmView.setShowCallback(setShowComfirm)
|
|
|
|
|
+ }, [])
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="home-container">
|
|
<div className="home-container">
|
|
@@ -30,11 +39,13 @@ function Home() {
|
|
|
{showProcess && <Process show={showProcess}/>}
|
|
{showProcess && <Process show={showProcess}/>}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- {showAlert && <Alert show={showAlert} onClose={createHandleClose(setShowAlert)} />}
|
|
|
|
|
- {showHint && <Hint show={showHint} onClose={createHandleClose(setShowHint)} />}
|
|
|
|
|
- {showComfirm && <Comfirm show={showComfirm} onClose={createHandleClose(setShowComfirm)} />}
|
|
|
|
|
|
|
+ <HintView {...createHintViewProps(showHint, setShowHint)} />
|
|
|
|
|
+ <Alert {...createAlertProps(showAlert, setShowAlert)} />
|
|
|
|
|
+ <ComfirmView {...createComfirmViewProps(showComfirm, setShowComfirm)} />
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export default Home
|
|
export default Home
|
|
|
|
|
+
|
|
|
|
|
+export { Alert, HintView, ComfirmView, alertView, hintView, comfirmView, createHandleClose }
|