Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_local_cqdsj
daiao 5 years ago
commit 9eb1dbe101

@ -46,12 +46,12 @@ class Admins::UserStatisticQuery < ApplicationQuery
finish_challenge = finish_challenge.where(updated_at: time_range)
end
study_myshixun_map = study_myshixun.group(:user_id).count
finish_myshixun_map = finish_myshixun.group(:user_id).count
study_challenge_map = study_challenge.group(:user_id).count
finish_challenge_map = finish_challenge.group(:user_id).count
evaluate_count_map = study_challenge.group(:user_id).sum(:evaluate_count)
cost_time_map = study_challenge.group(:user_id).sum(:cost_time)
study_myshixun_map = study_myshixun.reorder(nil).group(:user_id).count
finish_myshixun_map = finish_myshixun.reorder(nil).group(:user_id).count
study_challenge_map = study_challenge.reorder(nil).group(:user_id).count
finish_challenge_map = finish_challenge.reorder(nil).group(:user_id).count
evaluate_count_map = study_challenge.reorder(nil).group(:user_id).sum(:evaluate_count)
cost_time_map = study_challenge.reorder(nil).group(:user_id).sum(:cost_time)
users.each do |user|
user._extra_data = {

@ -24,4 +24,5 @@ json.course_identity @user_course_identity
json.excellent @course.excellent
if @course.is_end == 0
json.days_remaining (@course.end_date.to_date - Time.now.to_date).to_i
end
end
json.teacher_applies_count CourseMessage.unhandled_join_course_requests_by_course(@course).size if @user_course_identity < Course::ASSISTANT_PROFESSOR

@ -150,16 +150,16 @@ export function initAxiosInterceptors(props) {
throw new axios.Cancel('Operation canceled by the user.');
} else {
// hash跳转
var hash = window.location.hash;
if (hash) {
hashTimeout && window.clearTimeout(hashTimeout)
hashTimeout = setTimeout(() => {
var element = document.querySelector(hash);
if (element) {
element.scrollIntoView();
}
}, 400)
}
// var hash = window.location.hash;
// if (hash) {
// hashTimeout && window.clearTimeout(hashTimeout)
// hashTimeout = setTimeout(() => {
// var element = document.querySelector(hash);
// if (element) {
// element.scrollIntoView();
// }
// }, 400)
// }
}
// if(response.data.status === 401){
// console.log("401401401")

@ -68,7 +68,8 @@ class Registration extends React.Component {
mutiple_limited: false,
teamutiple_limited: false,
members_count: 0,
mode: 0
mode: 0,
region_schools: [],
}
}
@ -82,8 +83,8 @@ class Registration extends React.Component {
// //// //////console.log(this.props.isAdmin())
try {
const {keyword, page, per_page} = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
this.Getdata(keyword, page, per_page, this.props.user.admin);// 获取列表数据
this.GetenrollmentAPI();//获取我的报名配置
} catch (e) {
// const {keyword, page, per_page} = this.state;
// this.Getdata(keyword, page, per_page, this.props.isAdmin());
@ -104,6 +105,8 @@ class Registration extends React.Component {
this.Getdata(keyword, page, per_page, this.props.user.admin);
//取报名配置
this.GetenrollmentAPI();
//取模式
this.Getdataheader();
}
}
@ -116,6 +119,7 @@ class Registration extends React.Component {
if (result.data) {
this.setState({
mode: result.data.mode,
region_schools: result.data.region_schools
})
}
@ -454,6 +458,37 @@ class Registration extends React.Component {
return
}
let {region_schools} = this.state;
//判断是否是否是同一个学校数组元素为0就不用判断
try {
if (region_schools.length > 0) {
let i = 0;
for (var r = 0; r < region_schools.length; r++) {
if (region_schools[r] === this.props.user.user_school) {
// 终止循环
break;
}
i = i + 1;
}
if (i === region_schools.length) {
//如果i 等于region_schools.length说明本次循环中没有相同的学校本人不支持报名
try {
this.props.showNotification(`本竞赛只面向部分学校/单位开放,你暂时没有参赛资格!`);
} catch (e) {
}
this.Getdataheader();
return
}
}
} catch (e) {
}
if (this.props.user.is_teacher === true) {
try {
@ -541,6 +576,34 @@ class Registration extends React.Component {
return
}
let {region_schools} = this.state;
//判断是否是否是同一个学校数组元素为0就不用判断
try {
if (region_schools.length > 0) {
let i = 0;
for (var r = 0; r < region_schools.length; r++) {
if (region_schools[r] === this.props.user.user_school) {
// 终止循环
break;
}
i = i + 1;
}
if (i === region_schools.length) {
//如果i 等于region_schools.length说明本次循环中没有相同的学校本人不支持报名
try {
this.props.showNotification(`本竞赛只面向部分学校/单位开放,你暂时没有参赛资格!`);
} catch (e) {
}
this.Getdataheader();
return
}
}
} catch (e) {
}
if (this.props.user.is_teacher === true) {

@ -124,7 +124,7 @@ class CompetitionsIndex extends Component{
size="large"
dataSource={datas&&datas}
renderItem={(item,key) => (
<a href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null}
<a target="_blank" href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null}
className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}
>
@ -181,7 +181,7 @@ class CompetitionsIndex extends Component{
<List.Item.Meta
title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}>
<a className={"competitionstitles"}
<a target="_blank" className={"competitionstitles"}
href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null}
>{item.name}{item.sub_title===null?"":`——${item.sub_title}`}</a>
{/*<span>{item.sub_title===null?"":*/}

@ -31,6 +31,9 @@ class CompetitionCommon extends Component{
window.document.title = '竞赛';
if(this.props.match.params.identifier!=null){
this.getbannerdata();
// this.setState({
// thiskeys:this.props.location.search.replace('?menu=', '')
// })
// let url=`/competitions/${this.props.match.params.identifier}.json`;
// axios.get(url).then((response) => {
// if(response.status===200){
@ -45,19 +48,34 @@ class CompetitionCommon extends Component{
}
getbannerdata=()=>{
let menuid=this.props.location.search.replace('?menu=', '');
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
data:response.data,
thiskeys:response.data.competition_modules[0].id
data:response.data,
thiskeys:menuid===undefined||menuid===""?response.data.competition_modules[0].id:menuid
})
this.getrightdata(
response.data.competition_modules[0].id,
response.data.competition_modules[0].module_type,
response.data.competition_modules[0].module_url,
response.data.competition_modules[0].has_url
)
if(menuid===undefined||menuid===""){
this.getrightdata(
response.data.competition_modules[0].id,
response.data.competition_modules[0].module_type,
response.data.competition_modules[0].module_url,
response.data.competition_modules[0].has_url
)
}else{
let newlist=response.data.competition_modules;
newlist.map((item,key)=>{
if(`${item.id}`===`${menuid}`){
this.getrightdata(
item.id,
item.module_type,
item.module_url,
item.has_url
)
}
})
}
}
}).catch((error) => {
console.log(error)
@ -83,6 +101,7 @@ class CompetitionCommon extends Component{
getrightdatas=(e)=>{
let keys=parseInt(e.key);
this.getlistdata(keys)
this.props.history.replace(`?menu=${keys}`);
}
getlistdata=(keys,listkey)=>{
@ -109,7 +128,7 @@ class CompetitionCommon extends Component{
if(response.status===200){
this.setState({
chart_rules:response.data,
tabkey:tabkey===undefined?response.data.stages[0].id===null?"0":`${response.data.stages[0].id}`:tabkey
tabkey:tabkey===undefined?response.data.stages[0].id===null?"0":`${response.data.stages[0].id}`:tabkey
})
@ -121,6 +140,7 @@ class CompetitionCommon extends Component{
}
getrightdata=(id,typeid,module_url,has_url,listkey)=>{
// if(typeid==="enroll"){
// this.props.history.replace(`/competitions/${this.props.match.params.identifier}/enroll`);
// return
@ -234,7 +254,7 @@ class CompetitionCommon extends Component{
}
render() {
let {data,has_url,module_type,Competitionedittype,mdContentdata}=this.state;
let {data,thiskeys,Competitionedittype}=this.state;
return (
data===undefined?"":<div className={"educontent clearfix mt20 "}>
@ -327,7 +347,7 @@ class CompetitionCommon extends Component{
<Layout className={'teamsLayout mt40'}>
<Sider>
<Menu mode="inline" className="CompetitionMenu" defaultSelectedKeys={[`${this.state.thiskeys}`]} onClick={(e)=>this.getrightdatas(e)}>
<Menu mode="inline" className="CompetitionMenu" selectedKeys={[`${this.state.thiskeys}`]} onClick={(e)=>this.getrightdatas(e)}>
{data&&data.competition_modules.map((item,key)=>{
if(item.module_type!="enroll"){
return(

@ -9,20 +9,19 @@ class CompetitionContents extends Component{
constructor(props) {
super(props)
this.state={
hash:undefined
}
}
componentDidMount(){
window.document.title = '竞赛';
this.props.MdifHasAnchorJustScorll();
}
render() {
let{mdContentdata}=this.props;
//
let{mdContentdata}=this.props;
//mdhash滚动
this.props.MdifHasAnchorJustScorll();
return (
<div className={"fr"}>

@ -30,6 +30,7 @@ class CompetitionContents extends Component{
}).catch((error) => {
console.log(error)
})
this.props.MdifHasAnchorJustScorll();
}
derivefun=(url)=>{
@ -65,6 +66,7 @@ class CompetitionContents extends Component{
});
}
render() {
this.props.MdifHasAnchorJustScorll();
const operations = <div>
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
<Button className={"fr mr20"} type="primary" ghost>
@ -76,40 +78,40 @@ class CompetitionContents extends Component{
title: 'usersum',
dataIndex: 'usersum',
key: 'name',
render: text => <a className={"color-blue"}>{text}</a>,
render: text => <span className={"color-blue"}>{text}</span>,
},
{
title: 'userimg',
dataIndex: 'userimg',
key: 'userimg',
render: (text, record) =>(
<a href={`/users/${record.user_login}`} className="color-dark">
<span href={`/users/${record.user_login}`} className="color-dark">
<img className={"Competitionuserimg"} src={getImageUrl(`images/${record.userimg===null?`avatars/User/0?1442652658`:record.userimg}`)}/>
</a>),
</span>),
},
{
title: 'username',
dataIndex: 'username',
key: 'username',
render: text => <a title={text}>{text}</a>,
render: text => <span title={text}>{text}</span>,
},
{
title: 'school',
dataIndex: 'school',
key: 'school',
render: text => <a title={text}>{text}</a>,
render: text => <span title={text}>{text}</span>,
},
{
title: 'spendtime',
dataIndex: 'spendtime',
key: 'spendtime',
render: text => <a>{text}</a>,
render: text => <span>{text}</span>,
},
{
title: 'score',
dataIndex: 'score',
key: 'score',
render: text => <a className={"color-blue"}>{text}</a>,
render: text => <span className={"color-blue"}>{text}</span>,
},
];

@ -477,8 +477,9 @@ class CoursesBanner extends Component {
render() {
let { Addcoursestypes, coursedata,excellent, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,is_guide,AccountProfiletype,modalstrsvalue} = this.state;
const isCourseEnd = this.props.isCourseEnd()
document.title=coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":coursedata.name;
const isCourseEnd = this.props.isCourseEnd();
document.title=coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":coursedata.name;
return (
<div>
{/*{*/}
@ -705,18 +706,29 @@ class CoursesBanner extends Component {
`}
</style>
<Breadcrumb separator="|" className={"mt5"}>
<Breadcrumb.Item onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers")} className={"pointer"}>
<span className="color-grey-c font-16"><span className={"mr10"}>教师</span> <span className={"mr10"}>{coursedata.teacher_count}</span></span>
<Breadcrumb.Item className={"pointer"}>
<Tooltip visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false}
placement="topLeft"
title={<pre>{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?<span>您有{coursedata.teacher_applies_count}条新的加入申请<a className={"daishenp"} onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers?tab=2")}>待审批</a></span>:""}</pre>}>
<span className="color-grey-c font-16" onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers")}>
<span className={"mr10"}>教师</span>
<span className={"mr10"}>{coursedata.teacher_count}</span>
</span>
</Tooltip>
</Breadcrumb.Item>
<Breadcrumb.Item
className={excellent===true&&coursedata.course_end === true?this.props.isAdminOrTeacher()===true?"pointer":"":"pointer"}
onClick={excellent===true&&coursedata.course_end === true?this.props.isAdminOrTeacher()===true?()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/students"):"":()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/students")}
>
<span className="color-grey-c font-16"><span className={"mr10 ml10"}>学生</span> <span className={"mr10"}>{coursedata.student_count}</span></span>
</Breadcrumb.Item>
<Breadcrumb.Item>{coursedata.credit===null?"":
<span className="color-grey-c font-16"><span className={"mr10 ml10"}>学分</span> <span className={"mr10"}>{coursedata.credit}</span></span>
}</Breadcrumb.Item>
</Breadcrumb>
{/*<li className={"mt7 teachersbox"} >*/}

@ -391,9 +391,8 @@ class OneSelfOrderModal extends Component{
{this.props.modaltype===undefined||this.props.modaltype===2
|| this.props.usingCheckBeforePost ?"":<div className="clearfix edu-txt-center lineh-40 F4FAFF">
<li style={{ width: '100%',padding: "0px 10px"}} className={"mb10"}>
<span style={{"float":"left","color":"#05101A"}} className="task-hide color-grey-name ml50">分班名称</span>
<span style={{"float":"right","color":"#05101A"}} className="task-hide color-grey-name mr70">截止时间</span>
<span style={{"float":"left","color":"#05101A"}} className="task-hide color-grey-name color-grey-9">分班名称</span>
<span style={{"float":"right","color":"#05101A","margin-right": "145px"}} className="task-hide color-grey-name color-grey-9">截止时间</span>
</li>
</div>}
{this.props.modaltype===undefined||this.props.modaltype===2

@ -1744,4 +1744,9 @@ input.ant-input-number-input:focus {
line-height: 62px;
color: #fff;
margin: 0 auto;
}
.daishenp{
color: #F79946 !important;
text-decoration: underline !important;
}

@ -542,6 +542,7 @@ class Exercise extends Component{
{...this.props}
{...this.state}
style="grey"
single={true}
checkBoxValues={this.state.checkBoxValues}
action={this.reloadList}
></ImmediatelyEnd>

@ -421,8 +421,8 @@ class Testpapersettinghomepage extends Component{
className={"btn fr color-blue font-16 mt20 mr20"}
checkBoxValues={[parseInt(this.props.match.params.Id)]}
Exercisetype={"exercise"}
// single={true}
action={this.Commonheadofthetestpaper}
single={true}
></ImmediatelyEnd>:"":""}
{isAdmin === true?Commonheadofthetestpaper!==undefined&&Commonheadofthetestpaper.user_permission.exercise_unpublish_count>0? <ImmediatelyPublish
{...this.props}

@ -50,10 +50,14 @@ function CourseGroupChooserModal({ course_groups = [], isAdminOrCreator, item, i
application_id: record.application_id,
approval: approval,
group_id: arg_course_groups
})
props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
fetchAll(1)
modalEl.current.setVisible(false)
}).then((result) => {
if (result.data.status === 0) {
props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
fetchAll(1)
modalEl.current.setVisible(false)
window.location.reload();
}})
}
return (
<ModalWrapper

@ -258,7 +258,7 @@ class studentsList extends Component{
// approval 2 - 拒绝
onAgree = (record, approval = 1) => {
const isAdminOrCreator = this.props.isAdminOrCreator()
const { course_groups } = this.state
const { course_groups ,filterKey} = this.state
if (approval == 1 && isAdminOrCreator && course_groups && course_groups.length) {
this.setState({ clickRecord: record}, () => {
this.setGroupChooserModalVisible(true)
@ -280,7 +280,7 @@ class studentsList extends Component{
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification(`${approval == 1? '同意' : '拒绝'}`)
this.fetchAll(1)
this.fetchAll(1,filterKey)
}
})
.catch(function (error) {
@ -299,7 +299,20 @@ class studentsList extends Component{
this.setState({
isSpin:true
})
this.fetchAll(1);
let newmenuid=this.props.location.search.replace('?tab=', '');
if(newmenuid===undefined||newmenuid===""||newmenuid==="1"||newmenuid===1){
this.setState({
filterKey:'1'
})
this.fetchAll(1,'1');
}else{
this.setState({
filterKey:'2'
})
this.fetchAll(1,'2');
}
const isAdminOrTeacher = this.props.isAdminOrTeacher()
const isAdmin = this.props.isAdmin()
@ -319,10 +332,11 @@ class studentsList extends Component{
this.getCourseGroups()
}
addTeacherSuccessListener = (e, data) => {
// const params = JSON.parse(data)
// const coursesId = this.props.match.params.coursesId
if (window.location.pathname.endsWith('teachers')) {
this.fetchAll(1)
this.fetchAll(1,this.state.filterKey)
} else {
// this.props.history.push(`/courses/${coursesId}/teachers`)
}
@ -382,9 +396,11 @@ class studentsList extends Component{
});
}
onChangeRoleSuccess = () => {
this.fetchAll()
this.fetchAll(undefined,this.state.filterKey)
}
fetchAll = async (argPage) => {
fetchAll = async (argPage,filterKey) => {
let { searchValue }=this.state
this.setState({
isSpin:true
})
@ -395,7 +411,7 @@ class studentsList extends Component{
const sortedInfo = this.state.sortedInfo;
let page = argPage || this.state.page
let { searchValue, filterKey }=this.state
let order = 1;
if (sortedInfo.columnKey == 'role') {
order = 1;
@ -463,8 +479,8 @@ class studentsList extends Component{
// join_graduation_group
joinGraduationGroup = (graduation_group_id) => {
const courseId = this.props.match.params.coursesId
const courseId = this.props.match.params.coursesId
let { filterKey }=this.state
let url= `/courses/${courseId}/join_graduation_group.json`;
axios.post(url, {
course_member_list: this.state.checkBoxValues.map (item => { return { course_member_id: item } }),
@ -472,7 +488,7 @@ class studentsList extends Component{
}).then((result)=>{
if(result.data.status==0){
this.props.showNotification('操作成功。')
this.fetchAll()
this.fetchAll(undefined,filterKey)
}
}).catch((error)=>{
console.log(error);
@ -480,6 +496,7 @@ class studentsList extends Component{
}
onInputSearchChange = (e) => {
let {filterKey}=this.state;
this.setState({
searchValue: e.target.value
})
@ -488,12 +505,12 @@ class studentsList extends Component{
clearTimeout(this.timeoutHandler)
}
this.timeoutHandler = setTimeout(() => {
this.fetchAll(1)
this.fetchAll(1,filterKey)
}, 1200)
}
onPressEnter = (e) => {
this.fetchAll(1)
this.fetchAll(1,this.state.filterKey)
}
@ -530,7 +547,7 @@ class studentsList extends Component{
changeRole = (member, role) => {
const courseId = this.props.match.params.coursesId
let {filterKey}=this.state;
let url= `/courses/${courseId}/change_course_teacher.json`;
axios.post(url, {
course_member_id: member.course_member_id
@ -543,7 +560,7 @@ class studentsList extends Component{
}).then((result)=>{
if(result.data.status==0){
this.props.showNotification('操作成功。')
this.fetchAll()
this.fetchAll(undefined,filterKey)
}
}).catch((error)=>{
console.log(error);
@ -559,9 +576,11 @@ class studentsList extends Component{
this.refs.addAdminModal.setVisible(true)
}
changeAdminSuccess = () => {
this.fetchAll()
let {filterKey}=this.state;
this.fetchAll(undefined,filterKey)
}
onDelete = (member) => {
let {filterKey}=this.state;
this.props.confirm({
content: `确认要将“${member.name}”从教师列表中移除吗?`,
onOk: () => {
@ -577,7 +596,7 @@ class studentsList extends Component{
// {"status":1,"message":"删除成功"}
this.props.showNotification('删除成功')
trigger('updatabanner')
this.fetchAll()
this.fetchAll(undefined,filterKey)
}
})
.catch(function (error) {
@ -602,12 +621,13 @@ class studentsList extends Component{
}
onTableChange = (pagination, filters, sorter) => {
let {filterKey}=this.state;
console.log('Various parameters', pagination, filters, sorter);
this.setState({
page: pagination.current,
sortedInfo: sorter,
}, () => {
this.fetchAll()
this.fetchAll(undefined,filterKey)
});
};
clearSelection = () => {
@ -620,7 +640,7 @@ class studentsList extends Component{
page:1,
isSpin:true
}, () => {
this.fetchAll();
this.fetchAll(undefined,e.key);
})
}
setGroupChooserModalVisible = (visible) => {
@ -654,7 +674,9 @@ class studentsList extends Component{
const isSuperAdmin = this.props.isSuperAdmin()
const hasGraduationModule = this.hasGraduationModule()
const coursesId = this.props.match.params.coursesId
return(
<React.Fragment>
{/* <AddTeacherModal ref="addTeacherModal"
@ -693,7 +715,7 @@ class studentsList extends Component{
}
secondRowLeft={
isAdminOrTeacher ? <div className="fl mt6 task_menu_ul " style={{ width: '600px' }}>
<Menu mode="horizontal" defaultSelectedKeys="1" onClick={this.selectedStatus}>
<Menu mode="horizontal" selectedKeys={[`${this.state.filterKey}`]} onClick={this.selectedStatus}>
<Menu.Item key="1">已审批({total_count})</Menu.Item>
<Menu.Item key="2">待审批({apply_size})</Menu.Item>
</Menu>
@ -740,9 +762,11 @@ class studentsList extends Component{
<div className="mt20 edu-back-white padding20 teacherList">
{ course_groups && !!course_groups.length && <CourseGroupChooserModal
{...this.state}
{...this.props}
props={{match: this.props.match, showNotification: this.props.showNotification}}
record={this.state.clickRecord}
fetchAll={this.fetchAll}
fetchAll={(e)=>this.fetchAll(e,this.state.filterKey)}
course_groups={course_groups}
visible={this.state.groupChooserModalVisible}
setVisible={this.setGroupChooserModalVisible}

@ -563,6 +563,7 @@ class Poll extends Component{
{...this.props}
{...this.state}
style="grey"
single={true}
checkBoxValues={this.state.checkBoxValues}
action={this.successFun}
></ImmediatelyEnd>

@ -202,7 +202,7 @@ class PollDetailIndex extends Component{
className={"font-16"}
checkBoxValues={[this.props.match.params.pollId]}
action={this.getPollInfo}
single={true}
// single={true}
></ImmediatelyEnd>
</li>
:""

@ -14,6 +14,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
imageSrc: ''
}
}
onDelegateClick = (event) => {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
@ -35,6 +36,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
return false;
}
}
// jQuery._data( $('.newMain')[0], "events" )
componentDidMount() {
this.props.wrappedComponentRef && this.props.wrappedComponentRef(this.refs['wrappedComponentRef'])
@ -45,6 +47,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
.delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", this.onDelegateClick);
}, 1200)
}
componentWillUnmount() {
$(options.parentSelector || ".commentsDelegateParent", 'click', this.onDelegateClick)
}
@ -55,9 +58,24 @@ export function ImageLayerOfCommentHOC(options = {}) {
imageSrc: '',
})
}
MdifHasAnchorJustScorll=()=>{
//mdhash滚动
let anchor = decodeURI(this.props.location.hash).replace('#', '');
// 对应id的话, 滚动到相应位置
if (!!anchor) {
let anchorElement = document.getElementsByName(anchor);
if (anchorElement) {
if (anchorElement.length!=0) {
anchorElement[anchorElement.length-1].scrollIntoView();
}
}
}
}
render() {
this.MdifHasAnchorJustScorll();
return (
<React.Fragment>
<ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer>

@ -609,6 +609,21 @@ export function TPMIndexHOC(WrappedComponent) {
hideGlobalLoading = () => {
this.setState({ globalLoading: false })
}
MdifHasAnchorJustScorll=()=>{
//mdhash滚动
let anchor = decodeURI(this.props.location.hash).replace('#', '');
// 对应id的话, 滚动到相应位置
if (!!anchor) {
let anchorElement = document.getElementsByName(anchor);
if (anchorElement) {
if (anchorElement.length>0){
anchorElement[anchorElement.length-1].scrollIntoView();
}
}
}
}
render() {
let{Headertop,Footerdown, isRender, AccountProfiletype,mygetHelmetapi}=this.state;
const common = {
@ -643,6 +658,7 @@ export function TPMIndexHOC(WrappedComponent) {
hideGlobalLoading: this.hideGlobalLoading,
yslslowCheckresults:this.yslslowCheckresults,
yslslowCheckresultsNo:this.yslslowCheckresultsNo,
MdifHasAnchorJustScorll:this.MdifHasAnchorJustScorll
};
// console.log("this.props.mygetHelmetapi");

Loading…
Cancel
Save