| | |
| | | const { loading, activeKey, setting, defaultSql, columns, scripts, preScripts, cbScripts, status, regoptions, visible, script, scriptValue } = this.state |
| | | |
| | | return ( |
| | | <div className="model-table-setting-form-box" id="model-setting-form-body"> |
| | | <div className="model-table-setting-form-box"> |
| | | {loading && <Spin size="large" />} |
| | | <Tabs activeKey={activeKey} onChange={this.changeTab}> |
| | | <TabPane tab="数据源" key="setting"> |
| | |
| | | 自定义脚本 |
| | | {scripts.length ? <span className="count-tip">{scripts.length}</span> : null} |
| | | </span> |
| | | } disabled={!(status.interType === 'system' || (status.interType === 'custom' && status.requestMode === 'system'))} key="scripts"> |
| | | <BorderOutlined className="full-scripts" onClick={() => { |
| | | } disabled={!(status.interType === 'system' || (status.interType === 'custom' && status.requestMode === 'system'))} key="scripts" id="mk-setting-scripts"> |
| | | {scripts.length ? <BorderOutlined className="full-scripts" onClick={() => { |
| | | if (this.scriptsForm && (this.scriptsForm.state.editItem || (this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))))) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | return |
| | | } |
| | | this.setState({visible: true, script: null, scriptValue: ''}) |
| | | }}/> |
| | | }}/> : null} |
| | | <CustomScript |
| | | dict={dict} |
| | | setting={setting} |