From f267d04e0561a0a20d1f2a9f558a273558ece90d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 24 五月 2021 17:50:19 +0800 Subject: [PATCH] 2021-05-24 --- src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 64 ++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 12 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index af3c4ba..26c87fe 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -49,7 +49,7 @@ } let _sql = `Declare @${btn.sheet} table (${columns.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) - Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) + Declare @UserName nvarchar(50),@FullName nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) Select @ErrorCode='', @retmsg='' ` @@ -122,26 +122,66 @@ aaa: ` - let _initsql = '' - this.props.scripts.forEach(script => { - if (this.state.editItem && this.state.editItem.uuid === script.uuid) return - if (script.status === 'false' || script.position !== 'init') return + let _initCustomScript = '' // 鍒濆鍖栬剼鏈� + let _prevCustomScript = '' // 榛樿sql鍓嶆墽琛岃剼鏈� + let _backCustomScript = '' // 榛樿sql鍚庢墽琛岃剼鏈� - _initsql += ` - ${script.sql} + this.props.scripts.forEach(item => { + if (item.status === 'false') return + + if (item.position === 'init') { + _initCustomScript += ` + /* 鍒濆鍖栬剼鏈� */ + ${values.uuid === item.uuid ? values.sql : item.sql} ` + } else if (item.position === 'front') { + _prevCustomScript += ` + /* 榛樿sql鍓嶈剼鏈� */ + ${values.uuid === item.uuid ? values.sql : item.sql} + ` + } else { + _backCustomScript += ` + /* 榛樿sql鍚庤剼鏈� */ + ${values.uuid === item.uuid ? values.sql : item.sql} + ` + } }) + + if (!values.uuid) { + if (values.position === 'init') { + _initCustomScript += ` + /* 鍒濆鍖栬剼鏈� */ + ${values.sql} + ` + } else if (values.position === 'front') { + _prevCustomScript += ` + /* 榛樿sql鍓嶈剼鏈� */ + ${values.sql} + ` + } else { + _backCustomScript += ` + /* 榛樿sql鍚庤剼鏈� */ + ${values.sql} + ` + } + } let param = { func: 's_debug_sql', - LText: this.state.verifySql + _initsql + values.sql + tail + exec_type: 'y', + LText: this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail } param.LText = param.LText.replace(/@\$|\$@/ig, '') + // 澶栬仈鏁版嵁搴撴浛鎹� + if (window.GLOB.externalDatabase !== null) { + param.LText = param.LText.replace(/@db@/ig, window.GLOB.externalDatabase) + } + param.LText = Utils.formatOptions(param.LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.secretkey = Utils.encrypt('', param.timestamp) this.setState({loading: true}) Api.getLocalConfig(param).then(res => { @@ -238,9 +278,9 @@ {btn.sheet} </Form.Item> </Col> : null} - <Col span={16}> - <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}> - ErrorCode, retmsg + <Col span={10}> + <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0, whiteSpace: 'nowrap'}}> + ErrorCode锛堝鍔犲悗缂�NT琛ㄧず鏁版嵁涓嶅洖婊氾紝濡侲NT銆丯NT銆丗NT銆丯MNT锛�, retmsg </Form.Item> </Col> {usefulfields ? <Col span={24} className="sqlfield"> -- Gitblit v1.8.0