|
|
|
@ -1,24 +1,40 @@
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
import styles from './style/index.module.less';
|
|
|
|
import styles from './style/index.module.less';
|
|
|
|
import SideBar from './sideBar';
|
|
|
|
import SideBar from './sideBar';
|
|
|
|
import LogBar from './logBar';
|
|
|
|
import LogBar from './logBar';
|
|
|
|
import RightSideBar from './rightSideBar';
|
|
|
|
import RightSideBar from './rightSideBar';
|
|
|
|
|
|
|
|
import { getUrlParams } from '@/utils/common';
|
|
|
|
|
|
|
|
|
|
|
|
interface Selected {
|
|
|
|
interface Selected {
|
|
|
|
currentPath?: string;
|
|
|
|
currentPath?: string;
|
|
|
|
currentKey?: string;
|
|
|
|
currentKey?: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 假设您有这些组件
|
|
|
|
type UrlParamsOptions = {
|
|
|
|
|
|
|
|
identity?: string;
|
|
|
|
|
|
|
|
[key: string]: string
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const AppFlowComponent = () => <div style={{ height: '70vh', width: '100%' }}>应用编排</div>;
|
|
|
|
const AppFlowComponent = () => <div style={{ height: '70vh', width: '100%' }}>应用编排</div>;
|
|
|
|
const CompListComponent = () => <div style={{ height: '70vh', width: '100%' }}>组件列表</div>;
|
|
|
|
const CompListComponent = () => <div style={{ height: '70vh', width: '100%' }}>组件列表</div>;
|
|
|
|
const AppInstanceComponent = () => <div style={{ height: '70vh', width: '100%' }}>应用实例</div>;
|
|
|
|
const AppInstanceComponent = () => <div style={{ height: '70vh', width: '100%' }}>应用实例</div>;
|
|
|
|
const EventComponent = () => <div style={{ height: '70vh', width: '100%' }}>事件</div>;
|
|
|
|
const EventComponent = () => <div style={{ height: '70vh', width: '100%' }}>事件</div>;
|
|
|
|
const GlobalVarComponent = () => <div style={{ height: '70vh', width: '100%' }}>全局变量</div>;
|
|
|
|
const GlobalVarComponent = () => <div style={{ height: '70vh', width: '100%' }}>全局变量</div>;
|
|
|
|
|
|
|
|
const MyComponents = () => <div style={{ height: '70vh', width: '100%' }}>我的组件</div>;
|
|
|
|
|
|
|
|
const MatchingComponents = () => <div style={{ height: '70vh', width: '100%' }}>协同组件</div>;
|
|
|
|
|
|
|
|
const ComponentReview = () => <div style={{ height: '70vh', width: '100%' }}>组件审核</div>;
|
|
|
|
|
|
|
|
const ComponentCoding = () => <div style={{ height: '70vh', width: '100%' }}>组件编码</div>;
|
|
|
|
|
|
|
|
const ComponentDeployment = () => <div style={{ height: '70vh', width: '100%' }}>组件部署</div>;
|
|
|
|
|
|
|
|
const ComponentTest = () => <div style={{ height: '70vh', width: '100%' }}>组件测试</div>;
|
|
|
|
|
|
|
|
|
|
|
|
function IDEContainer() {
|
|
|
|
function IDEContainer() {
|
|
|
|
|
|
|
|
|
|
|
|
const [selected, setSelected] = useState<Selected>({});
|
|
|
|
const [selected, setSelected] = useState<Selected>({});
|
|
|
|
|
|
|
|
const [urlParams, setUrlParams] = useState<UrlParamsOptions>({});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
setUrlParams(getUrlParams(window.location.href) as UrlParamsOptions);
|
|
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
// 根据选中的菜单项渲染对应组件
|
|
|
|
// 根据选中的菜单项渲染对应组件
|
|
|
|
const renderContent = () => {
|
|
|
|
const renderContent = () => {
|
|
|
|
@ -33,8 +49,20 @@ function IDEContainer() {
|
|
|
|
return <EventComponent />;
|
|
|
|
return <EventComponent />;
|
|
|
|
case 'globalVar':
|
|
|
|
case 'globalVar':
|
|
|
|
return <GlobalVarComponent />;
|
|
|
|
return <GlobalVarComponent />;
|
|
|
|
|
|
|
|
case 'myComponents':
|
|
|
|
|
|
|
|
return <MyComponents />;
|
|
|
|
|
|
|
|
case 'matchingComponents':
|
|
|
|
|
|
|
|
return <MatchingComponents />;
|
|
|
|
|
|
|
|
case 'componentReview':
|
|
|
|
|
|
|
|
return <ComponentReview />;
|
|
|
|
|
|
|
|
case 'componentCoding':
|
|
|
|
|
|
|
|
return <ComponentCoding />;
|
|
|
|
|
|
|
|
case 'componentDeployment':
|
|
|
|
|
|
|
|
return <ComponentDeployment />;
|
|
|
|
|
|
|
|
case 'componentTest':
|
|
|
|
|
|
|
|
return <ComponentTest />;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return <AppFlowComponent />;
|
|
|
|
return <div>点击左侧菜单选择需要查看的功能</div>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
@ -43,12 +71,13 @@ function IDEContainer() {
|
|
|
|
<SideBar
|
|
|
|
<SideBar
|
|
|
|
onMenuSelect={(select) => setSelected(select)}
|
|
|
|
onMenuSelect={(select) => setSelected(select)}
|
|
|
|
selectedKey={selected.currentKey}
|
|
|
|
selectedKey={selected.currentKey}
|
|
|
|
|
|
|
|
identity={urlParams.identity}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div className={styles.content}>
|
|
|
|
<div className={styles.content}>
|
|
|
|
<div className={styles.mainContent}>
|
|
|
|
<div className={styles.mainContent}>
|
|
|
|
{renderContent()}
|
|
|
|
{renderContent()}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<LogBar></LogBar>
|
|
|
|
{urlParams.identity !== 'componentDevelopment' && <LogBar></LogBar>}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<RightSideBar></RightSideBar>
|
|
|
|
<RightSideBar></RightSideBar>
|
|
|
|
|