From bfcacf54ad793bc33560f8bb15833508cf73aa5b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 31 三月 2023 01:18:44 +0800
Subject: [PATCH] 2023-03-31

---
 src/mob/modalconfig/index.jsx |   49 ++++++-------------------------------------------
 1 files changed, 6 insertions(+), 43 deletions(-)

diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx
index 062c54e..b355b14 100644
--- a/src/mob/modalconfig/index.jsx
+++ b/src/mob/modalconfig/index.jsx
@@ -20,8 +20,8 @@
 
 const { Panel } = Collapse
 const { confirm } = Modal
-const PasteComponent = asyncComponent(() => import('./pastecomponent'))
 const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform'))
+const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms'))
 const DragElement = asyncComponent(() => import('@/mob/components/formdragelement'))
 const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
 
@@ -412,49 +412,12 @@
     })
   }
 
-  insert = (config, type) => {
-    if (type === 'forms') {
-      let _config = fromJS(this.state.config).toJS()
-
-      if (_config.fields.length > 0) {
-        let that = this
-        _config.fields = config.fields.map(item => {
-          item.uuid = Utils.getuuid()
-          return item
-        })
-
-        confirm({
-          title: '纭畾鏇挎崲琛ㄥ崟鍚楋紵',
-          content: '鍘熻〃鍗曞皢鍒犻櫎銆�',
-          onOk() {
-            that.setState({
-              config: _config
-            })
-          },
-          onCancel() {}
-        })
-      } else {
-        _config.fields = config.fields.map(item => {
-          item.uuid = Utils.getuuid()
-          return item
-        })
-
-        this.setState({
-          config: _config
-        })
-        notification.success({
-          top: 92,
-          message: '绮樿创鎴愬姛锛�',
-          duration: 2
-        })
-      }
-      return
-    }
+  pasteFields = (items) => {
+    let _config = fromJS(this.state.config).toJS()
+    _config.fields = items
 
     this.setState({
-      config
-    }, () => {
-      this.handleForm(config.fields[config.fields.length - 1])
+      config: _config
     })
   }
 
@@ -528,7 +491,7 @@
             <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>淇濆瓨</Button>
             <Button onClick={this.cancelConfig}>杩斿洖</Button>
             <Button type="primary" style={{background: '#26C281', border: 'none'}} onClick={this.triggerCopy}>澶嶅埗</Button>
-            <PasteComponent config={config} updateConfig={this.insert} />
+            <PasteForms type="toolbar" config={config} update={this.pasteFields}/>
             <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button>
             <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
           </div>

--
Gitblit v1.8.0