| | |
| | | import TransferForm from '@/components/transferform' |
| | | import SourceElement from '@/templates/zshare/dragelement/source' |
| | | import CreateFunc from '@/templates/zshare/createfunc' |
| | | // import CreateInterface from '@/templates/zshare/createinterface' |
| | | import CreateInterface from '@/templates/zshare/createinterface' |
| | | import Source from './source' |
| | | import './index.scss' |
| | | |
| | |
| | | const { menu } = this.props |
| | | const { config } = this.state |
| | | |
| | | this.settingRef.handleConfirm().then(setting => { |
| | | if (/[^\s]+\s+[^\s]+/ig.test(setting.dataresource) && config.setting.dataresource !== setting.dataresource) { |
| | | let param = { |
| | | func: 's_DataSrc_Save', |
| | | LText: setting.dataresource, |
| | | MenuID: menu.MenuID |
| | | this.menuformRef.handleConfirm().then(res => { |
| | | this.settingRef.handleConfirm().then(setting => { |
| | | if (/[^\s]+\s+[^\s]+/ig.test(setting.dataresource) && config.setting.dataresource !== setting.dataresource) { |
| | | let param = { |
| | | func: 's_DataSrc_Save', |
| | | LText: setting.dataresource, |
| | | MenuID: menu.MenuID |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getLocalConfig(param) |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getLocalConfig(param) |
| | | } |
| | | |
| | | // let _config = {...config, setting: setting} |
| | | |
| | | // this.refs.tableCreatInterface.exec(setting.innerFunc, newLText, DelText).then(result => { |
| | | // if (result === 'success') { |
| | | // this.setState({ |
| | | // config: {...config, setting: setting} |
| | | // }) |
| | | // } |
| | | // }) |
| | | if (setting.interType !== 'inner' || setting.innerFunc) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '接口类型为-内部,且不存在内部函数时,才可以创建接口!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let _config = {...config, setting: setting} |
| | | let _menu = { |
| | | type: 'main', |
| | | MenuID: menu.MenuID, |
| | | menuName: res.menuName, |
| | | menuNo: res.menuNo |
| | | } |
| | | |
| | | this.refs.tableCreatInterface.exec(_menu, _config).then(result => { |
| | | if (result === 'success') { |
| | | this.setState({ |
| | | config: _config |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | }) |
| | | }} |
| | | footer={[ |
| | | // <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>, |
| | | <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>, |
| | | <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, |
| | | <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button> |