chromesetting
杨树明 5 years ago
parent 2980aa82af
commit 1d63e7485d

@ -121,9 +121,7 @@ export default class Shixuninformation extends Component {
}
onSubmits = () => {
this.setState({
loading: true
})
let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state;
if(this.state.opentime===true){
if(opening_time===null){
@ -145,6 +143,9 @@ 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,
@ -172,7 +173,9 @@ export default class Shixuninformation extends Component {
})
})
this.setState({
loading: false
})
}
CheckboxonChange = (e) => {
this.setState({

@ -20,7 +20,7 @@ export default class Shixuninformation extends Component {
this.state = {
vnc: false,
hide_code: false,
is_secret_repository: false,
code_edit_permission: false,
code_hidden: false,
forbid_copy: false,
test_set_permission: true,
@ -43,7 +43,7 @@ export default class Shixuninformation extends Component {
hide_code: this.props.data && this.props.data.shixun.hide_code,
task_pass: this.props.data && this.props.data.shixun.task_pass,
test_set_permission: this.props.data && this.props.data.shixun.test_set_permission,
is_secret_repository: this.props.data && this.props.data.shixun.is_secret_repository,
code_edit_permission: this.props.data && this.props.data.shixun.code_edit_permission,
websshshow: this.props.data && this.props.data.shixun.webssh === 0 ? false : true,
multi_webssh: this.props.data && this.props.data.shixun.multi_webssh,
opensshRadio: this.props.data && this.props.data.shixun.webssh === 0 ? null : this.props.data && this.props.data.shixun.webssh,
@ -71,7 +71,7 @@ export default class Shixuninformation extends Component {
hide_code: this.props.data && this.props.data.shixun.hide_code,
task_pass: this.props.data && this.props.data.shixun.task_pass,
test_set_permission: this.props.data && this.props.data.shixun.test_set_permission,
is_secret_repository: this.props.data && this.props.data.shixun.is_secret_repository,
code_edit_permission: this.props.data && this.props.data.shixun.code_edit_permission,
websshshow: this.props.data && this.props.data.shixun.webssh === 0 ? false : true,
multi_webssh: this.props.data && this.props.data.shixun.multi_webssh,
opensshRadio: this.props.data && this.props.data.shixun.webssh === 0 ? null : this.props.data && this.props.data.shixun.webssh,
@ -106,7 +106,7 @@ export default class Shixuninformation extends Component {
test_set_permission: this.state.test_set_permission,
vnc: this.state.vnc,
webssh: this.state.websshshow === false ? 0 : this.state.opensshRadio,
code_edit_permission:this.state.is_secret_repository
code_edit_permission:this.state.code_edit_permission
},
}
).then((response) => {
@ -131,7 +131,7 @@ export default class Shixuninformation extends Component {
if (this.state.vnc === false) {
this.setState({
hide_code: false,
is_secret_repository: false,
code_edit_permission: false,
code_hidden: false,
forbid_copy: false,
multi_webssh: false,
@ -146,7 +146,7 @@ export default class Shixuninformation extends Component {
Checkhide_code = () => {
if (this.state.hide_code === false) {
this.setState({
is_secret_repository: false
code_edit_permission: false
})
}
this.setState({
@ -156,7 +156,7 @@ export default class Shixuninformation extends Component {
Checkis_secret_repository = () => {
this.setState({
is_secret_repository: !this.state.is_secret_repository
code_edit_permission: !this.state.code_edit_permission
})
}
@ -289,7 +289,7 @@ export default class Shixuninformation extends Component {
<span className="color-grey-6 mt5 fl font-16 ml33" style={{minWidth: '45px'}}>公开版本库</span>
<span className="fl mt8">
<Checkbox
checked={this.state.is_secret_repository}
checked={this.state.code_edit_permission}
onChange={this.Checkis_secret_repository}></Checkbox>
<label style={{top: '6px'}} className="color-grey-9 ml10">选中则允许学员修改版本库中的全部文件</label>
</span>

Loading…
Cancel
Save