From 572219449c261b7fd87135861c8cea01d7a5869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 6 Jan 2020 19:35:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 80 ++++++-- .../modules/question/component/Contentpart.js | 3 +- .../question/component/Headplugselections.js | 19 +- .../modules/question/component/Listjihe.js | 2 +- .../modules/question/component/SiderBars.js | 175 ++++++++++++++++++ .../question/component/SingleEditor.js | 5 + .../question/questioncss/questioncom.css | 24 +++ public/react/src/modules/tpm/SiderBar.js | 18 +- public/react/src/modules/tpm/TPMIndex.css | 6 + 9 files changed, 300 insertions(+), 32 deletions(-) create mode 100644 public/react/src/modules/question/component/SiderBars.js diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index 73b7eb00d..51d50932e 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -8,7 +8,8 @@ import { Table, Pagination, Drawer, - Input + Input, + Tooltip } from "antd"; import Headplugselections from "./component/Headplugselections"; import QuestionModal from "./component/QuestionModal"; @@ -17,8 +18,7 @@ import Contentpart from "./component/Contentpart"; import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; -import SiderBar from "../tpm/SiderBar"; -import ShixunSearchBar from "../tpm/shixuns/ShixunSearchBar"; +import SiderBars from "../question/component/SiderBars"; class Question extends Component { constructor(props) { @@ -259,10 +259,17 @@ class Question extends Component { this.getdata(data); } showDrawer = () => { - this.setState({ - visible: true, - }); - this.getbasket_listdata(); + if(this.state.visible===true){ + this.setState({ + visible: false, + }); + }else{ + this.setState({ + visible: true, + }); + this.getbasket_listdata(); + } + }; @@ -743,11 +750,23 @@ class Question extends Component { } - + { + ` + .-task-sidebar{ + height: 30%; + } + ` + } + + this.showDrawer()} Headertop={Headertop}/> + {/*顶部*/} @@ -811,19 +845,21 @@ class Question extends Component { onClose={() => this.onClose()} visible={visible} mask={false} - closable={true} > {Datacount && Datacount > 0 ?
+
+ 试题篮 +
{ single_questions_count === 0 ? "" - :
+ :

单选题{'('}{single_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}

this.showQuestionModals("SINGLE")}>

@@ -834,7 +870,7 @@ class Question extends Component { :

多选题{'('}{multiple_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}

this.showQuestionModals("MULTIPLE")}>

@@ -845,7 +881,7 @@ class Question extends Component { :

判断题{'('}{judgement_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}

this.showQuestionModals("JUDGMENT")}>

@@ -856,7 +892,7 @@ class Question extends Component { :

填空题{'('}{completion_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}

this.showQuestionModals("COMPLETION")}>

@@ -867,7 +903,7 @@ class Question extends Component { :

简答题{'('}{subjective_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}

this.showQuestionModals("SUBJECTIVE")}>

@@ -878,7 +914,7 @@ class Question extends Component { :

实训题{'('}{practical_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">实训题{'('}{practical_questions_count}{')'}

@@ -889,7 +925,7 @@ class Question extends Component { :

编程题{'('}{program_questions_count}{')'}

+ className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}

this.showQuestionModals("PROGRAM")}>

@@ -921,4 +957,12 @@ class Question extends Component { } export default SnackbarHOC()(TPMIndexHOC(Question)); - +{/* this.onClose()}*/} +{/* visible={visible}*/} +{/* mask={false}*/} +{/* closable={true}*/} +{/*>*/} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 7d18f4c11..859ab9dd2 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -9,7 +9,8 @@ import { Pagination, Tabs, Input, - Popover + Popover, + Tooltip } from "antd"; import './../questioncss/questioncom.css'; import NoneDatas from '../component/NoneDatas'; diff --git a/public/react/src/modules/question/component/Headplugselections.js b/public/react/src/modules/question/component/Headplugselections.js index 8d2cd6d01..3cff40cc2 100644 --- a/public/react/src/modules/question/component/Headplugselections.js +++ b/public/react/src/modules/question/component/Headplugselections.js @@ -174,10 +174,21 @@ class Headplugselections extends Component {
-
+
方向: + +
  • this.shixunsearchall("a")}>全部
  • +
    +
    -
  • this.shixunsearchall("a")}>全部
  • @@ -236,6 +245,8 @@ class Headplugselections extends Component {
    + +
    {/*题型*/} diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index f1a20378e..3c24c6a6b 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -77,7 +77,7 @@ class Listjihe extends Component { return ( -
    +
    {/*顶部*/}
    diff --git a/public/react/src/modules/question/component/SiderBars.js b/public/react/src/modules/question/component/SiderBars.js new file mode 100644 index 000000000..2717985fb --- /dev/null +++ b/public/react/src/modules/question/component/SiderBars.js @@ -0,0 +1,175 @@ +import React, { Component } from 'react'; +import { getImageUrl} from 'educoder'; +import {Tooltip} from 'antd'; +import '../../tpm/TPMIndex.css'; + +const $ = window.$; +const poiindex=0; +$(window).resize(function(){ + rightSlider(); +}); + +$(window).scroll(function(){ + if($(".gotop").length>0){ + if($(document).scrollTop()>0){ + $(".-task-sidebar .gotop").show(); + $(".gotop").click(function(){ + $("html,body").scrollTop(0); + }); + } + if($(document).scrollTop()==0){ + $(".-task-sidebar .gotop").hide(); + } + } +}); + +function rightSlider(){ + var poi=parseInt((parseInt($(window).width())- 1200 )/2)-81; + // console.log(parseInt($(window).width())+" "+poi); + if(poi>0){ + $(".-task-sidebar").css("right",poi); + }else{ + $(".-task-sidebar").css("right","0px"); + } + $(".-task-sidebar").show(); +} + + +function _initSider() { + var $descSide = $("
    ").appendTo("body"); + $(".-task-sidebar>div").hover(function(){ + //移入显示二维码 + if($(this).hasClass("scan")){ + $(".scan_ewm").show().css({right:"75px",opacity:0}).stop().animate({ + right:"45px",opacity:1 + }) + return; + } + var $tool = $(this).attr("tooltips"); + $descSide.html($tool+"
    "); + $descSide.data('_dom', this) + $descSide.show().css({ + left:$(this).offset().left - $descSide.width()-30, + opacity:0, + top:$(this).offset().top + }).stop().animate({ + left:$(this).offset().left - $descSide.width()-5, + opacity:1 + },400); + },function(){ + if($(this).hasClass("scan")){ + $(".scan_ewm").stop().animate({right:"75px",opacity:0},200).hide(); + } + $descSide.stop().animate({ + left:$(this).offset().left - $descSide.width()-30, + opacity:0 + },200).hide(); + }); + rightSlider(); + + $(window).scroll(function() { + if ($descSide.height()) { + var hoverIcon = $descSide.data('_dom') + $descSide.css('top', $(hoverIcon).offset().top) + } + }) +} + +class SiderBars extends Component { + constructor(props) { + super(props) + + } + + componentDidMount() { + _initSider() + + } + + render() { + + + // console.log("SiderBar"); + // console.log(this.props); + + var mypath= this.props&&this.props.match&&this.props.match.path; + let{myvisible}=this.props; + return ( + +
    + + {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
    + + { + mypath&&mypath==="/question"? + +
    this.props.showDrawer()} > + + + +

    试题库

    +
    +
    + :"" + + } + + +
    + + + +
    +
    + + + + +
    + + + +
    +
    + + +
    + +

    +

    + + +

    微信扫一扫

    +

    关注公众号

    +

    +

    + + }> + +
    +
    + + +
    + + + +
    +
    + +
    :""} +
    + ); + } +} + +export default SiderBars; diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js index 755034465..c111aa41b 100644 --- a/public/react/src/modules/question/component/SingleEditor.js +++ b/public/react/src/modules/question/component/SingleEditor.js @@ -253,6 +253,10 @@ class SingleEditor extends Component{ toShowMode = () => { } + + onContentChange=(e)=>{ + console.log(e); + } render() { let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state; let { question_id, index, exerciseIsPublish, @@ -314,6 +318,7 @@ class SingleEditor extends Component{ {/* placeholder="请您输入题干"*/} {/* value={question_title}*/} {/* options={['code-block', 'image', 'formula']}*/} + {/* onContentChange={this.onContentChange}*/} {/*/>*/}
    diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index 9a94af9e0..f61cfb8fd 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -858,3 +858,27 @@ .jinzhixiaoshou{ cursor:no-drop } + +.shitilang{ + height: 40px; + background: #606060; + color: #FFFFFF; + position: absolute; + top: -2px; + width: 100%; + left: 0px; + font-size:14px; + text-align: center; + line-height: 40px; +} + +.xiaoshoums:hover{ + color:#4CACFF; +} + +.shitikus{ + width: 40px !important; + position: absolute; + border-radius: 4px; + top: -50%; +} diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index 8f1ecf122..5cec0ec24 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -98,18 +98,11 @@ class SiderBar extends Component {
    {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
    - -
    - - - -
    -
    { mypath&&mypath==="/question"? -
    this.props.showDrawer()} > +
    this.props.showDrawer()} > @@ -120,6 +113,15 @@ class SiderBar extends Component { } + +
    + + + +
    +
    + +
    diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index ed37aac61..d5b8ef5c2 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -267,3 +267,9 @@ body>.-task-title { height:1px; background: #EEEEEE; } +.mystask-sidebar{ + right: 210px !important; +} +.mystask-sidebars{ + right: 10px !important; +} From 467929532f1847b7d948c59b842f4044c8280c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 6 Jan 2020 19:35:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/SiderBar.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index 5cec0ec24..cf7648ef4 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -99,19 +99,7 @@ class SiderBar extends Component { {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
    - { - mypath&&mypath==="/question"? - -
    this.props.showDrawer()} > - - - -

    试题库

    -
    -
    - :"" - - } +
    From 6b6f559e6a868cc33aca2210c5b75aecea00efa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 6 Jan 2020 19:36:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/SiderBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index cf7648ef4..ebc71d116 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -99,7 +99,7 @@ class SiderBar extends Component { {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?
    - +