From 704f82b06befe96e5f739b2dce419f76f5683a6f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 15 八月 2022 09:27:54 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/components/card/prop-card/index.jsx | 49 ++++++++++++++++++++++++++++++++++++------------- 1 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx index 9e382eb..3dc9f8d 100644 --- a/src/menu/components/card/prop-card/index.jsx +++ b/src/menu/components/card/prop-card/index.jsx @@ -238,22 +238,24 @@ } }) } else { - if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { - card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) - } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { - card.errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'}) - } else if (!card.setting.primaryKey) { - card.errors.push({ level: 0, detail: '鏈缃富閿紒'}) - } else if (!card.setting.supModule) { - card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) - } - let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : '' if (supModule === 'empty') { supModule = '' } let columns = card.columns.map(c => c.field) let lowcols = card.columns.map(c => c.field.toLowerCase()) + + if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { + card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) + } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { + card.errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'}) + } else if (!card.setting.primaryKey) { + card.errors.push({ level: 0, detail: '鏈缃富閿紒'}) + } else if (!columns.includes(card.setting.primaryKey)) { + card.errors.push({ level: 0, detail: '涓婚敭宸插け鏁堬紒'}) + } else if (!card.setting.supModule) { + card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) + } card.subcards.forEach((item, i) => { let linkbtn = item.setting.linkbtn || '' @@ -574,7 +576,9 @@ } updateWrap = (res) => { - let _card = {...this.state.card, wrap: res} + const { card } = this.state + + let _card = {...card, wrap: res} if (res.datatype === 'static') { if (res.supModule && res.supModule.length > 0) { @@ -587,7 +591,26 @@ _card.wrap.pagestyle = 'page' } - this.updateComponent(_card) + if (res.selStyle === 'tabs' && card.wrap.selStyle !== 'tabs') { + Object.keys(_card.style).forEach(key => { + if (/^border/.test(key)) { + delete _card.style[key] + } + }) + _card.style.borderBottomColor = '#eeeeee' + _card.style.borderBottomWidth = '1px' + _card.style.paddingBottom = '0px' + + _card.subcards.forEach(item => { + delete item.style.marginBottom + }) + + this.setState({card: {..._card, subcards: []}}, () => { + this.updateComponent(_card) + }) + } else { + this.updateComponent(_card) + } } clickComponent = (e) => { @@ -624,7 +647,7 @@ } trigger="hover"> <ToolOutlined /> </Popover> - <div className={(card.wrap.layout || 'grid') + '-layout float-' + (card.wrap.cardFloat || 'left')}> + <div className={(card.wrap.layout || 'grid') + '-layout float-' + (card.wrap.cardFloat || 'left') + ' select-' + card.wrap.selStyle}> {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} </div> <div className="component-name"> -- Gitblit v1.8.0