|
|
@ -1,5 +1,5 @@
|
|
|
|
import React, {Component} from "React";
|
|
|
|
import React, {Component} from "React";
|
|
|
|
import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon} from "antd";
|
|
|
|
import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon,AutoComplete} from "antd";
|
|
|
|
import ApplyForAddOrgModal from '../../user/modal/ApplyForAddOrgModal';
|
|
|
|
import ApplyForAddOrgModal from '../../user/modal/ApplyForAddOrgModal';
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
import "../css/Courses.css";
|
|
|
|
import "../css/Courses.css";
|
|
|
@ -47,8 +47,8 @@ class CoursesNew extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
let user_school=this.props.current_user&&this.props.current_user.user_school;
|
|
|
|
let user_school=this.props.current_user&&this.props.current_user.user_school;
|
|
|
|
this.getschool("")
|
|
|
|
// this.getschool("")
|
|
|
|
this.Searchvalue("")
|
|
|
|
// this.Searchvalue("")
|
|
|
|
if (coursesId != undefined) {
|
|
|
|
if (coursesId != undefined) {
|
|
|
|
let url = "/courses/" + coursesId + "/settings.json"
|
|
|
|
let url = "/courses/" + coursesId + "/settings.json"
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
axios.get(url).then((result) => {
|
|
|
@ -286,7 +286,7 @@ class CoursesNew extends Component {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
searchlist: result.data.course_lists,
|
|
|
|
searchlist: result.data.course_lists,
|
|
|
|
// course:value,
|
|
|
|
// course:value,
|
|
|
|
fetching: false
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// this.props.form.setFieldsValue({
|
|
|
|
// this.props.form.setFieldsValue({
|
|
|
@ -298,10 +298,11 @@ class CoursesNew extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
handleSearch=(value)=>{
|
|
|
|
handleSearch=(value)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(value!=""){
|
|
|
|
if(value!=""){
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
classroom:value,
|
|
|
|
classroom:value,
|
|
|
|
// course:value
|
|
|
|
course:value
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.Searchvalue(value)
|
|
|
|
this.Searchvalue(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -311,7 +312,7 @@ class CoursesNew extends Component {
|
|
|
|
handleChange=(value)=>{
|
|
|
|
handleChange=(value)=>{
|
|
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
// course:value,
|
|
|
|
course:value,
|
|
|
|
classroom:value
|
|
|
|
classroom:value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -319,21 +320,26 @@ class CoursesNew extends Component {
|
|
|
|
handleSearchschool=(value)=>{
|
|
|
|
handleSearchschool=(value)=>{
|
|
|
|
|
|
|
|
|
|
|
|
if(value!="") {
|
|
|
|
if(value!="") {
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
// this.props.form.setFieldsValue({
|
|
|
|
// school: value,
|
|
|
|
// // school: value,
|
|
|
|
fetching: true,
|
|
|
|
// fetching: true,
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
fetching: true
|
|
|
|
|
|
|
|
})
|
|
|
|
this.getschool(value)
|
|
|
|
this.getschool(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
handleChangeschools=(value)=>{
|
|
|
|
handleChangeschools=(value)=>{
|
|
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
// this.props.form.setFieldsValue({
|
|
|
|
// school: value,
|
|
|
|
// // school: value,
|
|
|
|
fetching: true,
|
|
|
|
// fetching: true,
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// fetching: true
|
|
|
|
|
|
|
|
// })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleChangeschool=(value)=>{
|
|
|
|
handleChangeschool=(value)=>{
|
|
|
@ -359,7 +365,7 @@ class CoursesNew extends Component {
|
|
|
|
if (result.data.status===0) {
|
|
|
|
if (result.data.status===0) {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
searchlistscholl: result.data.school_names,
|
|
|
|
searchlistscholl: result.data.school_names,
|
|
|
|
// school: value
|
|
|
|
fetching: false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -420,8 +426,7 @@ class CoursesNew extends Component {
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<Form onSubmit={this.handleSubmit}
|
|
|
|
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses"}>
|
|
|
|
className={"edu-back-white newcourses"}>
|
|
|
|
|
|
|
|
{/*内容*/}
|
|
|
|
{/*内容*/}
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
{`
|
|
|
|
{`
|
|
|
@ -435,15 +440,16 @@ class CoursesNew extends Component {
|
|
|
|
width: 280px !important;
|
|
|
|
width: 280px !important;
|
|
|
|
height: 160px;
|
|
|
|
height: 160px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.construction{
|
|
|
|
.construction .ant-input{
|
|
|
|
width: 280px !important;
|
|
|
|
width: 280px !important;
|
|
|
|
|
|
|
|
margin-left: 0px !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.construction {
|
|
|
|
|
|
|
|
width: 280px;
|
|
|
|
margin-left: 10px;
|
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
{/*<div className="stud-class-set bor-bottom-greyE padding10200">*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*</div>*/}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="stud-class-set bor-bottom-greyE padding10200 ">
|
|
|
|
<div className="stud-class-set bor-bottom-greyE padding10200 ">
|
|
|
|
<div className={"TabsWarpcourse"}>
|
|
|
|
<div className={"TabsWarpcourse"}>
|
|
|
@ -451,18 +457,15 @@ class CoursesNew extends Component {
|
|
|
|
{getFieldDecorator('course', {
|
|
|
|
{getFieldDecorator('course', {
|
|
|
|
rules: [{required: true, message: "不能为空"}],
|
|
|
|
rules: [{required: true, message: "不能为空"}],
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<Select
|
|
|
|
|
|
|
|
showSearch
|
|
|
|
<AutoComplete style={{ width: 280 }}
|
|
|
|
|
|
|
|
onSearch={this.handleSearch}
|
|
|
|
|
|
|
|
// onChange={this.handleChange}
|
|
|
|
className={"fl construction "}
|
|
|
|
className={"fl construction "}
|
|
|
|
placeholder="例如:数据结构"
|
|
|
|
placeholder="例如:数据结构"
|
|
|
|
// value={this.state.course}
|
|
|
|
|
|
|
|
onSearch={this.handleSearch}
|
|
|
|
|
|
|
|
onChange={this.handleChange}
|
|
|
|
|
|
|
|
onFocus={()=>this.Searchvalue("")}
|
|
|
|
|
|
|
|
allowClear={true}
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{options}
|
|
|
|
{options}
|
|
|
|
</Select>
|
|
|
|
</AutoComplete>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<span className={"newcoursestitle fl"}>
|
|
|
|
<span className={"newcoursestitle fl"}>
|
|
|
|
{/*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*/}
|
|
|
|
{/*(错误示例:数据结构2017本部;数据结构2017秋季;数据结构2017电子商务1班)*/}
|
|
|
@ -632,18 +635,14 @@ class CoursesNew extends Component {
|
|
|
|
{getFieldDecorator('school', {
|
|
|
|
{getFieldDecorator('school', {
|
|
|
|
rules: [{required: true, message: "不能为空"}],
|
|
|
|
rules: [{required: true, message: "不能为空"}],
|
|
|
|
})(
|
|
|
|
})(
|
|
|
|
<Select
|
|
|
|
<AutoComplete style={{ width: 280 }}
|
|
|
|
showSearch
|
|
|
|
onSearch={this.handleSearchschool}
|
|
|
|
|
|
|
|
// onChange={this.handleChangeschools}
|
|
|
|
className={"fl construction mr10 "}
|
|
|
|
className={"fl construction mr10 "}
|
|
|
|
placeholder="请输入并选择课本堂的所属单位"
|
|
|
|
placeholder="请输入并选择课本堂的所属单位"
|
|
|
|
// value={this.state.school}
|
|
|
|
|
|
|
|
onSearch={this.handleSearchschool}
|
|
|
|
|
|
|
|
// notFoundContent={this.state.fetching ? <Spin size="small" /> : null}
|
|
|
|
|
|
|
|
onChange={this.handleChangeschools}
|
|
|
|
|
|
|
|
allowClear={true}
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{optionschool}
|
|
|
|
{optionschool}
|
|
|
|
</Select>
|
|
|
|
</AutoComplete>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
<span className={"newcoursestitle fl"}>
|
|
|
|
<span className={"newcoursestitle fl"}>
|
|
|
|
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
|
|
|
|
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
|
|
|
@ -651,7 +650,7 @@ class CoursesNew extends Component {
|
|
|
|
<div id='isschool'></div>
|
|
|
|
<div id='isschool'></div>
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
|
|
{searchlistscholl.length===0?<div style={{height:"20px",lineHeight:"20px"}} className="ml20">
|
|
|
|
{searchlistscholl.length===0&&this.state.fetching===true?<div style={{height:"20px",lineHeight:"20px"}} className="ml20">
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
<span style={{color: '#CDCDCD'}}>未找到包含“{school}”的高校,</span>
|
|
|
|
<span style={{color: '#CDCDCD'}}>未找到包含“{school}”的高校,</span>
|
|
|
|
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
|
|
|
|
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
|
|
|
|