diff --git a/backend/pom.xml b/backend/pom.xml index 0ffce51cf3..3783dad76e 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -216,6 +216,11 @@ dataease-plugin-interface 1.7 + + io.dataease + dataease-plugin-view + 1.7 + cn.hutool hutool-all diff --git a/backend/src/main/java/io/dataease/plugins/server/view/PluginViewServer.java b/backend/src/main/java/io/dataease/plugins/server/view/PluginViewServer.java new file mode 100644 index 0000000000..d57b1088ab --- /dev/null +++ b/backend/src/main/java/io/dataease/plugins/server/view/PluginViewServer.java @@ -0,0 +1,33 @@ +package io.dataease.plugins.server.view; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import io.dataease.plugins.config.SpringContextUtil; +import io.dataease.plugins.view.entity.PluginViewType; +import io.dataease.plugins.view.service.ViewPluginService; + +@RequestMapping("/plugin/view") +@RestController +public class PluginViewServer { + + @PostMapping("/types") + public List types() { + List result = new ArrayList<>(); + Map beanMap = SpringContextUtil.getApplicationContext() + .getBeansOfType(ViewPluginService.class); + if (beanMap.keySet().size() == 0) { + return result; + } + for (Entry entry : beanMap.entrySet()) { + result.add(entry.getValue().viewType()); + } + return result; + } +} diff --git a/frontend/src/api/chart/chart.js b/frontend/src/api/chart/chart.js index 87abbcd662..d143acf1da 100644 --- a/frontend/src/api/chart/chart.js +++ b/frontend/src/api/chart/chart.js @@ -69,3 +69,10 @@ export function ajaxGetDataOnly(id, data) { data }) } + +export function pluginTypes() { + return request({ + url: '/plugin/view/types', + method: 'post' + }) +} diff --git a/frontend/src/icons/svg/buddle-map.svg b/frontend/src/icons/svg/buddle-map.svg new file mode 100644 index 0000000000..a56a4cf8c7 --- /dev/null +++ b/frontend/src/icons/svg/buddle-map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/main.js b/frontend/src/main.js index 9f8248118f..f4272a1bfb 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -24,9 +24,11 @@ import DeComplexSelect from '@/components/business/condition-table/DeComplexSele import '@/components/canvas/custom-component' // 注册自定义组件 import '@/utils/DateUtil' +import draggable from 'vuedraggable' Vue.config.productionTip = false Vue.use(VueClipboard) Vue.use(widgets) +Vue.component('draggable', draggable) Vue.prototype.$api = api import * as echarts from 'echarts' diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index 1bec7413d9..4991c2a24b 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -26,3 +26,284 @@ export function digToHex(dig) { } return prefix.concat(num.toString(16).toUpperCase()) } + +export const TYPE_CONFIGS = [ + { + render: 'antv', + category: 'chart.chart_type_table', + value: 'table-normal', + title: 'chart.chart_table_normal', + icon: 'table-normal' + }, + { + render: 'antv', + category: 'chart.chart_type_table', + value: 'table-info', + title: 'chart.chart_table_info', + icon: 'table-info' + }, + { + render: 'antv', + category: 'chart.chart_type_table', + value: 'table-pivot', + title: 'chart.chart_table_pivot', + icon: 'table-pivot' + }, + + { + render: 'antv', + category: 'chart.chart_type_quota', + value: 'text', + title: 'chart.chart_card', + icon: 'text' + }, + { + render: 'antv', + category: 'chart.chart_type_quota', + value: 'gauge', + title: 'chart.chart_gauge', + icon: 'gauge' + }, + { + render: 'antv', + category: 'chart.chart_type_quota', + value: 'liquid', + title: 'chart.chart_liquid', + icon: 'liquid' + }, + + { + render: 'antv', + category: 'chart.chart_type_trend', + value: 'line', + title: 'chart.chart_line', + icon: 'line' + }, + { + render: 'antv', + category: 'chart.chart_type_trend', + value: 'line-stack', + title: 'chart.chart_line_stack', + icon: 'line-stack' + }, + + { + render: 'antv', + category: 'chart.chart_type_compare', + value: 'bar', + title: 'chart.chart_bar', + icon: 'bar' + }, + { + render: 'antv', + category: 'chart.chart_type_compare', + value: 'bar-stack', + title: 'chart.chart_bar_stack', + icon: 'bar-stack' + }, + { + render: 'antv', + category: 'chart.chart_type_compare', + value: 'waterfall', + title: 'chart.chart_waterfall', + icon: 'waterfall' + }, + { + render: 'antv', + category: 'chart.chart_type_compare', + value: 'bar-horizontal', + title: 'chart.chart_bar_horizontal', + icon: 'bar-horizontal' + }, + { + render: 'antv', + category: 'chart.chart_type_compare', + value: 'bar-stack-horizontal', + title: 'chart.chart_bar_stack_horizontal', + icon: 'bar-stack-horizontal' + }, + + { + render: 'antv', + category: 'chart.chart_type_distribute', + value: 'pie', + title: 'chart.chart_pie', + icon: 'pie' + }, + { + render: 'antv', + category: 'chart.chart_type_distribute', + value: 'pie-rose', + title: 'chart.chart_pie_rose', + icon: 'pie-rose' + }, + { + render: 'antv', + category: 'chart.chart_type_distribute', + value: 'radar', + title: 'chart.chart_radar', + icon: 'radar' + }, + { + render: 'antv', + category: 'chart.chart_type_distribute', + value: 'treemap', + title: 'chart.chart_treemap', + icon: 'treemap' + }, + { + render: 'antv', + category: 'chart.chart_type_distribute', + value: 'word-cloud', + title: 'chart.chart_word_cloud', + icon: 'word-cloud' + }, + + { + render: 'antv', + category: 'chart.chart_type_relation', + value: 'scatter', + title: 'chart.chart_scatter', + icon: 'scatter' + }, + { + render: 'antv', + category: 'chart.chart_type_relation', + value: 'funnel', + title: 'chart.chart_funnel', + icon: 'funnel' + }, + /* 下面是echarts图表类型 */ + { + render: 'echarts', + category: 'chart.chart_type_table', + value: 'table-normal', + title: 'chart.chart_table_normal', + icon: 'table-normal' + }, + { + render: 'echarts', + category: 'chart.chart_type_table', + value: 'table-info', + title: 'chart.chart_table_info', + icon: 'table-info' + }, + + { + render: 'echarts', + category: 'chart.chart_type_quota', + value: 'text', + title: 'chart.chart_card', + icon: 'text' + }, + { + render: 'echarts', + category: 'chart.chart_type_quota', + value: 'gauge', + title: 'chart.chart_gauge', + icon: 'gauge' + }, + + { + render: 'echarts', + category: 'chart.chart_type_trend', + value: 'line', + title: 'chart.chart_line', + icon: 'line' + }, + { + render: 'echarts', + category: 'chart.chart_type_trend', + value: 'line-stack', + title: 'chart.chart_line_stack', + icon: 'line-stack' + }, + { + render: 'echarts', + category: 'chart.chart_type_trend', + value: 'chart-mix', + title: 'chart.chart_mix', + icon: 'chart-mix' + }, + + { + render: 'echarts', + category: 'chart.chart_type_compare', + value: 'bar', + title: 'chart.chart_bar', + icon: 'bar' + }, + { + render: 'echarts', + category: 'chart.chart_type_compare', + value: 'bar-stack', + title: 'chart.chart_bar_stack', + icon: 'bar-stack' + }, + { + render: 'echarts', + category: 'chart.chart_type_compare', + value: 'bar-horizontal', + title: 'chart.chart_bar_horizontal', + icon: 'bar-horizontal' + }, + { + render: 'echarts', + category: 'chart.chart_type_compare', + value: 'bar-stack-horizontal', + title: 'chart.chart_bar_stack_horizontal', + icon: 'bar-stack-horizontal' + }, + + { + render: 'echarts', + category: 'chart.chart_type_distribute', + value: 'pie', + title: 'chart.chart_pie', + icon: 'pie' + }, + { + render: 'echarts', + category: 'chart.chart_type_distribute', + value: 'pie-rose', + title: 'chart.chart_pie_rose', + icon: 'pie-rose' + }, + { + render: 'echarts', + category: 'chart.chart_type_distribute', + value: 'radar', + title: 'chart.chart_radar', + icon: 'radar' + }, + { + render: 'echarts', + category: 'chart.chart_type_distribute', + value: 'treemap', + title: 'chart.chart_treemap', + icon: 'treemap' + }, + + { + render: 'echarts', + category: 'chart.chart_type_relation', + value: 'scatter', + title: 'chart.chart_scatter', + icon: 'scatter' + }, + { + render: 'echarts', + category: 'chart.chart_type_relation', + value: 'funnel', + title: 'chart.chart_funnel', + icon: 'funnel' + }, + + { + render: 'echarts', + category: 'chart.chart_type_space', + value: 'map', + title: 'chart.chart_map', + icon: 'map' + } +] diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index a868617587..ee36986e32 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -219,348 +219,352 @@ - - - {{ $t('chart.map_range') }} - - - - - - - - - {{ $t('chart.table_pivot_row') }} - / - {{ $t('chart.dimension') }} - - - - +
+ + + {{ $t('chart.map_range') }} + + + - - -
- {{ $t('chart.placeholder_field') }} -
-
- - - - {{ $t('chart.drag_block_table_data_column') }} - {{ $t('chart.drag_block_type_axis') }} - {{ $t('chart.drag_block_pie_label') }} - {{ $t('chart.drag_block_funnel_split') }} - {{ $t('chart.drag_block_radar_label') }} - {{ $t('chart.area') }} - {{ $t('chart.drag_block_treemap_label') }} - {{ $t('chart.drag_block_word_cloud_label') }} - / - {{ $t('chart.dimension') }} - {{ $t('chart.dimension_or_quota') }} - - + + + - - - - -
- {{ $t('chart.placeholder_field') }} -
-
- - - - {{ $t('chart.drag_block_table_data_column') }} - {{ $t('chart.drag_block_value_axis') }} - {{ $t('chart.drag_block_pie_angel') }} - {{ $t('chart.drag_block_funnel_width') }} - {{ $t('chart.drag_block_radar_length') }} - {{ $t('chart.drag_block_gauge_angel') }} - {{ $t('chart.drag_block_label_value') }} - {{ $t('chart.chart_data') }} - {{ $t('chart.drag_block_treemap_size') }} - {{ $t('chart.drag_block_value_axis_main') }} - {{ $t('chart.drag_block_progress') }} - {{ $t('chart.drag_block_word_cloud_size') }} - / - {{ $t('chart.quota') }} - - + {{ $t('chart.table_pivot_row') }} + / + {{ $t('chart.dimension') }} + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ + - - - - -
- {{ $t('chart.placeholder_field') }} -
-
- - - - {{ $t('chart.drag_block_value_axis_ext') }} - / - {{ $t('chart.quota') }} - - + {{ $t('chart.drag_block_table_data_column') }} + {{ $t('chart.drag_block_type_axis') }} + {{ $t('chart.drag_block_pie_label') }} + {{ $t('chart.drag_block_funnel_split') }} + {{ $t('chart.drag_block_radar_label') }} + {{ $t('chart.area') }} + {{ $t('chart.drag_block_treemap_label') }} + {{ $t('chart.drag_block_word_cloud_label') }} + / + {{ $t('chart.dimension') }} + {{ $t('chart.dimension_or_quota') }} + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ + + + {{ $t('chart.drag_block_table_data_column') }} + {{ $t('chart.drag_block_value_axis') }} + {{ $t('chart.drag_block_pie_angel') }} + {{ $t('chart.drag_block_funnel_width') }} + {{ $t('chart.drag_block_radar_length') }} + {{ $t('chart.drag_block_gauge_angel') }} + {{ $t('chart.drag_block_label_value') }} + {{ $t('chart.chart_data') }} + {{ $t('chart.drag_block_treemap_size') }} + {{ $t('chart.drag_block_value_axis_main') }} + {{ $t('chart.drag_block_progress') }} + {{ $t('chart.drag_block_word_cloud_size') }} + / + {{ $t('chart.quota') }} + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ + + + {{ $t('chart.drag_block_value_axis_ext') }} + / + {{ $t('chart.quota') }} + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ + + + {{ $t('chart.stack_item') }} + / + {{ $t('chart.dimension') }} + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ + + + {{ $t('chart.bubble_size') }} + / + {{ $t('chart.quota') }} + +
+ 该指标生效时,样式大小中的气泡大小属性将失效 +
+ +
+
+ + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ + {{ $t('chart.result_filter') }} + + + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+
+ - - - - -
- {{ $t('chart.placeholder_field') }} -
-
- - - - {{ $t('chart.stack_item') }} - / - {{ $t('chart.dimension') }} - - - - - - -
- {{ $t('chart.placeholder_field') }} -
-
- - - - {{ $t('chart.bubble_size') }} - / - {{ $t('chart.quota') }} - -
- 该指标生效时,样式大小中的气泡大小属性将失效 -
- -
-
- - - - - -
- {{ $t('chart.placeholder_field') }} -
-
- - {{ $t('chart.result_filter') }} - - - - - - - - -
- {{ $t('chart.placeholder_field') }} -
-
- - - {{ $t('chart.drill') }} - / - {{ $t('chart.dimension') }} - - - - - - -
- {{ $t('chart.placeholder_field') }} -
-
+ + {{ $t('chart.drill') }} + / + {{ $t('chart.dimension') }} + + + + + + +
+ {{ $t('chart.placeholder_field') }} +
+ +
+
@@ -796,8 +800,14 @@
+ @@ -966,7 +976,6 @@ diff --git a/frontend/src/views/system/plugin/PluginCom.vue b/frontend/src/views/system/plugin/PluginCom.vue index 7a7767b33b..fc555d3ccc 100644 --- a/frontend/src/views/system/plugin/PluginCom.vue +++ b/frontend/src/views/system/plugin/PluginCom.vue @@ -1,7 +1,13 @@