|
|
|
@@ -1,7 +1,10 @@ |
|
|
|
import RobotFrame from '@/components/RobotFrame'; |
|
|
|
import { useDraggable } from '@/hooks/draggable'; |
|
|
|
import { getWorkspaceOverviewReq } from '@/services/workspace'; |
|
|
|
import { ExperimentInstance } from '@/types'; |
|
|
|
import { to } from '@/utils/promise'; |
|
|
|
import { useEffect, useState } from 'react'; |
|
|
|
import Draggable from 'react-draggable'; |
|
|
|
import AssetsManagement from './components/AssetsManagement'; |
|
|
|
import ExperimentChart, { type ExperimentStatistics } from './components/ExperimentChart'; |
|
|
|
import ExperitableTable from './components/ExperimentTable'; |
|
|
|
@@ -20,6 +23,10 @@ type OverviewData = { |
|
|
|
|
|
|
|
function Workspace() { |
|
|
|
const [overviewData, setOverviewData] = useState<OverviewData>(); |
|
|
|
const [robotFrameVisible, setRobotFrameVisible] = useState(false); |
|
|
|
const { handleStart, handleStop, handleDrag, handleClick } = useDraggable(() => |
|
|
|
setRobotFrameVisible((prev) => !prev), |
|
|
|
); |
|
|
|
const users: number[] = new Array(8).fill(0); |
|
|
|
useEffect(() => { |
|
|
|
getWorkspaceOverview(); |
|
|
|
@@ -64,6 +71,19 @@ function Workspace() { |
|
|
|
<AssetsManagement></AssetsManagement> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Draggable onStart={handleStart} onStop={handleStop} onDrag={handleDrag}> |
|
|
|
<img |
|
|
|
className={styles['workspace__robot-img']} |
|
|
|
src={require('@/assets/img/robot.png')} |
|
|
|
onClick={handleClick} |
|
|
|
onDragStart={(e) => e.preventDefault()} |
|
|
|
></img> |
|
|
|
</Draggable> |
|
|
|
|
|
|
|
<RobotFrame |
|
|
|
visible={robotFrameVisible} |
|
|
|
onClose={() => setRobotFrameVisible(false)} |
|
|
|
></RobotFrame> |
|
|
|
</div> |
|
|
|
); |
|
|
|
} |
|
|
|
|