dev_oauth
杨树林 6 years ago
parent 45103884d4
commit 980aee35fd

@ -72,7 +72,11 @@ const WrappedCoursesNewApp= Loadable({
loader: () => import('./new/CoursesNew'), loader: () => import('./new/CoursesNew'),
loading: Loading, loading: Loading,
}) })
//新建金品课堂
const WrappedCoursesNewAppGoldclass= Loadable({
loader: () => import('./new/Goldsubject'),
loading: Loading,
})
const ShixunHomeworkPage =Loadable({ const ShixunHomeworkPage =Loadable({
loader: () => import('./shixunHomework/ShixunHomeworkPage'), loader: () => import('./shixunHomework/ShixunHomeworkPage'),
loading: Loading, loading: Loading,
@ -821,6 +825,12 @@ class CoursesIndex extends Component{
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*新建金品课堂*/}
<Route path="/courses/newgold"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
}
></Route>
{/*修改课堂*/} {/*修改课堂*/}
<Route path="/courses/:coursesId/settings" <Route path="/courses/:coursesId/settings"
render={ render={

@ -32,7 +32,11 @@ const TeacherList= Loadable({
const StudentsList= Loadable({ const StudentsList= Loadable({
loader: () => import('./members/studentsList'), loader: () => import('./members/studentsList'),
loading: Loading, loading: Loading,
}) });
const Eduinforms= Loadable({
loader: () => import('./gradinforms/Eduinforms.js'),
loading: Loading,
});
// //
const Exercise= Loadable({ const Exercise= Loadable({
loader: () => import('./exercise/Exercise'), loader: () => import('./exercise/Exercise'),
@ -239,6 +243,13 @@ class ListPageIndex extends Component{
} }
></Route> ></Route>
{/*公告栏列表*/}
<Route path="/courses/:id/informs"
render={
(props) => (<Eduinforms {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 实训作业页面*/} {/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id" <Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={ render={

@ -721,6 +721,7 @@ class Coursesleftnav extends Component{
maincontent=(item,key)=>{ maincontent=(item,key)=>{
return ( <div className={"sandianbox"}> return ( <div className={"sandianbox"}>
{/*公告栏*/}
{/*作业*/} {/*作业*/}
{item.type==="shixun_homework"?<div onClick={e=>this.Navmodalnames(e,1,"shixun_homework",item.id)}>添加目录</div>:""} {item.type==="shixun_homework"?<div onClick={e=>this.Navmodalnames(e,1,"shixun_homework",item.id)}>添加目录</div>:""}
{/*资源*/} {/*资源*/}
@ -774,8 +775,12 @@ class Coursesleftnav extends Component{
// // console.log(item.category_url) // // console.log(item.category_url)
// console.log(this.props.location.pathname) // console.log(this.props.location.pathname)
console.log("778");
console.log("CoursesLeftNav");
console.log(this.props);
console.log(course_modules);
return( return(
<ul className="mb10 newedu-class-leftnav"> <ul className="mb10 newedu-class-leftnav">
@ -853,6 +858,8 @@ class Coursesleftnav extends Component{
<li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}> <li title={item.name.length<7?"":item.name} onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={this.props.mainurl===item.category_url&&key===this.props.indexs?"liactive":"clearfix active"} onMouseLeave={(e)=>this.hidesandian(e,key)} onMouseEnter={(e)=>this.showsandian(e,key)}>
<a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> <a onClick={(e)=>this.showsandians(e,key,item.category_url,1)} className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{ {
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>: item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="common_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-putongzuoye mr10 fl":"iconfont icon-putongzuoye mr10 fl"}></i>: item.type==="common_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-putongzuoye mr10 fl":"iconfont icon-putongzuoye mr10 fl"}></i>:
item.type==="group_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenzuzuoye mr10 fl":"iconfont icon-fenzuzuoye mr10 fl"}></i>: item.type==="group_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenzuzuoye mr10 fl":"iconfont icon-fenzuzuoye mr10 fl"}></i>:
@ -967,6 +974,8 @@ class Coursesleftnav extends Component{
> >
<a className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}> <a className={ item.second_category===undefined?"fl ml20 pd0":item.second_category.length===0?"fl ml20 pd0":this.state.sandiantypes===key?"fl ml20 pd0 ebebeb":"fl ml20 pd0"}>
{ {
item.type==="announcement"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="online_learning"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>: item.type==="shixun_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-daima mr10 fl":"iconfont icon-daima mr10 fl"}></i>:
item.type==="common_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-putongzuoye mr10 fl":"iconfont icon-putongzuoye mr10 fl"}></i>: item.type==="common_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-putongzuoye mr10 fl":"iconfont icon-putongzuoye mr10 fl"}></i>:
item.type==="group_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenzuzuoye mr10 fl":"iconfont icon-fenzuzuoye mr10 fl"}></i>: item.type==="group_homework"?<i className={this.props.location.pathname===item.category_url?"color-blue iconfont icon-fenzuzuoye mr10 fl":"iconfont icon-fenzuzuoye mr10 fl"}></i>:

@ -0,0 +1,174 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import '../css/members.css';
import '../css/busyWork.css'
const Search = Input.Search;
class Eduinforms extends Component{
constructor(props){
super(props);
this.state={
}
}
componentDidMount() {
on('updateNavSuccess', this.updateNavSuccess)
}
componentDidUpdate = (prevProps) => {
}
render(){
return(
<React.Fragment >
<div>
<div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}>
<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>
<li className="fr">
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
<WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn>
{/*<WordsBtn style="blue" onClick={()=>this.editname(datas&&datas.main_category_name)} className={"mr30"}>目录重命名</WordsBtn>*/}
</span>:
<WordsBtn style="blue" onClick={()=>this.editDir(datas&&datas.category_name)} className={"mr30 font-16"}>目录重命名</WordsBtn>:""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?<WordsBtn style="blue" className="mr30 font-16" onClick={this.createCommonpath}>选用实践课程</WordsBtn>:"":""}
{this.props.isAdmin()===true?<a className={"btn colorblue font-16"} onClick={()=>this.createCommonWork()}>选用实训</a>:""}
</li>
</p>
</p>
<div className="clearfix pl30 pr30">
<p style={{marginTop:'10px'}}>
<div style={{"display":"inline-block", "marginTop": "22px"}}>
<span> {datas&&datas.all_count}个实训作业</span>
<span style={{"marginLeft":"16px"}}>已发布{datas&&datas.published_count}</span>
<span style={{"marginLeft":"16px"}}>未发布 {datas&&datas.unpublished_count}</span>
</div>
</p>
<div className="fl mt6 task_menu_ul">
<Menu mode="horizontal" defaultSelectedKeys="null" onClick={this.handleClick}>
<Menu.Item key="null">全部</Menu.Item>
{this.props.isAdmin()?<Menu.Item key="0">未发布</Menu.Item>:""}
<Menu.Item key="1">提交中</Menu.Item>
<Menu.Item key="2">补交中</Menu.Item>
<Menu.Item key="5">评阅中</Menu.Item>
</Menu>
</div>
<div className="fr mt16 mb16 searchView">
<Search
value={Coursename}
placeholder="请输入名称进行搜索"
onInput={this.SearchCoursenames}
onSearch={value => this.SearchCoursename(value)}
></Search>
</div>
</div>
</div>
<Spin size="large" spinning={this.state.isSpin}>
{this.props.isAdmin()===true?<div className="mt20 edu-back-white padding20-30">
<div className="clearfix">
<Checkbox className="fl" style={{marginTop:'0px'}}checked={checkedtype} onClick={this.funselect}>已选 {checkBoxValues&&checkBoxValues.length} </Checkbox>
<div className="studentList_operation_ul">
<li className="li_line"><a className="color-grey-9" onClick={this.onDelete}>删除</a></li>
<li className="li_line"><a className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>
{/*onClick={this.homeworkstart}*/}
<li className="li_line"><a className="color-grey-9" onClick={this.homeworkends}>立即截止</a></li>
<li className="li_line" style={{display:datas===undefined?"none":datas.course_public===true?"block":"none"}}>
<a className="color-grey-9" onClick={this.onOpen}>设为公开</a>
</li>
<li className="li_line drop_down" onMouseEnter={this.updadatalist}>
{/*onClick={()=>this.selectBlank(4)}*/}
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
{ course_modules&&course_modules.homework_category.length > 10 && <p className="drop_down_search">
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
</p> }
{course_modules&&course_modules.main_category.map((item,key)=>{
return(
datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)}>{item.main_category_name}</li>
)
})}
{ course_modules&&course_modules.homework_category.filter((item,key)=> {
return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => {
if(datas&&datas.category_id!=null&&datas&&datas.category_id===item.category_id===false){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>
}
if(datas&&datas.category_id===null){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>
}
})}
<style>
{`
.courseSecond{
margin-left: 10px;
padding: 10px;
}
`}
</style>
{course_modules&&course_modules.homework_category.length===0&&datas&&datas.category_id===null?
<div className={"courseSecond"}>暂无数据</div>:""}
{/*{course_modules&&course_modules.homework_category.map((item,key)=>{*/}
{/*return(*/}
{/*<li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )}>{item.category_name}</li>*/}
{/*)*/}
{/*})}*/}
{this.props.isAdmin()?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<p className="drop_down_btn">
<a className="color-grey-6" onClick={()=>this.addDir()}>添加目录...</a>
</p>
:"":""}
</ul>
</li>
</div>
</div>
</div>:""}
<style>{`
.padding02010{
padding: 10px 30px 0px 30px;
cursor: pointer;
}
.ant-checkbox-group > div .boardsList {
border-top: 1px solid transparent;
padding: 10px 0px 20px!important;
}
.padding02010:hover{
box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1;
border-radius: 2px;
}
`}</style>
</Spin>
</div>
</React.Fragment>
)
}
}
export default Eduinforms;

@ -0,0 +1,814 @@
import React, {Component} from "React";
import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon,AutoComplete,InputNumber} from "antd";
import ApplyForAddOrgModal from '../../user/modal/ApplyForAddOrgModal';
import axios from 'axios';
import "../css/Courses.css";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
import Modals from '../../modals/Modals';
const { Option } = Select;
const dateFormat = 'YYYY-MM-DD';
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
function disabledDateTime() {
return {
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
};
}
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
class Goldsubject extends Component {
constructor(props) {
super(props)
this.state = {
coursedata: undefined,
searchlist: [],
searchlistscholl:[],
listvalue: undefined,
fetching:false,
subject_id:"",
start_date:"",
}
}
componentDidMount() {
let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school;
// this.getschool("")
// this.Searchvalue("")
if (coursesId != undefined) {
let url = "/courses/" + coursesId + "/settings.json"
axios.get(url).then((result) => {
let data = result.data;
this.props.form.setFieldsValue({
course: data.course_list_name,
classroom: data.name,
period: data.class_period,
credit: data.credit,
checkboxgroup: data.course_module_types,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
endtime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat),
school:data.school
});
this.setState({
datatime: data.end_date,
datatimetwo: data.end_date,
is_public: 1,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
})
this.handleSearchschool(data.school);
}).catch((error) => {
console.log(error);
})
}else{
let url = "/courses/new.json"
axios.get(url).then((result) => {
console.log(result)
}).catch((error) => {
console.log(error);
})
// console.log(user_school);
this.props.form.setFieldsValue({
school:user_school,
});
this.setState({
school:user_school,
});
this.handleSearchschool(user_school);
}
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user){
let user_school=this.props.current_user&&this.props.current_user.user_school;
this.props.form.setFieldsValue({
school:user_school,
});
this.setState({
school:user_school,
});
this.handleSearchschool(user_school);
}
}
onChangeTimepublishs = (date, dateString) => {
if(dateString===""){
this.setState({
datatime: undefined,
})
}else{
this.setState({
datatime: dateString,
})
}
};
onChangeTimepublishstwo = (date, dateString) => {
if(dateString===""){
this.setState({
datatimetwo: undefined,
})
}else{
this.setState({
datatimetwo: dateString,
})
}
};
cancelmodel = () => {
this.setState({
Modalstype: false,
Loadtype: false,
Modalstopval: "",
ModalCancel: "",
ModalSave: "",
})
}
scrollToAnchor = (anchorName) => {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
window.scrollTo(0, anchorElement.offsetTop - window.innerHeight / 2);
}
}
//提交数据的地方
handleSubmit = (e) => {
e.preventDefault();
let first_category_url=this.props.current_user.first_category_url;
let coursesId = this.props.match.params.coursesId;
let {is_public,datatime,datatimetwo} = this.state
// console.log(is_public)
if (coursesId != undefined) {
// 编辑
this.props.form.validateFields((err, values) => {
// if(values.course===""||values.course===undefined){
// this.scrollToAnchor("iscourse")
// return
//
// }
if(values.classroom===""||values.classroom===undefined){
this.scrollToAnchor("isclassroom")
return
}
if(values.school===""||values.school===undefined){
// this.scrollToAnchor("isschool")
return
}
if(values.checkboxgroup.length===0){
this.setState({
Modalstype:true,
Modalstopval:"请您至少添加一个课堂模块,",
ModalsBottomval:"否则您将无法新建课堂。",
Loadtype:true,
ModalSave:()=>this.cancelmodel(),
})
return
}
if (!err) {
// console.log('Received values of form: ', values);
let url = "/courses/" + coursesId + ".json";
axios.put(url, {
// subject_id:128, //这是带过来的值 编辑就不要传值了
name: values.classroom,
class_period: values.period,
credit: parseFloat(values.credit),
start_date:datatimetwo===undefined?"":datatimetwo,
end_date: datatime===undefined?"":datatime,
is_public: 1, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
}
).then((response) => {
// debugger
if (response.data.status === 0) {
// this.goback()
window.location.href=first_category_url;
var yslGuideone = window.localStorage.getItem('yslGuideone');
try {
if(yslGuideone=== null){
window.localStorage.setItem('yslGuideone', "true");
return
}
if(yslGuideone=== undefined){
window.localStorage.setItem('yslGuideone', "true");
return
}
}catch (e) {
}
}
}).catch((error) => {
console.log(error)
})
}
});
} else {
this.props.form.validateFields((err, values) => {
// if(values.course===""||values.course===undefined){
// this.scrollToAnchor("iscourse")
// return
// }
if(values.classroom===""||values.classroom===undefined){
this.scrollToAnchor("isclassroom")
return
}
if(values.school===""||values.school===undefined){
// this.scrollToAnchor("isschool")
return
}
if (!err) {
// debugger
//新建
// console.log('Received values of form: ', values);
let url = "/courses.json";
axios.post(url, {
subject_id:128, //这是带过来的值
name: values.classroom,
class_period: values.period,
credit: parseFloat(values.credit),
start_date:datatimetwo===undefined?"":datatimetwo,
end_date: datatime===undefined?"":datatime,
is_public: 1, //这是也是带过来的值
course_module_types: values.checkboxgroup,
school:values.school
}
).then((response) => {
if (response.status === 200) {
// this.goback
window.location.href=response.data.first_category_url;
var yslGuideone = window.localStorage.getItem('yslGuideone');
try {
if(yslGuideone=== null){
window.localStorage.setItem('yslGuideone', "true");
return
}
if(yslGuideone=== undefined){
window.localStorage.setItem('yslGuideone', "true");
return
}
}catch (e) {
}
}
}).catch((error) => {
console.log(error)
})
}
});
}
}
goback = () => {
// if(this.props.match.params.coursesId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
// window.history.go(-1)
this.props.history.goBack()
}
onCheckAllChange = (e) => {
// console.log(e.target.checked)
this.setState({
is_public: e.target.checked == true ? 1 : 0,
});
}
onchanges =(e)=>{
this.setState({
Realnamecertification:e.target.checked,
})
// console.log(e.target.checked);
}
onchangess=(e)=>{
this.setState({
Professionalcertification:e.target.checked,
})
// console.log(e.target.checked);
}
Searchvalue=(value)=>{
let url="/courses/search_course_list.json";
axios.post(url,{
search:value
}).then((result)=>{
// console.log(result.data)
if (result.data.message===undefined) {
this.setState({
searchlist: result.data.course_lists,
// course:value,
})
}
// this.props.form.setFieldsValue({
// course:value
// })
}).catch((error)=>{
console.log(error)
})
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
this.Searchvalue(value)
}
};
handleChange=(value)=>{
this.props.form.setFieldsValue({
// course:value,
classroom:value
})
};
handleSearchschool=(value)=>{
if(value!="") {
// this.props.form.setFieldsValue({
// // school: value,
// fetching: true,
// });
this.setState({
fetching: true,
school: value
})
this.getschool(value)
}
};
handleChangeschools=(value)=>{
// this.props.form.setFieldsValue({
// // school: value,
// fetching: true,
// });
// this.setState({
// fetching: true
// })
}
handleChangeschool=(value)=>{
this.setState({
school:value
});
this.props.form.setFieldsValue({
school:value,
})
};
getschool=(value)=>{
// this.props.form.setFieldsValue({
// school: value
// })
let url="/schools/school_list.json";
axios.get(url,{
params: {
search: value
}
}).then((result)=>{
if (result.data.status===0) {
this.setState({
searchlistscholl: result.data.school_names,
})
if(result.data.school_names.length!=0){
this.setState({
fetching: false
})
}
}
}).catch((error)=>{
console.log(error)
})
}
showApplyForAddOrgModal = () => {
this.applyForAddOrgForm.setVisible(true)
}
render() {
let {datatime,datatimetwo,school,searchlistscholl} = this.state;
const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
const options = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
const optionschool = this.state.searchlistscholl===undefined?"":this.state.searchlistscholl===null?"":this.state.searchlistscholl==="[]"?"":this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school)
// form合并了
console.log("获取到的数据");
console.log(this.state);
console.log(this.props);
console.log(this.props.current_user);
return (
<React.Fragment>
<div>
<style>
{
`
.color-green-light {
color: #45E660!important;
}
`
}
</style>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
{...propsWithoutForm}></ApplyForAddOrgModal>
{/*提示*/}
<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{width: '100%', height: '70px'}}>
<p className="ml15 fl color-black mt30 summaryname">{this.props.match.params.coursesId === undefined ? "新建课堂" : "编辑课堂"}</p>
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
<style>
{`
.ant-col-12{
width:800px;
}
`}
</style>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses"}>
{/*内容*/}
<style>
{`
.ant-select-dropdown{
// top: 221px !important;
// left: 115px !important;
width: 280px !important;
height: 160px;
}
.ant-select-dropdown-menu{
width: 280px !important;
height: 160px;
}
.construction .ant-input{
width: 280px !important;
margin-left: 0px !important;
}
.construction {
width: 280px;
margin-left: 10px;
}
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
line-height: 28px;
z-index: 2000;
}
`}
</style>
{/*<div className="stud-class-set bor-bottom-greyE padding10200 ">*/}
{/* <div className={"TabsWarpcourse"}>*/}
{/* <Form.Item label="课程名称">*/}
{/* {getFieldDecorator('course', {*/}
{/* rules: [{required: true, message: "不能为空"}],*/}
{/* })(*/}
{/* <AutoComplete style={{ width: 280 }}*/}
{/* onSearch={this.handleSearch}*/}
{/* onChange={this.handleChange}*/}
{/* className={"fl construction "}*/}
{/* placeholder="例如:数据结构"*/}
{/* >*/}
{/* {options}*/}
{/* </AutoComplete>*/}
{/* )}*/}
{/* <span className={"newcoursestitle fl"}>*/}
{/* /!*错误示例数据结构2017本部数据结构2017秋季数据结构2017电子商务1班*!/*/}
{/* <p className="ant-progress-text">*/}
{/* <Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>*/}
{/* <span className={"color-grey-9 font-12 ml5"}>正确示例:数据结构</span>*/}
{/* </p>*/}
{/* <p className="ant-progress-text">*/}
{/* <Icon style={{ color: 'red' }} theme="filled" type="close-circle"/>*/}
{/* <span className={"color-grey-9 font-12 ml5"}>错误示例数据结构2019春</span>*/}
{/* </p>*/}
{/* </span>*/}
{/* <div id='iscourse'></div>*/}
{/* </Form.Item>*/}
{/* </div>*/}
{/*</div>*/}
<style>
{
`
.ml19{
margin-left:19px;
} }
`
}
</style>
<div className="stud-class-set bor-bottom-greyE padding1020 ">
<Form.Item label="课堂名称">
{getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete style={{ width: 280 }}
onSearch={this.handleSearch}
onChange={this.handleChange}
className={"fl construction "}
placeholder="例如:数据结构"
>
{options}
</AutoComplete>
)}
<span className={"newcoursestitle fl"}>
{/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/}
<p className="ant-progress-text">
<Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>
<span className={"color-grey-9 font-12 ml5"}>正确示例数据结构2019春季班级</span>
</p>
<p className="ant-progress-text">
<Icon style={{ color: 'red' }} theme="filled" type="close-circle"/>
<span className={"color-grey-9 font-12 ml5"}>错误示例2019春季班级数据结构</span>
</p>
</span>
<div id='isclassroom'></div>
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE padding1020 coursenavbox coursenavboxtow yslinputcourput">
<style>
{`
.ant-form-item{
margin-bottom: 10px !important;
}
`}
</style>
<Form.Item
label="总学时"
hasFeedback
>
{getFieldDecorator("period",
{
rules:[{
required:false,
pattern: new RegExp(/^[0-9]\d*$/, "g"),
message: ''
}],
getValueFromEvent: (event) => {
return event.target.value.replace(/\D/g,'')
}}
)(
<Input id="period" className="greyInput " placeholder="例如30"/>
)}
</Form.Item>
<Form.Item
label="学分"
hasFeedback
>
{getFieldDecorator("credit",
{
rules:[{
required:false,
pattern: new RegExp(/^[0-9]\d*$/, "g"),
message: ''
}],
getValueFromEvent: (event) => {
return event.target.value.replace(/\D/g,'')
}}
)(
<Input id="credit" className={"greyInput "} placeholder="例如3"/>
)}
</Form.Item>
<Form.Item
label="开始时间"
hasFeedback
>
{getFieldDecorator("starttime")(
<span className="fl mt5">
<DatePicker
showToday={false}
placeholder="请选择开始时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatimetwo === undefined ? "" :datatimetwo === null ? "" : moment(datatimetwo, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishstwo}
/>
</span>
)}
</Form.Item>
<Form.Item
label="结束时间"
hasFeedback
>
{getFieldDecorator("endtime")(
<span className="fl mt5">
<DatePicker
showToday={false}
placeholder="请选择结束时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatime === undefined ? "" :datatime === null ? "" : moment(datatime, dateFormat)}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishs}
/>
</span>
)}
</Form.Item>
</div>
<div className="stud-class-set bor-bottom-greyE padding10200 coursenavbox">
<Form.Item
label="课堂模块"
hasFeedback
>
{getFieldDecorator("checkboxgroup", {
initialValue: [
"announcement","online_learning","shixun_homework", "exercise",
],
})(
<Checkbox.Group style={{width: "800px", marginTop: "10px"}}>
<Checkbox value={"announcement"} className="fl">公告栏</Checkbox>
<Checkbox value={"online_learning"} className="fl">在线学习</Checkbox>
<Checkbox value={"shixun_homework"} className="fl">实训作业</Checkbox>
<Checkbox value={"common_homework"} className="fl">普通作业</Checkbox>
<Checkbox value={"exercise"} className="fl">试卷</Checkbox>
<Checkbox value={"poll"} className="fl">问卷</Checkbox>
<Checkbox value={"attachment"} className="fl">资源</Checkbox>
<Checkbox value={"board"} className="fl">讨论</Checkbox>
<Checkbox value={"course_group"} className="fl">分班</Checkbox>
</Checkbox.Group>
)}
</Form.Item>
</div>
{/*<div className="stud-class-set bor-bottom-greyE padding10200 coursenavbox height100px" >*/}
{/* <span className={"fl"}>*/}
{/* <Form.Item*/}
{/* label="加入课堂条件"*/}
{/* style={{margin: 0}}*/}
{/* >*/}
{/* {getFieldDecorator("Realnamecertification")(*/}
{/* <Checkbox checked={this.state.Realnamecertification} onChange={this.onchanges}>已实名认证</Checkbox>*/}
{/* // <Checkbox.Group style={{ width: "800px",marginTop: "10px"}}>*/}
{/* // <Checkbox value={"authentication"} className="fl">已实名认证</Checkbox>*/}
{/* // <Checkbox value={"professional_certification"} className="fl">已职业认证 <span className="ml30" > (勾选,则通过邀请码加入课堂的用户,需要完成相关认证才能加入课堂)</span></Checkbox>*/}
{/* // </Checkbox.Group>*/}
{/* )}*/}
{/* </Form.Item>*/}
{/* </span>*/}
{/* <span className={"fl mt40"}>*/}
{/* <Form.Item*/}
{/* label=""*/}
{/* >*/}
{/* {getFieldDecorator("Professionalcertification")(*/}
{/* <Checkbox checked={this.state.Professionalcertification} onChange={this.onchangess}>已职业认证<span*/}
{/* className="coursesselects"> (勾选,则通过邀请码加入课堂的用户,需要完成相关认证才能加入课堂)</span></Checkbox>*/}
{/* )}*/}
{/* </Form.Item>*/}
{/* </span>*/}
{/*</div>*/}
{/*<div className="stud-class-set padding10200 coursenavbox bor-bottom-greyE">*/}
{/* <Form.Item*/}
{/* label="公开设置"*/}
{/* hasFeedback*/}
{/* >*/}
{/* {getFieldDecorator("publicclass")(*/}
{/* <Checkbox id="publicclass"*/}
{/* onChange={this.onCheckAllChange}*/}
{/* checked={this.state.is_public}*/}
{/* className="fl">公开课堂</Checkbox>*/}
{/* )}*/}
{/* <span className={"coursesselect"}>(选中后本课堂对所有用户可见,否则仅本课堂成员可见)</span>*/}
{/* </Form.Item>*/}
{/*</div>*/}
<div className="stud-class-set padding10200 mb20">
<Form.Item label="课堂所属单位">
{getFieldDecorator('school', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools}
className={"fl construction mr10 "}
placeholder="请输入并选择课本堂的所属单位"
>
{optionschool}
</AutoComplete>
)}
<span className={"newcoursestitle fl"}>
{/*(输入内容出现匹配的下拉菜单←同账号管理的单位信息填写)*/}
</span>
<div id='isschool'></div>
</Form.Item>
{searchlistscholl.length===0&&this.state.fetching===true?<div style={{height:"20px",lineHeight:"20px"}} className="ml20">
<span>
<span style={{color: '#CDCDCD'}}>未找到包含{school}的高校</span>
<span style={{color: '#4CACFF', cursor: 'pointer'}} onClick={this.showApplyForAddOrgModal}>申请新增</span>
</span>
</div>:""}
</div>
<div className={"FAFAFA"}>
<Form.Item >
<div className="clearfix mt40 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20">
提交
</Button>
{/*<a className="defalutSubmitbtn fl mr20">提交</a>*/}
<a className="defalutCancelbtn fl" onClick={this.goback}>取消</a>
</div>
</Form.Item>
</div>
</Form>
</div>
</div>
</div>
</React.Fragment>
)
}
}
const WrappedCoursesNewAppGoldclass = Form.create({name: 'goldsubject'})(Goldsubject);
export default WrappedCoursesNewAppGoldclass;
Loading…
Cancel
Save