king
2021-07-18 294a5ca15f02aa2e216b8c0e2829a17d9a2ab5d0
2021-07-18
2个文件已修改
54 ■■■■■ 已修改文件
src/views/interface/workspace/editTable/index.jsx 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/interface/workspace/request/index.scss 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/interface/workspace/editTable/index.jsx
@@ -173,34 +173,29 @@
    })
  }
  handleAdd = (e) => {
    e.stopPropagation()
    const { dataSource, selectedRowKeys } = this.state
    const item = {
      uuid: Utils.getuuid(),
      key: '',
      value: '',
      description: '',
      selected: true
    }
    let _data = [...dataSource, item]
    this.setState({
      dataSource: _data,
      selectedRowKeys: [...selectedRowKeys, item.uuid]
    }, () => {
      this.props.onChange(_data)
    })
  }
  handleSave = row => {
    const newData = this.state.dataSource.map(item => {
    let newData = this.state.dataSource.map(item => {
      if (row.uuid === item.uuid) return row
      return item
    })
    this.setState({ dataSource: newData }, () => {
    let selectedRowKeys = this.state.selectedRowKeys
    let last = newData[newData.length - 1]
    if (last.key || last.value || last.description) {
      const item = {
        uuid: Utils.getuuid(),
        key: '',
        value: '',
        description: '',
        selected: true
      }
      newData = [...newData, item]
      selectedRowKeys = [...selectedRowKeys, item.uuid]
    }
    this.setState({ dataSource: newData, selectedRowKeys }, () => {
      this.props.onChange(newData)
    })
  }
@@ -237,7 +232,6 @@
    })
    return (
      <div className="params-edit-table">
        <Icon className="add-row" type="plus" onClick={this.handleAdd} />
        <Table
          rowKey="uuid"
          components={components}
src/views/interface/workspace/request/index.scss
@@ -8,6 +8,10 @@
  .request-interface {
    background: #ffffff;
    margin-bottom: 10px;
    .ant-input-group.ant-input-group-compact > *:not(:last-child) {
      border-right-width: 0px;
    }
    .ant-select-selection {
      height: 40px;
      width: 90px;
@@ -74,16 +78,24 @@
    line-height: 40px;
    padding-left: 15px;
    border-top: 1px solid #e8e8e8;
    .ant-radio-wrapper {
      margin-right: 20px;
    }
  }
  .body-content {
    display: none;
    .no-body {
      color: rgba(0, 0, 0, 0.45);
      border-top: 1px solid #e8e8e8;
      border-bottom: 1px solid #e8e8e8;
      text-align: center;
      height: 40px;
      line-height: 40px;
    }
    .CodeMirror {
      height: 200px;
      line-height: 1.5;
    }
  }
  .body-content.show {
    display: block;