king
2023-08-27 da64ab0923bf8817fc8599a6e37b953ce38f64c8
src/menu/datasource/verifycard/index.jsx
@@ -29,7 +29,8 @@
class VerifyCard extends Component {
  static propTpyes = {
    config: PropTypes.object,        // 组件配置信息
    config: PropTypes.object,
    updRecord: PropTypes.func
  }
  state = {
@@ -117,7 +118,7 @@
      {
        title: 'SQL',
        dataIndex: 'sql',
        width: '72%',
        width: '65%',
        render: (text) => {
          let title = text.match(/^\s*\/\*.+\*\//)
          title = title && title[0] ? title[0] : ''
@@ -132,9 +133,21 @@
        }
      },
      {
        title: '执行位置',
        dataIndex: 'position',
        width: '10%',
        render: (text, record) => {
          if (record.position === 'back') {
            return <span style={{color: '#1890ff'}}>后置</span>
          } else {
            return <span style={{color: '#26C281'}}>前置</span>
          }
        }
      },
      {
        title: '状态',
        dataIndex: 'status',
        width: '13%',
        width: '10%',
        render: (text, record) => record.status === 'false' ?
          (
            <div style={{color: '#ff4d4f'}}>
@@ -244,7 +257,7 @@
    _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证
    
    Api.getSystemConfig(_sParam).then(res => {
    Api.getCloudConfig(_sParam).then(res => {
      if (res.status) {
        let _scripts = res.data.map(item => {
          return {
@@ -657,6 +670,7 @@
  }
  sqlverify = (resolve, reject, change = false, testScripts) => {
    const { config } = this.props
    const { columns, setting, scripts, searches, defaultSearch, debugId } = this.state
    let _scripts = scripts.filter(item => item.status !== 'false')
@@ -681,7 +695,7 @@
    if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) {
      let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, '2023-04-20 15:29:37')
      let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, config.type, '2023-04-20 15:29:37')
      let _debugId = md5(r.sql)
@@ -898,7 +912,14 @@
          this.setState({reload: false})
        })
      }
      this.props.updRecord({...res.data.setting})
    })
  }
  updateStatus = (res) => {
    this.setState({median: {...res}})
    this.props.updRecord({...res})
  }
  copyColumns = () => {
@@ -972,7 +993,7 @@
              subColumns={subColumns}
              setting={setting}
              scripts={scripts}
              updateStatus={(res) => this.setState({median: {...res}})}
              updateStatus={this.updateStatus}
              wrappedComponentRef={(inst) => this.settingForm = inst}
            /> : null}
          </TabPane>
@@ -1027,6 +1048,7 @@
              this.setState({visible: true, script: null, scriptValue: ''})
            }}/> : null}
            <CustomScriptsForm
              type={config.type}
              setting={setting}
              searches={searches}
              defaultsql={defaultsql}