king
2024-03-15 6e7e09300fdbe74e7cb453a80d2de42caf54b39c
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -227,12 +227,12 @@
        dataIndex: 'operation',
        render: (text, record) =>
          (<div style={{textAlign: 'center'}}>
            <span className="operation-btn" title="编辑" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span>
            <span className="operation-btn" title="状态切换" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span>
            <span className="operation-btn" title="编辑" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span>
            <span className="operation-btn" title="状态切换" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span>
            <Popconfirm
              overlayClassName="popover-confirm"
              title="确定删除吗?"
              onConfirm={() => this.handleDelete(record, 'scripts')
              onConfirm={() => this.handleDelete(record)
            }>
              <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
            </Popconfirm>
@@ -392,14 +392,9 @@
    })
  }
  handleEdit = (record, type) => {
    let node = null
    if (type === 'scripts') {
      this.scriptsForm.edit(record)
      node = document.getElementById('mk-exout-script')
    }
  handleEdit = (record) => {
    this.scriptsForm.edit(record)
    let node = document.getElementById('mk-exout-script')
    if (node && node.scrollTop) {
      let inter = Math.ceil(node.scrollTop / 10)
@@ -415,19 +410,17 @@
    }
  }
  handleStatus = (record, type) => {
  handleStatus = (record) => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    record.status = record.status === 'false' ? 'true' : 'false'
    if (type === 'scripts') {
      verify.scripts = verify.scripts.map(item => {
        if (item.uuid === record.uuid) {
          return record
        } else {
          return item
        }
      })
    }
    verify.scripts = verify.scripts.map(item => {
      if (item.uuid === record.uuid) {
        return record
      } else {
        return item
      }
    })
    this.setState({
      verify: verify
@@ -459,38 +452,12 @@
    })
  }
  handleDelete = (record, type) => {
    const { verify } = this.state
  handleDelete = (record) => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    verify.columns = verify.columns.filter(item => item.uuid !== record.uuid)
    verify.scripts = verify.scripts.filter(item => item.uuid !== record.uuid)
    this.setState({ verify: verify })
  }
  handleUpDown = (record, type, direction) => {
    let verify = JSON.parse(JSON.stringify(this.state.verify))
    let index = 0
    verify.columns = verify.columns.filter((item, i) => {
      if (item.uuid === record.uuid) {
        index = i
      }
      return item.uuid !== record.uuid
    })
    if ((index === 0 && direction === 'up') || (index === verify.columns.length && direction === 'down')) {
      return
    }
    if (direction === 'up') {
      verify.columns.splice(index - 1, 0, record)
    } else {
      verify.columns.splice(index + 1, 0, record)
    }
    this.setState({
      verify: verify
    })
  }
  showError = (errorType) => {