dev_hjm
commit
9d34878955
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 18 KiB |
@ -1,39 +1,56 @@
|
||||
.ant-checkbox-group > div .boardsList{
|
||||
/* border-top: 1px solid #ebebeb; */
|
||||
padding:10px 0px 20px!important;
|
||||
}
|
||||
.ant-checkbox-group > div:first-child .boardsList{
|
||||
border-top: none;
|
||||
}
|
||||
.boardsList .contentSection {
|
||||
flex: 1;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
|
||||
.ant-select-selection--single,.ant-select-selection__rendered{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.ant-input:focus + .ant-input-group-addon{
|
||||
background-color: #fff!important;
|
||||
}
|
||||
.ant-input-group-addon{
|
||||
color: #666!important;
|
||||
font-size: 12px;
|
||||
border: 1px solid #d9d9d9!important;
|
||||
border-left: none!important;
|
||||
}
|
||||
|
||||
.courseForm .ant-form-item-label{
|
||||
margin-left: unset;
|
||||
}
|
||||
|
||||
/* 毕设选题列表 */
|
||||
.TopicDetailTable .topHead{background-color: #F5F5F5;height: 56px;color: #666666;padding:0px 30px}
|
||||
.TopicDetailTable .topHead span,.TopicDetailTable .bottomBody li span{display: block;float: left;justify-content: center;align-items: center;display: -webkit-flex;height: 56px;}
|
||||
.TopicDetailTable .bottomBody{padding:0px 30px}
|
||||
.TopicDetailTable .bottomBody li{border-bottom: 1px solid #eee;clear: both;}
|
||||
.TopicDetailTable .bottomBody li:last-child{border-bottom: none;}
|
||||
|
||||
.ant-checkbox-group > div .boardsList{
|
||||
/* border-top: 1px solid #ebebeb; */
|
||||
padding:10px 0px 20px!important;
|
||||
}
|
||||
.ant-checkbox-group > div:first-child .boardsList{
|
||||
border-top: none;
|
||||
}
|
||||
.boardsList .contentSection {
|
||||
flex: 1;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
|
||||
.ant-select-selection--single,.ant-select-selection__rendered{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.ant-input:focus + .ant-input-group-addon{
|
||||
background-color: #fff!important;
|
||||
}
|
||||
.ant-input-group-addon{
|
||||
color: #666!important;
|
||||
font-size: 12px;
|
||||
border: 1px solid #d9d9d9!important;
|
||||
border-left: none!important;
|
||||
}
|
||||
|
||||
.courseForm .ant-form-item-label{
|
||||
margin-left: unset;
|
||||
}
|
||||
|
||||
/* 毕设选题列表 */
|
||||
.TopicDetailTable .topHead{background-color: #F5F5F5;height: 56px;color: #666666;padding:0px 30px}
|
||||
.TopicDetailTable .topHead span,.TopicDetailTable .bottomBody li span{display: block;float: left;justify-content: center;align-items: center;display: -webkit-flex;height: 56px;}
|
||||
.TopicDetailTable .bottomBody{padding:0px 30px}
|
||||
.TopicDetailTable .bottomBody li{border-bottom: 1px solid #eee;clear: both;}
|
||||
.TopicDetailTable .bottomBody li:last-child{border-bottom: none;}
|
||||
|
||||
.maxnamewidth100{
|
||||
max-width: 100px;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
.maxnamewidth110{
|
||||
max-width: 110px;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
.ysyslxh{
|
||||
background: #fafafa;
|
||||
}
|
@ -1,216 +1,213 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Modal,Checkbox,Input } from "antd";
|
||||
import axios from 'axios';
|
||||
|
||||
const Search = Input.Search;
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
class addCollaborators extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
addPartner:false,
|
||||
page:1,
|
||||
partnerList:undefined,
|
||||
search:'',
|
||||
partnerListid:[],
|
||||
checkAll: false,
|
||||
optionss:[]
|
||||
}
|
||||
}
|
||||
addBox=()=>{
|
||||
|
||||
this.setState({
|
||||
addPartner:true,
|
||||
search:"",
|
||||
page:1,
|
||||
partnerList:undefined,
|
||||
optionss:[]
|
||||
})
|
||||
this.searchList("")
|
||||
|
||||
}
|
||||
hideAddBox=()=>{
|
||||
this.setState({
|
||||
addPartner:false,
|
||||
optionss:[],
|
||||
partnerListid:[]
|
||||
})
|
||||
}
|
||||
// 搜索框输入
|
||||
changeSearchValue=(e)=>{
|
||||
this.setState({
|
||||
search: e.target.value
|
||||
})
|
||||
}
|
||||
// 回车搜索--搜索成功后page为1
|
||||
searchList=()=>{
|
||||
let id=this.props.match.params.pathId;
|
||||
let {search,page}=this.state;
|
||||
let url='/paths/'+id+'/search_members.json?search='+search+"&page="+page;
|
||||
axios.post(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
let list=result.data.users;
|
||||
let optionss=[]
|
||||
for(var i=0; i<list.length;i++){
|
||||
optionss.push(list[i].user_id)
|
||||
}
|
||||
this.setState({
|
||||
partnerList:result.data.users,
|
||||
page:1,
|
||||
optionss:optionss
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
SaveAddBox=()=>{
|
||||
let {partnerListid} =this.state;
|
||||
let id=this.props.match.params.pathId;
|
||||
let url="/paths/"+id+"/add_subject_members.json"
|
||||
axios.post(url,{
|
||||
user_ids:partnerListid
|
||||
}).then((response) => {
|
||||
if(response.status==200){
|
||||
this.setState({
|
||||
addPartner:false,
|
||||
optionss:[],
|
||||
partnerListid:[]
|
||||
})
|
||||
this.props.updatadetailInfoLists();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
}
|
||||
|
||||
addCollaboratorsid=(id)=>{
|
||||
this.setState({
|
||||
partnerListid:id
|
||||
})
|
||||
}
|
||||
|
||||
onCheckAllChange = (e) => {
|
||||
let {optionss} =this.state;
|
||||
|
||||
if(e.target.checked===true){
|
||||
this.setState({
|
||||
checkAll: e.target.checked,
|
||||
partnerListid:optionss
|
||||
});
|
||||
}else{
|
||||
this.setState({
|
||||
checkAll: e.target.checked,
|
||||
partnerListid:[]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
contentViewScroll=(e)=>{
|
||||
//滑动到底判断
|
||||
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
|
||||
// console.log("到达底部");
|
||||
|
||||
let id=this.props.match.params.pathId;
|
||||
let {search,page,partnerList,optionss}=this.state;
|
||||
let newpage=page+1;
|
||||
let url='/paths/'+id+'/search_members.json?search='+search+"&page="+newpage;
|
||||
|
||||
axios.post(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
let list=result.data.users;
|
||||
let newlist=partnerList;
|
||||
for(var j=0; j<list.length;j++){
|
||||
newlist.push(list[j])
|
||||
}
|
||||
let newoptionss=optionss
|
||||
for(var i=0; i<list.length;i++){
|
||||
newoptionss.push(list[i].user_id)
|
||||
}
|
||||
this.setState({
|
||||
partnerList:newlist,
|
||||
page:newpage,
|
||||
optionss:optionss
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
render(){
|
||||
let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state;
|
||||
|
||||
return(
|
||||
<div className="edu-back-white bor-top-greyE addTeamMember">
|
||||
{
|
||||
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true?
|
||||
<a onClick = {this.addBox} className="color-blue">+ 添加合作者</a>
|
||||
:""
|
||||
}
|
||||
|
||||
<Modal
|
||||
keyboard={false}
|
||||
title="添加合作者"
|
||||
visible={addPartner}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
>
|
||||
<div className="newupload_conbox clearfix">
|
||||
<div className="mb20">
|
||||
<Search placeholder="输入用户的真实姓名进行搜索" id="search_not_collaborators" style={{"width":"100%"}}
|
||||
autocomplete="off"
|
||||
value={search}
|
||||
onInput={this.changeSearchValue}
|
||||
onSearch={search => this.searchList(search)} />
|
||||
</div>
|
||||
<p className="clearfix pt10 pl10 pr10" style={{"background":"#F4FAFF","marginBottom":"0px"}}>
|
||||
<Checkbox className="fl"
|
||||
onChange={this.onCheckAllChange}
|
||||
checked={this.state.checkAll}
|
||||
></Checkbox>
|
||||
<span className="span1 fl edu-txt-w80 task-hide font-bd">姓名</span>
|
||||
<span className="span3 fl edu-txt-w80 task-hide font-bd">昵称</span>
|
||||
<span className="span2 fl edu-txt-w80 task-hide font-bd">职位</span>
|
||||
<span className="span3 fl edu-txt-w260 task-hide font-bd">单位</span>
|
||||
</p>
|
||||
<ul className="upload_select_box fl clearfix mb15"
|
||||
style={{"overflow-y":"auto"}}
|
||||
id="search_not_members_list"
|
||||
|
||||
onScroll={this.contentViewScroll}
|
||||
>
|
||||
<CheckboxGroup style={{ width: '100%' }} value={checkAll===true?optionss:partnerListid} onChange={this.addCollaboratorsid}>
|
||||
{
|
||||
partnerList && partnerList.map((item,key)=>{
|
||||
return(
|
||||
<li className="clearfix">
|
||||
<Checkbox value={item.user_id} key={key} className="fl"></Checkbox>
|
||||
<a target="_blank" className="task-hide color-grey3 fl span1 edu-txt-w80">{item.user_name}</a>
|
||||
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.nickname}</span>
|
||||
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identity}</span>
|
||||
<span className="span3 color-grey fl edu-txt-w260 task-hide">{item.school_name}</span>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</CheckboxGroup>
|
||||
</ul>
|
||||
<div className="mt20 marginauto clearfix edu-txt-center">
|
||||
<a onClick={this.hideAddBox} className="pop_close task-btn mr30">取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={this.SaveAddBox} id="submit_send_shixun">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
import React, { Component } from 'react';
|
||||
import { Modal,Checkbox,Input } from "antd";
|
||||
import axios from 'axios';
|
||||
|
||||
const Search = Input.Search;
|
||||
const CheckboxGroup = Checkbox.Group;
|
||||
class addCollaborators extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state = {
|
||||
addPartner:false,
|
||||
page:1,
|
||||
partnerList:undefined,
|
||||
search:'',
|
||||
partnerListid:[],
|
||||
checkAll: false,
|
||||
optionss:[]
|
||||
}
|
||||
}
|
||||
addBox=()=>{
|
||||
|
||||
this.setState({
|
||||
addPartner:true,
|
||||
search:"",
|
||||
page:1,
|
||||
partnerList:undefined,
|
||||
optionss:[]
|
||||
})
|
||||
this.searchList("")
|
||||
|
||||
}
|
||||
hideAddBox=()=>{
|
||||
this.setState({
|
||||
addPartner:false,
|
||||
optionss:[],
|
||||
partnerListid:[]
|
||||
})
|
||||
}
|
||||
// 搜索框输入
|
||||
changeSearchValue=(e)=>{
|
||||
this.setState({
|
||||
search: e.target.value
|
||||
})
|
||||
}
|
||||
// 回车搜索--搜索成功后page为1
|
||||
searchList=()=>{
|
||||
let id=this.props.match.params.pathId;
|
||||
let {search,page}=this.state;
|
||||
let url='/paths/'+id+'/search_members.json?search='+search+"&page="+page;
|
||||
axios.post(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
let list=result.data.users;
|
||||
let optionss=[]
|
||||
for(var i=0; i<list.length;i++){
|
||||
optionss.push(list[i].user_id)
|
||||
}
|
||||
this.setState({
|
||||
partnerList:result.data.users,
|
||||
page:1,
|
||||
optionss:optionss
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
SaveAddBox=()=>{
|
||||
let {partnerListid} =this.state;
|
||||
let id=this.props.match.params.pathId;
|
||||
let url="/paths/"+id+"/add_subject_members.json"
|
||||
axios.post(url,{
|
||||
user_ids:partnerListid
|
||||
}).then((response) => {
|
||||
if(response.status==200){
|
||||
this.setState({
|
||||
addPartner:false,
|
||||
optionss:[],
|
||||
partnerListid:[]
|
||||
})
|
||||
this.props.updatadetailInfoLists();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
}
|
||||
|
||||
addCollaboratorsid=(id)=>{
|
||||
this.setState({
|
||||
partnerListid:id
|
||||
})
|
||||
}
|
||||
|
||||
onCheckAllChange = (e) => {
|
||||
let {optionss} =this.state;
|
||||
|
||||
if(e.target.checked===true){
|
||||
this.setState({
|
||||
checkAll: e.target.checked,
|
||||
partnerListid:optionss
|
||||
});
|
||||
}else{
|
||||
this.setState({
|
||||
checkAll: e.target.checked,
|
||||
partnerListid:[]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
contentViewScroll=(e)=>{
|
||||
//滑动到底判断
|
||||
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
|
||||
// console.log("到达底部");
|
||||
|
||||
let id=this.props.match.params.pathId;
|
||||
let {search,page,partnerList,optionss}=this.state;
|
||||
let newpage=page+1;
|
||||
let url='/paths/'+id+'/search_members.json?search='+search+"&page="+newpage;
|
||||
|
||||
axios.post(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
let list=result.data.users;
|
||||
let newlist=partnerList;
|
||||
for(var j=0; j<list.length;j++){
|
||||
newlist.push(list[j])
|
||||
}
|
||||
let newoptionss=optionss
|
||||
for(var i=0; i<list.length;i++){
|
||||
newoptionss.push(list[i].user_id)
|
||||
}
|
||||
this.setState({
|
||||
partnerList:newlist,
|
||||
page:newpage,
|
||||
optionss:optionss
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
render(){
|
||||
let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state;
|
||||
|
||||
return(
|
||||
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true?
|
||||
<div className="edu-back-white bor-top-greyE addTeamMember">
|
||||
<a onClick = {this.addBox} className="color-blue">+ 添加合作者</a>
|
||||
<Modal
|
||||
keyboard={false}
|
||||
title="添加合作者"
|
||||
visible={addPartner}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
>
|
||||
<div className="newupload_conbox clearfix">
|
||||
<div className="mb20">
|
||||
<Search placeholder="输入用户的真实姓名进行搜索" id="search_not_collaborators" style={{"width":"100%"}}
|
||||
autocomplete="off"
|
||||
value={search}
|
||||
onInput={this.changeSearchValue}
|
||||
onSearch={search => this.searchList(search)} />
|
||||
</div>
|
||||
<p className="clearfix pt10 pl10 pr10" style={{"background":"#F4FAFF","marginBottom":"0px"}}>
|
||||
<Checkbox className="fl"
|
||||
onChange={this.onCheckAllChange}
|
||||
checked={this.state.checkAll}
|
||||
></Checkbox>
|
||||
<span className="span1 fl edu-txt-w80 task-hide font-bd">姓名</span>
|
||||
<span className="span3 fl edu-txt-w80 task-hide font-bd">昵称</span>
|
||||
<span className="span2 fl edu-txt-w80 task-hide font-bd">职位</span>
|
||||
<span className="span3 fl edu-txt-w260 task-hide font-bd">单位</span>
|
||||
</p>
|
||||
<ul className="upload_select_box fl clearfix mb15"
|
||||
style={{"overflow-y":"auto"}}
|
||||
id="search_not_members_list"
|
||||
|
||||
onScroll={this.contentViewScroll}
|
||||
>
|
||||
<CheckboxGroup style={{ width: '100%' }} value={checkAll===true?optionss:partnerListid} onChange={this.addCollaboratorsid}>
|
||||
{
|
||||
partnerList && partnerList.map((item,key)=>{
|
||||
return(
|
||||
<li className="clearfix">
|
||||
<Checkbox value={item.user_id} key={key} className="fl"></Checkbox>
|
||||
<a target="_blank" className="task-hide color-grey3 fl span1 edu-txt-w80">{item.user_name}</a>
|
||||
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.nickname}</span>
|
||||
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identity}</span>
|
||||
<span className="span3 color-grey fl edu-txt-w260 task-hide">{item.school_name}</span>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</CheckboxGroup>
|
||||
</ul>
|
||||
<div className="mt20 marginauto clearfix edu-txt-center">
|
||||
<a onClick={this.hideAddBox} className="pop_close task-btn mr30">取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={this.SaveAddBox} id="submit_send_shixun">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>:""
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default addCollaborators;
|
@ -1,251 +1,253 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import { BrowserRouter as Router, Route} from "react-router-dom";
|
||||
|
||||
import { Switch ,Input,Tooltip,Icon} from 'antd';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import classNames from 'classnames'
|
||||
|
||||
import 'antd/lib/switch/style/index.css'
|
||||
|
||||
import './shixunCss/ShixunCardList.css';
|
||||
|
||||
import { on, off } from 'educoder'
|
||||
|
||||
const $ = window.$;
|
||||
|
||||
const Search = Input.Search;
|
||||
|
||||
class ShixunCardList extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
allevent:"desc",
|
||||
mine:0,
|
||||
InputValue: props.keyword || "",
|
||||
typemy:0,
|
||||
hots:0,
|
||||
news:0,
|
||||
shixunid:"",
|
||||
upcircle:false,
|
||||
typekeyid:undefined,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate = (prevProps, prevState) => {
|
||||
if (this.props.keyword != prevProps.keyword) {
|
||||
this.setState({
|
||||
InputValue: this.props.keyword
|
||||
})
|
||||
}
|
||||
}
|
||||
componentDidMount = () => {
|
||||
on('searchKeywordChange', (event, data) => {
|
||||
// console.log(data)
|
||||
this.Input_search(data)
|
||||
})
|
||||
}
|
||||
componentWillUnmount = () => {
|
||||
off('searchKeywordChange')
|
||||
}
|
||||
|
||||
|
||||
latestHot=(e,key)=>{
|
||||
|
||||
let{upcircle,typekeyid}=this.state;
|
||||
|
||||
let id = e.target.id;
|
||||
$("#"+id).siblings().removeClass("active");
|
||||
$("#"+id).addClass("active");
|
||||
|
||||
let type;
|
||||
|
||||
if(id==="all"){
|
||||
type="publish_time";
|
||||
}
|
||||
if(id==="hot"){
|
||||
type="hot";
|
||||
}else if(id==="new"){
|
||||
type="new";
|
||||
|
||||
}
|
||||
if(typekeyid===key){
|
||||
if(upcircle===true){
|
||||
this.setState({
|
||||
upcircle:false,
|
||||
})
|
||||
this.props.Shixunsupcircles("desc")
|
||||
}else if(upcircle===false){
|
||||
this.setState({
|
||||
upcircle:true,
|
||||
})
|
||||
this.props.Shixunsupcircles("asc")
|
||||
}
|
||||
}else{
|
||||
this.setState({
|
||||
typekeyid:key
|
||||
})
|
||||
}
|
||||
|
||||
//allevent
|
||||
this.props.ShixunsState(false,type);
|
||||
}
|
||||
|
||||
|
||||
onSwitchChange=(e,key)=>{
|
||||
let id=e.target.id
|
||||
$("#"+id).siblings().removeClass("active");
|
||||
$("#"+id).addClass("active");
|
||||
let {typemy,upcircle,typekeyid}=this.state;
|
||||
|
||||
if(typekeyid===key){
|
||||
if(upcircle===true){
|
||||
this.setState({
|
||||
upcircle:false,
|
||||
})
|
||||
this.props.Shixunsupcircles("desc")
|
||||
}else if(upcircle===false){
|
||||
this.setState({
|
||||
upcircle:true
|
||||
})
|
||||
this.props.Shixunsupcircles("asc")
|
||||
}
|
||||
}else{
|
||||
this.setState({
|
||||
typekeyid:key
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if(typemy===0){
|
||||
this.setState({
|
||||
typemy:1
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
typemy:0
|
||||
})
|
||||
}
|
||||
// allevent
|
||||
this.props.ShixunsSwitch();
|
||||
}
|
||||
//输入框搜索
|
||||
Input_search = (value) => {
|
||||
this.setState({
|
||||
InputValue: value
|
||||
})
|
||||
this.props.OnSearchInput(value,true);
|
||||
}
|
||||
|
||||
Input_searchs = (e) => {
|
||||
this.setState({
|
||||
InputValue: e.target.value
|
||||
})
|
||||
this.props.OnSearchInput(e.target.value,false);
|
||||
}
|
||||
upcircles=(val)=>{
|
||||
if(val==="asc"){
|
||||
this.setState({
|
||||
upcircle:false,
|
||||
})
|
||||
this.props.Shixunsupcircles("desc")
|
||||
}else if(val==="desc"){
|
||||
this.setState({
|
||||
upcircle:true
|
||||
})
|
||||
this.props.Shixunsupcircles("asc")
|
||||
}
|
||||
}
|
||||
render(){
|
||||
let {mine,InputValue,upcircle}=this.state;
|
||||
return (
|
||||
<div className="educontent mt20">
|
||||
<div className="clearfix">
|
||||
|
||||
<div className="fl mr20 font-16 bestChoose shixun_repertoire active"
|
||||
id={"all"}
|
||||
onClick={(e)=>this.latestHot(e,1)}>全部
|
||||
</div>
|
||||
<div className="fl mr20 font-16 bestChoose shixun_repertoire"
|
||||
id={mine}
|
||||
onClick={(e)=>this.onSwitchChange(e,2)}>我的
|
||||
</div>
|
||||
|
||||
<div className="fl mr20 font-16 bestChoose shixun_repertoire"
|
||||
id="hot"
|
||||
onClick={(e)=>this.latestHot(e,3)}>最热
|
||||
</div>
|
||||
<div className="fl font-16 bestChoose shixun_repertoire"
|
||||
id="new"
|
||||
onClick={(e)=>this.latestHot(e,4)}>最新
|
||||
</div>
|
||||
|
||||
<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"
|
||||
style={{display:upcircle===true?"block":"none"}}
|
||||
// onClick={()=>this.upcircles("asc")}
|
||||
>
|
||||
<Tooltip placement="bottom" title={"升序"}>
|
||||
<Icon type="up-circle" theme="twoTone" />
|
||||
{/*<Icon type="sort-descending" />*/}
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"
|
||||
// onClick={()=>this.upcircles("desc")}
|
||||
style={{display:upcircle===true?"none":"block"}}
|
||||
>
|
||||
<Tooltip placement="bottom" title={"降序"}>
|
||||
<Icon type="down-circle" theme="twoTone" />
|
||||
{/*<Icon type="sort-ascending" />*/}
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
<div className="fr mt3">
|
||||
{/*<Search*/}
|
||||
{/*style={{ width: 300 }}*/}
|
||||
{/*className="search-new-input fl"*/}
|
||||
{/*placeholder="请输入创建者/实训/关卡名称进行搜索"*/}
|
||||
{/*value={InputValue}*/}
|
||||
{/*onInput={this.Input_searchs}*/}
|
||||
{/*onSearch={value => this.Input_search(value)}*/}
|
||||
{/*enterButton*/}
|
||||
{/*/>*/}
|
||||
|
||||
{/* <Search
|
||||
style={{ width: 300 }}
|
||||
className="fl"
|
||||
placeholder="请输入创建者/实训/关卡名称进行搜索"
|
||||
value={InputValue}
|
||||
onInput={this.Input_searchs}
|
||||
onSearch={value => this.Input_search(value)}
|
||||
autoComplete="off"
|
||||
></Search> */}
|
||||
</div>
|
||||
<div className="fr">
|
||||
<span className="fl color-grey-6 mr30 font-16 mt5" id="search_name">{
|
||||
this.props.search_tags === null ? "" : this.props.search_tags
|
||||
}</span>
|
||||
{/*<div className="fl mr5" style={{marginTop:'1px'}}>*/}
|
||||
{/*/!* <div className="controlblue"></div>*/}
|
||||
{/*<span className="controlring"></span> *!/*/}
|
||||
{/*<Switch*/}
|
||||
{/*className="controlbtn mr10 mt10 pr"*/}
|
||||
{/*size="small"*/}
|
||||
{/*style={{marginTop:'1px'}}*/}
|
||||
{/*onChange={this.onSwitchChange}*/}
|
||||
{/*/>*/}
|
||||
{/*</div>*/}
|
||||
{/*<span className="fl font-16 cdefault" data-tip-down="隐藏我学习的实训">隐藏我的</span>*/}
|
||||
|
||||
</div>
|
||||
<span className="fr color-grey-6 mr30 font-16" id="search_name"></span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ShixunCardList;
|
||||
import React, { Component } from 'react';
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import { BrowserRouter as Router, Route} from "react-router-dom";
|
||||
|
||||
import { Switch ,Input,Tooltip,Icon} from 'antd';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import classNames from 'classnames'
|
||||
|
||||
import 'antd/lib/switch/style/index.css'
|
||||
|
||||
import './shixunCss/ShixunCardList.css';
|
||||
|
||||
import { on, off } from 'educoder'
|
||||
|
||||
const $ = window.$;
|
||||
|
||||
const Search = Input.Search;
|
||||
|
||||
class ShixunCardList extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
allevent:"desc",
|
||||
mine:0,
|
||||
InputValue: props.keyword || "",
|
||||
typemy:0,
|
||||
hots:0,
|
||||
news:0,
|
||||
shixunid:"",
|
||||
upcircle:false,
|
||||
typekeyid:undefined,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate = (prevProps, prevState) => {
|
||||
if (this.props.keyword != prevProps.keyword) {
|
||||
this.setState({
|
||||
InputValue: this.props.keyword
|
||||
})
|
||||
}
|
||||
}
|
||||
componentDidMount = () => {
|
||||
on('searchKeywordChange', (event, data) => {
|
||||
// console.log(data)
|
||||
this.Input_search(data)
|
||||
})
|
||||
}
|
||||
componentWillUnmount = () => {
|
||||
off('searchKeywordChange')
|
||||
}
|
||||
|
||||
|
||||
latestHot=(e,key)=>{
|
||||
|
||||
let{upcircle,typekeyid}=this.state;
|
||||
|
||||
let id = e.target.id;
|
||||
$("#"+id).siblings().removeClass("active");
|
||||
$("#"+id).addClass("active");
|
||||
|
||||
let type;
|
||||
|
||||
// if(id==="all"){
|
||||
// type="publish_time";
|
||||
// }
|
||||
if(id==="hot"){
|
||||
type="hot";
|
||||
}else if(id==="new"){
|
||||
type="new";
|
||||
|
||||
}
|
||||
if(typekeyid===key){
|
||||
if(upcircle===true){
|
||||
this.setState({
|
||||
upcircle:false,
|
||||
})
|
||||
this.props.Shixunsupcircles("desc")
|
||||
}else if(upcircle===false){
|
||||
this.setState({
|
||||
upcircle:true,
|
||||
})
|
||||
this.props.Shixunsupcircles("asc")
|
||||
}
|
||||
}else{
|
||||
this.setState({
|
||||
typekeyid:key
|
||||
})
|
||||
}
|
||||
|
||||
//allevent
|
||||
this.props.ShixunsState(false,type);
|
||||
}
|
||||
|
||||
|
||||
onSwitchChange=(e,key)=>{
|
||||
let id=e.target.id
|
||||
$("#"+id).siblings().removeClass("active");
|
||||
$("#"+id).addClass("active");
|
||||
let {typemy,upcircle,typekeyid}=this.state;
|
||||
|
||||
if(typekeyid===key){
|
||||
if(upcircle===true){
|
||||
this.setState({
|
||||
upcircle:false,
|
||||
})
|
||||
this.props.Shixunsupcircles("desc")
|
||||
}else if(upcircle===false){
|
||||
this.setState({
|
||||
upcircle:true
|
||||
})
|
||||
this.props.Shixunsupcircles("asc")
|
||||
}
|
||||
}else{
|
||||
this.setState({
|
||||
typekeyid:key
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if(typemy===0){
|
||||
this.setState({
|
||||
typemy:1
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
typemy:0
|
||||
})
|
||||
}
|
||||
// allevent
|
||||
this.props.ShixunsSwitch();
|
||||
}
|
||||
//输入框搜索
|
||||
Input_search = (value) => {
|
||||
this.setState({
|
||||
InputValue: value
|
||||
})
|
||||
this.props.OnSearchInput(value,true);
|
||||
}
|
||||
|
||||
Input_searchs = (e) => {
|
||||
this.setState({
|
||||
InputValue: e.target.value
|
||||
})
|
||||
this.props.OnSearchInput(e.target.value,false);
|
||||
}
|
||||
upcircles=(val)=>{
|
||||
if(val==="asc"){
|
||||
this.setState({
|
||||
upcircle:false,
|
||||
})
|
||||
this.props.Shixunsupcircles("desc")
|
||||
}else if(val==="desc"){
|
||||
this.setState({
|
||||
upcircle:true
|
||||
})
|
||||
this.props.Shixunsupcircles("asc")
|
||||
}
|
||||
}
|
||||
render(){
|
||||
let {mine,InputValue,upcircle}=this.state;
|
||||
return (
|
||||
<div className="educontent mt20">
|
||||
<div className="clearfix">
|
||||
|
||||
{/*<div className="fl mr20 font-16 bestChoose shixun_repertoire active"*/}
|
||||
{/*id={"all"}*/}
|
||||
{/*onClick={(e)=>this.latestHot(e,1)}>全部*/}
|
||||
{/*</div>*/}
|
||||
{/*<div className="fl mr20 font-16 bestChoose shixun_repertoire"*/}
|
||||
{/*id={mine}*/}
|
||||
{/*onClick={(e)=>this.onSwitchChange(e,2)}>我的*/}
|
||||
{/*</div>*/}
|
||||
|
||||
<div className="fl mr20 font-16 bestChoose shixun_repertoire active"
|
||||
id="new"
|
||||
onClick={(e)=>this.latestHot(e,4)}>最新
|
||||
</div>
|
||||
|
||||
<div className="fl font-16 bestChoose shixun_repertoire"
|
||||
id="hot"
|
||||
onClick={(e)=>this.latestHot(e,3)}>最热
|
||||
</div>
|
||||
|
||||
|
||||
{/*<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"*/}
|
||||
{/*style={{display:upcircle===true?"block":"none"}}*/}
|
||||
{/*// onClick={()=>this.upcircles("asc")}*/}
|
||||
{/*>*/}
|
||||
{/*<Tooltip placement="bottom" title={"升序"}>*/}
|
||||
{/*<Icon type="up-circle" theme="twoTone" />*/}
|
||||
{/*/!*<Icon type="sort-descending" />*!/*/}
|
||||
{/*</Tooltip>*/}
|
||||
{/*</div>*/}
|
||||
{/*<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"*/}
|
||||
{/*// onClick={()=>this.upcircles("desc")}*/}
|
||||
{/*style={{display:upcircle===true?"none":"block"}}*/}
|
||||
{/*>*/}
|
||||
{/*<Tooltip placement="bottom" title={"降序"}>*/}
|
||||
{/*<Icon type="down-circle" theme="twoTone" />*/}
|
||||
{/*/!*<Icon type="sort-ascending" />*!/*/}
|
||||
{/*</Tooltip>*/}
|
||||
{/*</div>*/}
|
||||
|
||||
{/*<div className="fr mt3">*/}
|
||||
{/*<Search*/}
|
||||
{/*style={{ width: 300 }}*/}
|
||||
{/*className="search-new-input fl"*/}
|
||||
{/*placeholder="请输入创建者/实训/关卡名称进行搜索"*/}
|
||||
{/*value={InputValue}*/}
|
||||
{/*onInput={this.Input_searchs}*/}
|
||||
{/*onSearch={value => this.Input_search(value)}*/}
|
||||
{/*enterButton*/}
|
||||
{/*/>*/}
|
||||
|
||||
{/* <Search
|
||||
style={{ width: 300 }}
|
||||
className="fl"
|
||||
placeholder="请输入创建者/实训/关卡名称进行搜索"
|
||||
value={InputValue}
|
||||
onInput={this.Input_searchs}
|
||||
onSearch={value => this.Input_search(value)}
|
||||
autoComplete="off"
|
||||
></Search> */}
|
||||
{/*</div>*/}
|
||||
{/*<div className="fr">*/}
|
||||
{/*<span className="fl color-grey-6 mr30 font-16 mt5" id="search_name">{*/}
|
||||
{/*this.props.search_tags === null ? "" : this.props.search_tags*/}
|
||||
{/*}</span>*/}
|
||||
{/*<div className="fl mr5" style={{marginTop:'1px'}}>*/}
|
||||
{/*/!* <div className="controlblue"></div>*/}
|
||||
{/*<span className="controlring"></span> *!/*/}
|
||||
{/*<Switch*/}
|
||||
{/*className="controlbtn mr10 mt10 pr"*/}
|
||||
{/*size="small"*/}
|
||||
{/*style={{marginTop:'1px'}}*/}
|
||||
{/*onChange={this.onSwitchChange}*/}
|
||||
{/*/>*/}
|
||||
{/*</div>*/}
|
||||
{/*<span className="fl font-16 cdefault" data-tip-down="隐藏我学习的实训">隐藏我的</span>*/}
|
||||
|
||||
{/*</div>*/}
|
||||
{/*<span className="fr color-grey-6 mr30 font-16" id="search_name"></span>*/}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ShixunCardList;
|
||||
|
Loading…
Reference in new issue