From 3d47545da8aaf146ced03958fd2c9ef46ebcd151 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 20 Dec 2019 09:45:45 +0800 Subject: [PATCH] update style --- .../components/myMonacoEditor/index.scss | 2 +- .../leftpane/editorTab/AddTestDemo.js | 108 +++++++++--------- .../newOrEditTask/leftpane/editorTab/index.js | 4 +- .../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 +- 12 files changed, 90 insertions(+), 77 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..b1bf28d55 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'; @@ -311,7 +311,7 @@ class EditTab extends React.Component {
{ 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;