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

chromesetting
daiao 5 years ago
commit 235e00557c

@ -207,7 +207,7 @@ class ShixunsController < ApplicationController
@new_shixun = Shixun.new
@new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "averge_star",
"homepage_show","repo_name", "myshixuns_count", "challenges_count",
"can_copy", "created_at", "updated_at")
"can_copy", "created_at", "updated_at", "public")
@new_shixun.user_id = User.current.id
@new_shixun.averge_star = 5
@new_shixun.identifier = generate_identifier Shixun, 8

@ -60,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService
shixun = stage_shixun.shixun
to_shixun = Shixun.new
to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show',
'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count')
'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count', "public")
to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8)
to_shixun.user_id = user.id
if laboratory

@ -44,7 +44,7 @@ class Users::ShixunService
def user_policy_filter(relations)
# 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能
if self_or_admin?
relations = relations.where.not(status: -1)
relations = relations.where.not(status: -1).where(hidden: false)
status_filter(relations)
else
relations.where(status: [2, 3], hidden: false)

@ -35,7 +35,7 @@ class Users::SubjectService
def user_policy_filter(relations)
# 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能
if self_or_admin?
status_filter(relations)
status_filter(relations.unhidden)
else
relations.where(status: 2, hidden: false)
end

@ -591,7 +591,7 @@ class NewShixunModel extends Component{
this.props.type==='shixuns'?
(
item.is_jupyter===true?
<div className="myysljupyter fl ml20 mt3 intermediatecenter">
<div className="myysljupyter fl ml20 intermediatecenter">
<p className="myysljupytertest">
Jupyter
</p>

@ -391,7 +391,6 @@
text-align: center;
border-radius:5px;
border:1px solid #FF6802;
margin-top: 4px;
}
.myysljupytertest{
width:54px;

@ -529,6 +529,7 @@ class YslDetailCards extends Component{
{
this.props.isAdmin()===true?
<DetailCardsEditAndEdit
{...this.props}
idsum={idsum}
keys={key}
pathCardsedittype={pathCardsedittype}

@ -355,11 +355,15 @@ class ShixunhomeWorkItem extends Component{
.homepagePostSettingbox{
width:139px !important;
}
.colorfff{
color:#fff !important;
}
`
}
</style>
{this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}>
{discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:""}
{discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:
<a className={"btn colorfff font-16 fontweight400"}>实训详情</a>}
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>

@ -69,6 +69,7 @@ class Addshixuns extends Component {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
};
console.log(this.props)
return(
<Modal
className={this.props.className}
@ -92,14 +93,14 @@ class Addshixuns extends Component {
</style>:""}
<div className="task-popup-content">
<Form {...formItemLayout}>
<Form.Item label="实训类型">
<Radio.Group value={this.state.is_jupyter} onChange={this.GrouponChange}>
<Radio value="1">普通实训</Radio>
<Radio value="2">jupyter实训</Radio>
</Radio.Group>
</Form.Item>
</Form>
{/*<Form {...formItemLayout}>*/}
{/* <Form.Item label="实训类型">*/}
{/* <Radio.Group value={this.state.is_jupyter} onChange={this.GrouponChange}>*/}
{/* <Radio value="1">普通实训</Radio>*/}
{/* <Radio value="2">jupyter实训</Radio>*/}
{/* </Radio.Group>*/}
{/* </Form.Item>*/}
{/*</Form>*/}
<p className="task-popup-text-center font-16">
<span style={{ "line-height":"30px"}}>实训名称</span>
<span><Input style={{ width:"80%"}} className="yslzxueshisy " placeholder="请输入60字以内的实训名称" onChange={this.handleChange} addonAfter={String(this.state.shixunname===undefined?0:this.state.shixunname.length)+"/60"} maxLength={60} />

@ -1223,7 +1223,7 @@ class TPMBanner extends Component {
}
{this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
{this.props.identity < 5 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
<div className="fr kaike kkbth mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>

@ -121,8 +121,9 @@ export default class Shixuninformation extends Component {
}
onSubmits = () => {
let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state;
if(this.state.opentime===true){
if(opening_time===null){
this.setState({
@ -143,9 +144,7 @@ export default class Shixuninformation extends Component {
let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`;
this.setState({
loading: true
})
axios.post(url,
{
scope_partment: list,
@ -168,14 +167,10 @@ export default class Shixuninformation extends Component {
this.props.getdatas("3")
}
}).catch((error) => {
this.setState({
loading: false
})
})
this.setState({
loading: false
})
}
CheckboxonChange = (e) => {
this.setState({

@ -96,8 +96,8 @@ export default class TPMsettings extends Component {
operateshixunstype: false,
});
// window.location.href = "/shixuns";
this.props.history.replace( "/shixuns/");
window.location.href = "/shixuns";
// this.props.history.replace( "/shixuns/");
}
}).catch((error) => {
console.log(error)
@ -114,8 +114,8 @@ export default class TPMsettings extends Component {
operateshixunstype: false,
});
// window.location.href = "/shixuns/" + id + "/challenges";
this.props.history.replace( "/shixuns/" + id + "/challenges");
window.location.href = "/shixuns/" + id + "/challenges";
// this.props.history.replace( "/shixuns/" + id + "/challenges");
}
}).catch((error) => {
console.log(error)

@ -431,6 +431,7 @@ class Newshixuns extends Component {
return isLt150M;
},
}
return (
<div className="newMain clearfix">
<style>
@ -455,14 +456,14 @@ class Newshixuns extends Component {
</div>
<div className="padding10-20 color-grey-3 clearfix">
<Form>
<Form.Item label="实训类型">
{this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true?<Form.Item label="实训类型">
{getFieldDecorator('is_jupyter')(
<Radio.Group onChange={this.RadiovalueonChange}>
<Radio value="1">普通实训</Radio>
<Radio value="2">Jupyter实训</Radio>
</Radio.Group>,
)}
</Form.Item>
</Form.Item>:""}
<Form.Item
label="名称"
className="mt15"

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-12 09:01:30
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-13 15:27:13
* @LastEditTime: 2019-12-13 21:02:48
*/
import types from "./actionTypes";
import { message } from 'antd';
@ -25,18 +25,18 @@ export const getJupyterInfo = (id) => {
if (res.data.status === 401) return;
if (res.status === 200) {
const { data } = res;
if (data.status === 0) {
dispatch({
type: types.SAVE_JUPYTER_INFO,
payload: data
});
const { identifier, myshixun_identifier } = data;
dispatch(saveJupyterIdentifier(identifier));
// 调用获取数据集接口
dispatch(getJupyterTpiDataSet(identifier, jupyter_pagination));
// 调用获取url接口
dispatch(getJupyterTpiUrl({identifier: myshixun_identifier}));
}
// if (data.status === 0) {
dispatch({
type: types.SAVE_JUPYTER_INFO,
payload: data
});
const { identifier, myshixun_identifier } = data;
dispatch(saveJupyterIdentifier(identifier));
// 调用获取数据集接口
dispatch(getJupyterTpiDataSet(identifier, jupyter_pagination));
// 调用获取url接口
dispatch(getJupyterTpiUrl({identifier: myshixun_identifier}));
// }
}
})
}

@ -138,7 +138,7 @@
text-align: center;
border-radius:5px;
border:1px solid #FF6802;
margin-top: 4px;
margin-top: 3px;
}
.jupytertextp{

Loading…
Cancel
Save