Merge branch 'dev_hjm_groupwork_leader' into dev_hjm_826_2

dev_unstable
hjm 5 years ago
commit 8c1ef85cf3

@ -15,7 +15,7 @@ import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply' import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply'
import Example from './TestHooks' import Example from './TestHooks'
import CommonWorkAppraiseReviseAttachments from './CommonWorkAppraiseReviseAttachments' import CommonWorkAppraiseReviseAttachments from './CommonWorkAppraiseReviseAttachments'
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select; const { Option} = Select;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -88,6 +88,14 @@ class CommonWorkAppraise extends Component{
console.log(error) console.log(error)
}) })
} }
componentDidUpdate(prevProps, prevState) {
if (this.props.match.params.studentWorkId != prevProps.match.params.studentWorkId) {
this.getWork();
this.getReviseAttachments()
this.commonWorkAppraiseReply && this.commonWorkAppraiseReply.fetchAllComments()
}
}
componentDidMount() { componentDidMount() {
this.getWork(); this.getWork();
this.getReviseAttachments() this.getReviseAttachments()
@ -156,12 +164,13 @@ class CommonWorkAppraise extends Component{
attachments, homework_id, project_info, work_members, is_evaluation, attachments, homework_id, project_info, work_members, is_evaluation,
description, update_user_name, update_time, commit_time, author_name, description, update_user_name, update_time, commit_time, author_name,
revise_attachments, revise_reason, atta_update_user, atta_update_time, atta_update_user_login, revise_attachments, revise_reason, atta_update_user, atta_update_time, atta_update_user_login,
Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype Modalstype,Modalstopval,ModalCancel,ModalSave,loadtype, is_leader_work
} =this.state; } =this.state;
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id; let category_id=this.props.match.params.category_id;
let studentWorkId=this.props.match.params.studentWorkId; let studentWorkId=this.props.match.params.studentWorkId;
const isAdmin = this.props.isAdmin()
return( return(
<WorkDetailPageHeader <WorkDetailPageHeader
{...this.props} {...this.state} {...this.props} {...this.state}
@ -251,12 +260,27 @@ class CommonWorkAppraise extends Component{
{is_evaluation != true && work_members && !!work_members.length && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}> {is_evaluation != true && work_members && !!work_members.length && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}>
<div className={"color-grey-6 mb10"}> <div className={"color-grey-6 mb10"}>
其他组员 全部组员
</div> </div>
<div className={"ml20"}> <div className={"ml20 color-grey-6"}>
{work_members.map((item, index) => { <div className="">
return item.user_name + ' ' 当前组员{author_name} {is_leader_work && <LeaderIcon small={true} ></LeaderIcon>}
})} </div>
<div>
其他组员
{work_members.map((item, index) => {
return <React.Fragment>
isAdmin ?
<a className={`color-blue ${index == 0 ? '' : 'ml10'}`} href="javascript:void(0)"
onClick={() => this.props.toWorkDetailPage(this.props.match.params, null, item.work_id)}
>
{item.user_name}
</a> : <span className={`${index == 0 ? '' : 'ml10'}`} >{item.user_name}</span>
{item.is_leader && <LeaderIcon small={true} ></LeaderIcon>}
</React.Fragment>
})}
</div>
</div> </div>
</div> </div>
} }
@ -266,6 +290,7 @@ class CommonWorkAppraise extends Component{
{/* task_type={datalist&&datalist.task_type} */} {/* task_type={datalist&&datalist.task_type} */}
<CommonWorkAppraiseReply {...this.props} task_id={studentWorkId} <CommonWorkAppraiseReply {...this.props} task_id={studentWorkId}
onReplySuccess={this.onReplySuccess} {...this.state} onReplySuccess={this.onReplySuccess} {...this.state}
wrappedComponentRef={(ref) => {this.commonWorkAppraiseReply = ref}}
></CommonWorkAppraiseReply> ></CommonWorkAppraiseReply>
</div> </div>

@ -15,7 +15,7 @@ import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import PublishRightnow from './PublishRightnow' import PublishRightnow from './PublishRightnow'
import ModulationModal from "../coursesPublic/ModulationModal"; import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal"; import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
const { Option} = Select; const { Option} = Select;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -97,7 +97,12 @@ function buildColumns(that, student_works, studentData) {
}} title={text && text.length > 5 ? text : ''}> }} title={text && text.length > 5 ? text : ''}>
{/* <Tooltip placement="bottom" title={text}> {/* <Tooltip placement="bottom" title={text}>
</Tooltip> */} </Tooltip> */}
{text} {record.is_leader ?
<div style={{ display: 'flex', 'flex-direction': 'column', 'align-items': 'center'}}>
<div >{text}</div>
<LeaderIcon></LeaderIcon>
</div>
: <React.Fragment>{text}</React.Fragment>}
</div> </div>
), ),
}] }]

@ -0,0 +1,19 @@
import React,{Component} from "React";
export default function LeaderIcon(props = {}) {
let icon = null;
if (props.small) {
icon = <div className="font-8 blueFull Actionbtn" style={{
height: '14px',
'line-height': '14px',
width: '24px',
padding: 0,
'margin-top': '-2px',
'margin-left': '2px',
'vertical-align': 'middle', }}>组长</div>
} else {
icon = <div className="font-8 blueFull Actionbtn" style={{ height: '16px', 'line-height': '16px', width: '30px'}}>组长</div>
}
return icon
}

@ -37,6 +37,8 @@ export function ImageLayerOfCommentHOC(options = {}) {
} }
// jQuery._data( $('.newMain')[0], "events" ) // jQuery._data( $('.newMain')[0], "events" )
componentDidMount() { componentDidMount() {
this.props.wrappedComponentRef && this.props.wrappedComponentRef(this.refs['wrappedComponentRef'])
// commentsDelegateParent #game_left_contents #tab_con_4 // commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => { setTimeout(() => {
$(options.parentSelector || ".commentsDelegateParent") $(options.parentSelector || ".commentsDelegateParent")
@ -60,7 +62,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
<React.Fragment> <React.Fragment>
<ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer> <ImageLayer {...this.state} onImageLayerClose={this.onImageLayerClose}></ImageLayer>
<WrappedComponent {...this.props} > <WrappedComponent {...this.props} ref="wrappedComponentRef">
</WrappedComponent> </WrappedComponent>
</React.Fragment> </React.Fragment>
) )

Loading…
Cancel
Save