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 | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index c78bd0a..deae870 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -323,15 +323,24 @@ } else if (type === 'scripts' && _scripts.length === 0) { _resolve() } else { // type 涓� submit 銆� verify 锛屼互鍙婂叾浠栭渶瑕侀獙璇佺殑鍦烘櫙 - let r = SettingUtils.getDebugSql(setting, _scripts, arr_field, regoptions, search) + let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + let r = SettingUtils.getDebugSql(setting, _scripts, arr_field, regoptions, search, timestamp) let param = { func: 's_debug_sql', exec_type: 'y', LText: r.sql } param.LText = Utils.formatOptions(param.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) + 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) { @@ -345,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 { @@ -567,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"> @@ -587,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, @@ -598,7 +607,7 @@ return } this.setState({visible: true, script: null, scriptValue: ''}) - }}/> + }}/> : null} <CustomScript dict={dict} setting={setting} -- Gitblit v1.8.0