king
2023-06-20 b33d3bdee2e5705937af6ff1f2fed45d778c9a36
src/tabviews/zshare/topSearch/index.jsx
@@ -15,7 +15,7 @@
import './index.scss'
const MutilForm = asyncSpinComponent(() => import('./advanceform'))
const MKCheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheckCard'))
const MKCheckCard = asyncComponent(() => import('./mkCheckCard'))
const MKCheck = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheck'))
const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch'))
const MKSelect = asyncComponent(() => import('./mkSelect'))
@@ -156,6 +156,9 @@
        // 数据源查询语句
        if (item.resourceType === '1' && item.dataSource) {
          if (item.multiple === 'dropdown') {
            item.parentField = 'pid'
          }
          let _option = Utils.getSelectQueryOptions(item)
          if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
@@ -178,6 +181,10 @@
          }
        }
        item.oriOptions = fromJS(item.options).toJS()
        if (item.type === 'checkcard' && item.multiple === 'dropdown' && item.resourceType === '0') {
          this.resetCheckcard(item)
        }
      }
      fieldMap.set(item.field, item)
@@ -223,6 +230,37 @@
        this.improveSearch(mainItems, localItems)
      }
    })
  }
  resetCheckcard = (item) => {
    let _options = []
    let _others = []
    item.oriOptions.forEach(op => {
      if (op.pid === item.mark) {
        _options.push(op)
      } else {
        _others.push(op)
      }
    })
    _options = _options.map(op => {
      op.children = []
      _others = _others.filter(cell => {
        if (cell.pid === op.$value) {
          op.children.push(cell)
          return false
        }
        return true
      })
      op.subIds = op.children.map(cell => cell.$value)
      return op
    })
    item.oriOptions = _options
    item.options = _options
  }
  // 查询下拉菜单
@@ -432,6 +470,10 @@
        })
        item.oriOptions = [...item.oriOptions, ...options]
        if (item.type === 'checkcard' && item.multiple === 'dropdown') {
          this.resetCheckcard(item)
        }
      }
      if (item.linkField) {