king
2023-08-23 547e5fe219ee7bee309ecd67db74bc8df66b5433
src/components/mkIcon/index.jsx
@@ -46,12 +46,8 @@
  }
  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})
    }
  }
@@ -65,6 +61,8 @@
  }
  getIcons = () => {
    const { selectIcon } = this.state
    Api.getCloudConfig({ func: 's_get_icons' }).then(res => {
      if (!res.status) {
        notification.warning({
@@ -84,6 +82,13 @@
      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)
      }
    })
  }
@@ -92,7 +97,9 @@
    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()