From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 十一月 2021 20:47:04 +0800 Subject: [PATCH] 2021-11-18 --- src/mob/components/menubar/normal-menubar/menucomponent/index.jsx | 53 ++++++++++++++++------------------------------------- 1 files changed, 16 insertions(+), 37 deletions(-) diff --git a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx index a4e5882..4999373 100644 --- a/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx +++ b/src/mob/components/menubar/normal-menubar/menucomponent/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Modal, Popover, Icon, Col } from 'antd' +import { Popover, Icon, Col } from 'antd' import asyncIconComponent from '@/utils/asyncIconComponent' import Utils from '@/utils/utils.js' @@ -10,7 +10,6 @@ import MKEmitter from '@/utils/events.js' import './index.scss' -const { confirm } = Modal const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) const NormalForm = asyncIconComponent(() => import('@/components/normalform')) @@ -80,47 +79,24 @@ MKEmitter.emit('changeStyle', [cards.uuid, card.uuid], options, _style) } - cancel = () => { - const { card } = this.state - - if (card.isnew) { - let _card = fromJS(card).toJS() - delete _card.isnew - - this.setState({ card: _card }) - this.props.updateElement(_card) - } - } - getSettingForms = () => { + const { cards } = this.props const { card } = this.state - return getSettingForm(card.setting) + return getSettingForm(card.setting, cards.columns || []) } - updateSetting = (res, resolve) => { + updateSetting = (res) => { const { card } = this.state let _card = {...card, setting: res} - if (!card.isnew && card.setting.type === 'menu' && _card.setting.type !== 'menu') { - const _this = this - confirm({ - content: '鑿滃崟灏嗚閲嶇疆锛岀‘瀹氫慨鏀瑰悧锛�', - onOk() { - _card.oriuuid = _card.uuid - _card.uuid = Utils.getuuid() - _this.setState({ card: _card }) - _this.props.updateElement(_card) - resolve() - }, - onCancel() {} - }) - } else { - delete _card.isnew - this.setState({ card: _card }) - this.props.updateElement(_card) - resolve() + if (card.setting.type === 'menu' && _card.setting.type !== 'menu') { + _card.oriuuid = _card.uuid + _card.uuid = Utils.getuuid() } + + this.setState({ card: _card }) + this.props.updateElement(_card) } changeMenu = () => { @@ -150,7 +126,7 @@ <Col span={card.setting.width || 6} offset={offset || 0}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <NormalForm title="鑿滃崟缂栬緫" width={900} check update={this.updateSetting} getForms={this.getSettingForms} cancel={this.cancel}> + <NormalForm title="鑿滃崟缂栬緫" width={900} update={this.updateSetting} getForms={this.getSettingForms}> <Icon type="edit" style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="menucell" card={card}/> @@ -172,10 +148,13 @@ fontSize: card.setting.iconFont || 20, padding: card.setting.padding, background: card.setting.background, - color: card.setting.color + color: card.setting.color, + borderRadius: card.setting.borderRadius || '15%' }} type={card.setting.icon}/> + {card.setting.tip ? <sup className="am-badge-text"></sup> : null} </div> : <div className="menu-sign"> - <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth}} src={card.setting.url} alt=""/> + <img style={{width: card.setting.imgWidth, height: card.setting.imgWidth, borderRadius: card.setting.borderRadius || '15%'}} src={card.setting.url} alt=""/> + {card.setting.tip ? <sup className="am-badge-text"></sup> : null} </div>} <div className="menu-name">{card.setting.name}</div> </div> -- Gitblit v1.8.0