From ae170a9d58b4f91a225eada1dc83ed4a116b8d50 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 25 八月 2024 00:57:37 +0800 Subject: [PATCH] 2024-08-25 --- src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx | 48 +++++++++++++++++------------------------------- 1 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx index 5eab415..ba10535 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx @@ -1,11 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { notification, Modal, Spin, Tabs } from 'antd' -import moment from 'moment' +import { Form, notification, Modal, Spin, Tabs } from 'antd' 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 // 鍥炶溅鎻愪氦浜嬩欢 @@ -35,17 +32,17 @@ let _setting = fromJS(config.setting).toJS() let _scripts = _setting.scripts || [] - if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { - window.GLOB.funcs.forEach(m => { - let reg = new RegExp(`\\/\\*\\$ex@${m.func_code}-begin\\*\\/[\\s\\S]+\\/\\*@ex\\$-end\\*\\/`, 'ig') - _scripts.forEach(item => { - item.sql = item.sql.replace(reg, `$ex@${m.func_code}@ex$`) - }) - if (_setting.dataresource) { - _setting.dataresource = _setting.dataresource.replace(reg, `$ex@${m.func_code}@ex$`) - } - }) - } + // if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { + // window.GLOB.funcs.forEach(m => { + // let reg = new RegExp(`\\/\\*\\$ex@${m.func_code}-begin\\*\\/[\\s\\S]+\\/\\*@ex\\$-end\\*\\/`, 'ig') + // _scripts.forEach(item => { + // item.sql = item.sql.replace(reg, `$ex@${m.func_code}@ex$`) + // }) + // if (_setting.dataresource) { + // _setting.dataresource = _setting.dataresource.replace(reg, `$ex@${m.func_code}@ex$`) + // } + // }) + // } this.setState({ setting: _setting, @@ -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} @@ -284,4 +270,4 @@ } } -export default SettingForm \ No newline at end of file +export default Form.create()(SettingForm) \ No newline at end of file -- Gitblit v1.8.0