| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | strict: true, |
| | | copy: true, |
| | | rules: [{ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | |
| | | median: _setting, |
| | | searches: search, |
| | | defaultSearch: _search, |
| | | searchKey: '' |
| | | searchKey: '', |
| | | debugId: _setting.debugId || '' |
| | | }) |
| | | |
| | | this.getsysScript() |
| | |
| | | } |
| | | |
| | | sqlverify = (resolve, reject, change = false, testScripts) => { |
| | | const { config } = this.props |
| | | const { columns, setting, scripts, searches, defaultSearch, debugId } = this.state |
| | | |
| | | let _scripts = scripts.filter(item => item.status !== 'false') |
| | |
| | | |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, timestamp) |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, config.type, '2023-04-20 15:29:37') |
| | | |
| | | let _debugId = md5(r.sql) |
| | | |
| | |
| | | if (sumParam) { |
| | | Api.genericInterface(sumParam).then(res => { |
| | | if (res.status) { |
| | | this.setState({debugId: _debugId}) |
| | | resolve() |
| | | this.setState({debugId: _debugId}, () => { |
| | | resolve() |
| | | }) |
| | | } else { |
| | | reject() |
| | | Modal.error({ |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({debugId: _debugId}) |
| | | resolve() |
| | | this.setState({debugId: _debugId}, () => { |
| | | resolve() |
| | | }) |
| | | } |
| | | } else { |
| | | reject() |
| | |
| | | let n = [] |
| | | |
| | | columns.forEach(col => { |
| | | m.push(`${col.field}(${col.label})`) |
| | | m.push(`${col.field} ${col.datatype}`) |
| | | n.push(col.field) |
| | | }) |
| | | |
| | |
| | | let n = [] |
| | | |
| | | subColumns.forEach(col => { |
| | | m.push(`${col.field}(${col.label})`) |
| | | m.push(`${col.field} ${col.datatype}`) |
| | | n.push(col.field) |
| | | }) |
| | | |
| | |
| | | this.setState({visible: true, script: null, scriptValue: ''}) |
| | | }}/> : null} |
| | | <CustomScriptsForm |
| | | type={config.type} |
| | | setting={setting} |
| | | searches={searches} |
| | | defaultsql={defaultsql} |