From 5f823af95a37a8dc707df3ba0dcf88ea4f2ca6aa Mon Sep 17 00:00:00 2001 From: TaoJinlong Date: Wed, 17 Mar 2021 13:17:47 +0800 Subject: [PATCH 1/3] fix: sql --- backend/src/main/resources/db/migration/V12__panel_table.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/main/resources/db/migration/V12__panel_table.sql b/backend/src/main/resources/db/migration/V12__panel_table.sql index 323be7b353..0a4fea5f3c 100644 --- a/backend/src/main/resources/db/migration/V12__panel_table.sql +++ b/backend/src/main/resources/db/migration/V12__panel_table.sql @@ -90,8 +90,7 @@ CREATE TABLE `panel_share` ( `create_time` bigint(13) DEFAULT NULL COMMENT '创建日期', PRIMARY KEY (`share_id`) USING BTREE, UNIQUE KEY `UK_share_user_id` (`user_id`) USING BTREE, - UNIQUE KEY `UK_share_panel_group_id` (`panel_group_id`) USING BTREE, - + UNIQUE KEY `UK_share_panel_group_id` (`panel_group_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='仪表板分享'; From 63fe122209af48dd56a09d256982f77a4f0eec55 Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 17 Mar 2021 16:12:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor(=E8=A7=86=E5=9B=BE):=20=E5=9B=BE?= =?UTF-8?q?=E5=BD=A2=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=A2=9E=E5=8A=A0=20?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E6=96=B9=E6=A1=88=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/zh.js | 14 +- frontend/src/views/chart/chart/chart.js | 6 +- .../views/chart/components/ChartComponent.vue | 7 + .../views/chart/components/ColorSelector.vue | 130 ++++++++++++++++++ frontend/src/views/chart/group/Group.vue | 5 + frontend/src/views/chart/view/ChartEdit.vue | 36 +++-- 6 files changed, 181 insertions(+), 17 deletions(-) create mode 100644 frontend/src/views/chart/components/ColorSelector.vue diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 7d864f6b1d..46ef617959 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -602,7 +602,19 @@ export default { std: '标准差', var_samp: '方差', quick_calc: '快速计算', - show_name_set: '显示名设置' + show_name_set: '显示名设置', + color: '颜色', + color_case: '配色方案', + pls_slc_color_case: '请选择配色方案', + color_default: '默认', + color_retro: '复古', + color_future: '未来', + color_gradual: '渐变', + color_business: '商务', + color_gentle: '柔和', + color_elegant: '淡雅', + color_technology: '科技', + color_simple: '简洁' }, dataset: { datalist: '数据集', diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index 7392c1b3d2..ee38bc088f 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -1,3 +1,7 @@ +export const DEFAULT_COLOR_CASE = { + value: 'default', + colors: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'] +} export const BASE_BAR = { title: { text: '' @@ -33,5 +37,5 @@ export const BASE_LINE = { } export default { - BASE_BAR, BASE_LINE + BASE_BAR, BASE_LINE, DEFAULT_COLOR_CASE } diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 20c906e16b..3cf27335bc 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -40,6 +40,7 @@ export default { chart_option = JSON.parse(JSON.stringify(BASE_LINE)) } // console.log(chart_option); + // 处理data if (chart.data) { chart_option.title.text = chart.title chart_option.xAxis.data = chart.data.x @@ -49,6 +50,12 @@ export default { }) } // console.log(chart_option); + // 处理shape attr + if (chart.customAttr) { + if (chart.customAttr.color) { + chart_option.color = chart.customAttr.color.colors + } + } this.myEcharts(chart_option) }, myEcharts(option) { diff --git a/frontend/src/views/chart/components/ColorSelector.vue b/frontend/src/views/chart/components/ColorSelector.vue new file mode 100644 index 0000000000..383cd1ee4f --- /dev/null +++ b/frontend/src/views/chart/components/ColorSelector.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 35a2a951e1..a7ce7ad8cc 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -211,6 +211,7 @@