From 48db4d4b22331f32bf6c6a0956a7cd4245ad6fde Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 29 六月 2023 09:30:34 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/chart/antv-X6/chartcompile/index.jsx | 141 +++++++++++++++++++++------------------------- 1 files changed, 65 insertions(+), 76 deletions(-) diff --git a/src/menu/components/chart/antv-X6/chartcompile/index.jsx b/src/menu/components/chart/antv-X6/chartcompile/index.jsx index 4396a49..8d72d4c 100644 --- a/src/menu/components/chart/antv-X6/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-X6/chartcompile/index.jsx @@ -34,97 +34,86 @@ view: 'normal', plot: fromJS(config.plot).toJS(), baseFormlist: getBaseForm(config.plot, config.columns), - formlist: getOptionForm(config.plot, config.columns) + formlist: getOptionForm(config.plot, config.uuid) }) } onSubmit = () => { - const { config } = this.props const { plot, view } = this.state if (view === 'normal') { this.norRef.handleConfirm().then(res => { - let _plot = {...plot, ...res} - - if (_plot.click !== 'menus') { - delete _plot.menus - } - if (_plot.click !== 'menu') { - delete _plot.menu - delete _plot.MenuID - delete _plot.MenuName - delete _plot.MenuNo - delete _plot.tabType - } else if (sessionStorage.getItem('appType') === '' && _plot.menu) { - let list = null - try { - list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] - } catch (e) { - list = [] - } - - let id = _plot.menu[_plot.menu.length - 1] - - list.forEach(item => { - if (item.MenuID === id) { - _plot.MenuID = id - _plot.MenuName = item.MenuName - _plot.MenuNo = item.MenuNo - _plot.tabType = item.type - } - }) - } - - this.setState({ - plot: _plot, - visible: false - }) - - this.props.plotchange({...config, plot: _plot}) + this.resetPlot({...plot, ...res}) }) } else if (view === 'base') { this.baseRef.handleConfirm().then(res => { - let _plot = {...plot, ...res} - - if (_plot.click !== 'menus') { - delete _plot.menus - } - if (_plot.click !== 'menu') { - delete _plot.menu - delete _plot.MenuID - delete _plot.MenuName - delete _plot.MenuNo - delete _plot.tabType - } else if (sessionStorage.getItem('appType') === '' && _plot.menu) { - let list = null - try { - list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] - } catch (e) { - list = [] - } - - let id = _plot.menu[_plot.menu.length - 1] - - list.forEach(item => { - if (item.MenuID === id) { - _plot.MenuID = id - _plot.MenuName = item.MenuName - _plot.MenuNo = item.MenuNo - _plot.tabType = item.type - } - }) - } - - this.setState({ - plot: _plot, - visible: false - }) - - this.props.plotchange({...config, plot: _plot}) + this.resetPlot({...plot, ...res}) }) } } + resetPlot = (plot) => { + const { config } = this.props + + if (plot.click !== 'menus') { + delete plot.menus + } + if (plot.click !== 'menu') { + delete plot.menu + delete plot.MenuID + delete plot.MenuName + delete plot.MenuNo + delete plot.tabType + } else if (sessionStorage.getItem('appType') === '' && plot.menu) { + let list = null + try { + list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] + } catch (e) { + list = [] + } + + let id = plot.menu[plot.menu.length - 1] + + list.forEach(item => { + if (item.MenuID === id) { + plot.MenuID = id + plot.MenuName = item.MenuName + plot.MenuNo = item.MenuNo + plot.tabType = item.type + } + }) + } + + if (plot.gridType === 'none') { + plot.grid = {visible: false} + } else if (plot.gridType === 'dot') { + plot.grid = { + visible: true, + type: 'dot', + args: { + color: '#a0a0a0', + thickness: 1 + } + } + } else if (plot.gridType === 'mesh') { + plot.grid = { + visible: true, + type: 'mesh', + args: { + color: '#ddd', + thickness: 1 + } + } + } + + this.setState({ + plot: plot, + visible: false + }) + + this.props.plotchange({...config, plot: plot}) + } + changeTab = (tab) => { const { plot, view } = this.state -- Gitblit v1.8.0