king
2021-10-21 1da6506bf58270bacc2a4345002c6b082835580e
src/mob/components/navbar/normal-navbar/index.jsx
@@ -8,9 +8,10 @@
import MKEmitter from '@/utils/events.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import getWrapForm from './options'
import './index.scss'
const WrapComponent = asyncIconComponent(() => import('./wrapsetting'))
const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
const MenuComponent = asyncIconComponent(() => import('./menusetting'))
const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
@@ -39,12 +40,11 @@
        pageable: false,    // 组件属性 - 是否可分页
        switchable: false,  // 组件属性 - 数据是否可切换
        dataName: card.dataName || '',
        width: card.width || 24,
        name: card.name,
        subtype: card.subtype,
        setting: { interType: 'system' },
        wrap: { name: card.name, datatype: 'static', height: 50 },
        style: {borderTopColor: '#bcbcbc', borderTopWidth: '1px', paddingTop: '5px', fontSize: '13px' },
        style: {boxShadow: '0 0 3px #D9D9D9', shadowColor: '#D9D9D9', shadowBlur: '3px', paddingTop: '5px', fontSize: '13px' },
        menus: [],
        columns: [],
        scripts: [],
@@ -95,7 +95,6 @@
      card: component
    })
    component.width = component.wrap.width
    component.name = component.wrap.name
    this.props.updateConfig(component)
@@ -141,6 +140,16 @@
    }
  }
  getWrapForms = () => {
    const { wrap } = this.state.card
    return getWrapForm(wrap)
  }
  updateWrap = (res) => {
    this.updateComponent({...this.state.card, wrap: res})
  }
  render() {
    const { card } = this.state
@@ -152,7 +161,9 @@
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            <MenuComponent config={card} updateConfig={this.updateComponent} />
            <WrapComponent config={card} updateConfig={this.updateComponent} />
            <NormalForm title="菜单栏设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
              <Icon type="edit" style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
            <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}