king
2024-07-02 15889111de4daa730d94a2a60883e3665e16840a
src/menu/datasource/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal, Button } from 'antd'
import { Modal, Button, notification } from 'antd'
import { SettingOutlined } from '@ant-design/icons'
import VerifyCard from './verifycard'
@@ -179,6 +179,7 @@
      }
      let maxScript = 0
      let useExec = false
      if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
        window.GLOB.funcs.forEach(m => {
@@ -192,6 +193,7 @@
            if (item.status === 'false') return
            if (/exec\s/ig.test(item.sql)) {
              useExec = true
              maxScript = 1000
            } else if (item.sql.length > maxScript) {
              maxScript = item.sql.length
@@ -203,6 +205,7 @@
          if (item.status === 'false') return
          if (/exec\s/ig.test(item.sql)) {
            useExec = true
            maxScript = 1000
          } else if (item.sql.length > maxScript) {
            maxScript = item.sql.length
@@ -212,6 +215,14 @@
      res.setting.maxScript = maxScript
      if (useExec && res.setting.sync === 'true') {
        notification.warning({
          top: 92,
          message: '当前数据源使用了同步查询且自定义脚本中存在函数exec,如遇接口报错需关闭同步查询后重新测试。',
          duration: 5
        })
      }
      if (config.subtype !== 'dualdatacard') {
        delete res.subColumns
        if (config.type === 'interface') {