| | |
| | | data: param |
| | | }).then(res => { |
| | | if (res.status && res.urlPath) { |
| | | res.urlPath = window.GLOB.baseurl + res.urlPath |
| | | if (!/Content\/images/.test(res.urlPath)) { |
| | | let key = CryptoJS.enc.Utf8.parse('D1185ED7B32568C9') |
| | | let wordArray = CryptoJS.enc.Base64.parse(res.urlPath) |
| | | let decryptedWordArray = CryptoJS.AES.decrypt({ ciphertext: wordArray }, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }) |
| | | res.urlPath = CryptoJS.enc.Utf8.stringify(decryptedWordArray) |
| | | } |
| | | if (!/^http/.test(res.urlPath)) { |
| | | res.urlPath = window.GLOB.baseurl + res.urlPath |
| | | } |
| | | } |
| | | resolve(res) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | cancel = () => { |
| | | this.verifyRef.closeDataSource(() => { |
| | | this.setState({ visible: false, loading: false }) |
| | | }) |
| | | } |
| | | |
| | | creatFunc = () => { |
| | | const { config } = this.props |
| | | const { mainSearch } = this.state |
| | |
| | | onCancel={() => {this.setState({ visible: false, loading: false }) }} |
| | | footer={[ |
| | | config.subtype !== 'dualdatacard' && record.interType === 'inner' ? <CreateFunc key="create" getMsg={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false, loading: false }) }}>取消</Button>, |
| | | <Button key="cancel" onClick={this.cancel}>取消</Button>, |
| | | <Button key="confirm" type="primary" loading={loading} onClick={this.verifySubmit}>确定</Button> |
| | | ]} |
| | | destroyOnClose |
| | |
| | | loading: false, |
| | | colLoading: false, |
| | | searchKey: '', |
| | | initsql: '', // sql验证时变量声明及赋值 |
| | | usefulfields: '', |
| | | defaultsql: '', // 默认Sql |
| | | defaultsql: '', |
| | | systemScripts: [], |
| | | median: {}, |
| | | visible: false, |
| | |
| | | pvisible: false, |
| | | reload: false, |
| | | script: null, |
| | | oriConfig: null, |
| | | scriptValue: '', |
| | | cols: null, |
| | | colColumns: [ |
| | |
| | | median: _setting, |
| | | searches: formatSearch(search), |
| | | searchKey: '', |
| | | debugId: _setting.debugId || '' |
| | | debugId: _setting.debugId || '', |
| | | oriConfig: fromJS({ |
| | | scripts, |
| | | columns: columns, |
| | | subColumns: subColumns, |
| | | setting: _setting |
| | | }).toJS() |
| | | }) |
| | | |
| | | this.getsysScript() |
| | |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | closeDataSource = (callback) => { |
| | | const { setting, columns, subColumns, scripts, oriConfig } = this.state |
| | | |
| | | let line = scripts.map(item => item.sql).join('') |
| | | line += columns.map(item => item.field + item.datatype).join('') |
| | | line += subColumns.map(item => item.field + item.datatype).join('') |
| | | line += setting.interType + (setting.dataresource || '') + (setting.order || '') + (setting.primaryKey || '') |
| | | |
| | | let _line = oriConfig.scripts.map(item => item.sql).join('') |
| | | _line += oriConfig.columns.map(item => item.field + item.datatype).join('') |
| | | _line += oriConfig.subColumns.map(item => item.field + item.datatype).join('') |
| | | _line += oriConfig.setting.interType + (oriConfig.setting.dataresource || '') + (oriConfig.setting.order || '') + (oriConfig.setting.primaryKey || '') |
| | | |
| | | if (line !== _line) { |
| | | confirm({ |
| | | content: '数据源已修改,确定取消吗?', |
| | | onOk() { |
| | | callback() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | |
| | | sqlverify = (resolve, reject, type, testScripts) => { |
| | |
| | | setting={setting} |
| | | searches={searches} |
| | | defaultsql={defaultsql} |
| | | initsql={this.state.initsql} |
| | | customScripts={scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |