yslnewtiku
parent
ca4256661d
commit
b24024171d
@ -0,0 +1,100 @@
|
|||||||
|
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,
|
||||||
|
Breadcrumb
|
||||||
|
} from "antd";
|
||||||
|
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
|
||||||
|
import Itembankstop from "./component/Itembankstop";
|
||||||
|
import NoneData from './component/NoneData';
|
||||||
|
import './questioncss/questioncom.css';
|
||||||
|
class Questionitem_banks extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//初始化
|
||||||
|
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
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let {page,limit,count,Headertop,visible,placement,modalsType}=this.state;
|
||||||
|
return (
|
||||||
|
<div className="newMain clearfix educontent w1200mss">
|
||||||
|
<div className="w100s mt30">
|
||||||
|
<Breadcrumb separator=">">
|
||||||
|
<Breadcrumb.Item>试题库</Breadcrumb.Item>
|
||||||
|
<Breadcrumb.Item href="">新增试题</Breadcrumb.Item>
|
||||||
|
</Breadcrumb>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Itembankstop>
|
||||||
|
|
||||||
|
</Itembankstop>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
export default SnackbarHOC() (TPMIndexHOC ( Questionitem_banks ));
|
@ -0,0 +1,50 @@
|
|||||||
|
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,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
Select,
|
||||||
|
Cascader,
|
||||||
|
Col, Row, InputNumber, DatePicker, AutoComplete,Button,Tag
|
||||||
|
} from "antd";
|
||||||
|
import './../questioncss/questioncom.css';
|
||||||
|
class Choicequestion extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
page:1,
|
||||||
|
Knowpoints:[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//初始化
|
||||||
|
componentDidMount(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let {page}=this.state;
|
||||||
|
const { getFieldDecorator } = this.props.form;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19" >
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
const Choicequestions = Form.create({ name: 'Choicequestions' })(Choicequestion);
|
||||||
|
export default Choicequestions;
|
@ -0,0 +1,349 @@
|
|||||||
|
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,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
Select,
|
||||||
|
Cascader,
|
||||||
|
Col, Row, InputNumber, DatePicker, AutoComplete,Button,Tag
|
||||||
|
} from "antd";
|
||||||
|
import './../questioncss/questioncom.css';
|
||||||
|
const InputGroup = Input.Group;
|
||||||
|
const { Option } = Select;
|
||||||
|
const options = [
|
||||||
|
{
|
||||||
|
value: 'zhejiang',
|
||||||
|
label: 'Zhejiang',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: 'hangzhou',
|
||||||
|
label: 'Hangzhou',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: 'xihu',
|
||||||
|
label: 'West Lake',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'jiangsu',
|
||||||
|
label: 'Jiangsu',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: 'nanjing',
|
||||||
|
label: 'Nanjing',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
value: 'zhonghuamen',
|
||||||
|
label: 'Zhong Hua Men',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
class Itembankstop extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
page:1,
|
||||||
|
Knowpoints:[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//初始化
|
||||||
|
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}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSubmit=(e)=>{
|
||||||
|
e.preventDefault();
|
||||||
|
this.props.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
console.log("获取的form 数据");
|
||||||
|
console.log(values);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleFormLayoutChange=(value)=>{
|
||||||
|
//难度塞选
|
||||||
|
console.log("难度塞选");
|
||||||
|
console.log(value);
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
rbnd:value,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
handleFormkechen=(value)=>{
|
||||||
|
//课程
|
||||||
|
console.log("课程");
|
||||||
|
console.log(value);
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
rbkc:value,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
handleFormzhishidian=(value)=>{
|
||||||
|
//知识点
|
||||||
|
console.log("知识点");
|
||||||
|
console.log(value);
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
rbzsd:value,
|
||||||
|
});
|
||||||
|
this.setState({
|
||||||
|
Knowpoints:value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
handleFormtixing=(value)=>{
|
||||||
|
//题型
|
||||||
|
console.log("题型");
|
||||||
|
console.log(value);
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
rbtx:value,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
preventDefault=(e)=> {
|
||||||
|
e.preventDefault();
|
||||||
|
console.log('Clicked! But prevent default.');
|
||||||
|
}
|
||||||
|
deletesobject=(item,index)=>{
|
||||||
|
var tmp = JSON.parse(JSON.stringify(this.state.Knowpoints));
|
||||||
|
for(var i=0;i<tmp.length;i++){
|
||||||
|
if(i>=index){
|
||||||
|
var pos = this.state.Knowpoints.indexOf(tmp[i]);
|
||||||
|
this.state.Knowpoints.splice(pos, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.props.form.setFieldsValue({
|
||||||
|
rbzsd:this.state.Knowpoints,
|
||||||
|
});
|
||||||
|
this.setState({
|
||||||
|
Knowpoints:this.state.Knowpoints,
|
||||||
|
})
|
||||||
|
|
||||||
|
// console.log("deletesobject");
|
||||||
|
// console.log(item);
|
||||||
|
// console.log(index);
|
||||||
|
// console.log(this.state.Knowpoints);
|
||||||
|
// console.log("tmp");
|
||||||
|
// console.log(tmp);
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
let {page}=this.state;
|
||||||
|
const { getFieldDecorator } = this.props.form;
|
||||||
|
|
||||||
|
return (
|
||||||
|
|
||||||
|
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19" >
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.ant-form-item{
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.ant-form-explain{
|
||||||
|
padding-left:0px !important;
|
||||||
|
margin-top: 3px !important;
|
||||||
|
}
|
||||||
|
.ant-select-selection{
|
||||||
|
height: 33px !important;
|
||||||
|
}
|
||||||
|
.ant-input-group{
|
||||||
|
width:258px !important;
|
||||||
|
}
|
||||||
|
.ant-input {
|
||||||
|
height: 33px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div className="h12"></div>
|
||||||
|
<Form onSubmit={this.handleSubmit}>
|
||||||
|
<Form.Item
|
||||||
|
label="课程"
|
||||||
|
>
|
||||||
|
{getFieldDecorator("rbkc",
|
||||||
|
{
|
||||||
|
rules: [{ required: true, message: '请选择课程' }],
|
||||||
|
}
|
||||||
|
)(
|
||||||
|
|
||||||
|
<InputGroup compact >
|
||||||
|
<Select style={{ width: '258px' }} onChange={this.handleFormkechen} placeholder="请选择...">
|
||||||
|
<Option value="Home">Home</Option>
|
||||||
|
<Option value="Company">Company</Option>
|
||||||
|
</Select>
|
||||||
|
</InputGroup>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label="知识点"
|
||||||
|
>
|
||||||
|
{getFieldDecorator("rbzsd",
|
||||||
|
{
|
||||||
|
rules: [{ required: true, message: '请选择知识点' }],
|
||||||
|
}
|
||||||
|
)(
|
||||||
|
<div className="sortinxdirection">
|
||||||
|
<InputGroup compact >
|
||||||
|
<Cascader style={{ width: '258px' }} defaultValue={this.state.Knowpoints} options={options} onChange={this.handleFormzhishidian} placeholder="请选择..." />
|
||||||
|
</InputGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="sortinxdirection" style={{
|
||||||
|
height: "33px",
|
||||||
|
lineHeight: "28px",
|
||||||
|
|
||||||
|
}}>
|
||||||
|
|
||||||
|
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
|
||||||
|
return (
|
||||||
|
<div className="mytags" style={{
|
||||||
|
position: "relative",
|
||||||
|
}}>
|
||||||
|
<p className="w100s stestcen lh32">{object}</p>
|
||||||
|
<i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss" onClick={()=>this.deletesobject(object,index)}></i>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
label="题型"
|
||||||
|
>
|
||||||
|
{getFieldDecorator("rbtx",
|
||||||
|
{
|
||||||
|
rules: [{ required: true, message: '请选择题型'}],
|
||||||
|
}
|
||||||
|
)(
|
||||||
|
<InputGroup compact>
|
||||||
|
<Select style={{ width: '258px' }} onChange={this.handleFormtixing} placeholder="请选择...">
|
||||||
|
<Option value="Home">Home</Option>
|
||||||
|
<Option value="Company">Company</Option>
|
||||||
|
</Select>
|
||||||
|
</InputGroup>
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.ant-radio-button-wrapper{
|
||||||
|
width:106px !important;
|
||||||
|
height:33px !important;
|
||||||
|
background:#EEEEEE;
|
||||||
|
border-radius:17px !important;
|
||||||
|
color:#333333;
|
||||||
|
text-align: center !important;
|
||||||
|
border:0px !important;
|
||||||
|
margin-right: 27px !important;
|
||||||
|
margin-top: 6px !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.ant-radio-button-wrapper-checked {
|
||||||
|
width: 106px !important;
|
||||||
|
height: 33px !important;
|
||||||
|
background: #4CACFF !important;
|
||||||
|
border-radius: 17px !important;
|
||||||
|
text-align: center !important;
|
||||||
|
border:0px !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
margin-right: 27px !important;
|
||||||
|
margin-top: 6px!important;
|
||||||
|
|
||||||
|
}
|
||||||
|
.ant-radio-button-wrapper:not(:first-child)::before{
|
||||||
|
border:0px !important;
|
||||||
|
width:0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-radio-button-wrapper{
|
||||||
|
border:0px !important;
|
||||||
|
}
|
||||||
|
.ant-radio-group{
|
||||||
|
border:0px !important;
|
||||||
|
}
|
||||||
|
.ant-radio-group label{
|
||||||
|
border:0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-radio-group span{
|
||||||
|
border:0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<Form.Item label="难度">
|
||||||
|
{getFieldDecorator('rbnd',
|
||||||
|
{
|
||||||
|
rules: [{ required: true, message: '请选择难度'}],
|
||||||
|
}
|
||||||
|
)(
|
||||||
|
|
||||||
|
<Radio.Group onChange={this.handleFormLayoutChange} >
|
||||||
|
<Radio.Button value="0">简单</Radio.Button>
|
||||||
|
<Radio.Button value="1">适中</Radio.Button>
|
||||||
|
<Radio.Button value="2">困难</Radio.Button>
|
||||||
|
</Radio.Group>,
|
||||||
|
)}
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item>
|
||||||
|
<Button type="primary" htmlType="submit" className="login-form-button">
|
||||||
|
提交
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
const Itembankstops = Form.create({ name: 'Itembankstops' })(Itembankstop);
|
||||||
|
export default Itembankstops;
|
Loading…
Reference in new issue