diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 8c6f3be0b..ece36b61c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -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") diff --git a/public/react/src/modules/competition/Registration.js b/public/react/src/modules/competition/Registration.js index 3517236bf..c7cc102a4 100644 --- a/public/react/src/modules/competition/Registration.js +++ b/public/react/src/modules/competition/Registration.js @@ -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) { diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js index ca99fde8e..df21e4872 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js @@ -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 (
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js index 57db59c1b..f4c3a94d5 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js @@ -76,40 +76,40 @@ class CompetitionContents extends Component{ title: 'usersum', dataIndex: 'usersum', key: 'name', - render: text => {text}, + render: text => {text}, }, { title: 'userimg', dataIndex: 'userimg', key: 'userimg', render: (text, record) =>( - + - ), + ), }, { title: 'username', dataIndex: 'username', key: 'username', - render: text => {text}, + render: text => {text}, }, { title: 'school', dataIndex: 'school', key: 'school', - render: text => {text}, + render: text => {text}, }, { title: 'spendtime', dataIndex: 'spendtime', key: 'spendtime', - render: text => {text}, + render: text => {text}, }, { title: 'score', dataIndex: 'score', key: 'score', - render: text => {text}, + render: text => {text}, }, ]; diff --git a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js index 4261a4937..e42ce3df3 100644 --- a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js +++ b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js @@ -391,9 +391,8 @@ class OneSelfOrderModal extends Component{ {this.props.modaltype===undefined||this.props.modaltype===2 || this.props.usingCheckBeforePost ?"":
  • - 分班名称 - - 截止时间 + 分班名称 + 截止时间
  • } {this.props.modaltype===undefined||this.props.modaltype===2 diff --git a/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js b/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js index d19aa03ec..7c10b90d7 100644 --- a/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js +++ b/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js @@ -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[0].scrollIntoView(); + } + } + } + } + + render() { - + this.MdifHasAnchorJustScorll(); return ( diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index ee42ace21..77f04c0be 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -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[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");