diff --git a/public/react/src/modules/tpm/TPMsettings/Configuration.js b/public/react/src/modules/tpm/TPMsettings/Configuration.js index 9bf457993..b47644719 100644 --- a/public/react/src/modules/tpm/TPMsettings/Configuration.js +++ b/public/react/src/modules/tpm/TPMsettings/Configuration.js @@ -64,7 +64,8 @@ export default class Shixuninformation extends Component { opentime: false, oldscope_partment: [], scope_partment: [], - loading: false + loading: false, + opening_timetype:false } } @@ -113,7 +114,8 @@ export default class Shixuninformation extends Component { onChangeTimePicker = (value, dateString) => { this.setState({ - opening_time: dateString === "" ? "" : handleDateStrings(dateString) + opening_time: dateString === "" ? "" : handleDateStrings(dateString), + opening_timetype:false }) } @@ -122,6 +124,15 @@ export default class Shixuninformation extends Component { loading: true }) let {can_copy, use_scope, scope_partment, opening_time} = this.state; + if(this.state.opentime===true){ + if(opening_time===null){ + this.setState({ + opening_timetype:true + }) + + return + } + } let id = this.props.match.params.shixunId; let url = `/shixuns/${id}/update_permission_setting.json`; @@ -138,11 +149,23 @@ export default class Shixuninformation extends Component { if (response.data.status === -1) { } else { - this.props.getdatas("3") + + let list=[] + scope_partment.map((item,key)=>{ + list.push(item) + }) + + oldscope_partment.map((item,key)=>{ + list.push(item) + }) + this.props.showNotification("权限配置保存成功!") this.setState({ - loading: false + loading: false, + scope_partment:[], + oldscope_partment:list }) + this.props.getdatas("3") } }).catch((error) => { this.setState({ @@ -171,23 +194,30 @@ export default class Shixuninformation extends Component { datalist = [] } - datalist.push(e) - let scopetype = false; - scope_partment.map((item, key) => { - if (item === e) { - scopetype = true - } - }) + if(scope_partment.length>0){ + scope_partment.map((item, key) => { + if (item === e) { + debugger + scopetype = true + } + }) + } + + if(oldscope_partment.length>0){ + oldscope_partment.map((item, key) => { + if (item === e) { + debugger + scopetype = true + } + }) + } + - oldscope_partment.map((item, key) => { - if (item === e) { - scopetype = true - } - }) if (scopetype === false) { + datalist.push(e) this.setState({ scope_partment: datalist }); @@ -354,6 +384,7 @@ export default class Shixuninformation extends Component {
{this.state.opentime === false ? "" :