diff --git a/public/react/src/modules/question/component/Paperreview_itemModel.js b/public/react/src/modules/question/component/Paperreview_itemModel.js index b4ceacc02..72c9dd469 100644 --- a/public/react/src/modules/question/component/Paperreview_itemModel.js +++ b/public/react/src/modules/question/component/Paperreview_itemModel.js @@ -20,6 +20,25 @@ class Paperreview_itemModel extends Component { }) } + 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( @@ -56,7 +75,7 @@ width: 124px !important;
this.props.Singlemagazine("",false)}>取消 - this.props.setDownloady(this.state.value)}>确定 + this.setDownloadysl()}>确定
diff --git a/public/react/src/modules/question/component/Paperreview_itemModels.js b/public/react/src/modules/question/component/Paperreview_itemModels.js index ba7978aff..c6d7ce029 100644 --- a/public/react/src/modules/question/component/Paperreview_itemModels.js +++ b/public/react/src/modules/question/component/Paperreview_itemModels.js @@ -21,6 +21,28 @@ class Paperreview_itemModels extends Component { }) } + 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) { + + } + console.log("必须为数值s"); + + this.props.setDownloadys(this.state.value); + } + render() { return( @@ -57,7 +79,7 @@ width: 124px !important;
this.props.Singlemagazines(false,null)}>取消 - this.props.setDownloadys(this.state.value)}>确定 + this.setDownloadysl()}>确定