|
|
|
@ -4,10 +4,10 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-11-27 16:02:36
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-12-19 10:47:44
|
|
|
|
|
* @LastEditTime: 2019-12-19 19:47:32
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, { useState, useRef } from 'react';
|
|
|
|
|
import React, { useState, useRef, useEffect } from 'react';
|
|
|
|
|
import { Tabs, Button, Icon } from 'antd';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
import InitTabCtx from '../initTabCtx';
|
|
|
|
@ -23,10 +23,11 @@ const ControlSetting = (props) => {
|
|
|
|
|
submitLoading,
|
|
|
|
|
identifier,
|
|
|
|
|
excuteState,
|
|
|
|
|
showOrHideControl,
|
|
|
|
|
commitRecordDetail,
|
|
|
|
|
changeLoadingState,
|
|
|
|
|
changeSubmitLoadingStatus,
|
|
|
|
|
showOrHideControl,
|
|
|
|
|
changeShowOrHideControl,
|
|
|
|
|
// debuggerCode,
|
|
|
|
|
// startDebuggerCode, // 外部存入
|
|
|
|
|
onDebuggerCode,
|
|
|
|
@ -44,10 +45,14 @@ const ControlSetting = (props) => {
|
|
|
|
|
setDefaultActiveKey(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setShowTextResult(props.showOrHideControl);
|
|
|
|
|
}, [props]);
|
|
|
|
|
|
|
|
|
|
// 显示/隐藏tab
|
|
|
|
|
const handleShowControl = () => {
|
|
|
|
|
setShowTextResult(!showTextResult);
|
|
|
|
|
showOrHideControl(!showTextResult);
|
|
|
|
|
changeShowOrHideControl(!showTextResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 调试代码
|
|
|
|
@ -55,7 +60,7 @@ const ControlSetting = (props) => {
|
|
|
|
|
// console.log(formRef.current.handleTestCodeFormSubmit);
|
|
|
|
|
// 调出控制台界面
|
|
|
|
|
setShowTextResult(true);
|
|
|
|
|
showOrHideControl(true);
|
|
|
|
|
changeShowOrHideControl(true);
|
|
|
|
|
formRef.current.handleTestCodeFormSubmit(() => {
|
|
|
|
|
setDefaultActiveKey('2');
|
|
|
|
|
});
|
|
|
|
@ -131,19 +136,20 @@ const ControlSetting = (props) => {
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
|
|
const {commonReducer, ojForUserReducer} = state;
|
|
|
|
|
const {loading, excuteState, submitLoading } = commonReducer;
|
|
|
|
|
const {loading, excuteState, submitLoading, showOrHideControl } = commonReducer;
|
|
|
|
|
const { commitRecordDetail } = ojForUserReducer;
|
|
|
|
|
return {
|
|
|
|
|
loading,
|
|
|
|
|
submitLoading,
|
|
|
|
|
excuteState,
|
|
|
|
|
showOrHideControl,
|
|
|
|
|
// identifier: user_program_identifier,
|
|
|
|
|
commitRecordDetail // 提交详情
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
// changeSubmitLoadingStatus
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
showOrHideControl: (flag) => dispatch(actions.showOrHideControl(flag)),
|
|
|
|
|
changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)),
|
|
|
|
|
changeLoadingState: (flag) => dispatch(actions.changeLoadingState(flag)),
|
|
|
|
|
changeSubmitLoadingStatus: (flag) => dispatch(actions.changeSubmitLoadingStatus(flag)),
|
|
|
|
|
debuggerCode: (identifier, values) => dispatch(actions.debuggerCode(identifier, values)),
|
|
|
|
|