From 7b0dbecd1d6155d26ec67be0a47a16264c738c85 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 09 五月 2023 14:48:10 +0800
Subject: [PATCH] 2023-05-09

---
 src/templates/sharecomponent/fieldscomponent/index.jsx |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx
index 3066fac..c493ccd 100644
--- a/src/templates/sharecomponent/fieldscomponent/index.jsx
+++ b/src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -106,10 +106,13 @@
       selectCards.forEach(item => {
         let _match = ''
         let initval = ''
-        if (item.type === 'select') {
+        let _type = item.type
+        if (item.type === 'date') {
+          _type = 'daterange'
+        } else if (item.type === 'select') {
           _match = '='
         } else {
-          item.type = 'text'
+          _type = 'text'
           _match = 'like'
         }
 
@@ -118,7 +121,7 @@
           label: item.label,
           field: item.field,
           initval: initval,
-          type: item.type,
+          type: _type,
           resourceType: '0',
           options: [],
           orderType: 'asc',
@@ -163,7 +166,7 @@
           field: item.field,
           datatype: _t
         }
-        items.push(newcard)
+        items.unshift(newcard)
         keys.push(item.field.toLowerCase())
       })
 
@@ -194,7 +197,13 @@
           required: 'true'
         }
 
-        if (item.type === 'text' && item.length >= 256) {
+        if (/^icon|images?$/ig.test(item.field)) {
+          newcard.type = 'fileupload'
+          newcard.fileType = 'picture-card'
+          newcard.fieldlength = item.length || 512
+          newcard.maxSize = 1
+          newcard.maxfile = 1
+        } else if (item.type === 'text' && item.length >= 256) {
           newcard.type = 'textarea'
           newcard.required = 'false'
           newcard.fieldlength = item.length

--
Gitblit v1.8.0