|
|
|
@ -54,12 +54,7 @@ class Goldsubject extends Component {
|
|
|
|
|
addonAfteronelenone:"",
|
|
|
|
|
addonAfteronelentwo:"",
|
|
|
|
|
Whethertocreateanewclassroom:true,
|
|
|
|
|
checkbofrup:[
|
|
|
|
|
{module_type:"announcement",module_name:"公告栏"},{module_type:"online_learning",module_name:"在线学习"}
|
|
|
|
|
,{module_type:"shixun_homework",module_name:"实训作业"},{module_type:"common_homework",module_name:"普通作业"}
|
|
|
|
|
,{module_type:"exercise",module_name:"试卷"},{module_type:"poll",module_name:"问卷"}
|
|
|
|
|
,{module_type:"attachment",module_name:"资源"},{module_type:"board",module_name:"讨论"},{module_type:"course_group",module_name:"分班"},],
|
|
|
|
|
|
|
|
|
|
bordebool:false,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// disabledEndDate= endValue => {
|
|
|
|
@ -110,8 +105,8 @@ class Goldsubject extends Component {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
console.log("新建精品课堂的数据");
|
|
|
|
|
console.log(this.props);
|
|
|
|
|
// console.log("新建精品课堂的数据");
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
|
|
|
|
|
let coursesId = this.props.match.params.coursesId;
|
|
|
|
|
let user_school=this.props.current_user&&this.props.current_user.user_school;
|
|
|
|
@ -164,8 +159,8 @@ class Goldsubject extends Component {
|
|
|
|
|
if (response) {
|
|
|
|
|
// this.goback
|
|
|
|
|
if(response.data){
|
|
|
|
|
console.log("获取Goldsubject.js");
|
|
|
|
|
console.log(response.data);
|
|
|
|
|
// console.log("获取Goldsubject.js");
|
|
|
|
|
// console.log(response.data);
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
classroom: response.data.course_name,
|
|
|
|
@ -206,20 +201,20 @@ class Goldsubject extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onChangeTimepublishs = (date, dateString) => {
|
|
|
|
|
console.log("结束时间11111111111");
|
|
|
|
|
console.log(dateString);
|
|
|
|
|
// console.log("结束时间11111111111");
|
|
|
|
|
// console.log(dateString);
|
|
|
|
|
|
|
|
|
|
if(dateString===""){
|
|
|
|
|
this.setState({
|
|
|
|
|
datatime: undefined,
|
|
|
|
|
})
|
|
|
|
|
console.log("结束时间111111111116");
|
|
|
|
|
// console.log("结束时间111111111116");
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
endtime:undefined,
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
console.log("结束时间111111111117");
|
|
|
|
|
// console.log("结束时间111111111117");
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
datatime: dateString,
|
|
|
|
@ -231,10 +226,10 @@ class Goldsubject extends Component {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
onChangeTimepublishstwo = (date, dateString) => {
|
|
|
|
|
console.log("结束时间22222222222");
|
|
|
|
|
console.log(dateString);
|
|
|
|
|
// console.log("结束时间22222222222");
|
|
|
|
|
// console.log(dateString);
|
|
|
|
|
if(dateString===""){
|
|
|
|
|
console.log("结束时间222222222223");
|
|
|
|
|
// console.log("结束时间222222222223");
|
|
|
|
|
this.setState({
|
|
|
|
|
datatimetwo: undefined,
|
|
|
|
|
})
|
|
|
|
@ -242,7 +237,7 @@ class Goldsubject extends Component {
|
|
|
|
|
starttime: undefined,
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
console.log("结束时间222222222224");
|
|
|
|
|
// console.log("结束时间222222222224");
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
datatimetwo: dateString,
|
|
|
|
@ -320,13 +315,23 @@ class Goldsubject extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!err) {
|
|
|
|
|
var classroomysl=values.classroom+"";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if(classroomysl){
|
|
|
|
|
if(classroomysl.length>60){
|
|
|
|
|
classroomysl=classroomysl.substring(0,60);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log('Received values of form: ', values);
|
|
|
|
|
var datasysl={
|
|
|
|
|
// subject_id:128, //这是带过来的值 编辑就不要传值了
|
|
|
|
|
name: values.classroom,
|
|
|
|
|
name: classroomysl,
|
|
|
|
|
class_period: values.period,
|
|
|
|
|
credit: parseFloat(values.credit),
|
|
|
|
|
start_date:moment(values.starttime).format("YYYY-MM-DD"),
|
|
|
|
@ -336,12 +341,12 @@ class Goldsubject extends Component {
|
|
|
|
|
school:values.school
|
|
|
|
|
};
|
|
|
|
|
try {
|
|
|
|
|
console.log("327");
|
|
|
|
|
console.log(datasysl);
|
|
|
|
|
// console.log("327");
|
|
|
|
|
// console.log(datasysl);
|
|
|
|
|
// console.log(JSON.stringify(datasysl));
|
|
|
|
|
console.log("88887777");
|
|
|
|
|
console.log(moment(values.starttime).format("YYYY-MM-DD"));
|
|
|
|
|
console.log(moment(values.endtime).format("YYYY-MM-DD"));
|
|
|
|
|
// console.log("88887777");
|
|
|
|
|
// console.log(moment(values.starttime).format("YYYY-MM-DD"));
|
|
|
|
|
// console.log(moment(values.endtime).format("YYYY-MM-DD"));
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -375,15 +380,15 @@ class Goldsubject extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log("错误信息信息信息1");
|
|
|
|
|
console.log(err);
|
|
|
|
|
console.log(values.starttime);
|
|
|
|
|
console.log(values.endtime);
|
|
|
|
|
// console.log("错误信息信息信息1");
|
|
|
|
|
// console.log(err);
|
|
|
|
|
// console.log(values.starttime);
|
|
|
|
|
// console.log(values.endtime);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
|
|
console.log("错误信息信息信息2");
|
|
|
|
|
// console.log("错误信息信息信息2");
|
|
|
|
|
console.log(err);
|
|
|
|
|
if (err) {
|
|
|
|
|
return;
|
|
|
|
@ -419,11 +424,11 @@ class Goldsubject extends Component {
|
|
|
|
|
school:values.school
|
|
|
|
|
};
|
|
|
|
|
try {
|
|
|
|
|
console.log("提交的ysldatas数据");
|
|
|
|
|
console.log(ysldatas);
|
|
|
|
|
// console.log("提交的ysldatas数据");
|
|
|
|
|
// console.log(ysldatas);
|
|
|
|
|
// console.log(JSON.stringify(ysldatas));
|
|
|
|
|
console.log(moment(values.starttime).format("YYYY-MM-DD"));
|
|
|
|
|
console.log(moment(values.endtime).format("YYYY-MM-DD"));
|
|
|
|
|
// console.log(moment(values.starttime).format("YYYY-MM-DD"));
|
|
|
|
|
// console.log(moment(values.endtime).format("YYYY-MM-DD"));
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -527,12 +532,33 @@ class Goldsubject extends Component {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleChange=(value)=>{
|
|
|
|
|
|
|
|
|
|
handleChange=(e)=>{
|
|
|
|
|
console.log(e);
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
|
// course:value,
|
|
|
|
|
classroom:value
|
|
|
|
|
classroom:e.target.value,
|
|
|
|
|
})
|
|
|
|
|
if(e.target.value){
|
|
|
|
|
if(e.target.value.length>60){
|
|
|
|
|
this.setState({
|
|
|
|
|
bordebool:true,
|
|
|
|
|
})
|
|
|
|
|
}else if(e.target.value.length===0){
|
|
|
|
|
this.setState({
|
|
|
|
|
bordebool:true,
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
bordebool:false,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
bordebool:true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleSearchschool=(value)=>{
|
|
|
|
@ -602,7 +628,7 @@ class Goldsubject extends Component {
|
|
|
|
|
this.applyForAddOrgForm.setVisible(true)
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom,addonAfteronelenone,addonAfteronelentwo} = this.state;
|
|
|
|
|
let {datatime,datatimetwo,school,bordebool,searchlistscholl,Whethertocreateanewclassroom,addonAfteronelenone,addonAfteronelentwo} = this.state;
|
|
|
|
|
const {getFieldDecorator} = this.props.form;
|
|
|
|
|
const propsWithoutForm = Object.assign({}, this.props)
|
|
|
|
|
delete propsWithoutForm.form
|
|
|
|
@ -624,8 +650,12 @@ class Goldsubject extends Component {
|
|
|
|
|
if(addonAftertwo){
|
|
|
|
|
addonAfteronelens=String(addonAftertwo).length;
|
|
|
|
|
}
|
|
|
|
|
console.log(addonAfteronelenone);
|
|
|
|
|
console.log(addonAfteronelentwo);
|
|
|
|
|
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
|
|
|
|
|
var addonAfteronelens3=0;
|
|
|
|
|
if(addonAfterthree){
|
|
|
|
|
addonAfteronelens3=String(addonAfterthree).length;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
|
@ -687,20 +717,16 @@ class Goldsubject extends Component {
|
|
|
|
|
.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;
|
|
|
|
|
margin-left: 11px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
|
|
|
|
@ -753,19 +779,61 @@ class Goldsubject extends Component {
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<div className="stud-class-set bor-bottom-greyE padding1020 ">
|
|
|
|
|
<style>{
|
|
|
|
|
`
|
|
|
|
|
.yslzxueshis .ant-input{
|
|
|
|
|
border-right: none !important;
|
|
|
|
|
height: 40px !important;
|
|
|
|
|
width: 655px !important;
|
|
|
|
|
}
|
|
|
|
|
.yslzxueshisy span .ant-input-group-addon{
|
|
|
|
|
width: 65px !important;
|
|
|
|
|
background-color: #fafafa!important;
|
|
|
|
|
}
|
|
|
|
|
.yslzxueshisy .ant-input-group-addon{
|
|
|
|
|
width: 65px !important;
|
|
|
|
|
background-color: #fafafa!important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.yslzxueshis .ant-select-dropdown{
|
|
|
|
|
width: 655px !important;
|
|
|
|
|
height:160px !important;
|
|
|
|
|
}
|
|
|
|
|
.yslzxueshis .ant-select-dropdown-menu{
|
|
|
|
|
width: 655px !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-select-dropdown{
|
|
|
|
|
width: 655px !important;
|
|
|
|
|
height:160px !important;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}</style>
|
|
|
|
|
<style>
|
|
|
|
|
{bordebool===false?
|
|
|
|
|
`
|
|
|
|
|
.ant-input:hover {
|
|
|
|
|
// border: 1px solid #d9d9d9;
|
|
|
|
|
}
|
|
|
|
|
`:
|
|
|
|
|
`
|
|
|
|
|
.ant-input:hover {
|
|
|
|
|
// border: 1px solid #f5222d;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Form.Item label="课堂名称">
|
|
|
|
|
{getFieldDecorator('classroom', {
|
|
|
|
|
rules: [{required: true, message: "不能为空"}],
|
|
|
|
|
})(
|
|
|
|
|
|
|
|
|
|
<AutoComplete style={{ width: 280 }}
|
|
|
|
|
<AutoComplete
|
|
|
|
|
style={{width: 720}}
|
|
|
|
|
onSearch={this.handleSearch}
|
|
|
|
|
onChange={this.handleChange}
|
|
|
|
|
className={"fl construction "}
|
|
|
|
|
placeholder="例如:数据结构"
|
|
|
|
|
className={"fl construction yslzxueshis "}
|
|
|
|
|
dataSource={options}
|
|
|
|
|
>
|
|
|
|
|
{options}
|
|
|
|
|
<Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
|
|
|
|
|
</AutoComplete>
|
|
|
|
|
)}
|
|
|
|
|
{/*<span className={"newcoursestitle fl"}>*/}
|
|
|
|
@ -863,7 +931,6 @@ class Goldsubject extends Component {
|
|
|
|
|
width={"210px"}
|
|
|
|
|
value={datatimetwo === undefined ? "" :datatimetwo === null ? "" : moment(datatimetwo, dateFormat)}
|
|
|
|
|
disabledTime={disabledDateTime}
|
|
|
|
|
disabledDate={this.isabledStartDate}
|
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
|
onChange={this.onChangeTimepublishstwo}
|
|
|
|
|
/>
|
|
|
|
@ -887,7 +954,6 @@ class Goldsubject extends Component {
|
|
|
|
|
width={"210px"}
|
|
|
|
|
value={datatime === undefined ? "" :datatime === null ? "" : moment(datatime, dateFormat)}
|
|
|
|
|
disabledTime={disabledDateTime}
|
|
|
|
|
disabledDate={this.disabledEndDate}
|
|
|
|
|
dropdownClassName="hideDisable"
|
|
|
|
|
onChange={this.onChangeTimepublishs}
|
|
|
|
|
/>
|
|
|
|
|