各模块需要增加鼠标中键点击事件

issues25489
杨树林 6 years ago
parent 27d6c42deb
commit b1338af040

@ -369,7 +369,9 @@ function buildColumns(that, student_works, studentData) {
</Tooltip> } </Tooltip> }
{/* toWorkDetailPage */} {/* toWorkDetailPage */}
{/* /courses/"+courseId+"/common_homeworks/"+workId+ '/' + record.id +"/appraise */} {/* /courses/"+courseId+"/common_homeworks/"+workId+ '/' + record.id +"/appraise */}
<a style={{color:'#4CACFF', marginLeft: '4px'}} href={"javascript:void(0)"} onClick={() => that.props.toWorkDetailPage(courseId, workId, record.id)} >{ isAdmin ? '评阅': '查看'}</a> <a style={{color: '#4CACFF', marginLeft: '4px'}} href={"javascript:void(0)"}
onMouseDown={(e, courseId, workId, record) => that.props.toWorkDetailPage2(e, courseId, workId, record.id)}
onClick={() => that.props.toWorkDetailPage(courseId, workId, record.id)}>{isAdmin ? '评阅' : '查看'}</a>
</div> </div>

@ -20,7 +20,7 @@ export function RouteHOC(options = {}) {
toCreateProject = () => { toCreateProject = () => {
let url = '/projects/new' let url = '/projects/new'
if (window.location.port == 3007) { if (window.location.port == 3007) {
// window.location.href // window.location.href
url = '/testbdweb.educoder.net/projects/new' url = '/testbdweb.educoder.net/projects/new'
} }
window.open( window.open(
@ -56,7 +56,7 @@ export function RouteHOC(options = {}) {
this.props.history.push(`/courses/${_courseId}/boards/${workId}/messages/${topicId}`) this.props.history.push(`/courses/${_courseId}/boards/${workId}/messages/${topicId}`)
} }
} }
toEditPage = (_courseId, _workId) => { toEditPage = (_courseId, _workId) => {
const secondName = this.getModuleName() const secondName = this.getModuleName()
if (typeof _courseId == "object") { if (typeof _courseId == "object") {
@ -78,6 +78,17 @@ export function RouteHOC(options = {}) {
window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`); window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
} }
} }
toWorkDetailPage2 = (e, _courseId, _workId, _studentWorkId) => {
const secondName = this.getModuleName()
if (typeof _courseId == "object") {
const workId = _courseId.workId
const courseId = _courseId.coursesId
const studentWorkId = _courseId.studentWorkId
window.open(`/courses/${courseId}/${secondName}/${_workId || workId}/${_studentWorkId || studentWorkId}/appraise`);
} else {
window.open(`/courses/${_courseId}/${secondName}/${_workId}/${_studentWorkId}/appraise`);
}
}
toNewPage = (courseId) => { toNewPage = (courseId) => {
const secondName = this.getModuleName() const secondName = this.getModuleName()
this.props.history.push(`/courses/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`) this.props.history.push(`/courses/${courseId.coursesId}/${secondName}/${courseId.category_id}/new`)
@ -126,7 +137,7 @@ export function RouteHOC(options = {}) {
} }
} }
toWorkQuestionPage = (_courseId, _workId) => { toWorkQuestionPage = (_courseId, _workId) => {
const secondName = this.getModuleName() const secondName = this.getModuleName()
if (typeof _courseId == "object") { if (typeof _courseId == "object") {
const workId = _workId || _courseId.workId const workId = _workId || _courseId.workId
@ -149,33 +160,32 @@ export function RouteHOC(options = {}) {
} }
render() {
render() {
const { snackbarOpen} = this.state; const { snackbarOpen} = this.state;
return ( return (
<React.Fragment> <React.Fragment>
<WrappedComponent {...this.props} <WrappedComponent {...this.props}
toDetailPage={this.toDetailPage} toDetailPage={this.toDetailPage}
toEditPage={this.toEditPage} toEditPage={this.toEditPage}
toNewPage={this.toNewPage} toNewPage={this.toNewPage}
toListPage={this.toListPage} toListPage={this.toListPage}
toWorkDetailPage={this.toWorkDetailPage} toWorkDetailPage={this.toWorkDetailPage}
toWorkPostPage={this.toWorkPostPage} toWorkPostPage={this.toWorkPostPage}
toWorkListPage={this.toWorkListPage} toWorkListPage={this.toWorkListPage}
toWorkAnswerPage={this.toWorkAnswerPage} toWorkAnswerPage={this.toWorkAnswerPage}
toWorkQuestionPage={this.toWorkQuestionPage} toWorkQuestionPage={this.toWorkQuestionPage}
toWorkSettingPage={this.toWorkSettingPage} toWorkSettingPage={this.toWorkSettingPage}
toCreateProject={this.toCreateProject} toCreateProject={this.toCreateProject}
isGroup={this.isGroup} isGroup={this.isGroup}
getModuleName={this.getModuleName} getModuleName={this.getModuleName}
getModuleType={this.getModuleType} getModuleType={this.getModuleType}
> >
</WrappedComponent> </WrappedComponent>
</React.Fragment> </React.Fragment>
) )
} }

Loading…
Cancel
Save