yslnewtiku
杨树林 5 years ago
parent 699a3d35be
commit 75408005fb

@ -326,8 +326,8 @@ module.exports = {
comments: false
},
compress: {
drop_debugger: true,
drop_console: true
drop_debugger: false,
drop_console: false
}
}
}),

@ -301,6 +301,11 @@ const Developer = Loadable({
loader: () => import('./modules/developer'),
loading: Loading
})
// 题库
const Headplugselection = Loadable({
loader: () => import('./modules/question/Question'),
loading: Loading
})
// 学院统计
const College = Loadable({
loader: () => import('./college/College'),
@ -736,7 +741,10 @@ class App extends Component {
render={
(props) => (<Developer {...this.props} {...props} {...this.state} />)
}/>
<Route path="/question"
render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
}/>
<Route exact path="/"
// component={ShixunsHome}
render={

@ -52,7 +52,6 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net"
proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -0,0 +1,159 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input
} from "antd";
import Headplugselection from "./component/Headplugselection";
import Contentpart from "./component/Contentpart";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './../courses/coursesPublic/NoneData';
import './questioncss/questioncom.css';
import SiderBar from "../tpm/SiderBar";
class Question extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
limit:20,
count:50,
defaultActiveKey:1,
Headertop:"",
Footerdown:"",
visible: false,
placement: 'right'
}
}
//初始化
componentDidMount(){
let {defaultActiveKey}= this.state;
var data={
public:defaultActiveKey
};
this.getdata(data);
let url=`/users/get_navigation_info.json`;
axios.get(url, {
}).then((response) => {
// console.log("开始请求/get_navigation_info.json");
// console.log(response);
if(response!=undefined){
if(response.status===200){
this.setState({
Headertop:response.data.top,
Footerdown:response.data.down
})
}
}
});
}
callback=(key)=>{
this.setState({
defaultActiveKey:key,
})
}
getdata =(data)=>{
const url=`/item_banks.json`;
axios.get((url),{params:data}).then((response) => {
if(response===null||response===undefined){
return
}
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
}
console.log("item_banks");
console.log(response);
}).catch((error) => {
console.log(error)
});
}
paginationonChange=()=>{
}
showDrawer = () => {
this.setState({
visible: true,
});
};
onClose = () => {
this.setState({
visible: false,
});
};
onChange = e => {
this.setState({
placement: e.target.value,
});
};
render() {
let {page,limit,count,Headertop,visible,placement}=this.state;
return (
<div className="newMain clearfix">
<SiderBar
{...this.props}
{...this.state}
showDrawer={()=>this.showDrawer()}
Headertop={Headertop}/>
{/*顶部*/}
<Headplugselection ></Headplugselection>
{/*头部*/}
<Contentpart {...this.state} {...this.props} callback={(e)=>this.callback(e)}></Contentpart>
{/*分页*/}
{/*<div className="clearfix mt5">*/}
{/*<div className="educontent mt10 pb20 w1200s">*/}
{/* fenye*/}
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={limit}
total={count}></Pagination>
</div>
{/*抽屉效果*/}
<Drawer
placement={placement}
closable={false}
onClose={()=>this.onClose()}
visible={visible}
>
<div>
<Input placeholder="未命名试卷" />
</div>
<div className="sortinxdirection">
<p className="w50s ">单选题</p>
<p className="w50s"><i className="iconfont icon-shanchu1 font-12 lg lh30 icontianjiadaohangcolor "></i></p>
</div>
<div className="intermediatecenter verticallayout mt42">
<div className="drawerbutton">
试卷预览
</div>
</div>
</Drawer>
</div>
)
}
}
export default SnackbarHOC() (TPMIndexHOC ( Question ));

@ -0,0 +1,207 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Tabs,
Input,
Popover
} from "antd";
import './../questioncss/questioncom.css';
import Contentquestionbank from "./Contentquestionbank";
import Listjihe from "./Listjihe";
const { TabPane } = Tabs;
const Search = Input.Search;
class Contentpart extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
}
setdatafuns=(value)=>{
}
setdatafunsval=(e)=>{
}
render() {
let {page}=this.state;
let {defaultActiveKey}=this.props;
const content = (
<div className="questiontypes" style={{
width:'93px',
height:'161px',
}}>
<p className="questiontype ">单选题</p>
<p className="questiontypeheng"></p>
<p className="questiontype ">多选题</p>
<p className="questiontypeheng"></p>
<p className="questiontype ">判断题</p>
<p className="questiontypeheng"></p>
<p className="questiontype ">编程题</p>
<p className="questiontypeheng"></p>
</div>
);
const contents = (
<div className="questiontypes" style={{
width:'93px',
height:'120px',
}}>
<p className="questiontype ">简单</p>
<p className="questiontypeheng"></p>
<p className="questiontype ">适中</p>
<p className="questiontypeheng"></p>
<p className="questiontype ">困难</p>
<p className="questiontypeheng"></p>
</div>
);
const buttonWidth = 70;
return (
<div className=" clearfix mt5">
<div className="educontent mt10 pb20 w1200s">
<div className="w1200ms contentparttit" style={{
position: "relative",
}}>
<style>
{
`
.contentparttit .ant-tabs-nav .ant-tabs-tab{
margin: 10px 10px 10px 0 !important;
}
.contentparttit .ant-tabs-nav .ant-tabs-ink-bar{
width: 31px !important;
left: 14px;
}
`
}
</style>
<Tabs defaultActiveKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
<div className=" mt19" style={{
position:"absolute",
top: "0px",
right:" 0px",
paddingRight: "20px",
}}>
<style>
{
`
.xaxisreverseorder .ant-input-group-addon{
width: 60px !important;
}
.xaxisreverseorder .ant-input-lg {
height: 41px;}
.ant-popover{
top: 348px !important;
}
.ant-popover-inner-content {
padding:0px !important;
}
`
}
</style>
<div className="xaxisreverseorder">
<Popover placement="bottom" content={contents} trigger="click">
<div className=" sortinxdirection mr10">
<div className="subjecttit">
难度
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
<Popover placement="bottom" content={content} trigger="click">
<div className="sortinxdirection mr40">
<div className="subjecttit">
题型
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
<Search
style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} />
</div>
</div>
</div>
{/*内容*/}
<div className=" w100s mb10">
{
defaultActiveKey===1||defaultActiveKey==="1"?
<Contentquestionbank {...this.props} {...this.state} ></Contentquestionbank>
:""
}
{
defaultActiveKey===0||defaultActiveKey==="0"?
<Contentquestionbank {...this.props} {...this.state} ></Contentquestionbank>
:""
}
</div>
{/*列表集合*/}
<div className=" w100s">
<Listjihe>
</Listjihe>
<Listjihe>
</Listjihe>
</div>
</div>
</div>
)
}
}
export default Contentpart

@ -0,0 +1,70 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox
} from "antd";
import './../questioncss/questioncom.css';
class Contentquestionbank extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
console.log("componentDidMount");
console.log(this.state);
console.log(this.props);
// let homeworkid = this.props.match.params.homeworkid;
// let url = "/homework_commons/" + homeworkid + "/end_groups.json";
// axios.get(url).then((response) => {
// if (response.status === 200) {
// this.setState({})
// }
// }).catch((error) => {
// console.log(error)
// });
}
onChange=(e)=> {
console.log(`checked = ${e.target.checked}`);
}
render() {
let {page}=this.state;
return (
<div className=" clearfix mt5 Contentquestionbankstyle">
<div className="educontent mt10 w100s">
<div className="sortinxdirection w100s" >
<div className="sortinxdirection w50s">
<Checkbox onChange={()=>this.onChange()}></Checkbox>
<p className="setequesbank ml20">选用本页全部试题</p>
</div>
<div className="xaxisreverseorder testpaper w50s">
共123个试题
</div>
</div>
</div>
</div>
)
}
}
export default Contentquestionbank ;

@ -0,0 +1,72 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
} from "antd";
import './../questioncss/questioncom.css';
class Headplugselection extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
titlestting:["全部","前端开发","后端开发","移动开发","数据库","云计算和大数据","运维与测试","人工测试","其他"],
}
}
//初始化
componentDidMount(){
}
render() {
let {page,titlestting}=this.state;
return (
<div className=" clearfix">
<div className="educontent mt10 mb20 w1200">
<div className="clearfix edu-back-white h177 mt21 tophom">
{/*课程*/}
<div className="h40 sortinxdirection">
<div className="w70 tophomsembold">
课程
</div>
{this.state.titlestting === undefined ? "" : this.state.titlestting.map((object, index) => {
return (
<div className="ml24">
{object}
</div>
)
})}
</div>
{/*知识点*/}
<div className="mt30">
<div className="w70 tophomsembold">
知识点
</div>
</div>
</div>
</div>
</div>
)
}
}
export default Headplugselection ;

@ -0,0 +1,97 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
} from "antd";
import './../questioncss/questioncom.css';
class Listjihe extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
name:"单选题",
nd:"简单",
chakanjiexibool:false,
}
}
//初始化
componentDidMount(){
}
chakanjiexibool=()=>{
if(this.state.chakanjiexibool===true){
this.setState({
chakanjiexibool:false
})
}else{
this.setState({
chakanjiexibool:true
})
}
}
render() {
let {page,name,nd,chakanjiexibool}=this.state;
return (
<div className={chakanjiexibool===true?"w100s borderwds283 pd20 mb20":"w100s borderwds pd20 mb20"}>
{/*顶部*/}
<div className="w100s sortinxdirection">
<div className="w70s listjihetixingstit">
1___________的意思
</div>
<div className="w30s xaxisreverseorder">
<p className="listjihetixing">难度<span className="listjihetixings">{nd}</span></p>
<p className="mr30 listjihetixing">题型<span className="listjihetixings">{name}</span></p>
</div>
</div>
{/*内容*/}
<div className="w100s sortinxdirection">
<p className="w100s listjihetixingstits">
A网页 B万维网 D超文本传输协议
</p>
</div>
{/*更新时间*/}
<div className="w100s sortinxdirection mt22">
<div className="w50s listjihetixingstit sortinxdirection">
<p className="updatetimes lh30">更新时间2019-12-09</p>
<p className="updatetimes lh30">创建者王老师</p>
</div>
<div className="w50s xaxisreverseorder">
<p className="selection ml30 xiaoshou">
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span></p>
<p className="viewparsings xiaoshou" onClick={()=>this.chakanjiexibool()}>
查看解析</p>
</div>
</div>
{
chakanjiexibool===true?<div>
<div className="w100s questiontypeheng mt23">
</div>
<p className="analysis mt22">解析</p>
<p className="mt25 testfondex">
万维网WWW是World Wide Web的简称也称为Web3W等WWW是基于客户机/服务器方式的信息发现技术和超文本技术的综合WWW服务器通过超文本标记语言(HTML)把信息组织成为图文并茂的超文本利用链接从一个站点跳到另个站点这样一来彻底摆脱了以前查询工具只能按特定路径一步步地查找信息的限制
</p>
</div>:""
}
</div>
)
}
}
export default Listjihe;

@ -0,0 +1,324 @@
.w1200{
width:1062px;
height:177px;
background:rgba(255,255,255,1);
box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03);
border-radius:2px;
}
.w1200ms{
width:1062px;
}
.w1200s{
width:1062px;
background:rgba(255,255,255,1);
box-shadow:0px 6px 8px 0px rgba(0,0,0,0.03);
border-radius:2px;
}
.h177{
height: 177px;
}
/* 中间居中 */
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/* 简单居中 */
.intermediatecenterysls{
display: flex;
align-items: center;
}
.spacearound{
display: flex;
justify-content: space-around;
}
.spacebetween{
display: flex;
justify-content: space-between;
}
/* 头顶部居中 */
.topcenter{
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
/* x轴正方向排序 */
/* 一 二 三 四 五 六 七 八 */
.sortinxdirection{
display: flex;
flex-direction:row;
}
/* x轴反方向排序 */
/* 八 七 六 五 四 三 二 一 */
.xaxisreverseorder{
display: flex;
flex-direction:row-reverse;
}
/* 垂直布局 正方向*/
/*
*/
.verticallayout{
display: flex;
flex-direction:column;
}
/* 垂直布局 反方向*/
.reversedirection{
display: flex;
flex-direction:column-reverse;
}
.w100{
width: 100px;
}
.mt21{
margin-top: 21px;
}
.mt23{
margin-top: 23px;
}
.mt19{
margin-top: 19px;
}
.mt15{
margin-top: 10px;
}
.h40{
height: 40px;
}
.tophom{
padding-top: 33px;
padding-bottom: 40px;
padding-left: 26px;
padding-right: 26px;
}
.borderwd{
border: 1px solid #000000;
}
.borderwds{
width: 1020px !important;
background: #FFFFFF;
border: 1px solid #DDDDDD;
margin-left: 20px;
height: 150px;
}
.borderwds283{
width: 1020px !important;
height: 283px;
background:#F9F9F9;
border:1px solid #DDDDDD;
margin-left: 20px;
}
.w64{
width: 64px;
}
.w70{
width: 70px;
}
.tophomsembold{
height:21px;
font-size:16px;
color:#333333;
line-height:21px;
}
/*Contentpart*/
.contentparttit{
padding-top: 10px;
padding-left: 20px;
padding-right: 20px;
}
.subjecttit{
width:28px;
height:19px;
font-size:14px;
color:rgba(51,51,51,1);
line-height: 42px;
cursor:pointer;
}
.ml55{
margin-right: 55px;
}
.lg{
line-height: 42px;
}
.ml7{
margin-left: 7px;
}
.icondowncolor{
color:#9E9E9E;
}
.questiontype{
width: 100%;
font-size: 12px;
color: #333333;
line-height: 17px;
text-align: center;
padding: 11px;
cursor:pointer;
}
.questiontypes{
width:37px;
height:17px;
font-size:12px;
color:rgba(51,51,51,1);
line-height:17px;
cursor:pointer;
}
.questiontypeheng{
width:100%;
height:1px;
background: #EEEEEE;
}
.questiontype:hover{
color: #4CACFF;
}
.questiontype:active{
color: #4CACFF;
}
.w100s{
width:100%;
}
.w70s{
width:70%;
}
.w30s{
width:70%;
}
.w50s{
width: 50%;
}
.testpaper{
font-size:12px;
color:#888888;
line-height:28px;
text-align: center;
}
.setequesbank{
font-size:14px;
color:#333333;
line-height:28px;
}
.Contentquestionbankstyle{
padding-left: 20px;
padding-right: 20px;
}
.pd20{
padding-top: 20px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 30px;
}
/*listjihe*/
.listjihetixing{
color: #888888;
font-size: 12px;
line-height: 17px;
}
.listjihetixings{
color: #333333;
font-size: 12px;
line-height: 17px;
}
.listjihetixingstit{
color: #333333;
font-size: 14px;
line-height: 17px;
}
.listjihetixingstits{
color: #333333;
font-size: 14px;
line-height:19px;
margin-top: 19px;
}
.updatetimes{
color: #BBBBBB;
font-size: 12px;
}
.mt22{
margin-top: 22px;
}
.viewparsings{
color:#4CACFF;
font-size:12px;
line-height: 30px;
}
.selection{
width:88px;
height:30px;
background:#33BD8C;
border-radius:4px;
text-align: center;
line-height: 30px;
color: #FFFFFF;
}
.lh30{
line-height: 30px;
}
.analysis{
height:19px;
font-size:14px;
color:#333333;
line-height:19px;
}
.testfondex{
color: #808080;
font-size: 14px;
}
.pb20{
padding-bottom: 20px;
}
.icontianjiadaohangcolor{
color: #FFFFFF;
}
.xiaoshou{
cursor:pointer
}
.mt40{
margin-top: 40px;
}
.mt42{
margin-top: 42px;
}
.drawerbutton{
width:88px;
height:30px;
background:#4CACFF;
border-radius:4px;
font-size:14px;
color:#ffffff;
line-height:30px;
text-align: center;
}

@ -942,9 +942,9 @@ submittojoinclass=(value)=>{
)
})
}
{/*<li className={`${activePaths === true ? 'pr active' : 'pr'}`}>*/}
{/* <Link to={this.props.Headertop===undefined?"":'/paths'}>实践课程</Link>*/}
{/*</li>*/}
<li className={`pr`}>
<Link to={'/question'}>题库</Link>
</li>
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
{/*<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>*/}

@ -89,10 +89,13 @@ class SiderBar extends Component {
render() {
// console.log(this.props)
// console.log("SiderBar");
// console.log(this.props);
var mypath= this.props&&this.props.match&&this.props.match.path;
return (
<div className="-task-sidebar" >
<div className={mypath&&mypath==="/question"?"-task-sidebar myrigthsiderbar":"-task-sidebar"} >
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div>
<Tooltip placement="right" title={"返回顶部"}>
@ -103,6 +106,20 @@ class SiderBar extends Component {
</div>
</Tooltip>
{
mypath&&mypath==="/question"?
<Tooltip placement="right" title={"试题库"}>
<div className="feedback">
<a target="_blank" className="color_white" onClick={()=>this.props.showDrawer()}>
<i className="iconfont icon-yijianfankui color-white font-22"></i>
</a>
</div>
</Tooltip>
:""
}
<Tooltip placement="right" title={"意见反馈"}>
<div className="feedback">
<a target="_blank" className="color_white" href="/help/feedback">

@ -229,4 +229,8 @@ body>.-task-title {
}
.wechatcenter{
text-align: center;
}
}
.myrigthsiderbar{
right: 250px !important;
}

@ -675,6 +675,10 @@ export function TPMIndexHOC(WrappedComponent) {
};
// console.log("this.props.mygetHelmetapi");
// console.log(this.props.mygetHelmetapi);
// console.log("WrappedComponent");
// console.log(this.props);
// console.log(this.props.match.path);
var mypath= this.props&&this.props.match&&this.props.match.path;
return (
<div className="indexHOC">
{isRender===true ? <LoginDialog
@ -696,10 +700,17 @@ export function TPMIndexHOC(WrappedComponent) {
{...this.state}
{...this.dialogObj}
/>:""}
<SiderBar
{...this.props}
{...this.state}
Headertop={Headertop}/>
{
mypath&&mypath==="/question"?
""
:
<SiderBar
{...this.props}
{...this.state}
Headertop={Headertop}/>
}
{/* 注释掉了1440 影响到了手机屏幕的展示 */}
<style>{
`

Loading…
Cancel
Save