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

dev_aliyun2
anke1460 5 years ago
commit 8c83c0a620

@ -27,6 +27,12 @@ module ApplicationHelper
sanitize content, tags: tags, attributes: attributes sanitize content, tags: tags, attributes: attributes
end end
# MD5加密
def base64_encode(content)
return nil if content.blank?
Base64.encode64(content)
end
def graduation_navigation graduation def graduation_navigation graduation
graduation.class.to_s == "GraduationTopic" ? "毕设选题" : "毕设任务" graduation.class.to_s == "GraduationTopic" ? "毕设选题" : "毕设任务"
end end

@ -1,7 +1,7 @@
json.course_groups @course_groups do |group| json.course_groups @course_groups do |group|
json.id group.id json.id group.id
json.name group.name json.name group.name
json.end_time @group_settings.select{|group_setting| group_setting.course_group_id == group.id}.first&.end_time json.end_time @homework.unified_setting ? @homework.end_time : @group_settings.select{|group_setting| group_setting.course_group_id == group.id}.first&.end_time
end end
json.end_time @homework.end_time json.end_time @homework.end_time
json.late_time @homework.late_time json.late_time @homework.late_time

@ -1,4 +1,6 @@
json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded
json.play_url base64_encode(video.play_url)
json.file_url base64_encode(video.file_url)
json.play_duration video.video_play_duration json.play_duration video.video_play_duration
json.published_at video.display_published_at json.published_at video.display_published_at
json.created_at video.display_created_at json.created_at video.display_created_at

@ -1011,7 +1011,7 @@ class Fileslists extends Component{
:"":""} :"":""}
{this.props.isAdmin()?<li className="li_line drop_down"> {this.props.isAdmin()?<li className="li_line drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i> 移动到目录<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<style> <style>
{ ` { `

@ -387,7 +387,7 @@ class Boards extends Component{
{ coursedata && !!coursedata.course_public && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSetToOpen}>设为公开</a></li> } { coursedata && !!coursedata.course_public && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSetToOpen}>设为公开</a></li> }
<li className="li_line drop_down"> <li className="li_line drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i> 移动到目录<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" <ul className="drop_down_menu"
style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}> style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
{ boards && boards.length > 10 && <p className="drop_down_search"> { boards && boards.length > 10 && <p className="drop_down_search">

@ -442,16 +442,17 @@ class CommonWorkList extends Component{
if (val === ""||val===undefined) { if (val === ""||val===undefined) {
this.setState({ this.setState({
search: undefined, search: undefined,
searchtypes:false searchtypes:false,
page:1
}) })
}else{ }else{
this.setState({ this.setState({
searchtypes:true, searchtypes:true,
loadingstate:true loadingstate:true,
page:1
}) })
} }
this.fetchList(1)
this.fetchList()
} }
onSearchValueInput = (e) => { onSearchValueInput = (e) => {
if (e.target.value === ""||e.target.value===undefined) { if (e.target.value === ""||e.target.value===undefined) {
@ -482,8 +483,9 @@ class CommonWorkList extends Component{
this.fetchList() this.fetchList()
} }
_getRequestParams() { _getRequestParams(pages) {
const {search, arg_work_status, arg_teacher_comment, arg_course_group, order, page, arg_member_work, b_order} = this.state let {search, arg_work_status, arg_teacher_comment, arg_course_group, order, page, arg_member_work, b_order} = this.state
page=pages?pages:page
return { return {
page, page,
search, search,
@ -500,7 +502,7 @@ class CommonWorkList extends Component{
fetchData = () => { fetchData = () => {
this.fetchList() this.fetchList()
} }
fetchList = () => { fetchList = (page) => {
if(this.state.comwbool===true){ if(this.state.comwbool===true){
console.log('arg_course_group2'); console.log('arg_course_group2');
console.log(this.state.arg_course_group); console.log(this.state.arg_course_group);
@ -515,7 +517,7 @@ class CommonWorkList extends Component{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
const url = `/homework_commons/${workId}/works_list.json` const url = `/homework_commons/${workId}/works_list.json`
let params = this._getRequestParams() let params = this._getRequestParams(page)
axios.post(url, params).then((response)=> { axios.post(url, params).then((response)=> {
if (response.data) { if (response.data) {
this.setState({ this.setState({

@ -582,7 +582,7 @@ class commonWork extends Component{
onClick={this.addToBank} onClick={this.addToBank}
>加入题库</a></li>:""} >加入题库</a></li>:""}
<li className="li_line drop_down"> <li className="li_line drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i> 移动到目录<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" <ul className="drop_down_menu"
style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}> style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
{ course_module && course_module.length > 10 && <p className="drop_down_search"> { course_module && course_module.length > 10 && <p className="drop_down_search">

@ -601,7 +601,7 @@ class CoursesBanner extends Component {
</div> </div>
<div className="clearfix "> <div className="clearfix ">
<div className="fl fl mr40 mb20" > <div className="fl fl mr40 mb20" >
@ -665,6 +665,10 @@ class CoursesBanner extends Component {
{/*}*/} {/*}*/}
<div> <div>
{this.props.isStudent()?this.props.current_user&&this.props.current_user.course_is_end===true?"":<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 永久退出课堂 </a>:""}
{coursedata.switch_to_student === true ? {coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={ <Tooltip placement="bottom" title={
<pre>由教师/助教身份切换至学生<br/>可进行提交作品答题等操作</pre> <pre>由教师/助教身份切换至学生<br/>可进行提交作品答题等操作</pre>
@ -723,9 +727,7 @@ class CoursesBanner extends Component {
) )
: ""} : ""}
{this.props.isStudent()?this.props.current_user&&this.props.current_user.course_is_end===true?"":<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 永久退出课堂 </a>:""}
</div> </div>

@ -49,14 +49,20 @@ class OneSelfOrderModal extends Component{
let arr = this.props.course_groups.map(item => item.id); let arr = this.props.course_groups.map(item => item.id);
let newarr = []; let newarr = [];
let course_groups = this.props.course_groups; let course_groups = this.props.course_groups;
course_groups.map((item, key) => { course_groups.map((item, key) => {
if (item.end_time === null) { if (item.end_time === null) {
// if(this.props.starttimesend===undefined){ // if(this.props.starttimesend===undefined){
// item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); // item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
// }else{ // }else{
// item.end_time = moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm"); // item.end_time = moment(handleDateString(this.props.starttimesend)).format("YYYY-MM-DD HH:mm");
// } // }
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); if(this.props.starttimesend){
item.end_time = moment(moment(handleDateString(this.props.starttimesend))).format("YYYY-MM-DD HH:mm");
}else{
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
}
newarr.push(item) newarr.push(item)
} else { } else {
newarr.push(item) newarr.push(item)
@ -101,7 +107,12 @@ class OneSelfOrderModal extends Component{
let course_groups=this.props.course_groups; let course_groups=this.props.course_groups;
course_groups.map((item,key)=>{ course_groups.map((item,key)=>{
if(item.end_time===null){ if(item.end_time===null){
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"); // item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
if(this.props.starttimesend){
item.end_time = moment(moment(handleDateString(this.props.starttimesend))).format("YYYY-MM-DD HH:mm");
}else{
item.end_time = moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm");
}
newarr.push(item) newarr.push(item)
}else{ }else{
newarr.push(item) newarr.push(item)

@ -860,7 +860,7 @@ class studentsList extends Component{
<div className="studentList_operation_ul"> <div className="studentList_operation_ul">
{/* {isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>} */} {/* {isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>} */}
{isAdmin && !isStudentPage && <li className="drop_down"> {isAdmin && !isStudentPage && <li className="drop_down">
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i> 移动到目录<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", width: '200px', maxHeight: '324px', overflowY: 'auto'}}> <ul className="drop_down_menu" style={{"right":"0px","left":"unset", width: '200px', maxHeight: '324px', overflowY: 'auto'}}>
{ {
course_groups && course_groups.length > 9 ? course_groups && course_groups.length > 9 ?

@ -60,8 +60,11 @@ class PollDetailTabFirst extends Component{
}) })
} }
searchInfo=()=>{ searchInfo=()=>{
let {order, search, commit_status, poll_group_id, page, order_type} = this.state let {order, search, commit_status, poll_group_id, page, order_type} = this.state;
this.getTableList(order, search, commit_status, poll_group_id, page, order_type); this.setState({
page:1
})
this.getTableList(order, search, commit_status, poll_group_id, 1, order_type);
} }
// 获取接口数据 // 获取接口数据

@ -1256,7 +1256,7 @@ class ShixunHomework extends Component{
</li> </li>
<li className="li_line drop_down" onMouseEnter={this.updadatalist}> <li className="li_line drop_down" onMouseEnter={this.updadatalist}>
{/*onClick={()=>this.selectBlank(4)}*/} {/*onClick={()=>this.selectBlank(4)}*/}
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i> 移动到目录<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}> <ul className="drop_down_menu" style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
{ course_modules&&course_modules.homework_category.length > 10 && <p className="drop_down_search"> { course_modules&&course_modules.homework_category.length > 10 && <p className="drop_down_search">
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/> <Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>

@ -43,7 +43,7 @@ class ShixunPathCard extends Component{
<p className="font-14 color-white">非试用内容需要授权</p> <p className="font-14 color-white">非试用内容需要授权</p>
</div> */} </div> */}
<Link to={"/paths/"+item.id} className="squareImg" > <Link to={"/paths/"+item.id} className="squareImg" target="_blank">
{/*target="_blank"*/} {/*target="_blank"*/}
<img alt="详情图片" src={setImagesUrl(item.image_url)}/> <img alt="详情图片" src={setImagesUrl(item.image_url)}/>
</Link> </Link>
@ -80,7 +80,7 @@ class ShixunPathCard extends Component{
</div> </div>
) )
} }
</div> </div>
) )
} }

@ -212,8 +212,8 @@ const App = (props) => {
sorter: (a, b) => a.cost_time - b.cost_time sorter: (a, b) => a.cost_time - b.cost_time
} }
]; ];
useEffect(() => { useEffect(() => {
changeParams({ changeParams({
page: 1, page: 1,
@ -307,7 +307,7 @@ const App = (props) => {
fetchData={handleFetchData} fetchData={handleFetchData}
/> />
</TabPane> </TabPane>
<TabPane tab="实使用情况" key="2"> <TabPane tab="实使用情况" key="2">
<DisplayTableData <DisplayTableData
columns={sxColumns} columns={sxColumns}
datas={other_info} datas={other_info}
@ -315,7 +315,7 @@ const App = (props) => {
fetchData={handleFetchData} fetchData={handleFetchData}
/> />
</TabPane> </TabPane>
<TabPane tab="学习情况" key="3"> <TabPane tab="学员学习情况" key="3">
<DisplayTableData <DisplayTableData
columns={stColumns} columns={stColumns}
datas={other_info} datas={other_info}
@ -339,7 +339,7 @@ const mapStateToProps = (state) => {
other_info, other_info,
total, total,
} }
}; };
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({

Loading…
Cancel
Save