king
2024-12-23 65c9d768ad5bbb8d01babc4435801b0cb39c9b06
src/templates/zshare/verifycard/index.jsx
@@ -1733,9 +1733,12 @@
    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])
@@ -1747,7 +1750,7 @@
      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 = []
@@ -2075,6 +2078,10 @@
        }
      })
    } else {
      let sql = this.getSysExecSql(verify, false)
      Api.sDebug(sql, true)
      this.setState({ verify })
    }
  }
@@ -2144,6 +2151,10 @@
        }
      })
    } else {
      let sql = this.getSysExecSql(verify, false)
      Api.sDebug(sql, true)
      MKEmitter.emit('editLineId', values.uuid)
  
      this.setState({ verify })
@@ -2209,6 +2220,29 @@
        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 })