| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { notification, Modal, Spin, Tabs } from 'antd' |
| | | import { Form, notification, Modal, Spin, Tabs } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | config: PropTypes.object, // 页面配置信息 |
| | | inputSubmit: PropTypes.any // 回车提交事件 |
| | |
| | | exec_type: 'y', |
| | | LText: SettingUtils.getDebugSql(setting, _scripts, timestamp) |
| | | } |
| | | param.LText = param.LText.replace(/\n/g, ' ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = timestamp |
| | | param.secretkey = Utils.encrypt('', timestamp) |
| | |
| | | if (_loading) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | message: '存在未保存脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({loading: true}) |
| | | this.sqlverify(() => { // 验证成功 |
| | |
| | | <TabPane tab="数据源" key="setting"> |
| | | <DataSource |
| | | menu={menu} |
| | | dict={this.props.dict} |
| | | setting={setting} |
| | | inputSubmit={this.props.inputSubmit} |
| | | wrappedComponentRef={(inst) => this.settingForm = inst} |
| | |
| | | </span> |
| | | } key="scripts" id="mk-setting-scripts"> |
| | | <CustomScript |
| | | dict={this.props.dict} |
| | | setting={setting} |
| | | scripts={scripts} |
| | | defaultSql={this.state.defaultsql} |
| | |
| | | } |
| | | } |
| | | |
| | | export default SettingForm |
| | | export default Form.create()(SettingForm) |