king
2023-12-12 49f09cc6f8ff8c30a75ed1a9d6f510b69b73962a
src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx
@@ -2,10 +2,8 @@
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, notification, Modal, Spin, Tabs } from 'antd'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import SettingUtils from './utils.jsx'
import DataSource from './datasource'
import asyncComponent from '@/utils/asyncComponent'
@@ -16,7 +14,6 @@
class SettingForm extends Component {
  static propTpyes = {
    dict: PropTypes.object,         // 字典项
    menu: PropTypes.object,         // 菜单信息
    config: PropTypes.object,       // 页面配置信息
    inputSubmit: PropTypes.any      // 回车提交事件
@@ -135,18 +132,10 @@
    } else if (type === 'scripts' && _scripts.length === 0) {
      _resolve()
    } else { // type 为 submit 、 verify ,以及其他需要验证的场景
      let timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      let param = {
        func: 's_debug_sql',
        exec_type: 'y',
        LText: SettingUtils.getDebugSql(setting, _scripts, timestamp)
      }
      param.LText = Utils.formatOptions(param.LText)
      param.timestamp = timestamp
      param.secretkey = Utils.encrypt('', timestamp)
      let sql = SettingUtils.getDebugSql(setting, _scripts)
      
      Api.genericInterface(param).then(result => {
        if (result.status) {
      Api.sDebug(sql).then(result => {
        if (result.status || result.ErrCode === '-2') {
          _resolve()
        } else {
          _reject()
@@ -212,10 +201,9 @@
      if (_loading) {
        notification.warning({
          top: 92,
          message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!',
          message: '存在未保存脚本!',
          duration: 5
        })
        return
      }
      this.setState({loading: true})
      this.sqlverify(() => { // 验证成功
@@ -255,7 +243,6 @@
          <TabPane tab="数据源" key="setting">
            <DataSource
              menu={menu}
              dict={this.props.dict}
              setting={setting}
              inputSubmit={this.props.inputSubmit}
              wrappedComponentRef={(inst) => this.settingForm = inst}
@@ -268,7 +255,6 @@
            </span>
          } key="scripts" id="mk-setting-scripts">
            <CustomScript
              dict={this.props.dict}
              setting={setting}
              scripts={scripts}
              defaultSql={this.state.defaultsql}