From e35e2d2e9956803b4ec5356395b02a6484441b4f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 20 二月 2025 16:58:41 +0800
Subject: [PATCH] 2025-02-20

---
 src/utils/utils-custom.js |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index c78b049..ce328a7 100644
--- a/src/utils/utils-custom.js
+++ b/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({
@@ -2322,9 +2334,23 @@
     })
     return false
   } else if (/\sdecimal\(8,/ig.test(sql)) {
+    let lines = ''
+    sql.split(/\n/).forEach((s, i) => {
+      if (/(^|\s)decimal\(8,/ig.test(s)) {
+        lines = '绗�' + (i + 1) + '琛屼腑'
+      }
+    })
+
     notification.warning({
       top: 92,
-      message: `涓嶅彲浣跨敤 decimal(8`,
+      message: `${lines}涓嶅彲浣跨敤 decimal(8`,
+      duration: 5
+    })
+    return false
+  } else if (caseErr) {
+    notification.warning({
+      top: 92,
+      message: 'case when 璇彞闇�瑕佹湁 else',
       duration: 5
     })
     return false

--
Gitblit v1.8.0