From 2737c184d0954ac1f13b3a02840a88cd0db159c0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 15 一月 2021 18:30:30 +0800
Subject: [PATCH] 2021-01-15

---
 src/templates/zshare/modalform/index.jsx        |    3 ++-
 src/templates/modalconfig/index.scss            |    4 ++++
 src/templates/modalconfig/source.jsx            |    6 ++++++
 src/templates/modalconfig/dragelement/index.jsx |    2 +-
 src/templates/zshare/formconfig.jsx             |   16 ++++++++++++++++
 src/templates/modalconfig/dragelement/card.jsx  |   11 ++++++++---
 6 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx
index 19e6785..8c78e29 100644
--- a/src/templates/modalconfig/dragelement/card.jsx
+++ b/src/templates/modalconfig/dragelement/card.jsx
@@ -3,12 +3,15 @@
 import { Icon, Select, DatePicker, Input, InputNumber, Button, Popover, Switch, Radio, Checkbox } from 'antd'
 import moment from 'moment'
 
-import CheckCard from '../checkCard'
-import ColorSketch from '@/mob/colorsketch'
+import asyncComponent from '@/utils/asyncComponent'
 import './index.scss'
 
 const { MonthPicker } = DatePicker
 const { TextArea } = Input
+
+const Editor = asyncComponent(() => import('@/components/editor'))
+const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
+const CheckCard = asyncComponent(() => import('../checkCard'))
 
 const Card = ({ id, card, cols, moveCard, findCard, editCard, closeCard, copyCard, showField }) => {
   const originalIndex = findCard(id).index
@@ -63,7 +66,7 @@
   let wrapCol = 'ant-col-sm-16'
   let isEntireLine = false
 
-  if (card.entireLine === 'true' || ['textarea', 'hint', 'checkcard'].includes(card.type)) {
+  if (card.entireLine === 'true' || ['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type)) {
     isEntireLine = true
   }
 
@@ -97,6 +100,8 @@
     formItem = (<DatePicker showTime value={card.initval ? moment().subtract(card.initval, 'days') : null} />)
   } else if (card.type === 'textarea') {
     formItem = (<TextArea value={card.initval} autoSize={{ minRows: 2, maxRows: 6 }} />)
+  } else if (card.type === 'brafteditor') {
+    formItem = (<Editor />)
   } else if (card.type === 'fileupload') {
     formItem = (<Button style={{marginTop: '3px'}}><Icon type="upload" /> 鐐瑰嚮涓婁紶 </Button>)
   } else if (card.type === 'funcvar') {
diff --git a/src/templates/modalconfig/dragelement/index.jsx b/src/templates/modalconfig/dragelement/index.jsx
index 5f978c3..bcfe294 100644
--- a/src/templates/modalconfig/dragelement/index.jsx
+++ b/src/templates/modalconfig/dragelement/index.jsx
@@ -128,7 +128,7 @@
       {cards.map(card => {
         let isEntireLine = false
 
-        if (card.entireLine === 'true' || ['textarea', 'hint', 'checkcard'].includes(card.type)) {
+        if (card.entireLine === 'true' || ['textarea', 'hint', 'checkcard', 'brafteditor'].includes(card.type)) {
           isEntireLine = true
         }
         
diff --git a/src/templates/modalconfig/index.scss b/src/templates/modalconfig/index.scss
index 8d3e188..9dd5236 100644
--- a/src/templates/modalconfig/index.scss
+++ b/src/templates/modalconfig/index.scss
@@ -252,6 +252,10 @@
                   min-width: 100px;
                 }
               }
+              .normal-braft-editor {
+                border: 1px solid #d9d9d9;
+                border-radius: 4px;
+              }
             }
             .ant-form-item-control-wrapper::after {
               content: '';
diff --git a/src/templates/modalconfig/source.jsx b/src/templates/modalconfig/source.jsx
index 0148cdb..9edd2ae 100644
--- a/src/templates/modalconfig/source.jsx
+++ b/src/templates/modalconfig/source.jsx
@@ -170,6 +170,12 @@
   },
   {
     type: 'form',
+    label: '瀵屾枃鏈�',
+    subType: 'brafteditor',
+    url: ''
+  },
+  {
+    type: 'form',
     label: CommonDict['header.form.funcvar'],
     subType: 'funcvar',
     url: ''
diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index 65a1932..0697f18 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -1927,6 +1927,9 @@
         value: 'color',
         text: Formdict['model.form.color']
       }, {
+        value: 'brafteditor',
+        text: '瀵屾枃鏈�'
+      }, {
         value: 'funcvar',
         text: Formdict['header.form.funcvar']
       },
@@ -2225,6 +2228,19 @@
     },
     {
       type: 'radio',
+      key: 'hidelabel',
+      label: '闅愯棌鍚嶇О',
+      initVal: card.hidelabel || 'false',
+      options: [{
+        value: 'true',
+        text: Formdict['model.true']
+      }, {
+        value: 'false',
+        text: Formdict['model.false']
+      }]
+    },
+    {
+      type: 'radio',
       key: 'readonly',
       label: Formdict['header.form.readonly'],
       initVal: card.readonly || 'false',
diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx
index 1b9b8cf..852f8bb 100644
--- a/src/templates/zshare/modalform/index.jsx
+++ b/src/templates/zshare/modalform/index.jsx
@@ -30,6 +30,7 @@
   textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'maxRows', 'encryption', 'interception', 'tooltip'],
   color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'entireLine', 'tooltip'],
   hint: ['label', 'type', 'blacklist', 'message'],
+  brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'tooltip'],
   funcvar: [],
   linkMain: ['readonly', 'required', 'hidden', 'fieldlength', 'entireLine', 'tooltip']
 }
@@ -521,7 +522,7 @@
                   getPopupContainer={() => document.getElementById('modal-fields-form-box')}
                 >
                   {item.options.map((option, i) =>
-                    <Select.Option key={`${i}`} value={option.value || option.field}>
+                    <Select.Option key={`${i}`} value={option.value || option.field || ''}>
                       {item.key === 'icon' && <Icon type={option.text} />} {option.text || option.label}
                     </Select.Option>
                   )}

--
Gitblit v1.8.0