From 0011ec870d3d1fe9d77a4941358c84acf8632e5e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 五月 2022 22:51:51 +0800 Subject: [PATCH] 2022-05-18 --- src/menu/components/chart/antv-bar/chartcompile/index.jsx | 22 ++++++++++ src/tabviews/custom/components/table/edit-table/normalTable/index.scss | 2 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 34 +++++++++------- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 27 +++++++++++++ src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx | 2 src/utils/option.js | 2 src/tabviews/custom/components/share/normalTable/index.scss | 4 + 7 files changed, 73 insertions(+), 20 deletions(-) diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 784141f..0b0c513 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -258,6 +258,8 @@ }]) } + let _label = card.label || 'false' + return [ { type: 'radio', @@ -389,7 +391,7 @@ type: labelOptions.length > 20 ? 'select' : 'radio', key: 'label', label: '鏍囨敞', - initVal: card.label || 'false', + initVal: _label, tooltip: '鍥惧舰鑺傜偣澶勭殑鏁板�笺��', required: false, options: labelOptions @@ -400,6 +402,7 @@ initVal: card.labelColor || 'system', tooltip: '浣跨敤绯荤粺鑹叉椂锛屼娇鐢ㄨ壊绯婚�夐」璁剧疆鐨勭郴缁熼鑹诧紝浣跨敤鑷畾涔変负棰滆壊璁剧疆涓畾涔夌殑鍥惧舰棰滆壊銆�', required: false, + hidden: _label !== 'true', options: [{ value: 'system', text: '绯荤粺' @@ -407,20 +410,21 @@ value: 'custom', text: '鑷畾涔�' }] - // }, { - // type: 'radio', - // key: 'offset', - // label: '鏍囨敞浣嶇疆', - // initVal: card.offset || 'outer', - // required: false, - // options: [{ - // value: 'outer', - // text: '澶栭儴' - // }, { - // value: 'inner', - // text: '鍐呴儴' - // }], - // forbid: card.chartType !== 'bar' + }, { + type: 'radio', + key: 'labelValue', + label: '鏍囨敞鍊�', + initVal: card.labelValue || 'default', + tooltip: '鏍囨敞鍊肩殑鏄剧ず瑙勫垯銆�', + required: false, + hidden: _label === 'false', + options: [{ + value: 'default', + text: '榛樿' + }, { + value: 'zero', + text: '闅愯棌 0 鍊�' + }], }, { type: 'radio', key: 'adjust', diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx index accb869..b2d1d56 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx @@ -286,7 +286,7 @@ if (key === 'datatype') { this.setState({ datatype: val, - formlist: formlist.map(item => { + formlist: fromJS(formlist).toJS().map(item => { if (['Yaxis'].includes(item.key)) { item.hidden = val === 'statistics' } else if (['InfoType', 'InfoValue'].includes(item.key)) { @@ -295,6 +295,26 @@ return item }) }) + } else if (key === 'label') { + this.setState({formlist: fromJS(formlist).toJS().map(cell => { + if (!['labelColor', 'labelValue'].includes(cell.key)) return cell + + if (cell.key === 'labelColor') { + if (val !== 'true') { + cell.hidden = true + } else { + cell.hidden = false + } + } else { + if (val === 'false') { + cell.hidden = true + } else { + cell.hidden = false + } + } + + return cell + })}) } } diff --git a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx index 494a36f..fbdeeee 100644 --- a/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx @@ -261,7 +261,7 @@ { type: 'radio', key: 'label', - label: '鏍囩', + label: '鏍囨敞', initVal: card.label || 'false', required: false, options: [{ 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 be150a4..6c687f2 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -1018,6 +1018,9 @@ } if (plot.label !== 'false') { _chart.label(_valfield, (value) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } if (plot.show === 'percent') { value = value + '%' } @@ -1253,6 +1256,10 @@ } if (plot.label !== 'false') { _chart.label('value*key', (value, key) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } + if (plot.show === 'percent') { value = value + '%' } @@ -1304,6 +1311,10 @@ } if (plot.label !== 'false') { _chart.label('value*key', (value, key) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } + if (plot.show === 'percent') { value = value + '%' } @@ -1371,6 +1382,10 @@ } if (item.label !== 'false') { _chart.label(item.name, (value) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } + if (item.show === 'percent') { value = value + '%' } @@ -1419,6 +1434,10 @@ if (item.label === 'true') { _chart.label(item.name, (value) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } + if (item.show === 'percent') { value = value + '%' } @@ -1624,6 +1643,10 @@ } if (plot.label !== 'false') { _chart.label(`${_valfield}*${_typefield}`, (value, key) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } + if (plot.show === 'percent') { value = value + '%' } @@ -1682,6 +1705,10 @@ } if (plot.label !== 'false') { _chart.label(`${_valfield}*${_typefield}`, (value, key) => { + if (plot.labelValue === 'zero' && value === 0) { + return null + } + if (plot.show === 'percent') { value = value + '%' } diff --git a/src/tabviews/custom/components/share/normalTable/index.scss b/src/tabviews/custom/components/share/normalTable/index.scss index e234a07..a6ffaf4 100644 --- a/src/tabviews/custom/components/share/normalTable/index.scss +++ b/src/tabviews/custom/components/share/normalTable/index.scss @@ -26,6 +26,8 @@ .mk-disabled { color: #bcbcbc; cursor: not-allowed; + --mk-table-color: #bcbcbc; + .ant-btn { cursor: not-allowed; } @@ -207,7 +209,7 @@ font-size: var(--mk-table-font-size)!important; font-weight: var(--mk-table-font-weight)!important; - >span, div:not(.card-cell-list), div:not(.card-cell-list) div, div:not(.card-cell-list) span { + >span, >div:not(.card-cell-list) div, >div:not(.card-cell-list) span { font-weight: var(--mk-table-font-weight)!important; } } diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss index 0fa9c9f..5232fee 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss @@ -310,7 +310,7 @@ font-size: var(--mk-table-font-size)!important; font-weight: var(--mk-table-font-weight)!important; - >span, div:not(.card-cell-list), div:not(.card-cell-list) div, div:not(.card-cell-list) span { + >span, >div:not(.card-cell-list) div, >div:not(.card-cell-list) span { font-weight: var(--mk-table-font-weight)!important; } } diff --git a/src/utils/option.js b/src/utils/option.js index 2c6f1d5..bfdd2e3 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -102,7 +102,7 @@ ] // 鍥捐〃鑹茬郴 -export const chartColors = ['rgb(91, 143, 249)', 'rgb(90, 216, 166)', 'rgb(93, 112, 146)', 'rgb(246, 189, 22)', 'rgb(232, 100, 82)', 'rgb(109, 200, 236)', 'rgb(148, 95, 185)', 'rgb(246, 189, 22)', 'rgb(205, 221, 253)', 'rgb(248, 208, 203)'] +export const chartColors = ['rgb(91, 143, 249)', 'rgb(90, 216, 166)', 'rgb(93, 112, 146)', 'rgb(246, 189, 22)', 'rgb(232, 100, 82)', 'rgb(109, 200, 236)', 'rgb(148, 95, 185)', 'rgb(205, 221, 253)', 'rgb(248, 208, 203)', 'rgb(145, 213, 255)', 'rgb(211, 173, 247)'] // 鏃ユ湡榛樿鍊奸�夋嫨鑼冨洿 export const dateOptions = { -- Gitblit v1.8.0