From 06a670976e2145a10ea05207041d3cf3164cd380 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 03 二月 2024 18:13:25 +0800
Subject: [PATCH] Merge branch 'positec' into dms

---
 src/mob/components/tabs/antv-tabs/index.jsx |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/mob/components/tabs/antv-tabs/index.jsx b/src/mob/components/tabs/antv-tabs/index.jsx
index fdd6b21..9653b81 100644
--- a/src/mob/components/tabs/antv-tabs/index.jsx
+++ b/src/mob/components/tabs/antv-tabs/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Tabs, Popover, Modal, notification } from 'antd'
+import { Tabs, Popover, Modal } from 'antd'
 import { ToolOutlined, PlusOutlined, EditOutlined, FontColorsOutlined, DeleteOutlined, CloseOutlined } from '@ant-design/icons'
 
 import MKEmitter from '@/utils/events.js'
@@ -16,7 +16,7 @@
 
 const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
-const PasteComponent = asyncIconComponent(() => import('@/menu/components/tabs/paste'))
+const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller'))
 const TabComponents = asyncComponent(() => import('../tabcomponents'))
 
 const { TabPane } = Tabs
@@ -203,20 +203,11 @@
     this.props.updateConfig(tabs)
   }
 
-  insert = (item, tab) => {
+  insert = (item, tabId) => {
     let tabs = fromJS(this.state.tabs).toJS()
 
-    if (item.type === 'search') {
-      notification.warning({
-        top: 92,
-        message: '绉诲姩绔悳绱㈢粍浠朵笉鍙矘璐达紒',
-        duration: 5
-      })
-      return
-    }
-
     tabs.subtabs.forEach(stab => {
-      if (stab.uuid === tab.uuid) {
+      if (stab.uuid === tabId) {
         stab.components.push(item)
       }
     })
@@ -251,7 +242,7 @@
     editab.hide = res.hide || 'false'
     editab.backgroundColor = res.backgroundColor
     // editab.controlVal = res.controlVal || ''
-    editab.selectVal = res.selectVal || ''
+    // editab.selectVal = res.selectVal || ''
     editab.blacklist = res.blacklist
 
     if (editab.uuid) {
@@ -295,6 +286,17 @@
 
       delete res.controlVals
     }
+    if (res.selectVals) {
+      let values = {}
+      res.selectVals.forEach(item => {
+        values[item.uuid] = item.value
+      })
+      tabs.subtabs.forEach(tab => {
+        tab.selectVal = values[tab.uuid]
+      })
+
+      delete res.selectVals
+    }
 
     tabs.setting = res
 
@@ -321,7 +323,7 @@
                   <NormalForm title="鏍囩缂栬緫" width={800} update={this.updateTab} getForms={() => this.getTabForms(tab)}>
                     <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
                   </NormalForm>
-                  <PasteComponent Tab={tab} insert={this.insert} />
+                  <PasteController type="tabs" tab={tab} insert={(item) => this.insert(item, tab.uuid)} />
                   <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeTabStyle}/>
                   <CloseOutlined className="close" onClick={() => this.delTab(tab)} />
                 </div>

--
Gitblit v1.8.0