From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 十月 2021 23:17:08 +0800 Subject: [PATCH] 2021-10-21 --- src/mob/components/navbar/normal-navbar/index.jsx | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/mob/components/navbar/normal-navbar/index.jsx b/src/mob/components/navbar/normal-navbar/index.jsx index 0d38e64..21cf498 100644 --- a/src/mob/components/navbar/normal-navbar/index.jsx +++ b/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} -- Gitblit v1.8.0