From 0eb129a9beddbb86ae74d7106a8e60823206b8d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 14 十二月 2023 11:29:15 +0800
Subject: [PATCH] 2023-12-14

---
 src/templates/sharecomponent/searchcomponent/searchform/index.jsx |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx
index 5dbb18b..2a87811 100644
--- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx
+++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -252,6 +252,7 @@
       reTypes.initval = 'text'
     }
 
+    reTooltip.match = ''
     if (type === 'text') {
       reOptions.match = matchReg.class1
     } else if (type === 'multiselect') {
@@ -263,7 +264,8 @@
     } else if (type === 'date') {
       reOptions.match = matchReg.class4
     } else if (type === 'datemonth') {
-      reOptions.match = matchReg.class5
+      reTooltip.match = '鍖归厤妯″紡涓� between 鏃讹紝鎼滅储鏉′欢涓哄ぇ浜庢湀鍒濆皬浜庢湀鏈紝鍖归厤妯″紡涓� = 鏃讹紝鎼滅储鏉′欢涓虹瓑浜庡綋鍓嶆湀锛圷YYY-MM锛夈��'
+      reOptions.match = matchReg.class6
     } else if (type === 'dateweek' || type === 'daterange' || type === 'range') {
       reOptions.match = matchReg.class5
     } else if (type === 'checkcard') {
@@ -284,6 +286,25 @@
     } else if (type === 'group') {
       reTooltip.field = '鏌ヨ鏁版嵁鏃讹紙鑷畾涔夎剼鏈垨缁熻鏁版嵁婧愶級锛岀被鍨嬪瓧娈靛皢鐢ㄤ綔鏇挎崲鑴氭湰涓殑 @瀛楁@ 锛岀被鍨嬪瓧娈靛搴斿�间负锛氭棩 -> day锛涘懆 -> week锛涙湀 -> month锛涘 -> quarter锛涘勾 -> year锛涜嚜瀹氫箟 -> customized'
       reLabel.field = '绫诲瀷瀛楁'
+    }
+
+    reTooltip.initval = ''
+    if (type === 'select') {
+      if (this.record.resourceType === '0') {
+        reTooltip.initval = '鍒濆鍊煎簲涓烘暟鎹殑Value鍊硷紝鍙娇鐢ˊusername@銆丂fullName@'
+      } else if (this.record.resourceType === '1') {
+        reTooltip.initval = '鍒濆鍊煎簲涓恒�婂�悸峰瓧娈点�嬬殑鍊硷紝鍙娇鐢ˊusername@銆丂fullName@銆�$first銆傛敞锛氫娇鐢�$first鏃讹紝鎼滅储鏉′欢搴斾负蹇呭~銆�'
+      }
+    } else if (type === 'link') {
+      if (this.record.resourceType === '0') {
+        reTooltip.initval = '鍒濆鍊煎簲涓烘暟鎹殑Value鍊笺��'
+      } else if (this.record.resourceType === '1') {
+        reTooltip.initval = '鍒濆鍊煎簲涓恒�婂�悸峰瓧娈点�嬬殑鍊硷紝鍙娇鐢�$first銆傛敞锛氫娇鐢�$first鏃讹紝鎼滅储鏉′欢搴斾负蹇呭~銆�'
+      }
+    } else if (type === 'text') {
+      reTooltip.initval = '鍙娇鐢ˊusername@銆丂fullName@銆�'
+    } else if (type === 'range') {
+      reTooltip.initval = '浣跨敤閫楀彿鎷兼帴锛屼緥濡� 3,10'
     }
 
     return {
@@ -688,6 +709,23 @@
             values.field = values.field.join(',')
           }
 
+          if (['select', 'link'].includes(values.type)) {
+            if (values.resourceType === '1') {
+              if (/\$first/.test(values.initval) && values.initval.replace(/\s/g, '') === '$first') {
+                values.initval = '$first'
+              }
+
+              if (values.initval === '$first' && values.required !== 'true') {
+                notification.warning({
+                  top: 92,
+                  message: '浣跨敤$first鏃讹紝鎼滅储鏉′欢搴斾负蹇呭~锛�',
+                  duration: 5
+                })
+                return
+              }
+            }
+          }
+
           // 涓嬫媺鑿滃崟鎴栬仈鍔ㄨ彍鍗�
           if (['multiselect', 'select', 'link', 'radio'].includes(values.type)) {
             if (values.resourceType === '0') {

--
Gitblit v1.8.0