king
2024-08-25 326aa6b3effaccc71cfe0775d47b0f29eb3695a6
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
@@ -169,7 +169,7 @@
  delTab = (tab) => {
    let tabs = fromJS(this.state.tabs).toJS()
    const _this = this
    const that = this
    tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid)
@@ -177,8 +177,8 @@
      title: '确定删除标签?',
      content: '',
      onOk() {
        _this.setState({tabs})
        _this.props.updateConfig(tabs)
        that.setState({tabs})
        that.props.updateConfig(tabs)
      },
      onCancel() {}
    })
@@ -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)
      }
    })
@@ -332,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>