From 5f5f799e3ebcb559cc027ac17fa9c68a1a9117bf Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 31 三月 2023 12:51:56 +0800
Subject: [PATCH] 2023-03-31

---
 src/menu/components/editor/braft-editor/options.jsx           |   12 ++++++
 src/tabviews/custom/components/editor/braft-editor/index.jsx  |    2 
 src/menu/components/group/paste/index.jsx                     |    2 
 src/menu/components/share/pasteforms/index.jsx                |    8 +++-
 src/templates/zshare/pasteform/index.jsx                      |   31 ++++++++++++---
 src/menu/pastecontroller/index.jsx                            |    2 
 src/tabviews/zshare/actionList/printbutton/index.jsx          |    8 ++++
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx       |    5 ++
 src/tabviews/custom/components/editor/braft-editor/index.scss |   10 +++++
 src/menu/components/editor/braft-editor/index.jsx             |    4 +-
 src/menu/components/editor/braft-editor/index.scss            |    9 ++++
 src/tabviews/zshare/actionList/normalbutton/index.jsx         |    8 ++++
 src/menu/components/tabs/paste/index.jsx                      |    2 
 13 files changed, 89 insertions(+), 14 deletions(-)

diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx
index 444a206..85d22a1 100644
--- a/src/menu/components/editor/braft-editor/index.jsx
+++ b/src/menu/components/editor/braft-editor/index.jsx
@@ -199,14 +199,14 @@
     let style = {...card.style}
 
     return (
-      <div className="menu-normal-editor-box" style={style} onClick={this.clickComponent} id={card.uuid}>
+      <div className={'menu-normal-editor-box ' + (card.wrap.firstTr || '')} style={style} onClick={this.clickComponent} id={card.uuid}>
         <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
             <NormalForm title="瀵屾枃鏈缃�" width={750} update={this.updateWrap} getForms={this.getWrapForms}>
               <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
             </NormalForm>
-            <CopyComponent type="normaltable" card={card}/>
+            <CopyComponent type="editor" card={card}/>
             <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
             <UserComponent config={card}/>
             <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} />
diff --git a/src/menu/components/editor/braft-editor/index.scss b/src/menu/components/editor/braft-editor/index.scss
index 8830797..aa55923 100644
--- a/src/menu/components/editor/braft-editor/index.scss
+++ b/src/menu/components/editor/braft-editor/index.scss
@@ -25,6 +25,15 @@
     color: #bcbcbc;
   }
 }
+.menu-normal-editor-box.light {
+  .braft-content {
+    table {
+      tr:first-child {
+        background-color:#ffffff;
+      }
+    }
+  }
+}
 .menu-normal-editor-box::after {
   display: block;
   content: ' ';
diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx
index 3c33098..c746b12 100644
--- a/src/menu/components/editor/braft-editor/options.jsx
+++ b/src/menu/components/editor/braft-editor/options.jsx
@@ -118,6 +118,18 @@
     },
     {
       type: 'radio',
+      field: 'firstTr',
+      label: '琛ㄦ牸棣栬',
+      initval: wrap.firstTr || 'deep',
+      tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��',
+      required: false,
+      options: [
+        {value: 'deep', label: '娣辫壊'},
+        {value: 'light', label: '娴呰壊'},
+      ]
+    },
+    {
+      type: 'radio',
       field: 'permission',
       label: '鏉冮檺楠岃瘉',
       initval: wrap.permission || 'false',
diff --git a/src/menu/components/group/paste/index.jsx b/src/menu/components/group/paste/index.jsx
index 608cf32..8db0190 100644
--- a/src/menu/components/group/paste/index.jsx
+++ b/src/menu/components/group/paste/index.jsx
@@ -20,7 +20,7 @@
 
   pasteSubmit = () => {
     let appType = sessionStorage.getItem('appType')
-    let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox']
+    let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'editor', 'line', 'bar', 'pie', 'scatter', 'sandbox']
     let types = {
       login: '鐧诲綍',
       navbar: '瀵艰埅鏍�',
diff --git a/src/menu/components/share/pasteforms/index.jsx b/src/menu/components/share/pasteforms/index.jsx
index ff09638..6cf98a8 100644
--- a/src/menu/components/share/pasteforms/index.jsx
+++ b/src/menu/components/share/pasteforms/index.jsx
@@ -10,7 +10,7 @@
 
 const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
 
-class PasteController extends Component {
+class PasteForms extends Component {
   static propTpyes = {
     config: PropTypes.object,        // 缁勪欢閰嶇疆
     update: PropTypes.func
@@ -26,6 +26,10 @@
     const { config } = this.props
 
     this.pasteFormRef.handleConfirm().then(res => {
+      if (res.copyType === 'search' && ['text', 'select', 'multiselect', 'link', 'checkcard', 'date', 'datemonth'].includes(res.type)) {
+        res.copyType = 'form'
+      }
+
       if (!['form', 'forms', 'formgroup', 'simpleform'].includes(res.copyType)) {
         notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 })
         return
@@ -171,4 +175,4 @@
   }
 }
 
-export default PasteController
\ No newline at end of file
+export default PasteForms
\ No newline at end of file
diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx
index 31151b9..9391b7c 100644
--- a/src/menu/components/tabs/paste/index.jsx
+++ b/src/menu/components/tabs/paste/index.jsx
@@ -53,7 +53,7 @@
   pasteSubmit = () => {
     const { Tab } = this.props
     let appType = sessionStorage.getItem('appType')
-    let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox']
+    let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'editor', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox']
     let types = {
       login: '鐧诲綍',
       navbar: '瀵艰埅鏍�',
diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx
index a8579f3..5179037 100644
--- a/src/menu/pastecontroller/index.jsx
+++ b/src/menu/pastecontroller/index.jsx
@@ -54,7 +54,7 @@
 
   pasteSubmit = () => {
     let appType = sessionStorage.getItem('appType')
-    let options = ['tabs', 'timeline', 'datacard', 'propcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'iframe', 'sandbox']
+    let options = ['tabs', 'timeline', 'datacard', 'propcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'bar', 'editor', 'pie', 'scatter', 'iframe', 'sandbox']
 
     if (appType === 'mob') {
       if (sessionStorage.getItem('editMenuType') !== 'popview') {
diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx
index 434ed5d..a4084ac 100644
--- a/src/tabviews/custom/components/editor/braft-editor/index.jsx
+++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx
@@ -222,7 +222,7 @@
     if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null
 
     return (
-      <div className="custom-braft-editor-box" id={'anchor' + config.uuid} style={config.style}>
+      <div className={'custom-braft-editor-box ' + (config.wrap.firstTr || '')} id={'anchor' + config.uuid} style={config.style}>
         {loading ?
           <div className="loading-mask">
             <div className="ant-spin-blur"></div>
diff --git a/src/tabviews/custom/components/editor/braft-editor/index.scss b/src/tabviews/custom/components/editor/braft-editor/index.scss
index 5bbfc97..1829c88 100644
--- a/src/tabviews/custom/components/editor/braft-editor/index.scss
+++ b/src/tabviews/custom/components/editor/braft-editor/index.scss
@@ -28,6 +28,16 @@
   }
 }
 
+.custom-braft-editor-box.light {
+  .braft-content {
+    table {
+      tr:first-child {
+        background-color:#ffffff;
+      }
+    }
+  }
+}
+
 .custom-braft-editor-box::after {
   content: ' ';
   display: block;
diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index be05ea6..b96ad92 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -922,6 +922,11 @@
       menuname: btn.logLabel
     }
 
+    if (btn.verify.dataType !== 'custom' && setting.sub_field) {
+      arr_field = arr_field + ',' + setting.sub_field
+      param.arr_field = arr_field
+    }
+
     // 鏁版嵁绠$悊鏉冮檺
     if (sessionStorage.getItem('dataM') === 'true') {
       param.dataM = 'Y'
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index b22f897..699bebe 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2614,6 +2614,14 @@
       } else if (item.type === 'datetime') {
         _item.type = 'date'
         _format = 'YYYY-MM-DD HH:mm:ss'
+      } else if (['select', 'link', 'radio'].includes(item.type)) { // 閫変腑绗竴椤�
+        if (typeof(_initval) === 'string' && _initval.indexOf('$first') > -1) {
+          _initval = ''
+
+          if (item.resourceType === '0' && item.options[0] && item.options[0].Value) {
+            _initval = item.options[0].Value
+          }
+        }
       }
 
       let key = item.field.toLowerCase()
diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 8983ccf..9bdf99e 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -2120,6 +2120,14 @@
 
       if (item.type === 'linkMain' || item.type === 'funcvar') {
         _readin = false
+      } else if (['select', 'link', 'radio'].includes(item.type)) { // 閫変腑绗竴椤�
+        if (typeof(_initval) === 'string' && _initval.indexOf('$first') > -1) {
+          _initval = ''
+
+          if (item.resourceType === '0' && item.options[0] && item.options[0].Value) {
+            _initval = item.options[0].Value
+          }
+        }
       }
 
       if (item.type === 'linkMain' && BData.hasOwnProperty(item.field.toLowerCase())) {
diff --git a/src/templates/zshare/pasteform/index.jsx b/src/templates/zshare/pasteform/index.jsx
index 2facaa2..f44b6bb 100644
--- a/src/templates/zshare/pasteform/index.jsx
+++ b/src/templates/zshare/pasteform/index.jsx
@@ -55,12 +55,31 @@
               }
             }
           } catch (e) {
-            notification.warning({
-              top: 92,
-              message: '瑙f瀽閿欒',
-              duration: 5
-            })
-            _config = ''
+            // 閫氳繃sql璇彞娣诲姞瀛楁闆�
+            if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig.test(values.config)) {
+              _config = {
+                key: 'datasourcefield',
+                type: 'array',
+                data: []
+              }
+
+              let list = values.config.match(/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig)
+
+              list.forEach(item => {
+                _config.data.push({
+                  datatype: item.split(/\s+/)[1],
+                  field: item.split(/\s+/)[0],
+                  label: item.split(/\s+/)[0],
+                })
+              })
+            } else {
+              notification.warning({
+                top: 92,
+                message: '瑙f瀽閿欒',
+                duration: 5
+              })
+              _config = ''
+            }
           }
 
           if (_config) {

--
Gitblit v1.8.0