king
2022-05-07 4590502dd26419fd190045d84fbf11eccb6093f7
src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -85,7 +85,7 @@
    status.requestMode = status.requestMode || 'system'
    status.procMode = status.procMode || 'script'
    status.callbackType = status.callbackType || 'script'
    let regoptions = Utils.getRegOptions(search)
    let regoptions = this.getRegOptions(search)
    if (config.urlFields && config.urlFields.length > 0) {
      config.urlFields.forEach(field => {
@@ -128,6 +128,58 @@
    })
  }
  getRegOptions = (searches) => {
    if (!searches || searches.length === 0) return []
    let options = []
    let fieldmap = new Map()
    searches.forEach(search => {
      let item = {
        key: search.field,
        value: '0'
      }
      if (fieldmap.has(item.key)) {
        item.key = item.key + '1'
      }
      fieldmap.set(item.key, true)
      if (search.type === 'group') {
        options.push({
          key: search.field,
          value: '0'
        })
        options.push({
          key: search.datefield,
          value: '0'
        })
        options.push({
          key: search.datefield + '1',
          value: '0'
        })
        options.push(item)
      } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) {
        options.push(item)
        options.push({
          key: item.key + '1',
          value: '0'
        })
      } else if (search.type === 'text' || search.type === 'select') {
        item.key.split(',').forEach(field => {
          let cell = JSON.parse(JSON.stringify(item))
          cell.key = field
          options.push(cell)
        })
      } else {
        options.push(item)
      }
    })
    return options
  }
  /**
   * @description 获取全部搜索条件
   * @param {Array} searches 搜索条件数组