Commit 4d8c9fc3 authored by Sixiang_Zzb's avatar Sixiang_Zzb

新增服务范围权限

parent 1fdc4efe
......@@ -9,6 +9,7 @@ class TagSelect extends React.Component {
inputValue: '',
editInputIndex: -1,
editInputValue: '',
permissionArr: [],
};
// componentDidUpdate(value) {
......@@ -17,17 +18,24 @@ class TagSelect extends React.Component {
// console.log(value);
// }
// componentDidMount(value) {
// console.log('--组件加载完成--');
// console.log(this.state.value);
// console.log(value);
// }
componentDidMount() {
// console.log('--组件加载完成--');
// console.log(this.state.value);
// console.log(value);
this.setState({
permissionArr: JSON.parse(localStorage.getItem('permission') || ''),
});
}
componentWillReceiveProps(value) {
this.setState({ value: value.value });
}
handleClose = (removedTag, e) => {
if (this.state.permissionArr.indexOf('70') < 0) {
message.error('No Permissions!!!', 3);
return;
}
console.log(removedTag, e);
const that = this;
confirm({
......@@ -47,6 +55,10 @@ class TagSelect extends React.Component {
};
showInput = () => {
if (this.state.permissionArr.indexOf('69') < 0) {
message.error('No Permissions!!!', 3);
return;
}
this.setState({ inputVisible: true }, () => this.input.focus());
};
......@@ -103,7 +115,15 @@ class TagSelect extends React.Component {
};
render() {
const { value, inputVisible, inputValue, editInputIndex, editInputValue, visible } = this.state;
const {
value,
inputVisible,
inputValue,
editInputIndex,
editInputValue,
visible,
permissionArr,
} = this.state;
return (
<>
{value.map((tag, index) => {
......@@ -136,6 +156,11 @@ class TagSelect extends React.Component {
>
<span
onDoubleClick={(e) => {
if (permissionArr.indexOf('68') < 0) {
message.error('No Permissions!!!', 3);
return;
}
if (index !== 0 && index !== 1) {
this.setState({ editInputIndex: index, editInputValue: tag }, () => {
this.editInput.focus();
......
......@@ -88,6 +88,10 @@ const ServiceProviderManagement = (props: propsType) => {
};
const goToServices = () => {
if (permissionArr.indexOf('67') < 0) {
message.error('No Permissions!!!', 3);
return;
}
history.push(location.pathname + '/Services');
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment