| | |
| | | } |
| | | |
| | | if ((setting.interType === 'system' && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let result = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch) |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch) |
| | | |
| | | if (result.error) { |
| | | if (r.error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.error, |
| | | message: r.error, |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: result.sql |
| | | 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) |
| | | |
| | | let sumParam = null |
| | | if (r.sumSql) { |
| | | sumParam = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: r.sumSql |
| | | } |
| | | sumParam.LText = Utils.formatOptions(sumParam.LText) |
| | | sumParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | sumParam.secretkey = Utils.encrypt('', sumParam.timestamp) |
| | | } |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | if (result.status) { |
| | | resolve() |
| | | if (sumParam) { |
| | | Api.getLocalConfig(sumParam).then(res => { |
| | | if (res.status) { |
| | | resolve() |
| | | } else { |
| | | reject() |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | resolve() |
| | | } |
| | | } else { |
| | | reject() |
| | | Modal.error({ |