From a975aa770d1f5d0ae133f0e87a28b5d6b94734ef Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 五月 2024 11:16:42 +0800 Subject: [PATCH] 2024-05-09 --- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 81 +++++++++++++++++++++++++--------------- 1 files changed, 50 insertions(+), 31 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index f86a91e..db28367 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -3,7 +3,7 @@ import { is, fromJS } from 'immutable' import { Chart } from '@antv/g2' import DataSet from '@antv/data-set' -import { Spin, Empty, notification, Modal } from 'antd' +import { Spin, Empty } from 'antd' import { DownloadOutlined } from '@ant-design/icons' import moment from 'moment' @@ -256,15 +256,35 @@ style: { fill: _config.plot.color } }} let yc = {label: { style: { fill: _config.plot.color } }} + if (_config.plot.grid === 'hidden') { yc.grid = null } - if (_config.plot.y_line === 'show') { + if (_config.plot.tick === 'hidden') { + xc.tickLine = null + } + if (_config.plot.x_line === 'hidden') { + xc.line = null + } + if (_config.plot.y_line === 'hidden') { + yc.line = null + } else { yc.line = {style: { stroke: '#D1D2CE' }} } + if (_config.plot.x_label === 'hidden') { + xc.label = null + } + if (_config.plot.y_label === 'hidden') { + yc.label = null + } + if (_config.plot.lineColor) { - xc.tickLine = {style: { stroke: _config.plot.lineColor }} - xc.line = { style: { stroke: _config.plot.lineColor } } + if (xc.tickLine !== null) { + xc.tickLine = {style: { stroke: _config.plot.lineColor }} + } + if (xc.line !== null) { + xc.line = { style: { stroke: _config.plot.lineColor } } + } if (yc.grid !== null) { yc.grid = { line: { style: { stroke: _config.plot.lineColor } }} } @@ -528,8 +548,8 @@ if (config.uuid !== menuId) return - if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { // 鍒锋柊婧愮粍浠舵椂锛岄檮甯﹀埛鏂颁笂绾ц涓庡綋鍓嶇粍浠� - MKEmitter.emit('reloadData', config.setting.supModule, BID) + if (['mainline', 'maingrid', 'popclose'].includes(position) && config.setting.supModule) { + MKEmitter.emit('reloadData', config.setting.supModule, position === 'maingrid' ? '' : BID) } else { this.loadData() } @@ -642,37 +662,15 @@ this.timer && this.timer.stop() } } - if (result.message) { - if (result.ErrCode === 'Y') { - Modal.success({ - title: result.message - }) - } else if (result.ErrCode === 'S') { - notification.success({ - top: 92, - message: result.message, - duration: 2 - }) - } - } + + UtilsDM.querySuccess(result) } else { this.setState({ loading: false }) this.timer && this.timer.stop() - if (!result.message) return - if (result.ErrCode === 'N') { - Modal.error({ - title: result.message, - }) - } else if (result.ErrCode !== '-2') { - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) - } + UtilsDM.queryFail(result) } } @@ -928,6 +926,9 @@ } else if (plot.show === 'thdSeparator') { val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') + } + if (plot.labelUnit) { + val = val + plot.labelUnit } return { content: val, @@ -1221,6 +1222,9 @@ val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') } + if (plot.labelUnit) { + val = val + plot.labelUnit + } if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { lablecfg.style.fill = plot.$colors.get(key) @@ -1283,6 +1287,9 @@ } else if (plot.show === 'thdSeparator') { val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') + } + if (plot.labelUnit) { + val = val + plot.labelUnit } if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { lablecfg.style.fill = plot.$colors.get(key) @@ -1380,6 +1387,9 @@ val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') } + if (plot.labelUnit) { + val = val + plot.labelUnit + } if (plot.label === 'true' && plot.labelColor === 'custom' && item.color) { lablecfg.style.fill = item.color } @@ -1446,6 +1456,9 @@ } else if (item.show === 'thdSeparator') { val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') + } + if (plot.labelUnit) { + val = val + plot.labelUnit } return { @@ -1694,6 +1707,9 @@ val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') } + if (plot.labelUnit) { + val = val + plot.labelUnit + } if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { lablecfg.style.fill = plot.$colors.get(key) @@ -1780,6 +1796,9 @@ val = val + '' val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') } + if (plot.labelUnit) { + val = val + plot.labelUnit + } if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { lablecfg.style.fill = plot.$colors.get(key) -- Gitblit v1.8.0