From b8cde0c39d7b6d58ceff3adf6dea3cb3118ea602 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 13 九月 2022 14:46:15 +0800 Subject: [PATCH] 2022-09-13 --- src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 2fec3e1..deae870 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -334,6 +334,14 @@ param.timestamp = timestamp param.secretkey = Utils.encrypt('', timestamp) + if (r.errors) { + notification.warning({ + top: 92, + message: r.errors, + duration: 5 + }) + } + let sumParam = null if (r.sumSql) { sumParam = { @@ -346,10 +354,10 @@ sumParam.secretkey = Utils.encrypt('', sumParam.timestamp) } - Api.getLocalConfig(param).then(result => { + Api.genericInterface(param).then(result => { if (result.status) { if (sumParam) { - Api.getLocalConfig(sumParam).then(res => { + Api.genericInterface(sumParam).then(res => { if (res.status) { _resolve() } else { @@ -568,7 +576,7 @@ 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"> @@ -588,8 +596,8 @@ 鑷畾涔夎剼鏈� {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, @@ -599,7 +607,7 @@ return } this.setState({visible: true, script: null, scriptValue: ''}) - }}/> + }}/> : null} <CustomScript dict={dict} setting={setting} -- Gitblit v1.8.0