chromesetting
杨树明 5 years ago
parent 97a432fa6a
commit 3159d3fd1e

@ -7,7 +7,7 @@
background-color: rgba(18,28,36,1); background-color: rgba(18,28,36,1);
color: #fff; color: #fff;
height: 56px; height: 56px;
padding: 0 30px; padding: 0 20px;
.flex_strict{ .flex_strict{
flex: 1; flex: 1;
} }

@ -4,11 +4,11 @@
* @Github: * @Github:
* @Date: 2019-11-21 09:19:38 * @Date: 2019-11-21 09:19:38
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-19 17:54:28 * @LastEditTime: 2019-12-20 09:23:07
*/ */
import './index.scss'; import './index.scss';
import React, { useState } from 'react'; 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 { connect } from 'react-redux';
import actions from '../../../../../redux/actions'; import actions from '../../../../../redux/actions';
import { CNotificationHOC} from 'educoder'; import { CNotificationHOC} from 'educoder';
@ -18,14 +18,14 @@ const FormItem = Form.Item;
const AddTestDemo = (props) => { const AddTestDemo = (props) => {
const { const {
key, key,
onSubmitTest, // onSubmitTest,
onDeleteTest, onDeleteTest,
testCase, testCase,
testCaseValidate, testCaseValidate,
isOpen isOpen
} = props; } = props;
const [isEditor, setIsEditor] = useState(false); // 是否是编辑 // const [isEditor, setIsEditor] = useState(false); // 是否是编辑
// 删除操作 // 删除操作
const handleDeletePanel = (e) => { const handleDeletePanel = (e) => {
@ -73,54 +73,54 @@ const AddTestDemo = (props) => {
) )
// 取消操作 // 取消操作
const handleReset = (e) => { // const handleReset = (e) => {
e.preventDefault(); // e.preventDefault();
props.form.resetFields(); // props.form.resetFields();
} // }
// 保存 // 保存
const handleSubmit = (e) => { // const handleSubmit = (e) => {
e.preventDefault(); // e.preventDefault();
props.form.validateFields((err, values) => { // props.form.validateFields((err, values) => {
if (err) { // if (err) {
return; // return;
} // }
console.log('提交表单: ', values); // console.log('提交表单: ', values);
onSubmitTest(values); // onSubmitTest(values);
}); // });
} // }
// 编辑后保存 // 编辑后保存
const handleEditorOrSave = (e) => { // const handleEditorOrSave = (e) => {
if (!isEditor) { // if (!isEditor) {
setIsEditor(true); // setIsEditor(true);
} else { // } else {
// TODO 调用修改测试用例接口 // // TODO 调用修改测试用例接口
setIsEditor(false); // 保存后 设置 false // setIsEditor(false); // 保存后 设置 false
} // }
} // }
// 渲染提交按钮 // 渲染提交按钮
const renderSubmitBtn = () => { // const renderSubmitBtn = () => {
const { identifier, testCase, loading } = props; // const { identifier, testCase, loading } = props;
// console.log('========', identifier); // // console.log('========', identifier);
// 1. 新增时,不显示按钮 // // 1. 新增时,不显示按钮
if (identifier) { // if (identifier) {
if (testCase.isAdd) { // if (testCase.isAdd) {
return ( // return (
<FormItem style={{ textAlign: 'right' }}> // <FormItem style={{ textAlign: 'right' }}>
<Button style={{ marginRight: '20px' }} onClick={handleReset}>取消</Button> // <Button style={{ marginRight: '20px' }} onClick={handleReset}>取消</Button>
<Button type="primary" onClick={handleSubmit}>保存</Button> // <Button type="primary" onClick={handleSubmit}>保存</Button>
</FormItem> // </FormItem>
); // );
} else { // } else {
return ( // return (
<FormItem style={{ textAlign: 'right' }}> // <FormItem style={{ textAlign: 'right' }}>
<Button onClick={handleEditorOrSave} loading={loading}>{isEditor ? '保存' : (loading ? '保存' : '编辑')}</Button> // <Button onClick={handleEditorOrSave} loading={loading}>{isEditor ? '保存' : (loading ? '保存' : '编辑')}</Button>
</FormItem> // </FormItem>
); // );
} // }
} // }
} // }
/** /**
* 文本输入框可编辑的情况 * 文本输入框可编辑的情况
@ -128,9 +128,9 @@ const AddTestDemo = (props) => {
* 2. isAdd false isEditor 为true * 2. isAdd false isEditor 为true
* @param {*} testCase * @param {*} testCase
*/ */
const isDisabled = (testCase) => { // const isDisabled = (testCase) => {
return !testCase.isAdd && !isEditor; // return !testCase.isAdd && !isEditor;
}; // };
// const {input = {}, output = {}} = (testCasesValidate[index] = {}); // const {input = {}, output = {}} = (testCasesValidate[index] = {});
const activePane = { const activePane = {
@ -158,7 +158,8 @@ const AddTestDemo = (props) => {
rows={5} rows={5}
value={testCase.input} value={testCase.input}
onChange={handleInputChange} onChange={handleInputChange}
disabled={isDisabled(testCase)}/> // disabled={isDisabled(testCase)}
/>
</FormItem> </FormItem>
<FormItem <FormItem
label={<span className={'label_text'}>输出</span>} label={<span className={'label_text'}>输出</span>}
@ -170,9 +171,10 @@ const AddTestDemo = (props) => {
rows={5} rows={5}
value={testCase.output} value={testCase.output}
onChange={handleOutputChange} onChange={handleOutputChange}
disabled={isDisabled(testCase)}/> // disabled={isDisabled(testCase)}
/>
</FormItem> </FormItem>
{renderSubmitBtn()} {/* {renderSubmitBtn()} */}
</Form> </Form>
</Panel> </Panel>
</Collapse> </Collapse>

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:35:40 * @Date: 2019-11-20 10:35:40
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-19 17:23:10 * @LastEditTime: 2019-12-19 20:16:32
*/ */
import './index.scss'; import './index.scss';
// import 'katex/dist/katex.css'; // import 'katex/dist/katex.css';
@ -311,7 +311,7 @@ class EditTab extends React.Component {
<div style={{ marginTop: '15px'}}> <div style={{ marginTop: '15px'}}>
<QuillForEditor <QuillForEditor
style={{ height: '200px', 'overflowY': 'auto' }} style={{ height: '200px', 'overflowY': 'auto' }}
placeholder="init content" placeholder="请输入描述信息"
onContentChange={handleContentChange} onContentChange={handleContentChange}
options={quillConfig} options={quillConfig}
value={ojForm.description} value={ojForm.description}

@ -48,7 +48,7 @@
.test_demo_title, .test_demo_title,
.test_demo_ctx, .test_demo_ctx,
.editor_form{ .editor_form{
margin: 0 30px; margin: 0 20px;
.ant-form-explain{ .ant-form-explain{
margin-top: 5px; margin-top: 5px;
@ -68,7 +68,7 @@
top: 43px; top: 43px;
left: -30px; left: -30px;
right: -30px; right: -30px;
padding: 0 30px; padding: 0 20px;
// background: gold; // background: gold;
background: rgb(249,249,249); background: rgb(249,249,249);
z-index: 1000; z-index: 1000;
@ -77,5 +77,9 @@
.collapse_area{ .collapse_area{
margin-bottom: 20px; margin-bottom: 20px;
.ant-form-item{
margin-bottom: 0px;
}
} }
} }

@ -17,7 +17,7 @@
} }
.code-title, .code-title,
.pane_control_opts{ .pane_control_opts{
padding: 0 30px; padding: 0 20px;
} }
.code-title{ .code-title{

@ -2,7 +2,7 @@
.record_detail_area{ .record_detail_area{
.record_detail_ctx{ .record_detail_ctx{
padding: 0 30px; padding: 0 20px;
.detail_ctx_header{ .detail_ctx_header{
position: relative; position: relative;
height: 56px; height: 56px;

@ -88,7 +88,7 @@
.add_editor_list_area{ .add_editor_list_area{
background: #fff; background: #fff;
padding: 0 30px; padding: 0 20px;
margin: 0; margin: 0;
.add_editor_item{ .add_editor_item{
display: inline-block; display: inline-block;

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 09:49:33 * @Date: 2019-11-27 09:49:33
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-05 10:38:49 * @LastEditTime: 2019-12-20 09:35:00
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
@ -79,6 +79,9 @@ const CommitRecord = (props) => {
const [pagination, setPagination] = useState(paginationConfig); const [pagination, setPagination] = useState(paginationConfig);
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
let clipboard;
// const [recordDetail, setRecordDetail] = useState({}); // const [recordDetail, setRecordDetail] = useState({});
const [renderCtx, setRenderCtx] = useState(() => { const [renderCtx, setRenderCtx] = useState(() => {
return function () { return function () {
@ -89,14 +92,14 @@ const CommitRecord = (props) => {
const renderRecordDetail = () => { const renderRecordDetail = () => {
const { const {
id, id,
error_line, // error_line,
error_msg, // error_msg,
execute_memory, // execute_memory,
execute_time, // execute_time,
input, // input,
output, // output,
status, status,
expected_output // expected_output
} = commitRecordDetail; } = commitRecordDetail;
if (Object.keys(commitRecordDetail).length > 0) { if (Object.keys(commitRecordDetail).length > 0) {
console.log('当前状态====》》》', status); console.log('当前状态====》》》', status);
@ -146,9 +149,12 @@ const CommitRecord = (props) => {
setRenderCtx(() => (renderRecordDetail)) setRenderCtx(() => (renderRecordDetail))
}, [commitRecordDetail]); }, [commitRecordDetail]);
// 复制功能 // 复制功能
useEffect(() => { useEffect(() => {
if (!clipboard) {
clipboard = new ClipboardJS('.copy_error');
}
if (commitRecordDetail.status !== 0) { if (commitRecordDetail.status !== 0) {
const clipboard = new ClipboardJS('.copy_error');
clipboard.on('success', (e) => { clipboard.on('success', (e) => {
message.success('复制成功'); message.success('复制成功');
e.clearSelection(); e.clearSelection();

@ -1,6 +1,6 @@
.commit_record_area{ .commit_record_area{
// padding: 20px 30px; // padding: 20px 30px;
padding: 0 30px; padding: 0 20px;
.record_header{ .record_header{
display: flex; display: flex;
// justify-content: space-between; // justify-content: space-between;

@ -16,7 +16,7 @@
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid rgba(244,244,244,1); border-top: 1px solid rgba(244,244,244,1);
// background: pink; // background: pink;
padding: 0 30px; padding: 0 20px;
// background-color: rgba(250,250,250,1); // background-color: rgba(250,250,250,1);
background: #fff; background: #fff;
@ -32,7 +32,7 @@
} }
.commit_record_area{ .commit_record_area{
padding: 0 30px; padding: 0 20px;
// height: calc(100vh - 178px); // height: calc(100vh - 178px);
// overflow-y: auto; // overflow-y: auto;
} }
@ -40,6 +40,7 @@
.task_desc_area{ .task_desc_area{
height: calc(100vh - 242px); height: calc(100vh - 242px);
overflow-y: auto;
padding: 0 0 0 15px; padding: 0 0 0 15px;
} }
.desc_area_header{ .desc_area_header{
@ -47,7 +48,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 64px; height: 64px;
padding: 0 30px; padding: 0 20px;
.header_flex{ .header_flex{
font-size: 14px; font-size: 14px;
.flex_label{ .flex_label{

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 09:49:30 * @Date: 2019-11-27 09:49:30
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-19 09:22:52 * @LastEditTime: 2019-12-20 09:39:35
*/ */
import '../index.scss'; import '../index.scss';
import React from 'react'; import React from 'react';

@ -6,7 +6,7 @@
line-height: 44px; line-height: 44px;
// background-color: #EEEEEE; // background-color: #EEEEEE;
background: #fff; background: #fff;
padding: 0 30px; padding: 0 20px;
font-size: 16px; font-size: 16px;
// box-size: border-box; // box-size: border-box;
box-sizing: border-box; box-sizing: border-box;

@ -59,7 +59,7 @@ class Challenges extends Component {
isopentitletype:"Less", isopentitletype:"Less",
}) })
} }
this.getjianjiesize()
} }
} }
}).catch((error) => { }).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<ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?160:300){
debugger
this.setState({
isopentitletype:"Less",
boxoffsetHeigh:boxoffsetHeigh
})
}else{
debugger
this.setState({
opentitletype:true,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}
console.log(boxoffsetHeigh)
}
}
componentDidMount() { componentDidMount() {
this.ChallengesList() this.ChallengesList()
@ -75,24 +100,7 @@ class Challenges extends Component {
//防止陷入无限循环 //防止陷入无限循环
if(prevState.ChallengesDataList!=this.state.ChallengesDataList){ if(prevState.ChallengesDataList!=this.state.ChallengesDataList){
let boxoffsetHeigh; this.getjianjiesize()
let box=document.getElementById("shixunchallengesid");
if(box){
boxoffsetHeigh=box.offsetHeight
if(boxoffsetHeigh<300){
this.setState({
isopentitletype:"Less",
boxoffsetHeigh:boxoffsetHeigh
})
}else{
this.setState({
opentitletype:true,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}
console.log(boxoffsetHeigh)
}
} }
} }
@ -333,7 +341,7 @@ class Challenges extends Component {
opentitle=()=>{ opentitle=()=>{
this.setState({ this.setState({
opentitletype:!this.state.opentitletype, opentitletype:!this.state.opentitletype,
isopentitletype:!this.state.opentitletype===false?"Less":"greater"
}) })
} }
@ -415,7 +423,7 @@ class Challenges extends Component {
this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943" this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943"
target="_blank">实训制作指南</a> : "":""} target="_blank">实训制作指南</a> : "":""}
</div> </div>
{this.state.opentitletype===true?<style> {ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?this.state.opentitletype===true?<style>
{ {
` `
#shixunchallengesid{ #shixunchallengesid{
@ -424,7 +432,16 @@ class Challenges extends Component {
} }
` `
} }
</style>:""} </style>:"":<style>
{
`
#shixunchallengesid{
max-height: 160px;
overflow: hidden;
}
`
}
</style>}
<div> <div>
<div className={"pd20"} id={"shixunchallengesid"}> <div className={"pd20"} id={"shixunchallengesid"}>
<style> <style>
@ -454,7 +471,7 @@ class Challenges extends Component {
</div> </div>
</div> </div>
{this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> {this.state.isopentitletype==="Less"&&this.state.opentitletype===false?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a> <a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}> </Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a> <a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a>

Loading…
Cancel
Save