From 6f2fe96e9046d3a5fe0c7785a5f0cc2615f12e9b Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 23 Aug 2019 11:17:36 +0800 Subject: [PATCH] issue --- .../busyWork/common/WorkDetailPageHeader.js | 11 +- .../src/modules/courses/exercise/Exercise.js | 2 +- .../courses/exercise/ExerciseListItem.js | 20 +- public/react/src/modules/courses/poll/Poll.js | 2 +- .../src/modules/courses/poll/PollListItem.js | 6 +- .../shixunHomework/ShixunhomeWorkItem.js | 177 +++++++++--------- .../courses/shixunHomework/shixunHomework.js | 3 +- 7 files changed, 109 insertions(+), 112 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js index a092c5066..4177be8a4 100644 --- a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js +++ b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js @@ -85,8 +85,7 @@ class WorkDetailPageHeader extends Component{ background: #fff; } .workDetailPageHeader .summaryname { - line-height: 20px; - margin-top: 13px; + line-height:30px } `} -
- +
+ {homework_name} {/* {homework_name} */} - {category && 返回} + {category && 返回} {this.props.update_atta && diff --git a/public/react/src/modules/courses/exercise/Exercise.js b/public/react/src/modules/courses/exercise/Exercise.js index 4331bdc6f..044dc87f0 100644 --- a/public/react/src/modules/courses/exercise/Exercise.js +++ b/public/react/src/modules/courses/exercise/Exercise.js @@ -559,7 +559,7 @@ class Exercise extends Component{ {...this.props} {...this.state} item={item} - key={key} + index={key} checkBox={ this.onItemClick(item)} >} diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 639f5bdc8..5248f4c1a 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -52,17 +52,17 @@ class ExerciseListItem extends Component{ }) } render(){ - let{item,checkBox,key}=this.props; + let{item,checkBox,index}=this.props; let {coursesId,Id}=this.props.match.params const IsAdmin =this.props.isAdmin(); const IsStudent =this.props.isStudent(); // console.log(this.props.current_user.user_id) return( -
window.$(`.exerciseitem${key} input`).click() }> +
window.$(`.exerciseitem${index} input`).click() }> { IsAdmin && - + {checkBox} } @@ -96,20 +96,20 @@ class ExerciseListItem extends Component{ {/*{item.exercise_name}*/} { - this.props.isAdmin()? {item.exercise_name}:"" + to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}:"" } { this.props.isStudent()? - {item.exercise_name}:"" + {item.exercise_name}:"" } { this.props.isNotMember()? item.lock_status === 0 ? {item.exercise_name} - : {item.exercise_name}:"" + : {item.exercise_name}:"" } { @@ -165,8 +165,8 @@ class ExerciseListItem extends Component{ { IsAdmin &&
- 编辑 - 设置 + 编辑 + 设置
}

@@ -193,7 +193,7 @@ class ExerciseListItem extends Component{
{item.current_status ===0&&item.exercise_status>1?
  • 继续答题
  • : item.current_status ===1&&item.exercise_status>1?
  • 查看答题
  • : - item.current_status ===2&&item.exercise_status>1?
  • this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题
  • :""} + item.current_status ===2&&item.exercise_status>1?
  • this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题
  • :""}
    }
    diff --git a/public/react/src/modules/courses/poll/Poll.js b/public/react/src/modules/courses/poll/Poll.js index 9574f2492..b064c289b 100644 --- a/public/react/src/modules/courses/poll/Poll.js +++ b/public/react/src/modules/courses/poll/Poll.js @@ -596,7 +596,7 @@ class Poll extends Component{ {...this.state} courseType={course_types} item={item} - key={key} + index={key} checkBox={ this.onItemClick(item)}>} > ) diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js index 368fda32b..c4f1c8209 100644 --- a/public/react/src/modules/courses/poll/PollListItem.js +++ b/public/react/src/modules/courses/poll/PollListItem.js @@ -16,7 +16,7 @@ class PollListItem extends Component{ super(props); } render(){ - let{item,checkBox,courseType,key}=this.props; + let{item,checkBox,courseType,index}=this.props; let {coursesId}=this.props.match.params; const IsAdmin =this.props.isAdmin(); @@ -28,10 +28,10 @@ class PollListItem extends Component{ let canNotLink = !isAdminOrStudent && item.lock_status == 0 return( -
    window.$(`.pollitem${key} input`).click() }> +
    window.$(`.pollitem${index} input`).click() }> { IsAdmin && - + {checkBox} } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index 38ab63a4f..942c06800 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -124,13 +124,19 @@ class ShixunhomeWorkItem extends Component{ }) } - editname = (name,id) => { + // 实训详情,阻止冒泡 + stopPro = (event) => { + event.stopPropagation() + } + + editname = (name,id,event) => { this.setState({ ModalsRenametype:true, NavmodalValue:name, Navmodalname:"重命名", url:`/homework_commons/${id}/alter_name.json` }) + event.stopPropagation() } cannerNavmoda=()=>{ this.setState({ @@ -157,88 +163,74 @@ class ShixunhomeWorkItem extends Component{ const { checkBox, discussMessage, - taskid, + taskid,index } = this.props; - // - - // allow_late: true //是否开启补交 - - // homework_id: 9250 - - // shixun_identifier: "25ykhpvl" - - // - // console.log("this.props.isAdmin"); - - return( -
    - {this.state.ModalsRenametype===true? - this.cannerNavmoda()} - /> - :""} - - - - {visible===true?:""} - - - -
    -

    实训已经更新了,正在为您重置!

    -
    - -
    - -
    -

    本实训的开启时间:{shixunsmessage}
    开启时间之前不能挑战 -

    -
    -
    - {/*取消*/} - 知道啦 -
    - {/*

    */} - {/*知道了*/} - {/*

    */} -
    - + + { + this.state.ModalsRenametype===true? + this.cannerNavmoda()} + /> + :""} + + {visible===true?:""} + +
    +

    实训已经更新了,正在为您重置!

    +
    + +
    + + +
    +

    本实训的开启时间:{shixunsmessage}
    开启时间之前不能挑战 +

    +
    +
    + {/*取消*/} + 知道啦 +
    + {/*

    */} + {/*知道了*/} + {/*

    */} +
    +
    window.$(`.shixunitem${index} input`).click() } > - {this.props.isAdmin?checkBox:""} + {this.props.isAdmin? + {checkBox} + : + "" + }
    - {this.props.isAdmin?
    - 实训详情 - {this.props.isAdminOrCreator()?this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名:""} + {this.props.isAdmin?
    this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}> + 实训详情 + {this.props.isAdminOrCreator()?this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16"}>重命名:""} {/* 设置*/} 设置
    :""} @@ -408,6 +404,7 @@ class ShixunhomeWorkItem extends Component{
    + ) } } diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index d84453fc8..cdbac6760 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1163,8 +1163,9 @@ class ShixunHomework extends Component{ isStudent={this.props.isStudent()} isNotMember={this.props.isNotMember()} isClassManagement={this.props.isClassManagement()} - checkBox={this.props.isAdmin()?:""} + checkBox={this.props.isAdmin()?:""} match={this.props.match} + index={index} coursedata={this.props.coursedata} coursupdata={()=>this.homeworkupdatalist(Coursename,page,order)} course_identity={datas.course_identity}