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

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

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