提交 27b036ca authored 作者: 周盛's avatar 周盛

添加老师角色role === 1‘

上级 f5908a97
......@@ -17,7 +17,7 @@ export default class Filter extends React.Component{
super(props);
this.state ={
role: 2,
inputValue:'',
inputValue: '',
formValues: {
institutionIds: [],
majorIds:[],
......@@ -44,7 +44,7 @@ export default class Filter extends React.Component{
const { options } = this.state;
var role = res.type;
options.institutionList = res.institutionModelList.map(i=> ({key: i.name,value: i.id}));
if(role === 0) {
if(role === 0 || role === 1) {
this.setState({
role,
options
......@@ -166,16 +166,21 @@ export default class Filter extends React.Component{
// 搜索框输入处理
inputChange = (e) => {
const { formValues } = this.state;
var value = Number(e.target.value);
if(isNaN(value)){
formValues.name = e.target.value;
if(formValues.studentNo) delete formValues.studentNo;
if(e.target.value !== "") {
var value = Number(e.target.value);
if(isNaN(value)){
formValues.name = e.target.value;
if(formValues.studentNo) delete formValues.studentNo;
}
else{
formValues.studentNo = value;
if(formValues.name) delete formValues.name;
}
}
else{
formValues.studentNo = value;
if(formValues.name) delete formValues.name;
delete formValues.name;
delete formValues.studentNo
}
this.setState({
formValues,
inputValue: e.target.value,
......@@ -233,7 +238,6 @@ export default class Filter extends React.Component{
else {
delete temp.clazzIds;
}
this.props.getPage({...temp});
this.props.Toggle && this.props.Toggle();
}
......@@ -241,6 +245,7 @@ export default class Filter extends React.Component{
// 重置搜索条件
reset =() => {
this.setState({
inputValue: '',
formValues: {
institutionIds: [],
majorIds:[],
......@@ -254,7 +259,7 @@ export default class Filter extends React.Component{
const { gradeList, institutionList, majorList, clazzList } = this.state.options;
const { gradeId, institutionIds , majorIds } = this.state.formValues;
const { role } = this.state;
if(role === 0){
if(role === 0 || role === 1){
return (
<>
<p style={{color: '#666666'}}>年级选择</p>
......
......@@ -12,6 +12,7 @@
width: 222px;
margin:auto;
padding-top: 16px;
padding-bottom: 20px;
#searchInput {
padding-left: 15px;
width: 188px;
......@@ -71,7 +72,7 @@
// 查询按钮
.buttonBox{
width: 100%;
height: 70px;
height: 100px;
display: flex;
justify-content: space-around;
padding: 20px 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论