king
2023-06-25 5025901e459ae49d85210573ad38fb3f3c1d9230
src/tabviews/custom/components/tree/antd-tree/index.jsx
@@ -260,7 +260,7 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.loaded = true
      if (config.$cache) {
      if (config.$cache && config.setting.onload !== 'false') {
        Api.writeCacheConfig(config.uuid, result.data || '')
      }
@@ -270,17 +270,39 @@
      }, () => {
        this.handleData()
      })
      if (config.timer && config.clearField && result.data && result.data[0]) {
        let vals = (config.clearValue || '').split(',')
        if (vals.includes(result.data[0][config.clearField])) {
          this.timer && this.timer.stop()
        }
      }
      if (result.message) {
        if (result.ErrCode === 'Y') {
          Modal.success({
            title: result.message
          })
        } else if (result.ErrCode === 'S') {
          notification.success({
            top: 92,
            message: result.message,
            duration: 2
          })
        }
      }
    } else {
      this.setState({
        loading: false
      })
      this.timer && this.timer.stop()
      
      if (!result.message) return
      if (result.ErrCode === 'N') {
        Modal.error({
          title: result.message,
        })
      } else {
      } else if (result.ErrCode !== '-2') {
        notification.error({
          top: 92,
          message: result.message,
@@ -332,6 +354,7 @@
      if (pval === config.wrap.mark) {
        parentNodes.push({
          ...item,
          mk_floor: 1,
          $$uuid: uuid,
          $title: item[config.wrap.labelField] || '',
          $key: val,
@@ -348,7 +371,7 @@
      }
    })
    let _treedata = this.getTree(parentNodes, _options)
    let _treeNodes = []
    if (!searchkey) {
@@ -430,6 +453,7 @@
      // 添加菜单的子元素
      options = options.filter(option => {
        if (option.$parentId === parent.$key) {
          option.mk_floor = parent.mk_floor + 1
          parent.children.push(option)
          return false
        }