From 753ac5f57b10588e225c1d82203b13a81bc9c9a7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 十二月 2020 18:36:26 +0800 Subject: [PATCH] 2020-12-03 --- src/tabviews/custom/components/chart/antv-pie/index.jsx | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index dd7fa3f..0e4995f 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -25,6 +25,7 @@ } state = { + BID: '', // 涓婄骇ID config: null, // 鍥捐〃閰嶇疆淇℃伅 empty: true, // 鍥捐〃鏁版嵁涓虹┖ loading: false, // 鏁版嵁鍔犺浇鐘舵�� @@ -38,7 +39,7 @@ } UNSAFE_componentWillMount () { - const { config, data, initdata } = this.props + const { config, data, initdata, BID } = this.props let _config = fromJS(config).toJS() let _data = null @@ -66,9 +67,16 @@ _config.style = {minHeight: (config.plot.height || 400)} } + let _BID = BID || '' + if (config.setting.supModule && config.setting.supModule[0] !== 'empty') { + _BID = '' + } + sessionStorage.setItem(config.uuid, 'bid') + this.setState({ config: _config, data: _data, + BID: _BID, arr_field: _config.columns.map(col => col.field).join(','), plot: _config.plot, sync: _sync, @@ -85,10 +93,11 @@ } /** - * @description 鏍¢獙鍥捐〃鐨勬寜閽粍锛屽鏋滀负缁熻鍥捐〃锛岃绠楀浘琛ㄥ瓧娈� + * @description 缁勪欢閿�姣� */ - componentDidMount () { - + componentWillUnmount () { + const { config } = this.state + sessionStorage.removeItem(config.uuid) } /** @@ -128,8 +137,8 @@ } async loadData () { - const { mainSearch, BID, menuType, dataManager } = this.props - const { config, arr_field, search } = this.state + const { mainSearch, menuType, dataManager } = this.props + const { config, arr_field, search, BID } = this.state let searches = fromJS(search).toJS() if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢 @@ -476,7 +485,7 @@ } if (plot.linkmenu && plot.linkmenu.length > 0) { - let menu_id = plot.linkmenu[plot.linkmenu.length - 1] + let menu_id = plot.linkmenu.slice(-1)[0] let menu = this.props.permMenus.filter(m => m.MenuID === menu_id)[0] || '' chart.on('element:dblclick', (ev) => { -- Gitblit v1.8.0