| | |
| | | dict: PropTypes.object, // 字典项 |
| | | menu: PropTypes.object, // 菜单信息 |
| | | config: PropTypes.object, // 页面配置信息 |
| | | search: PropTypes.array // 搜索条件 |
| | | search: PropTypes.array, // 搜索条件 |
| | | updRecord: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | cbScripts: _cbScripts, |
| | | status |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | this.props.updRecord(this.state.status) |
| | | } |
| | | |
| | | getRegOptions = (searches) => { |
| | |
| | | if (activeKey === 'setting') { |
| | | return new Promise((resolve, reject) => { |
| | | this.settingForm.handleConfirm().then(res => { |
| | | if (trigger === 'func' && res.interType !== 'inner') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用内部接口,才可以创建存储过程!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({loading: false}) |
| | | reject() |
| | | return |
| | | } else if (trigger === 'interface' && res.interType !== 'system') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用系统接口时,才可以创建接口!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({loading: false}) |
| | | reject() |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | setting: res |
| | | }, () => { |
| | |
| | | }) |
| | | } else if (activeKey === 'scripts') { |
| | | return new Promise((resolve, reject) => { |
| | | if (trigger === 'func' && setting.interType !== 'inner') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用内部接口,才可以创建存储过程!', |
| | | duration: 5 |
| | | }) |
| | | this.sqlverify(() => { |
| | | this.setState({loading: false}) |
| | | resolve({...setting, scripts, preScripts, cbScripts}) |
| | | }, () => { |
| | | this.setState({loading: false}) |
| | | reject() |
| | | } else { |
| | | this.sqlverify(() => { |
| | | this.setState({loading: false}) |
| | | resolve({...setting, scripts, preScripts, cbScripts}) |
| | | }, () => { |
| | | this.setState({loading: false}) |
| | | reject() |
| | | }, 'submit') |
| | | } |
| | | }, 'submit') |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | |
| | | } |
| | | |
| | | updateStatus = (status) => { |
| | | this.setState({status: {...this.state.status, ...status}}) |
| | | let _status = {...this.state.status, ...status} |
| | | this.setState({status: _status}) |
| | | this.props.updRecord(_status) |
| | | } |
| | | |
| | | render() { |