king
2021-11-01 0d58c560feeddd8409a34ef0bd1e16f0be3f9758
src/mob/components/menubar/normal-menubar/index.jsx
@@ -19,6 +19,7 @@
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
const { confirm } = Modal
@@ -45,10 +46,14 @@
        floor: card.floor,
        tabId: '',
        parentId: '',
        format: 'object',   // 组件属性 - 数据格式
        pageable: false,    // 组件属性 - 是否可分页
        switchable: false,  // 组件属性 - 数据是否可切换
        dataName: card.dataName || '',
        width: card.width || 24,
        name: card.name,
        subtype: card.subtype,
        setting: { interType: 'system' },
        wrap: { name: card.name, width: card.width || 24, title: '' },
        style: { marginLeft: '0px', marginRight: '0px', marginTop: '8px', marginBottom: '8px' },
        headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
@@ -227,7 +232,16 @@
  }
  updateWrap = (res) => {
    this.updateComponent({...this.state.card, wrap: res})
    let card = {...this.state.card, wrap: res}
    if (res.datatype === 'dynamic' && !card.format) {
      card.format = 'object'
      card.pageable = false
      card.switchable = false
      card.setting = { interType: 'system' }
      card.columns = []
      card.scripts = []
    }
    this.updateComponent(card)
  }
  clickComponent = (e) => {
@@ -268,6 +282,8 @@
            <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
            <UserComponent config={card}/>
            <Icon className="close" title="删除组件" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
            {card.wrap.datatype === 'dynamic' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
            {card.wrap.datatype !== 'dynamic' ? <Icon style={{color: '#eeeeee', cursor: 'not-allowed'}} type="setting"/> : null}
          </div>
        } trigger="hover">
          <Icon type="tool" />