king
2025-01-23 0f6010e63f46f4282267cbdd3b029ed0f90310f4
2025-01-23
7个文件已修改
273 ■■■■■ 已修改文件
src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/markcomponent/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/components/login/normal-login/options.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.jsx 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.scss 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardsimplecomponent/node-wrap/menus/index.jsx
@@ -62,7 +62,6 @@
        dataIndex: 'remark',
        inputType: 'input',
        editable: true,
        unique: false,
        required: false,
        width: '20%'
      }
src/menu/components/share/markcomponent/index.jsx
@@ -36,15 +36,8 @@
        uniqueFunc: (data, item) => {
          let index = data.findIndex(mark => mark.uuid !== item.uuid && mark.contrastValue === item.contrastValue && mark.match === item.match && mark.field.join('') === item.field.join(''))
          if (index > -1) {
            notification.warning({
              top: 92,
              message: '此标记已存在!',
              duration: 5
            })
            return false
          }
          return true
          if (index > -1) return '此标记已存在!'
          return ''
        },
        inputType: 'cascader',
        options: [],
src/pc/components/login/normal-login/options.jsx
@@ -264,7 +264,6 @@
          dataIndex: 'link',
          inputType: 'input',
          editable: true,
          unique: true,
          required: true,
          width: '40%'
        },
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -617,8 +617,8 @@
  columnChange = (values, callback) => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    let fields = verify.columns.map(item => item.Column)
    if (fields.includes(values.Column)) {
    let fields = verify.columns.map(item => item.Column.toLowerCase())
    if (fields.includes(values.Column.toLowerCase())) {
      notification.warning({
        top: 92,
        message: values.Column + '字段已存在!',
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -41,6 +41,7 @@
        inputType: 'input',
        editable: true,
        unique: true,
        strict: true,
        searchable: true,
        copy: true,
        width: '16%'
@@ -51,7 +52,6 @@
        inputType: 'input',
        editable: true,
        searchable: true,
        unique: true,
        width: '16%'
      },
      {
@@ -494,8 +494,8 @@
  columnChange = (values, callback) => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    let fields = verify.columns.map(item => item.Column)
    if (fields.includes(values.Column)) {
    let fields = verify.columns.map(item => item.Column.toLowerCase())
    if (fields.includes(values.Column.toLowerCase())) {
      notification.warning({
        top: 92,
        message: values.Column + '字段已存在!',
src/templates/zshare/editTable/index.jsx
@@ -485,42 +485,64 @@
      return
    }
    let ucol = columns.filter(col => col.unique === true)[0]
    const that = this
    if (data.length === 0) {
    if (res.type === 'line') {
      let unique = true
      res.data.uuid = Utils.getuuid()
      columns.forEach(col => {
        if (col.unique !== true || !unique) return
        data.push(res.data)
      } else if (res.type === 'array') {
        res.data.forEach(cell => {
          cell.uuid = Utils.getuuid()
          data.push(cell)
        })
      }
      this.setState({ data, editingKey: '', editLineId: res.type === 'line' ? res.data.uuid : '' }, () => {
        this.props.onChange(data)
      })
    } else if (res.type === 'line') {
      let index = -1
      res.data.uuid = Utils.getuuid()
        if (col.uniqueFunc) {
          unique = col.uniqueFunc(data, res.data)
        } else if (col.strict) {
          let key = res.data[col.dataIndex].toLowerCase()
          let _index = data.findIndex(item => key === item[col.dataIndex].toLowerCase())
      if (ucol) {
        if (ucol.uniqueFunc) {
          let msg = ucol.uniqueFunc(data, res.data)
          if (_index > -1) {
          if (msg) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
              message: msg,
              duration: 5
            })
            unique = false
            callback()
            return
          }
        } else if (ucol.strict) {
          let key = res.data[ucol.dataIndex].toLowerCase()
          index = data.findIndex(item => key === item[ucol.dataIndex].toLowerCase())
        } else {
          let _index = data.findIndex(item => res.data[col.dataIndex] === item[col.dataIndex])
          if (_index > -1) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
              duration: 5
            })
            unique = false
          index = data.findIndex(item => res.data[ucol.dataIndex] === item[ucol.dataIndex])
          }
        }
      if (index > -1) {
        callback()
        data.splice(index, 1, res.data)
        confirm({
          title: `${ucol.title}(${res.data[ucol.dataIndex]})已存在!`,
          okText: '知道了',
          cancelText: '替换',
          onOk() {},
          onCancel() {
            that.setState({ data, editingKey: '', editLineId: res.data.uuid || '' }, () => {
              that.props.onChange(data)
      })
      if (!unique) return
          }
        })
        return
      } else {
      if (type === 'excelcolumn') {
        data.push(res.data)
      } else {
@@ -530,38 +552,84 @@
      this.setState({ data, editingKey: '', editLineId: res.data.uuid || '' }, () => {
        this.props.onChange(data)
      })
      }
    } else if (res.type === 'array') {
      let repeats = []
      let vals = []
      if (ucol) {
        if (ucol.uniqueFunc) {
        } else if (ucol.strict) {
          vals = data.map(item => item[ucol.dataIndex].toLowerCase())
        } else {
          vals = data.map(item => item[ucol.dataIndex])
        }
      }
      res.data.forEach(cell => {
        let unique = true
        cell.uuid = Utils.getuuid()
        columns.forEach(col => {
          if (col.unique !== true || !unique) return
          if (col.uniqueFunc) {
            unique = col.uniqueFunc(data, cell)
          } else if (col.strict) {
            let _index = data.findIndex(item => cell[col.dataIndex].toLowerCase() === item[col.dataIndex].toLowerCase())
        if (ucol) {
          let unique = true
          if (ucol.uniqueFunc) {
            let msg = ucol.uniqueFunc(data, cell)
  
            if (_index > -1) {
              unique = false
            if (msg) return
          } else if (ucol.strict) {
            unique = !vals.includes(cell[ucol.dataIndex].toLowerCase())
          } else {
            unique = !vals.includes(cell[ucol.dataIndex])
          }
          if (unique) {
            data.push(cell)
          } else {
            repeats.push(cell)
            }
          } else {
            let _index = data.findIndex(item => cell[col.dataIndex] === item[col.dataIndex])
            if (_index > -1) {
              unique = false
            }
          }
        })
        if (!unique) return
        data.push(cell)
        }
      })
      if (repeats.length) {
        callback()
        let _data = fromJS(data).toJS().map(cell => {
          let _cell = cell
          repeats.forEach(item => {
            if (ucol.strict) {
              if (cell[ucol.dataIndex].toLowerCase() === item[ucol.dataIndex].toLowerCase()) {
                _cell = item
              }
            } else if (cell[ucol.dataIndex] === item[ucol.dataIndex]) {
              _cell = item
            }
          })
          return _cell
        })
        confirm({
          content: `存在重复的${ucol.title},请选择处理方式。`,
          okText: '跳过',
          cancelText: '替换',
          onOk() {
            that.setState({ data, editingKey: '', editLineId: '' }, () => {
              that.props.onChange(data)
            })
          },
          onCancel() {
            that.setState({ data: _data, editingKey: '', editLineId: '' }, () => {
              that.props.onChange(data)
            })
          }
        })
        return
      } else {
      this.setState({ data, editingKey: '' }, () => {
        this.props.onChange(data)
      })
      }
    }
    callback()
@@ -618,40 +686,36 @@
      return
    }
    let unique = true
    columns.forEach(col => {
      if (col.unique !== true || !unique) return
    let ucol = columns.filter(col => col.unique === true)[0]
    if (ucol) {
      let index = -1
      if (ucol.uniqueFunc) {
        let msg = ucol.uniqueFunc(newData, record)
      if (col.uniqueFunc) {
        unique = col.uniqueFunc(newData, record)
        if (msg) {
          notification.warning({
            top: 92,
            message: msg,
            duration: 5
          })
        return
      } else if (col.strict) {
        let key = record[col.dataIndex].toLowerCase()
        let _index = newData.findIndex(item => record.uuid !== item.uuid && key === item[col.dataIndex].toLowerCase())
        if (_index > -1) {
          notification.warning({
            top: 92,
            message: col.title + '不可重复!',
            duration: 5
          })
          unique = false
        }
      } else if (ucol.strict) {
        let key = record[ucol.dataIndex].toLowerCase()
        index = newData.findIndex(item => record.uuid !== item.uuid && key === item[ucol.dataIndex].toLowerCase())
      } else {
        let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex])
        index = newData.findIndex(item => record.uuid !== item.uuid && record[ucol.dataIndex] === item[ucol.dataIndex])
      }
  
        if (_index > -1) {
      if (index > -1) {
          notification.warning({
            top: 92,
            message: col.title + '不可重复!',
          message: ucol.title + '不可重复!',
            duration: 5
          })
          unique = false
        return
        }
      }
    })
    if (!unique) return
    newData.splice(index, 1, record)
    this.setState({ data: newData, editingKey: '' }, () => {
@@ -704,40 +768,36 @@
        return
      }
      let unique = true
      columns.forEach(col => {
        if (col.unique !== true || !unique) return
      let ucol = columns.filter(col => col.unique === true)[0]
      if (ucol) {
        let _index = -1
        if (ucol.uniqueFunc) {
          let msg = ucol.uniqueFunc(newData, row)
        if (col.uniqueFunc) {
          unique = col.uniqueFunc(newData, row)
          if (msg) {
            notification.warning({
              top: 92,
              message: msg,
              duration: 5
            })
          return
        } else if (col.strict) {
          let key = row[col.dataIndex].toLowerCase()
          let _index = newData.findIndex(item => row.uuid !== item.uuid && key === item[col.dataIndex].toLowerCase())
          if (_index > -1) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
              duration: 5
            })
            unique = false
          }
        } else if (ucol.strict) {
          let key = row[ucol.dataIndex].toLowerCase()
          _index = newData.findIndex(item => row.uuid !== item.uuid && key === item[ucol.dataIndex].toLowerCase())
        } else {
          let _index = newData.findIndex(item => row.uuid !== item.uuid && row[col.dataIndex] === item[col.dataIndex])
          _index = newData.findIndex(item => row.uuid !== item.uuid && row[ucol.dataIndex] === item[ucol.dataIndex])
        }
  
          if (_index > -1) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
            message: ucol.title + '不可重复!',
              duration: 5
            })
            unique = false
          return
          }
        }
      })
      if (!unique) return
      if (index > -1) {
        newData.splice(index, 1, row)
@@ -912,6 +972,10 @@
                ...moveprops
              })}
            />
            {actions.includes('copy') && data.length > 10 ? <span className="footer-copy-control">
              <CopyOutlined title="复制" onClick={() => this.copy()} />
              <PasteBoard getPasteValue={this.pasteSubmit}/>
            </span> : null}
          </DndProvider>
        </div>
      </EditableContext.Provider>
src/templates/zshare/editTable/index.scss
@@ -125,6 +125,18 @@
    font-size: 18px;
    color: #26C281;
  }
  .footer-copy-control {
    text-align: right;
    margin: 10px;
    display: block;
    .anticon-copy {
      margin-right: 15px;
      color: #26C281;
    }
    .anticon-snippets {
      color: purple;
    }
  }
}
.ant-modal.ant-modal-confirm.ant-modal-confirm-info.sql-example {