From f0dd437c332fafc5466953331cc5a8d3df539953 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 14:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/question/Question.js | 7 +- .../modules/question/component/Contentpart.js | 8 +- .../question/component/Contentquestionbank.js | 2 +- .../question/component/Headplugselections.js | 135 +++++++----------- .../src/modules/testpaper/Testpaperlibrary.js | 51 +++++-- .../testpaper/component/Contentpart.js | 19 +-- 6 files changed, 115 insertions(+), 107 deletions(-) diff --git a/public/react/src/modules/question/Question.js b/public/react/src/modules/question/Question.js index e2ec41a5e..9b781a142 100644 --- a/public/react/src/modules/question/Question.js +++ b/public/react/src/modules/question/Question.js @@ -701,6 +701,11 @@ class Question extends Component { disciplinesdata={this.state.disciplinesdata} {...this.props} {...this.state} + setdifficulty={(e) => this.setdifficulty(e)} + setitem_types={(e) => this.setitem_types(e)} + setdiscipline_id={(e)=>this.setdiscipline_id(e)} + setsub_discipline_id={(e)=>this.setsub_discipline_id(e)} + settag_discipline_id={(e)=>this.settag_discipline_id(e)} /> {/*头部*/} <Contentpart {...this.state} {...this.props} @@ -710,9 +715,7 @@ class Question extends Component { setdatafuns={(e) => this.setdatafuns(e)} setdatafunsval={(e) => this.setdatafunsval(e)} handleVisibleChanges={(e) => this.handleVisibleChanges(e)} - setitem_types={(e) => this.setitem_types(e)} handleVisibleChange={(e) => this.handleVisibleChange(e)} - setdifficulty={(e) => this.setdifficulty(e)} showmodels={(e) => this.showmodels(e)} showmodelysl={(e) => this.showmodelysl(e)} callback={(e) => this.callback(e)}></Contentpart> diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 681128a70..0fd38e4e3 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -95,6 +95,11 @@ class Contentpart extends Component { <style> { ` + + .contentparttit .ant-tabs-bar{ + margin: 0px 0px 0px 0px !important; + + } .contentparttit .ant-tabs-nav .ant-tabs-tab{ margin: 10px 10px 10px 0 !important; } @@ -121,6 +126,7 @@ class Contentpart extends Component { <style> { ` + .xaxisreverseorder .ant-input-group-addon{ width: 60px !important; @@ -151,7 +157,7 @@ class Contentpart extends Component { </a> :"" } - + {/*<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={()=>this.props.handleVisibleChange(true)}>*/} {/*<div className=" sortinxdirection mr10">*/} diff --git a/public/react/src/modules/question/component/Contentquestionbank.js b/public/react/src/modules/question/component/Contentquestionbank.js index 31b3d14fc..4f7441956 100644 --- a/public/react/src/modules/question/component/Contentquestionbank.js +++ b/public/react/src/modules/question/component/Contentquestionbank.js @@ -44,7 +44,7 @@ class Contentquestionbank extends Component { return ( <div className=" clearfix mt5 Contentquestionbankstyle"> - <div className="educontent mt10 w100s"> + <div className="educontent w100s"> <div className="sortinxdirection w100s" > <div className="sortinxdirection w50s"> <Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()}></Checkbox> diff --git a/public/react/src/modules/question/component/Headplugselections.js b/public/react/src/modules/question/component/Headplugselections.js index 4aa8b6e25..6d7a97a75 100644 --- a/public/react/src/modules/question/component/Headplugselections.js +++ b/public/react/src/modules/question/component/Headplugselections.js @@ -73,68 +73,32 @@ class Headplugselections extends Component { } - settitlesttings=(name,id)=>{ - //课程选项 + shixunsearchall=(id)=>{ this.setState({ - titlesttings:name, - titlesttingsid:id, - titlesttingss:null, - }) - this.props.setsub_discipline_id(id); - } - - settitlesttingss=(name,id)=>{ - //知识点 - if(this.state.titlesttings===null){ - this.props.showNotification('请先选择课程'); - return - - } - this.setState({ - titlesttingss:name, - titlesttingssid:id + shixunsearchAllvalue:id, + shixunchildValues:"" }) - this.props.settag_discipline_id(id); - - - } - - - shixunsearchall=(e)=>{ - let{shixunsearchAllvalue}=this.state; - let id = "a"; + try { + this.props.setdiscipline_id(null); + }catch (e) { - if(shixunsearchAllvalue===id){ - return } - this.setState({ - shixunsearchAllvalue:"a", - shixunchildValues:"" - }) - // this.props.allUpdatashixunlist(); } - //查询 - shixunsearchAll = (e) => { - let{shixunsearchAllvalue}=this.state; - let id = e.target.value; - if(shixunsearchAllvalue===id){ - return - } - if(id===0){ - id=" " - this.setState({ - InputValue: " " - }) - // this.props.OnSearchInput(""); - } - let list=[{'tag_level':1},{'tag_id':id}]; + //获取方向 + shixunsearchAll = (id) => { + console.log("获取方向"); + console.log(id); if(id!=undefined){ this.setState({ shixunsearchAllvalue:id, - shixunchildValues:"" }) - // this.props.Updatasearchlist(list); + try { + this.props.setdiscipline_id(id); + }catch (e) { + + } + } } @@ -153,6 +117,29 @@ class Headplugselections extends Component { tixing: value, }) + try { + this.props.setitem_types(value); + }catch (e) { + + } + + } + + getshixunchildValue = (id,ids) => { + console.log("getshixunchildValue"); + console.log(id); + debugger + if(id!=undefined ||ids!=undefined){ + this.setState({ + shixunsearchAllvalue:ids + }) + + try { + this.props.setsub_discipline_id(id); + }catch (e) { + + } + } } render() { let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state; @@ -160,20 +147,11 @@ class Headplugselections extends Component { let overlaymenu=(item,id)=>( <Menu> { - item.map((list,k)=>{ + item&&item.map((list,k)=>{ return( <Menu.Item > <div className="mt5 subshaicontent-part" key={k}> - <a style={{ height: '20px' }} className={ "mb15 shixun_repertoire color-dark intermediatecenterysls textcen "} name={list.id} id={id} onClick={this.getshixunchildValue}>{list.name}</a> - {/*<div className="sub-Item clearfix">*/} - {/* {*/} - {/* list.tag_disciplines.map((tag,e)=>{*/} - {/* return(*/} - {/* <a className={parseInt(shixunchildValues)===tag.id?"shixun_repertoire active":"shixun_repertoire"} key={e} id={tag.id} name={id} rel="subshaicontent" onClick={this.getshixunchildValues}>{tag.name}</a>*/} - {/* )*/} - {/* })*/} - {/* }*/} - {/*</div>*/} + <a style={{ height: '20px' }} className={ "mb15 shixun_repertoire color-dark intermediatecenterysls textcen "} name={list.id} id={list.id} onClick={()=>this.getshixunchildValue(list.id,id)}>{list.name}</a> </div> </Menu.Item> ) @@ -195,7 +173,7 @@ class Headplugselections extends Component { <div className="clearfix mb10 shaiContent"> <span className=" fl mt3">方向:</span> <div className="fl pr shaiAllItem "> - <li className={shixunsearchAllvalue==="a"?"shaiItem shixun_repertoire active ":"shaiItem shixun_repertoire "} value= "a" onClick={this.shixunsearchall}>全部</li> + <li className={shixunsearchAllvalue==="a"?"shaiItem shixun_repertoire active ":"shaiItem shixun_repertoire "} value= "a" onClick={()=>this.shixunsearchall("a")}>全部</li> <style> { ` @@ -241,10 +219,10 @@ class Headplugselections extends Component { { - disciplinesdata.map((item,key)=>{ + disciplinesdata&&disciplinesdata.map((item,key)=>{ return( <Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}> - <li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={this.shixunsearchAll}> + <li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunsearchAll(item.id)}> {item.name} </li> </Dropdown> @@ -257,7 +235,8 @@ class Headplugselections extends Component { </div> {/*题型*/} - <div className="clearfix mb10"> + + <div className="clearfix"> <span className=" fl mt6">题型:</span> { <style> @@ -281,18 +260,16 @@ class Headplugselections extends Component { } <div className="fl pr shaiAllItem mt1"> <li className={this.state.tixing===null?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing(null)}>全部</li> - <li className={this.state.tixing===1?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing(1)}>简单</li> - <li className={this.state.tixing===2?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing(2)}>适中</li> - <li className={this.state.tixing===3?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing(3)}>困难</li> + <li className={this.state.tixing==="PROGRAM"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("PROGRAM")}>编程题</li> + <li className={this.state.tixing==="SINGLE"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("SINGLE")}>单选题</li> + <li className={this.state.tixing==="MULTIPLE"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("MULTIPLE")}>多选题</li> + <li className={this.state.tixing==="JUDGMENT"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("JUDGMENT")}>判断题</li> </div> </div> - {/*题型结尾*/} - - {/*难度*/} - <div className="clearfix"> + <div className="clearfix mb10"> <span className=" fl mt6">难度:</span> { <style> @@ -316,18 +293,14 @@ class Headplugselections extends Component { } <div className="fl pr shaiAllItem mt1"> <li className={this.state.diff===null?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(null)}>全部</li> - <li className={this.state.diff==="PROGRAM"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search("PROGRAM")}>编程题</li> - <li className={this.state.diff==="SINGLE"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search("SINGLE")}>单选题</li> - <li className={this.state.diff==="MULTIPLE"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search("MULTIPLE")}>多选题</li> - <li className={this.state.diff==="JUDGMENT"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search("JUDGMENT")}>判断题</li> + <li className={this.state.diff===1?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(1)}>简单</li> + <li className={this.state.diff===2?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(2)}>适中</li> + <li className={this.state.diff===3?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(3)}>困难</li> </div> </div> {/*难度结尾*/} - - - </div> </div> </div> diff --git a/public/react/src/modules/testpaper/Testpaperlibrary.js b/public/react/src/modules/testpaper/Testpaperlibrary.js index 0ae4f8d5f..f82dc33ff 100644 --- a/public/react/src/modules/testpaper/Testpaperlibrary.js +++ b/public/react/src/modules/testpaper/Testpaperlibrary.js @@ -15,7 +15,7 @@ import NoneData from './component/NoneData'; import './testioncss/testioncss.css'; import Contentpart from "./component/Contentpart"; import SiderBar from "../tpm/SiderBar"; -import Headplugselection from "../question/component/Headplugselection"; +import Headplugselections from "../question/component/Headplugselections"; import QuestionModal from "./component/QuestionModal"; import QuestionModals from "./component/QuestionModals"; class Testpaperlibrary extends Component { @@ -189,14 +189,15 @@ class Testpaperlibrary extends Component { this.setState({ discipline_id:discipline_id, sub_discipline_id:null, - tag_discipline_id:null + tag_discipline_id:null, + keywords:null, }) var data = { discipline_id:discipline_id, sub_discipline_id:null, tag_discipline_id:null, public: this.state.defaultActiveKey, - difficulty: null, + difficulty: this.props.difficulty, keywords: null, page: 1, per_page:10, @@ -207,14 +208,15 @@ class Testpaperlibrary extends Component { setsub_discipline_id=(sub_discipline_id)=>{ this.setState({ sub_discipline_id:sub_discipline_id, - tag_discipline_id:null + tag_discipline_id:null, + keywords:null, }) var data = { discipline_id:this.state.discipline_id, sub_discipline_id:sub_discipline_id, tag_discipline_id:null, public: this.state.defaultActiveKey, - difficulty: null, + difficulty: this.state.difficulty, keywords: null, page:1, per_page:10, @@ -224,14 +226,15 @@ class Testpaperlibrary extends Component { settag_discipline_id=(tag_discipline_id)=>{ this.setState({ - tag_discipline_id:tag_discipline_id + tag_discipline_id:tag_discipline_id, + keywords:null, }) var data = { discipline_id:this.state.discipline_id, sub_discipline_id:this.state.sub_discipline_id, tag_discipline_id:tag_discipline_id, public: this.state.defaultActiveKey, - difficulty: null, + difficulty: this.state.difficulty, keywords: null, page: 1, per_page:10, @@ -374,6 +377,32 @@ class Testpaperlibrary extends Component { } + + + setitem_types = (item_type) => { + this.setState({ + item_type: item_type, + visiblemyss: false, + }) + + var data = { + discipline_id:this.state.discipline_id, + sub_discipline_id:this.state.sub_discipline_id, + tag_discipline_id:this.state.tag_discipline_id, + public: this.state.defaultActiveKey, + difficulty: this.state.difficulty, + item_type: item_type, + keywords: this.state.keywords, + page: this.state.page, + per_page:10, + }; + + this.getdata(data); + } + + + + render() { let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state; return ( @@ -397,12 +426,14 @@ class Testpaperlibrary extends Component { showDrawer={() => this.showDrawer()} Headertop={Headertop}/> {/*顶部*/} - <Headplugselection {...this.props} {...this.state} - + <Headplugselections {...this.props} {...this.state} + disciplinesdata={this.state.disciplinesdata} setdiscipline_id={(e)=>this.setdiscipline_id(e)} setsub_discipline_id={(e)=>this.setsub_discipline_id(e)} settag_discipline_id={(e)=>this.settag_discipline_id(e)} - ></Headplugselection> + setitem_types={(e) => this.setitem_types(e)} + setdifficulty={(e) => this.setdifficulty(e)} + ></Headplugselections> {/*头部*/} <Contentpart {...this.props} diff --git a/public/react/src/modules/testpaper/component/Contentpart.js b/public/react/src/modules/testpaper/component/Contentpart.js index dd831f673..2ff4b92a5 100644 --- a/public/react/src/modules/testpaper/component/Contentpart.js +++ b/public/react/src/modules/testpaper/component/Contentpart.js @@ -65,6 +65,9 @@ class Contentpart extends Component { <style> { ` + .contentparttit .ant-tabs-bar{ + margin: 0px 0px 0px 0px !important; + } .contentparttit .ant-tabs-nav .ant-tabs-tab{ margin: 10px 10px 10px 0 !important; } @@ -121,21 +124,13 @@ class Contentpart extends Component { enterButton size="large" onInput={(e)=>this.props.setdatafunsval(e)} - onSearch={ (value)=>this.props.setdatafuns(value)} /> - - <Popover placement="bottom" trigger="hover" content={contents} > - <div className=" sortinxdirection mr10"> - <div className="subjecttitys"> - 难度 - </div> - <i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i> - </div> - </Popover> - + onSearch={ (value)=>this.props.setdatafuns(value)} + value={this.props.keywords} + /> <div className="xaxisreverseorder" style={{ - width:"388px" + width:"50%" }}> <a href={'/question/newitem'}>