Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit 377554d6df

@ -277,7 +277,7 @@ class CommonWorkAppraiseReply extends Component{
showModulationtype={this.showModulationtype}
addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length}
onReply={this.onReply} placeholder={"请在此输入对本作品的评语最大限制2000个字符"}
showSameScore={isGroup}
showSameScore={isGroup && isAdmin}
></GraduationTasksappraiseMainEditor> }
</div>
{/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */}

@ -760,7 +760,9 @@ class Studentshavecompletedthelist extends Component {
<span>
{record.operating==="--"?
<span style={{"text-align": "center","color": '#999999',}}>{record.operating}</span>
:
:record.submitstate === "未提交"?
<span style={{"text-align": "center","color": '#999999',}}>--</span>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.operating}</a>
}
@ -954,6 +956,9 @@ class Studentshavecompletedthelist extends Component {
{record.finalscore==="--"?
<span style={{"text-align": "center","color": '#999999'}}
>--</span>
:record.submitstate === "未提交"?
<span style={{"text-align": "center","color": '#999999'}}
>--</span>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
@ -1141,6 +1146,9 @@ class Studentshavecompletedthelist extends Component {
{record.finalscore==="--"?
<span style={{"text-align": "center","color": '#999999'}}
>--</span>
:record.submitstate === "未提交"?
<span style={{"text-align": "center","color": '#999999'}}
>--</span>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>

@ -352,8 +352,8 @@ onBoardsNew=()=>{
(<React.Fragment>
{/* 参考普通作业 - 题库选用 */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=>this.useFromBank()}>题库选用</WordsBtn> 正式版没有,先隐藏*/}
< a href={`/api/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`} className={"fl color-blue mr30 font-16"}>导出</a>
<p className="fl"><UseBank {...this.props} {...this.state} object_type={"gtopic"} useBankSuccess={this.useBankSuccess}></UseBank></p>
< a href={`/api/courses/${this.props.match.params.coursesId}/graduation_topics/export.xlsx`} className={"color-blue mr20 font-16"}>导出</a>
<WordsBtn style="blue" className="font-16" onClick={()=>this.onBoardsNew()}>新建</WordsBtn>
</React.Fragment>):""
}

@ -39,15 +39,17 @@ function buildColumns(that) {
render: (content, item, index) => {
return <a href="javascript:;">{(that.state.page - 1) * 20 + index + 1} </a>
}
},{
title: '用户ID',
width: 120,
dataIndex: 'login',
key: 'login',
render: (login, record) => {
return <span className="overflowHidden1" style={{ maxWidth: '110px'}} title={`${login.length > 8 ? login : ''}`}>{login}</span>
}
}, {
}
// ,{
// title: '用户ID',
// width: 120,
// dataIndex: 'login',
// key: 'login',
// render: (login, record) => {
// return <span className="overflowHidden1" style={{ maxWidth: '110px'}} title={`${login.length > 8 ? login : ''}`}>{login}</span>
// }
// }
, {
title: '姓名',
dataIndex: 'name',
width: 120,

@ -187,56 +187,6 @@ class PollDetailTabForth extends Component{
}
UnifiedSetting=()=>{
let { unit_e_tip , unit_p_tip , publish_time , end_time ,course_group }=this.state
// 如果两个时间都没有填写或者只选择了截止时间则先保存设置然后弹出立即发布弹框
// if ( !publish_time ){
// if(moment(end_time,dataformat)<=moment()){
// this.setState({
// unit_e_tip:"截止时间不能小于当前时间"
// })
// }else{
// this.setState({
// unit_e_tip:""
// })
// let list=[];
// let pollId=this.props.match.params.pollId;
// let coursesId=this.props.match.params.coursesId;
// let url=`/courses/${coursesId}/polls/publish_modal.json`;
// axios.get(url,{
// params:{
// check_ids:[pollId]
// }
// }).then((response) => {
// if(response.data.course_info){
// for(var i=0;i<response.data.course_info.length;i++){
// list.push({
// id:response.data.course_info[i].course_group_id,
// name:response.data.course_info[i].course_group_name,
// })
// }
// this.setState({
// modalname:"立即发布",
// modaltype:list.length > 0 ? 1 : 2,
// visible:true,
// Topval:"本操作只对“未发布”的对象生效",
// Botvalleft:"暂不发布",
// Botval:"则通过后续手动设置,定时发布",
// starttime:"发布时间:"+this.props.getNowFormatDates(1),
// endtime:"截止时间:" + moment(end_time || this.props.getNowFormatDates(2)).format(dataformat),
// Cancelname:"暂不发布",
// Savesname:"立即发布",
// Cancel:this.homeworkhide,
// Saves:this.homeworkstartend,
// publishCourse:list,
// publish_time:this.props.getNowFormatDates(1)
// })
// }
// }).catch((error)=>{
// console.log(error);
// })
// }
// }
if( this.state.un_change_unified == false){
if ( !publish_time ){
this.setState({
@ -275,16 +225,16 @@ class PollDetailTabForth extends Component{
unit_e_tip:""
})
}
this.commitSetting((result)=>{
if(result.status==200){
this.props.showNotification(`${result.data.message}`);
this.getSettingInfo();
this.setState({
flagPageEdit:false
})
}
})
}
this.commitSetting((result)=>{
if(result.status==200){
this.props.showNotification(`${result.data.message}`);
this.getSettingInfo();
this.setState({
flagPageEdit:false
})
}
})
}
// 非统一设置提交

@ -60,7 +60,7 @@ class PollListItem extends Component{
}
{
item.polls_status ==1 && item.publish_time ==null && item.created_at &&
<span className="mr20 fl mt3">创建于{moment(item.created_at).format(dataformat)}</span>
<span className="mr20 fl mt3">创建于{moment(item.created_at).fromNow()}</span>
}
{
item.polls_status ==1 && item.publish_time !=null &&

@ -2763,7 +2763,17 @@ class PollNew extends Component {
</div>
: ""
:
<div className="clearfix mt30" >
<span className="fr mt5">
<ActionBtn style="greyBack" className=" mr20 w100"
onClick={() => this.deleteadddom(indexo)}>取消</ActionBtn>
<ActionBtn style="blue" className="mr20 w100"
onClick={() => this.deleteadddomthree(indexo, itemo)}>保存</ActionBtn>
<ActionBtn style="blue" className=" w100"
onClick={() => this.deleteadddomtwo(indexo, itemo)}>保存并继续</ActionBtn>
</span>
</div>
)
: itemo.question.question_type === 3 ?

@ -115,6 +115,7 @@ class Listofworks extends Component {
key: 'name',
align: 'center',
className:'font-14',
width:'120px',
render: (text, record) => (
<span style={{"color": '#07111B', "text-align": "center"}}>{record.name}</span>
)
@ -139,7 +140,7 @@ class Listofworks extends Component {
dataIndex: 'classroom',
align: 'center',
className:'font-14',
width:'288px',
width:"260px",
render: (text, record) => (
<span style={{"color": '#07111B', "text-align": "center"}}>{record.classroom}</span>
)
@ -239,9 +240,9 @@ class Listofworks extends Component {
</span>
</Tooltip>
:
<a style={{color:"#9A9A9A"}}>
<span style={{color:"#9A9A9A"}}>
--
</a>
</span>
)
:
<span style={parseInt(record.efficiencyscore) <= 60 ? {
@ -367,6 +368,7 @@ class Listofworks extends Component {
key: 'name',
align: 'center',
className:'font-14',
width:'120px',
render: (text, record) => (
<span style={{"color": '#07111B', "text-align": "center"}}>{record.name}</span>
)
@ -391,7 +393,7 @@ class Listofworks extends Component {
dataIndex: 'classroom',
align: 'center',
className:'font-14',
width:'288px',
width:"260px",
render: (text, record) => (
<span style={{"color": '#07111B', "text-align": "center"}}>{record.classroom}</span>
)
@ -491,9 +493,9 @@ class Listofworks extends Component {
</span>
</Tooltip>
:
<a style={{color:"#9A9A9A"}}>
<span style={{color:"#9A9A9A"}}>
--
</a>
</span>
)
:
<span style={parseInt(record.efficiencyscore) <= 60 ? {
@ -1346,7 +1348,7 @@ class Listofworks extends Component {
// }
// let url = "/zip/shixun_report";
// let homeworkid = this.props.match.params.homeworkid;
axios.get((url),{headers:{'filename':'utf-8'},responseType: 'blob'}).then((response) => {
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1350");
console.log(response);
if(response.data.status&&response.data.status===-1){
@ -1374,31 +1376,6 @@ class Listofworks extends Component {
console.log(error)
});
}
//字节装为字符串
utf8ByteArrayToString(bytes) {
var out = [], pos =0, c =0;
while (pos < bytes.length) {
var c1 = bytes[pos++];
if (c1 <128) {
out[c++] = String.fromCharCode(c1);
}else if (c1 >191 && c1 <224) {
var c2 = bytes[pos++];
out[c++] = String.fromCharCode((c1 &31) <<6 | c2 &63);
}else if (c1 >239 && c1 <365) {
var c2 = bytes[pos++];
var c3 = bytes[pos++];
var c4 = bytes[pos++];
var u = ((c1 &7) <<18 | (c2 &63) <<12 | (c3 &63) <<6 | c4 &63) -0x10000;
out[c++] = String.fromCharCode(0xD800 + (u >>10));
out[c++] = String.fromCharCode(0xDC00 + (u &1023));
}else {
var c2 = bytes[pos++];
var c3 = bytes[pos++];
out[c++] =String.fromCharCode((c1 &15) <<12 | (c2 &63) <<6 | c3 &63);
}
}
return out.join('');
}
// 课堂学生成绩的导出下载
Classstudentachievement=(url)=>{
console.log("Classstudentachievement");
@ -1410,7 +1387,7 @@ class Listofworks extends Component {
// search: this.state.searchtext,
// }
// },{responseType: 'blob'})
axios.get((url),{headers:{'filename':'utf-8'},responseType: 'blob'}).then((response) => {
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1374");
console.log(response);
if(response.data.status&&response.data.status===-1){
@ -1427,6 +1404,7 @@ class Listofworks extends Component {
const name = decodeURI(response.headers['content-disposition'].split('=')[1])
console.log(response.headers['content-disposition'].split('=')[1]);
console.log(name);
console.log(decodeURIComponent(response.headers['content-disposition'].split('=')[1]));
downloadElement.href = href
downloadElement.download = name
document.body.appendChild(downloadElement)

@ -443,8 +443,50 @@ class ShixunStudentWork extends Component {
starttimes:undefined,
})
}
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid;
// let url = "/zip/shixun_report";
axios.get(url).then((response) => {
console.log("326");
console.log(response);
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else{
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId;
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
axios.get(url).then((response) => {
console.log("1374");
console.log(response);
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else{
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
render() {
let {
data,
@ -606,10 +648,35 @@ class ShixunStudentWork extends Component {
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/settings`}
>设置</Link>
{this.props.isAdmin() ? <a
className="fr color-blue font-16"
href={`/api/homework_commons/${this.props.match.params.coursesId}/works_list.xlsx`}
>导出</a> : ""}
<style>{`
.drop_down_menu li a {
padding: 0px;
font-size: 14px;
}
.drop_down_menu {
width: 93px;
}
.drop_down_menu li {
overflow: visible;
width: 93px;
}
.drop_down_menu, .drop_down_normal {
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
color:#1A0B00 !important;
}
`}</style>
{this.props.isAdmin() ? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a onClick={()=>this.internshipreport(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li>
<li><a onClick={()=>this.Classstudentachievement(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li>
</ul>
</li> : ""}
{this.props.isAdmin()?
data&&data.end_immediately===true?
<a className="fr color-blue font-16" onClick={this.homeworkends}>立即截止</a> : "" : ""}

Loading…
Cancel
Save