合并阿里云

issues25489
杨树林 5 years ago
parent 90bc7648b9
commit 40ac08166b

@ -33,7 +33,7 @@ class ModulationModal extends Component{
this.setState({ this.setState({
Inputsval: "", Inputsval: "",
Inputsvaltype: true, Inputsvaltype: true,
Inputsvaltest: "请输入分数", Inputsvaltest: "请填写分数",
}) })
return return
} }
@ -58,29 +58,39 @@ class ModulationModal extends Component{
setInputs=(e)=>{ setInputs=(e)=>{
console.log("setInputs"); console.log("setInputs");
console.log(e); console.log(e.target.value);
if (e === undefined || e === null || e === "") { if (e.target.value === undefined || e.target.value === null || e.target.value === "") {
this.setState({ this.setState({
borredszf: "ml10 color-grey-9 bor-reds ", borredszf: "ml10 color-grey-9 bor-reds ",
Inputsval: 0, Inputsval: "",
Inputsvaltype: true, Inputsvaltype: true,
Inputsvaltest: "请输入分数", Inputsvaltest: "请填写分数",
}) })
return return
} }
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/ var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = e; var nubmer = e.target.value;
if (!re.test(nubmer)) { if (!re.test(nubmer)) {
this.setState({ this.setState({
borredszf: "ml10 color-grey-9 bor-reds ", borredszf: "ml10 color-grey-9 bor-reds ",
Inputsval: e, Inputsval: e.target.value,
Inputsvaltype: true, Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数", Inputsvaltest: "请输入0-100的分数",
}) })
return; return;
} }
if (parseFloat(e.target.value) > 100) {
this.setState({ this.setState({
Inputsval: parseFloat(e), borredszf: "ml10 color-grey-9 bor-reds ",
Inputsval: e.target.value,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
return;
}
this.setState({
Inputsval: parseFloat(e.target.value),
Inputsvaltype: false, Inputsvaltype: false,
}) })
} }
@ -133,19 +143,36 @@ class ModulationModal extends Component{
line-height: 40px; line-height: 40px;
height: 35px; height: 35px;
} }
` `
} }
</style> </style>
<InputNumber min={0} {Inputsvaltype === true ?
className={Inputsvaltype === true ? "borerinput myinputnumbers" : "myinputnumbers"} <style>
{
`
.ant-input:hover {
border: 1px solid #DD1717!important;
}
.ant-input:focus {
border: 1px solid #DD1717!important;
}
}
`
}
</style>
:
""
} <Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{ style={{
width: "120px", width: "120px",
height: "40px", height: "40px",
}} }}
step={0.1} placeholder="请填写分数"
onChange={(e) => this.setInputs(e)} onChange={(e) => this.setInputs(e)}
value={Inputsval === undefined || Inputsval === null ? 0 : Inputsval}/> value={Inputsval === undefined || Inputsval === null ? "" : Inputsval}/>
<span <span
style={{ style={{
textAlign: "center", textAlign: "center",

@ -344,3 +344,5 @@
border: 1px solid #eee !important; border: 1px solid #eee !important;
} }

@ -1243,6 +1243,9 @@ class Studentshavecompletedthelist extends Component {
exercise_status:0, exercise_status:0,
order_type: "desc", order_type: "desc",
exeuserid: 0, exeuserid: 0,
subjective: 0,
objective_score: 0,
subjective_score: 0,
} }
// //console.log("Studentshavecompletedthelist"); // //console.log("Studentshavecompletedthelist");
// //console.log(props.current_status); // //console.log(props.current_status);

Loading…
Cancel
Save