From a757b75163d77acc5111637fbe20ec61d895a72b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 11 八月 2021 23:15:29 +0800 Subject: [PATCH] 2021-08-11 --- src/mob/components/tabs/antv-tabs/index.jsx | 34 ++++++++++++++++++++++++++-------- 1 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/mob/components/tabs/antv-tabs/index.jsx b/src/mob/components/tabs/antv-tabs/index.jsx index 5ecb338..ee9041d 100644 --- a/src/mob/components/tabs/antv-tabs/index.jsx +++ b/src/mob/components/tabs/antv-tabs/index.jsx @@ -138,18 +138,34 @@ MKEmitter.emit('changeStyle', [tabs.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], tabs.style) } + changeTabStyle = () => { + const { tabs } = this.state + + MKEmitter.emit('changeStyle', [tabs.uuid, 'tab'], ['font', 'padding'], tabs.tabStyle || {}) + } + getStyle = (comIds, style) => { const { tabs } = this.state - if (comIds.length !== 1 || comIds[0] !== tabs.uuid) return + if (comIds[0] !== tabs.uuid) return - let _card = {...tabs, style} + if (comIds.length === 1) { + let _card = {...tabs, style} - this.setState({ - tabs: _card - }) - - this.props.updateConfig(_card) + this.setState({ + tabs: _card + }) + + this.props.updateConfig(_card) + } else if (comIds[1] === 'tab') { + let _card = {...tabs, tabStyle: style} + + this.setState({ + tabs: _card + }) + + this.props.updateConfig(_card) + } } handleTabsChange = (parentId) => { @@ -353,6 +369,7 @@ render() { const { tabs, dict, labelvisible, editab, appType } = this.state let _style = resetStyle(tabs.style) + let _tabStyle = resetStyle(tabs.tabStyle) return ( <div className={'mob-tabs-edit-box ' + tabs.setting.display} style={_style} onClick={this.clickComponent} id={tabs.uuid}> @@ -363,10 +380,11 @@ <div className="mk-popover-control"> <Icon className="edit" title="edit" type="edit" onClick={() => this.editTab(tab)} /> <PasteController type="tab" Tab={tab} insert={this.insert} /> + <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeTabStyle} type="font-colors" /> <Icon className="close" title="delete" type="close" onClick={() => this.delTab(tab)} /> </div> } trigger="hover"> - <span>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span> + <span style={_tabStyle}>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span> </Popover> } key={tab.uuid}> {appType === 'mob' && tabs.setting.position === 'top' && tabs.setting.display === 'inline-block' && tab.hasSearch === 'icon' ? -- Gitblit v1.8.0