From 3159d3fd1e8ac97f045001bd116837382985bbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 20 Dec 2019 10:06:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/myMonacoEditor/index.scss | 2 +- .../leftpane/editorTab/AddTestDemo.js | 108 +++++++++--------- .../newOrEditTask/leftpane/editorTab/index.js | 12 +- .../leftpane/editorTab/index.scss | 8 +- .../newOrEditTask/rightpane/index.scss | 2 +- .../modules/developer/recordDetail/index.scss | 2 +- .../modules/developer/split_pane_resizer.scss | 2 +- .../leftpane/commitRecord/index.js | 24 ++-- .../leftpane/commitRecord/index.scss | 2 +- .../studentStudy/leftpane/index.scss | 7 +- .../leftpane/taskDescription/index.js | 4 +- .../modules/tpm/jupyter/leftPane/index.scss | 2 +- .../tpm/shixunchild/Challenges/Challenges.js | 63 ++++++---- 13 files changed, 134 insertions(+), 104 deletions(-) diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.scss b/public/react/src/modules/developer/components/myMonacoEditor/index.scss index 61689b51e..a9fe17b94 100644 --- a/public/react/src/modules/developer/components/myMonacoEditor/index.scss +++ b/public/react/src/modules/developer/components/myMonacoEditor/index.scss @@ -7,7 +7,7 @@ background-color: rgba(18,28,36,1); color: #fff; height: 56px; - padding: 0 30px; + padding: 0 20px; .flex_strict{ flex: 1; } diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js index 8e7aa70fc..e42004555 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js @@ -4,11 +4,11 @@ * @Github: * @Date: 2019-11-21 09:19:38 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 17:54:28 + * @LastEditTime: 2019-12-20 09:23:07 */ import './index.scss'; import React, { useState } from 'react'; -import { Collapse, Icon, Input, Form, Button } from 'antd'; +import { Collapse, Icon, Input, Form } from 'antd'; import { connect } from 'react-redux'; import actions from '../../../../../redux/actions'; import { CNotificationHOC} from 'educoder'; @@ -18,14 +18,14 @@ const FormItem = Form.Item; const AddTestDemo = (props) => { const { key, - onSubmitTest, + // onSubmitTest, onDeleteTest, testCase, testCaseValidate, isOpen } = props; - const [isEditor, setIsEditor] = useState(false); // 是否是编辑 + // const [isEditor, setIsEditor] = useState(false); // 是否是编辑 // 删除操作 const handleDeletePanel = (e) => { @@ -73,54 +73,54 @@ const AddTestDemo = (props) => { ) // 取消操作 - const handleReset = (e) => { - e.preventDefault(); - props.form.resetFields(); - } + // const handleReset = (e) => { + // e.preventDefault(); + // props.form.resetFields(); + // } // 保存 - const handleSubmit = (e) => { - e.preventDefault(); - props.form.validateFields((err, values) => { - if (err) { - return; - } - console.log('提交表单: ', values); - onSubmitTest(values); - }); - } + // const handleSubmit = (e) => { + // e.preventDefault(); + // props.form.validateFields((err, values) => { + // if (err) { + // return; + // } + // console.log('提交表单: ', values); + // onSubmitTest(values); + // }); + // } // 编辑后保存 - const handleEditorOrSave = (e) => { - if (!isEditor) { - setIsEditor(true); - } else { - // TODO 调用修改测试用例接口 - setIsEditor(false); // 保存后 设置 false - } - } + // const handleEditorOrSave = (e) => { + // if (!isEditor) { + // setIsEditor(true); + // } else { + // // TODO 调用修改测试用例接口 + // setIsEditor(false); // 保存后 设置 false + // } + // } // 渲染提交按钮 - const renderSubmitBtn = () => { - const { identifier, testCase, loading } = props; - // console.log('========', identifier); - // 1. 新增时,不显示按钮 - if (identifier) { - if (testCase.isAdd) { - return ( - - - - - ); - } else { - return ( - - - - ); - } - } - } + // const renderSubmitBtn = () => { + // const { identifier, testCase, loading } = props; + // // console.log('========', identifier); + // // 1. 新增时,不显示按钮 + // if (identifier) { + // if (testCase.isAdd) { + // return ( + // + // + // + // + // ); + // } else { + // return ( + // + // + // + // ); + // } + // } + // } /** * 文本输入框可编辑的情况 @@ -128,9 +128,9 @@ const AddTestDemo = (props) => { * 2. isAdd 为 false 且 isEditor 为true 时 * @param {*} testCase */ - const isDisabled = (testCase) => { - return !testCase.isAdd && !isEditor; - }; + // const isDisabled = (testCase) => { + // return !testCase.isAdd && !isEditor; + // }; // const {input = {}, output = {}} = (testCasesValidate[index] = {}); const activePane = { @@ -158,7 +158,8 @@ const AddTestDemo = (props) => { rows={5} value={testCase.input} onChange={handleInputChange} - disabled={isDisabled(testCase)}/> + // disabled={isDisabled(testCase)} + /> 输出} @@ -170,9 +171,10 @@ const AddTestDemo = (props) => { rows={5} value={testCase.output} onChange={handleOutputChange} - disabled={isDisabled(testCase)}/> + // disabled={isDisabled(testCase)} + /> - {renderSubmitBtn()} + {/* {renderSubmitBtn()} */} diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js index da31754bd..929cdab43 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 10:35:40 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 17:23:10 + * @LastEditTime: 2019-12-19 20:16:32 */ import './index.scss'; // import 'katex/dist/katex.css'; @@ -235,7 +235,7 @@ class EditTab extends React.Component { ['image', 'formula'], // 数学公式、图片、视频 ['clean'], // 清除格式 ]; - + return (
@@ -309,15 +309,15 @@ class EditTab extends React.Component { colon={ false } >
-
- + {/* */} - +
{/* 添加测试用例 */} diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.scss b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.scss index 17f3eae34..56fa3e306 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.scss +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.scss @@ -48,7 +48,7 @@ .test_demo_title, .test_demo_ctx, .editor_form{ - margin: 0 30px; + margin: 0 20px; .ant-form-explain{ margin-top: 5px; @@ -68,7 +68,7 @@ top: 43px; left: -30px; right: -30px; - padding: 0 30px; + padding: 0 20px; // background: gold; background: rgb(249,249,249); z-index: 1000; @@ -77,5 +77,9 @@ .collapse_area{ margin-bottom: 20px; + + .ant-form-item{ + margin-bottom: 0px; + } } } \ No newline at end of file diff --git a/public/react/src/modules/developer/newOrEditTask/rightpane/index.scss b/public/react/src/modules/developer/newOrEditTask/rightpane/index.scss index 9c472b641..4bec9546e 100644 --- a/public/react/src/modules/developer/newOrEditTask/rightpane/index.scss +++ b/public/react/src/modules/developer/newOrEditTask/rightpane/index.scss @@ -17,7 +17,7 @@ } .code-title, .pane_control_opts{ - padding: 0 30px; + padding: 0 20px; } .code-title{ diff --git a/public/react/src/modules/developer/recordDetail/index.scss b/public/react/src/modules/developer/recordDetail/index.scss index 5c6c78f7e..e52090060 100644 --- a/public/react/src/modules/developer/recordDetail/index.scss +++ b/public/react/src/modules/developer/recordDetail/index.scss @@ -2,7 +2,7 @@ .record_detail_area{ .record_detail_ctx{ - padding: 0 30px; + padding: 0 20px; .detail_ctx_header{ position: relative; height: 56px; diff --git a/public/react/src/modules/developer/split_pane_resizer.scss b/public/react/src/modules/developer/split_pane_resizer.scss index 2898d966c..fc868022d 100644 --- a/public/react/src/modules/developer/split_pane_resizer.scss +++ b/public/react/src/modules/developer/split_pane_resizer.scss @@ -88,7 +88,7 @@ .add_editor_list_area{ background: #fff; - padding: 0 30px; + padding: 0 20px; margin: 0; .add_editor_item{ display: inline-block; diff --git a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js index 63d1bd2a3..7fc061765 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 09:49:33 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-05 10:38:49 + * @LastEditTime: 2019-12-20 09:35:00 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -79,6 +79,9 @@ const CommitRecord = (props) => { const [pagination, setPagination] = useState(paginationConfig); const [tableData, setTableData] = useState([]); + + let clipboard; + // const [recordDetail, setRecordDetail] = useState({}); const [renderCtx, setRenderCtx] = useState(() => { return function () { @@ -89,14 +92,14 @@ const CommitRecord = (props) => { const renderRecordDetail = () => { const { id, - error_line, - error_msg, - execute_memory, - execute_time, - input, - output, + // error_line, + // error_msg, + // execute_memory, + // execute_time, + // input, + // output, status, - expected_output + // expected_output } = commitRecordDetail; if (Object.keys(commitRecordDetail).length > 0) { console.log('当前状态====》》》', status); @@ -146,9 +149,12 @@ const CommitRecord = (props) => { setRenderCtx(() => (renderRecordDetail)) }, [commitRecordDetail]); // 复制功能 + useEffect(() => { + if (!clipboard) { + clipboard = new ClipboardJS('.copy_error'); + } if (commitRecordDetail.status !== 0) { - const clipboard = new ClipboardJS('.copy_error'); clipboard.on('success', (e) => { message.success('复制成功'); e.clearSelection(); diff --git a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss index 596e9abe7..283617445 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss +++ b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.scss @@ -1,6 +1,6 @@ .commit_record_area{ // padding: 20px 30px; - padding: 0 30px; + padding: 0 20px; .record_header{ display: flex; // justify-content: space-between; diff --git a/public/react/src/modules/developer/studentStudy/leftpane/index.scss b/public/react/src/modules/developer/studentStudy/leftpane/index.scss index 1582c033f..a48d021f9 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/index.scss +++ b/public/react/src/modules/developer/studentStudy/leftpane/index.scss @@ -16,7 +16,7 @@ box-sizing: border-box; border-top: 1px solid rgba(244,244,244,1); // background: pink; - padding: 0 30px; + padding: 0 20px; // background-color: rgba(250,250,250,1); background: #fff; @@ -32,7 +32,7 @@ } .commit_record_area{ - padding: 0 30px; + padding: 0 20px; // height: calc(100vh - 178px); // overflow-y: auto; } @@ -40,6 +40,7 @@ .task_desc_area{ height: calc(100vh - 242px); + overflow-y: auto; padding: 0 0 0 15px; } .desc_area_header{ @@ -47,7 +48,7 @@ justify-content: space-between; align-items: center; height: 64px; - padding: 0 30px; + padding: 0 20px; .header_flex{ font-size: 14px; .flex_label{ diff --git a/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js b/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js index 981770b8c..3f4a3d6c0 100644 --- a/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js +++ b/public/react/src/modules/developer/studentStudy/leftpane/taskDescription/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 09:49:30 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 09:22:52 + * @LastEditTime: 2019-12-20 09:39:35 */ import '../index.scss'; import React from 'react'; @@ -41,7 +41,7 @@ const TaskDescription = (props) => {

- diff --git a/public/react/src/modules/tpm/jupyter/leftPane/index.scss b/public/react/src/modules/tpm/jupyter/leftPane/index.scss index 9c95b1aae..352e1c9ab 100644 --- a/public/react/src/modules/tpm/jupyter/leftPane/index.scss +++ b/public/react/src/modules/tpm/jupyter/leftPane/index.scss @@ -6,7 +6,7 @@ line-height: 44px; // background-color: #EEEEEE; background: #fff; - padding: 0 30px; + padding: 0 20px; font-size: 16px; // box-size: border-box; box-sizing: border-box; diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index 548e7224a..772cd089a 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -59,7 +59,7 @@ class Challenges extends Component { isopentitletype:"Less", }) } - + this.getjianjiesize() } } }).catch((error) => { @@ -67,6 +67,31 @@ class Challenges extends Component { }); } + getjianjiesize=()=>{ + let {ChallengesDataList}=this.state; + let boxoffsetHeigh; + let box=document.getElementById("shixunchallengesid"); + + if(box){ + boxoffsetHeigh=box.offsetHeight + if(boxoffsetHeigh{ this.setState({ opentitletype:!this.state.opentitletype, - + isopentitletype:!this.state.opentitletype===false?"Less":"greater" }) } @@ -415,7 +423,7 @@ class Challenges extends Component { this.props.identity < 5?实训制作指南 : "":""}
- {this.state.opentitletype===true?:""} + :"":}