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='仪表板分享'; diff --git a/frontend/src/components/vue-drag-resize-rotate/index.vue b/frontend/src/components/vue-drag-resize-rotate/index.vue index c019654d98..16686fc84e 100644 --- a/frontend/src/components/vue-drag-resize-rotate/index.vue +++ b/frontend/src/components/vue-drag-resize-rotate/index.vue @@ -69,6 +69,10 @@ export default { replace: true, name: 'VueDragResizeRotate', props: { + viewId: { + type: String, + default: '' + }, className: { type: String, default: 'vdr' @@ -596,6 +600,11 @@ export default { }, methods: { + removeView(){ + debugger + console.log(this.viewId); + this.$emit('removeView',this.viewId) + }, // 重置边界和鼠标状态 resetBoundsAndMouseState() { this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 } 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/store/modules/panel.js b/frontend/src/store/modules/panel.js index a3c5d064e7..d90be32b5a 100644 --- a/frontend/src/store/modules/panel.js +++ b/frontend/src/store/modules/panel.js @@ -1,7 +1,10 @@ const getDefaultState = () => { return { - panelName: '' + panelName: '', + panelInfo:{ + name:'' + } } } @@ -10,12 +13,20 @@ const state = getDefaultState() const mutations = { setPanelName: (state, panelName) => { state.panelName = panelName + }, + setPanelInfo: (state, panelInfo) => { + debugger + state.panelInfo = panelInfo } } const actions = { setPanelName({ commit }, panelName) { commit('setPanelName', panelName) + }, + setPanelInfo({ commit }, panelInfo) { + debugger + commit('setPanelInfo', panelInfo) } } 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 @@