|
|
|
|
@ -5,14 +5,16 @@ import { IconFullscreen, IconFullscreenExit } from '@arco-design/web-react/icon'
|
|
|
|
|
import { useSelector, useDispatch } from 'react-redux';
|
|
|
|
|
import { getMyComponentList } from '@/api/componentBase';
|
|
|
|
|
import { updateComponentCodingPath } from '@/store/ideContainer';
|
|
|
|
|
import { getComponentBaseInfo } from '@/api/componentDevelopProcess';
|
|
|
|
|
|
|
|
|
|
const Option = Select.Option;
|
|
|
|
|
|
|
|
|
|
const ComponentCoding = () => {
|
|
|
|
|
const [serverUrl, setServerUrl] = useState('');
|
|
|
|
|
const [optionsList, setOptionsList] = useState([]);
|
|
|
|
|
const [originList, setOriginList] = useState([]);
|
|
|
|
|
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
|
|
|
const [serverUrl, setServerUrl] = useState(''); // code-server 地址
|
|
|
|
|
const [optionsList, setOptionsList] = useState([]); // 下拉选择菜单
|
|
|
|
|
const [originList, setOriginList] = useState([]); // 原始数据-组件列表
|
|
|
|
|
const [currentComponent, setCurrentComponent] = useState({}); // 当前组件信息
|
|
|
|
|
const [isFullscreen, setIsFullscreen] = useState(false); // 全屏状态
|
|
|
|
|
const iframeRef = useRef(null);
|
|
|
|
|
const { componentCoding } = useSelector((state: any) => state.ideContainer);
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
@ -30,11 +32,19 @@ const ComponentCoding = () => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const getComponentInfo = async () => {
|
|
|
|
|
const res: any = await getComponentBaseInfo(componentCoding.id);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
setCurrentComponent(res.data);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getOptionsList();
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getComponentInfo();
|
|
|
|
|
const uri = process.env.NEXT_PUBLIC_DEV_CODE_SERVER_HOST;
|
|
|
|
|
const codeServerFolderPre = '/app/data';
|
|
|
|
|
|
|
|
|
|
|