king
2022-08-19 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9
src/menu/components/group/normal-group/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Popover, Button } from 'antd'
import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined } from '@ant-design/icons'
import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, PrinterOutlined } from '@ant-design/icons'
import MKEmitter from '@/utils/events.js'
import asyncComponent from '@/utils/asyncComponent'
@@ -35,7 +35,6 @@
      let _group = {
        uuid: group.uuid,
        type: group.type,
        floor: group.floor,
        tabId: group.tabId || '',
        parentId: group.parentId || '',
        subtype: group.subtype,
@@ -61,7 +60,6 @@
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
    MKEmitter.addListener('tabsChange', this.handleTabsChange)
    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
  }
@@ -73,7 +71,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
    MKEmitter.removeListener('tabsChange', this.handleTabsChange)
    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
  }
@@ -100,15 +97,11 @@
  changeStyle = () => {
    const { group } = this.state
    MKEmitter.emit('changeStyle', [group.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], group.style)
    MKEmitter.emit('changeStyle', ['background', 'border', 'padding', 'margin', 'shadow'], group.style, this.getStyle)
  }
  getStyle = (comIds, style) => {
    const { group } = this.state
    if (comIds.length !== 1 || comIds[0] !== group.uuid) return
    let _card = {...group, style}
  getStyle = (style) => {
    let _card = {...this.state.group, style}
    this.setState({
      group: _card
@@ -145,7 +138,6 @@
  insert = (item) => {
    let group = fromJS(this.state.group).toJS()
    item.floor = group.floor || 1
    item.parentId = group.parentId
    group.components.push(item)
@@ -181,7 +173,7 @@
    }
    return (
      <div className={'menu-group-edit-box' + (paddingTop ? ' padding' : '')} style={_style} onClick={this.clickComponent} id={group.uuid}>
      <div className={'menu-group-edit-box ' + (paddingTop ? 'padding ' : '') + (group.setting.layout || '')} style={_style} onClick={this.clickComponent} id={group.uuid}>
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            <NormalForm title="分组设置" width={700} update={this.updateWrap} getForms={this.getWrapForms}>
@@ -195,7 +187,7 @@
        } trigger="hover">
          <ToolOutlined />
        </Popover>
        {group.setting && group.setting.print === 'true' ? <Button className="print-button" icon="printer" onClick={this.print}></Button> : null}
        {group.setting && group.setting.print === 'true' ? <Button className="print-button" onClick={this.print}><PrinterOutlined /></Button> : null}
        <GroupComponents config={group} handleList={this.updateComponent} deleteCard={this.deleteCard} />
      </div>
    )