From 6e106eb13ce404d9955d6c9045d21050d3e08294 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 20 十一月 2020 11:19:36 +0800 Subject: [PATCH] 2020-11-20 --- src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 124 ++++++++++++++++++++++------------------ 1 files changed, 68 insertions(+), 56 deletions(-) diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index e53c3d6..9b14404 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -8,34 +8,8 @@ * @param {object} card // 鍥捐〃瀵硅薄 * @param {Array} columns // 鏄剧ず鍒� */ -export function getBarOrLineChartOptionForm (card, columns, sysRoles = [], MenuType) { - let shapes = [] +export function getBaseForm (card, sysRoles = [], MenuType) { let _sysRoles = sysRoles.map(item => ({...item, field: item.value, label: item.text})) - - if (card.chartType === 'line') { - shapes = [ - { field: 'smooth', label: 'smooth' }, - { field: 'line', label: 'line' }, - { field: 'dot', label: 'dot' }, - { field: 'dash', label: 'dash' }, - { field: 'hv', label: 'hv' }, - { field: 'vh', label: 'vh' }, - { field: 'hvh', label: 'hvh' }, - { field: 'vhv', label: 'vhv' } - ] - } else if (card.chartType === 'bar') { - shapes = [ - { field: 'rect', label: 'rect' }, - { field: 'hollow-rect', label: 'hollow-rect' }, - { field: 'line', label: 'line' }, - { field: 'tick', label: 'tick' }, - { field: 'funnel', label: 'funnel' }, - { field: 'pyramid', label: 'pyramid' } - ] - } - - let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) - let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) return [ { @@ -74,6 +48,53 @@ decimal: 0, required: true }, + { + type: 'select', + key: 'blacklist', + label: '榛戝悕鍗�', + initVal: card.blacklist || [], + multi: true, + required: false, + forbid: MenuType === 'billPrint', + options: _sysRoles + } + ] +} + +/** + * @description 鑾峰彇鍥捐〃瑙嗗浘閰嶇疆琛ㄥ崟 + * @param {object} card // 鍥捐〃瀵硅薄 + * @param {Array} columns // 鏄剧ず鍒� + */ +export function getOptionForm (card, columns, MenuType) { + let shapes = [] + + if (card.chartType === 'line') { + shapes = [ + { field: 'smooth', label: 'smooth' }, + { field: 'line', label: 'line' }, + { field: 'dot', label: 'dot' }, + { field: 'dash', label: 'dash' }, + { field: 'hv', label: 'hv' }, + { field: 'vh', label: 'vh' }, + { field: 'hvh', label: 'hvh' }, + { field: 'vhv', label: 'vhv' } + ] + } else if (card.chartType === 'bar') { + shapes = [ + { field: 'rect', label: 'rect' }, + { field: 'hollow-rect', label: 'hollow-rect' }, + { field: 'line', label: 'line' }, + { field: 'tick', label: 'tick' }, + { field: 'funnel', label: 'funnel' }, + { field: 'pyramid', label: 'pyramid' } + ] + } + + let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) + let yfields = columns.filter(item => /^(Int|Decimal)/ig.test(item.datatype)) + + return [ { type: 'radio', key: 'datatype', @@ -155,7 +176,7 @@ { type: 'radio', key: 'tooltip', - label: '鎻愮ず淇℃伅', + label: '鎮诞鎻愮ず', initVal: card.tooltip || 'true', required: false, options: [{ @@ -164,20 +185,6 @@ }, { value: 'false', text: '闅愯棌' - }] - }, - { - type: 'radio', - key: 'coordinate', - label: '鍧愭爣', - initVal: card.coordinate || 'angle', - required: false, - options: [{ - value: 'angle', - text: '浜岀淮鍧愭爣' - }, { - value: 'polar', - text: '鏋佸潗鏍�' }] }, { @@ -200,6 +207,7 @@ key: 'transpose', label: '鍙樻崲', initVal: card.transpose || 'false', + tooltip: '妯旱鍧愭爣杞翠氦鎹�', required: false, options: [{ value: 'true', @@ -212,21 +220,21 @@ { type: 'radio', key: 'show', - label: '鏄剧ず鍊�', + label: '鏍煎紡鍖�', initVal: card.show || 'value', required: false, options: [{ + value: 'value', + text: '鏃�' + }, { value: 'percent', text: '鐧惧垎姣�' - }, { - value: 'value', - text: '鏁板��' }] }, { type: 'radio', key: 'label', - label: '鏍囨敞-鍊�', + label: '鏍囨敞鍊�', initVal: card.label || 'false', required: false, options: [{ @@ -267,6 +275,19 @@ text: '绱姞' }] }, { + type: 'radio', + key: 'coordinate', + label: '鍧愭爣', + initVal: card.coordinate || 'angle', + required: false, + options: [{ + value: 'angle', + text: '浜岀淮鍧愭爣' + }, { + value: 'polar', + text: '鏋佸潗鏍�' + }] + }, { type: 'number', key: 'InfoDefNumber', label: '灞曠ず鏁�', @@ -302,15 +323,6 @@ value: 'white', text: '鐧借壊' }] - }, { - type: 'select', - key: 'blacklist', - label: '榛戝悕鍗�', - initVal: card.blacklist || [], - multi: true, - required: false, - forbid: MenuType === 'billPrint', - options: _sysRoles } ] } -- Gitblit v1.8.0