From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 16 五月 2024 10:56:41 +0800 Subject: [PATCH] 2024-05-16 --- src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 384 +++++++++++++++++++++++++----------------------------- 1 files changed, 181 insertions(+), 203 deletions(-) diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 8e8f520..a808760 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -128,7 +128,6 @@ controlFields: [ {field: 'menu', values: ['menu']}, {field: 'open', values: ['menu', 'menus']}, - {field: 'joint', values: ['menu', 'menus']}, {field: 'menuType', values: ['menus']}, {field: 'menus', values: ['menus']}, ] @@ -168,26 +167,13 @@ hidden: card.click !== 'menu' && card.click !== 'menus' }, { - type: 'radio', - field: 'joint', - label: '鍙傛暟鎷兼帴', - initval: card.joint || 'true', - required: false, - options: [ - {value: 'true', label: '鏄�'}, - {value: 'false', label: '鍚�'}, - ], - forbid: appType === 'mob' || card.chartType !== 'bar', - hidden: card.click !== 'menu' && card.click !== 'menus' - }, - { type: 'table', field: 'menus', label: '鑿滃崟缁�', initval: card.menus || [], required: true, span: 24, - actions: ['view'], + actions: ['edit', 'del', 'add', 'move', 'view'], forbid: appType === 'mob' || card.chartType !== 'bar', hidden: card.click !== 'menus', columns: [ @@ -224,27 +210,41 @@ export function getOptionForm (card, columns) { let appType = sessionStorage.getItem('appType') let shapes = [] + let shape = card.shape 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锛堝瀭鐩�-姘村钩-鍨傜洿绾匡級' } + { field: 'smooth', label: '骞虫粦绾�' }, + { field: 'line', label: '鐩寸嚎' }, + { field: 'dot', label: '鐐圭姸绾�' }, + { field: 'dash', label: '铏氱嚎' }, + { field: 'hv', label: '姘村钩-鍨傜洿绾�' }, + { field: 'vh', label: '鍨傜洿-姘村钩绾�' }, + { field: 'hvh', label: '姘村钩-鍨傜洿-姘村钩绾�' }, + { field: 'vhv', label: '鍨傜洿-姘村钩-鍨傜洿绾�' } ] } 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锛堣閿ワ級' } + { field: 'rect', label: '鐭╁舰' }, + { field: 'hollow-rect', label: '绌哄績鐭╁舰' }, + // { field: 'hollow', label: 'hollow锛堢┖蹇冪煩褰級' }, + // { field: 'line', label: 'line锛堢嚎鏉★級' }, + // { field: 'tick', label: 'tick锛堟尝鍔級' }, + // { field: 'funnel', label: 'funnel锛堟紡鏂楀浘锛�' }, + { field: 'pyramid', label: '閲戝瓧濉�' }, + { field: 'barChart', label: '鏉″舰鍥�' }, + { field: 'roseChart', label: '鐜懓鍥�' }, ] + + if (card.transpose === 'true') { + shape = 'barChart' + } else if (card.coordinate === 'polar') { + shape = 'roseChart' + } + } + + if (!shape) { + shape = shapes[0].field } let xfields = columns.filter(item => /^Nvarchar/ig.test(item.datatype)) @@ -272,23 +272,57 @@ }]) } + let axis = [] + if (card.grid !== 'hidden') { + axis.push('grid') + } + if (card.x_line !== 'hidden') { + axis.push('x_line') + } + if (card.y_line !== 'hidden') { + axis.push('y_line') + } + if (card.tick !== 'hidden') { + axis.push('tick') + } + + let tickVals = [] + if (card.x_label !== 'hidden') { + tickVals.push('x_label') + } + if (card.y_label !== 'hidden') { + tickVals.push('y_label') + } + + let datatype = card.datatype || 'query' + if (card.enabled === 'true') { + datatype = 'custom' + } + return [ { type: 'radio', field: 'datatype', - label: '鏁版嵁绫诲瀷', - initval: card.datatype || 'query', + label: '鍥惧舰绫诲瀷', + initval: datatype, tooltip: '缁熻鍥捐〃閫傜敤浜庡睍绀烘暟鎹被鍨嬩负鍔ㄦ�佸�笺��', required: false, $trans: true, options: [ - { value: 'query', label: '鏌ヨ' }, + { value: 'query', label: card.chartType !== 'line' ? '鏌辩姸鍥�' : '鎶樼嚎鍥�' }, + { value: 'custom', label: '鑷畾涔夊浘褰�' }, { value: 'statistics', label: '缁熻' } ], controlFields: [ {field: 'InfoType', values: ['statistics']}, {field: 'InfoValue', values: ['statistics']}, - {field: 'Yaxis', values: ['query']}, + {field: 'Yaxis', values: ['query', 'custom']}, + {field: 'adjust', values: ['query', 'statistics']}, + {field: 'area', values: ['query', 'statistics']}, + {field: 'show', values: ['query', 'statistics']}, + {field: 'selectColor', values: ['query']}, + {field: 'barSize', values: card.chartType !== 'line' ? ['query', 'custom', 'statistics'] : ['custom']}, + {field: 'mutilBar', values: ['custom']}, ] }, { type: 'select', @@ -313,6 +347,20 @@ options: yfields }, { type: 'select', + field: 'shape', + label: '褰㈢姸', + initval: shape, + required: false, + options: shapes + }, { + type: 'multiselect', + field: 'Yaxis', + label: 'Y-杞�', + initval: card.Yaxis || [], + required: true, + options: yfields + }, { + type: 'select', field: 'legend', label: '鍥句緥浣嶇疆', initval: card.legend || 'bottom', @@ -333,20 +381,6 @@ { field: 'hidden', label: '闅愯棌' } ] }, { - type: 'multiselect', - field: 'Yaxis', - label: 'Y-杞�', - initval: card.Yaxis || [], - required: true, - options: yfields - }, { - type: 'select', - field: 'shape', - label: '褰㈢姸', - initval: card.shape || (shapes[0] && shapes[0].field), - required: false, - options: shapes - }, { type: 'radio', field: 'tooltip', label: '鎮诞鎻愮ず', @@ -361,38 +395,9 @@ }] }, { type: 'radio', - field: 'point', - label: '鐐瑰浘', - initval: card.point || 'false', - required: false, - forbid: !['line'].includes(card.chartType), - options: [{ - value: 'true', - label: '鏄剧ず' - }, { - value: 'false', - label: '闅愯棌' - }] - }, { - type: 'radio', - field: 'transpose', - label: '鍙樻崲', - initval: card.transpose || 'false', - tooltip: '妯旱鍧愭爣杞翠氦鎹�', - required: false, - options: [{ - value: 'true', - label: '鏄�' - }, { - value: 'false', - label: '鍚�' - }] - }, { - type: 'radio', field: 'show', label: '鏄剧ず', initval: card.show || 'value', - tooltip: '褰撲娇鐢ㄨ嚜瀹氫箟璁剧疆鏃讹紝鍙湪鏄剧ず锛堝��/%锛夊鍗曠嫭璁剧疆鏄剧ず绫诲瀷銆傛敞锛氳嚜瀹氫箟涓虹┖鏃朵娇鐢ㄦ澶勮缃��', required: false, options: [{ value: 'value', @@ -413,36 +418,8 @@ required: false, options: labelOptions, controlFields: [ - {field: 'labelColor', values: ['true']} + {field: 'labelUnit', values: ['true', 'top', 'middle', 'bottom']} ] - }, { - type: 'radio', - field: 'labelColor', - label: '鏍囨敞棰滆壊', - initval: card.labelColor || 'system', - tooltip: '浣跨敤绯荤粺鑹叉椂锛屼娇鐢ㄨ壊绯婚�夐」璁剧疆鐨勭郴缁熼鑹诧紝浣跨敤鑷畾涔変负棰滆壊璁剧疆涓畾涔夌殑鍥惧舰棰滆壊銆�', - required: false, - options: [{ - value: 'system', - label: '绯荤粺' - }, { - value: 'custom', - label: '鑷畾涔�' - }] - // }, { - // type: 'radio', - // field: 'labelValue', - // label: '鏍囨敞鍊�', - // initval: card.labelValue || 'default', - // tooltip: '鏍囨敞鍊肩殑鏄剧ず瑙勫垯銆�', - // required: false, - // options: [{ - // value: 'default', - // label: '榛樿' - // }, { - // value: 'zero', - // label: '闅愯棌 0 鍊�' - // }], }, { type: 'radio', field: 'adjust', @@ -459,11 +436,38 @@ }] }, { type: 'radio', + field: 'mutilBar', + label: '澶氭煴鎺掑垪', + initval: card.mutilBar || 'dodge', + required: false, + options: [{ + value: 'dodge', + label: '鍒嗙粍' + }, { + value: 'stack', + label: '鍫嗗彔' + }] + }, { + type: 'radio', + field: 'point', + label: '鐐瑰浘', + initval: card.point || 'false', + required: false, + forbid: card.chartType === 'bar', + options: [{ + value: 'true', + label: '鏄剧ず' + }, { + value: 'false', + label: '闅愯棌' + }] + }, { + type: 'radio', field: 'area', label: '闈㈢Н鍥�', initval: card.area || 'false', required: false, - forbid: ['bar'].includes(card.chartType), + forbid: card.chartType === 'bar', options: [{ value: 'true', label: '鏄剧ず' @@ -472,75 +476,43 @@ label: '涓嶆樉绀�' }] }, { - type: 'radio', - field: 'repeat', - label: '閲嶅鏁版嵁', - initval: card.repeat || 'unrepeat', + type: 'checkbox', + field: 'axis', + label: '鍧愭爣杞�', + initval: axis, required: false, options: [{ - value: 'unrepeat', - label: '鍘婚噸' + value: 'grid', + label: '缃戞牸绾�' }, { - value: 'average', - label: '骞冲潎' + value: 'x_line', + label: 'X杞�' }, { - value: 'cumsum', - label: '绱姞' - }] + value: 'y_line', + label: 'Y杞�' + }, { + value: 'tick', + label: '鍒诲害绾�' + }], + controlFields: [ + {field: 'lineColor', notNull: true}, + ] }, { - type: 'radio', - field: 'coordinate', - label: '鍧愭爣', - initval: card.coordinate || 'angle', + type: 'checkbox', + field: 'tickVals', + label: '鍒诲害鍊�', + initval: tickVals, required: false, options: [{ - value: 'angle', - label: '浜岀淮鍧愭爣' + value: 'x_label', + label: 'X杞�' }, { - value: 'polar', - label: '鏋佸潗鏍�' - }] - }, { - type: 'radio', - field: 'grid', - label: '缃戞牸绾�', - initval: card.grid || 'show', - required: false, - options: [{ - value: 'show', - label: '鏄剧ず' - }, { - value: 'hidden', - label: '闅愯棌' - }] - }, { - type: 'radio', - field: 'y_line', - label: 'y杞磋竟绾�', - initval: card.y_line || 'hidden', - tooltip: '鍥惧舰宸︿晶鎴栧彸渚х殑杈圭嚎銆�', - required: false, - options: [{ - value: 'show', - label: '鏄剧ず' - }, { - value: 'hidden', - label: '闅愯棌' - }] - }, { - type: 'radio', - field: 'download', - label: '瀵煎嚭鍥剧墖', - initval: card.download || 'forbid', - required: false, - forbid: appType === 'mob', - options: [{ - value: 'forbid', - label: '绂佺敤' - }, { - value: 'enable', - label: '鍚敤' - }] + value: 'y_label', + label: 'Y杞�' + }], + controlFields: [ + {field: 'color', notNull: true}, + ] }, { type: 'radio', field: 'empty', @@ -561,7 +533,6 @@ max: 200, precision: 0, initval: card.barSize, - forbid: !['bar'].includes(card.chartType), required: false }, { type: 'number', @@ -572,7 +543,7 @@ max: 200, precision: 0, initval: card.barRadius || 0, - forbid: !['bar'].includes(card.chartType), + forbid: card.chartType === 'line', required: false }, { type: 'number', @@ -598,18 +569,25 @@ forbid: appType === 'mob', required: false }, { - type: 'color', - field: 'color', - label: '鑹茬郴', - initval: card.color || 'rgba(0, 0, 0, 0.65)', - tooltip: '鍧愭爣杞存彁绀烘枃瀛楀強绀轰緥鐨勯鑹层��', + type: 'text', + field: 'labelUnit', + label: '鏍囨敞鍗曚綅', + initval: card.labelUnit ||'', + forbid: appType === 'mob', required: false }, { type: 'color', field: 'lineColor', - label: '杞寸嚎棰滆壊', - initval: card.lineColor, - tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞村強缃戞牸绾裤��', + label: '鍧愭爣杞撮鑹�', + initval: card.lineColor || '', + tooltip: '鍧愭爣杞寸嚎鐨勯鑹诧紝鍖呮嫭x杞淬�亂杞淬�佺綉鏍肩嚎銆佸埢搴︾嚎銆�', + allowClear: true, + required: false + }, { + type: 'color', + field: 'color', + label: '鍒诲害鍊奸鑹�', + initval: card.color || '', allowClear: true, required: false }, { @@ -623,37 +601,37 @@ initval: card.rotate, forbid: appType !== 'mob', required: false - }, { - type: 'multiselect', - field: 'interaction', - label: '浜や簰鏁堟灉', - initval: card.interaction || [], - required: false, - forbid: appType === 'mob', - options: [ - { value: 'element-active', label: '鍏冪礌鑱氱劍' }, - { value: 'element-selected', label: '鍏冪礌閫変腑锛堝閫夛級' }, - { value: 'element-single-selected', label: '鍏冪礌閫変腑锛堝崟閫夛級' }, - { value: 'active-region', label: '鑳屾櫙妗�' }, - { value: 'view-zoom', label: '瑙嗗浘缂╂斁' }, - { value: 'element-highlight', label: '鍏冪礌楂樹寒' }, - { value: 'element-highlight-by-color', label: '鍚岃壊鍏冪礌楂樹寒' }, - { value: 'element-highlight-by-x', label: '鍚孹杞村厓绱犻珮浜�' }, - { value: 'legend-filter', label: '鍥句緥杩囨护' }, - { value: 'legend-active', label: '鍥句緥鑱氱劍' }, - { value: 'legend-highlight', label: '鍥句緥楂樹寒' }, - { value: 'brush', label: '閫夋杩囨护' }, - ], - controlFields: [ - {field: 'selectColor', values: ['element-selected', 'element-single-selected']}, - ] + // }, { + // type: 'multiselect', + // field: 'interaction', + // label: '浜や簰鏁堟灉', + // initval: card.interaction || [], + // required: false, + // forbid: appType === 'mob', + // options: [ + // { value: 'element-active', label: '鍏冪礌鑱氱劍' }, + // { value: 'element-selected', label: '鍏冪礌閫変腑锛堝閫夛級' }, + // { value: 'element-single-selected', label: '鍏冪礌閫変腑锛堝崟閫夛級' }, + // { value: 'active-region', label: '鑳屾櫙妗�' }, + // { value: 'view-zoom', label: '瑙嗗浘缂╂斁' }, + // { value: 'element-highlight', label: '鍏冪礌楂樹寒' }, + // { value: 'element-highlight-by-color', label: '鍚岃壊鍏冪礌楂樹寒' }, + // { value: 'element-highlight-by-x', label: '鍚孹杞村厓绱犻珮浜�' }, + // { value: 'legend-filter', label: '鍥句緥杩囨护' }, + // { value: 'legend-active', label: '鍥句緥鑱氱劍' }, + // { value: 'legend-highlight', label: '鍥句緥楂樹寒' }, + // { value: 'brush', label: '閫夋杩囨护' }, + // ], + // controlFields: [ + // {field: 'selectColor', values: ['element-selected', 'element-single-selected']}, + // ] }, { type: 'color', field: 'selectColor', label: '閫変腑棰滆壊', initval: card.selectColor || '', - tooltip: '閫変腑鏌卞舰鍥剧殑棰滆壊锛屽惎鐢ㄨ嚜瀹氫箟璁剧疆鏃舵棤鏁堛��', - forbid: !['bar'].includes(card.chartType), + tooltip: '閫変腑鏌卞舰鍥剧殑棰滆壊銆�', + forbid: card.chartType === 'line', allowClear: true, required: false } -- Gitblit v1.8.0