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

@ -121,9 +121,7 @@ export default class Shixuninformation extends Component {
} }
onSubmits = () => { onSubmits = () => {
this.setState({
loading: true
})
let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state; let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state;
if(this.state.opentime===true){ if(this.state.opentime===true){
if(opening_time===null){ if(opening_time===null){
@ -145,6 +143,9 @@ export default class Shixuninformation extends Component {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`; let url = `/shixuns/${id}/update_permission_setting.json`;
this.setState({
loading: true
})
axios.post(url, axios.post(url,
{ {
scope_partment: list, scope_partment: list,
@ -172,7 +173,9 @@ export default class Shixuninformation extends Component {
}) })
}) })
this.setState({
loading: false
})
} }
CheckboxonChange = (e) => { CheckboxonChange = (e) => {
this.setState({ this.setState({

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

Loading…
Cancel
Save