king
2021-06-24 95afd40fc2741ac0ce59c2091f6cfce1f98877d4
src/templates/zshare/editcomponent/index.jsx
@@ -21,7 +21,7 @@
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    thawVisible: false,
    thawbtnlist: null,
    pasteVisible: false,
@@ -150,7 +150,7 @@
        // 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', 'checkcard', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) {
          if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) {
            res.type = 'text'
          } else if (res.type === 'radio') {
            res.type = 'select'
@@ -221,25 +221,13 @@
        }
        res.copyType = 'form'
        if (_config.groups.length > 0) {
          _config.groups.forEach(group => {
            group.sublist.forEach(item => {
              fields.push(item.field.toLowerCase())
              labels.push(item.label)
            })
            if (group.default) {
              group.sublist.push(res)
            }
          })
        } else {
          _config.fields.forEach(item => {
            fields.push(item.field.toLowerCase())
            labels.push(item.label)
          })
          _config.fields.push(res)
        }
        _config.fields.forEach(item => {
          item.field && fields.push(item.field.toLowerCase())
          labels.push(item.label)
        })
        _config.fields.push(res)
        if (fields.includes(res.field.toLowerCase())) {
        if (res.field && fields.includes(res.field.toLowerCase())) {
          notification.warning({
            top: 92,
            message: '字段已存在!',
@@ -312,10 +300,7 @@
          onCancel={() => {this.setState({pasteVisible: false})}}
          destroyOnClose
        >
          <PasteForm
            dict={dict}
            wrappedComponentRef={(inst) => this.pasteFormRef = inst}
          />
          <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst}/>
        </Modal>
      </div>
    )