调整试卷和作业设置规则

competitions
杨树明 5 years ago
parent d1b0df49c9
commit bd75a26ed2

@ -1128,7 +1128,9 @@ class CommonWorkSetting extends Component{
{<div className={"publicTimeTip color-red ml30"}>{publicTimeTip}</div>} {<div className={"publicTimeTip color-red ml30"}>{publicTimeTip}</div>}
</React.Fragment> : </React.Fragment> :
adaptered_group_settings && !!adaptered_group_settings.length && <PollDetailTabForthRules adaptered_group_settings && !!adaptered_group_settings.length && <PollDetailTabForthRules
{...this.props}
{...this.state}
ref="pollDetailTabForthRules" ref="pollDetailTabForthRules"
rules={rules} rules={rules}
course_group={adaptered_group_settings} course_group={adaptered_group_settings}

@ -350,6 +350,7 @@ class Exercisesetting extends Component{
this.commitSetting((result)=>{ this.commitSetting((result)=>{
console.log(result)
if(result.status==200){ if(result.status==200){
this.props.showNotification(`${result.data.message}`); this.props.showNotification(`${result.data.message}`);
this.getSettingInfo(); this.getSettingInfo();
@ -369,6 +370,7 @@ class Exercisesetting extends Component{
} }
this.commitSetting((result)=>{ this.commitSetting((result)=>{
console.log(result)
if(result.status==200){ if(result.status==200){
this.props.showNotification(`${result.data.message}`); this.props.showNotification(`${result.data.message}`);
this.cancelEdit(); this.cancelEdit();
@ -702,7 +704,9 @@ class Exercisesetting extends Component{
</div> </div>
: :
<PollDetailTabForthRules <PollDetailTabForthRules
ref="pollDetailTabForthRules" {...this.props}
{...this.state}
ref="pollDetailTabForthRules"
rules={rules} rules={rules}
type={"Exercise"} type={"Exercise"}
course_group={course_group} course_group={course_group}

@ -257,6 +257,15 @@ class Testpapersettinghomepage extends Component{
if(tab[0]==="0"){ if(tab[0]==="0"){
this.child.Teacherliststudentlist(); this.child.Teacherliststudentlist();
} }
if(tab[0]==="1"){
this.child.Teacherliststudentlist();
}
if(tab[0]==="2"){
this.child.Teacherliststudentlist();
}
if(tab[0]==="3"){
this.child.getSettingInfo();
}
}catch (e) { }catch (e) {
} }

@ -49,6 +49,24 @@ class PollDetailIndex extends Component{
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
let{tab}=this.state;
try {
if(tab[0]==="0"){
this.child.Teacherliststudentlist();
}
if(tab[0]==="1"){
this.child.Teacherliststudentlist();
}
if(tab[0]==="2"){
this.child.Teacherliststudentlist();
}
if(tab[0]==="3"){
this.child.getSettingInfo();
}
}catch (e) {
}
} }
componentDidMount(){ componentDidMount(){
@ -110,6 +128,7 @@ class PollDetailIndex extends Component{
DownloadMessageval:undefined DownloadMessageval:undefined
}) })
} }
bindRef = ref => { this.child = ref };
render(){ render(){
let {tab,pollDetail,user_permission,polls_status}=this.state; let {tab,pollDetail,user_permission,polls_status}=this.state;
const { current_user } = this.props; const { current_user } = this.props;
@ -235,7 +254,7 @@ class PollDetailIndex extends Component{
} }
{ {
//设置 //设置
parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth> parseInt(tab[0])==3 && <PollTabForth {...this.props} {...this.state} triggerRef={this.bindRef} user_permission={user_permission} getPollInfo={this.getPollInfo}></PollTabForth>
} }
</div> </div>

@ -90,6 +90,11 @@ class PollDetailTabForth extends Component{
if(this.props.isAdmin() === false){ if(this.props.isAdmin() === false){
this.cancelEdit() this.cancelEdit()
} }
try {
this.props.triggerRef(this);
}catch (e) {
}
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(prevProps.pollDetail!= this.props.pollDetail){ if(prevProps.pollDetail!= this.props.pollDetail){
@ -610,6 +615,8 @@ class PollDetailTabForth extends Component{
</div> </div>
: :
<PollDetailTabForthRules <PollDetailTabForthRules
{...this.props}
{...this.state}
ref="pollDetailTabForthRules" ref="pollDetailTabForthRules"
rules={rules} rules={rules}
course_group={course_group} course_group={course_group}

@ -342,7 +342,7 @@ class PollDetailTabForthRules extends Component{
} }
render(){ render(){
let {rules,course_group,flagPageEdit}=this.state let {rules,course_group,flagPageEdit}=this.state
console.log(rules) let isAdmin=this.props.isAdmin();
return( return(
<div className="bor-top-greyE pt20"> <div className="bor-top-greyE pt20">
<p className="clearfix mb10"> <p className="clearfix mb10">
@ -386,25 +386,30 @@ class PollDetailTabForthRules extends Component{
}` }`
} }
</style> </style>
<Select <Tooltip placement="bottom"
placeholder="请选择分班名称" title={
className={rule.class_flag && rule.class_flag!=""?"noticeTip setInfo":"setInfo" } rule.p_timeflag===undefined?moment(rule.publish_time,dataformat) <= moment()?isAdmin===true?"发布时间已过,不能再修改":"":"": rule.e_timeflag ===undefined?rule.publish_time===null?"":!flagPageEdit:rule.p_timeflag == true ?isAdmin===true?"发布时间已过,不能再修改":"" : ""
mode="multiple" }>
filterOption={(input, option) => <Select
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 placeholder="请选择分班名称"
} className={rule.class_flag && rule.class_flag!=""?"noticeTip setInfo":"setInfo" }
value={rule.course_group_id} mode="multiple"
onChange={(value,option)=>this.changeClasses(value,option,r)} filterOption={(input, option) =>
disabled={ rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.p_timeflag == true ? true : !flagPageEdit} option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
> }
{ value={rule.course_group_id}
courseGroup && courseGroup.length > 0 && courseGroup.map((team,t)=>{ onChange={(value,option)=>this.changeClasses(value,option,r)}
return( disabled={rule.p_timeflag===undefined?moment(rule.publish_time,dataformat) <= moment()?true:!flagPageEdit: rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.p_timeflag == true ? true : !flagPageEdit}
<Option value={team.course_group_id} key={t} style={{display:`${team.course_choosed==0 ? "" : "none"}`}}>{team.course_group_name}</Option> >
) {
}) courseGroup && courseGroup.length > 0 && courseGroup.map((team,t)=>{
} return(
</Select> <Option value={team.course_group_id} key={t} style={{display:`${team.course_choosed==0 ? "" : "none"}`}}>{team.course_group_name}</Option>
)
})
}
</Select>
</Tooltip>
<p className="color-orange-tip lineh-25 clearfix" style={{height:"25px"}}> <p className="color-orange-tip lineh-25 clearfix" style={{height:"25px"}}>
{ {
rule.class_flag && rule.class_flag!=""?<span className="fl color-red">{rule.class_flag}</span>:"" rule.class_flag && rule.class_flag!=""?<span className="fl color-red">{rule.class_flag}</span>:""
@ -413,7 +418,9 @@ class PollDetailTabForthRules extends Component{
</div> </div>
</div> </div>
<div className="fl pr20 with25 yskspickersy"> <div className="fl pr20 with25 yskspickersy">
<Tooltip placement="bottom" title={rule.e_timeflag ? this.props.isAdmin()?"发布时间已过,不能再修改":"":""}> <Tooltip placement="bottom" title={
rule.p_timeflag===undefined?moment(rule.publish_time,dataformat) <= moment()?isAdmin===true?"发布时间已过,不能再修改":"":"": rule.e_timeflag ===undefined?rule.publish_time===null?"":!flagPageEdit:rule.p_timeflag == true ? isAdmin===true?"发布时间已过,不能再修改":"" : ""
}>
<span> <span>
<DatePicker <DatePicker
showToday={false} showToday={false}
@ -427,7 +434,7 @@ class PollDetailTabForthRules extends Component{
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabledDate={disabledDate} disabledDate={disabledDate}
disabled={ rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.p_timeflag == true ? true : !flagPageEdit} disabled={ rule.p_timeflag===undefined?moment(rule.publish_time,dataformat) <= moment()?true:!flagPageEdit: rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.p_timeflag == true ? true : !flagPageEdit}
style={{"height":"42px",width:'100%'}} style={{"height":"42px",width:'100%'}}
></DatePicker> ></DatePicker>
</span> </span>

@ -2261,6 +2261,8 @@ class Trainingjobsetting extends Component {
className="ml40" className="ml40"
> >
<PollDetailTabForthRules <PollDetailTabForthRules
{...this.props}
{...this.state}
rules={rules} rules={rules}
moduleName={"作业"} moduleName={"作业"}
course_group={rulest} course_group={rulest}

@ -913,7 +913,7 @@ submittojoinclass=(value)=>{
strbool=false strbool=false
} }
} }
console.log(item.hidden); // console.log(item.hidden);
return( return(
<li key={key} onClick={()=>this.headtypesonClick(item.link,true)} className={`${headtypes===undefined?'pr':headtypes===item.link?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}> <li key={key} onClick={()=>this.headtypesonClick(item.link,true)} className={`${headtypes===undefined?'pr':headtypes===item.link?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}>
{ {

Loading…
Cancel
Save