king
2022-10-22 03a22ec6f9ad7303d10b4c65bb5bc6fa5cbd448a
src/menu/datasource/verifycard/index.jsx
@@ -26,7 +26,6 @@
class VerifyCard extends Component {
  static propTpyes = {
    dict: PropTypes.object,          // 字典项
    config: PropTypes.object,        // 组件配置信息
  }
@@ -149,11 +148,11 @@
        dataIndex: 'operation',
        render: (text, record) =>
          (<div style={{textAlign: 'center'}}>
            <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span>
            <span className="operation-btn" title={this.props.dict['model.status.change']} onClick={() => this.handleStatus(record)} 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={this.props.dict['model.query.delete']}
              title="确定删除吗?"
              onConfirm={() => this.deleteScript(record)
            }>
              <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
@@ -740,6 +739,7 @@
  }
  pasteSubmit = () => {
    const { config } = this.props
    const { setting } = this.state
    this.pasteFormRef.handleConfirm().then(res => {
@@ -763,21 +763,35 @@
        res.data.setting.supModule = setting.supModule
      }
      this.setState({
        scripts: res.data.scripts.map(col => {
          col.uuid = Utils.getuuid()
          return col
        }),
        columns: res.data.columns.map(col => {
          col.uuid = Utils.getuuid()
          return col
        }),
        setting: res.data.setting,
        reload: true,
        pvisible: false
      }, () => {
        this.setState({reload: false})
      })
      if (config.subtype !== 'basetable') {
        this.setState({
          scripts: res.data.scripts.map(col => {
            col.uuid = Utils.getuuid()
            return col
          }),
          columns: res.data.columns.map(col => {
            col.uuid = Utils.getuuid()
            return col
          }),
          setting: res.data.setting,
          reload: true,
          pvisible: false
        }, () => {
          this.setState({reload: false})
        })
      } else {
        this.setState({
          scripts: res.data.scripts.map(col => {
            col.uuid = Utils.getuuid()
            return col
          }),
          setting: res.data.setting,
          reload: true,
          pvisible: false
        }, () => {
          this.setState({reload: false})
        })
      }
    })
  }
@@ -828,7 +842,6 @@
            </span>
          } key="setting">
            {!reload ? <SettingForm
              dict={this.props.dict}
              config={config}
              columns={columns}
              setting={setting}
@@ -836,21 +849,21 @@
              wrappedComponentRef={(inst) => this.settingForm = inst}
            /> : null}
          </TabPane>
          <TabPane tab={
          {config.subtype !== 'basetable' ? <TabPane tab={
            <span>
              字段集
              {columns.length ? <span className="count-tip">{columns.length}</span> : null}
              <CopyOutlined title="以逗号拼接形式复制字段" className="mk-copy-fields" onClick={this.copyColumns}/>
            </span>
          } key="columns">
            <ColForm dict={this.props.dict} columnChange={this.columnChange}/>
            <ColForm columnChange={this.columnChange}/>
            <FieldsComponent
              config={{...config, columns}}
              type="fields"
              updatefield={this.updatefields}
            />
            <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/>
          </TabPane>
          </TabPane> : null}
          <TabPane tab={
            <span>
              自定义脚本
@@ -873,7 +886,6 @@
              searches={searches}
              defaultsql={defaultsql}
              initsql={this.state.initsql}
              dict={this.props.dict}
              customScripts={scripts}
              systemScripts={this.state.systemScripts}
              scriptsChange={this.scriptsChange}
@@ -920,7 +932,7 @@
                    <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span>
                    <Popconfirm
                      overlayClassName="popover-confirm"
                      title={this.props.dict['model.query.delete']}
                      title="确定删除吗?"
                      onConfirm={() => this.deleteScript(item)
                    }>
                      <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>