king
2025-02-19 4038bd70d2b48e68c5b897a98198d18f9e6da79e
src/utils/utils-custom.js
@@ -2125,6 +2125,9 @@
      if (item.subButton.intertype === 'system' && !item.subButton.sqlType) {
        errors.push({ level: 0, detail: `${item.subButton.label} 按钮请设置操作类型`})
      }
      if (item.subButton.Ot === 'requiredSgl' && card.wrap.datatype === 'static') {
        errors.push({ level: 0, detail: `${item.subButton.label} 按钮选行时不可使用静态数据源`})
      }
      if (item.subButton.verify && !item.subButton.output) {
        if (item.subButton.verify.noteEnable === 'true') {
          errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`})
@@ -2192,6 +2195,7 @@
  let _ch_d = sql.match(/@check\$/ig)
  let _m_b = sql.match(/\$@/ig)
  let _m_d = sql.match(/@\$/ig)
  let caseErr = false
  _quot = _quot ? _quot.length : 0
  _lparen = _lparen ? _lparen.length : 0
@@ -2200,6 +2204,14 @@
  _ch_d = _ch_d ? _ch_d.length : 0
  _m_b = _m_b ? _m_b.length : 0
  _m_d = _m_d ? _m_d.length : 0
  if (/case\s+when\s+[\s\S]+\send(\s|\n|$)/ig.test(sql)) {
    sql.match(/case\s+when\s+[\s\S]+\send(\s|\n|$)/ig).forEach(line => {
      if (!/\selse\s/ig.test(line)) {
        caseErr = true
      }
    })
  }
  if (_quot % 2 !== 0) {
    notification.warning({
@@ -2328,6 +2340,13 @@
      duration: 5
    })
    return false
  } else if (caseErr) {
    notification.warning({
      top: 92,
      message: 'case when 语句需要有 else',
      duration: 5
    })
    return false
  } else if (type === 'customscript' && /\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(sql)) {
    let list = sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
    let errors = []