From 4c775de9de07291b345fd5c975a87230ddedd5ca Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 20 五月 2020 09:27:13 +0800
Subject: [PATCH] 2020-05-20

---
 src/templates/zshare/formconfig.jsx |  102 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 93 insertions(+), 9 deletions(-)

diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 4b47bd8..9d5a4b2 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -1217,7 +1217,7 @@
  * @param {object} card       // 鎼滅储鏉′欢瀵硅薄
  * @param {Array}  roleList   // 瑙掕壊鍒楄〃-榛戝悕鍗�
  */
-export function getChartViewForm (card, roleList = []) {
+export function getChartViewForm (card, roleList = [], _columns) {
   let _charts = [{
     value: 'line',
     text: '鎶樼嚎鍥�'
@@ -1332,6 +1332,16 @@
         value: 'roll',
         text: '婊氬姩'
       }]
+    },
+    {
+      type: 'select',
+      key: 'bgfield',
+      label: '鑳屾櫙鎺у埗',
+      initVal: card.bgfield || '',
+      required: false,
+      readonly: false,
+      hidden: true,
+      options: _columns
     },
     {
       type: 'multiselect',
@@ -2092,6 +2102,7 @@
       label: '鏁版嵁绫诲瀷',
       initVal: card.datatype || 'dynamic',
       required: true,
+      forbid: !['detail', 'header'].includes(_type),
       options: [{
         value: 'dynamic',
         text: '鍔ㄦ��'
@@ -2101,11 +2112,27 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'type',
+      label: '绫诲瀷',
+      initVal: card.type || 'picture',
+      required: true,
+      forbid: !['avatar'].includes(_type),
+      options: [{
+        value: 'picture',
+        text: '鍥剧墖'
+      }, {
+        value: 'icon',
+        text: '鍥炬爣'
+      }]
+    },
+    {
       type: 'text',
       key: 'content',
       label: '鍐呭',
       initVal: card.content || '',
-      required: true
+      required: true,
+      forbid: !['detail', 'header'].includes(_type),
     },
     {
       type: 'select',
@@ -2113,6 +2140,7 @@
       label: '瀛楁',
       initVal: card.field || '',
       required: true,
+      forbid: !['detail', 'header', 'avatar'].includes(_type),
       options: _columns
     },
     {
@@ -2121,7 +2149,7 @@
       label: '鍔犵矖',
       initVal: card.bold || 'false',
       required: true,
-      forbid: _type !== 'detail',
+      forbid: !['detail'].includes(_type),
       options: [{
         value: 'true',
         text: '鏄�'
@@ -2136,7 +2164,7 @@
       label: '瀹藉害',
       initVal: card.width || '',
       required: false,
-      forbid: _type !== 'detail',
+      forbid: !['detail'].includes(_type),
       options: [{
         value: '',
         text: '100%'
@@ -2150,13 +2178,51 @@
     },
     {
       type: 'radio',
+      key: 'widthType',
+      label: '瀹藉害璁剧疆',
+      initVal: card.widthType || 'absolute',
+      required: false,
+      forbid: !['avatar'].includes(_type),
+      hidden: true,
+      options: [{
+        value: 'ratio',
+        text: '姣斾緥'
+      }, {
+        value: 'absolute',
+        text: '缁濆鍊�'
+      }]
+    },
+    {
+      type: 'number',
+      key: 'width',
+      label: '瀹藉害鍊�',
+      initVal: card.width || 32,
+      min: 1,
+      max: card.widthType === 'ratio' ? 100 : 500,
+      required: false,
+      hidden: true,
+      forbid: !['avatar'].includes(_type)
+    },
+    {
+      type: 'number',
+      key: 'size',
+      label: '瀛椾綋澶у皬',
+      initVal: card.size || 14,
+      min: 12,
+      max: 500,
+      required: false,
+      hidden: true,
+      forbid: !['avatar'].includes(_type)
+    },
+    {
+      type: 'radio',
       key: 'align',
       label: '瀵归綈',
-      initVal: card.align || '',
+      initVal: card.align || 'left',
       required: false,
-      forbid: _type !== 'detail',
+      forbid: !['detail'].includes(_type),
       options: [{
-        value: '',
+        value: 'left',
         text: '宸�'
       }, {
         value: 'align-center',
@@ -2167,13 +2233,31 @@
       }]
     },
     {
+      type: 'radio',
+      key: 'show',
+      label: '鏄剧ず',
+      initVal: card.show || '',
+      required: false,
+      forbid: !['bottom'].includes(_type),
+      options: [{
+        value: 'icon',
+        text: '鍥炬爣'
+      }, {
+        value: 'text',
+        text: '鏂囧瓧'
+      }, {
+        value: 'all',
+        text: '鍏ㄩ儴'
+      }]
+    },
+    {
       type: 'multiselect',
       key: 'actions',
       label: '鎸夐挳缁�',
       tooltip: '',
-      initVal: card.actions || [],
+      initVal: card.actions ? card.actions.map(cell => cell.value) : [],
       required: false,
-      forbid: _type !== 'header',
+      forbid: !['header', 'bottom'].includes(_type),
       options: _actions
     },
   ]

--
Gitblit v1.8.0