dev_unstable^2
杨树林 5 years ago
parent ca0fa6ed73
commit e0dadb9f9c

@ -27,7 +27,9 @@ function disabledDateTime() {
disabledMinutes: () => range(1, 30).concat(range(31, 60)), disabledMinutes: () => range(1, 30).concat(range(31, 60)),
}; };
} }
function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days');
}
// function disabledDate(current) { // function disabledDate(current) {
// console.log(current); // console.log(current);
// return current && current < moment().endOf('day').subtract(1, 'days'); // return current && current < moment().endOf('day').subtract(1, 'days');
@ -49,6 +51,8 @@ class Goldsubject extends Component {
fetching:false, fetching:false,
subject_id:"", subject_id:"",
start_date:"", start_date:"",
addonAfteronelenone:"",
addonAfteronelentwo:"",
Whethertocreateanewclassroom:true, Whethertocreateanewclassroom:true,
checkbofrup:[ checkbofrup:[
{module_type:"announcement",module_name:"公告栏"},{module_type:"online_learning",module_name:"在线学习"} {module_type:"announcement",module_name:"公告栏"},{module_type:"online_learning",module_name:"在线学习"}
@ -121,8 +125,8 @@ class Goldsubject extends Component {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
course: data.course_list_name, course: data.course_list_name,
classroom: data.name, classroom: data.name,
period: data.class_period, period: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period+"",
credit: data.credit, credit: data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit+"",
checkboxgroup: data.course_module_types, checkboxgroup: data.course_module_types,
Realnamecertification: data.authentication, Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification, Professionalcertification:data.professional_certification,
@ -140,7 +144,9 @@ class Goldsubject extends Component {
Professionalcertification:data.professional_certification, Professionalcertification:data.professional_certification,
name: data.name, name: data.name,
class_period: data.class_period, class_period: data.class_period,
credit: parseFloat(data.credit), addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period,
credit: parseFloat(data.credit),
addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit,
course_module_types: data.course_module_types, course_module_types: data.course_module_types,
school:data.school, school:data.school,
Whethertocreateanewclassroom:false, Whethertocreateanewclassroom:false,
@ -596,7 +602,7 @@ class Goldsubject extends Component {
this.applyForAddOrgForm.setVisible(true) this.applyForAddOrgForm.setVisible(true)
} }
render() { render() {
let {datatime,datatimetwo,school,searchlistscholl,Whethertocreateanewclassroom} = this.state; let {datatime,datatimetwo,school,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
@ -618,8 +624,8 @@ class Goldsubject extends Component {
if(addonAftertwo){ if(addonAftertwo){
addonAfteronelens=String(addonAftertwo).length; addonAfteronelens=String(addonAftertwo).length;
} }
console.log(addonAfterone); console.log(addonAfteronelenone);
console.log(addonAfteronelen); console.log(addonAfteronelentwo);
return ( return (
<React.Fragment> <React.Fragment>
@ -758,6 +764,7 @@ class Goldsubject extends Component {
onChange={this.handleChange} onChange={this.handleChange}
className={"fl construction "} className={"fl construction "}
placeholder="例如:数据结构" placeholder="例如:数据结构"
addonAfter={String(5)+"/5"}
> >
{options} {options}
</AutoComplete> </AutoComplete>
@ -792,7 +799,16 @@ class Goldsubject extends Component {
.yslzxueshi .ant-input{ .yslzxueshi .ant-input{
border-right: none !important; border-right: none !important;
height: 40px !important; height: 40px !important;
width: 236px !important
}
.yslzxueshi .ant-input-group {
width: 280px !important;
} }
.yslzxueshi .ant-input-group-addon{
width: 44px !important;
background-color: #fafafa!important;
}
` `
}</style> }</style>
<Form.Item <Form.Item
@ -802,25 +818,17 @@ class Goldsubject extends Component {
{getFieldDecorator("period", {getFieldDecorator("period",
{ {
rules:[{ rules:[{
pattern: new RegExp(/^[1-9]\d*$/, "g"), pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
message: '必须是数值' message: '必须是数值'
}, },
{ {
max:4, max:5,
message: '不能超过5个字符', message: '不能超过5个字符',
}]} }]}
)( )(
<Input id="period" placeholder="例如30" className="yslzxueshi" addonAfter={String(addonAfteronelen)+"/5"} /> <Input id="period" value={addonAfteronelenone} placeholder="例如30" className="yslzxueshi" addonAfter={String(addonAfteronelen)+"/5"} maxLength={5}/>
)} )}
</Form.Item> </Form.Item>
<style>{
`
.yslzxuefen .ant-input{
border-right: none !important;
height: 40px !important;
}
`
}</style>
<Form.Item <Form.Item
label="学分" label="学分"
hasFeedback hasFeedback
@ -828,16 +836,16 @@ class Goldsubject extends Component {
{getFieldDecorator("credit", {getFieldDecorator("credit",
{ {
rules:[{ rules:[{
pattern: new RegExp(/^[1-9]\d*$/, "g"), pattern: new RegExp(/^[0-9]+([.]{1}[0-9]+){0,1}$/, "g"),
message: '必须是数值' message: '必须是数值'
}, },
{ {
max:4, max:5,
message: '不能超过5个字符', message: '不能超过5个字符',
} }
]} ]}
)( )(
<Input id="credit" placeholder="例如3" className="yslzxuefen" addonAfter={String(addonAfteronelens)+"/5"} /> <Input id="credit" value={addonAfteronelentwo} placeholder="例如3" className="yslzxueshi" addonAfter={String(addonAfteronelens)+"/5"} maxLength={5}/>
)} )}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
@ -856,7 +864,7 @@ 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} disabledDate={disabledDate}
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishstwo} onChange={this.onChangeTimepublishstwo}
/> />
@ -867,7 +875,8 @@ class Goldsubject extends Component {
label="结束时间" label="结束时间"
> >
{getFieldDecorator("endtime", { {getFieldDecorator("endtime", {
rules: [{type: 'object',required: true, message: "结束时间不能为空"}], rules: [{type: 'object',
required: true, message: "结束时间不能为空"}],
})( })(
<span className="fl mt5"> <span className="fl mt5">
<DatePicker <DatePicker
@ -879,7 +888,7 @@ 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} disabledDate={disabledDate}
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishs} onChange={this.onChangeTimepublishs}
/> />

Loading…
Cancel
Save