dev_aliyun_beta
杨树林 6 years ago
parent c6627385da
commit 4691df45f8

@ -1063,6 +1063,12 @@ samp {
color: #989898; color: #989898;
margin-left: 40px; margin-left: 40px;
} }
.newcoursestitleysl{
font-size: 12px;
color: #989898;
margin-left: 51px;
}
.coursenavbox .ant-form-item-label{ .coursenavbox .ant-form-item-label{
margin-left:10px; margin-left:10px;

@ -59,7 +59,7 @@ class Bullsubdirectory extends Component{
} }
}; };
changeTopicName = (e) => { changeTopicName = (e) => {
console.log("调用了changeTopicName"); // console.log("调用了changeTopicName");
let num = e.target.value.length; let num = e.target.value.length;
if(num>60){ if(num>60){

@ -107,7 +107,7 @@ class Eduinforms extends Component{
} }
}; };
changeTopicName = (e) => { changeTopicName = (e) => {
console.log("调用了changeTopicName"); // console.log("调用了changeTopicName");
let num = e.target.value.length; let num = e.target.value.length;
if(num>60){ if(num>60){
return; return;

@ -47,9 +47,7 @@ class CoursesNew extends Component {
checkboxgroup:undefined, checkboxgroup:undefined,
addonAfteronelenone:0, addonAfteronelenone:0,
addonAfteronelentwo:0, addonAfteronelentwo:0,
checkbofrup:[{module_type:"shixun_homework",module_name:"实训作业"},{module_type:"common_homework",module_name:"普通作业"},{module_type:"group_homework",module_name:"分组作业"} bordebool:false,
,{module_type:"exercise",module_name:"试卷"},{module_type:"poll",module_name:"问卷"},{module_type:"graduation",module_name:"毕业设计"}
,{module_type:"board",module_name:"讨论"},{module_type:"attachment",module_name:"资源"},{module_type:"course_group",module_name:"分班"}],
} }
} }
componentDidMount() { componentDidMount() {
@ -382,8 +380,8 @@ class CoursesNew extends Component {
}) })
} }
handleSearch=(value)=>{ handleSearch=(value)=>{
console.log("handleSearchhandleSearch");
console.log(value);
if(value!=""){ if(value!=""){
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
classroom:value, classroom:value,
@ -393,13 +391,40 @@ class CoursesNew extends Component {
} }
}; };
handleSearchsysl=(value)=>{
if(value){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
}
}
handleChange=(value)=>{ handleChange=(e)=>{
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
// course:value, // 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)=>{ handleSearchschool=(value)=>{
@ -469,7 +494,7 @@ class CoursesNew extends Component {
this.applyForAddOrgForm.setVisible(true) this.applyForAddOrgForm.setVisible(true)
} }
render() { render() {
let {datatime,school,searchlistscholl} = this.state; let {datatime,school,searchlistscholl,bordebool} = this.state;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props) const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form delete propsWithoutForm.form
@ -491,6 +516,16 @@ class CoursesNew extends Component {
if(addonAftertwo){ if(addonAftertwo){
addonAfteronelens=String(addonAftertwo).length; addonAfteronelens=String(addonAftertwo).length;
} }
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('course');
var addonAfteronelens3=0;
if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length;
}
var addonAfterfour=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens4=0;
if(addonAfterfour){
addonAfteronelens4=String(addonAfterfour).length;
}
return ( return (
<React.Fragment> <React.Fragment>
@ -545,27 +580,23 @@ class CoursesNew extends Component {
`} `}
</style> </style>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses"}> <Form onSubmit={this.handleSubmit} className="edu-back-white newcourses">
{/*内容*/} {/*内容*/}
<style> <style>
{` {`
.ant-select-dropdown{ .ant-select-dropdown{
// top: 221px !important; // top: 221px !important;
// left: 115px !important; // left: 115px !important;
width: 280px !important;
height: 160px; height: 160px;
} }
.ant-select-dropdown-menu{ .ant-select-dropdown-menu{
width: 280px !important;
height: 160px; height: 160px;
} }
.construction .ant-input{ .construction .ant-input{
width: 280px !important;
margin-left: 0px !important; margin-left: 0px !important;
} }
.construction { .construction {
width: 280px; margin-left: 11px;
margin-left: 10px;
} }
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder { .construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
@ -577,22 +608,55 @@ class CoursesNew extends Component {
<div className="stud-class-set bor-bottom-greyE padding10200 "> <div className="stud-class-set bor-bottom-greyE padding10200 ">
<div className={"TabsWarpcourse"}> <div className={"TabsWarpcourse"}>
<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;
}
.yslzxueshisy .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>
<Form.Item label="课程名称"> <Form.Item label="课程名称">
{getFieldDecorator('course', { {getFieldDecorator('course', {
rules: [{required: true, message: "不能为空"}], rules: [{required: true, message: "不能为空"}],
})( })(
<AutoComplete style={{ width: 280 }} <AutoComplete
style={{ width: 720}}
onSearch={this.handleSearch} onSearch={this.handleSearch}
onChange={this.handleChange} onSelect={this.handleSearchsysl}
className={"fl construction "} className="fl construction yslzxueshis "
placeholder="例如:数据结构"
dataSource={options} dataSource={options}
> >
<Input className="yslzxueshisy " placeholder="例如:数据结构" onChange={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete> </AutoComplete>
)} )}
<span className={"newcoursestitle fl"}> <span className="newcoursestitle fl">
{/*错误示例数据结构2017本部数据结构2017秋季数据结构2017电子商务1班*/} {/*错误示例数据结构2017本部数据结构2017秋季数据结构2017电子商务1班*/}
<p className="ant-progress-text"> <p className="ant-progress-text">
<Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/> <Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>
@ -619,12 +683,39 @@ class CoursesNew extends Component {
} }
</style> </style>
<div className="stud-class-set bor-bottom-greyE padding1020 "> <div className="stud-class-set bor-bottom-greyE padding1020 ">
<style>{
`
.yslzxueshiskmc .ant-input{
border-right: none !important;
height: 40px !important;
width: 655px !important;
}
<Form.Item label="课堂名称"> .yslzxueshiskmc .ant-input-group{
width: 720px !important;
}
.yslzxueshisy span .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshiskmc .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshiskmc .ant-input-group-wrapper{
width: 720px !important;
}
.yslzxueshiskmcs .ant-input-group-wrapper{
width: 720px !important;
}
`
}</style>
<Form.Item label="课堂名称" className="yslzxueshiskmcs">
{getFieldDecorator('classroom', { {getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}], rules: [{required: true, message: "不能为空"}],
})(<Input className={"greyInput fl"} placeholder="例如数据结构2016秋季班级"/>)} })(<Input className="yslzxueshiskmc fl" placeholder="例如数据结构2016秋季班级" addonAfter={String(addonAfteronelens4)+"/60"} maxLength={60} />)}
<span className={"newcoursestitle fl"}> <span className="newcoursestitleysl fl">
{/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/} {/*(如果本学期包含多个班级,只需创建一个课堂然后在课堂内部建立不同的分班)*/}
<p className="ant-progress-text"> <p className="ant-progress-text">
<Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/> <Icon style={{ color: '#52c41a' }} type="check-circle" theme="filled"/>
@ -675,10 +766,6 @@ class CoursesNew extends Component {
rules:[{ rules:[{
pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"), pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
message: '必须是数值' message: '必须是数值'
},
{
max:5,
message: '不能超过5个字符',
}]} }]}
)( )(
<Input id="period" className="yslzxueshi " placeholder="例如30" addonAfter={String(addonAfteronelen)+"/5"} maxLength={5}/> <Input id="period" className="yslzxueshi " placeholder="例如30" addonAfter={String(addonAfteronelen)+"/5"} maxLength={5}/>
@ -694,10 +781,6 @@ class CoursesNew extends Component {
rules:[{ rules:[{
pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"), pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
message: '必须是数值' message: '必须是数值'
},
{
max:5,
message: '不能超过5个字符',
} }
]} ]}
)( )(

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

@ -77,7 +77,7 @@ class PollNew extends Component {
} }
changeTopicName = (e) => { changeTopicName = (e) => {
console.log("调用了changeTopicName"); // console.log("调用了changeTopicName");
let num = parseInt(e.target.value.length); let num = parseInt(e.target.value.length);
if(num>60){ if(num>60){
return; return;

Loading…
Cancel
Save