From 09e0de52a398dd08a0dc3f4b43e4589d211e9c27 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 30 十二月 2021 12:44:45 +0800
Subject: [PATCH] 2021-12-30

---
 src/templates/zshare/formconfig.jsx |  109 ++++++++++++++++++++++++++----------------------------
 1 files changed, 53 insertions(+), 56 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 3eabad5..0498a8c 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -364,23 +364,30 @@
     }
   }
 
+  let options = card.options || []
+  if (['select', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎
+    options.unshift({
+      key: 'empty',
+      Value: '',
+      Text: '鍏ㄩ儴',
+      ParentID: ''
+    })
+  }
+
   return [
     {
       type: 'text',
       key: 'label',
       label: Formdict['model.name'],
       initVal: card.label || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'field',
       label: Formdict['model.form.field'],
       initVal: card.field || '',
-      tooltipClass: 'middle',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'select',
@@ -395,8 +402,7 @@
       key: 'datefield',
       label: '鏃堕棿瀛楁',
       initVal: card.datefield || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
@@ -420,19 +426,19 @@
         text: Formdict['header.form.datasource']
       }]
     },
-    {
-      type: 'radio',
-      key: 'setAll',
-      label: '璁剧疆鍏ㄩ儴',
-      initVal: card.setAll || 'true',
-      options: [{
-        value: 'true',
-        text: Formdict['model.true']
-      }, {
-        value: 'false',
-        text: Formdict['model.false']
-      }]
-    },
+    // {
+    //   type: 'radio',
+    //   key: 'setAll',
+    //   label: '璁剧疆鍏ㄩ儴',
+    //   initVal: card.setAll || 'true',
+    //   options: [{
+    //     value: 'true',
+    //     text: Formdict['model.true']
+    //   }, {
+    //     value: 'false',
+    //     text: Formdict['model.false']
+    //   }]
+    // },
     {
       type: 'radio',
       key: 'display',
@@ -463,16 +469,14 @@
       key: 'cardValField',
       label: '鍊悸峰瓧娈�',
       initVal: card.cardValField || 'Value',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'urlField',
       label: '鍦板潃瀛楁',
       initVal: card.urlField || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'radio',
@@ -499,24 +503,21 @@
       key: 'fields',
       label: '瀛楁闆�',
       initVal: card.fields || [],
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'textarea',
       key: 'dataSource',
       label: Formdict['header.form.datasource'],
       initVal: card.dataSource || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'options',
       key: 'options',
       label: '閫夐」',
-      initVal: card.options || [],
-      required: true,
-      readonly: false
+      initVal: options,
+      required: true
     },
     {
       type: 'checkbox',
@@ -524,7 +525,6 @@
       label: '閫夐」',
       initVal: card.items || ['day', 'week', 'month', 'quarter', 'year', 'customized'],
       required: true,
-      readonly: false,
       options: [{
         value: 'day',
         label: '鏃�'
@@ -546,12 +546,26 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'multiple',
+      label: '閫夋嫨褰㈠紡',
+      initVal: card.multiple || 'false',
+      required: true,
+      options: [{
+        value: 'false',
+        text: '鍗曢��'
+      }, {
+        value: 'true',
+        text: '澶氶��'
+      }]
+    },
+    {
       type: 'select',
       key: 'linkField',
       label: '鍏宠仈瀛楁',
       initVal: card.linkField || '',
       required: true,
-      readonly: false,
+      allowClear: true,
       options: linkableFields
     },
     {
@@ -559,24 +573,21 @@
       key: 'valueField',
       label: '鍊悸峰瓧娈�',
       initVal: card.valueField || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'valueText',
       label: '鏂囨湰路瀛楁',
       initVal: card.valueText || '',
-      required: true,
-      readonly: false
+      required: true
     },
     {
       type: 'text',
       key: 'orderBy',
       label: '鎺掑簭路瀛楁',
       initVal: card.orderBy || '',
-      required: false,
-      readonly: false
+      required: false
     },
     {
       type: 'select',
@@ -637,20 +648,6 @@
       initVal: card.ratio || 6,
       forbid: appType === 'mob',
       required: false
-    },
-    {
-      type: 'radio',
-      key: 'multiple',
-      label: '鍙閫�',
-      initVal: card.multiple || 'false',
-      required: true,
-      options: [{
-        value: 'true',
-        text: '鏄�'
-      }, {
-        value: 'false',
-        text: '鍚�'
-      }]
     },
     {
       type: 'radio',
@@ -2554,11 +2551,11 @@
       initVal: card.multiple || 'false',
       required: true,
       options: [{
-        value: 'true',
-        text: '澶氶��'
-      }, {
         value: 'false',
         text: '鍗曢��'
+      }, {
+        value: 'true',
+        text: '澶氶��'
       }]
     },
     {

--
Gitblit v1.8.0