From 81d0d7721bb14a34b1eef99fd9506c3eda4bda99 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 十月 2023 17:17:47 +0800 Subject: [PATCH] 2023-10-18 --- src/templates/modalconfig/index.jsx | 67 +++++++-------------------------- 1 files changed, 14 insertions(+), 53 deletions(-) diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index 669ef9e..5343768 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -8,7 +8,6 @@ import Api from '@/api' import { getModalForm } from '@/templates/zshare/formconfig' - import SourceElement from './dragelement/source' import SettingForm from './settingform' import MenuForm from './menuform' @@ -348,73 +347,35 @@ /** * @description 缂栬緫鍚庢彁浜� - * 1銆佽幏鍙栫紪杈戝悗鐨勮〃鍗曚俊鎭� - * 2銆佸幓闄ゅ彲鑳藉瓨鍦ㄧ殑绀轰緥琛ㄥ崟 - * 3銆侀�氳繃loading鍒锋柊 */ handleSubmit = () => { - this.formRef.handleConfirm().then(res => { - let _config = fromJS(this.state.config).toJS() - let fieldrepet = false // 瀛楁閲嶅 + let _config = fromJS(this.state.config).toJS() + this.formRef.handleConfirm(_config.fields).then(res => { _config.fields = _config.fields.map(item => { - if (item.uuid !== res.uuid && res.field && item.field && item.field.toLowerCase() === res.field.toLowerCase()) { - fieldrepet = true - } - - if (item.uuid === res.uuid) { - if (item.style) { - res.style = item.style - } - return res + if (item.uuid === res.values.uuid) { + return res.values } else { return item } }) - if (fieldrepet) { - notification.warning({ - top: 92, - message: '瀛楁宸插瓨鍦紒', - duration: 10 - }) - return - } - _config.fields = _config.fields.filter(item => !item.origin) - window.GLOB.formId = res.uuid - - if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) { + if (res.loading) { this.setState({ sqlVerifing: true }) - let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) - ${res.dataSource}` - - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) - - let rduri = '' - if (window.GLOB.mainSystemApi && res.database === 'sso') { - rduri = window.GLOB.mainSystemApi - } - - Api.sDebug(sql, rduri).then(result => { - if (result.status || result.ErrCode === '-2') { - this.setState({ - sqlVerifing: false, - config: _config, - card: null, - visible: false - }) - } else { - this.setState({sqlVerifing: false}) - - Modal.error({ - title: result.message - }) - } + res.promise().then(() => { + this.setState({ + sqlVerifing: false, + config: _config, + card: null, + visible: false + }) + }, () => { + this.setState({sqlVerifing: false}) }) } else { this.setState({ -- Gitblit v1.8.0