You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/public/react/src/modules/question/component/Paperreview_itemModel.js

87 lines
1.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
class Paperreview_itemModel extends Component {
constructor(props) {
super(props);
this.state={
value:0,
}
}
onChange=(value)=>{
//console.log("设置批量得分");
//console.log(value);
this.setState({
value:value,
})
}
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
this.props.setDownloady(this.state.value)
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="批量设置分数"
centered={true}
visible={this.props.modalsTypey===undefined?false:this.props.modalsTypey}
width="442px"
>
<style>
{
`
.yslzxueshisanfd .ant-input-number{
height: 35px !important;
width: 124px !important;
}
`
}
</style>
<div className="educouddiv intermediatecenter">
<div className={"tabeltext-alignleft mt10 sortinxdirection yslzxueshisanfd"}>
<p className="titiles lh35">
{this.props.titilesm}</p>
<InputNumber min={0}
step={0.1}
onChange={this.onChange} />
<p className="titiles ml5 lh35">
/
</p>
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazine("",false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default Paperreview_itemModel;