Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

competitions
杨树林 5 years ago
commit 84415f32d2

@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
let debugType ="" let debugType =""
if (isDev) { // if (isDev) {
const _search = window.location.search; // const _search = window.location.search;
let parsed = {}; // let parsed = {};
if (_search) { // if (_search) {
parsed = queryString.parse(_search); // parsed = queryString.parse(_search);
} // }
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : // debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' : // window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' // window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
} // }
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
initOnlineOfflineListener() initOnlineOfflineListener()

@ -528,20 +528,31 @@ class Coursesleftnav extends Component{
axios.post(url, axios.post(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result.data.status===0){ if(result!=undefined){
// window.location.reload() if(result.data.status===0){
this.updasaveNavmoda() // window.location.reload()
// this.updasaveNavmoda()
notification.open({ //
message:"提示", notification.open({
description:result.data.message message:"提示",
}); description:result.data.message
trigger('updateNavSuccess') });
if(positiontype==="files"){ trigger('updateNavSuccess')
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
// this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`) if(positiontype==="files"){
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
}
if(positiontype==="boards"){
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`;
}
if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
}
}
} }
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
@ -549,17 +560,19 @@ class Coursesleftnav extends Component{
saveboardpost=(url,value)=>{ saveboardpost=(url,value)=>{
axios.put(url, axios.put(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result.data.status===0){ if(result!=undefined){
// window.location.reload() if(result.data.status===0){
this.updasaveNavmoda() // window.location.reload()
trigger('updateNavSuccess') this.updasaveNavmoda()
trigger('updateNavSuccess')
//
notification.open({ //
message:"提示", notification.open({
description:result.data.message message:"提示",
}); description:result.data.message
} });
}
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
@ -599,7 +612,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId; let newid=this.props.match.params.coursesId;
let url="/courses/"+newid+"/course_groups.json"; let url="/courses/"+newid+"/course_groups.json";
this.saveNavmodapost(url,NavmodalValue) this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===3){ }else if(Navmodaltypename===3){
@ -620,7 +633,7 @@ class Coursesleftnav extends Component{
let newid=this.props.match.params.coursesId; let newid=this.props.match.params.coursesId;
let url = "/courses/"+newid+"/boards.json"; let url = "/courses/"+newid+"/boards.json";
this.saveNavmodapost(url,NavmodalValue) this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
}else if(Navmodaltypename===7) { }else if(Navmodaltypename===7) {
@ -708,13 +721,15 @@ class Coursesleftnav extends Component{
droppablepost=(url,list)=>{ droppablepost=(url,list)=>{
axios.post(url,{position: list}).then((result)=>{ axios.post(url,{position: list}).then((result)=>{
// this.updasaveNavmoda(result.data.message) if(result!=undefined){
this.updasaveNavmoda() // this.updasaveNavmoda(result.data.message)
// this.updasaveNavmoda()
notification.open({ //
message:"提示", notification.open({
description:result.data.message message:"提示",
}); description:result.data.message
});
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })

@ -45,6 +45,12 @@ class Selectsetting extends Component{
componentDidMount() { componentDidMount() {
this.getalldata();
}
getalldata=()=>{
let {discussMessageid} =this.props; let {discussMessageid} =this.props;
let course_id=this.props.course_id; let course_id=this.props.course_id;
let url="/files/"+discussMessageid+".json"; let url="/files/"+discussMessageid+".json";
@ -70,19 +76,10 @@ class Selectsetting extends Component{
console.log(error); console.log(error);
}); });
}
getalldata=()=>{
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if ( prevProps.visible != this.props.visible ) { if ( prevProps.visible != this.props.visible ) {
console.log(prevProps)
console.log(this.props)
this.setState({ this.setState({
visible:this.props.visible visible:this.props.visible
}) })
@ -105,7 +102,6 @@ class Selectsetting extends Component{
ModalSave:this.hidecouseShixunModal, ModalSave:this.hidecouseShixunModal,
loadtype:false loadtype:false
}) })
this.props.Cancel()
} }
savecouseShixunModal=()=>{ savecouseShixunModal=()=>{
@ -152,9 +148,10 @@ class Selectsetting extends Component{
delay_publish:Radiovalue delay_publish:Radiovalue
}).then((result)=>{ }).then((result)=>{
if(result.data.status===0){ if(result.data.status===0){
this.hidecouseShixunModal()
this.props.setupdate(attachmentId) this.props.setupdate(attachmentId)
this.props.showNotification("设置资源成功"); this.props.showNotification("设置资源成功");
this.hidecouseShixunModal() this.props.Cancel()
} }
}) })
@ -233,6 +230,35 @@ class Selectsetting extends Component{
Radiovalue: e.target.value, Radiovalue: e.target.value,
}); });
} }
delectfils=(id)=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确定删除该历史资源?",
ModalSave:()=>this.delectcousedelectfils(id),
ModalCancel:this.hidecouseShixunModal,
loadtype:false
})
}
delectcousedelectfils=(id)=>{
const url = `/attachments/${id}.json`;
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
// {"status":1,"message":"删除成功"}
this.props.showNotification(response.data.message);
this.getalldata
this.hidecouseShixunModal
}else{
this.props.showNotification(response.data.message);
}
})
.catch(function (error) {
console.log(error);
});
}
render(){ render(){
let {datatime,description,datalist}=this.state; let {datatime,description,datalist}=this.state;
@ -256,7 +282,7 @@ class Selectsetting extends Component{
lineHeight: '30px', lineHeight: '30px',
}; };
console.log(this.state.Radiovalue)
return( return(
<div> <div>
<style> <style>
@ -329,7 +355,7 @@ class Selectsetting extends Component{
height: 37px; height: 37px;
} }
.isabox{ .isabox{
max-width: 173px; max-width:280px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
@ -343,7 +369,7 @@ class Selectsetting extends Component{
`}</style> `}</style>
<div className="pl20 pr20 settingbox"> <div className="pl20 pr20 settingbox">
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE"> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl" style={{width: '350px'}}> <li className="fl" style={{width: '343px'}}>
<span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span> <span className={"isabox"} title={datalist&&datalist.title}> {datalist&&datalist.title} </span>
{datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>} {datalist&&datalist.attachment_histories.length===0?"":<span className={"newcolor-orange fl"}>当前版本</span>}
</li> </li>
@ -358,7 +384,7 @@ class Selectsetting extends Component{
{datalist&&datalist.attachment_histories.map((item,key)=>{ {datalist&&datalist.attachment_histories.map((item,key)=>{
return( return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}> <div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl" style={{width: '350px'}}> <li className="fl" style={{width: '343px'}}>
<span className={"isabox"} title={item.title}> {item.title} </span> <span className={"isabox"} title={item.title}> {item.title} </span>
{/*<span className={"newcolor-orange fl"}>当前版本</span>*/} {/*<span className={"newcolor-orange fl"}>当前版本</span>*/}
</li> </li>
@ -368,6 +394,7 @@ class Selectsetting extends Component{
<li className="fl paddingl10 datastyle"> <li className="fl paddingl10 datastyle">
{moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')} {moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
</li> </li>
<a className="fr" onClick={()=>this.delectfils(item.id)}><i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i></a>
</div> </div>
) )
})} })}
@ -537,7 +564,7 @@ class Selectsetting extends Component{
</div> </div>
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={()=>this.props.Cancel()}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>
</div> </div>
</div> </div>

@ -19,7 +19,7 @@ class Exercisestatisticalresult extends Component {
super(props); super(props);
this.state = { this.state = {
data:undefined, data:undefined,
sort:"percent", sort:"asc",
exercise_group_id:[], exercise_group_id:[],
page:1, page:1,
limit:10, limit:10,
@ -60,24 +60,28 @@ class Exercisestatisticalresult extends Component {
limit:limit limit:limit
} }
}).then((result) => { }).then((result) => {
// console.log(result)
this.setState({ this.setState({
data:result.data data:result.data
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
onSortTypeChange=(value)=>{ onSortTypeChange=()=>{
let{exercise_group_id,page,limit}=this.state; let{exercise_group_id,page,limit,sort}=this.state;
let newdesc="asc";
if(sort==="desc"){
newdesc="asc"
}else{
newdesc="desc"
}
this.setState({ this.setState({
sort:value sort:newdesc
}) })
this.updatefun(value,exercise_group_id,page,limit)
this.updatefun(newdesc,exercise_group_id,page,limit)
} }
funtaskstatustwo=(checkedValues,list)=>{ funtaskstatustwo=(checkedValues,list)=>{
@ -172,17 +176,29 @@ class Exercisestatisticalresult extends Component {
.mr33{ .mr33{
margin-right: 33px; margin-right: 33px;
} }
.fiilssort{
position: absolute;
top: -9px;
}
`} `}
</style> </style>
<div className="stud-class-set fafafa"> <div className="stud-class-set fafafa">
<li className="drop_down fr mt10 mr33"> <li className="drop_down fr mt10 mr33 cursor" onClick={() => this.onSortTypeChange()}>
{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}<i className="iconfont icon-xiajiantou font-12 ml2"></i> {/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/}
<ul className="drop_down_normal"> {/*<i className="iconfont icon-xiajiantou font-12 ml2"></i>*/}
{sort==='percent'?"":<li onClick={() => this.onSortTypeChange('percent')}>正确率</li>} {/*<ul className="drop_down_normal">*/}
{sort==='type'?"":<li onClick={() => this.onSortTypeChange('type')}>题型</li>} {/*{sort==='percent'?"":<li onClick={() => this.onSortTypeChange('percent')}>正确率</li>}*/}
{sort==='position'?"":<li onClick={() => this.onSortTypeChange('position')}>题序</li>} {/*{sort==='type'?"":<li onClick={() => this.onSortTypeChange('type')}>题型</li>}*/}
</ul> {/*{sort==='position'?"":<li onClick={() => this.onSortTypeChange('position')}>题序</li>}*/}
{/*</ul>*/}
正确率
<sapn className="relativef ml5"style={{"top":"3px"}} >
<i className={sort==="asc"?
"iconfont icon-sanjiaoxing-up font-12 color-blue fiilssort" :"iconfont icon-sanjiaoxing-up font-12 fiilssort"}></i>
<i className={sort==="desc"?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue":"iconfont icon-sanjiaoxing-down font-12 yslbottomsj"}></i>
</sapn>
</li> </li>
</div> </div>

@ -111,7 +111,7 @@
} }
.logincloseIcon{ .logincloseIcon{
position: absolute; position: absolute;
top: -100px; top: -100px !important;
right: -27px; right: -27px;
z-index: 100000; z-index: 100000;
} }

Loading…
Cancel
Save