| | |
| | | if (!_prev) return _back |
| | | |
| | | let tbs = [] |
| | | _prev.replace(/\/\*[^/*]+\*\//g, '').replace(/\n|\r/g, ' ').split(/\sdeclare\s/ig).forEach(line => { |
| | | if (!/^\s*(@|#)[a-zA-Z0-9_]+\s+table\s+\(/ig.test(line)) return |
| | | let tb = line.match(/(@|#)[a-zA-Z0-9_]+\s+table\s+\(.+(\)|date|datetime)\s*\)/ig) |
| | | _prev.replace(/\/\*[^/*]+\*\//g, '').replace(/\n|\r/g, ' ').split(/\sdeclare\s+|\screate\s+table\s+/ig).forEach(line => { |
| | | if (/^\s*(@|#)[a-zA-Z0-9_]+\s+table\s+\(/ig.test(line)) { |
| | | line = line.replace(/\s+table\s+\(/, '(') |
| | | } |
| | | if (!/^\s*(@|#)[a-zA-Z0-9_]+\s*\(/ig.test(line)) return |
| | | let tb = line.match(/(@|#)[a-zA-Z0-9_]+\s*\(.+(\)|date|datetime)\s*\)/ig) |
| | | |
| | | if (tb && tb.length === 1) { |
| | | tbs.push(tb[0]) |
| | |
| | | |
| | | if (!tbName) return |
| | | |
| | | let content = tb.replace(/(@|#)[a-zA-Z0-9_]+\s+table\s+\(\s*/, '').replace(/\s*\)$/, '') |
| | | let content = tb.replace(/(@|#)[a-zA-Z0-9_]+\s*\(\s*/, '').replace(/\s*\)$/, '') |
| | | content = content.replace(/decimal\(\s*\d+\s*,\s*\d+\s*\)/ig, 'decimal') |
| | | |
| | | let keys = [] |
| | |
| | | } |
| | | }) |
| | | } 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 }) |