调整试卷调分弹框

issues25489
杨树林 5 years ago
parent 5d9e4966f9
commit 212fdbd900

@ -29,11 +29,21 @@ class ModulationModal extends Component{
})
if(Inputsval===undefined||Inputsval===""){
this.setState({
Inputsvaltype:true
})
this.setState({
Inputsval: "",
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
return
}
if (this.state.Inputsvaltype === true) {
return;
}
this.setState({
Inputsvaltype: false,
Inputsvaltest: "",
})
this.props.Saves(textareaval,Inputsval)
}
@ -45,21 +55,34 @@ class ModulationModal extends Component{
}
setInputs=(e)=>{
debugger
var value=parseInt(e.target.value)
if(isNaN(value)){
value=0
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
}else{
if(value<0||value>100){
value=0
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
}
}
this.setState({
Inputsval:value
Inputsval: value,
Inputsvaltype: false,
})
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
let {textareaval, Inputsval, textareavaltype, Inputsvaltype, Inputsvaltest} = this.state;
return(
<div>
<Modal
@ -82,6 +105,8 @@ class ModulationModal extends Component{
flexDirection: "initial",
}}>
<span style={{
width: "70px",
textAlign: "center",
@ -91,7 +116,9 @@ class ModulationModal extends Component{
lineHeight: " 40px",
color: " #f5222d",
}}>*</span></span>
<Input style={{
<Input
className={Inputsvaltype === true ? "borerinput" : "borerinputs"}
style={{
width: "335px",
height: "40px",
}}
@ -108,6 +135,12 @@ class ModulationModal extends Component{
}
/>
</div>
{
Inputsvaltype === true ?
<p style={{color: "#DD1717", width: "268px"}}>{Inputsvaltest}</p>
: ""
}
<div style={{
display: "flex",
flexDirection: "initial",

@ -317,3 +317,11 @@
padding-right: 0.25rem;
}
.borerinput {
border: 1px solid #DD1717 !important;
}
.borerinputs {
border: 1px solid #eee !important;
}

Loading…
Cancel
Save