From 4590502dd26419fd190045d84fbf11eccb6093f7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 07 五月 2022 15:53:12 +0800
Subject: [PATCH] 2022-05-07

---
 src/templates/sharecomponent/settingcomponent/settingform/index.jsx |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx
index 0ad95b9..6ef30e6 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx
@@ -85,7 +85,7 @@
     status.requestMode = status.requestMode || 'system'
     status.procMode = status.procMode || 'script'
     status.callbackType = status.callbackType || 'script'
-    let regoptions = Utils.getRegOptions(search)
+    let regoptions = this.getRegOptions(search)
 
     if (config.urlFields && config.urlFields.length > 0) {
       config.urlFields.forEach(field => {
@@ -128,6 +128,58 @@
     })
   }
 
+  getRegOptions = (searches) => {
+    if (!searches || searches.length === 0) return []
+
+    let options = []
+    let fieldmap = new Map()
+    searches.forEach(search => {
+      let item = {
+        key: search.field,
+        value: '0'
+      }
+
+      if (fieldmap.has(item.key)) {
+        item.key = item.key + '1'
+      }
+
+      fieldmap.set(item.key, true)
+
+      if (search.type === 'group') {
+        options.push({
+          key: search.field,
+          value: '0'
+        })
+        options.push({
+          key: search.datefield,
+          value: '0'
+        })
+        options.push({
+          key: search.datefield + '1',
+          value: '0'
+        })
+        options.push(item)
+      } else if (['datemonth', 'dateweek', 'daterange'].includes(search.type)) {
+        options.push(item)
+        options.push({
+          key: item.key + '1',
+          value: '0'
+        })
+      } else if (search.type === 'text' || search.type === 'select') {
+        item.key.split(',').forEach(field => {
+          let cell = JSON.parse(JSON.stringify(item))
+          cell.key = field
+
+          options.push(cell)
+        })
+      } else {
+        options.push(item)
+      }
+    })
+
+    return options
+  }
+
   /**
    * @description 鑾峰彇鍏ㄩ儴鎼滅储鏉′欢
    * @param {Array} searches 鎼滅储鏉′欢鏁扮粍

--
Gitblit v1.8.0