king
2020-04-03 4c6bdfe1f3557e49a315c1564bcb6164c0bc7faa
src/templates/subtableconfig/index.jsx
@@ -496,13 +496,39 @@
          })
        }
        let fieldrepet = false // 字段重复
        let labelrepet = false // 提示文字重复
        let _search = config.search.map(item => {
          if (item.uuid !== res.uuid && item.field === res.field) {
            fieldrepet = true
          } else if (item.uuid !== res.uuid && item.field && item.label === res.label) {
            labelrepet = true
          }
          if (item.uuid === res.uuid) {
            return res
          } else {
            return item
          }
        })
        if (fieldrepet) {
          notification.warning({
            top: 92,
            message: '字段已存在!',
            duration: 10
          })
          return
        } else if (labelrepet) {
          notification.warning({
            top: 92,
            message: '名称已存在!',
            duration: 10
          })
          return
        }
        _search = _search.filter(item => !item.origin)
        this.setState({
@@ -610,13 +636,39 @@
      })
    } else if (modaltype === 'columns' || modaltype === 'colspan') {
      this.columnFormRef.handleConfirm().then(res => {
        let fieldrepet = false // 字段重复
        let labelrepet = false // 提示文字重复
        let _columns = config.columns.map(item => {
          if (item.uuid !== res.uuid && item.field === res.field) {
            fieldrepet = true
          } else if (item.uuid !== res.uuid && item.field && item.label === res.label) {
            labelrepet = true
          }
          if (item.uuid === res.uuid) {
            return res
          } else {
            return item
          }
        })
        if (fieldrepet) {
          notification.warning({
            top: 92,
            message: '字段已存在!',
            duration: 10
          })
          return
        } else if (labelrepet) {
          notification.warning({
            top: 92,
            message: '名称已存在!',
            duration: 10
          })
          return
        }
        _columns = _columns.filter(item => !item.origin)
        this.setState({