From 89f85223ff7b1b5ee3931ae01efa3dd17d5524fc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 十一月 2022 16:03:27 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/components/card/data-card/index.jsx | 86 ++----------------------------------------- 1 files changed, 4 insertions(+), 82 deletions(-) diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 7e33108..3eb6454 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -140,10 +140,6 @@ } } - componentDidMount () { - MKEmitter.addListener('submitModal', this.handleSave) - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) } @@ -155,7 +151,6 @@ this.setState = () => { return } - MKEmitter.removeListener('submitModal', this.handleSave) } /** @@ -281,7 +276,6 @@ * @description 鍗曚釜鍗$墖淇℃伅鏇存柊 */ deleteCard = (cell) => { - const { appType } = this.state let card = fromJS(this.state.card).toJS() let _this = this @@ -291,25 +285,6 @@ card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) _this.updateComponent(card) - - if (appType === 'mob') return - - let uuids = [] - - cell.elements && cell.elements.forEach(c => { - if (c.eleType !== 'button' || (appType === 'pc' && c.OpenType !== 'popview')) return - - uuids.push(c.uuid) - }) - cell.backElements && cell.backElements.forEach(c => { - if (c.eleType !== 'button' || (appType === 'pc' && c.OpenType !== 'popview')) return - - uuids.push(c.uuid) - }) - - if (uuids.length === 0) return - - MKEmitter.emit('delButtons', uuids) }, onCancel() {} }) @@ -318,7 +293,7 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', ['background', 'height', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle) + MKEmitter.emit('changeStyle', ['background', 'height', 'border', 'padding', 'margin', 'shadow', 'clear'], card.style, this.getStyle) } getStyle = (style) => { @@ -401,26 +376,6 @@ } else if (btn.OpenType === 'popview' && appType !== 'mob') { MKEmitter.emit('changePopview', card, btn) } - } - - handleSave = (_cards, btn, modal) => { - let card = fromJS(this.state.card).toJS() - - if (card.uuid !== _cards.uuid) return - - let _index = card.action.findIndex(cell => cell.uuid === btn.uuid) - - if (_index === -1) return - - card.action = card.action.map(cell => { - if (cell.uuid === btn.uuid) { - cell.modal = modal - } - - return cell - }) - - this.updateComponent(card) } addCard = (copy) => { @@ -537,7 +492,6 @@ res.$cardType = 'extendCard' res.setting.width = res.setting.width || 6 - let copyBtns = [] let mobtypes = ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'] let elements = [] @@ -552,16 +506,7 @@ } else if (appType === 'mob' && !mobtypes.includes(cell.OpenType)) { return } else { - let _uuid = Utils.getuuid() - - if (cell.OpenType === 'popview') { - let _cell = fromJS(cell).toJS() - _cell.$originUuid = _cell.uuid - _cell.uuid = _uuid - copyBtns.push(_cell) - } - - cell.uuid = _uuid + cell.uuid = Utils.getuuid() elements.push(cell) } }) @@ -582,26 +527,13 @@ } else if (appType === 'mob' && !mobtypes.includes(cell.OpenType)) { return } else { - let _uuid = Utils.getuuid() - - if (cell.OpenType === 'popview') { - let _cell = fromJS(cell).toJS() - _cell.$originUuid = _cell.uuid - _cell.uuid = _uuid - copyBtns.push(_cell) - } - - cell.uuid = _uuid + cell.uuid = Utils.getuuid() backElements.push(cell) } }) } res.backElements = backElements - - if (copyBtns.length > 0) { - MKEmitter.emit('copyButtons', copyBtns) - } resolve({status: true}) @@ -638,19 +570,9 @@ if (appType === 'mob' && !['pop', 'prompt', 'exec', 'innerpage'].includes(res.OpenType)) { resolve({status: false, message: '绉诲姩绔笉鏀寔姝ょ被鍨嬬殑鎸夐挳銆�'}) } else { - let _uuid = Utils.getuuid() - - if (res.OpenType === 'popview') { - let _cell = fromJS(res).toJS() - _cell.$originUuid = _cell.uuid - _cell.uuid = _uuid - - MKEmitter.emit('copyButtons', [_cell]) - } - resolve({status: true}) - res.uuid = _uuid + res.uuid = Utils.getuuid() this.addButton(res) } } -- Gitblit v1.8.0