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

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

Loading…
Cancel
Save