diff --git a/packages/core/src/components/codeRun/index.module.less b/packages/core/src/components/codeRun/index.module.less index dabd6d2..76cb5db 100644 --- a/packages/core/src/components/codeRun/index.module.less +++ b/packages/core/src/components/codeRun/index.module.less @@ -1,6 +1,11 @@ .tabPane{ margin:0 20px; + .form{ + height:600px; + overflow-y: auto; + } + .jsonInput { display: flex; flex-direction: row; diff --git a/packages/core/src/components/codeRun/index.tsx b/packages/core/src/components/codeRun/index.tsx index bece212..a8f163f 100644 --- a/packages/core/src/components/codeRun/index.tsx +++ b/packages/core/src/components/codeRun/index.tsx @@ -8,38 +8,42 @@ import CodeEditor from '../codeEditor'; import { defaultJson, formatJson, defaultConfig, formatConfig, compData } from './json' import styles from './index.module.less'; -interface IVisualrops { +interface IProps { onChange: (value: object) => void } - interface FormValue { children: object[], parent: string, schema: object } -const VisualTab: React.FC = (props) => { +// 可视化操作面板 +const VisualTab: React.FC = (props) => { const onChange = (value: FormValue) => { props.onChange(value.schema) } + return ( - +
+ +
) } -const JsonTab: React.FC = () => { - const termRef = useRef(null); +// 输入测试用例面板,包括pipe、config、context、payload +const JsonTab: React.FC = () => { + const termRef = useRef(document.createElement('div')); useEffect(() => { const term = new Terminal(); - term.open(termRef.current); - term.write('I\'m \x1B[1;3;31mterminal\x1B[0m $ ') + term.open(termRef.current as HTMLDivElement); + term.write('I\'m \x1B[1;3;31mterminal\x1B[0m $ '); }, []) return ( @@ -53,7 +57,7 @@ const JsonTab: React.FC = () => {
-

输入格式化:

+

输出:

{ ); } -interface IConfigProps { - onChange: (value: object) => void -} - -const ConfigTab: React.FC = (props) => { +// 输入投放配置config的操作面板,如”投放配置schema“ +const ConfigTab: React.FC = (props) => { return (
@@ -118,7 +119,7 @@ const CodeRun: React.FC = (props) => { - {props.isConfig ? : } + {props.isConfig ? : } ) diff --git a/packages/core/src/mods/settingBar/components/code/index.tsx b/packages/core/src/mods/settingBar/components/code/index.tsx index eb0231e..af249f4 100644 --- a/packages/core/src/mods/settingBar/components/code/index.tsx +++ b/packages/core/src/mods/settingBar/components/code/index.tsx @@ -119,6 +119,10 @@ const EditModal: React.FC = (props) => { }); }; + const onChange = (value: any) => { + // console.log({ value }) + } + return ( = (props) => { /> = (props) => { onOk={onRunOk} onCancel={onRunCancel} > - + ); diff --git a/packages/core/src/mods/settingBar/components/json/index.tsx b/packages/core/src/mods/settingBar/components/json/index.tsx index 4371b53..30aabba 100644 --- a/packages/core/src/mods/settingBar/components/json/index.tsx +++ b/packages/core/src/mods/settingBar/components/json/index.tsx @@ -97,7 +97,6 @@ const EditModal: React.FC = (props) => { }; const onChangeJson = (ev: any, newJson: string | undefined = ''): void => { // TODO 投放配置schema转化、普通json识别 - console.log({ newJson }) if (newJson !== json) { setJson(newJson); } diff --git a/packages/core/src/mods/settingBar/mods/testCase/index.tsx b/packages/core/src/mods/settingBar/mods/testCase/index.tsx index 3ad2c77..d854d36 100644 --- a/packages/core/src/mods/settingBar/mods/testCase/index.tsx +++ b/packages/core/src/mods/settingBar/mods/testCase/index.tsx @@ -45,6 +45,11 @@ interface IEditModalProps { const EditModal: React.FC = (props): JSX.Element => { const { visible, onOk, onCancel } = props; + + const onChange = (value: any) => { + // console.log({ value }) + } + return ( = (props): JSX.Element => { onOk={onOk} onCancel={onCancel} > - + ); };