Commit 58c7aac0 authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

parents 00b9f6eb 4d8c9fc3
...@@ -9,6 +9,7 @@ class TagSelect extends React.Component { ...@@ -9,6 +9,7 @@ class TagSelect extends React.Component {
inputValue: '', inputValue: '',
editInputIndex: -1, editInputIndex: -1,
editInputValue: '', editInputValue: '',
permissionArr: [],
}; };
// componentDidUpdate(value) { // componentDidUpdate(value) {
...@@ -17,17 +18,24 @@ class TagSelect extends React.Component { ...@@ -17,17 +18,24 @@ class TagSelect extends React.Component {
// console.log(value); // console.log(value);
// } // }
// componentDidMount(value) { componentDidMount() {
// console.log('--组件加载完成--'); // console.log('--组件加载完成--');
// console.log(this.state.value); // console.log(this.state.value);
// console.log(value); // console.log(value);
// } this.setState({
permissionArr: JSON.parse(localStorage.getItem('permission') || ''),
});
}
componentWillReceiveProps(value) { componentWillReceiveProps(value) {
this.setState({ value: value.value }); this.setState({ value: value.value });
} }
handleClose = (removedTag, e) => { handleClose = (removedTag, e) => {
if (this.state.permissionArr.indexOf('70') < 0) {
message.error('No Permissions!!!', 3);
return;
}
console.log(removedTag, e); console.log(removedTag, e);
const that = this; const that = this;
confirm({ confirm({
...@@ -47,6 +55,10 @@ class TagSelect extends React.Component { ...@@ -47,6 +55,10 @@ class TagSelect extends React.Component {
}; };
showInput = () => { showInput = () => {
if (this.state.permissionArr.indexOf('69') < 0) {
message.error('No Permissions!!!', 3);
return;
}
this.setState({ inputVisible: true }, () => this.input.focus()); this.setState({ inputVisible: true }, () => this.input.focus());
}; };
...@@ -103,7 +115,15 @@ class TagSelect extends React.Component { ...@@ -103,7 +115,15 @@ class TagSelect extends React.Component {
}; };
render() { render() {
const { value, inputVisible, inputValue, editInputIndex, editInputValue, visible } = this.state; const {
value,
inputVisible,
inputValue,
editInputIndex,
editInputValue,
visible,
permissionArr,
} = this.state;
return ( return (
<> <>
{value.map((tag, index) => { {value.map((tag, index) => {
...@@ -136,6 +156,11 @@ class TagSelect extends React.Component { ...@@ -136,6 +156,11 @@ class TagSelect extends React.Component {
> >
<span <span
onDoubleClick={(e) => { onDoubleClick={(e) => {
if (permissionArr.indexOf('68') < 0) {
message.error('No Permissions!!!', 3);
return;
}
if (index !== 0 && index !== 1) { if (index !== 0 && index !== 1) {
this.setState({ editInputIndex: index, editInputValue: tag }, () => { this.setState({ editInputIndex: index, editInputValue: tag }, () => {
this.editInput.focus(); this.editInput.focus();
......
...@@ -88,6 +88,10 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -88,6 +88,10 @@ const ServiceProviderManagement = (props: propsType) => {
}; };
const goToServices = () => { const goToServices = () => {
if (permissionArr.indexOf('67') < 0) {
message.error('No Permissions!!!', 3);
return;
}
history.push(location.pathname + '/Services'); 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