From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

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

diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx
index 67cb5a2..34b71e8 100644
--- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx
+++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -84,6 +84,7 @@
       {value: '[3, 0]', label: '杩戜笁澶�'},
       {value: '[7, 0]', label: '杩戜竷澶�'},
       {value: '[30, 0]', label: '杩�30澶�'},
+      {value: '[90, 0]', label: '杩�90澶�'},
       {value: '[7, -7]', label: '鍓嶅悗涓冨ぉ'},
       {value: '[30, -30]', label: '鍓嶅悗30澶�'},
       {value: '[90, -90]', label: '鍓嶅悗90澶�'},
@@ -98,6 +99,7 @@
 const searchTypeOptions = {
   text: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'inputType', 'advanced', 'query', 'labelwidth'],
   select: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'dropdown', 'query', 'labelwidth'],
+  radio: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'query', 'labelwidth'],
   multiselect: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'],
   link: ['label', 'field', 'resourceType', 'initval', 'type', 'linkField', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'dropdown', 'query', 'labelwidth'],
   date: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'precision', 'labelwidth'],
@@ -119,11 +121,7 @@
   }
 
   state = {
-    openType: null,          // 鎼滅储鏉′欢鏄剧ず绫诲瀷
-    resourceType: null,      // 涓嬫媺鎼滅储鏃讹紝閫夐」鏉ユ簮绫诲瀷
-    formlist: null,          // 琛ㄥ崟
-    cFields: [],
-    textTooltip: '瀛楁鍚嶅彲浠ヤ娇鐢ㄩ�楀彿鍒嗛殧锛岃繘琛岀患鍚堟悳绱�',
+    formlist: null
   }
 
   record = {}
@@ -183,7 +181,7 @@
     let reRequired = {}
     let reLabel = {}
 
-    if (['multiselect', 'select', 'link'].includes(type)) {
+    if (['multiselect', 'select', 'link', 'radio'].includes(type)) {
       reRequired.linkField = true
       if (this.record.resourceType === '0') {        // 鑷畾涔夎祫婧�
         shows.push('options')
@@ -213,6 +211,9 @@
         }
         if (this.record.selectStyle === 'custom') {
           shows.push('backgroundColor')
+        }
+        if (this.record.multiple === 'dropdown' && this.record.resourceType === '1') {
+          shows.push('mark', 'parentField')
         }
       }
       shows.push('linkField')
@@ -319,7 +320,7 @@
               uuid: key
             }]
           }
-        } else if (['multiselect', 'select', 'link'].includes(value)) {
+        } else if (['multiselect', 'select', 'link', 'radio'].includes(value)) {
           if (!this.record.options[0].Text && this.record.fields.length > 0) {
             let field = this.record.fields[0].field
     
@@ -487,7 +488,7 @@
             <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />
           </AutoComplete>
         } else {
-          content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />
+          content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} onChange={(e) => {this.optionChange(item.key, e.target.value)}}/>
         }
       } else if (item.type === 'number') {
         rules = [
@@ -554,7 +555,7 @@
           if (this.record.linkField) {
             type = 'link'
           }
-          content = <DataTable type={type} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/>
+          content = <DataTable type={type} multiple={this.record.multiple} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/>
         }
       } else if (item.type === 'fields') {
         span = 24
@@ -619,7 +620,7 @@
         if (!err) {
           values.uuid = this.props.card.uuid
           // 涓嬫媺鑿滃崟鎴栬仈鍔ㄨ彍鍗�
-          if (['multiselect', 'select', 'link'].includes(values.type)) {
+          if (['multiselect', 'select', 'link', 'radio'].includes(values.type)) {
             if (values.resourceType === '0') {
               values.options = values.options || []
               values.dataSource = ''
@@ -665,10 +666,15 @@
               values.options = []
             }
           } else if (values.type === 'checkcard') {
+            if (values.multiple === 'dropdown' && values.display !== 'text') {
+              values.multiple = 'false'
+            }
+
             if (values.resourceType === '0') {
               values.options = values.options || []
               values.options = values.options.map(m => {
                 m.ParentID = m.ParentID || ''
+                m.pid = m.pid || ''
                 return m
               })
 
@@ -750,7 +756,7 @@
 
           ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => {
             if (values[item]) {
-              values[item] = values[item].replace(/\s* | \t* | \v* | \r*/ig, '')
+              values[item] = values[item].replace(/\s+|\t+|\v+|\r+/ig, '')
             }
           })
 

--
Gitblit v1.8.0