| | |
| | | value: '0' |
| | | }) |
| | | options.push(item) |
| | | } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) { |
| | | } else if (['datemonth', 'dateweek'].includes(search.type)) { |
| | | options.push(item) |
| | | options.push({ |
| | | key: item.key + '1', |
| | | value: '0' |
| | | }) |
| | | } else if (search.type === 'daterange') { |
| | | let _skey = search.field |
| | | let _ekey = search.field + '1' |
| | | |
| | | if (/,/.test(search.field)) { |
| | | _skey = search.field.split(',')[0] |
| | | _ekey = search.field.split(',')[1] |
| | | } |
| | | |
| | | options.push({ |
| | | key: _skey, |
| | | value: '0' |
| | | }) |
| | | options.push({ |
| | | key: _ekey, |
| | | value: '0' |
| | | }) |
| | | } else if (search.type === 'text' || search.type === 'select') { |
| | |
| | | } else if (type === 'scripts' && _scripts.length === 0) { |
| | | _resolve() |
| | | } else { // type 为 submit 、 verify ,以及其他需要验证的场景 |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, arr_field, regoptions, search, timestamp) |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: r.sql |
| | | } |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = timestamp |
| | | param.secretkey = Utils.encrypt('', timestamp) |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, arr_field, regoptions, search) |
| | | |
| | | if (r.errors) { |
| | | notification.warning({ |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | 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.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | if (sumParam) { |
| | | Api.genericInterface(sumParam).then(res => { |
| | | if (res.status) { |
| | | _resolve() |
| | | } else { |
| | | _reject() |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | _resolve() |
| | | } |
| | | Api.sDebug(r.sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | _resolve() |
| | | } else { |
| | | _reject() |
| | | Modal.error({ |