king
2021-07-06 71d4765ba3cdc4a004687cd37a529b565e9ea9fd
src/templates/zshare/editcomponent/index.jsx
@@ -141,26 +141,10 @@
            config: _config
          })
        })
      } else if (options.includes('search') && (res.copyType === 'search' || res.copyType === 'form')) {
      } else if (options.includes('search') && res.copyType === 'search') {
        res.uuid = Utils.getuuid()
        _config.search = _config.search.filter(item => !item.origin)
        let keys = _config.search.map(item => item.field.toLowerCase())
        // search: text select multiselect link date dateweek datemonth daterange group
        // form: text number select multiselect link switch checkbox radio checkcard
        //       fileupload date datemonth datetime textarea hint color funcvar
        if (res.copyType === 'form') {
          if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) {
            res.type = 'text'
          } else if (res.type === 'radio') {
            res.type = 'select'
          } else if (res.type === 'checkbox') {
            res.type = 'multiselect'
          } else if (res.type === 'datetime') {
            res.type = 'date'
          }
        }
        res.copyType = 'search'
        _config.search.push(res)
@@ -206,20 +190,10 @@
            config: _config
          })
        })
      } else if (options.includes('form') && (res.copyType === 'form' || res.copyType === 'search')) {
      } else if (options.includes('form') && res.copyType === 'form') {
        let fields = []
        let labels = []
        res.uuid = Utils.getuuid()
        // search: text select multiselect link date dateweek datemonth daterange group
        // form: text number select multiselect link switch checkbox radio checkcard
        //       fileupload date datemonth datetime textarea hint color funcvar
        if (res.copyType === 'search') {
          if (res.type === 'dateweek' || res.type === 'daterange' || res.type === 'group') {
            res.type = 'date'
          }
        }
        res.copyType = 'form'
        _config.fields.forEach(item => {
          item.field && fields.push(item.field.toLowerCase())