From c98e45bfac25e9110ad0383faac54a54d98ea9d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 十一月 2021 20:47:04 +0800 Subject: [PATCH] 2021-11-18 --- src/menu/components/chart/antv-scatter/index.jsx | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/menu/components/chart/antv-scatter/index.jsx b/src/menu/components/chart/antv-scatter/index.jsx index 41a896b..30b127c 100644 --- a/src/menu/components/chart/antv-scatter/index.jsx +++ b/src/menu/components/chart/antv-scatter/index.jsx @@ -33,7 +33,7 @@ state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, - ismob: sessionStorage.getItem('appType') === 'mob', + appType: sessionStorage.getItem('appType'), eventListener: null } @@ -187,16 +187,11 @@ const { card } = this.state const plot = card.plot const data = this.getdata() - let height = plot.height - 25 - - if (card.plot.title || card.search.length > 0) { - height = plot.height - 70 - } const chart = new Chart({ container: card.uuid + 'canvas', autoFit: true, - height: height + height: this.wrap.offsetHeight - 25 }) chart.data(data); @@ -251,7 +246,7 @@ updateComponent = (component) => { const card = fromJS(this.state.card).toJS() - if (!is(fromJS(component.plot), fromJS(card.plot)) || !is(fromJS(component.style), fromJS(card.style))) { + if (!is(fromJS(component.plot), fromJS(card.plot)) || !is(fromJS(component.style), fromJS(card.style)) || !is(fromJS(component.search), fromJS(card.search))) { let _element = document.getElementById(card.uuid + 'canvas') if (_element) { _element.innerHTML = '' @@ -285,7 +280,6 @@ newcard.options = [] newcard.setAll = 'false' newcard.orderType = 'asc' - newcard.display = 'dropdown' newcard.match = '=' // 娉ㄥ唽浜嬩欢-娣诲姞鎼滅储 @@ -313,7 +307,6 @@ newcard.execSuccess = 'grid' newcard.execError = 'never' newcard.popClose = 'never' - newcard.errorTime = 10 newcard.verify = null newcard.show = 'icon' @@ -324,7 +317,7 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) + MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style) } getStyle = (comIds, style) => { @@ -371,18 +364,18 @@ } render() { - const { card, ismob } = this.state + const { card, appType } = this.state let _style = resetStyle(card.style) return ( <div className="menu-scatter-chart-edit-box" style={{..._style, height: card.plot.height || 400}} onClick={this.clickComponent} id={card.uuid}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - {!ismob ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle"/> : null} - <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> + {appType !== 'mob' ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle"/> : null} + {appType !== 'mob' ? <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> : null} <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> <CopyComponent type="line" card={card}/> - <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent}/> + <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent}/> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors"/> <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog}/> <ClockComponent config={card} updateConfig={this.updateComponent}/> @@ -393,9 +386,9 @@ } trigger="hover"> <Icon type="tool" /> </Popover> - {card.plot.title || card.search.length > 0 ? <NormalHeader config={card} updateComponent={this.updateComponent}/> : null} - <div className="canvas" id={card.uuid + 'canvas'}></div> - <ActionComponent type="chart" config={card} updateaction={this.updateComponent}/> + <NormalHeader config={card} updateComponent={this.updateComponent}/> + <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div> + {appType !== 'mob' ? <ActionComponent type="chart" config={card} updateaction={this.updateComponent}/> : null} </div> ) } -- Gitblit v1.8.0