Merge branches 'dev_Ysl' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl

dev_admin
杨树明 6 years ago
commit 714cc78e24

@ -1,7 +1,7 @@
class ProjectPackagesController < ApplicationController
include PaginateHelper
before_action :require_login, :check_auth, only: %i[create update destroy]
before_action :require_login, :check_auth, only: %i[show create update destroy]
helper_method :current_package, :package_manageable?

@ -406,9 +406,10 @@ class ShixunsController < ApplicationController
end
end
@shixun.update_attributes(shixun_params)
logger.info("##########shixun_info_params: #{shixun_info_params}")
logger.info("##########params[:shixun_info][:evaluate_script]: #{params[:shixun_info][:evaluate_script]}")
@shixun.shixun_info.update_attributes(shixun_info_params)
@shixun.shixun_schools.delete_all
logger.info("##########scope_partment:###{params[:scope_partment]}")
# scope_partment: 高校的名称
if params[:scope_partment].present?
arr = []

@ -1,6 +1,7 @@
class TidingsController < ApplicationController
include PaginateHelper
before_action :require_login
after_action :update_onclick_time!, only: [:index]
def index

@ -25,28 +25,33 @@ elsif @type == "txt"
elsif @type =="qrcode"
json.qrcode_str @qrcode_str
elsif @type == "mp3" || @type == "mp4"
if @type == "mp4"
json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.mp4"}]
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}]
json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}]
else
json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}]
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
end
# json.orignal_file do
# json.array! @orignal_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @original_path)
# end
# if @type == "mp4"
# json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.mp4"}]
# json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}]
# json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}]
# else
# json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}]
# json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
# json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
# end
json.orignal_file do
json.array! @orignal_picture do |file|
json.file_url attachment_show_users_path(:file_name => file, :path => @original_path)
end
end
# json.user_file do
# json.array! @user_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @user_path, :time => Time.now.to_i)
# end
# end
# json.answer_file do
# json.array! @answer_picture do |file|
# json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path)
# end
# end
if @type == "mp4"
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}]
else
json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}]
end
json.answer_file do
json.array! @answer_picture do |file|
json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path)
end
end
end

@ -38,7 +38,7 @@ json.operation do
json.can_deletable manageable
json.can_editable manageable
json.user_praised PraiseTread.exists?(user_id: current_user&.id)
json.user_praised library.praise_treads.exists?(user_id: current_user&.id)
else
json.can_deletable false
json.can_editable false

@ -1,4 +1,5 @@
json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, :parent_container_id, :parent_container_type
json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type,
:parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type
json.content tiding.content
json.identifier tiding.identifier

@ -577,7 +577,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;}
.recently_name{float: left;line-height: 48px;display: block}
.recently_item:hover{background-color: #F9F9F9;}
/*私信对话框*/
.private-list{min-height: 660px;max-height: 831px;overflow-y: auto}
.private-list{min-height: 660px;max-height: 831px;overflow-y: auto;overflow-x: hidden;}
.private-list .private-part{padding-left:20px;cursor: pointer}
.private-part:hover{background-color: #F5F5F5;}
.private-part.active{background-color: #F5F5F5;}

@ -90,12 +90,19 @@ class Clappr extends Component{
<React.Fragment>
{/* https://github.com/CookPete/react-player/issues/686 */}
<ReactPlayer url={source} playing={false} controls={true} width={400} height={ type == 'mp3' ? 55 : 290}/>
{/* <style>{`
.playback_rate {
margin-right: 16px;
}
`}</style>
<div id={_id} className={className + ' ' + type}></div> */}
{/* 原生 */}
{/* { type == 'mp3' ? <audio src={source} preload controls></audio>
: <video src={source} controls="controls">
您的浏览器不支持 video 标签
</video>} */}
</React.Fragment>
)
}

@ -55,9 +55,11 @@ class PackageIndexNEITaskDetails extends Component {
getdatas=()=>{
let url =`/project_packages/${this.props.match.params.id}.json`;
axios.get(url).then((response) => {
this.setState({
data:response.data
})
if(response.data.status!=401&&response.data.status!=403&&response.data.status!=408&&response.data.status!=409)[
this.setState({
data:response.data
})
]
}).catch((error) => {
console.log(error);
@ -236,8 +238,12 @@ class PackageIndexNEITaskDetails extends Component {
render() {
let {overtype,data}=this.state;
// console.log(data&&data.creator.login)
console.log(data)
// console.log(data&&data.creator.id)
let datalogin=data&&data.creator.id;
let userlogin=this.props.current_user&&this.props.current_user.user_id;
console.log(datalogin===userlogin)
// console.log(this.props.current_user&&this.props.current_user.user_id)
return (
data===undefined?"":<div>
<div className="clearfix">
@ -258,11 +264,9 @@ class PackageIndexNEITaskDetails extends Component {
<Breadcrumb.Item><span className={"tabelcli"} title={data&&data.title}>{data&&data.title}</span></Breadcrumb.Item>
</Breadcrumb>
<a className="color-grey-6 fr font-15 mr20" onClick={this.goback}>返回</a>
<a className="color-grey-6 fr font-18 mr20" onClick={this.goback}>返回</a>
<div className="mb20">
<p className="clearfix ">
<p className="clearfix">
<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
<div className={"ant-row contentbox mdInForm "}>
@ -289,12 +293,12 @@ class PackageIndexNEITaskDetails extends Component {
{data&&data.creator.name}
</div>
{data&&data.creator.login===this.props.current_user&&this.props.current_user.login?"":<div className=" edu-back-white ml5 mt10 "
{datalogin===userlogin===true?"":<div className=" edu-back-white ml5 mt10 "
onMouseOver={this.setover}
onMouseOut={this.setout}
>
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/message/${data&&data.creator.login}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
{overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/message/${this.props.current_user&&this.props.current_user.user_id}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" target="_blank" href={`/message/${this.props.current_user&&this.props.current_user.user_id}/message_detail?target_ids=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
src={require('./newstwo.png')}/>联系TA</a>}
</div>}
</div>
@ -304,7 +308,7 @@ class PackageIndexNEITaskDetails extends Component {
<div className=" item-body">
<div className=" item-head mbf10">
<div className=" item-head mbf10 mt15 ">
<div className=" item-head-title ">
<span className={"fl mt3 font-18 font-bd color-dark maxwidth700 "}
@ -407,7 +411,7 @@ class PackageIndexNEITaskDetails extends Component {
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/message/${item.login}/message_detail?target_ids=${item.id}`}>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/message/${this.props.current_user&&this.props.current_user.user_id}/message_detail?target_ids=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
</a>:""}
</div>

@ -692,7 +692,7 @@ class TPMBanner extends Component {
</div>
{
startbtn === false ?
startbtn === false && shixunsDetails.shixun_status != -1 ?
<Tooltip placement="bottom" title={
shixunsDetails.task_operation === undefined ? "" : shixunsDetails.task_operation[0] === "开始实战" ? "开始学习并完成实战任务" : shixunsDetails.task_operation[0] === "继续挑战" ? "继续完成后续学习和实战任务" :
shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" :
@ -843,7 +843,7 @@ class TPMBanner extends Component {
<a onClick={this.Senttothe}
className="fr user_default_btn user_blue_btn mr20 font-18"
data-tip-down=""
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ? "none" : "block"}}
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ||shixunsDetails.shixun_status === -1 ? "none" : "block"}}
data-remote="true">
<Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}>
发送至
@ -921,7 +921,12 @@ class TPMBanner extends Component {
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a>
}
{this.props.identity < 8?<div className="fr user_default_btn user_blue_btn mr20"
{shixunsDetails.shixun_status === -1 &&
<a className="fr user_default_btn edu-greyback-btn mr15 font-18">已删除</a>
}
{this.props.identity < 8&&shixunsDetails.shixun_status != -1 ?<div className="fr user_default_btn user_blue_btn mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<span className="flex1 edu-txt-center fl font-18"

@ -727,6 +727,12 @@ export default class TPMsettings extends Component {
// });
// }
submit_edit_shixun = () => {
if(this.state.status===-1){
this.props.showSnackbar("该实训已被删除,保存失败!");
return
}
let {
name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum,
evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh,
@ -739,13 +745,15 @@ export default class TPMsettings extends Component {
return v1
});
let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
// let operateauthority=
// this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false;
// this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1;
const description_editormd = this.description_editormd.getValue();
let evaluate_script_editormd;
if(operateauthority===true){
if(this.state.status==0||this.state.status==1||this.state.status==2&&this.props.identity===1){
// evaluate_script_editormd = this.evaluate_script_editormd.getValue();
evaluate_script_editormd = shixunmemoMDvalue
}else{
@ -753,6 +761,7 @@ export default class TPMsettings extends Component {
}
if (name === "") {
this.setState({
shixunnametype: true
@ -826,6 +835,7 @@ export default class TPMsettings extends Component {
if(newmulti_webssh===null){
newmulti_webssh=false
}
//exec_time: exec_time,
let Url = `/shixuns/` + id + `.json`;
let data = {
@ -1625,8 +1635,8 @@ export default class TPMsettings extends Component {
options={ {
selectOnLineNumbers: true
}}
onChange={operateauthority===true?this.getshixunmemoMDvalue:""}
// onChange={this.getshixunmemoMDvalue}
/>
</div>

@ -580,7 +580,7 @@ p .activity-item:first-child{border-top: 1px solid #eee;}
.recently_name{float: left;line-height: 48px;display: block}
.recently_item:hover{background-color: #F9F9F9;}
/*私信对话框*/
.private-list{min-height: 660px;max-height: 831px;overflow-y: auto}
.private-list{min-height: 660px;max-height: 831px;overflow-y: auto;overflow-x: hidden;}
.private-list .private-part{padding-left:20px;cursor: pointer}
.private-part:hover{background-color: #F5F5F5;}
.private-part.active{background-color: #F5F5F5;}
@ -3122,7 +3122,7 @@ a.singlepublishtwo{
height: 40px;
}
.project-package-item .item-head-title {
max-width: 700px;
max-width: 650px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ -3213,7 +3213,7 @@ a.singlepublishtwo{
font-size: 20px;
}
.project-package-item.with-operator:hover .item-head-title {
max-width: 600px;
max-width: 650px;
}
.list-count {

Loading…
Cancel
Save