chromesetting
杨树明 5 years ago
parent 709d120c88
commit 58151da5d9

@ -64,7 +64,8 @@ export default class Shixuninformation extends Component {
opentime: false, opentime: false,
oldscope_partment: [], oldscope_partment: [],
scope_partment: [], scope_partment: [],
loading: false loading: false,
opening_timetype:false
} }
} }
@ -113,7 +114,8 @@ export default class Shixuninformation extends Component {
onChangeTimePicker = (value, dateString) => { onChangeTimePicker = (value, dateString) => {
this.setState({ 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 loading: true
}) })
let {can_copy, use_scope, scope_partment, opening_time} = this.state; 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 id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`; let url = `/shixuns/${id}/update_permission_setting.json`;
@ -138,11 +149,23 @@ export default class Shixuninformation extends Component {
if (response.data.status === -1) { if (response.data.status === -1) {
} else { } 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.props.showNotification("权限配置保存成功!")
this.setState({ this.setState({
loading: false loading: false,
scope_partment:[],
oldscope_partment:list
}) })
this.props.getdatas("3")
} }
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
@ -171,23 +194,30 @@ export default class Shixuninformation extends Component {
datalist = [] datalist = []
} }
datalist.push(e)
let scopetype = false; let scopetype = false;
if(scope_partment.length>0){
scope_partment.map((item, key) => { scope_partment.map((item, key) => {
if (item === e) { if (item === e) {
debugger
scopetype = true scopetype = true
} }
}) })
}
if(oldscope_partment.length>0){
oldscope_partment.map((item, key) => { oldscope_partment.map((item, key) => {
if (item === e) { if (item === e) {
debugger
scopetype = true scopetype = true
} }
}) })
}
if (scopetype === false) { if (scopetype === false) {
datalist.push(e)
this.setState({ this.setState({
scope_partment: datalist scope_partment: datalist
}); });
@ -354,6 +384,7 @@ export default class Shixuninformation extends Component {
<div className={"both"}></div> <div className={"both"}></div>
{this.state.opentime === false ? "" : <div className="mt20 ml25"> {this.state.opentime === false ? "" : <div className="mt20 ml25">
<DatePicker <DatePicker
className={this.state.opening_timetype===true?"bor-red":""}
showToday={false} showToday={false}
showTime={{format: 'HH:mm'}} showTime={{format: 'HH:mm'}}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
@ -367,6 +398,7 @@ export default class Shixuninformation extends Component {
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
/> />
</div>} </div>}
<div className={this.state.opening_timetype===true?"color-red mt10 ml20":"none"}>请选择开启时间</div>
</span> </span>
</div> </div>

Loading…
Cancel
Save