From 2f71678db0378c7c841e721dfebaea6d159e13b2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 15 一月 2022 00:46:12 +0800 Subject: [PATCH] 2022-01-15 --- src/menu/components/card/data-card/index.jsx | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 7692420..335e3f9 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -15,7 +15,6 @@ const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const CardComponent = asyncComponent(() => import('../cardcomponent')) -const Nodes = asyncComponent(() => import('./node-wrap')) const MobPagination = asyncIconComponent(() => import('@/menu/components/share/mobPagination')) const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) @@ -479,11 +478,25 @@ getWrapForms = () => { const { card } = this.state - return getWrapForm(card.wrap, card.subtype, card.columns) + return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, card.supNodes) } updateWrap = (res) => { - this.updateComponent({...this.state.card, wrap: res}) + let _card = {...this.state.card, wrap: res} + + if (res.supNodes) { + _card.supNodes = res.supNodes + _card.supNodes = _card.supNodes.map(item => { + item.componentId = item.nodes[item.nodes.length - 1] + return item + }) + + delete res.supNodes + } else { + delete _card.supNodes + } + + this.updateComponent(_card) } pasteComponent = (res, resolve) => { @@ -624,16 +637,6 @@ } } - updateSupNodes = (res) => { - const { card } = this.state - - this.setState({ - card: {...card, supNodes: res} - }) - - this.updateComponent({...card, supNodes: res}) - } - render() { const { card, appType } = this.state @@ -661,7 +664,6 @@ <NormalForm title="鏁版嵁鍗¤缃�" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> - {card.wrap.supType === 'multi' && appType !== 'mob' ? <Nodes card={card} updateMenus={this.updateSupNodes}/> : null} <CopyComponent type="datacard" card={card}/> <PasteComponent options={['action', 'search', 'form', 'cardcell']} updateConfig={this.pasteComponent} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> -- Gitblit v1.8.0