| | |
| | | } |
| | | |
| | | componentDidMount() { |
| | | if (!window.GLOB.designView) { |
| | | if (window.GLOB.systemIcons) { |
| | | this.setState({cusicons: window.GLOB.systemIcons}) |
| | | } else { |
| | | this.getIcons() |
| | | } |
| | | if (!window.GLOB.designView && window.GLOB.systemIcons) { |
| | | this.setState({cusicons: window.GLOB.systemIcons}) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | getIcons = () => { |
| | | const { selectIcon } = this.state |
| | | |
| | | Api.getCloudConfig({ func: 's_get_icons' }).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | |
| | | window.GLOB.systemIcons = icons |
| | | |
| | | this.setState({cusicons: icons}) |
| | | |
| | | if (icons.length > 0 && selectIcon && /<svg/.test(selectIcon)) { |
| | | setTimeout(() => { |
| | | let node = document.getElementById('mk-custom-tab') |
| | | node && node.click() |
| | | }, 200) |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | this.setState({visible: true}) |
| | | |
| | | if (cusicons.length > 0 && selectIcon && /<svg/.test(selectIcon)) { |
| | | if (!window.GLOB.designView && !window.GLOB.systemIcons) { |
| | | this.getIcons() |
| | | } else if (cusicons.length > 0 && selectIcon && /<svg/.test(selectIcon)) { |
| | | setTimeout(() => { |
| | | let node = document.getElementById('mk-custom-tab') |
| | | node && node.click() |