From 96266d3d0e1c5c53e2f5b17e2fbf2c814c2a8d8f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 04 四月 2022 11:21:34 +0800 Subject: [PATCH] 2022-04-04 --- src/mob/components/menubar/normal-menubar/index.jsx | 47 +++++++++++++++++++++++++++++++++++------------ 1 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/mob/components/menubar/normal-menubar/index.jsx b/src/mob/components/menubar/normal-menubar/index.jsx index 2e02fab..0ff743d 100644 --- a/src/mob/components/menubar/normal-menubar/index.jsx +++ b/src/mob/components/menubar/normal-menubar/index.jsx @@ -144,20 +144,27 @@ /** * @description 鍗曚釜鍗$墖淇℃伅鏇存柊 */ - deleteCard = (cell) => { + deleteCard = (cell, type) => { let card = fromJS(this.state.card).toJS() let _this = this - confirm({ - content: '纭畾鍒犻櫎鍗$墖鍚楋紵', - onOk() { - card.subMenus = card.subMenus.filter(item => item.uuid !== cell.uuid) - - _this.setState({card}) - _this.props.updateConfig(card) - }, - onCancel() {} - }) + if (type !== 'direct') { + confirm({ + content: '纭畾鍒犻櫎鍗$墖鍚楋紵', + onOk() { + card.subMenus = card.subMenus.filter(item => item.uuid !== cell.uuid) + + _this.setState({card}) + _this.props.updateConfig(card) + }, + onCancel() {} + }) + } else { + card.subMenus = card.subMenus.filter(item => item.uuid !== cell.uuid) + + this.setState({card}) + this.props.updateConfig(card) + } } changeStyle = () => { @@ -185,7 +192,7 @@ let newcard = { uuid: Utils.getuuid(), - setting: { type: 'menu', width: 6, sign: 'icon', icon: 'user', name: '瀹㈡埛', url: '', color: '#ffffff', iconFont: 20, padding: 12, background: '#1890ff', imgWidth: '' }, + setting: { type: 'menu', width: 6, sign: 'icon', icon: '', name: '', url: '', color: '#ffffff', iconFont: 20, padding: 12, background: '#1890ff', imgWidth: '' }, style: { paddingTop: '15px', paddingBottom: '15px' } @@ -194,12 +201,28 @@ if (card.subMenus.length > 0) { newcard = fromJS(card.subMenus.slice(-1)[0]).toJS() newcard.uuid = Utils.getuuid() + + newcard.setting.clearMenu = 'true' + newcard.setting.icon = '' + newcard.setting.name = '' + newcard.setting.MenuNo = '' + newcard.setting.type = 'menu' + newcard.setting.copyMenuId = '' + newcard.setting.linkMenuId = '' + newcard.setting.linkurl = '' + newcard.setting.tip = '' + newcard.setting.url = '' } card.subMenus.push(newcard) this.setState({card}) this.props.updateConfig(card) + + setTimeout(() => { + let node = document.getElementById(newcard.uuid) + node && node.click() + }, 200) } move = (item, direction) => { -- Gitblit v1.8.0