From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 27 八月 2023 18:37:36 +0800 Subject: [PATCH] 2023-08-27 --- src/menu/components/chart/antv-X6/chartcompile/index.jsx | 143 ++++++++++++++++++++++------------------------- 1 files changed, 66 insertions(+), 77 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..6942006 100644 --- a/src/menu/components/chart/antv-X6/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-X6/chartcompile/index.jsx @@ -34,95 +34,84 @@ 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) => { @@ -155,7 +144,7 @@ <Modal wrapClassName="mk-pop-modal" visible={visible} - width={850} + width={900} maskClosable={false} onOk={this.onSubmit} onCancel={() => { this.setState({ visible: false }) }} -- Gitblit v1.8.0