| | |
| | | /** |
| | | * @description sql检验 |
| | | */ |
| | | sDebug (sql) { |
| | | sDebug (sql, skip = false) { |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: window.GLOB.execType || 'y', |
| | |
| | | |
| | | window.mkInfo(`/* sql 验证 */\n${sql.replace(/\n\s{6,20}/ig, '\n')}`) |
| | | |
| | | if (skip) return |
| | | |
| | | sql = sql.replace(/\n/ig, ' ') |
| | | |
| | | param.LText = Utils.formatOptions(sql, param.exec_type) |
| | |
| | | }) |
| | | } |
| | | |
| | | if (/@.*@/.test(url)) { |
| | | Object.keys(param).forEach(key => { |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | if (reg.test(url)) { |
| | | url = url.replace(reg, param[key]) |
| | | delete param[key] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let _params = { |
| | | url: url, |
| | | method: btn.method || 'post' |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | let sql = this.getSysExecSql(verify, false) |
| | | |
| | | Api.sDebug(sql, true) |
| | | |
| | | this.setState({ verify }) |
| | | } |
| | | } |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | let sql = this.getSysExecSql(verify, false) |
| | | |
| | | Api.sDebug(sql, true) |
| | | |
| | | MKEmitter.emit('editLineId', values.uuid) |
| | | |
| | | this.setState({ verify }) |
| | |
| | | this.setState({ verify }) |
| | | } |
| | | } else { |
| | | let sql = this.getSysBackSql(verify.cbScripts, card.cbTable) |
| | | |
| | | if (sql) { |
| | | let defSql = this.getSysExecSql(verify, true) |
| | | |
| | | sql = `${defSql} |
| | | ${sql} |
| | | ` |
| | | |
| | | if (card.output) { |
| | | sql += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg,${card.output} as mk_b_id` |
| | | } else { |
| | | sql += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | } |
| | | |
| | | sql = sql.replace(/@typename@/ig, `'typename'`) |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) |
| | | |
| | | Api.sDebug(sql, true) |
| | | } |
| | | |
| | | MKEmitter.emit('editLineId', values.uuid) |
| | | |
| | | this.setState({ verify }) |