dev_sync_trustie
杨树林 5 years ago
parent 8414c6a3b2
commit dbd1e97d40

@ -589,6 +589,12 @@ reglistviewdivs2 {
} }
.demo-infinite-container33 {
border-radius: 2px;
height: 161px;
width: 410px;
}
.cpersondiv1Items { .cpersondiv1Items {
color: #05101A; color: #05101A;
font-size: 12px; font-size: 12px;

@ -6,6 +6,7 @@ import competition from '../comcss/competition.css';
import Registrationitem from "../Registrationitem"; import Registrationitem from "../Registrationitem";
import InfiniteScroll from 'react-infinite-scroller'; import InfiniteScroll from 'react-infinite-scroller';
// import PersonModaltion from "./PersonModaltion"; // import PersonModaltion from "./PersonModaltion";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
const {Search} = Input; const {Search} = Input;
//创建战队 //创建战队
@ -64,6 +65,9 @@ class PersonModal extends Component {
} }
Getteacherdata = (keywordteachers, team_idteachers, teacher_ids) => { Getteacherdata = (keywordteachers, team_idteachers, teacher_ids) => {
this.setState({
person2: false,
})
//老师姓名 keyword //老师姓名 keyword
//当前战队ID team_id //当前战队ID team_id
//当前老师ID数组 teacher_ids //当前老师ID数组 teacher_ids
@ -88,6 +92,9 @@ class PersonModal extends Component {
}) })
}; };
Getstudentsdata = (keywordstudents, team_idstudents, student_ids) => { Getstudentsdata = (keywordstudents, team_idstudents, student_ids) => {
this.setState({
person1: false,
})
//学生姓名 keyword //学生姓名 keyword
//当前战队ID team_id //当前战队ID team_id
//当前队员ID数组 student_ids //当前队员ID数组 student_ids
@ -117,22 +124,69 @@ class PersonModal extends Component {
teacheronChange = (e) => { teacheronChange = (e) => {
console.log(e.target.value); console.log(e.target.value);
console.log("老师输入框事件|||||||||||123123123"); console.log("老师输入框事件|||||||||||123123123");
try {
if (e.target.value.length > 0) {
this.setState({
person1: true,
person2: false,
keywordteachers: e.target.value
})
} else {
this.setState({
person1: false,
person2: false,
keywordteachers: e.target.value
})
}
} catch (e) {
this.setState({ this.setState({
person1: true, person1: true,
person2: false,
keywordteachers: e.target.value keywordteachers: e.target.value
}) })
}
try {
const {team_idteachers, teacher_ids} = this.state;
this.Getteacherdata(e.target.value, team_idteachers, teacher_ids);
} catch (e) {
}
}; };
//学生输入框事件 //学生输入框事件
studentsonChange = (e) => { studentsonChange = (e) => {
console.log("学生输入框事件"); console.log("学生输入框事件");
console.log(e); console.log(e);
try {
if (e.target.value.length > 0) {
this.setState({ this.setState({
person2: true, person2: true,
person1: false,
keywordstudents: e.target.value keywordstudents: e.target.value
}) });
} else {
this.setState({
person2: false,
person1: false,
keywordstudents: e.target.value
});
}
} catch (e) {
this.setState({
person2: true,
person1: false,
keywordstudents: e.target.value
});
}
try {
const {team_idstudents, student_ids} = this.statel
this.Getstudentsdata(e.target.value, team_idstudents, student_ids);
} catch (e) {
} }
}
//点击获取老师数据 //点击获取老师数据
getdatacpersondiv1Items = (object) => { getdatacpersondiv1Items = (object) => {
@ -249,17 +303,60 @@ class PersonModal extends Component {
inputOnFocus = (e) => { inputOnFocus = (e) => {
console.log("inputOnFocus"); console.log("inputOnFocus");
console.log(e); console.log(e);
try {
if (this.state.keywordteachers && this.state.keywordteachers.length > 0) {
this.setState({
person1: true,
person2: false,
})
} else {
this.setState({
person1: false,
person2: false,
})
}
} catch (e) {
this.setState({ this.setState({
person1: true person1: true,
person2: false,
}) })
} }
}
inputOnFocus2 = (e) => { inputOnFocus2 = (e) => {
console.log("inputOnFocus2"); console.log("inputOnFocus2");
console.log(e); console.log(e);
try {
if (this.state.keywordstudents && this.state.keywordstudents.length > 0) {
this.setState({
person2: true,
person1: false,
})
} else {
this.setState({ this.setState({
person2: true person2: false,
person1: false,
})
}
} catch (e) {
this.setState({
person2: true,
person1: false,
})
}
}
inputOnFocus3 = (e) => {
console.log("inputOnFocus3");
console.log(e);
this.setState({
person2: false,
person1: false,
}) })
} }
@ -352,7 +449,11 @@ class PersonModal extends Component {
const cpersondiv1 = ( const cpersondiv1 = (
<div className={" backgroundspersondiv cpersondiv1 borders2"}> <div className={" backgroundspersondiv cpersondiv1 borders2"}>
<Spin spinning={false}> <Spin spinning={false}>
<div className="demo-infinite-container2"> <div className={cpersondiv1Items.length === 0 ? "demo-infinite-container33" : "demo-infinite-container2"}>
{
cpersondiv1Items.length === 0 ?
<NoneData></NoneData>
:
<InfiniteScroll <InfiniteScroll
initialLoad={false} initialLoad={false}
pageStart={0} pageStart={0}
@ -366,6 +467,8 @@ class PersonModal extends Component {
} }
</InfiniteScroll> </InfiniteScroll>
}
</div> </div>
</Spin> </Spin>
</div> </div>
@ -410,7 +513,11 @@ class PersonModal extends Component {
<div className={" backgroundspersondiv cpersondiv1 borders2"}> <div className={" backgroundspersondiv cpersondiv1 borders2"}>
{/*this.state.loading2*/} {/*this.state.loading2*/}
<Spin spinning={false}> <Spin spinning={false}>
<div className="demo-infinite-container2"> <div className={persondiv2Items.length === 0 ? "demo-infinite-container33" : "demo-infinite-container2"}>
{
persondiv2Items.length === 0 ?
<NoneData></NoneData>
:
<InfiniteScroll <InfiniteScroll
initialLoad={false} initialLoad={false}
pageStart={0} pageStart={0}
@ -424,6 +531,7 @@ class PersonModal extends Component {
} }
</InfiniteScroll> </InfiniteScroll>
}
</div> </div>
</Spin> </Spin>
</div> </div>
@ -504,7 +612,8 @@ class PersonModal extends Component {
队名: 队名:
</p> </p>
<Input className="yslzxueshiskmc" onInput={this.changeTopicName} placeholder="请输入您的战队名称最多不超过60个字符" <Input className="yslzxueshiskmc" onInput={this.changeTopicName} onFocus={this.inputOnFocus3}
placeholder="请输入您的战队名称最多不超过60个字符"
addonAfter={String(addonAfter) + "/60"} maxLength={60}/> addonAfter={String(addonAfter) + "/60"} maxLength={60}/>
</div> </div>

Loading…
Cancel
Save